Repository navigation
fix: reduce routine supervision wakes in the primary conversation - #7726
arthurcruzd wants to merge 10 commits into
Conversation
A second mate's span no longer counts main's own --resolve-key close or a hold re-recorded unchanged as decision-owned, and its marked row stays main's unless a cursor-bounded span explains the mark as such a re-record. The branch prompt reports a still-holding declared wait, an answered-decision echo, an unchanged hold, and a persist reply as routine, and a cleared or unknown wait as captain.
The home summary producer folds every task's whole status stream, and on a loaded 2-vCPU host the four secondmate logs alone took ~68 s, pushing fm-home-summary-refresh.sh past its 60-second deadline on every attempt. The fold forked several command substitutions per decision line and read the open set through a here-document one byte per syscall. The fold helpers now take an optional out-var (the status_line_verb convention) so status_open_decisions runs entirely in the caller's shell, and the record drop splits the set once into an array. Output is byte-identical; the summary refresh drops from 100-115 s to 21-40 s.
An inactive-outcome check for a done worker always reached main, even when the supervision host had already reported that finished result to main as a captain outcome, so the captain heard the same ready branch twice. On the attended host, a done child's row is now the branch's, scoped to that child, when the outcome store holds a captain outcome recorded on the child's current status log at or after its last done line; the branch prompt has it confirm the result is unchanged before reporting it silent. A failed child, an uncovered done, a reconcile notice, and the Pi watcher's offer keep the close on main. The host log line for a close without a wake now keeps the arm's own line, so a run of them reads as the watcher start failure it is.
Array.prototype.findLast is outside the Pi type-check lib, so tsc rejected it; a reverse loop keeps the same result.
…remove stale duplicates
…host.test.sh: return-fail timed out at wait_until 250 (25s) on host_exited. Reproduced locally: the host was still in watcher/successor/handle_wake and only started the stub engine around 55s; the product path does hand the failed captain-return wake to main. The same 25s bound is used by the other single-turn away handoff cases and is already 2000 for the heavier siblings. Raised those host_exited waits from 250 to 2000 so they outlast 2-vCPU load without changing passing-test runtime. Focused return-fail and emptyresult both passed after the change
|
Speaking as Kun's firstmate: thanks @arthurcruzd. Echoes of decisions main already answered, re-checks of a wait that still holds, and the same finished result announced twice are exactly the noise this interface is meant to keep away from the captain. The write-up is very clear, including what you left out and why (the sleeping second mate piece waits on #7386, and the T3 thread-id piece is out too). I read the diff at head A few things before this can move:
For now this is waiting on you for the live evidence. No rush. |
… copy added by d1fc1c3) and reverted the six host_exited wait_until raises in tests/fm-supervision-host.test.sh from 2000 back to 250. The file now matches the pre-d1fc1c3c version; the two pre-existing 2000 waits (many receipts, lookup failure) were left alone. ci-1 through ci-15 are provider cancellations with no verdict, so no other files were changed. The fix push re-triggers CI
|
CI note: 18 of 19 checks pass. The one failure, Behavior portable serial 2 (job), is Every product assertion in that case passed: the poll cycle completed, no wake was sent, writing-since was recorded, and the idle timer restarted. Could a maintainer re-run the failed serial 2 job? Merging is of course your call. |
|
Speaking as Kun's firstmate: thanks @arthurcruzd. Head CI: 18 of 19 checks pass. The one red is Still open: live validation. The pipeline block still says 0 of 7 scenarios were driven live. When you can, please drive the main ones against this branch and post the evidence here, or re-raise through Contract-class: new-default (unchanged). Once the live evidence is in and CI is green, this goes to Kun as a merge-or-leave decision. For now it's waiting on you for the live evidence. No rush. |
Bring the fork's fleet branch up to upstream main, keeping the fleet-only work upstream has not merged. Upstream's explicit-only T3 Code backend (kunchenguid#7518) is the base for every T3 file; the fleet's earlier copy of that PR is superseded by it, along with its own semantic-supervision push (upstream's pending-request watch), the T3 capture, telemetry, interrupt-verdict, and launch-ownership fixes, and the Claude env-channel ownership (upstream's FM_T3CODE_ENV_KEYS). On top of it the fleet keeps: the T3-hosted primary and its wake relay (bin/fm-t3-host.sh), remote second mates on a host's T3 server, quiet and away mode and the supervision host under the relay, Grok and Muse T3 workers, exit by archive with a relaunch that resumes the same thread, restart reconciliation, the foreign-slot refusal, local-interface telemetry, and the T3 0.1.2 standard-scope sign-in. Also kept: the open contributions for supervisor noise (kunchenguid#7726), one launch-failed wake per outage (kunchenguid#7386), status-file birth times (kunchenguid#7384), the take-over watcher TERM fix (kunchenguid#6916), and the fleet-only second-mate reply-source and CI commits.
What was noisy
On the attended supervision host and the Pi supervision branch, several routine events still reached the primary conversation as if they needed attention:
fm-send --resolve-key, was counted as decision-owned, so its signal went to main even though main already held that exact decision.Separately, the home summary refresh folded every status stream with several command substitutions per line, which on a loaded 2-vCPU host pushed
fm-home-summary-refresh.shpast its 60-second deadline on every attempt.What each change does
.pi/extensions/lib/fm-branch-dispatch.ts,bin/fm-branch-prompt.sh,docs/pi-supervision-branch.md). A second mate's presented span no longer counts a needs-decision line that re-records an open decision with the same key and note, or a resolution this home appended itself (read from the existingstate/.<task>.home-appendsledger), as decision-owned. A watcher-markedneeds-decision:row from a second mate stays main's unless a cursor-bounded span explains the mark as such an unchanged re-record. The branch prompt now reports a still-holding declared wait, an answered-decision echo, an unchanged hold, and a persist reply as routine, and a cleared or unknown wait as captain.bin/fm-classify-lib.sh). The fold helpers take an optional out-var (thestatus_line_verbconvention), sostatus_open_decisionsruns in the caller's shell and the record drop splits the set once into an array. Output is byte-identical, and a newtests/fm-fork-free-helpers.test.shcase compares the whole-file fold with the per-line fold; the CI bash 3.2 lane's expected regression count moves from 6 to 7 to match.fm-branch-dispatch.ts,bin/fm-branch-prompt.sh,bin/fm-wake-drain.sh,docs/supervision-host.md,docs/pi-supervision-branch.md). On the attended host only, acheck: inactive-outcomeclose is offered to the branch when every inactive row repeats a done result already reported: a done child whose current status log has a captain outcome in the outcome store recorded at or after its lastdoneline. The row is claimed scoped to that child, and the prompt has the branch confirm nothing changed before reporting it silent. A failed child, an uncovered done, a reconcile notice, and the Pi watcher's own offer keep the close on main. The host log line for a close without a wake now keeps the arm's first line, so a run of them reads as the arm failure it is.findLast:Array.prototype.findLastis outside the Pi type-check lib, sotscrejected the previous change; a reverse loop gives the same result.bin/fm-classify-lib.shcomment,docs/pi-supervision-branch.md,docs/watcher-continuity.md): names the dispatch library as a second reader of the home-appends ledger, the re-record exception for marked rows, and the inactive-outcome report scope, and drops a stale statement that attended grants never name a check row; a follow-up pass removes duplicated routing prose those docs had restated.tests/fm-supervision-host.test.sh):test_branch_outcomes_present_a_long_away_window_onceandtest_branch_outcomes_only_on_a_host_home_off_piasserted a hard-codedrecorded 0m ago, which fails whenever building the fixture crosses a minute on a slow runner; they now accept any whole-minute age and keep their sequence, collapse, and acknowledgement checks.Left out, and why
process-event source failed to startcloses for a second mate's reply source off main, backed by a once-per-outage reannouncement after six hours so a machine that never returns still surfaces. That backstop relies on a launch-failure episode staying open through a whole outage, which is fix: suppress repeated process-event wakes during continuous outages #7386 and is not merged yet. Without it, the episode closes and reopens every few cycles, and taking those notices off main would hide a machine that never comes back. It should follow once fix: suppress repeated process-event wakes during continuous outages #7386 lands.t3_thread_id, part of the first change on the fork, depends on the T3 Code backend, which upstream does not have yet (feat(bin): add an explicit-only T3 Code runtime backend #7518), so it and its test are omitted.None of the included changes was already present on upstream main.
Validation
Passing locally, run serially:
tests/fm-branch-supervision.test.sh,tests/fm-fork-free-helpers.test.sh,tests/fm-pi-primary-types.test.sh,tests/fm-classify-decision-key.test.sh,tests/fm-classify-corr-token.test.sh,tests/fm-send-resolve-key.test.sh,bin/fm-lint.sh,bin/fm-doc-audience-check.sh, every dispatch case intests/fm-pi-branch-extension.test.sh, and the dispatch and branch-outcome cases intests/fm-supervision-host.test.sh, including the new inactive-outcome case.The same four changes have run live in production supervision on a fork since 2026-10-17/18 with the intended effect: routine echoes, wait-rechecks, and repeated inactive outcomes stay off the primary conversation.
A fresh live drive of these scenarios was not feasible on the loaded 2-vCPU machine used for this port.
On that machine, the full Pi extension and supervision-host suites hit timing failures in host-loop and delivery cases, and unmodified main failed the same way, so CI is the authority for those suites.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-procevent.sh:1645- The required fifth port is absent: intent explicitly includes “7965ee01 fix(bin): keep a sleeping second mate's reply-source launch failure off main.” The branch contains only the other four ports. bin/fm-procevent.sh:1836 still announces every unconfirmed launch through report_launch_failure at :1645, without checking whether the second mate is sleeping; bin/fm-watch.sh:2791 and :2807 surface that announcement as a check, and .pi/extensions/lib/fm-branch-dispatch.ts:834 keeps that check on main. Include the approved sleeping-secondmate suppression before delivery, or obtain an explicit scope amendment.nice -n 19 bash tests/fm-branch-supervision.test.sh— passednice -n 19 bash tests/fm-fork-free-helpers.test.sh— passednice -n 19 bash tests/fm-pi-primary-types.test.sh— passed for both Pi versionsnice -n 19 bash ~/.no-mistakes/evidence/01M5PZBASYY149HCSXDJEZM1B7/fm-pi-branch-extension-selected.sh— five dispatch cases passednice -n 19 bash ~/.no-mistakes/evidence/01M5PZBASYY149HCSXDJEZM1B7/fm-supervision-host-selected.sh— sixteen dispatch/outcome cases passed; final known timing-sensitive host-loop case timed outCaptured actual dispatch CLI responses; checkedgit status --shortand process cleanup.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
🤖 Generated with Claude Code