Skip to content

feat: enable supervision host by default for Claude primaries - #6124

Merged
kunchenguid merged 5 commits into
mainfrom
fm/fm-afk-3d-claude-default-on-r1
Sep 29, 2026
Merged

kunchenguid merged 5 commits into
mainfrom
fm/fm-afk-3d-claude-default-on-r1

Conversation

@kunchenguid

@kunchenguid kunchenguid commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

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:

  • Section 3.2 (what the flip touches): the one owner of the opt-in parse is fm_supervision_host_enabled and fm_supervision_host_config in bin/fm-supervision-engine-lib.sh, called by bin/fm-afk-launch.sh, bin/fm-afk-return.sh, bin/fm-supervision-host.sh (including its "the home no longer opts into the supervision host" recheck), and bin/fm-wake-drain.sh. The flip lives there: an absent file plus a Claude primary reads as on with the default engine (the Claude engine at sonnet); a file holding off reads as off; everything else unchanged. The direct file tests that must route through the lib instead are bin/fm-claude-stop-autoarm.sh (host mode), bin/fm-host-mirror.sh (the mirror writers' gate; its Claude UserPromptSubmit and Stop hook registrations already run on every Claude home), bin/fm-supervision-instructions.sh (renders the host protocol block and Grok's arm command), bin/fm-afk-launch.sh (daemon refusal and the no-engine note), and bin/fm-lease-lib.sh (main's lease-checked commands take the per-task lock while the host runs). The Cursor, Codex, OpenCode, and omp owners (bin/fm-turnend-guard-cursor.sh, bin/fm-watch-checkpoint.sh, the OpenCode plugin, the omp extension) stay file-gated under this rung. The invariance tests that assert "without the file nothing changes" become "without the file a Claude home runs the host; with off nothing changes": tests/fm-claude-stop-autoarm.test.sh, tests/fm-supervision-host.test.sh, tests/fm-host-mirror.test.sh, tests/fm-afk-launch.test.sh, tests/fm-supervision-instructions.test.sh. Docs: docs/configuration.md "Supervision host" (the schema gains off; the sentence that absence leaves the home unchanged changes for Claude), docs/supervision-host.md "Scope today", docs/supervision-protocols/supervision-host.md, the afk and quiet skills' per-harness lists, and README where it names the opt-in. Secondmate inheritance: the file is deliberately not inherited today; with default-on, either an inherited opt-out is added to the inherited set, or each mate that must stay off gets its own off file.
  • Section 3.3 and 7 (captain calls): the sequence was approved; the first flip is Claude-only with an off opt-out; default-on for the other five harnesses (3d-2) is built before the away daemon is retired (3e).
  • Section 4 and plan section 5 (when Claude default-on can flip): after quiet-record and return-brief fixes, the auto-arm help-mode guard, and one away cycle and one restart under the host on the main home (all done), plus lab validation of the flip itself on the Claude class: the Stop auto-arm arms the host, the protocol renders the host branch, the mirror gate is on, off disables everything, /afk and /quiet behave as on the main home today, a restart re-anchors cleanly, and the inverted invariance tests pass. Rollout (main home first, then mates one by one) is procedural and not part of this change. A home can pick a cheaper engine model by writing "default " in the file.

What Changed

  • Run the supervision host on Claude primaries when config/supervision-host is absent, using the default Claude engine and model; off opts out, while the other five supported primaries remain file-gated.
  • Route arm owners, mirror writers, protocol rendering, AFK handling, and lease guards through the shared host gate.
  • Update documentation and tests for the new default and opt-out, including the rule that secondmates keep their own supervision-host configuration.

Risk Assessment

⚠️ Medium: The default-on flip is broadly wired and source review found no substantiated defect, but it changes stateful supervision across several entry points and still warrants the planned validation.

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.

  • Live validation: ⚠️ inconclusive - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A Claude home without a supervision file enables the host and renders its protocol ✅ pass live host-gate-cli.txt; real gate CLI and instruction renderer returned gate=0 and the host block
A Claude home writing off disables the host protocol and gate ✅ pass live host-gate-cli.txt; gate=1 and no host block
The other five harnesses leave an absent-file home file-gated ✅ pass live host-gate-cli.txt; codex, cursor, opencode, omp, and grok each returned gate=1 with no host block
A default-on Claude home records away words without starting the away daemon ✅ pass live afk-lab-cli.txt; real AFK launcher refused daemon start and printed the recorded away words
A real Claude primary auto-arms, handles attended and /quiet turns, and re-anchors after restart ⏸️ untested no A disposable marked lab and private tmux socket launched the installed, logged-in Claude CLI. Two tmux prompt submissions remained displayed in its composer without executing, so no live host cycle or…
A secondmate inherits the explicit off opt-out ⏸️ untested no The focused secondmate suite did not finish within either bound. A real secondmate would require completing a disposable primary-driven spawn and config-convergence cycle; the isolated Claude primary…
Evidence: Host gate and rendered protocol

Source: Host gate and rendered protocol

=== claude absent ===
gate=0
- Supervision host: on; it takes away-posture wakes and, where the dialog mirror is verified, eligible attended wakes itself, and hands the rest to you (protocol at the end of this block).
=== claude off ===
gate=1
no host block
=== claude default haiku ===
gate=0
- Supervision host: on; it takes away-posture wakes and, where the dialog mirror is verified, eligible attended wakes itself, and hands the rest to you (protocol at the end of this block).
=== codex absent ===
gate=1
no host block
=== cursor absent ===
gate=1
no host block
=== opencode absent ===
gate=1
no host block
=== omp absent ===
gate=1
no host block
=== grok absent ===
gate=1
no host block
Evidence: Disposable away entry and opt-out

Source: Disposable away entry and opt-out

=== absent Claude: away start ===
fm-afk-launch: the away daemon is not launched on this claude home, which runs the supervision host (docs/supervision-host.md); the away-posture record is the posture here (run bin/fm-afk-launch.sh enter and stop)
exit=1
=== absent Claude: away enter with words ===
Away posture recorded at 2026-09-29T12:44:04Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 4 concurrent workers.
Away posture (recorded):
  entered: 2026-09-29T12:44:04Z
  expected return: not given
  spend cap: 4 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    lab away
exit=0
=== away record ===
=== off: away start without record ===
fm-afk-launch: away-posture record archived at /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T//fm-lab.5RuV1W/state/afk-contracts/1790685844.afk-contract
fm-afk-launch: away mode stopped; no daemon terminal was running, .afk cleared, and the posture record archived
fm-afk-launch: an away-posture record is required; run enter before starting the daemon
exit=1
Evidence: Real Claude lab primary opened

Source: Real Claude lab primary opened

--- real Claude primary pane ---

 ▐▛███▛█   Claude Code v2.1.284
▝▜██████▀  Opus 4.8 with high effort · Claude Max
 ▝▝   ▝▝   ~/.no-mistakes/worktrees/52b07e9083e7/01M3PGKPCS760WGZRWZE15QA8B














                                                              ● high · /effort
────────────────────────────────────────────────────────────────────────────────
❯ Try "create a util logging.py that..."
────────────────────────────────────────────────────────────────────────────────

  ⏵⏵ auto mode on (shift+tab to cycle) · ← for agents
--- lab primary process ---
4619 2.1.284
- Outcome: ⚠️ 2 warnings across 1 run (42m3s)

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 yes from tree 86a5b31d (this branch), on a private tmux server (no Herdr), torn down with fm-live-lab.sh down (exit 0, lab root, task temps, and Claude trust entries removed, ~/.treehouse unchanged).

Case Evidence
No file on a Claude home config/ held only backend, claude-permission-mode, crew-harness, secondmate-harness, startup-memory-budget
Stop auto-arm arms the host up checks: ok host: supervision host pid 20727; state/.supervision-host row host ... fm-supervision-host.sh park with the watcher arm beneath it; host ledger start gen=host-20727-... primary=claude
Protocol renders the host branch fm-supervision-instructions.sh --harness claude in the lab home printed Supervision host: on; it takes away-posture wakes and ... eligible attended wakes itself and Supervision host: on for this home (config/supervision-host holding off turns it off ...)
Mirror gate on ok mirror: verified writer, check passed, captain=1 main=1 (later captain=6 main=8)
Attended wake handled by the host Worker completion: ledger handled turn=host-20727-...1 posture=attended rc=0 ... signal: .../labdce309a6f344-worker.status, then to-main branch-outcome ... (store rows 1); main drained it through BRANCH OUTCOMES and asked the captain about landing
/afk with words Words recorded verbatim in state/.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, then fm-merge-local.sh); no away daemon process; the host kept running
Away wake Worker follow-up commit while away: ledger handled 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.")
Honest return brief 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
/quiet fm-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 .afk or .afk-contract written
Main restart /exit stopped main (lock pid 99166) and the host (pid 21160 gone, state/.supervision-host removed); 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)
off reverts Wrote off; bash bin/fm-supervision-engine-lib.sh enabled config claude exit 1. Next wake: ledger pass-through attended ... signal: ... to main, host exited; the next turn end armed the plain watcher (auto-arm epoch 5, no state/.supervision-host, no host process, healthy watcher); .host-mirror.jsonl stopped 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 home

