martha start <engine member> --acp: serve ACP upward to the client above (martha#361) #363

Manually merged
terra merged 0 commits from neptunus/361-start-acp into main 2026-12-02 12:17:36 +00:00
Member

Refs #361

martha start <engine member> --acp serves the engine member upward, over ACP on stdio, to the client above it (lazymartha package 1). The engine below is driven as before (gate, owner's rules, dashboard rows). Only the owner's side changes:

  • The client above's prompts become the owner's turns, and the engine's updates are relayed up.
  • The asks the gate and the rules leave for the owner go up as session/request_permission, with once-options only.
  • One ask has two answer paths. martha answer and the client's reply settle the same held ask by key, and the first one wins. An ask settled the other way is dropped up with _martha/ask_settled, and a late reply answers nothing.
  • start --acp is refused inside a member, as martha answer is. stdout carries only protocol frames: no started line, no bell, no chat.

New slice: src/serve_acp_to_the_client_above/. It is drawn in the ACP box of architecture/c4_diagrams.ts and its README row.

Proof on a2963287 (tested on 5ebf3a19; the only difference is one comment line in the new slice):

  • lint, tsc, marthas-names, no-import-cycle, base-tests, pictures, restated-values and check:private are all clean on origin/main..HEAD.
  • Whole npm test: 5976 tests, 1 fail. The failure is the martha#70 setsid-loop case under load (60.4 s against the 60 s timeout). It is unrelated, passes alone, and is filed as #362.
  • Mutants 6/6 killed: inside-member refusal, a rules-allowed call sent up, a second answer applied, a settled ask not dropped, a command prompt passed, asks not sent up.

Not tested: a gate deny never going up. A deny never opens an ask, which is the same path the rules test proves. The bell guard on a tty stdin is not tested either.

Refs #361 `martha start <engine member> --acp` serves the engine member upward, over ACP on stdio, to the client above it (lazymartha package 1). The engine below is driven as before (gate, owner's rules, dashboard rows). Only the owner's side changes: - The client above's prompts become the owner's turns, and the engine's updates are relayed up. - The asks the gate and the rules leave for the owner go up as `session/request_permission`, with once-options only. - One ask has two answer paths. `martha answer` and the client's reply settle the same held ask by key, and the first one wins. An ask settled the other way is dropped up with `_martha/ask_settled`, and a late reply answers nothing. - `start --acp` is refused inside a member, as `martha answer` is. stdout carries only protocol frames: no started line, no bell, no chat. New slice: `src/serve_acp_to_the_client_above/`. It is drawn in the ACP box of architecture/c4_diagrams.ts and its README row. Proof on a2963287 (tested on 5ebf3a19; the only difference is one comment line in the new slice): - lint, tsc, marthas-names, no-import-cycle, base-tests, pictures, restated-values and check:private are all clean on origin/main..HEAD. - Whole `npm test`: 5976 tests, 1 fail. The failure is the martha#70 setsid-loop case under load (60.4 s against the 60 s timeout). It is unrelated, passes alone, and is filed as #362. - Mutants 6/6 killed: inside-member refusal, a rules-allowed call sent up, a second answer applied, a settled ask not dropped, a command prompt passed, asks not sent up. Not tested: a gate `deny` never going up. A deny never opens an ask, which is the same path the rules test proves. The bell guard on a tty stdin is not tested either.
lazymartha package 1. The engine is driven as before - gate,
owner's rules, dashboard rows - and only the owner's side changes: the client
above's prompts are the owner's turns, the engine's updates are relayed up,
and the asks the gate and rules leave for the owner go up as
session/request_permission with once-options only.

One ask, two answer paths: martha answer and the client's reply settle the
same held ask by key; the asks keep one answer. An ask settled another way is
dropped up with _martha/ask_settled, and a late reply answers nothing.

start --acp is refused inside a member, as martha answer is (martha#601).
stdout carries only protocol frames: no started line, no bell, no chat.

Under the lint caps: the server above is a class of small methods, and the
start's drive, its client above and the asks' close are helpers. The slice
reads its input lines as the_acp_client does (no node:readline in a slice),
and is drawn in the ACP box of the C4 page and its row.
terra manually merged commit 28b8909b99 into main 2026-12-02 12:17:36 +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!363
No description provided.