Skip to content

docs: ADR 0001, a stored marker setting answers for agents - #20

Merged
Skeyelab merged 1 commit into
mainfrom
docs/adr-marker
Nov 13, 2026
Merged

Skeyelab merged 1 commit into
mainfrom
docs/adr-marker

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Summary

+docs/adr/0001-stored-marker-answers-for-agents.md

Records why #14 was closed: contacts.toml always/never settings apply to agents too, so future architecture reviews don't re-suggest requiring --no-robot.

Evidence

Docs only; 127 tests unchanged.

Merge Danger

Door: two-way

Blast Radius: none

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCgWWsJbTMzsnA2WJkmsjC

@claude

claude Bot commented Nov 13, 2026

Copy link
Copy Markdown

Review summary. I could not run the test suite (pytest isn't installed in this environment), so this is from reading the code.

Invariants

  • Privacy: every phone number and email in tracked files, tests included, is a placeholder (+15555550123, +1555555xxxx, @example.com). One nit: a real-looking name, "Eric" (inline).
  • Scoping: every query binds a chat identifier. --chat and --contact are mutually exclusive, and resolve() raises ScopeError with neither. updated() only reads file mtimes. --find-groups is the one cross-thread path: it takes a participant and returns group ids and names, not message content. That seems acceptable and is documented, but it is the widest surface.
  • chat.db read-only: mode=ro URI, never written. OK.
  • --robot: a non-interactive caller with no flag is refused unless the contact has a stored marker. That is a deliberate weakening, accepted in ADR 0001, so I'm not re-proposing it. Be aware that --contacts-file and $IMSG_AGENT_CONTACTS let a caller point at a file it wrote itself. ADR 0001 already lists that as outside what the tool can enforce.
  • Bug (inline): an empty message with --robot sends a lone 🤖, because the empty-body check runs after marking.

Decoder: the NSString → + → length logic is correct, bounds-checked, and 0x81/0x82 lengths are handled. A truncated blob returns None. No issues.

Contacts lookup order: env, then XDG config, then the module directory. A set env var is authoritative, and a missing file is an error. This matches the README table and SKILL.md. One caveat: write_contact and --config can end up writing to the module-directory copy if that is the only file that exists. That is fine for a clone, but it would write into site-packages for a non-editable install.

README install: the steps are consistent with pyproject.toml (imsg-agent = imsgread:main, py-modules, Python >=3.11, setuptools>=77). The Usage block omits --config and --confirm-timeout, which a new user would want to know about.

Minor: unhandled --message-file OSError (inline).

@claude

claude Bot commented Nov 13, 2026

Copy link
Copy Markdown

Correction to my summary: the three inline comments I referred to failed to post (those lines aren't in the PR diff), so the details are here.

  1. imsgread.py:907-912, mark_agent_sent. With robot=True and an empty or whitespace body, text.rstrip() is "" and the function returns " 🤖". I confirmed this by running it. The if not body.strip() guard in send() then passes, so --send --message "" --robot sends a lone robot emoji. Check emptiness on the unmarked text before marking.
  2. imsgread.py:1287, _run_send. args.message_file.read_text can raise OSError or UnicodeDecodeError. Only ScopeError and ConfigError are caught, so a bad path gives a raw traceback. Nothing has been sent at that point, so catch both and exit 1 with an error: line.
  3. README.md:149 and .claude/skills/imsg-agent/SKILL.md:17. "text Eric" looks like a real person's name. Use the friend placeholder.

@Skeyelab
Skeyelab merged commit ea342f3 into main Nov 13, 2026
6 checks passed
@Skeyelab
Skeyelab deleted the docs/adr-marker branch November 13, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant