lazymartha#6 package 5: martha up opens the crew screen, the new lazymartha pin, and the docs #367

Open
opened 2026-12-02 12:15:50 +00:00 by ceres · 0 comments
Member

Purpose (feature): martha up opens the crew in lazymartha's crew screen instead of tmux or kitty, a release pins and fetches the lazymartha that carries it, and getting-started tells the truth about what to install and what up opens.

Raf, DECIDED 2026-12-02: "Yes, build it. Real CLI in a pane. Whole room."
Design: martha-ai/lazymartha#6, comment 8053 (Uranus; Jupiter PASS r=2), §2 ("What leaves martha, and what martha up does instead") and §5 row 5, with §6's "Package 6 lands only after 2-5 have run a real crew".
This issue is package 5 of that design, in martha. Package 6 (removing the tmux and kitty openers and their callers) is not this issue: they stay here, as up's fallback.

Refs martha-ai/lazymartha#6.

Base and dependencies

  • Base: martha main after PR 366 lands (#361 + #364). It rewrites src/run_the_martha_command/run_the_martha_command.ts (+27/−14), the file up's last line is on; branching before it lands only buys a conflict.
  • The pin names the first lazymartha release that carries the crew screen and the Claude Code pane — today lazymartha main caa38f1 (design packages 2 and 3) — and, by the design's order (1, 2, 3, 4a, 4, 5, 6), package 4's crew strip, room pane and editor tab. So the tag comes after lazymartha's package 4 lands, and its sha256 is read back from what macula-pub serves (lazymartha/<version>/lazymartha-linux-amd64.sha256), never typed from a local build.
  • The tag is this change's one ask: dry-run first, then the tag, then the pin in the code range that lands — the shape of the 0.5.0 chain. CI publishes to macula-pub (.forgejo/workflows/release.yml, DECIDED 2026-11-24 "Tag = CI build"); tags and releases are still asked (DECIDED 2026-11-18 "martha-main-batches-land-without-ask" keeps tags out of the unasked land).

What it does

  1. martha up's last line stops choosing between tmux and kitty. When lazymartha is found (the release's own bin/lazymartha first, then PATH, through findTheLazymartha) and this is a terminal, up replaces itself with:

    lazymartha crew --root <root> --martha <the script that ran up>
    

    and that process's exit status is up's. The martha handed over is THIS_MARTHA's own script (process.argv[1]), and the screen's environment is the owner's with the PATH's first entries this martha's node (dirname(process.execPath)) and its own directory (dirname(process.argv[1])): the screen reads its places with martha where and starts members with martha start {member} --acp and martha start {member}, so those must all be the martha the owner ran, not whatever a PATH holds. execve's argv[0] is the screen's own path, as a shell would start it. Everything up does before that line is unchanged: the declaration is read, the endpoint written or refused, the roster kept, parked members left down.

  2. The fallback is today's last line, said in one line. No lazymartha found, or this is no terminal (a tmux crew needs none; a kitty crew's refusal stays as it is), up says so in one line and opens the crew as today. This is the design's "Until then, martha up keeps tmux as the fallback", and it is why the openers stay one more package.

  3. martha up --prompt forwards to the crew screen. On the crew-screen path the last line becomes lazymartha crew --root <root> --martha <this martha> --prompt <text>, and lazymartha gives the first turn to the same members as today's tmux path — the Claude Code members, never an engine member (martha#134's meaning; Titan adds the flag in lazymartha's package 4). Martha keeps its own checks before forwarding: a text that begins with / or !, or holds a line break or another control character, is refused and nothing is opened (#919). On the fallback path --prompt works exactly as today: tmux types it into each member's window, and a kitty crew still refuses it. Supervisor ruling, 2026-12-02 (relayed by Mars): neither refuse nor silently fall back to tmux; until package 4 and this issue have both landed, --prompt stays on today's tmux path, which is another reason this issue lands after package 4.

  4. The pin moves. the_lazymartha_pin.json gains the version and sha256 of the release above; nothing in fetch_the_pinned_lazymartha changes (it already reads the pin and checks the digest the release build places the editor by).

A limit to state, not fix here: the martha the screen is given is THIS_MARTHA's script, so an up reached through a wrapper that is not node <script> is outside this hand-over. The screen's own --agent and --terminal-agent defaults ("martha start …") are what the PATH it is handed resolves; that is why the PATH is set rather than a command spelled out.

Fold-ins (Supervisor, 2026-12-02)

  • getting-started's "What you need" omits bubblewrap. An owner-signed run is sandboxed with bwrap (src/run_an_owner_signed_command/run_in_a_sandbox.ts:1-12); without it the run refuses with "bwrap cannot build a sandbox here (unprivileged user namespaces may be off), so no listed command keeps the shell" (:141-142). The list gains a bubblewrap bullet: what it is for (martha run, the owner-signed commands), and that refusal.
  • src/install_the_recorded_engine/install_the_recorded_engine.ts:21-26 still calls martha-engine private. It has been public since 2026-11-24, and docs/getting-started.md:59 already says so ("The engine's source is public, at that address"). The comment is corrected; the code that names the repository as the owner's to give stays, since the variable is still how it is named.
  • Do not drop tmux or kitty from the docs' list yet. That waits until package 6 lands. This package says what up now opens and keeps the openers' own documentation (martha attach, martha down, Ctrl-b q, the fallback) true.

Done when

  1. On a terminal with lazymartha found, martha up replaces itself with lazymartha crew --root <root> --martha <the script that ran up>: a test hands a stand-in lazymartha and asserts its argv (the root, that script), that execve's argv[0] is the screen's own path, that nothing tmux or kitty was started, and that up's exit status is the screen's.
  2. findTheLazymartha's order is kept: a release's bin/lazymartha is preferred over one on PATH, and a test proves both — and the environment handed over has this martha's node and its own directory first on the PATH, so the screen's martha where and the members it starts run the martha the owner ran.
  3. With no lazymartha found, and with no terminal, up runs today's last line (tmux crew; kitty crew) and says why in one line; a test on each flavour proves it.
  4. martha up --prompt <text> on the crew-screen path forwards the text to lazymartha crew --prompt <text>: a test hands a stand-in lazymartha and finds the prompt in its argv, and a text up refuses today (one beginning / or !, or holding a line break) is still refused before anything is opened. On the fallback, --prompt types into each member's window as today, and a kitty crew still refuses it.
  5. The finder is a seam, exercised directly for both paths as init's lookIn is (theInitDeclaresAsked.lookIn), and every test builds the PATH it runs with: a box with lazymartha installed, or a checkout that once packed a release (bin/lazymartha), never decides a test's outcome. Both paths have a test. Mutants each turn one red: the fallback dropped; the martha handed to --martha dropped; the prompt dropped from the crew screen's argv; a /-prefixed prompt forwarded; the release-tree binary not preferred.
  6. The pin holds the version and sha256 that macula-pub serves for it (read back from the registry), and the release build's fetch places exactly those bytes.
  7. Docs: "What you need" gains the bubblewrap bullet; the up sections say what up opens, what closing the screen means (the crew ends; the next up resumes each member with session/load), and that tmux/kitty remain for attach/down and as the fallback; --prompt's paragraphs say it reaches the crew screen and the same members as before; docs/the-declaration.md's terminal row says what still reads it.
  8. The changed up section shows no output block: the one it had was the tmux opener's, and a crew screen's output is a drawn TUI, not lines to print. What the section says was run for real: this tree's bin/martha up, with lazymartha built from its main, reached the screen with the right root and martha (it stopped at the screen's own refusal, "the declaration names no member to draw", for a crew with every member parked — the one way to run the hand-over here without starting a member and spending). A drawn screen with members started is the real-crew run the design gates package 6 on.
  9. install_the_recorded_engine.ts no longer calls martha-engine private, and says since when it is public.
  10. The whole npm test is green before the push, and every mutant above is killed.

Files (expected)

  • src/run_the_martha_command/run_the_martha_command.ts — up's last line, the fallback's one line, the --prompt forwarding
  • src/run_the_martha_command/the_crew_screen_up_opens.ts — new: what the screen is handed, the fallback, and this process replaced by the screen
  • src/run_the_martha_command/run_the_martha_command.node-test.ts — both paths, the finder's order, the fallback on each flavour, --prompt, the mutants
  • src/run_the_martha_command/the_lazymartha_pin.json — version, sha256
  • src/install_the_recorded_engine/install_the_recorded_engine.ts — the stale "private repository" comment
  • docs/getting-started.md — "What you need" (bubblewrap), the up/terminal/attach/down/--prompt sections
  • docs/the-declaration.md — the terminal row
  • README.md — only if a line there claims what up opens; today none does

Review by Mercurius. martha CI comes via Terra's land-PR round.

