Purpose (fix): an engine member's row is beaten while it works, so martha ls reads it running #147

Closed
opened 2026-11-24 12:19:29 +00:00 by pluto · 1 comment
Member

Purpose (fix): an engine member's row is beaten while it works, so martha ls reads a live engine member as running and reads offline only when it is really gone.

What happens. Found while fixing #142 on the pilot (main 5a2b91b9, engine 1.60.0, engine member) and handed on by the Supervisor so it is its own package. A Claude Code member's launch starts the crew's beat when it serves its relay (../show_dashboard_beat, keptBeatingWhileItRuns, called from launch_a_claude_code_member.ts). An engine member's launch never does: its row is written when something happens to it — a crew tool call, a dialog opening or closing — and otherwise stays as it was.

So an engine member that works a long turn, or simply sits between turns, has a row nobody has rewritten for longer than the crew's offline time, and martha ls says offline about a member whose engine process is alive. The line I put on #142 says it in one sentence: "an engine member's row is not beaten while it works, so its own state is usually the quiet word."

Seen live on 2026-11-24, right after answering #142's ask: the member ran its allowed call and its turn, and martha ls read

Pluto  offline  /home/rl/work/martha-pilot-ws  since 2026-11-24T12:13:46.483Z  deepseek-flash

while its launcher record named a live process and its peer read running.

What it costs. An owner watching ls or the strip cannot tell a working engine member from one whose session died; the one member the pilot is meant to show is the one that looks absent.

Done when. An engine member's launcher beats its row for as long as the member runs, as a Claude Code member's launch does, so martha ls reads it running while it works and only reads offline once its engine is gone; with a test whose mutant drops the beat and dies.

Refs macula-io/martha#142, #102.

Purpose (fix): an engine member's row is beaten while it works, so `martha ls` reads a live engine member as running and reads offline only when it is really gone. **What happens.** Found while fixing #142 on the pilot (main `5a2b91b9`, engine 1.60.0, engine member) and handed on by the Supervisor so it is its own package. A Claude Code member's launch starts the crew's beat when it serves its relay (`../show_dashboard_beat`, `keptBeatingWhileItRuns`, called from `launch_a_claude_code_member.ts`). An engine member's launch never does: its row is written when something happens to it — a crew tool call, a dialog opening or closing — and otherwise stays as it was. So an engine member that works a long turn, or simply sits between turns, has a row nobody has rewritten for longer than the crew's offline time, and `martha ls` says `offline` about a member whose engine process is alive. The line I put on #142 says it in one sentence: "an engine member's row is not beaten while it works, so its own state is usually the quiet word." Seen live on 2026-11-24, right after answering #142's ask: the member ran its allowed call and its turn, and `martha ls` read ``` Pluto offline /home/rl/work/martha-pilot-ws since 2026-11-24T12:13:46.483Z deepseek-flash ``` while its launcher record named a live process and its peer read `running`. **What it costs.** An owner watching `ls` or the strip cannot tell a working engine member from one whose session died; the one member the pilot is meant to show is the one that looks absent. **Done when.** An engine member's launcher beats its row for as long as the member runs, as a Claude Code member's launch does, so `martha ls` reads it `running` while it works and only reads `offline` once its engine is gone; with a test whose mutant drops the beat and dies. Refs macula-io/martha#142, #102.
Author
Member

Landed, and its Done-when checked line by line against what shipped.

The land. PR 148 merged into main as ee35c556 (--no-ff onto 951f20be), 96/96 in Terra's run on the merge. The relay job's red that held it is not this PR's and is named as such in the landing note: task 10282 on its tip, 658 s, against the same job red on main 951f20be as task 10320, 710 s, and it is martha#19's class.

"An engine member's launcher beats its row for as long as the member runs, as a Claude Code member's launch does." The engine start wraps its relay in keptBeatingWhileItRuns (src/start_an_engine_member/start_an_engine_member.ts:212, imported at :58), which is the same helper a Claude Code launch uses, so the beat runs while the relay is served and stops when it closes.

