martha#180: a host whose relay did not report its start is started again once, then stopped #185
Loading…
Reference in a new issue
No description provided.
Delete branch "saturnus/180-restart-once"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.theOneRestartkills the host's group, andwhenTheMemberStopsawaits that host's exit. Only then is the host started again bytheSecondStart, on the samestartingand 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).<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.whenTheMemberStopstakes 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, likehearSessionStart, so a test counts starts where the launcher makes them.Tests (fake host
fakeClaudeThatCountsItsStarts)stopreaches the restarted hostkeep_the_backstop_of_a_launch.node-test.ts): a report beforeanewnever counts for the next start (T3)Mutants (each killed by its named test): restart on every miss, stop path removed, restart on any stop, reported carried over.
Residual / notes
startedMemberagain, so the mesh-server config is placed into the snapshot again from the same approved bytes. Nothing is re-read from the owner.MemberStarted.pidstays the first start's pid.stopandstoppedfollow the restarted host.Refs #180, #171, #104.
🤖 Generated with Claude Code