Repository navigation
feat: enable supervision host by default for Claude primaries - #6124
Merged
Merged
Conversation
An absent config/supervision-host on a Claude primary now reads as on with the default engine, and a file holding `off` opts any home out. Cursor, OpenCode, omp, Grok, and Codex stay file-gated, with `off` read as disabled there too. Every reader asks fm_supervision_host_enabled instead of testing the file, and non-bash readers query it through the lib's `enabled` entry. A primary's `off` is not inherited by secondmates: each home keeps its own supervision posture.
…sion host Fixtures that drive the watcher arm or assert a non-host drain now write an explicit off file, and fixtures that copy the Stop auto-arm or the supervision instructions carry the engine lib they now source. The two drain suites also stop reading the code root's config.
A host parked when the home writes off now logs that the home does not run the supervision host, rather than claiming it has no engine.
|
…h case now stops its recorded watcher and host/arm processes; fake hook sessions exit through session.stop. The full host suite passed before the final cleanup refinement, and both affected cases, bash syntax, ShellCheck, and diff checks passed afterward. CI runtime still needs confirmation
tiago-peixoto
added a commit
to tiago-peixoto/firstmate
that referenced
this pull request
Sep 29, 2026
…x idle continuity After rebasing onto kunchenguid#6124, a supervision-host file holding `off` opts a home out, and every reader asks fm_supervision_host_enabled instead of testing the file. The idle supervisor still tested the file, so an off Codex home lost idle continuity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
andrewesweet
pushed a commit
to andrewesweet/firstmate
that referenced
this pull request
Sep 30, 2026
…nguid#6124) * feat: run the supervision host by default on a Claude primary An absent config/supervision-host on a Claude primary now reads as on with the default engine, and a file holding `off` opts any home out. Cursor, OpenCode, omp, Grok, and Codex stay file-gated, with `off` read as disabled there too. Every reader asks fm_supervision_host_enabled instead of testing the file, and non-bash readers query it through the lib's `enabled` entry. A primary's `off` is not inherited by secondmates: each home keeps its own supervision posture. * test: pin the watcher-path posture in fixtures that assume no supervision host Fixtures that drive the watcher arm or assert a non-host drain now write an explicit off file, and fixtures that copy the Stop auto-arm or the supervision instructions carry the engine lib they now source. The two drain suites also stop reading the code root's config. * fix: name the opt-out when an off home passes an attended wake to main A host parked when the home writes off now logs that the home does not run the supervision host, rather than claiming it has no engine. * no-mistakes(document): Clarify Claude supervision defaults and historical evidence * no-mistakes(ci): Fixed process leaks in the two added host tests. Each case now stops its recorded watcher and host/arm processes; fake hook sessions exit through session.stop. The full host suite passed before the final cleanup refinement, and both affected cases, bash syntax, ShellCheck, and diff checks passed afterward. CI runtime still needs confirmation
RooseveltAdvisors
added a commit
to RooseveltAdvisors/firstmate
that referenced
this pull request
Sep 30, 2026
…locally, and shellcheck at warning level is clean. **Behavior portable serial 5.** The failing test was `tests/fm-remote-secondmate-lifecycle-e2e.test.sh`, which reported "the watcher did not exit on its auto-relaunch wake within the bound". This PR doesn't touch that code. The test gave the watcher a fixed 1500 × 0.02s loop, about 30 seconds, and on a busy CI runner the sleeps take longer than that. It now waits up to 120 seconds by the clock (`SECONDS + 120`). A working relaunch still exits within seconds, so only a hung watcher reaches the limit. The whole script passes locally ("ALL TESTS PASSED", about 5m46s). **Greptile Review.** - **Missing skill file:** An earlier review step in this run had changed the ship/scout launch brief in `bin/fm-dod-lib.sh` to say "if absent, continue without it". That reopened Greptile's P1: a worker on a host without `~/.agents/skills/caveman/SKILL.md` would run without `caveman full`, which breaks the requirement that every future crewmate and scout activates it. The brief now says "if absent, still apply `full` from its known rules". This keeps the short wording that review step asked for, and activation no longer depends on the file being there. `tests/fm-task-delivery.test.sh` checks this clause in the generated launch brief for each ship/scout kind; it passes, and so does `tests/fm-brief.test.sh`. - **Stale PR base on GitHub:** The newest Greptile P1s point at `bin/fm-supervision-engine-lib.sh` and `bin/fm-config-inherit-lib.sh`. Those changes come from kunchenguid#6124 and kunchenguid#6154, which are already in this branch's base commit (`c35b9a69`). GitHub still compares the PR against an older base (`b3d41332`), so Greptile reviewed code that isn't part of this change. This branch changes neither file, and those comments should go away once the PR is compared against the current base. - **Still open:** The two P1s I left alone before are unchanged. Fresh firstmate and secondmate sessions get the directive only through `data/captain-shared.md` and the session-start digest; a review step in this run deliberately removed it from `AGENTS.md`. Crewmates and scouts that are already running need a relaunch or a message through `bin/fm-send.sh` after merge, which code can't do for them. The changes are uncommitted in `tests/fm-remote-secondmate-lifecycle-e2e.test.sh`, `bin/fm-dod-lib.sh` and `tests/fm-task-delivery.test.sh`
Intent
Use an Opus crewmate to build the change that flips supervision on by default for Claude. Ship it through no-mistakes with yolo OFF; the PR waits for review and merge - never self-merge.
Scope: Claude-only flip. An absent config/supervision-host on a Claude primary reads as on with the default engine; an explicit 'off' opts out; the other five harnesses stay file-gated. Route the direct file tests through fm_supervision_host_enabled in bin/fm-supervision-engine-lib.sh (autoarm, host-mirror, supervision-instructions, afk-launch, lease-lib as listed in 3.2), invert the invariance tests, update the docs, and settle secondmate inheritance of the off opt-out. Validate the flip in a Claude-class lab with the live lab builder (#6037) - attended, away with words, /quiet, restart - and put that evidence in the PR. Out of scope: default-on for the other harnesses (3d-2), daemon retirement (3e), rollout.
Context: this is plan rung 3d-1, approved on the 2026-09-28 AFK revamp board with the answer "approve-claude-only-3d1" - the first default-on flip is Claude-only with an off opt-out, and the other harnesses stay file-gated until 3d-2. The approved design is in the audit report (sections 3.2, 3.3, 4, 7) and implementation plan (section 5). Its prerequisites have landed: quiet records treated as attended (#6064), quiet no longer holding requested actions for return (#6033), accurate latch reporting in away return briefs (#6043), and the Stop auto-arm help-mode guard. The main-home away cycle and session restart under the host have been done and worked.
Substance of the referenced audit report and plan sections:
What Changed
config/supervision-hostis absent, using the default Claude engine and model;offopts out, while the other five supported primaries remain file-gated.Risk Assessment
Testing
Targeted gate, hook, mirror, instruction, lease, and AFK checks passed; disposable CLI evidence shows Claude default-on,
off, other-harness file gating, and away entry. The real Claude lab reached its TUI but did not execute the submitted prompt, so attended, /quiet, and restart behavior lack live proof. The host and secondmate suites timed out, and the omp suite failed under the runner’s Pi ancestry.Evidence: Host gate and rendered protocol
Source: Host gate and rendered protocol
Evidence: Disposable away entry and opt-out
Source: Disposable away entry and opt-out
Evidence: Real Claude lab primary opened
Source: Real Claude lab primary opened
Live lab validation (Claude primary, no config/supervision-host)
Built with
bin/fm-live-lab.sh up --harness claude --worker --supervision-host none --expect-host yesfrom tree 86a5b31d (this branch), on a private tmux server (no Herdr), torn down withfm-live-lab.sh down(exit 0, lab root, task temps, and Claude trust entries removed,~/.treehouseunchanged).config/held onlybackend,claude-permission-mode,crew-harness,secondmate-harness,startup-memory-budgetupchecks:ok host: supervision host pid 20727;state/.supervision-hostrowhost ... fm-supervision-host.sh parkwith the watcher arm beneath it; host ledgerstart gen=host-20727-... primary=claudefm-supervision-instructions.sh --harness claudein the lab home printedSupervision host: on; it takes away-posture wakes and ... eligible attended wakes itselfandSupervision host: on for this home (config/supervision-host holding off turns it off ...)ok mirror: verified writer, check passed, captain=1 main=1(latercaptain=6 main=8)handled turn=host-20727-...1 posture=attended rc=0 ... signal: .../labdce309a6f344-worker.status, thento-main branch-outcome ... (store rows 1); main drained it through BRANCH OUTCOMES and asked the captain about landing/afkwith wordsstate/.afk-contract(words: stepping out for a bit - yes, land the lab worker's branch ...); main acted on them at entry (checked fast-forward and tests, thenfm-merge-local.sh); no away daemon process; the host kept runninghandled turn=host-62583-...2 posture=away rc=0; captain outcome held for return ("Your away words say to land it on local main, but I can't land local-only work in any posture, so it is held for your return or MAIN.")fm-afk-return.sh:away mode stopped; no daemon terminal was running;supervision ran through the away window with no detected gap; words shown verbatim;the away session took no action under them(main landed at entry, not the away session);1 captain outcome(s) escalated by the away session; catch-up clear/quietfm-afk-launch.sh quiet-check: "Quiet mode needs nothing on this home: the ordinary supervision session already handles the wakes it can while the captain is present ... no daemon and no away record are used." exit 0; no.afkor.afk-contractwritten/exitstopped main (lock pid 99166) and the host (pid 21160 gone,state/.supervision-hostremoved); relaunched with the same command, the first turn end re-armed the host under a new generation (start gen=host-389-... primary=claude, lock pid 76335, auto-arm epoch 4);fm-live-lab.sh check: primary, probe, trust, mirror, host, watcher, treehouse all ok (worker check expectedly not parked, it had finished)offrevertsoff;bash bin/fm-supervision-engine-lib.sh enabled config claudeexit 1. Next wake: ledgerpass-through attended ... signal: ...to main, host exited; the next turn end armed the plain watcher (auto-arm epoch 5, nostate/.supervision-host, no host process, healthy watcher);.host-mirror.jsonlstopped growing (14 lines before and after a main turn); rendered protocol dropped the host state line and block and names the watcher arm the Stop hook foregrounds on an opted-out homeThe lab surfaced one wording fix, included in this branch: the pass-through after
offlogged "no supervision engine"; it now names the opt-out ("the home does not run the supervision host"), covered by a new host test.This lab covers the scenario the pipeline's own test step could not drive (a real Claude primary auto-arming, handling attended and
/quietturns, and re-anchoring after restart); the Test exception recorded above was approved on this evidence.Secondmate inheritance of
offA primary's
offis not propagated to secondmates:config/supervision-hoststays outside the inherited-material set, as it already was before this change.Each home's supervision posture and engine model are its own choice (a mate may run the host on a cheaper model, or opt out, independently of its primary), and silently copying the primary's
offwould switch off supervision on a mate that never asked for it, while copying it in only one direction would leave no way to express "primary off, mate on".A mate that must stay off writes its own
off.docs/configuration.md"Supervision host" states the rule, andtests/fm-secondmate-harness.test.shcovers it.So "a secondmate inherits the explicit off" is not the accepted behavior, and there is nothing to drive live for it.
Local test notes
Targeted suites run sequentially on the author's machine passed, including the host, auto-arm, mirror, instructions, afk-launch, afk-return, session-start, turn-end guard, session-lock ancestry, drain, daemon, merge, teardown, and watcher suites.
Fixtures that drove the watcher arm or asserted a non-host drain on what is now a host-running Claude home were pinned to an explicit
off(and two drain suites no longer read the code root's config).tests/fm-watch-triage.test.shhit the local 15-minute bound with 110 cases passing; it touches no changed code (bin/fm-watch.shand the classifier do not reach the supervision-host gate).Out of scope, follow-ups: default-on for the other five harnesses (3d-2), away-daemon retirement (3e), rollout.
Host suite CI runtime: regression and fix
The first CI round cancelled
Behavior portable serial 5at its 30-minute job limit twice.No test failed, but
tests/fm-supervision-host.test.shroughly doubled: 1199905 ms and 1146839 ms here, against 556779 ms for another PR's shard 5 in the same hour.Per-case times were about 1.5x slower from the first case (runner variance), rising to 2 to 3x right after the two host cases this PR added.
Cause: those two cases leaked live processes for the rest of the suite (a parked host, two watcher cycles, and two fake main-session poll loops), not per-call overhead in
bin/.Local profiling of one slow case outside any Claude process ancestry found no code-path cost: "attended, two engine errors latch the session" ran 36.9 s on main and 38.6 s on this branch, with the same 16 harness-detection calls on both.
The pipeline's CI fix makes both cases stop everything they start (session.stop for the fake sessions, and the host and watcher pids the home recorded).
fm-supervision-host.test.shduration (shard 5)CI sharding and job timeouts are unchanged.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
tests/fm-claude-stop-autoarm.test.sh,tests/fm-host-mirror.test.sh,tests/fm-afk-launch.test.sh,tests/fm-supervision-instructions.test.sh,tests/fm-branch-supervision.test.sh,tests/fm-cursor-primary.test.sh, andtests/fm-watch-checkpoint.test.shtests/fm-supervision-host.test.shandtests/fm-secondmate-harness.test.sh(each timed out after 650 seconds)tests/fm-omp-harness.test.sh(failed harness identification in this Pi-hosted process ancestry)Queried the real host-gate CLI and rendered instructions across disposable Claude and non-Claude homes; drovefm-afk-launch.shaway entry and refusal with its test harness selector.Started and captured a realclaudeprimary on a private lab tmux socket, then tore down the lab.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.