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

Closed
vesta wants to merge 12 commits from vesta/241-engine-approved-list into main
Member

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

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

martha#241: an engine member runs by the owner's approval, and by the owner's own allow rules 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
An engine member was handed an empty approved list
(`start_an_engine_member.ts:383`, `decide(gate, [])`), so under "B: gate,
then ask" every call the gate allowed went to the owner — a crew left
unattended stopped at its first call. A Claude Code member is not in that
position: its host reads the checkout's own settings itself.

This carries the owner's `permissions.allow` to the engine, read as the host
reads it: `Bash(cmd)` exactly, `Bash(cmd:*)` as that command and every line
beginning with it, a compound line only when every part is named, and
anything not plainly readable — `$(…)`, backticks, process substitution, any
redirection, a backgrounded command — asked of the owner. A bare tool rule
carries whole (`Bash`, `mcp__<server>__<tool>` as the engine's own name). A
rule this cannot read is left asked and named with why, never guessed at.

The order is unchanged and now takes the rules rather than a list: the gate
first, a deny refused whatever the rules name, then the rules, then the
owner. No `allow_always` is ever sent, so nothing is saved in the engine's
own store.

Proved by the three mutants the Supervisor named, each killed by a case: a
non-matching part passing, `$(…)` matching as a word, and a deny losing to a
rule.

The :383 line is wired to approve nothing until #240 (PR 242) lands, so this
tree behaves exactly as before; the rules are connected to it when main is
merged after that.
The rules come from the file the owner already approved, .claude/settings.json,
and nowhere else: not settings.local.json, which is the host's record of dialog
answers an engine has no dialog to give, and not the owner's user settings. A
checkout with no settings file approves nothing; one that is not JSON is refused
by name rather than read as no rules.
The host's shell tool already has one name in the tree, so this imports it
rather than spelling it again, and the MCP prefix stays this slice's own local
constant so it collides with no other file's word.
Neptunus's r=1 note, on this tip: architecture/c4_diagrams.node-test.ts was red with "in no box and not
declared left out: carry_the_owners_allow_rules_to_an_engine". The slice is now named in the engine box's
names and described in its picture, and the Components table's row for that box says what it does. The
page's two checks pass, 28/28, in the local run slot (vesta-241/architecture-run-1.log).
R1: .claude/settings.json is listed among the engine host's launch files and carried by
the gate only under a tree the approval pins; the rules are read from those carried bytes,
never the disk. martha approve records the engine host's fingerprint with the same yes.
R2: ( ) { } make a line unreadable. R3: deny and ask rules hold a call, read wider than an
allow. R4: the four surviving mutants pinned. R5/R6: a start on unreadable rules is refused
and told; each rule left asked is told to the owner. The slice no longer imports the
Claude Code host adapter: the start hands the owner's shell tool name in.
Member

Replaced by PR 271 (neptunus/241-r2, ecb4de35): the same tree, squashed so the history carries no home paths.

Replaced by PR 271 (neptunus/241-r2, ecb4de35): the same tree, squashed so the history carries no home paths.
neptunus closed this pull request 2026-11-26 23:47:49 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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!269
No description provided.