martha#296: one owner answer keeps a tool or a shell prefix for the launch #343

Manually merged
terra merged 14 commits from neptunus/296-session-answer into main 2026-12-01 08:51:23 +00:00
Member

Purpose (gap): one owner answer covers a tool, or a shell prefix, for the rest of an engine member's launch, so a member that runs the same tool twenty times does not ask twenty times. Refs #296, #239, #241.

Scope is the Supervisor's ruling of 2026-12-01, option (b): per tool plus command pattern. Threat model and Done-when: #296 comment 6934.

What it does

  • martha answer <member> <key> allow-for-session [<prefix>] allows the ask and keeps a rule for the rest of that member's launch:
    • a tool other than the shell is kept whole;
    • a shell line with no prefix is kept part by part, exactly;
    • with a prefix, Bash(<prefix>:*) is kept, read by the settings reader (theRuleOf), and the line's other parts are kept exactly.
  • Each of these keeps nothing and answers nothing, leaving the ask open:
    • a prefix that names no part of the line;
    • a prefix on another tool;
    • a line that is not read plainly;
    • a keep on a reject.
  • The decide order is: gate, then the owner's rules plus the kept rules, then the owner. The owner's deny and ask rules hold kept rules back. /allow-always's exact keep is now held too (it was not).
  • The keep is written to the owner-act record and must match it. A keep with no martha answer record behind it answers the one ask, keeps nothing, and says so in the notes.
  • What is kept lives only in the launcher's memory. No file is written.

Found on the way (it blocked this package)

The engine launch read the owner-act record with typeof read === 'string', but readStateFile returns { text }. So since 85f3bd73 (#541 package A), every answer an engine member heard was kept with owner_act: false and noted as having no owner act behind it. It now reads read.text, and the launch test below pins it.

Tests and mutants

  • the_rules_kept_for_a_launch.node-test.ts: whole tool; exact line; prefix; the three refusals; deny and ask holding kept rules; theLaunchsMayRun holding kept rules and an /allow-always call.
  • hear_an_acp_agents_asks.node-test.ts: a keep with an owner act; without one; refused by the keeper; on a reject; with no keeper.
  • the_owners_answer_route.node-test.ts: the keep crossing the route; a malformed keep refused; the record pinning the prefix; the command words; the receipt.
  • start_an_engine_member.node-test.ts: a real launch. One allow-for-session ls runs the next ls -la unasked, and a deny of ls -R still asks.
  • Mutants, each killed: holds dropped from kept rules; the exact keep not held; kept rules not read by the launch; no keeper; the owner-act condition dropped; shell kept whole; keep on a reject; the record's keep ignored; the owner-act read put back as a string; the prefix check dropped.

No new check or job.

Purpose (gap): one owner answer covers a tool, or a shell prefix, for the rest of an engine member's launch, so a member that runs the same tool twenty times does not ask twenty times. Refs #296, #239, #241. Scope is the Supervisor's ruling of 2026-12-01, option (b): per tool plus command pattern. Threat model and Done-when: #296 comment 6934. ## What it does - `martha answer <member> <key> allow-for-session [<prefix>]` allows the ask and keeps a rule for the rest of that member's launch: - a tool other than the shell is kept whole; - a shell line with no prefix is kept part by part, exactly; - with a prefix, `Bash(<prefix>:*)` is kept, read by the settings reader (`theRuleOf`), and the line's other parts are kept exactly. - Each of these keeps nothing and answers nothing, leaving the ask open: - a prefix that names no part of the line; - a prefix on another tool; - a line that is not read plainly; - a keep on a reject. - The decide order is: gate, then the owner's rules plus the kept rules, then the owner. The owner's deny and ask rules hold kept rules back. `/allow-always`'s exact keep is now held too (it was not). - The keep is written to the owner-act record and must match it. A keep with no `martha answer` record behind it answers the one ask, keeps nothing, and says so in the notes. - What is kept lives only in the launcher's memory. No file is written. ## Found on the way (it blocked this package) The engine launch read the owner-act record with `typeof read === 'string'`, but `readStateFile` returns `{ text }`. So since 85f3bd73 (#541 package A), every answer an engine member heard was kept with `owner_act: false` and noted as having no owner act behind it. It now reads `read.text`, and the launch test below pins it. ## Tests and mutants - `the_rules_kept_for_a_launch.node-test.ts`: whole tool; exact line; prefix; the three refusals; deny and ask holding kept rules; `theLaunchsMayRun` holding kept rules and an `/allow-always` call. - `hear_an_acp_agents_asks.node-test.ts`: a keep with an owner act; without one; refused by the keeper; on a reject; with no keeper. - `the_owners_answer_route.node-test.ts`: the keep crossing the route; a malformed keep refused; the record pinning the prefix; the command words; the receipt. - `start_an_engine_member.node-test.ts`: a real launch. One `allow-for-session ls` runs the next `ls -la` unasked, and a deny of `ls -R` still asks. - Mutants, each killed: holds dropped from kept rules; the exact keep not held; kept rules not read by the launch; no keeper; the owner-act condition dropped; shell kept whole; keep on a reject; the record's keep ignored; the owner-act read put back as a string; the prefix check dropped. No new check or job.
The launch read the owner-act record as a string, but readStateFile returns { text }, so every answer an engine
member heard was kept with owner_act false since 85f3bd73 (#541 package A). It now reads the text, which a keep needs.
terra manually merged commit 60ce2063a6 into main 2026-12-01 08:51:23 +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!343
No description provided.