martha#180: a host whose relay did not report its start is started again once, then stopped #185

Manually merged
terra merged 6 commits from saturnus/180-restart-once into main 2026-11-25 15:04:18 +00:00
Member

Purpose (fix): a member whose host dropped Martha's relay is restarted once with the relay, and stopped with a plain message if that fails too, so it never goes on working without the owner's approvals.

DECIDED 2026-11-25 (Raf): "Yes, build it (Recommended)". Threat model: #180 comment 4598 (T1-T7).

What changes

  • launching(): the backstop's miss (#104) no longer stops the member at once. theOneRestart kills the host's group, and whenTheMemberStops awaits that host's exit. Only then is the host started again by theSecondStart, on the same starting and relay server, with the relay directory and snapshot kept. One restart per launch, never reset (T1). A stop for any other reason comes first and is never turned into a restart (T2). A second start that fails stops the member with its own refusal (T7).
  • backstopsOfALaunch: a fresh backstop per start, put in place before the second spawn, so a report of the first start never counts for the second (T3).
  • Final message: <member> is stopped: its host ran without Martha's relay twice (no report of the session's start within <n> s, on the first start and on the restart), so it was not started again. When the trust-answer deadline applied, the hint "start the member again and answer it" is appended, as the old message had it.
  • whenTheMemberStops takes a restart. A host that exits on an asked restart loses only its own group. Everything the launch made is removed once, at the final stop (T6). The first host's launcher-end handlers stay on through the second start.
  • hearHostStart(pid) on the launch: a test hook, like hearSessionStart, so a test counts starts where the launcher makes them.

Tests (fake host fakeClaudeThatCountsItsStarts)

  • never reports → exactly 2 starts, the message, args/env/socket equal on both starts (T4), relay root empty
  • reports on the restart → runs on past two deadlines; stop reaches the restarted host
  • stopped for another reason → 1 start, no restart (T2)
  • unit (keep_the_backstop_of_a_launch.node-test.ts): a report before anew never counts for the next start (T3)
  • The existing owner's-terminal deadline tests pass with the restart on a real pty

Mutants (each killed by its named test): restart on every miss, stop path removed, restart on any stop, reported carried over.

Residual / notes

  • The second start goes through startedMember again, so the mesh-server config is placed into the snapshot again from the same approved bytes. Nothing is re-read from the owner.
  • MemberStarted.pid stays the first start's pid. stop and stopped follow the restarted host.
  • The ungated window can be up to two deadlines (T5, accepted by the ruling). The message says so.

Refs #180, #171, #104.

🤖 Generated with Claude Code

Purpose (fix): a member whose host dropped Martha's relay is restarted once with the relay, and stopped with a plain message if that fails too, so it never goes on working without the owner's approvals. DECIDED 2026-11-25 (Raf): "Yes, build it (Recommended)". Threat model: #180 comment 4598 (T1-T7). **What changes** - `launching()`: the backstop's miss (#104) no longer stops the member at once. `theOneRestart` kills the host's group, and `whenTheMemberStops` awaits that host's exit. Only then is the host started again by `theSecondStart`, on the same `starting` and relay server, with the relay directory and snapshot kept. One restart per launch, never reset (T1). A stop for any other reason comes first and is never turned into a restart (T2). A second start that fails stops the member with its own refusal (T7). - `backstopsOfALaunch`: a fresh backstop per start, put in place before the second spawn, so a report of the first start never counts for the second (T3). - Final message: `<member> is stopped: its host ran without Martha's relay twice (no report of the session's start within <n> s, on the first start and on the restart), so it was not started again`. When the trust-answer deadline applied, the hint "start the member again and answer it" is appended, as the old message had it. - `whenTheMemberStops` takes a restart. A host that exits on an asked restart loses only its own group. Everything the launch made is removed once, at the final stop (T6). The first host's launcher-end handlers stay on through the second start. - `hearHostStart(pid)` on the launch: a test hook, like `hearSessionStart`, so a test counts starts where the launcher makes them. **Tests** (fake host `fakeClaudeThatCountsItsStarts`) - never reports → exactly 2 starts, the message, args/env/socket equal on both starts (T4), relay root empty - reports on the restart → runs on past two deadlines; `stop` reaches the restarted host - stopped for another reason → 1 start, no restart (T2) - unit (`keep_the_backstop_of_a_launch.node-test.ts`): a report before `anew` never counts for the next start (T3) - The existing owner's-terminal deadline tests pass with the restart on a real pty **Mutants (each killed by its named test)**: restart on every miss, stop path removed, restart on any stop, reported carried over. **Residual / notes** - The second start goes through `startedMember` again, so the mesh-server config is placed into the snapshot again from the same approved bytes. Nothing is re-read from the owner. - `MemberStarted.pid` stays the first start's pid. `stop` and `stopped` follow the restarted host. - The ungated window can be up to two deadlines (T5, accepted by the ruling). The message says so. Refs #180, #171, #104. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The backstop's miss (#104) no longer stops the member at once: the launch kills the host's group, awaits its exit and
starts it again on the same `starting`, relay and snapshot. A second miss stops it with a plain message; a stop for any
other reason wins and is never turned into a restart; a second start that fails stops it with its own refusal. Each
start is judged by a backstop of its own, so a report of the first start never counts for the second.

