martha#254: martha up needs no terminal, so a crew of dead panes restarts itself #281

Manually merged
terra merged 3 commits from ceres/254-dead-panes into main 2026-11-27 02:32:25 +00:00
Member

What it does

martha up no longer asks for the caller's terminal, so a crew whose start failed restarts itself from a script.

A failed start leaves the crew's tmux session behind with a dead pane per member (#239: all three panes died at
status 1). The next martha up, run from a script under tmux with no terminal, refused before it read anything:

martha: martha start runs a member on your own terminal, and its input is not one. Run it yourself, in a terminal.

Nothing up opens is typed on the caller's terminal: each member is new-session -d / new-window -d on Martha's own
tmux, or a detached kitty. The dead-pane recovery was already there — openAMembersWindow reads pane_dead on the
member's own pane, closes the window, opens the member again in its place — it was simply unreachable for a caller with
no terminal.

The one thing up does ask is where the engine's key file is, when the crew names no engine_endpoint and the
provider's variable is unset. Asked with no terminal, readline would wait on a reading that never comes, so it is
refused instead, naming the field and the file it goes in.

The cost, stated plainly (the #619 speed bump)

Deleting the gate removes a speed bump: a member's shell can now run martha up for a tmux crew, as it could always run
tmux -L martha new-window itself. It still cannot run martha start <member>, and the terminal gate was never a wall
(martha#619 says so in its own comment). The Supervisor ruled this on 2026-11-26 under DECIDED 2026-11-24 "the team is
way too paranoid": no guard for a crew-insider scenario. The kitty path, martha start and martha attach keep their
refusals.

Evidence

  • run_the_martha_command.node-test.ts + bring_up_the_declared_crew.node-test.ts: 91/91.
  • The dead-pane test reached without a terminal:
    #254: martha up whose input is no terminal starts a tmux crew again, closing each window whose member ended — the
    session is open with 1 Lead and 1 flash-a listed (both panes ended) and the run's stdin is a pipe; it asserts
    kill-window then new-window then the strip for each member, and no second new-session.
  • Red first: with the deleted gate put back, that test fails (EXIT_REFUSED), and so does
    #254: martha up whose input is no terminal and whose crew names no engine endpoint refuses, naming the field to write.
  • Main 5d3c4813 merged once, automatically, nothing resolved by hand (Mars's ruling): tip 875ae51d. The merge touches
    neither of the two files this changes.
  • On 875ae51d: .github/workflows diff vs 5d3c4813 0 bytes; run_the_martha_command.ts exactly 1105 lines,
    the lint cap, nothing net-added; npm run verify green end to end (lint first, then 1224 files' names, 1163 sources
    with no cycle, 480 test files' titles, 48 restated-value sites with 0 findings, nothing private, 16 checks each in a
    job, 19 jobs timed, posted-text bites, 17 recorded-host runs counted); check:private
    MARTHA_GITHUB_STOPPED=1 nothing private on df4ec408.. and on 5d3c4813..; whole npm test
    5679 tests, 5641 pass, 0 fail, 38 skipped (stage 1's 17 recorded-host runs do not run locally, as its script says:
    ci.yml's relay job runs them).
  • The one renamed test title carries a Drops-test: line in the commit message.

Refs martha-ai/martha#254, martha-ai/martha#239, martha-ai/martha#223.

## What it does `martha up` no longer asks for the caller's terminal, so a crew whose start failed restarts itself from a script. A failed start leaves the crew's tmux session behind with a dead pane per member (#239: all three panes died at status 1). The next `martha up`, run from a script under tmux with no terminal, refused before it read anything: martha: martha start runs a member on your own terminal, and its input is not one. Run it yourself, in a terminal. Nothing `up` opens is typed on the caller's terminal: each member is `new-session -d` / `new-window -d` on Martha's own tmux, or a detached kitty. The dead-pane recovery was already there — `openAMembersWindow` reads `pane_dead` on the member's own pane, closes the window, opens the member again in its place — it was simply unreachable for a caller with no terminal. The one thing `up` does ask is where the engine's key file is, when the crew names no `engine_endpoint` and the provider's variable is unset. Asked with no terminal, `readline` would wait on a reading that never comes, so it is refused instead, naming the field and the file it goes in. ## The cost, stated plainly (the #619 speed bump) Deleting the gate removes a speed bump: a member's shell can now run `martha up` for a tmux crew, as it could always run `tmux -L martha new-window` itself. It still cannot run `martha start <member>`, and the terminal gate was never a wall (martha#619 says so in its own comment). The Supervisor ruled this on 2026-11-26 under DECIDED 2026-11-24 "the team is way too paranoid": no guard for a crew-insider scenario. The kitty path, `martha start` and `martha attach` keep their refusals. ## Evidence - `run_the_martha_command.node-test.ts` + `bring_up_the_declared_crew.node-test.ts`: 91/91. - The dead-pane test reached without a terminal: `#254: martha up whose input is no terminal starts a tmux crew again, closing each window whose member ended` — the session is open with `1 Lead` and `1 flash-a` listed (both panes ended) and the run's stdin is a pipe; it asserts `kill-window` then `new-window` then the strip for each member, and no second `new-session`. - Red first: with the deleted gate put back, that test fails (`EXIT_REFUSED`), and so does `#254: martha up whose input is no terminal and whose crew names no engine endpoint refuses, naming the field to write`. - Main `5d3c4813` merged once, automatically, nothing resolved by hand (Mars's ruling): tip `875ae51d`. The merge touches neither of the two files this changes. - On `875ae51d`: `.github/workflows` diff vs `5d3c4813` **0 bytes**; `run_the_martha_command.ts` exactly **1105** lines, the lint cap, nothing net-added; `npm run verify` green end to end (lint first, then 1224 files' names, 1163 sources with no cycle, 480 test files' titles, 48 restated-value sites with 0 findings, nothing private, 16 checks each in a job, 19 jobs timed, posted-text bites, 17 recorded-host runs counted); `check:private` `MARTHA_GITHUB_STOPPED=1` **nothing private** on `df4ec408..` and on `5d3c4813..`; whole `npm test` **5679 tests, 5641 pass, 0 fail, 38 skipped** (stage 1's 17 recorded-host runs do not run locally, as its script says: ci.yml's relay job runs them). - The one renamed test title carries a `Drops-test:` line in the commit message. Refs martha-ai/martha#254, martha-ai/martha#239, martha-ai/martha#223.
A start that failed leaves its crew's tmux session behind with a dead pane per member,
and `martha up` refused before reading anything: its caller was a script, its input no
terminal, and the refusal spoke of `martha start` on a terminal that caller does not have.
Every member `up` starts is opened detached — a window on Martha's own tmux, or kitty's
tabs — so nothing is typed on the caller's terminal and `up` asks for none; a crew now
restarts itself unattended, and a window whose member ended is closed and its member
opened again in its place, as it already was for an owner at a terminal.

The one thing `up` does ask is where the engine's key file is, when the crew names no
engine_endpoint and the provider's variable is unset. Asked with no terminal, that
question waits on a reading that never comes, so it is refused instead, naming the field
and the file it goes in. `martha start` and `martha attach`, which really do run on the
owner's terminal, keep their refusal.

The kitty path is unchanged: it still asks for the owner's terminal, and the test that
named the old refusal for `up` now pins that instead.

Drops-test: src/run_the_martha_command/run_the_martha_command.node-test.ts :: #511: martha up whose input is no terminal refuses, and writes nothing
Jupiter's three notes, folded in. (1) `up` read the crew, wrote the engine endpoint into the
declaration, kept the crew's realm key and wrote its roster, and only then refused for a kitty
crew whose caller has no terminal — the write-then-refuse order the old #511 test forbade. The
refusal now sits where the crew is read, in `theCrewUpOpens` (../bring_up_the_declared_crew),
which hands back either the crew or the caller's refusal line; the line is the caller's so that
module names no launcher's wording and imports none of it. A tmux crew still needs no terminal.
The test pins it: the declaration bytes unchanged, no file written anywhere under the home, no
kitty started — and it reds when the guard is taken out ("up wrote the endpoint before it refused").

(2) Two comments corrected: `up`'s doc block says a tmux crew needs no terminal and a kitty
crew's is asked for before anything is written, and the owner's-acts table no longer claims every
one of them asks for a terminal, since `up` is not.

(3) A row for NAME_THE_ENDPOINT_INSTEAD in getting-started's "What a refusal means" table.

`run_the_martha_command.ts` stays at its 1105-line cap: the guard is paid for by the comment it
replaces and by the crew read it folds into.
terra manually merged commit 530950313a into main 2026-11-27 02:32:25 +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!281
No description provided.