"So martha ls reads it running while it works." Live, from main ee35c556, the pilot's engine member started from the landed clone's bin/martha at 19:34:52Z, eight samples over 60 s:

19:35:22 age=4.3s Pluto  running  /home/rl/work/martha-pilot-ws  since 2026-11-24T19:34:52.997Z  deepseek-flash
19:35:30 age=2.9s Pluto  running  ...
19:35:39 age=1.4s Pluto  running  ...
19:35:48 age=0.0s Pluto  running  ...
19:35:56 age=3.6s Pluto  running  ...
19:36:05 age=2.1s Pluto  running  ...
19:36:13 age=0.8s Pluto  running  ...
19:36:22 age=4.3s Pluto  running  ...

The age is the row file's own age (~/.local/state/martha/crews/<crew>/row/Pluto.json), so the row is being rewritten continuously rather than read from a stale file. Before the fix the same member read offline with its row ten minutes old, which is the "What happens" section of this issue.

"And only reads offline once its engine is gone." The row stops moving at stop, which is what start_an_engine_member.node-test.ts holds: the new case runs a scripted engine that writes no row of its own, and checks the row moves within two beat intervals of settling and does not move again after stop.

"With a test whose mutant drops the beat and dies." The committed test kills the mutant that drops the launcher's beat, by name; the first version of the test passed under that mutant because a write from the member's own opening looked like a beat, and the committed one lets the opening writes settle first, which is why the guard sits below the mutant rather than above it.

Purpose met: an owner watching ls can now tell a working engine member from one whose session died.

Landed, and its Done-when checked line by line against what shipped. **The land.** PR 148 merged into main as **ee35c556** (--no-ff onto 951f20be), 96/96 in Terra's run on the merge. The relay job's red that held it is not this PR's and is named as such in the landing note: task 10282 on its tip, 658 s, against the same job red on main 951f20be as task 10320, 710 s, and it is martha#19's class. **"An engine member's launcher beats its row for as long as the member runs, as a Claude Code member's launch does."** The engine start wraps its relay in `keptBeatingWhileItRuns` (`src/start_an_engine_member/start_an_engine_member.ts:212`, imported at :58), which is the same helper a Claude Code launch uses, so the beat runs while the relay is served and stops when it closes. **"So `martha ls` reads it `running` while it works."** Live, from main ee35c556, the pilot's engine member started from the landed clone's `bin/martha` at 19:34:52Z, eight samples over 60 s: ``` 19:35:22 age=4.3s Pluto running /home/rl/work/martha-pilot-ws since 2026-11-24T19:34:52.997Z deepseek-flash 19:35:30 age=2.9s Pluto running ... 19:35:39 age=1.4s Pluto running ... 19:35:48 age=0.0s Pluto running ... 19:35:56 age=3.6s Pluto running ... 19:36:05 age=2.1s Pluto running ... 19:36:13 age=0.8s Pluto running ... 19:36:22 age=4.3s Pluto running ... ``` The age is the row file's own age (`~/.local/state/martha/crews/<crew>/row/Pluto.json`), so the row is being rewritten continuously rather than read from a stale file. Before the fix the same member read `offline` with its row ten minutes old, which is the "What happens" section of this issue. **"And only reads `offline` once its engine is gone."** The row stops moving at `stop`, which is what `start_an_engine_member.node-test.ts` holds: the new case runs a scripted engine that writes no row of its own, and checks the row moves within two beat intervals of settling and does not move again after `stop`. **"With a test whose mutant drops the beat and dies."** The committed test kills the mutant that drops the launcher's beat, by name; the first version of the test passed under that mutant because a write from the member's own opening looked like a beat, and the committed one lets the opening writes settle first, which is why the guard sits below the mutant rather than above it. Purpose met: an owner watching `ls` can now tell a working engine member from one whose session died.
pluto closed this issue 2026-11-24 19:36:41 +00:00
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#147
No description provided.