Refs #180 (threat model: comment 4598, T1-T7).
martha#180 r=0: the launcher counts its own starts of the host, so a second start killed at once is still counted (mutant: restart on any stop)
Some checks failed
dependency advisories / node in . (pull_request) Successful in 13s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 13s
c4 model / c4-model (pull_request) Successful in 0s
dependency advisories / node in installer (pull_request) Successful in 13s
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
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 3s
CI / links resolve (pull_request) Successful in 6s
CI / structural floor (pull_request) Successful in 26s
CI / Martha's names are its own (pull_request) Successful in 29s
CI / no import cycle (pull_request) Successful in 28s
CI / the engine drift check bites (pull_request) Successful in 40s
CI / the posted text check bites (pull_request) Successful in 15s
CI / the host drift check bites (pull_request) Successful in 1m19s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 16s
CI / workflows are valid (pull_request) Successful in 14s
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 42s
CI / the pictures change only with the version (pull_request) Successful in 21s
CI / installer (pull_request) Successful in 2m23s
CI / every check runs in a job (pull_request) Successful in 17s
CI / every job has a timeout (pull_request) Successful in 16s
CI / no literal restates a defined value (pull_request) Successful in 1m10s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 18s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 32s
CI / gate coverage (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
CI / the relay loads in the recorded host (pull_request) Has been cancelled
a25419de5c
martha#180 r=1: the owner's stop and restart follow the host the launcher started again (fable review F1), no group between the two starts, and T7 and the live launch are tested
Some checks failed
dependency advisories / node in . (pull_request) Successful in 11s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 12s
dependency advisories / node in installer (pull_request) Successful in 12s
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
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 7s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 7s
CI / structural floor (pull_request) Successful in 31s
CI / Martha's names are its own (pull_request) Successful in 30s
CI / no import cycle (pull_request) Successful in 33s
CI / the engine drift check bites (pull_request) Has been cancelled
CI / the posted text check bites (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
CI / the ring reaches the owner on the live run's tmux (pull_request) Has been cancelled
CI / workflows are valid (pull_request) Has been cancelled
CI / installer (pull_request) Has been cancelled
CI / nothing private (pull_request) Has been cancelled
CI / no test the base passed goes missing (pull_request) Has been cancelled
CI / the pictures change only with the version (pull_request) Has been cancelled
CI / no literal restates a defined value (pull_request) Has been cancelled
CI / every check runs in a job (pull_request) Has been cancelled
CI / every job has a timeout (pull_request) Has been cancelled
CI / the host drift check bites (pull_request) Has been cancelled
CI / gate coverage (pull_request) Has been cancelled
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Has been cancelled
standalone / the pinned Node is nodejs.org's (pull_request) Has been cancelled
CI / the relay loads in the recorded host (pull_request) Has been cancelled
77d7181b49
martha#180 r=2: a stop or restart asked of either host of the launch reaches it (fable verify R1), and two nits folded
Some checks failed
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 12s
dependency advisories / node in installer (pull_request) Successful in 10s
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
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 / gate coverage (pull_request) Has been cancelled
CI / structural floor (pull_request) Has been cancelled
CI / Martha's names are its own (pull_request) Has been cancelled
CI / no import cycle (pull_request) Has been cancelled
CI / the relay loads in the recorded host (pull_request) Has been cancelled
CI / the host drift check bites (pull_request) Has been cancelled
CI / the engine drift check bites (pull_request) Has been cancelled
CI / the posted text check bites (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
CI / the ring reaches the owner on the live run's tmux (pull_request) Has been cancelled
CI / workflows are valid (pull_request) Has been cancelled
CI / installer (pull_request) Has been cancelled
CI / nothing private (pull_request) Has been cancelled
CI / no test the base passed goes missing (pull_request) Has been cancelled
CI / the pictures change only with the version (pull_request) Has been cancelled
CI / no literal restates a defined value (pull_request) Has been cancelled
CI / every check runs in a job (pull_request) Has been cancelled
CI / every job has a timeout (pull_request) Has been cancelled
CI / links resolve (pull_request) Has been cancelled
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Has been cancelled
standalone / the pinned Node is nodejs.org's (pull_request) Has been cancelled
a21cc70452
martha#180 r=3: a restarted host that exits on its own before its deadline is not started a third time (fable verdict F4, mutant on asked = false), T6 asserted there, and test 2's deadline widened (F10)
Some checks failed
dependency advisories / node in . (pull_request) Successful in 9s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 12s
dependency advisories / node in installer (pull_request) Successful in 11s
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
dependency advisories / advisories (pull_request) Successful in 0s
dependency advisories / node in . (container) (pull_request) Has been skipped
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 24s
CI / Martha's names are its own (pull_request) Successful in 26s
CI / no import cycle (pull_request) Successful in 25s
CI / the host drift check bites (pull_request) Successful in 56s
CI / the posted text check bites (pull_request) Successful in 12s
CI / the engine drift check bites (pull_request) Successful in 25s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 12s
CI / workflows are valid (pull_request) Successful in 11s
CI / installer (pull_request) Successful in 2m4s
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 32s
CI / the pictures change only with the version (pull_request) Successful in 19s
CI / no literal restates a defined value (pull_request) Successful in 56s
CI / every check runs in a job (pull_request) Successful in 15s
CI / every job has a timeout (pull_request) Successful in 16s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 16s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 29s
CI / the relay loads in the recorded host (pull_request) Successful in 22m44s
CI / the clean-install proof removes its container (pull_request) Failing after 21m8s
CI / gate coverage (pull_request) Failing after 22m48s
7c43da0a27
Merge remote-tracking branch 'origin/main' into saturnus/180-restart-once
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
dependency advisories / node in installer (pull_request) Successful in 9s
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 6s
dependency advisories / node in . (pull_request) Successful in 14s
c4 model / c4-model (pull_request) Successful in 0s
dependency advisories / advisories (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 4s
CI / structural floor (pull_request) Successful in 25s
CI / Martha's names are its own (pull_request) Successful in 23s
CI / no import cycle (pull_request) Successful in 31s
CI / the posted text check bites (pull_request) Successful in 12s
CI / the engine drift check bites (pull_request) Successful in 25s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 10s
CI / workflows are valid (pull_request) Successful in 9s
CI / the host drift check bites (pull_request) Successful in 59s
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 34s
CI / the pictures change only with the version (pull_request) Successful in 16s
CI / no literal restates a defined value (pull_request) Successful in 55s
CI / installer (pull_request) Successful in 2m9s
CI / every job has a timeout (pull_request) Successful in 13s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 28s
CI / every check runs in a job (pull_request) Successful in 15s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 14s
CI / the relay loads in the recorded host (pull_request) Successful in 15m28s
CI / the clean-install proof removes its container (pull_request) Successful in 22m12s
CI / gate coverage (pull_request) Successful in 18m14s
c33d1ce09c
terra manually merged commit 9985cba310 into main 2026-11-25 15:04:18 +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!185
No description provided.