The lab surfaced one wording fix, included in this branch: the pass-through after off logged "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 /quiet turns, and re-anchoring after restart); the Test exception recorded above was approved on this evidence.

Secondmate inheritance of off

A primary's off is not propagated to secondmates: config/supervision-host stays 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 off would 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, and tests/fm-secondmate-harness.test.sh covers 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.sh hit the local 15-minute bound with 110 cases passing; it touches no changed code (bin/fm-watch.sh and 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 5 at its 30-minute job limit twice.
No test failed, but tests/fm-supervision-host.test.sh roughly 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).

Measure Before fix After fix
CI fm-supervision-host.test.sh duration (shard 5) 1199905 ms, 1146839 ms (shard cancelled at 30 min both times) 579794 ms (shard passed in 21 min); another PR on main in the same afternoon: 556779 ms
Local: processes left under the suite's temp root after the two new cases 8 2 (a bare run of the suite's opening leaves 1)
Local: the latch case run right after the two new cases 38 s 35 s

CI sharding and job timeouts are unchanged.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

⚠️ **Test** - 2 warnings
  • ⚠️ The required Claude-class attended, /quiet, and restart proof is missing. A real Claude primary opened in an isolated lab, but it did not submit the verification prompt; the host and secondmate targeted tests also exceeded their 650-second bounds. Re-run with an interactive Claude lab that can submit commands and retain its pane and state evidence.
  • ⚠️ live validation verdict: inconclusive (4 of 6 scenarios were driven live against the product); untested: A real Claude primary auto-arms, handles attended and /quiet turns, and re-anchors after restart, A secondmate inherits the explicit off opt-out
  • Live validation: ⚠️ inconclusive - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A Claude home without a supervision file enables the host and renders its protocol ✅ pass live host-gate-cli.txt; real gate CLI and instruction renderer returned gate=0 and the host block
