Repository navigation
Conversation
|
Speaking as Kun's firstmate: thank you @kesslerio for picking up #5378. Delivering a completed startup result exactly once without waiting for another startup is a real gap. I read head What I checked:
Contract-class (mine): new-default. On main, a retained completion waits for a later startup, which #5528 chose on purpose. With this tip, the default watcher cycle runs a new recovery step, and the default supervision status gains a new "needed" reason. Those are new default-on behaviors, not a repair of an already-specified path. So this goes to Kun as merge-or-leave, not auto-merge. How this relates to #6889: #6889 (also yours) is a standing captain hold. It touches the same VISION.md, rule by rule
Two warm asks (waiting on you):
|
Live-home validation of the held-lock recovery (maintainer ask)The remaining ask was to drive the deferred startup network recovery in a real home: hold the publication or wake lock past the worker's budget, release it WITHOUT starting a new session, and show the running watcher delivering the wake once and the receipt clearing on ack. The three prior "live" rows pointed at fixture suites; this run used Environment fidelity
Scenario (controlled run)Staged with
One precision note on the ask's wording: in this design the queue row clears on ack, while the receipt - written by the watcher under the queue lock at enqueue, and committed for the consumer's own rows at ack through Full transcriptDriver phases ran as separate commands (pre-flight wait for the real stage to settle, stage, hold evidence, release + monitor, drain + ack); complete timestamped output attached. Full transcript: Out of scope observations (not defects in this change)
StatusRe-raised through no-mistakes ( |
|
Speaking as Kun's firstmate: thank you @kesslerio for the real-home trace. It covers the live ask I made on 10-21. In a real lab home with the real watcher, you held the publication lock past the worker's 8s budget, and the completion stayed on disk without being published. After the lock was released, with no new session and no operator
This is waiting on you for one thing: how this lands next to #6889 (my ask 1 from 10-21). #6889 is your other PR on the same retention path and still has a standing captain hold. Its body leaves "eventual delivery without another startup and deduplication" to #5378, which is this PR. Should this one stack after #6889, replace it, or land on its own if #6889 is left? One sentence in each body is enough, and then I'll put the two in front of Kun as a pair. The |
|
| attempt | job | window | result |
|---|---|---|---|
| 1 | 119341409963 | 16:24:57 → 16:55:15 (30m18s) | cancelled |
| 2 | 119402976713 | 18:26:45 → 18:57:04 (30m19s) | cancelled |
Attempt 1 is decisive: tests/fm-supervision-host.test.sh passed — FM_TEST_END ... exit=0 duration_ms=1692096 — consuming 28.2 of the 30 minutes. The shard had already started a sixth script when the cap hit, and its five finished members summed to 29.7 minutes. Attempt 2 ran the same file first, printed 75 ok and zero not ok, and the cap hit after its final test.
The cause is the packer's hint, not the suite. At this head bin/fm-test-run.sh carries tests/fm-supervision-host.test.sh 789123 against a measured 1,692,096 ms (2.14x under), with PORTABLE_SERIAL_SHARDS=9 and PORTABLE_SERIAL_MAX_WEIGHT_MS=1200000, so no packing keeps that shard inside the 30-minute tier.
Base comparison. On the merge-base 3847411b — which contains none of this PR's changes — run 39618934309 cancelled the same shard at the same cap: Behavior portable serial 2, 15:10:47 → 15:41:11 (30m24s), after starting tests/fm-supervision-host.test.sh at 15:11:07 and never finishing it. Its timing artifact is the only one of that run's nine lane artifacts that is missing. Head and base fail identically, at the same shard and the same file, so the diff is not the cause; the one product file it shares with the host loop, bin/fm-supervision-lib.sh, only adds a block that runs when startup-network evidence already exists, and the fixture homes here have none.
Current main already fixed this class: e92eaf01 (2026-10-26) split the supervision-host suite into four serial members, and docs/fm-test-portable-shards.md records the single file overrunning the 30-minute cap in run 39765114423. A rerun of this exact head will time out again for the same reason; a run after the conflict fix inherits the split and should be clean.
For the record, this is not the fm_lock_acquire_wait_bounded deadline race: no lock-wait deadline appears anywhere in these logs.
89220ff to
d513b2f
Compare
[Medium impact] The PR appears safe to merge; no new actionable defects remain. Reviews (4) · Last reviewed commit: "no-mistakes(document): Align docs with s..." · Reviewed by Greptile |
|
Re-raised on current Rebase. All four commits replayed onto Your ask 1 (#6889) is answered in the body: this lands on its own, carrying the eventual-delivery and deduplication layer that #6889's body leaves to #5378. It neither stacks on nor replaces #6889. Checks on this head. Local evidence on the rebased head: |
|
Speaking as Kun's firstmate: thank you @kesslerio for the clean re-raise and the clear answer on #6889. Landing this on its own, as the eventual-delivery and dedup layer #6889 leaves to #5378, is clear, and I'll present it to Kun that way. Thanks also for the serial-2 analysis. It matches what we see. At head Waiting on you for one thing: the Greptile P2 on After that, this goes to Kun as a pair with #6889. Nothing else is needed from you. VISION: One captain aligns (deduplicated, eventual delivery, no double wake). Authority aligns. Scripts own the mechanics aligns. Restart is a non-event aligns (this is the durability fix #5378 asks for). Delegation with a spine aligns (live evidence at head). Vendor aligns. Scope: Kun's call together with #6889. |
a57179f to
1ac4359
Compare
|
Speaking as Kun's firstmate: thank you @kesslerio, the retention pass is exactly what I hoped for, and moving it off the session-start path after Greptile's second note was the right call. At |
|
Speaking as Kun's firstmate: thank you @kesslerio, the full suite is green on |
|
Speaking as Kun's firstmate: thanks for the ping @kesslerio. Nothing has changed on your side. This is still waiting on Kun's decision, not on you. On the red Contract-class: new-default, unchanged. It goes to Kun as a merge-or-leave decision together with #6889. The green full run is from Nov 3 and main has moved 56 commits since. So on a merge word we'll run a fresh full suite first, and the 30-minute serial-2 fix is already in main. The bulk |
Every session start reserves a generation and retains its completion under state/.startup-network-results/<generation>/, and the wake receipt adds a second per-generation file, so a long-lived home kept one report directory per start forever - unlike the fixed set of shared files this state replaced. prune_results() now runs under the publication lock when a generation is reserved and when one settles. A generation survives while anything can still act on it: the current shared-status generation, a generation named by a queued startup-network wake row, and the newest RESULT_KEEP_UNSETTLED unsettled generations, which is the grace window for a run that died before settling. Everything else is settled or fenced by a successor, so its directory and wake receipt are removed. Malformed, incomplete, and symlinked entries are declined rather than followed or deleted. The same pass is exposed as `prune` for an operator and for the tests.
cmd_start ran the retention scan while holding the publication lock, before launching the worker, so every session start paid for a scan of whatever the home had accumulated - and each entry cost several reads plus its own awk over the whole wake queue. The detached worker now owns the pass, running it under the same publication lock once it has made or verified the reservation, so the digest that launches the stage never waits for it. One pass reads the queued generation keys once instead of once per entry, and examines at most RESULT_PRUNE_MAX entries, so a home that keeps accumulating exceptions cannot turn cleanup into its own startup tax; leftovers are picked up by the next pass.
…ee worker pruning
… in retention test
1ac4359 to
8adb8e6
Compare
|
Speaking as Kun's firstmate: thanks @kesslerio for re-raising on current main. I checked head What changed: the series is rebased onto Gates on this head:
Contract-class: new-default, unchanged. The default watcher cycle gains a recovery attempt for retained startup results without an opt-in. That makes this Kun's merge-or-leave decision, together with #6889. It is waiting on Kun's decision, not on you. Nothing more is needed from your side. |
What Changed
state/.startup-network-results/<generation>/(report, optional timings, status written last as the completion boundary) before publication, and runs a lock-free retention pass that keeps the current generation, queued generations, and a small name-only look-back window.startup-network:<generation>wakes backed bystate/.startup-network-wake-receipts/<generation>enqueue receipts, contended publication keeps the immutable completion for later recovery instead of claiming findings are readable, andrecover/prunemodes expose that path.Risk Assessment
✅ Low: Generation fencing, retained completion recovery, receipt handling, and pruning follow the approved contracts; no concrete material defects were substantiated.
Testing
Four live scenarios (late actionable delivery, late clean silence, supervision need before and after acknowledgement, and adversarial retention/starvation) were driven end-to-end against the real startup-network stage, wake queue, drain, guard, and prune in disposable lab homes with the real bootstrap probe against a stand-in
ghnetwork client; all passed. The five focused suites that cover this change also pass. No TUI harness primary was required: this change's surface is the scripted startup-network delivery path, which was exercised directly rather than only through its tests.bin/fm-startup-network.sh start/harvest/report+ realbin/fm-bootstrap.shprobe with a slow failinggh:scenario-a-harvest-midflight.txt,scenario-a-report-generation.txt, `s…recover/prune/a second drain re-enqueue nothing because the wake receipt suppresses producer replay, and the current generation's…scenario-a-drain-ack.txt(ack-through 1 + recovery generation consumed the row to 0 bytes) followed byrecover --generation,prune, seconddrainleaving the queue empty and the result director…gh: no.wake-queuefile, no receipt,clean:<generation>settled marker,scenario-b-report.txtshows(silent - no problems found)scenario-a-guard-before-drain.txt(banner +queued wakes pending, needed from the startup obligation) vs. silentbin/fm-guard.shafter ackscenario-c-before-results.txt/scenario-c-after-results.txt/scenario-c-after-receipts.txt/scenario-c-after-queue.txt; kept 1200.1.1 (queued, still readable via `scenario-c-queued-report.t…pruneruns: pass 1 deleted all three old settled results (74→10), pass 2 reached 3, pass 3 unchanged — `scenario-d-after-pass1.tx…Evidence: Consolidated live-scenario transcript (commands, outputs, lab setup, teardown)
Source: Consolidated live-scenario transcript (commands, outputs, lab setup, teardown)
Evidence: Scenario A: digest drain while the check is still running (generation-scoped pending guidance)
Source: Scenario A: digest drain while the check is still running (generation-scoped pending guidance)
Evidence: Scenario A: retained late result read via report --generation
Source: Scenario A: retained late result read via report --generation
Evidence: Scenario A: guard reports supervision needed while the startup wake is undelivered
Source: Scenario A: guard reports supervision needed while the startup wake is undelivered
Evidence: Scenario A: durable drain presents the generation-scoped startup wake
Source: Scenario A: durable drain presents the generation-scoped startup wake
Evidence: Scenario B: late clean success stays silent and readable
Source: Scenario B: late clean success stays silent and readable
Evidence: Scenario C: results and receipts after retention (current/queued/look-back kept, older removed)
Source: Scenario C: results and receipts after retention (current/queued/look-back kept, older removed)
Evidence: Scenario C: queued wake row untouched by retention
Source: Scenario C: queued wake row untouched by retention
Evidence: Scenario D: incomplete backlog drained, final look-back window only
Source: Scenario D: incomplete backlog drained, final look-back window only
Evidence: Focused startup-network suite (all assertions passed)
Source: Focused startup-network suite (all assertions passed)
Evidence: Focused wake-queue suite incl. startup receipt tests
Source: Focused wake-queue suite incl. startup receipt tests
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bin/fm-startup-network.sh start/harvest/report+ realbin/fm-bootstrap.shprobe with a slow failinggh:scenario-a-harvest-midflight.txt,scenario-a-report-generation.txt, `s…recover/prune/a second drain re-enqueue nothing because the wake receipt suppresses producer replay, and the current generation's…scenario-a-drain-ack.txt(ack-through 1 + recovery generation consumed the row to 0 bytes) followed byrecover --generation,prune, seconddrainleaving the queue empty and the result director…gh: no.wake-queuefile, no receipt,clean:<generation>settled marker,scenario-b-report.txtshows(silent - no problems found)scenario-a-guard-before-drain.txt(banner +queued wakes pending, needed from the startup obligation) vs. silentbin/fm-guard.shafter ackscenario-c-before-results.txt/scenario-c-after-results.txt/scenario-c-after-receipts.txt/scenario-c-after-queue.txt; kept 1200.1.1 (queued, still readable via `scenario-c-queued-report.t…pruneruns: pass 1 deleted all three old settled results (74→10), pass 2 reached 3, pass 3 unchanged — `scenario-d-after-pass1.tx…FM_STARTUP_NETWORK_CASES=…was avoided; ranbash tests/fm-startup-network.test.shin full (exit 0, all assertions passed)bash tests/fm-wake-queue.test.sh(exit 0)bash tests/fm-turnend-guard.test.sh(exit 0)bash tests/fm-claude-stop-autoarm.test.sh(exit 0)bash tests/fm-cursor-primary.test.sh(exit 0)Live lab A:bin/fm-startup-network.sh start --locked 0 --harvest-pid 999999999with a slow failinggh,harvest --pid 999999999mid-flight, completion, thenreport --generation,bin/fm-guard.sh,bin/fm-wake-drain.sh,--ack-through 1 --recovery-generation …,recover,prune, second drainLive lab B: slow silent-successgh, mid-flightharvest, completion,report,bin/fm-guard.shLive lab C: seeded settled/queued/incomplete/symlink/foreign result directories plus a queued startup wake row, thenbin/fm-startup-network.sh prunetwice andreport --generation 1200.1.1Live lab D: seeded 70 incomplete newer completions plus 3 older settled ones, then threebin/fm-startup-network.sh prunepassesTeardown: bothfm-lab-home.shlab homes removed withrm -rf, no fm-startup-network/fm-watch/gh fixture processes left,git status --shortcleanbin/fm-supervision-lib.sh:38- The supervision-need source inventory is still restated outside its owner: the authoritative list in bin/fm-supervision-lib.sh's header is repeated in docs/turnend-guard.md (invariant bullet and 'Supervision need' list) and in two docs/architecture.md sentences, so this branch's new startup-work input had to be added to all of them. A follow-up could reduce the guard and architecture mentions to a pointer at the owner so future inputs cannot drift between copies; it is out of scope for this phase because it restructures operator and maintainer-architecture prose beyond this change.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Issues
Closes #5378