Repository navigation
feat: add attended supervision to the non-Pi host - #5631
Closed
kunchenguid wants to merge 55 commits into
Closed
kunchenguid wants to merge 55 commits into
kunchenguid wants to merge 55 commits into
Conversation
kunchenguid
force-pushed
the
fm/fm-supervision-host-attended-r1
branch
from
September 25, 2026 07:49
f34f758 to
1c49412
Compare
The non-Pi supervision host now takes the attended wakes the Pi branch would take, behind the same default-off config/supervision-host flag: - The Pi watcher's offer rule moves into the dispatch module (branchOfferForWake), and the host asks it through fm-branch-dispatch.mjs offer, so a close reaches main off Pi exactly when it would on Pi. - bin/fm-host-mirror.sh owns a dialog mirror that each primary's prompt and turn-end surfaces write (Claude, Codex, Grok, Cursor hooks and the OpenCode plugin); the host feeds it at the head of each wake. - A handled attended wake with a captain outcome exits with one branch-outcome line; the drain's BRANCH OUTCOMES section presents every unprocessed captain outcome until bin/fm-branch-outcome.sh mark-processed. - The Pi branch's broken-session latch and cooldown apply to the host. - /quiet enters nothing where the attended host runs. The host still adds no delivery path: its fallback is the close's own reason line through the owner's existing wake path.
…utcomes once The live Claude lab showed a finished local-only task the captain had called routine reported as routine, which left it invisible to main, the only actor that may land it while attended. The branch prompt now makes such work a captain outcome, and the drain lists routine host outcomes once for awareness, as the Pi branch's routine notes reach main's transcript without a turn.
In the live Claude lab the engine reported a rebased local-only branch as routine four times, reasoning that main already knew it would land it. The verdict rule now says that anything main must act on is a captain outcome, even when an earlier outcome told main, because a routine outcome reaches main only at its next wake.
The live Claude lab showed each host handback's rewake mirrored as captain text, because Claude submits a Stop-hook rewake through UserPromptSubmit with only its <task-notification> wrapper to tell it apart. The mirror drops a prompt that opens with that wrapper, and the live guard now drives a real rewake and fails if it is mirrored.
A supervising Codex main stays inside one turn across its foreground checkpoints, so the live Codex lab's mid-turn captain messages fired no prompt or Stop hook and never reached the mirror. Codex's hooks, now including PostToolUse, read the session's rollout transcript instead, and the live guard types a real mid-turn steer and requires it in the mirror.
The live Grok lab showed slow drains; the BRANCH OUTCOMES section made three validated store reads per main drain. The store now owns one locked present call that prints what is unread or unprocessed and advances the cursor, and the drain checks its cheap gates before it asks which harness is primary.
The live Grok lab mirrored every background-task completion notice, which Grok submits as a prompt inside <system-reminder>, as captain text. The mirror drops that wrapper too, and the live guard now runs a real Grok background task and requires its completion turn to stay out of the captain's words.
The quiet check also covered Pi, which changed /quiet on Pi homes that never opted into the supervision host. It now answers only for a home whose attended host runs, so a home without the flag behaves as before.
…y a steer check fails
… and record the final run
Its stub turns run the real drain, report, and acknowledgement, which took about 13 seconds each at a load average near 20, so a 3-second turn bound and a 20-second park failed as a fixture while the behavior held.
…mes, fix cooldown
…et-check during cooldown
…tly; drop scratch suite
…t-review re-check A later documentation pass described the removed Grok and OpenCode writers as still registered. Restore the accurate wording in the mirror header, the host doc, and the verification record, note the away-ledger line a primary without a mirror logs as follow-up, and record the live re-check of the attended, away, latch, and mirror cases after review. Move the recreated-mirror regression into the existing mirror suite, where its fixtures already live, so it no longer builds a temporary tree inside the checkout.
…their payload rows A late documentation pass again described the removed Grok and OpenCode writers as still installed. Restore the accurate wording in the mirror header, the host doc, and the verification record, and drop the Grok and OpenCode rows from the record's table of captured writer payloads, which only described writers this branch removed.
…nly named wrappers
kunchenguid
force-pushed
the
fm/fm-supervision-host-attended-r1
branch
from
September 25, 2026 08:10
1c49412 to
021853f
Compare
… directives, but the changed script has six. The test now checks that telemetry reports a positive numeric count without depending on the script’s exact contents. `bash tests/fm-lint.test.sh` passes
This was referenced Sep 25, 2026
Owner
Author
|
Superseded by a re-cut into smaller PRs from this branch's final validated tree:
The repeated-escalation fix that surfaced during this work ships separately as its own PR. Closing this one in favour of those. |
This was referenced Sep 26, 2026
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
Standing words for this AFK revamp:
Context: this task is rung 3c of the approved AFK revamp plan. Rung 3c is the attended posture and /quiet on the non-Pi supervision host: the dialog mirror writers, a BRANCH OUTCOMES section in the wake drain for unprocessed captain-verdict rows with the mark-processed acknowledgement, the broken-session latch and cooldown copied from the Pi policy, and /quiet becoming a statement that the attended host already is quiet. Rungs 3a (host core plus Claude away, #5488) and 3b (Cursor, OpenCode, omp, Grok, and Codex arm owners running the host under the flag while away, #5503) are merged on main, and 3b has a dated live-validation record.
What the approved plan says rung 3c is, in substance:
What Changed
mark-processed./quietuse the already-quiet attended posture where it is available.Risk Assessment
Testing
Targeted behavioral tests passed. Two real Claude turns completed in isolated labs, but neither produced a session lock or dialog mirror, so quiet-check correctly declined readiness and the attended host could not be exercised. No reviewer-visible artifact was captured; this CLI/TUI check yielded only transient pane and state observations.
FM_HOME="$LAB" bin/fm-afk-launch.sh quiet-checkexited 1 while the mirror was absent.Validation notes
The pipeline's own test phase could not stand up real primaries, so its live verdict above is inconclusive; live validation was driven separately on the real Claude engine and real harnesses, in disposable lab homes with
config/supervision-hostnamingclaude, each primary on its own private tmux server, with real Pi workers on a small lab repository (2026-09-24 and 2026-09-25):branch-outcome, and main drainedBRANCH OUTCOMES, landed the work, and acknowledged it withmark-processed.the away session could not take this wake: the engine turn failed; a worker finishing while away became aper your away instructionscaptain outcome that the return brief named; away wakes carry no mirror and leave its cursor alone, and after the return the next attended wake carried the away window's dialog./quietin the real primary reported the session paused with its next retry time until a probe succeeded, then recovered.quiet-checkrefuses with the engine executable missing or a malformed mirror, and the live host passed an attended wake to main withthe claude engine executable is missing.no verified dialog mirror) while away wakes run on the engine.Accepted limits (documented in
docs/supervision-host.md):branch-outcomewake is delivered, no immediate wake reaches main; the captain outcome stays durable and the next drain'sBRANCH OUTCOMESsection presents it until it is acknowledged.Pipeline steps skipped in the final validation run:
origin/main, so rebasing onto the old pushed head could only conflict and re-apply work already present.Follow-ups, not in this PR:
tests/fm-host-mirror-live-e2e.test.shshould keep the pane after a harness exits and fail at once, naming the harness and its last output, when the harness never reaches its prompt.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
Step was skipped.
✅ No issues found.
✅ No issues found.
tests/fm-afk-launch.test.sh(also retried without inherited PI_* variables; fixture detected the Pi ancestor and failed its Claude/daemon cases)bash tests/fm-host-mirror.test.shtests/fm-supervision-host.test.shbash tests/fm-branch-supervision.test.shls bin/fm-lab-home.sh(required lab-home helper absent)Live validation:⚠️ inconclusive - 1 of 5 scenarios driven live against the product
FM_HOME="$LAB" bin/fm-afk-launch.sh quiet-checkexited 1 while the mirror was absent.tests/fm-host-mirror.test.shinitially failed to execute directly (permission denied); reran withbash.bash tests/fm-host-mirror.test.sh && bash tests/fm-afk-launch.test.sh && bash tests/fm-supervision-host.test.shLaunched Claude twice in a disposable marked lab home on a private tmux socket, submitted a real prompt, inspected the pane and lab state, and ranFM_HOME="$LAB" bin/fm-afk-launch.sh quiet-check; removed each lab afterward.⏭️ **Document** - skipped
Step was skipped.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.