Key a session's record streams by member (martha#240) #242

Manually merged
terra merged 3 commits from pluto/240-session-record-per-member into main 2026-11-26 08:48:20 +00:00
Member

Closes nothing; the fix for martha-ai/martha#240, found by the proof run martha-ai/martha#239.

An engine launch makes its own GOOSE_PATH_ROOT, so the engine names its first session <date>_1 in every launch. The crew keeps a session's records as streams named by session id alone, in one rows directory. Two members started on the same day therefore wrote one stream, the second flush appended with an expected_length the first writer had already passed, and keep broke that session for the rest of its launch (ROW_STREAM_MOVED). On the #239 crew the supervisor and the builder were both refused on session 20261126_1 before their first turn answered.

  • session_records_in_rows: sessionRecordsIn takes the member and keys every stream it names. The engine launch passes it. A Claude Code launch keeps the names it had: its session ids are UUIDs, and a crew declared before this must keep reading the streams it wrote.
  • apply_the_owners_release: the release streams follow the same key, written and read.
  • release_a_held_member: reads the member's stream first and the session-id-only name after it, so martha release still reaches a member whose record was written before this, and puts the mark on the stream it read.

Test: src/session_records_in_rows/session_records_in_rows.node-test.ts, "two members whose session ids collide keep their own record streams"; the two affected files run 17 of 17 green in a namespace of their own, and tsc --noEmit and eslint are clean on the changed files.

Refs martha-ai/martha#239, martha-ai/martha#240

Closes nothing; the fix for martha-ai/martha#240, found by the proof run martha-ai/martha#239. An engine launch makes its own `GOOSE_PATH_ROOT`, so the engine names its first session `<date>_1` in every launch. The crew keeps a session's records as streams named by session id alone, in one rows directory. Two members started on the same day therefore wrote one stream, the second `flush` appended with an `expected_length` the first writer had already passed, and `keep` broke that session for the rest of its launch (`ROW_STREAM_MOVED`). On the #239 crew the supervisor and the builder were both refused on session `20261126_1` before their first turn answered. - `session_records_in_rows`: `sessionRecordsIn` takes the member and keys every stream it names. The engine launch passes it. A Claude Code launch keeps the names it had: its session ids are UUIDs, and a crew declared before this must keep reading the streams it wrote. - `apply_the_owners_release`: the release streams follow the same key, written and read. - `release_a_held_member`: reads the member's stream first and the session-id-only name after it, so `martha release` still reaches a member whose record was written before this, and puts the mark on the stream it read. Test: `src/session_records_in_rows/session_records_in_rows.node-test.ts`, "two members whose session ids collide keep their own record streams"; the two affected files run 17 of 17 green in a namespace of their own, and `tsc --noEmit` and eslint are clean on the changed files. Refs martha-ai/martha#239, martha-ai/martha#240
Key a session's record streams by member, so an engine crew's members do not share one (martha#240)
Some checks failed
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
CI / nothing private (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 9s
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
dependency advisories / node in . (pull_request) Successful in 32s
CI / links resolve (pull_request) Successful in 5s
dependency advisories / node in installer (pull_request) Successful in 13s
dependency advisories / advisories (pull_request) Successful in 0s
CI / Martha's names are its own (pull_request) Successful in 28s
CI / no import cycle (pull_request) Successful in 30s
CI / structural floor (pull_request) Successful in 1m17s
CI / the engine drift check bites (pull_request) Successful in 49s
CI / the posted text check bites (pull_request) Successful in 19s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 13s
CI / workflows are valid (pull_request) Successful in 19s
CI / the host drift check bites (pull_request) Successful in 1m31s
CI / the pictures change only with the version (pull_request) Successful in 15s
CI / every check runs in a job (pull_request) Successful in 21s
CI / no test the base passed goes missing (pull_request) Successful in 56s
CI / every job has a timeout (pull_request) Successful in 21s
CI / no literal restates a defined value (pull_request) Failing after 59s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 12s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 40s
CI / installer (pull_request) Successful in 3m49s
CI / the relay loads in the recorded host (pull_request) Successful in 16m14s
CI / gate coverage (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
30fcca6cfe
An engine launch makes its own GOOSE_PATH_ROOT, so the engine names its first session `<date>_1` in
every launch. The crew keeps session records as streams named by session id alone, in one rows
directory, so two members started on the same day wrote one stream: the second append was refused
ROW_STREAM_MOVED and that session was broken for the rest of its launch. Measured on martha#239's
crew: supervisor and builder, 2026-11-26 06:34Z, both refused on session 20261126_1.

- session_records_in_rows: sessionRecordsIn takes the member and keys every stream this store names.
  The engine launch passes it. A Claude Code launch keeps the names it had: its session ids are
  UUIDs, and a crew declared before this must keep reading the streams it wrote.
- apply_the_owners_release: the release streams follow the same key, written and read.
- release_a_held_member: reads the member's stream first and the session-id-only name after it, so
  `martha release` still reaches a member whose record was written before this, and puts the mark on
  the stream it read.
- The test starts two members whose session ids collide, with one rows directory, and asserts each
  keeps its own record and that no session-id-only stream is written.

Refs martha-ai/martha#239, martha-ai/martha#240
martha#240 r=1: the tests that pin the member key, and the two readers it left behind
Some checks failed
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
CI / nothing private (pull_request) Has been skipped
dependency advisories / node in . (pull_request) Successful in 14s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 15s
dependency advisories / node in installer (pull_request) Successful in 13s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 7s
CI / structural floor (pull_request) Successful in 43s
CI / Martha's names are its own (pull_request) Successful in 39s
CI / no import cycle (pull_request) Successful in 36s
CI / the engine drift check bites (pull_request) Successful in 25s
CI / the posted text check bites (pull_request) Successful in 9s
CI / the host drift check bites (pull_request) Successful in 1m16s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 15s
CI / workflows are valid (pull_request) Successful in 16s
CI / no test the base passed goes missing (pull_request) Successful in 45s
CI / the pictures change only with the version (pull_request) Successful in 25s
CI / every check runs in a job (pull_request) Successful in 19s
CI / every job has a timeout (pull_request) Successful in 18s
CI / installer (pull_request) Successful in 2m33s
CI / no literal restates a defined value (pull_request) Failing after 1m19s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 19s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 34s
CI / the relay loads in the recorded host (pull_request) Successful in 16m33s
CI / gate coverage (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
09b420ea82
Mars's r=1 FAIL was two survived mutants, each now killed.

start_an_engine_member.ts:282, reverted to sessionRecordsIn(rows, releasesIn(rows)), survived 29/29, 7/7 and 10/10. A
new test starts two engine members of one crew together, both engines naming their first session stand-in-session, and
asserts both first turns reach their engine with no ROW_STREAM_MOVED, each member's record on its own stream, and
nothing on the session-id-only one. With the mutant it is red, and red the way martha#239 was: "the record of session
stand-in-session could not be kept (ROW_STREAM_MOVED), so nothing in it is answered for again".

release_a_held_member.ts:101, always releaseStreamOf(session), survived. Two cases now pin both directions: a record
kept under the member's key puts its mark on the member's release stream and writes nothing to the unkeyed one (red
with that mutant), and a record kept under the session-id-only name puts its mark there and writes nothing to the
member's (red with the other).

The ruling's check, run again, found two readers still naming a stream by the session alone:

- start_an_engine_member.node-test.ts's handover writer read the unkeyed stream, which broke martha#1002 on this branch
  (stage 3: "no record of stand-in-session"). It reads the member's stream now.
- the_environment_a_member_is_given.ts's theSessionIn took the whole "builder/<id>" as a session id, so a session id the
  crew recorded would have been handed to a member's environment, failing martha#683 open. It strips through the last
  separator now, with a test that is red without it.

The Claude Code launch (launch_a_claude_code_member.ts:661) keeps its unkeyed streams on purpose: its ids are UUIDs, and
a crew declared before this must read what it wrote.

The stale headers in release_a_held_member.ts and apply_the_owners_release.ts now name the key.

Green locally: tsc --noEmit, eslint on the changed folders, and the five affected test files in a namespace, 79/79.
martha#240 r=2 fix: the member name in the test is SUPERVISOR, not a copy of it
All checks were successful
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
CI / nothing private (pull_request) Has been skipped
dependency advisories / node in . (pull_request) Successful in 10s
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 5s
dependency advisories / node in installer (pull_request) Successful in 13s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 16s
dependency advisories / advisories (pull_request) Successful in 0s
CI / structural floor (pull_request) Successful in 29s
CI / Martha's names are its own (pull_request) Successful in 29s
CI / no import cycle (pull_request) Successful in 32s
CI / the engine drift check bites (pull_request) Successful in 36s
CI / the posted text check bites (pull_request) Successful in 13s
CI / the host drift check bites (pull_request) Successful in 1m25s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 13s
CI / workflows are valid (pull_request) Successful in 14s
CI / installer (pull_request) Successful in 3m51s
CI / no test the base passed goes missing (pull_request) Successful in 38s
CI / the pictures change only with the version (pull_request) Successful in 18s
CI / every check runs in a job (pull_request) Successful in 15s
CI / every job has a timeout (pull_request) Successful in 14s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 19s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 37s
CI / no literal restates a defined value (pull_request) Successful in 1m16s
CI / the relay loads in the recorded host (pull_request) Successful in 15m59s
CI / the clean-install proof removes its container (pull_request) Successful in 19m58s
CI / gate coverage (pull_request) Successful in 22m10s
7a14f1bfd8
The guard "no literal restates a defined value" named two sites in the new
martha#240 test: session_records_in_rows.node-test.ts:180 and :193 use the
literal 'supervisor', which report_where_the_work_stands.ts:37 defines as
SUPERVISOR. The literal is imported from there now, as six other test files
in the tree already do, instead of declared a coincidence.

Nothing else changes: the test is the same case in both places, and the four
readers named in the r=1 fold-in are untouched.
terra manually merged commit ee1615ea1f into main 2026-11-26 08:48:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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!242
No description provided.