Repository navigation
feat(pi): add persistent multi-brain supervision branch - #13
Merged
Merged
Conversation
* wip: forked supervision on Pi (checkpoint before docs) * fix(pi-branch): harden mirror delivery, fallback encoding, and session replacement Peek-then-shift mirror flush so a failed append retries instead of dropping; durable mirror cursor commits only after delivery into the branch; the main fallback wake is operational-encoded like every watcher injection; session_shutdown quiesces the generation and session_start re-arms, so /new and /resume no longer kill the branch permanently. Registers the extension in the strict typecheck, adds the dispatch handshake test, the branch extension suite, the bash-level regression suite, the session-start replay test, and the opt-in real-SDK live guard. * test(fixtures): carry the branch-dispatch lib and lease lib into isolated fixtures The watcher extension now imports lib/fm-branch-dispatch.ts and fm-teardown sources fm-lease-lib.sh, so every fixture that copies or symlinks those files in isolation gains the new sibling. * no-mistakes(review): Prevent shutdown wake loss and serialize lease claims * no-mistakes(review): Durably hand off wakes and retain portable leases * no-mistakes(review): Require durable reports and clear disposed branch leases * no-mistakes(review): Enforce per-wake outcomes and quiescent lease cleanup * no-mistakes(review): Require wake acknowledgements and tighten branch lifecycle boundaries * no-mistakes(review): Require complete acknowledgements and replay cleanup failures * no-mistakes(review): Bind supervision to lock ownership and durable delivery * no-mistakes(review): Activate branch lazily after session lock acquisition * no-mistakes(review): Preserve undelivered mirror context across extension rebinds * no-mistakes(review): Acknowledge startup replay only after main delivery * no-mistakes(review): Isolate replay metadata from untrusted digest content * no-mistakes(review): Reject duplicate reports for active wake sequences * no-mistakes(review): Retain failed fallbacks and deduplicate outcome replay * no-mistakes(review): Deduplicate durable outcomes and cache delivery receipts * no-mistakes(review): Anchor wake sequence matching to outcome fields * no-mistakes(document): Clarify Pi supervision durability contracts * no-mistakes(lint): Fix ShellCheck issues in branch supervision scripts * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * refactor(pi-branch): collapse to confused-agent-grade guards per captain decision Captain decision A: the lease/actor guards target the CONFUSED-AGENT threat model bin/fm-gate-refuse-lib.sh already documents; adversarial-grade separation is impossible in the shared-process design and is filed as separate follow-up work. Rip out the machinery that chased it: the generation fence and shell-provenance markers, the wrapper-tagged ancestry walks, guard auto-claim with per-script release traps, the pending-wake files and ack-receipt correlation (the durable wake queue already re-presents anything unacknowledged), the delivery-receipt store with contiguous cursor advancement, the session-start replay-metadata channel, and the branch tool quiescence counters. Keep the behaviors the board requires, each on its simplest implementation: lazy per-action session-lock ownership (cold start activates after the lock lands; a secondary session stays inert), mirror durability across extension rebinds via the durable cursor, replay-exactly-once from the one read cursor, the awaited operational-encoded fallback, per-generation stray-lease cleanup, session-lock-bound lease liveness (a recycled pid or a non-Pi home never honors a leftover lease), the loud accidental-override guards (readonly actor prelude, cross-actor claim refusal), and the role-partition refinements (no forced teardown, no direct relaunch for the branch). Default-on-for-Pi is unchanged. * no-mistakes(review): Enforce lock ownership and serialize lease mutations * no-mistakes(review): Synchronize guard cleanup and bind leases to lock owner * no-mistakes(review): Report outcomes before acknowledging durable wakes * no-mistakes(review): Restrict leases to Pi and instruct main claims * no-mistakes(review): Reject malformed lease locks and torn outcome tails * no-mistakes(review): Validate complete outcome tails before appending * no-mistakes(review): Guard branch side effects across session replacements * no-mistakes(document): Update Pi supervision durability and lease documentation * no-mistakes(lint): Suppress intentional nested-shell expansion warning * no-mistakes: apply CI fixes * fix(pi-branch): authorize lease releases by caller * fix(lint): break redundant source-analysis path in fm-lease-lib.sh fm-lease-lib.sh's lazy fallback source of fm-wake-lib.sh gave ShellCheck's --external-sources traversal a second path into an already 1540-line file that fm-send.sh and fm-teardown.sh also source directly, blowing up the recursive analysis past CI's lint timeout. Mark it a source=/dev/null analysis boundary, matching the existing fm-task-inbox-lib.sh convention. Also restores bin/fm-lint.sh and tests/fm-lint.test.sh to the shared serial-lint definition (dropping an unrelated parallel-sharding change that was itself hanging and masked this root cause). * no-mistakes(document): Correct lease caller-authorization documentation * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes (cherry picked from commit 7b88520)
… icon (kunchenguid#2934) * style(pi): restyle supervision merge notes with a sailboat and matching pad Secondary-session notes were flush against the TUI edge and fully tinted. Use the sailboat prefix, Pi's default outputPad, boat-only color, and dim remainder so they sit like real messages. * style(pi): distinguish routine and captain merge notes by icon only Visible notes now lead with a sailboat or anchor, then only the dim outcome. Drop the branch-merged wording and verdict brackets so the icon is the only kind signal. (cherry picked from commit 52ff62e)
kunchenguid#2858) Cherry-picking 7b88520/8fa0505 alone silently dropped their prerequisite content: confirmHandlingDelivery()/WithRetry() and the owner.restoring re-entrancy guard were introduced by 3f03533 (fix: bound recovery announcements and preserve supervision, kunchenguid#2733), which landed on kunchenguid/firstmate main before 7b88520 and was therefore absent from each later commit's own diff. tsc caught the missing confirmHandlingDelivery reference; manually reconstructed to match origin/main's current file (now byte-identical for .pi/extensions/fm-primary-pi-watch.ts). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016KZ15GDC21fsLKVtsXnkLJ
…id#2733) * fix(watch): announce recovery once per generation and keep successors supervising A lost Pi/OpenCode handling handshake re-announced the same recovery generation on every cycle and spent the successor's first ~55s blind, so a real crew event could be ignored and then dropped. Record the announcement in the durable marker, confirm the handshake before the follow-up without swallowing failure, and enter the poll loop immediately. * no-mistakes(review): Tighten recovery event timing regression * no-mistakes(document): Document recovery-loop supervision guarantees (cherry picked from commit 3f03533)
Corrections found during PR #9's recovery onto current main: - Fix the real CI failure. The multi-brain feature roughly doubled the portable-serial lane's total weight (2.19M ms vs the 1.14M ms baseline the sharding was designed around) without a matching shard-count increase, silently compressing the CI job timeout's intended ~3x hang-tripwire margin to under 2x. "Behavior portable serial 4" was cancelled at almost exactly the 15-minute job boundary on both PR #9 CI attempts, mid-script, not inside any single hanging test - a margin failure, not a hang. Raise PORTABLE_SERIAL_SHARDS 4 -> 8, restoring each shard to ~273s (comfortably >3x under the unchanged 900s cap); docs/fm-test-portable-shards.md and the CI workflow comment carry the corrected numbers. - Fix the outcome-cursor defect. bin/fm-branch-outcome.sh's read cursor is one monotonic sequence number, not a per-row acknowledgement, so a bare "mark-read --through N" could silently bury a lower-seq row still unread (a prior merge that lost lock ownership after appending but before sending, or after sending but before the cursor advanced). mergeIntoMain now redelivers every such stale row, in order, before delivering its own outcome and only then advances the cursor past everything it actually delivered. - Fix misleading merge-failure reporting. A merge that sent its note but then lost lock ownership before the cursor advance used to report "merge refused" to the calling agent - false, since the note had already reached main - which could prompt a duplicate re-report. mergeIntoMain now returns delivered/cursorAdvanced separately so the fm_branch_report tool only ever reports true refusal when nothing was sent. Regression coverage: two new tests in tests/fm-pi-branch-extension.test.sh (stale-unread redelivery, cursor-advance-failure reporting). Preserves PR #9's 6 cherry-picked commits (persistent Pi supervision branch, its follow-up fixes, docs, and tests) reconstructed onto current verbagem/main rather than the stale 3d8426c base, with the tests/fm-pi- watch-extension.test.sh and .pi/extensions/fm-primary-pi-watch.ts merge conflicts resolved by keeping both sides' independently-added tests and functions rather than picking one. Verified: strict Pi extension typecheck, fm-pi-branch-extension.test.sh (15/15 incl. new), fm-branch-supervision.test.sh (14/14), fm-pi-watch-extension.test.sh (36/36), fm-test-run.test.sh (portable shard coverage/partition), fm-shared-captain-inheritance.test.sh, fm-calm-pi-extension.test.sh, fm-watcher-lock.test.sh, fm-session-start.test.sh, fm-spawn-*.test.sh, fm-send-*.test.sh, fm-control-relaunch.test.sh, fm-wake-queue.test.sh, shellcheck + actionlint. Superseded: #9
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.
Intent
Recover the fully built multi-brain Pi supervision feature from PR #9 (#9, branch fm/firstmate-pi-multibrain-fork-reconcile-5834) into a clean, current, no-mistakes-certified replacement PR against verbagem/firstmate:main. PR #9 was opened outside no-mistakes (expected provenance-check failure) and had one real CI failure: 'Behavior portable serial 4' was cancelled by GitHub Actions at the 15-minute job timeout on both its CI attempts, mid-script in an unrelated pre-existing test, not inside any hang. Root cause: the multi-brain feature's new tests roughly doubled the portable-serial lane's real total weight (measured 2,187,781ms across 120 scripts vs. the 1,143,762ms baseline the 4-shard/15-minute-timeout design was sized around, per docs/fm-test-portable-shards.md) without a matching shard-count increase, silently compressing the documented ~3x hang-tripwire margin to under 2x. Fix applied: raised PORTABLE_SERIAL_SHARDS 4->8 in bin/fm-test-run.sh, matched .github/workflows/ci.yml's matrix, corrected docs/fm-test-portable-shards.md's shard table and Timeouts section with real current numbers; verified via bin/fm-test-run.sh --check-coverage (serial_shards=8) and the same bin-packing algorithm CI runs (each of 8 shards balances to ~273s, restoring >3x margin under the unchanged 900s cap). Two additional correctness defects were found during review of the reconciled branch's outcome-delivery code (.pi/extensions/fm-branch-supervision.ts) and fixed with regression tests in tests/fm-pi-branch-extension.test.sh: (1) an outcome-cursor defect where the durable outcome store's single monotonic read cursor could silently bury an undelivered lower-sequence outcome when a later outcome was delivered and its cursor advanced past it - fixed by having mergeIntoMain redeliver every still-unread lower-seq row (in order) before advancing the cursor, preserving ordering and at-least-once delivery without a parallel store; (2) misleading merge-failure reporting where a note that sent successfully but then lost lock ownership before the cursor-advance step was reported to the calling agent as 'merge refused', which could prompt a false duplicate re-report - fixed by having mergeIntoMain return delivered/cursorAdvanced separately so only a truly-undelivered note is ever reported as refused. The task required reconstructing PR #9's exact 6-commit range (feat: add persistent Pi supervision branch kunchenguid#2858; style: distinguish routine and captain supervision merge notes by icon kunchenguid#2934; docs: add the approved multi-brain architecture poster kunchenguid#2938; feat(pi): default branch supervision and route heartbeats kunchenguid#2939; fix(pi-watch): restore confirm-before-send handling delivery, prereq of kunchenguid#2858; fix: bound recovery announcements and preserve supervision kunchenguid#2733) from the remote PR branch onto CURRENT verbagem/main (which had advanced 4 commits past PR #9's stale 3d8426c base) rather than PR #9's own base, explicitly excluding unrelated Kun Chen/kunchenguid upstream drift, and preserving every fork-specific change already on current main. This produced 3 real merge conflicts (tests/fm-pi-watch-extension.test.sh, .pi/extensions/fm-primary-pi-watch.ts, docs/watcher-continuity.md), each a genuine case of both current main and PR #9 independently adding different new tests/functions/paragraphs at the same anchor point; resolved by keeping BOTH sides' additions in full rather than picking one, verified by every downstream test exercising that code passing (fm-pi-watch-extension.test.sh 36/36, fm-pi-branch-extension.test.sh 15/15 incl. the 2 new tests, fm-branch-supervision.test.sh 14/14, strict Pi/pi-signed extension typecheck). kunchenguid/firstmate was read-only evidence throughout (fetched, never pushed to, never modified). The old worker's endpoint and its preserved active validation run/local copy at a separate worktree were left completely untouched per instruction - this is a fresh worktree and fresh branch. Do not merge this PR; leave PR #9 open for firstmate to retire after this replacement lands. The replacement PR body must link PR #9 as preserved/superseded evidence, explain the real CI root cause and both correctness fixes, and include complete final-head validation evidence - this commit message on b5d1675 already carries that full content and should be reused/adapted for the PR body. Disclosed, not silently omitted: fm-watch-arm.test.sh's one pre-existing failure and fm-pr-check-security.test.sh's local-machine-only timing flakiness both reproduce identically on an unmodified origin/main baseline in an isolated worktree - confirmed pre-existing, out of scope, not asserted as fixed.
What Changed
.pi/extensions/fm-branch-supervision.tsextension pluslib/fm-branch-dispatch.ts,bin/fm-branch-prompt.sh,bin/fm-branch-outcome.sh, and a lease layer (bin/fm-lease.sh,bin/fm-lease-lib.sh); branch supervision becomes the default and heartbeats route through it, routine vs. captain merge notes are distinguished by icon, andfm-primary-pi-watch.ts, the watch/wake/send/spawn/teardown scripts, and the OpenCode watch-arm plugin are wired to the new path. Recovery announcements are now bounded so a recovery loop cannot preserve-then-spam supervision.fm-branch-supervision.ts: the durable outcome store's single monotonic read cursor could bury an undelivered lower-sequence outcome once a later one advanced the cursor —mergeIntoMainnow redelivers every still-unread lower-seq row in order before advancing, and leaves the cursor unadvanced when redelivery is unproven; and it now returnsdelivered/cursorAdvancedseparately so a note that sent but then lost lock ownership is no longer misreported to the calling agent as "merge refused".PORTABLE_SERIAL_SHARDS4 → 8 inbin/fm-test-run.shand matches thetests-portable-serialmatrix in.github/workflows/ci.yml, because the new suites roughly doubled the lane's measured serial weight and had compressed the 15-minute job timeout's intended ~3x hang-tripwire margin to under 2x;docs/fm-test-portable-shards.mdshard table and Timeouts section were corrected with the current measurements. New/expanded coverage lands intests/fm-pi-branch-extension.test.sh,fm-branch-supervision.test.sh,fm-watch-recovery-loop.test.sh,fm-pi-branch-live-e2e.test.sh, andfm-pi-watch-extension.test.sh, alongside new docs (docs/pi-supervision-branch.md, architecture poster, configuration/scripts/supervision-protocol updates).Risk Assessment
Testing
I validated the intent's three claims directly rather than by suite pass counts. For the CI root cause I re-ran the runner's own bin-packing partitioner at both shard counts and summed each shard against the unchanged 900s job cap: the 4-shard config balances to 547s per shard (1.65x margin, matching the intent's "under 2x" compression) and the 8-shard config to ~273.4s (3.29x) — so the artifact demonstrates the hang-tripwire margin restored to over 3x, not a reproduced job cancellation, and it independently reproduces the doc's 2187781 ms total and its per-shard table exactly. I also confirmed the 8 shards partition the 120-script serial lane completely and disjointly, that ci.yml's matrix resolves to exactly those 8 lanes, and that a stale 4-shard lane is refused loudly. For the two correctness fixes I produced fail-before/pass-after across two separate parent states (reverting only the extension file, tests held at HEAD) and, more usefully, a transcript of what the captain's main session actually receives: before the fix a single note is delivered while the undelivered lower-sequence row's unread count silently drops to zero, after the fix both notes arrive in sequence order. The conflict resolution's "kept both sides" claim is backed by a superset check showing no test, function, or doc heading from current main was dropped (32 → 38 tests in the pi-watch suite), with that suite plus fm-branch-supervision and fm-pi-branch-extension all green. The disclosed fm-watch-arm failure did not reproduce at HEAD or on a clean fbcd994 baseline, so it is not caused by this change; fm-pr-check-security ran past a 10-minute local budget and is flagged as the one unverified disclosure. The worktree is clean — all revert experiments were restored and transient files removed.
Evidence: Portable-serial shard margin: 4 shards (1.65x) vs 8 shards (3.29x) against the 900s CI cap
Source: Portable-serial shard margin: 4 shards (1.65x) vs 8 shards (3.29x) against the 900s CI cap
== BEFORE: PORTABLE_SERIAL_SHARDS=4 (the config PR #9's CI ran) == shard scripts weight_ms weight_s margin 1/4 28 546952 547.0 1.65x 2/4 32 546943 546.9 1.65x 3/4 30 546950 547.0 1.65x 4/4 30 546936 546.9 1.65x == AFTER: PORTABLE_SERIAL_SHARDS=8 (this change) == 1/8 7 273925 273.9 3.29x 2/8 13 273422 273.4 3.29x 3/8 17 273405 273.4 3.29x 4/8 17 273413 273.4 3.29x 5/8 14 273396 273.4 3.29x 6/8 16 273406 273.4 3.29x 7/8 19 273413 273.4 3.29x 8/8 17 273401 273.4 3.29xEvidence: Merge notes actually delivered to the captain's main session, before vs after the outcome-cursor fix
Source: Merge notes actually delivered to the captain's main session, before vs after the outcome-cursor fix
BEFORE the fix (extension at 24aa62f): unread rows before the merge: 1 notes actually delivered into the main session: 1 [1] ⛵ task-fresh: opened PR #12, checks green still-unread rows after the merge: 0 <- the earlier row was buried, never delivered AFTER the fix (HEAD 31fb75f): unread rows before the merge: 1 notes actually delivered into the main session: 2 [1] ⛵ task-stale: rebased onto main, checks green [2] ⛵ task-fresh: opened PR #12, checks green still-unread rows after the merge: 0Evidence: Fail-before / pass-after across both fix commits' parents
Source: Fail-before / pass-after across both fix commits' parents
== BEFORE fix b5d1675 (extension restored from parent 24aa62f) == not ok - an undelivered lower-sequence outcome must be redelivered, not buried == BEFORE fix 31fb75f (extension restored from parent b5d1675) == ok - an earlier undelivered outcome is redelivered ahead of a later merged outcome ok - a delivered outcome whose read-cursor advance fails is reported as delivered, not refused not ok - a failed unread enumeration must leave the cursor untouched == AT HEAD (31fb75f) == 16/16 okEvidence: Isolated merge-refusal regression (test run alone)
Source: Isolated merge-refusal regression (test run alone)
Evidence: CI shard partition: complete, disjoint, matrix-consistent
Source: CI shard partition: complete, disjoint, matrix-consistent
ci.yml jobs.tests-portable-serial: matrix.shard=[1,2,3,4,5,6,7,8] timeout-minutes=15 full portable-serial lane scripts: 120 union over the CI matrix shards: 120 duplicates: 0 dropped by sharding: none RESULT: complete and disjoint - no test is dropped or run twice fm-test-run: lane 'portable-serial-1of4' asks for 4 portable serial shards but this runner is configured for 8 FM_TEST_COVERAGE ok total=156 parallel=24 serial=120 serial_shards=8 herdr=12Evidence: Conflict resolution kept both sides (no test/function/heading lost)
Source: Conflict resolution kept both sides (no test/function/heading lost)
tests/fm-pi-watch-extension.test.sh - test function names base(fbcd994)=32 head=38 lost=0 .pi/extensions/fm-primary-pi-watch.ts - top-level functions base(fbcd994)=13 head=13 lost=0 docs/watcher-continuity.md - section headings base(fbcd994)=7 head=7 lost=0Evidence: Disclosed pre-existing failures vs an unmodified fbcd994 baseline
Source: Disclosed pre-existing failures vs an unmodified fbcd994 baseline
tests/fm-watch-arm.test.sh @ HEAD (31fb75f) exit=0 ok=14 not-ok=0 tests/fm-watch-arm.test.sh @ fbcd994 baseline exit=0 ok=14 not-ok=0 tests/fm-pr-check-security.test.sh @ HEAD exceeded a 10-minute local budget; not re-run on baselineEvidence: tests/fm-branch-supervision.test.sh full log (14/14)
Source: tests/fm-branch-supervision.test.sh full log (14/14)
Evidence: tests/fm-pi-watch-extension.test.sh full log (38/38)
Source: tests/fm-pi-watch-extension.test.sh full log (38/38)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
.pi/extensions/fm-branch-supervision.ts:399- mergeIntoMain discards deliverStaleUnreadBelow's return value and advances the read cursor unconditionally, so the buried-outcome defect the commit claims to durably fix is still reachable. deliverStaleUnreadBelow returns 0 without delivering anything on two early exits (line 345:if (!unread.ok || !unread.stdout) return 0;) and silently skips any row it cannot JSON.parse or whose seq is not an integer (lines 350-356). mergeIntoMain ignores all of that and runsmark-read --through numericSeqat line 403 whenever seq is numeric, violating the invariant its own comment states at line 341 ("the cursor is only ever advanced over rows this call actually delivered"). Concrete failing sequence: seq 5 is durably appended but never delivered (a prior merge lost lock ownership after append, per the commit's own scenario); the branch then reports a new outcome, appended as seq 6; theunreadinvocation fails (spawnSync error, unreadable/missing state dir, or a non-zero exit from fm-branch-outcome.sh underset -eu) so runOutcomeScript returns ok:false; deliverStaleUnreadBelow returns 0 having delivered nothing; mergeIntoMain delivers only seq 6 and then advances the cursor to 6 — seq 5 is now marked read and will never be redelivered by a later merge or by startup-replay. Note also that the!unread.stdoutbranch cannot mean "nothing to redeliver" in practice: the row at numericSeq was just appended and sits above the cursor, so a healthyunreadalways emits at least that line — empty stdout likewise means enumeration is broken. Earliest supported boundary: have deliverStaleUnreadBelow signal enumeration failure (or incomplete redelivery) back to mergeIntoMain and return {delivered: true, cursorAdvanced: false} instead of calling mark-read. No call-site change is needed — the fm_branch_report handler at lines 466-476 already reports that state correctly as delivered-but-will-resurface.🔧 Fix: keep outcome cursor unadvanced when redelivery unproven
2 infos still open:
bin/fm-test-run.sh:428- The restored ~3x hang-tripwire margin is computed from weight hints, and the two heaviest new portable-serial suites carry none. Only tests/fm-watch-recovery-loop.test.sh got a measured hint (80000). tests/fm-pi-branch-extension.test.sh (1321 lines, ~18 node-driver tests) and tests/fm-branch-supervision.test.sh (548 lines) fall back to PORTABLE_SERIAL_DEFAULT_WEIGHT_MS=20000, and tests/fm-pi-branch-live-e2e.test.sh does too (its sibling fm-pi-primary-live-e2e is hinted at 19ms). I reproduced the documented partition exactly (shards 273925/273422/273405/273413/273396/273406/273413/273401 ms, total 2187781 ms, 120 scripts), so the arithmetic in docs/fm-test-portable-shards.md is correct - but the inputs for the newest scripts are estimates, which is the same class of under-estimation that compressed the margin in the first place. Doubling the shard count halves real per-shard load regardless of hint error, so this is a balance risk rather than a total-weight risk. Refresh the hints from the next fm-test-timing-portable-serial artifact per the procedure the doc already states..pi/extensions/fm-branch-supervision.ts:347- deliverStaleUnreadBelow's new return shape carries maxDelivered, but the only caller (mergeIntoMain, line 404) reads just stale.ok - the cursor is advanced with String(numericSeq), never with maxDelivered. The field is therefore inert. It was explicitly requested in the fix instruction and documents the walk's progress for a future partial-advance policy, so leaving it is fine; noting it only so a later reader does not assume it feeds the cursor decision.tests/fm-pr-check-security.test.sh- tests/fm-pr-check-security.test.sh exceeded a 10-minute local wall-clock budget and was stopped, so I could not compare it against the fbcd994 baseline. The test file itself is unchanged by this range and docs/fm-test-portable-shards.md records it as the longest portable-serial script (199573 ms), which is consistent with the author's disclosure of local-machine-only timing flakiness. Remote CI owns confirmation of this lane.bash tests/fm-pi-branch-extension.test.sh— 16/16 at HEAD, including the three outcome-delivery regressionsFail-before/pass-after:git checkout 24aa62f -- .pi/extensions/fm-branch-supervision.ts(tests-at-HEAD) → redelivery test fails;git checkout b5d1675 -- …→ cursor-enumeration test fails; HEAD → all passIsolated run oftest_cursor_advance_failure_is_not_reported_as_refusalat 24aa62f (fails) vs HEAD (passes)Node driver over the test's real extension fixture capturingsentToMainnote contents for a stale-then-fresh routine merge and a captain-verdict merge, before vs after the fixbin/fm-test-run.sh --list --lane portable-serial-{1..8}of8weight-summed against the 900s cap, vs the same runner with PORTABLE_SERIAL_SHARDS=4 overportable-serial-{1..4}of4Semantic parse of.github/workflows/ci.ymljobs.tests-portable-serial(matrix.shard, timeout-minutes) plus set-equality of the 8 shards' union against--list --lane portable-serial(120 scripts, 0 duplicates, 0 drops)bin/fm-test-run.sh --list --lane portable-serial-1of4→ runner refuses a matrix built for the old shard countbin/fm-test-run.sh --check-coverage→serial_shards=8Cross-checked docs/fm-test-portable-shards.md's shard table, imbalance, total weight, and Timeouts section against the computed ground truthbash tests/fm-branch-supervision.test.sh— 14/14bash tests/fm-pi-watch-extension.test.sh— 38/38 (conflict-resolution proof)Superset check of the three conflicted files: test-function names, top-level functions, and doc headings at fbcd994 vs 31fb75f (0 lost)bash tests/fm-watch-arm.test.shat HEAD and on a cleangit archive fbcd994baseline checkout — 14/14 bothRendered docs/pi-supervision-branch-poster.svg to PNG via headless Chrome at its 1200x860 viewBox✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.