relay: a run orders its own end, and a turn start names its turn (martha#19 part two) #78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ceres/19-relay-end-written"
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 (bug): the ci.yml job "the relay loads in the recorded host" gives the same answer for the same tree on the forge runners, so a red on a PR names a fault of that PR. Its case at
an_end_on_the_recorded_host.node-test.tswaited on a beat to order its end; on task 3081 the chain (a take-up, a one-minute ceiling, two beats) slipped and the case failed by name at 184 s on a tree that changed nothing about it.What changes (martha#19 part two, option A as ruled)
turn.startand nothing a run reads carries it. The mod's report of every main turn's start reaches the launcher as a core-tool call (a_turn_started, martha#440), which the launcher answers without journalling an event — so the line that names the turn is the one the launcher notes itself, now for every main turn start where before only a turn of unnamed source had a line, and it carriesturn_id: one optional field on a line that already exists, no new kind of line (src/hear_every_turn_the_model_runs/hear_every_turn_the_model_runs.ts,src/keep_the_relays_journal/keep_the_relays_journal.ts). The launcher notes every main turn start, with the record's own words for what it added (a turn of unnamed source, a turn that took the crew message in, a turn the record already held).anEndIsDuerefuses a flow that already carries an ending, so an end written into the flow by anything but a beat was never picked up.holdTheEndTheFlowCarriesreads the member's flow just before a call's answer is taken and holds what it carries, once; the answer then hands it out (src/a_crews_tools/a_crews_tools.ts,src/answer_what_a_host_reports/answer_what_a_host_reports.ts,hold_the_end.ts+holds). martha#311's conclude rule (question.turn_id === flow.ending.turn_id) is untouched.keepTheFlow+theFlowEnding— the writers an announcement uses — then ends the tool. Nothing in the case waits on a timer to order the end; the take-up it does wait for still rides the mod's beat, sized from the chain (one beat, and one more as margin), and the silence budget is above that so the take-up can never read as a silent host. A red says which of the three things the write needs was missing: the long call open in the journal, the flow readable, or a line naming the turn.requestsCarryingrefuses an empty needle. Every request carries"", so a run given no turns to wait for completed at once; the helper moved todrive_the_recorded_host.tsand is pinned by a test.model request Infinity.The second case option A proposed is dropped by the ruling: :232 no longer exercises the beat chain, and the chain stays proved by the flow's own unit cases (
an_end_is_due.node-test.ts,the_refresh_flow_ends_a_running_turn.node-test.ts,hold_the_end.node-test.ts), not end to end at the recorded host. Recorded as comment 985 on #19. No new check.The first run on the recorded host, and what it caught
Run 2233's relay job was red on
005bfdf4(task 4322, 243 s): "no end was written into the flow while the long tool ran", with the flow present. The turn id had never reached any line — the field was onreceived(), a route no turn start takes, and the launcher's own note for a turn start existed only for a turn of unnamed source, so an owner's turn had no line at all. The test that passed for it drovereceived()with a body no turn start carries. Both are fixed above: the field is on the line the launcher notes, for every main turn start, and the test drives the route the host really takes.Proof on the exact tip
005bfdf4's code — six failures, among them "the line the launcher noted for the turn start does not name the turn" —~/.claude/sessions/ceres-19-relay/red-3.log. The earlier pass's red (crew.tools.ends.holds is not a function,holdTheEndTheFlowCarries is not a function) is inred.log.prove_the_relay_loads.shexit 0, every one of its recorded-host runs whole, this case among them ("the host ends a running turn on the launcher's order and the handover queued behind it runs", martha#311), and the other seven files green with the extra journal line in place (~/.claude/sessions/ceres-19-relay/proof-msi00.log).tsc --noEmit: 0 errors.npm run lint(the structural floor): 0 problems.check:restated-values,check:marthas-names,check:recorded-host-runs,check:no-import-cycle,check:every-check-runs-in-a-job: pass.check:privateandcheck:posted-textreach GitHub and were not run under the stop.Refs #19
r=2 (review r=1, N2 — Jupiter's finder, folded in)
The pickup refused only an end it already held, so an end whose turn had ended could be taken up again from the flow that still named it:
aTurnEndeddropped the hold, the flow kept itsendinguntilconcludeTheEndwrote the outcome (several awaits later, and never where that write is refused), and a result arriving in that gap re-held the dead turn — every call denied until the flow's ceiling expired, the answer carrying an end for a turn already over. The same window sat on the expiry path, whereanEndExpiredalso drops the hold before the flow is rewritten.The hold now remembers the turns an end was spent on (
aTurnEnded, andanEndExpired, which takes the turn from the flow at its call site) and the pickup refuses a flow that still names one; a hold for a turn makes it live again, so the same turn tried again after an expiry is a new end. Red first: two cases ofthe_refresh_flow_ends_a_running_turn.node-test.tsand two assertions ofhold_the_end.node-test.tsfail by name on7b93dfbb; four mutants (the pickup's guard gone,aTurnEndednot remembering,anEndExpirednot remembering,holdnot clearing) each die by name. N5's stale words are fixed inanswer_the_relay.ts's event table and in item 1 above. N1 is Jupiter's fix at7b93dfbb, read and passed.