A Claude home writing off disables the host protocol and gate ✅ pass live host-gate-cli.txt; gate=1 and no host block
The other five harnesses leave an absent-file home file-gated ✅ pass live host-gate-cli.txt; codex, cursor, opencode, omp, and grok each returned gate=1 with no host block
A default-on Claude home records away words without starting the away daemon ✅ pass live afk-lab-cli.txt; real AFK launcher refused daemon start and printed the recorded away words
A real Claude primary auto-arms, handles attended and /quiet turns, and re-anchors after restart ⏸️ untested no A disposable marked lab and private tmux socket launched the installed, logged-in Claude CLI. Two tmux prompt submissions remained displayed in its composer without executing, so no live host cycle or…
A secondmate inherits the explicit off opt-out ⏸️ untested no The focused secondmate suite did not finish within either bound. A real secondmate would require completing a disposable primary-driven spawn and config-convergence cycle; the isolated Claude primary…
  • 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, and tests/fm-watch-checkpoint.test.sh
  • tests/fm-supervision-host.test.sh and tests/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; drove fm-afk-launch.sh away entry and refusal with its test harness selector.
  • Started and captured a real claude primary 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.

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.
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes supervision host default behavior for Claude primaries.

The PR appears safe to merge based on the changes since the previous review.

Reviews (2) · Last reviewed commit: "no-mistakes(ci): Fixed process leaks in ..."

Comment thread tests/fm-supervision-host.test.sh Resolved
…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
@kunchenguid
kunchenguid merged commit 0a2cdf9 into main Sep 29, 2026
21 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-afk-3d-claude-default-on-r1 branch September 29, 2026 16:27
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`
ironerumi added a commit to ironerumi/firstmate that referenced this pull request Oct 2, 2026