martha#241: an engine member runs by the owner's approval, and by the owner's own allow rules #271

Manually merged
terra merged 0 commits from neptunus/241-r2 into main 2026-11-27 00:40:12 +00:00
Member

Under "B: gate, then ask" (DECIDED 2026-11-18) a call is refused only when the owner's approval does not cover it; every other call is asked. This carries the last piece: the rules the owner already wrote for that checkout are carried to the engine member, so a call the approved list names runs unasked, and everything else is still asked.

What it reads, and what it never reads:

  • one file only, the checkout's .claude/settings.json, and only the bytes the owner approved — it is in the launch gate's own files, so a checkout that ships {"permissions":{"allow":["Bash"]}} is refused until the owner approves those bytes, and a rewrite under a running member changes nothing it runs unasked;
  • never settings.local.json and never the owner's user settings;
  • a rule the reader cannot place is left asked and named to the owner, never guessed at.

Semantics, matched to how Claude Code reads the same rule: exact and cmd:* prefix rules; a compound line passes only if every part does; $(…), backticks, process substitution and redirection into a file fall back to asking; the gate is read first and deny wins, so no allow can carry a call the gate denies. A deny or ask rule that names a call keeps it asked, and an unreadable deny/ask list refuses the launch rather than running with the owner's holds silently gone. Martha still never answers allow_always, and nothing is written into the engine's own permission store.

Duplicate keys. The file is read with JSON.parse, so a .claude/settings.json that names permissions — or allow, deny, ask — more than once is read as its last occurrence, exactly as the host's own JavaScript reader takes it. That is the reading the owner approved, since the fingerprint pins those bytes and no other; a file whose duplicate keys matter to the owner should be cleaned up, and a stricter canonical-bytes reading already exists in trust_only_signed_lists for the documents that carry signatures.

Residual, from the same probe. A rule naming mcp__developer__text_editor is carried to the engine's built-in editor: the two are read as the same tool, so the rule the owner wrote for one runs unasked in the other.

After this lands: one martha approve per checkout. .claude/settings.json joins the engine's files in the launch gate, so every checkout that holds one is a checkout whose approval no longer covers what the launch would carry. Run martha approve once in each such checkout after this lands; until it is run, an engine member started there is refused at the launch by name, rather than run with rules the owner has not approved.

Tests: the matcher's three named mutants (a non-matching part passes; $(…) passes; deny loses to allow) each fail by name, and the gate's own refusal, the wiring, and the architecture page are covered. Reviewed r1→r3 by Mars with the security split.

Refs #241, #255

Replaces PR 269: the same reviewed tree, squashed to one commit so the history carries no home paths.

Under "B: gate, then ask" (DECIDED 2026-11-18) a call is refused only when the owner's approval does not cover it; every other call is asked. This carries the last piece: the rules the owner already wrote for that checkout are carried to the engine member, so a call the approved list names runs unasked, and everything else is still asked. What it reads, and what it never reads: - one file only, the checkout's `.claude/settings.json`, and only the bytes the owner approved — it is in the launch gate's own files, so a checkout that ships `{"permissions":{"allow":["Bash"]}}` is refused until the owner approves those bytes, and a rewrite under a running member changes nothing it runs unasked; - never `settings.local.json` and never the owner's user settings; - a rule the reader cannot place is left asked and named to the owner, never guessed at. Semantics, matched to how Claude Code reads the same rule: exact and `cmd:*` prefix rules; a compound line passes only if every part does; `$(…)`, backticks, process substitution and redirection into a file fall back to asking; the gate is read first and **deny wins**, so no allow can carry a call the gate denies. A `deny` or `ask` rule that names a call keeps it asked, and an unreadable deny/ask list refuses the launch rather than running with the owner's holds silently gone. Martha still never answers `allow_always`, and nothing is written into the engine's own permission store. **Duplicate keys.** The file is read with `JSON.parse`, so a `.claude/settings.json` that names `permissions` — or `allow`, `deny`, `ask` — more than once is read as its **last** occurrence, exactly as the host's own JavaScript reader takes it. That is the reading the owner approved, since the fingerprint pins those bytes and no other; a file whose duplicate keys matter to the owner should be cleaned up, and a stricter canonical-bytes reading already exists in `trust_only_signed_lists` for the documents that carry signatures. **Residual, from the same probe.** A rule naming `mcp__developer__text_editor` is carried to the engine's built-in editor: the two are read as the same tool, so the rule the owner wrote for one runs unasked in the other. **After this lands: one `martha approve` per checkout.** `.claude/settings.json` joins the engine's files in the launch gate, so every checkout that holds one is a checkout whose approval no longer covers what the launch would carry. Run `martha approve` once in each such checkout after this lands; until it is run, an engine member started there is refused at the launch by name, rather than run with rules the owner has not approved. Tests: the matcher's three named mutants (a non-matching part passes; `$(…)` passes; deny loses to allow) each fail by name, and the gate's own refusal, the wiring, and the architecture page are covered. Reviewed r1→r3 by Mars with the security split. Refs #241, #255 Replaces PR 269: the same reviewed tree, squashed to one commit so the history carries no home paths.
The owner's allow rules for a checkout are carried to the engine member: a call the approved list names runs unasked, every other call is still asked. One squash of the reviewed branch (tree of 9b9cae1f) onto main b478e03f.
terra manually merged commit 5d3c4813e3 into main 2026-11-27 00:40:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha!271
No description provided.