Repository navigation
feat(bin): finish the cline harness adapter and raise grok's reasoning-effort ceiling - #7
Merged
Merged
Conversation
…ource Three gaps measured live while supervising real cline crewmates, all fixed by supplying verified facts rather than by loosening any refusal. Act mode: cline's TUI start mode follows the persisted planActMode in its global settings file, not the documented act-by-default, so a crewmate silently inherited the operator's plan mode and analysed without implementing. There is no --act flag, so the launch now redirects CLINE_GLOBAL_SETTINGS_PATH at a firstmate-owned copy that forces act and carries the operator's other choices over. The operator's own ~/.cline is never written. Control plane: cline was refused outright because it had no registered mechanics. It is now registered with its own verified keys - Escape cancels the turn, Ctrl+C EXITS - which is the exact inverse of grok. cline is also the first adapter with no composer exit command at all, so the exit mechanism is tabled as a key alongside the existing command table rather than overloading one string. Busy state: cline reported unknown, leaving supervision blind. It now folds cline's own per-session record, a structural source rather than a rendered tail. Two independent signals back it: the record's status field, and the turn log's last message role, which is what separates a finished turn from one that was accepted and never processed - the wedge that renders identically to a healthy idle pane. The recorded pid is deliberately unused for binding; it is the shared hub daemon's, not the pane's. Also teaches the shared composer classifier cline's plan-mode placeholder, so an operator's own plan-mode pane reads as an empty composer rather than pending input that away-mode supervision would refuse to deliver into.
…was re-verified grok's accepted effort vocabulary moved between installed versions. 0.2.99 rejected xhigh and max alike; 1.0.4's own refusal names `xhigh, high, medium, low`, and a real single-turn prompt at xhigh answers cleanly. firstmate was still omitting xhigh, silently downgrading a task the captain asked for the strongest reasoning on. max is still rejected and stays omitted. Adds live drift guards for both adapters. They read each vocabulary from the harness's own refusal rather than a remembered list, exercise the real binary, and fail naming the harness and version. Both refuse to pass when they checked nothing. Re-verified and unchanged, now pinned rather than remembered: grok's headless single-turn surface; its no-pty failure being an OS device error that names no credential problem, so a harness artifact is never read as an auth fault; and quota-axi resolving no grok quota window at all while grok's auth reads usable. That last pairing is the trap the credit selector must not fall into, and the selector already handled it correctly - the regression pins that rather than changing it. Cursor's live catalog confirms the recorded Grok ladder, and its usage-limit behaviour is unchanged: cursor-grok-4.6-high answers, while gpt-5.3-codex-low and claude-4.5-sonnet refuse until the monthly cycle ends.
…d defects The live guard now runs green end to end against cline 3.0.55 and proves every claim the adapter makes: a persisted plan mode still governs start mode (so the act-mode mechanism is still load-bearing), the settings redirect starts the real TUI in act mode, the session record structurally confirms it ran in act mode, the pane binds to exactly one of its own records, the fold reports busy in flight and leaves busy on cancel, the recorded exit key exits cleanly, the recorded interrupt key cancels the turn without polluting the composer, and the operator's own settings come out byte-identical. Two defects were in the guard rather than the adapter, and both would have reported a working mechanism as broken: Its pre-checks spent the only window in which a turn is observably in flight, so it read the fold after the turn had already settled and reported the busy source dead. Everything checkable is now checked inside the observation loop. Its composer check searched the whole pane, which also contains the conversation echo of the submitted prompt, so it reported a restored prompt that was not there. It now reads the last prompt-glyph row only. cline genuinely does not repollute its composer after an interrupt, so recording no clear key is correct. Also covers the crew-state layer, where a cline task previously read "unknown - harness state unavailable".
Registering cline's control mechanics was necessary but not sufficient. Every lifecycle verb refuses an endpoint it cannot positively attribute, and cline runs as a bundled Node script whose reported command name is a bare `node`, so a live cline pane classified `ambiguous` and fm-control refused it a second time - now for an unattributable endpoint rather than for unverified mechanics. Its identity is its install path (.../node_modules/cline/bin/.cline), the same shape cursor-agent has, so cline joins the shared exact-executable-name list that the path rule reads. That rule matches an exact `cline` path COMPONENT rather than a substring, so an unrelated node process still matches nothing and stays unattributed rather than being claimed as an agent - callers fold that into ambiguous, never into dead. Verified against a real cline 3.0.55 worker through fm-control.sh itself: `interrupt` reported agent-alive and left the composer on its idle placeholder, and `exit` reported stopped with the pane back at its shell.
…imitation Adds the two findings the live verification turned up that are not behaviour changes: cline's install-path identity and why a bare node pane was unattributable, and the pre-existing bare-row composer read that classifies a genuinely idle cline composer as pending. The second is bounded rather than fixed: it is pre-existing on an unmodified baseline, Cursor's cursorless reclassification does not transfer because cline first resolves to the pi separated shape, and a submit that starts a turn is still confirmed by the submit core's busy fallback. Correcting it would change the one fleet-wide classifier's conservatism for every harness and backend, so it is recorded with its measurements instead of changed under this task.
adibirzu
force-pushed
the
fm/fm-cline-harness-integration
branch
from
August 16, 2026 10:52
1e2cf23 to
1f9943b
Compare
…sed ceiling PR #8 restored this suite with the grok 0.2.99 expectation that xhigh is omitted, while this branch's ceiling change passes xhigh through on grok 1.0.4. The launch itself was never wrong - the captured command still threads --model and the typed brief - so the test now asserts the full new shape: model flag, xhigh reasoning effort, and typed brief together, with max still omitted by the sibling test and drift guarded live in tests/fm-grok-signals-live-e2e.test.sh.
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
Finish the cline harness adapter in firstmate, then re-verify the cursor and grok adapters end to end. All gaps below were measured live by supervising real cline crewmates; they are observations, not theory.
Gap 1 - cline crewmates launched into Plan mode and never implemented. A cline crewmate spent 47,000 tokens reading and reasoning without writing a line. Requirement: a firstmate-spawned cline crewmate starts in Act mode deterministically, using a launch-time mechanism, and WITHOUT mutating the captain's own ~/.cline configuration, which his interactive cline session uses. Established during the work and accepted: the brief's premise was that globalState.json's
mode = planwins; on cline 3.0.55 the actual authority isplanActModein the settings file, and the machine carried the two disagreeing (globalState mode=plan, settings planActMode=act) while the TUI started in Act. There is no --act flag (-p/--plan only selects Plan), so the mechanism chosen is redirecting CLINE_GLOBAL_SETTINGS_PATH at a firstmate-owned per-task settings copy that forces act and carries the operator's other keys (telemetry, auto-update) across. That variable redirects only that one file, so credentials and provider config still resolve from the operator's own store. Deliberate: the spawn refuses rather than launching when operator settings exist but cannot be carried over faithfully, so a crewmate never silently starts in plan mode and the operator's telemetry choice is never silently reset.Gap 2 - firstmate could not control a cline worker at all. fm-control refused cline outright as having no verified control mechanics. That refusal was correct behaviour for an unverified adapter: the fix is to verify the mechanics and register them, NEVER to loosen the refusal. Requirement: fm-control.sh interrupt|exit|relaunch works against a real cline worker with mechanics registered in the executable control plane rather than guessed. Verified live on 3.0.55: Esc cancels the turn, a single Ctrl+C EXITS the TUI (so Ctrl+C must never be used to interrupt), and Esc leaves the composer on its idle placeholder rather than restoring the cancelled prompt, so no composer clear key is recorded. cline is the first verified adapter with NO composer exit command at all, so the exit mechanism is tabled as a separate exit-KEY table beside the existing exit-command table rather than overloading one string - required because cline's exit key is grok's interrupt key. A second, distinct refusal was found during the work and fixed: cline runs as a bundled Node script reporting a bare
node, so a live cline pane classifiedambiguousand every lifecycle verb refused the endpoint as unattributable. Its identity is its install path, so cline joined the shared exact-executable-name list; that rule matches an exactclinepath COMPONENT, never a substring, so an unrelated node process stays unattributed rather than being claimed as an agent.Gap 3 - firstmate could not read a cline worker's state; fm-crew-state.sh returned unknown, so supervision was blind and a genuinely wedged worker went unnoticed. Requirement: fm-crew-state.sh reports a real busy or idle state for a live cline worker. A rendered-tail signature was explicitly the weakest acceptable source; a structural source was preferred, more than one independent signal was required so no single vendor string is load-bearing, and detecting the queued-but-unprocessed state was requested because that is the failure that actually bit. Implemented as a pull source folding cline's own per-session record (structural, not rendered), bound to the pane by a sidecar, with two independent signals: the record's status field, and, for the ambiguous
idle, the turn log's last message role - which is what separates a finished turn from one accepted and never processed. Deliberate: the record's pid is NOT used for binding because it is the shared cline hub daemon's pid, verified live; binding is on workspace_root plus pre-existing-session exclusion. Deliberate: jq is required and its absence reports unknown rather than falling back to a formatting-dependent text read, because every unresolvable outcome must be unknown, never idle.Also required and delivered: for every harness-dependent check added or changed, TWO tests - a portable regression in tests/ that pins the logic with no harness present, and a live opt-in guard in the live-harness-optin family that exercises the real installed harness and fails naming harness and version, refusing to pass when it checked nothing. Both cline and grok live guards run green against the real binaries. The harness-adapters skill is updated with what was verified, dated, patching existing language rather than appending a second description.
Re-verification of the other two adapters, as requested. grok: real drift found and corrected - the reasoning-effort ceiling moved, 0.2.99 rejected xhigh while 1.0.4 accepts it, so firstmate was silently downgrading tasks; max is still rejected and stays omitted. Re-verified unchanged and now pinned: the headless single-turn surface, the no-pty failure being an OS device error that names no credential problem (a test-harness artifact that must never be mistaken for an auth fault), and quota-axi resolving no grok quota window at all while grok auth reads usable - the pairing the credit selector must not price. The selector already handled that correctly, so the regression pins existing behaviour rather than changing it. cursor: recorded facts confirmed unchanged against the live catalog and account; the stale Grok-ladder claim had already been corrected by earlier work and was re-confirmed, not re-appended.
Scope boundaries the captain set and confirmed, which must not be treated as omissions: do not restructure the control plane, the busy library or the spawn path beyond what these gaps require; do not add a new harness; and never weaken a fail-closed refusal to make something pass - the refusals are correct and the fix is always to supply verified facts.
Explicitly excluded by the captain after being measured and reported, and filed as separate work (fm-composer-bare-row-idle) with instructions not to touch it: cline's composer has full-width rules but no side borders, so the shared screen classifier takes the bare-row path where an idle placeholder is deliberately not trusted, and a genuinely idle cline composer therefore reads
pending. This is pre-existing on an unmodified baseline, Cursor's cursorless reclassification does not transfer because cline first resolves to the pi separated shape, and a submit that starts a turn is still confirmed by the submit core's busy fallback, so it should bite only when a delivered message starts no turn - most plausibly a ClinePass quota refusal. It is recorded with its measurements in the verification doc and the skill rather than fixed, because correcting it would change the one fleet-wide classifier's conservatism for every harness and every backend.Also observed and documented rather than fixed: nothing surfaces a ClinePass quota limit, so a quota-blocked cline worker renders identically to one that finished a turn - the panel scrolls away and the pane returns to an ordinary idle composer - and quota-axi has no cline provider at all, which is also why cline is correctly absent from the credit selector's routable providers.
Known pre-existing and NOT introduced by this change, confirmed identical on the branch base and owned by another worker's in-flight branch (fm-restore-main-ci), which the captain instructed to leave alone: bin/fm-lint.sh exits non-zero on two SC2034 warnings (bin/fm-composer-lib.sh FM_COMPOSER_BARE_PROMPT_RE_DEFAULT, tests/fm-backend.test.sh archive), and the fm-spawn-capacity, fm-backend and fm-muse-harness suites fail identically on the base. This fork's GitHub Actions genuinely run but main has been red since 1 August, so a red CI result may not belong to this change.
What Changed
fm-spawn.shnow writes a firstmate-owned<id>.cline-settings.json(operator settings carried over viajq,planActModeforced toact) that the launch pointsCLINE_GLOBAL_SETTINGS_PATHat, plus a<id>.cline-sessionsidecar binding the pane to cline's own session record byworkspace_rootand pre-existing-session exclusion — and it refuses to launch rather than dropping operator settings; both files are retired byfm-teardown.sh.fm-control-lib.shregisters cline's verified mechanics (Escape interrupt, no composer clear key) and adds a separatefm_control_exit_keytable sofm-control.shsendsC-cto exit, refusing when the backend cannot deliver that exact key or when neither an exit command nor key is verified.fm-busy-lib.shadds a structuralcline-sessionpull source folding the record'sstatusplus the turn log's last message role — reportingcline-session-stalledfor a queued-but-unprocessed turn andunknown(neveridle) for every unresolvable case, including missingjq; the herdr native-busy arm now falls through to that source once the staleness bound fires instead of returningunknown native-stale.fm-session-lock-lib.shaddsclineto the exact-executable-name list so a bundled-Node cline pane is attributable instead ofambiguous, andfm-composer-lib.shadds cline's plan-mode idle placeholder.--reasoning-effortceiling infm-spawn.shfromhightoxhigh(verified accepted on grok 1.0.4, rejected on 0.2.99);maxstays omitted as still-rejected.tests/fm-cline-harness.test.sh,fm-control.test.sh,fm-crew-state.test.sh,fm-dispatch-select.test.sh,fm-teardown.test.sh,fm-watch-busy-staleness.test.sh, andfm-grok-harness.test.sh, plus two new live opt-in guards (tests/fm-cline-signals-live-e2e.test.sh,tests/fm-grok-signals-live-e2e.test.sh) registered in the live-harness-optin family infm-test-run.sh. Docs and the harness-adapters skill record the verified facts, the process-identity rule, and the known idle-composerpendinglimitation (filed separately asfm-composer-bare-row-idle, not fixed here).Risk Assessment
✅ Low: All previously reported defects are verifiably fixed in the current code with behavioural regressions that fail against the pre-fix implementation, the one shared-classifier change is provably scoped to cline alone by
fm_busy_native_boundedand pinned by an anti-widening test, and the only surviving findings are two inaccurate comments with no behavioural effect.Testing
I ran 13 targeted portable suites (all green) and then proved the intent the way an operator would experience it: a real cline 3.0.55 crewmate spawned by fm-spawn.sh into a real tmux pane, driven through fm-crew-state.sh and fm-control.sh. That run shows the TUI footer rendering
○ Plan ● Act (Tab), the crewmate writing ACT_PROOF.txt instead of analysing forever,state: working · source: pane · harness busy (cline-session)where the old adapter said unknown,interrupt-delivered … verified=agent-alivewith the composer back on its idle placeholder,stopped … harness=clineagainst a live busy agent with the worktree preserved, and the operator's ~/.cline settings byte-identical throughout. Both live opt-in guards run green against the real binaries, and cursor's recorded facts were re-checked against the live catalog and account. The relaunch verb could not be demonstrated: fm-control passes fm-spawn a--relaunchflag that does not exist, which stops the agent and then fails to replace it - I confirmed this fails identically on the branch base and with harness=claude, so it is pre-existing and harness-agnostic rather than something this change broke. No screenshot artifact applies here: every changed surface is a shell CLI or a vendor terminal TUI, so the reviewer-visible evidence is verbatim CLI transcripts including the rendered pane rows captured via tmux capture-pane. One nuance worth knowing: for an idle cline worker fm-crew-state rendersunknown · nonerather than an explicit idle, which is the deliberate fall-through the shipped portable test pins and the commit documents, and the busy side - the wedged-worker failure that actually bit - now reports correctly.Evidence: Live CLI transcript: fm-spawn -> Act mode -> fm-crew-state busy -> fm-control interrupt (real cline 3.0.55)
Source: Live CLI transcript: fm-spawn -> Act mode -> fm-crew-state busy -> fm-control interrupt (real cline 3.0.55)
=== $ fm-spawn.sh cline-act-demo <project> cline --mode local-only --yolo off === spawned cline-act-demo harness=cline kind=ship mode=local-only yolo=off window=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project === firstmate-owned settings copy the launch redirects CLINE_GLOBAL_SETTINGS_PATH at === {"autoUpdateEnabled":true,"telemetryOptOut":false,"planActMode":"act"} === waiting for the real cline TUI to render its mode footer === kimi-k3 (medium) (0) $0.00 ○ Plan ● Act (Tab) === $ fm-crew-state.sh cline-act-demo (while the crewmate works) === state: working · source: pane · harness busy (cline-session) === $ fm-control.sh cline-act-demo interrupt === interrupt-delivered cline-act-demo harness=cline backend=tmux verified=agent-alive cancel=unconfirmed interrupt exit=0 --- pane composer row after interrupt --- ❯ Ask anything... === the operator's own ~/.cline settings after the whole run === before=2948635118 84 after =2948635118 84 UNCHANGED (byte-identical)Evidence: Live CLI transcript: fm-control exit against a live, busy cline worker
Source: Live CLI transcript: fm-control exit against a live, busy cline worker
=== relaunching the recorded worker command by hand (fm-control relaunch is broken pre-existing) === kimi-k3 (medium) (0) $0.00 ○ Plan ● Act (Tab) === $ fm-control.sh cline-act-demo exit (against the live, busy agent) === stopped cline-act-demo harness=cline backend=tmux endpoint=firstmate:fm-cline-act-demo worktree=/Users/adrianb/.treehouse/project-c6f6e2/1/project exit verb rc=0 === endpoint after exit: the worktree and its work are preserved, the agent is gone === pane command: zsh worktree still holds the crewmate's work: ACT_PROOF.txt ACT-MODE-OKEvidence: Act-mode proof: the file the cline crewmate actually wrote
Source: Act-mode proof: the file the cline crewmate actually wrote
worktree: /Users/adrianb/.treehouse/project-c6f6e2/1/project -rw-r--r--@ 1 adrianb staff 12 Aug 16 09:47 ACT_PROOF.txt ACT_PROOF.txt (written by the firstmate-spawned cline crewmate): ACT-MODE-OKEvidence: Live cline drift guard (cline 3.0.55)
Source: Live cline drift guard (cline 3.0.55)
ok - cline 3.0.55: a persisted plan mode still governs the TUI start mode (the gap reproduces) ok - cline 3.0.55: cline's recorded exit key exits the real TUI cleanly ok - cline 3.0.55: the act-mode settings redirect starts the real TUI in act mode ok - cline 3.0.55: a live cline pane is positively attributed as a running agent ok - cline 3.0.55: the real cline pane binds to exactly one of its own session records ok - cline 3.0.55: the real session record structurally confirms the crewmate ran in act mode ok - cline 3.0.55: cline's real session record classifies busy in flight ok - cline 3.0.55: cline's recorded interrupt key cancels the turn without polluting the composer ok - cline 3.0.55: cline's real session record leaves busy once the turn is cancelled ok - cline 3.0.55: the operator's own cline settings are byte-identical after a forced-act run ALL PASS: fm-cline-signals-live-e2e (cline 3.0.55)Evidence: Live grok drift guard (grok 1.0.4) - the xhigh ceiling move
Source: Live grok drift guard (grok 1.0.4) - the xhigh ceiling move
ok - grok 1.0.4 (d846eb93d94d) [stable]: grok's accepted effort vocabulary is still low|medium|high|xhigh with no max ok - grok 1.0.4: grok answers a real headless single turn at the highest effort firstmate passes ok - grok 1.0.4: grok's no-pty failure is an OS device error and names no credential problem ok - grok 1.0.4: quota-axi still resolves no grok quota window, so grok stays unpriceable ok - grok 1.0.4: grok's native model listing surface still answers ALL PASS: fm-grok-signals-live-e2e (grok grok 1.0.4 (d846eb93d94d) [stable])Evidence: Cursor live re-verification (catalog + account)
Source: Cursor live re-verification (catalog + account)
$ cursor-agent --version 2026.08.11-e8db854 (matches the recorded row exactly) $ cursor-agent status ✓ Logged in as [email protected] $ cursor-agent --list-models (the documented ladder, still present) cursor-grok-4.6-low / -low-fast / -medium / -medium-fast / -high / -high-fast / -xhigh / -xhigh-fast cursor-grok-4.5-low / -low-fast / -medium / -medium-fast / -high / -high-fastEvidence: Manual verification scripts used to produce the live transcripts
Source: Manual verification scripts used to produce the live transcripts
Evidence: Pre-existing relaunch failure, reproduced on the branch base (8b22be8)
Pipeline
Updates from git push no-mistakes
... (6 earlier update rounds omitted to keep the PR body within GitHub's 65536-char limit; full history is in the run log.)
Failure scenario: an operator runs
fm-control.sh t1 relaunch --harness cline. do_exit succeeds and the agent is stopped, then the spawn fails and fm-control dies with 'the replacement agent for t1 could not be launched on cline', leaving the task with no agent on a live worktree pending rollback.This contradicts the intent's required criterion: 'fm-control.sh <task> interrupt|exit|relaunch works against a real cline worker with mechanics registered in the executable control plane rather than guessed.' interrupt and exit were live-verified and do work; relaunch is broken for every harness on this branch. Because the call site belongs to a different in-flight workstream's rename, the right fix (change
--relaunchto--reuse-worktree, drop the now-redundant--harness/positional shape mismatch if any, and add a happy-path relaunch case that asserts the spawn argv) is an ownership decision rather than a mechanical one.bin/fm-spawn.sh:2463- The cline spawn arm creates two new per-task state files -state/<id>.cline-settings.json(bin/fm-spawn.sh:2444) andstate/<id>.cline-session(bin/fm-spawn.sh:2463) - butbin/fm-teardown.shwas not extended to remove them. Its explicit removal list at bin/fm-teardown.sh:2585-2589 names.muse-session,.muse-session-currentand.cursor-session(the two structurally identical pull-source sidecars) plus every other per-task token, and the secondmate-child cleanup at bin/fm-teardown.sh:2279-2282 does the same; neither mentions cline. There is no wildcard cleanup - the list is enumerated.Failure scenario: spawn a cline crew task, let it finish, run
fm-teardown.sh <id>.state/<id>.metaand every other artifact is removed, butstate/<id>.cline-sessionandstate/<id>.cline-settings.jsonremain in the state directory forever. Every cline task the operator ever runs leaves two more orphaned files, one of which is a verbatim copy of the operator's cline global settings, retained indefinitely after the task it was made for no longer exists.fm_control_harness_wiring_pathsalready tables both paths for cline (bin/fm-control-lib.sh:253-261) but that function has no production caller, so it does not cover this.Fix: add
"$STATE/$ID.cline-session" "$STATE/$ID.cline-settings.json"to the teardownrm -flist (and thesub_stateequivalent), matching the muse/cursor sidecar treatment.bin/fm-busy-lib.sh:885-fm_busy_cline_matching_sessionsiterates every directory under cline's sessions root and callsfm_busy_cline_session_workspaceon each, which forks a separatejqper record (bin/fm-busy-lib.sh:870-877, 885-897). The scan covers the machine's ENTIRE cline session history, not just this task's workspace, because the workspace filter is what the jq call computes. It runs on everyfm_busy_classifyfor a cline task, which is the hot supervision path: bin/fm-watch.sh:217 and bin/fm-supervise-daemon.sh:631 call it once per task per poll, and bin/fm-crew-state.sh:168 on every state read.Failure scenario: an operator with a few hundred accumulated cline sessions (one per interactive run, never pruned by firstmate) supervising two cline crewmates pays several hundred
jqprocess spawns per watch tick per task - hundreds of milliseconds to seconds of CPU on each poll, growing monotonically with cline usage and never shrinking.The two sibling pull sources avoid this: muse resolves its whole matching set in ONE
nodeinvocation (bin/fm-busy-lib.sh:332-336), and cursor's per-dir fork issedover a set bounded by distinct workspaces rather than by launches (bin/fm-busy-lib.sh:647-660). Fix without changing the fold's semantics: resolve the whole set in a single jq pass over the candidate records (for examplejq -r 'select(.workspace_root == $w) | input_filename' --arg w "$want" "$root"/*/*.json), keeping the exact-match rule and the jq-absent-means-unknown guarantee intact.tests/fm-cline-harness.test.sh:230- Four cases in the cline suite prove nothing by executing anything - they grep implementation source bytes:test_existing_launch_templates_untouched(line 230, greps bin/fm-spawn.sh for two template fragments),test_cline_is_a_known_bare_adapter_name(greps for the literal|kimi|cline),test_cline_model_and_effort_flags(greps for|kimi|clineand'--thinking %s '), andtest_cline_detection_wired(greps bin/fm-harness.sh for*cline*) echo cline; return ;;).test_shared_idle_default_covers_clinealso greps each backend source forFM_BACKEND_*_IDLE_RE=.*FM_COMPOSER_IDLE_RE_DEFAULT.All five are pre-existing (they came in with the original cline adapter commit, not this change), and this change moved in the right direction: it DELETED the worst of them (
test_cline_launch_template_is_pinned) and replaced it with real spawn scaffolding that captures what fm-spawn hands the backend off a fake tmux. Recording it only because that scaffolding now exists in the same file and makes the remaining greps cheap to convert: a behavior-preserving refactor of the launch template or the harness allowlist would fail these while the adapter still works, and conversely a template that no longer reaches a pane would pass them.run_cline_spawn+$home/launch.logalready gives the executable assertion for the launch, model, and effort cases.🔧 Fix: clean up cline sidecars, batch session scan, drop source greps
3 issues (1 warning, 2 infos) still open:
bin/fm-busy-lib.sh:1124- On the herdr backend the newcline-sessionstructural source is unreachable, so Gap 3's "real busy or idle state for a live cline worker" is not delivered there.fm_busy_classifyconsults the herdr native arm first (bin/fm-busy-lib.sh:1093) and returns from it unconditionally:busy->printf 'busy herdr-native'; return 0, or, oncefm_busy_native_bounded clineplusfm_busy_native_stalefire,printf 'unknown native-stale'; return 0(line 1098). Thecline*)arm at line 1124 is only reached when herdr's native probe is NOT busy. But this branch's own sibling test states the measured fact: "Herdr ... has NO cline integration, so its agent_status for a cline pane is a guess that sticks at 'working' forever" (tests/fm-watch-busy-staleness.test.sh:6-10). If it sticks at busy forever, the cline arm never runs on herdr at all.Concrete sequence: dispatch a cline crewmate on herdr (
config/crew-harness=cline), let it run a turn. For the first FM_BUSY_NATIVE_MAX_SECONDS (default 120) supervision reportsbusy herdr-native- herdr's guess, true or false - and from then onunknown native-stalepermanently, whilestate/<id>.cline-sessionand the bound record hold the answer (running-> busy,completed-> idle, or theidle+ trailingrole: userwedge -> stalled). A worker that finished 20 minutes ago and one genuinely wedged mid-turn both readunknown, which is the exact blindness Gap 3 was opened for.This is reachable on the path the change's own doc names as the closing acceptance: docs/verification/cline-adapter.md:296-301 records the remaining acceptance as "a full live crewmate dispatch through the herdr backend ... observing the supervisor drive ready-gate -> brief-inject -> busy -> turn-end". The live guard that proved the fold works (tests/fm-cline-signals-live-e2e.test.sh) runs on raw tmux, where the arm is reached, so the gap is invisible to it.
The code comment at line 1125-1128 justifies the ordering as "two independent signals either of which can carry a positive busy verdict, and losing one does not blind the classifier". That reasoning holds for an adapter herdr actually integrates with; for cline the native signal carries no information by herdr's own admission, so putting it first makes the informative source dead code and the stale guard blinds the classifier rather than degrading it.
The earliest shared boundary that would make the invariant hold is the same one
cursor*already uses: resolve cline's structural fold before the herdr native arm (thecursor*)case sits in the pre-recordcaseat line 1010), or gate the herdr native arm on the harnesses herdr actually integrates with -fm_busy_native_boundedalready enumerates cline as the exception. Flagged rather than fixed because the ordering is explicitly deliberate in the comment and changing it changes classifier precedence for a shipped backend.tests/fm-cline-harness.test.sh:306- The max-effort half oftest_cline_model_and_effort_flagshas no positive anchor, so it can pass while proving nothing.assert_no_grepis! grep -F -- "$1" "$2" >/dev/null || fail(tests/lib.sh:331), and grep on an empty or absent file exits 1, so the assertion succeeds. Theflags-maxcase (line 301-307) runs the spawn, checksexpect_code 0, then only asserts the ABSENCE of--thinkingin$home/launch.log. The fake tmux exits 0 for every subcommand and only appends to the launch log on asend-keys -l(tests/fm-cline-harness.test.sh:62-71), so a change that stopped delivering the launch throughsend-keys -l- a different delivery verb, a renamed placeholder, a backend switch - would leave the log empty, keep the spawn's exit status 0, and let this case pass green while nothing was launched.The sibling
flagscase (line 293-300) is anchored by its two positiveassert_greps, so this is specific to the max branch. Add a positive anchor before the negative assertion, e.g.assert_grep "cline -i --tui" "$home/launch.log" "cline max-effort launch did not reach the pane", matching whattest_cline_is_a_known_bare_adapter_namealready asserts off the same log.bin/fm-busy-lib.sh:910- The batched session scan's process bound holds only while every record on the machine parses.xargs -0 jq ...aborts on the first unparseable record, and any non-zero status discardsmatchedentirely and re-runs the whole candidate set through the per-recordfm_busy_cline_session_workspaceloop (line 917-921), one jq fork per accumulated session - the original cost plus one extra process. I confirmed the exit-status plumbing works as intended (a missing/corrupt file in the list yields rc!=0 and the fallback fires) and thatinput_filenamereports the correct file per match on jq 1.7.1, so the happy path is sound.The residual point is that a single permanently corrupt record - a cline session killed mid-write leaves a truncated JSON, and nothing prunes the sessions root - restores the per-fork cost on every supervision tick (bin/fm-watch.sh, bin/fm-supervise-daemon.sh, bin/fm-crew-state.sh) until the operator finds and deletes it. The comment at lines 891-899 documents this tradeoff explicitly and it is the right correctness call: one corrupt unrelated record must skip only itself, which
test_a_corrupt_unrelated_session_does_not_blind_the_scanpins. Recording it only so the bound is not read as unconditional; no change required.🔧 Fix: reach cline structural fold on herdr, anchor max-effort case
2 infos still open:
docs/verification/cline-adapter.md:292- The verification record's owners table statestests/fm-cline-harness.test.sh | 24 portable behavior checks (all green), but the suite now runs 35 test functions with 35passassertions. The count was already wrong when the row landed (29 at commit a6bbaa0) and the fix rounds added four more cases (corrupt-scan, unrelated-node detection, and the two herdr handoff regressions). This is a verification doc whose stated purpose is that every value is a capture rather than a guess, so a number that is off by eleven undercuts exactly the property the file exists to carry. Either update the count or drop the number and name the coverage instead, since it will drift again on the next added case.tests/fm-cline-signals-live-e2e.test.sh:12- The guard's header claims "It never writes anything under it: the only files this creates are the lab's own settings copies and workspace", where "it" is the operator's cline data directory. That is not accurate: the guard launches the real binary with the operator's HOME and onlyCLINE_GLOBAL_SETTINGS_PATHredirected, so cline writes a fresh session record under$CLINE_DATA_ROOT/sessions/<new-id>/for the lab workspace on each of the two launches, and the guard depends on that (line ~205 resolvesfm_busy_cline_session_recordagainstCLINE_SESSIONS_ROOT). Those records are never removed bycleanup, which only kills the tmux server and deletes$LAB. Concretely: each opt-in run of the guard leaves two more permanent session directories under the operator's~/.cline/data/sessions/, pointing at a/tmpworkspace that no longer exists, and they are then part of the whole-history set the supervision-path scan walks on every poll. The actual safety claim the guard does enforce - the operator'sglobal-settings.jsonis byte-identical afterwards, measured with cksum - is correct and unaffected. Correct the comment to say the redirected settings file is what is never written, and note that running the real binary necessarily leaves session records behind (or reap the two lab sessions incleanup).bin/fm-control.sh:831-fm-control.sh <task> relaunchstops the running agent and then fails to launch its replacement, leaving the task with no agent. It invokesbin/fm-spawn.sh <id> --relaunch --harness <name>(bin/fm-control.sh:831), but fm-spawn defines no--relaunchflag (the real flag is--reuse-worktree, bin/fm-spawn.sh:297), so--relaunchfalls into the positional bucket, becomes the project-dir argument, and spawn dies witherror: ship spawns require --mode .... Reproduced live against a real cline worker (relaunch exit=1,no agent is running) and bytests/fm-control-relaunch.test.sh, which fails ona same-harness relaunch should succeed. VERIFIED PRE-EXISTING: an identical run against a clean checkout of base commit 8b22be8 fails the same way with harness=claude, so this change did not introduce it and it is harness-agnostic. Flagging it because the user intent namesrelaunchas a required verb for a cline worker, and this suite is not in the intent's list of known-red suites (fm-spawn-capacity, fm-backend, fm-muse-harness) - so the captain should decide whether it belongs to the in-flight fm-restore-main-ci branch or needs its own work. I did not fix it: it is out of this change's stated scope ("do not restructure the control plane beyond what these gaps require") and is product code, not a test defect.rm -rf ~/.treehouse/project-c6f6e2 /tmp/fm-cline-act-demo /var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-cline-cli-demo.* /var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-cline-exit.* /var/folders/j8/ztw_4_wx3691gww5x_1n9r4c0000gn/T/fm-base.xJCFb5. All lab tmux servers are already dead (only stale socket files remain) and no test-spawned agent survives. The live runs also left ordinary cline session records under ~/.cline/data/sessions, which is normal vendor state and exactly what the repo's own live guard produces../bin/fm-test-run.sh tests/fm-cline-harness.test.sh tests/fm-control.test.sh tests/fm-crew-state.test.sh tests/fm-grok-harness.test.sh tests/fm-dispatch-select.test.sh tests/fm-teardown.test.sh tests/fm-watch-busy-staleness.test.sh- 7 suites, 0 failed./bin/fm-test-run.sh tests/fm-busy-state.test.sh tests/fm-busy-adapter-wiring.test.sh tests/fm-composer-lib.test.sh tests/fm-session-lock-ancestry.test.sh tests/fm-tmux-agent-liveness.test.sh tests/fm-cursor-harness.test.sh- 6 suites, 0 failedFM_CLINE_SIGNALS_LIVE=1 ./tests/fm-cline-signals-live-e2e.test.sh- 10 live assertions green against real cline 3.0.55 (plan-mode gap reproduces, act redirect works, live pane positively attributed, session record binds and classifies busy in flight, Escape cancels the turn without polluting the composer, Ctrl+C exits, operator settings byte-identical)FM_GROK_SIGNALS_LIVE=1 ./tests/fm-grok-signals-live-e2e.test.sh- 5 live assertions green against real grok 1.0.4 (effort vocabulary low|medium|high|xhigh with no max, real headless xhigh turn answers, no-pty failure is an OS device error naming no credential problem, quota-axi resolves no grok window, model listing answers)Manual live end-to-end through the real user-facing CLIs:bin/fm-spawn.sh cline-act-demo <project> cline --mode local-only --yolo off-> real cline crewmate in a real tmux pane ->bin/fm-crew-state.sh cline-act-demo->bin/fm-control.sh cline-act-demo interrupt->bin/fm-control.sh cline-act-demo exit(script: live-cline-cli-demo.sh / live-cline-exit-demo.sh in the evidence dir)Verified the crewmate implemented rather than planned:cat ~/.treehouse/project-c6f6e2/1/project/ACT_PROOF.txt->ACT-MODE-OK, plusjq -c . state/cline-act-demo.cline-settings.json->{"autoUpdateEnabled":true,"telemetryOptOut":false,"planActMode":"act"}Verified the operator's own config was never written:cksum < ~/.cline/data/settings/global-settings.jsonbefore and after the whole run (2948635118 84 both times)cursor-agent --version,cursor-agent status,cursor-agent --list-models- live re-verification of the cursor row's catalog and account claims./bin/fm-test-run.sh tests/fm-control-relaunch.test.shon the branch AND on a cleangit archivecheckout of base commit 8b22be8 - identical failure, establishing the relaunch defect as pre-existingdocs/configuration.md:264- docs/configuration.md "Harness support" carries two overlapping and disagreeing statements of the same fact: line 258 says claude, codex, opencode, pi, pi-signed, grok, kimi, and cursor are verified for crewmate and secondmate launches (with cline and copilot crewmate-only), while line 264 says only claude, codex, opencode, pi, pi-signed, grok, and kimi are, and names agy as the crewmate-only adapter. Both are pre-existing (identical on the branch base) and this change did not touch either, so consolidating them into one owner sentence is out of scope here; it is worth a follow-up because a reader picking the second sentence would conclude cursor cannot run as a secondmate.docs/calm-mode-feasibility.md:306- docs/calm-mode-feasibility.md records captured transcript lines readingFM_TEST_SUMMARY_FAMILY family=live-harness-optin count=7; this change adds two members to that family, so the count no longer matches a run today. Left unchanged deliberately: those are dated maintainer-verification captures of exact past output, and rewriting recorded output would falsify the evidence rather than correct a fact. Flagging only so the discrepancy is not later mistaken for drift.🔧 Fix: consolidate harness crewmate/secondmate split in docs/configuration.md
1 info still open:
AGENTS.md:193- Follow-up proposal, not fixed here. AGENTS.md states the crewmate-only restriction twice within three lines: line 192's verified-adapter list already carries "plusmusefor crewmates and scouts only andagyfor crewmate launches only", and line 193 repeats "agyis verified for crewmate launches only, and a--secondmatespawn refuses it". That list is also incomplete against the executable owner: bin/fm-spawn.sh refuses a --secondmate launch for cline and copilot too (secondmate_harness_unsupported, bin/fm-spawn.sh:658-666 and the backstop at 1099-1105), yet AGENTS.md names cline, cursor-agent, and copilot with no spawn-scope qualifier, so an agent reading only line 192 could dispatch a cline or copilot secondmate and hit the refusal. Both lines are pre-existing and identical on the branch base - this change touched only AGENTS.md's state-file inventory (the .cline-session and .cline-settings.json entries), not the adapter list - so correcting the owner list is outside this change's staleness scope and outside the captain's ruled scope for this round, which named docs/configuration.md only. Raising it as one finding rather than editing, per the out-of-scope-consolidation rule.✅ **Push** - passed
✅ No issues found.