Purpose (feature): `martha up` opens the crew in lazymartha's crew screen instead of tmux or kitty, a release pins and fetches the lazymartha that carries it, and getting-started tells the truth about what to install and what `up` opens. Raf, DECIDED 2026-12-02: "Yes, build it. Real CLI in a pane. Whole room." Design: martha-ai/lazymartha#6, comment 8053 (Uranus; Jupiter PASS r=2), §2 ("What leaves martha, and what `martha up` does instead") and §5 row 5, with §6's "Package 6 lands only after 2-5 have run a real crew". This issue is package 5 of that design, in martha. Package 6 (removing the tmux and kitty openers and their callers) is not this issue: they stay here, as `up`'s fallback. Refs martha-ai/lazymartha#6. ## Base and dependencies - **Base: martha main after PR 366 lands** (#361 + #364). It rewrites `src/run_the_martha_command/run_the_martha_command.ts` (+27/−14), the file `up`'s last line is on; branching before it lands only buys a conflict. - **The pin names the first lazymartha release that carries the crew screen and the Claude Code pane** — today lazymartha main `caa38f1` (design packages 2 and 3) — and, by the design's order (1, 2, 3, 4a, 4, 5, 6), package 4's crew strip, room pane and editor tab. So the tag comes after lazymartha's package 4 lands, and its sha256 is read back from what macula-pub serves (`lazymartha/<version>/lazymartha-linux-amd64.sha256`), never typed from a local build. - **The tag is this change's one ask**: dry-run first, then the tag, then the pin in the code range that lands — the shape of the 0.5.0 chain. CI publishes to macula-pub (`.forgejo/workflows/release.yml`, DECIDED 2026-11-24 "Tag = CI build"); tags and releases are still asked (DECIDED 2026-11-18 "martha-main-batches-land-without-ask" keeps tags out of the unasked land). ## What it does 1. **`martha up`'s last line stops choosing between tmux and kitty.** When lazymartha is found (the release's own `bin/lazymartha` first, then PATH, through `findTheLazymartha`) and this is a terminal, `up` replaces itself with: ``` lazymartha crew --root <root> --martha <the script that ran up> ``` and that process's exit status is `up`'s. The martha handed over is `THIS_MARTHA`'s own script (`process.argv[1]`), and the screen's environment is the owner's with the PATH's first entries this martha's node (`dirname(process.execPath)`) and its own directory (`dirname(process.argv[1])`): the screen reads its places with `martha where` and starts members with `martha start {member} --acp` and `martha start {member}`, so those must all be the martha the owner ran, not whatever a PATH holds. `execve`'s argv[0] is the screen's own path, as a shell would start it. Everything `up` does before that line is unchanged: the declaration is read, the endpoint written or refused, the roster kept, parked members left down. 2. **The fallback is today's last line, said in one line.** No lazymartha found, or this is no terminal (a tmux crew needs none; a kitty crew's refusal stays as it is), `up` says so in one line and opens the crew as today. This is the design's "Until then, `martha up` keeps tmux as the fallback", and it is why the openers stay one more package. 3. **`martha up --prompt` forwards to the crew screen.** On the crew-screen path the last line becomes `lazymartha crew --root <root> --martha <this martha> --prompt <text>`, and lazymartha gives the first turn to the same members as today's tmux path — the Claude Code members, never an engine member (martha#134's meaning; Titan adds the flag in lazymartha's package 4). Martha keeps its own checks before forwarding: a text that begins with `/` or `!`, or holds a line break or another control character, is refused and nothing is opened (#919). On the fallback path `--prompt` works exactly as today: tmux types it into each member's window, and a kitty crew still refuses it. Supervisor ruling, 2026-12-02 (relayed by Mars): neither refuse nor silently fall back to tmux; until package 4 and this issue have both landed, `--prompt` stays on today's tmux path, which is another reason this issue lands after package 4. 4. **The pin moves.** `the_lazymartha_pin.json` gains the version and sha256 of the release above; nothing in `fetch_the_pinned_lazymartha` changes (it already reads the pin and checks the digest the release build places the editor by). **A limit to state, not fix here:** the martha the screen is given is `THIS_MARTHA`'s script, so an `up` reached through a wrapper that is not `node <script>` is outside this hand-over. The screen's own `--agent` and `--terminal-agent` defaults ("`martha start …`") are what the PATH it is handed resolves; that is why the PATH is set rather than a command spelled out. ## Fold-ins (Supervisor, 2026-12-02) - **getting-started's "What you need" omits bubblewrap.** An owner-signed run is sandboxed with `bwrap` (`src/run_an_owner_signed_command/run_in_a_sandbox.ts:1-12`); without it the run refuses with "bwrap cannot build a sandbox here (unprivileged user namespaces may be off), so no listed command keeps the shell" (`:141-142`). The list gains a **bubblewrap** bullet: what it is for (`martha run`, the owner-signed commands), and that refusal. - **`src/install_the_recorded_engine/install_the_recorded_engine.ts:21-26` still calls martha-engine private.** It has been public since 2026-11-24, and `docs/getting-started.md:59` already says so ("The engine's source is public, at that address"). The comment is corrected; the code that names the repository as the owner's to give stays, since the variable is still how it is named. - **Do not drop tmux or kitty from the docs' list yet.** That waits until package 6 lands. This package says what `up` now opens and keeps the openers' own documentation (`martha attach`, `martha down`, `Ctrl-b q`, the fallback) true. ## Done when 1. On a terminal with lazymartha found, `martha up` replaces itself with `lazymartha crew --root <root> --martha <the script that ran up>`: a test hands a stand-in lazymartha and asserts its argv (the root, that script), that `execve`'s argv[0] is the screen's own path, that nothing tmux or kitty was started, and that `up`'s exit status is the screen's. 2. `findTheLazymartha`'s order is kept: a release's `bin/lazymartha` is preferred over one on PATH, and a test proves both — and the environment handed over has this martha's node and its own directory first on the PATH, so the screen's `martha where` and the members it starts run the martha the owner ran. 3. With no lazymartha found, and with no terminal, `up` runs today's last line (tmux crew; kitty crew) and says why in one line; a test on each flavour proves it. 4. `martha up --prompt <text>` on the crew-screen path forwards the text to `lazymartha crew --prompt <text>`: a test hands a stand-in lazymartha and finds the prompt in its argv, and a text `up` refuses today (one beginning `/` or `!`, or holding a line break) is still refused before anything is opened. On the fallback, `--prompt` types into each member's window as today, and a kitty crew still refuses it. 5. The finder is a seam, exercised directly for both paths as `init`'s `lookIn` is (`theInitDeclaresAsked.lookIn`), and every test builds the PATH it runs with: a box with lazymartha installed, or a checkout that once packed a release (`bin/lazymartha`), never decides a test's outcome. Both paths have a test. Mutants each turn one red: the fallback dropped; the martha handed to `--martha` dropped; the prompt dropped from the crew screen's argv; a `/`-prefixed prompt forwarded; the release-tree binary not preferred. 6. The pin holds the version and sha256 that macula-pub serves for it (read back from the registry), and the release build's fetch places exactly those bytes. 7. Docs: "What you need" gains the bubblewrap bullet; the `up` sections say what `up` opens, what closing the screen means (the crew ends; the next `up` resumes each member with `session/load`), and that tmux/kitty remain for `attach`/`down` and as the fallback; `--prompt`'s paragraphs say it reaches the crew screen and the same members as before; `docs/the-declaration.md`'s `terminal` row says what still reads it. 8. The changed `up` section shows no output block: the one it had was the tmux opener's, and a crew screen's output is a drawn TUI, not lines to print. What the section says was run for real: this tree's `bin/martha up`, with lazymartha built from its main, reached the screen with the right root and martha (it stopped at the screen's own refusal, "the declaration names no member to draw", for a crew with every member parked — the one way to run the hand-over here without starting a member and spending). A drawn screen with members started is the real-crew run the design gates package 6 on. 9. `install_the_recorded_engine.ts` no longer calls martha-engine private, and says since when it is public. 10. The whole `npm test` is green before the push, and every mutant above is killed. ## Files (expected) - `src/run_the_martha_command/run_the_martha_command.ts` — `up`'s last line, the fallback's one line, the `--prompt` forwarding - `src/run_the_martha_command/the_crew_screen_up_opens.ts` — new: what the screen is handed, the fallback, and this process replaced by the screen - `src/run_the_martha_command/run_the_martha_command.node-test.ts` — both paths, the finder's order, the fallback on each flavour, `--prompt`, the mutants - `src/run_the_martha_command/the_lazymartha_pin.json` — version, sha256 - `src/install_the_recorded_engine/install_the_recorded_engine.ts` — the stale "private repository" comment - `docs/getting-started.md` — "What you need" (bubblewrap), the `up`/terminal/attach/down/`--prompt` sections - `docs/the-declaration.md` — the `terminal` row - `README.md` — only if a line there claims what `up` opens; today none does Review by Mercurius. martha CI comes via Terra's land-PR round.
Sign in to join this conversation.
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#367
No description provided.