Repository navigation
fix(loop): dual-mode supervisor notes + derive run index on read (drop the append) - #474
Merged
Merged
Conversation
…p the append) Two changes driven by the multi-worker 16x16 solve: 1. Supervisor notes are now durable (dual-mode notify). Previously the completion/failure/infra-stop reports were prompt-only pushes that wake an IDLE supervisor session; an active orchestrator (one that is polling `status` while watching workers) never drains them, so they queue up and arrive only after it goes idle. `notify_supervisor` now writes a `SupervisorNote` ledger event FIRST (durable, replayable, surfaced in the `supervisor events` projection and `describe_event`) and THEN pushes to the supervisor session. Lost/delayed pushes no longer lose the notification — the note is readable by polling even when the push is dropped or the supervisor is busy. No supervisor registered still ledgers the note (a later `supervisor register` reads it back); only the push is skipped. 2. The run index is no longer persisted (append removed). The old `write_run` appended `runs/index.jsonl` with a lockless `OpenOptions::append` per process, so N concurrent workers writing a run at once could interleave rows and drift the read model (the observed "run_index drifted — rebuilt" self-heal noise). The index is now a pure projection: writers only write the per-run JSON/MD files (each a unique, uncontended file), and readers derive the index rows via the new `run_index::load_run_index` (scans the run dir incl. archive). run-history, compaction, and retention all read through `load_run_index`; `runs index --rebuild` / `store verify --repair` remain as on-demand human inspection. The run-path `run_index_self_heal` seam is now a no-op.
huichen
enabled auto-merge (squash)
September 3, 2026 03:43
This was referenced Sep 3, 2026
huichen
added a commit
that referenced
this pull request
Sep 3, 2026
Two follow-ups to the detached-run and turn-provenance fixes: 1. Detached-run liveness check. `spawn` succeeding only means the child was created, not that it re-dispatched correctly. A mis-dispatched re-exec (e.g. the child drops a group layer and lands on an unrelated command) exits instantly with a usage error while the parent printed a fake pid and returned success. Give the child a short grace window, then bail with a pointer to the detached log when it has already exited. 2. Doc sync. The goal-level monotonic turn counter landed in #474 but the `DecisionSummary::turn` field and `record_turn_decision` docs still described the old run-local counter. Update both to the goal-level semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(loop): dual-mode supervisor notes + derive run index on read (drop the append)
Two changes driven by the multi-worker 16x16 solve:
Supervisor notes are now durable (dual-mode notify). Previously the
completion/failure/infra-stop reports were prompt-only pushes that wake an
IDLE supervisor session; an active orchestrator (one that is polling
statuswhile watching workers) never drains them, so they queue up andarrive only after it goes idle.
notify_supervisornow writes aSupervisorNoteledger event FIRST (durable, replayable, surfaced in thesupervisor eventsprojection anddescribe_event) and THEN pushes to thesupervisor session. Lost/delayed pushes no longer lose the notification —
the note is readable by polling even when the push is dropped or the
supervisor is busy. No supervisor registered still ledgers the note (a
later
supervisor registerreads it back); only the push is skipped.The run index is no longer persisted (append removed). The old
write_runappendedruns/index.jsonlwith a locklessOpenOptions::appendper process, so N concurrent workers writing a run atonce could interleave rows and drift the read model (the observed
"run_index drifted — rebuilt" self-heal noise). The index is now a pure
projection: writers only write the per-run JSON/MD files (each a unique,
uncontended file), and readers derive the index rows via the new
run_index::load_run_index(scans the run dir incl. archive). run-history,compaction, and retention all read through
load_run_index;runs index --rebuild/store verify --repairremain as on-demand human inspection.The run-path
run_index_self_healseam is now a no-op.