Repository navigation
fix(bin): surface launches parked on an interactive prompt as not-started - #5250
Conversation
a3ef85b to
2be0b6c
Compare
|
Speaking as Kun's firstmate: first stamp — waiting-ci. HEAD contract-class: restore (own inspection). Tip narrows false VISION: One captain/interface — aligns (honest not-started vs busy). Authority — aligns. Scripts/mechanics — aligns (classifier regex backstop is deterministic). Restart — aligns. Delegation spine — aligns (supervision sees parked launch). Vendor-orthogonal — aligns (harness-scoped signatures). Scope — aligns (busy/watch command layer). Closing: restores busy-contract honesty on the unconfigured path → auto-merge candidate when CI fully green. CI: NM pass ( Waiting on CI finish — not on author. No Firstmate flag. Will squash-merge if the remaining serials stay green (restore + MATCH + safe review). |
|
Speaking as Kun's firstmate: this is merged. Thank you @sdivanl — really appreciate you taking the time on this. CI fully green on tip |
Intent
A worker parked on an interactive launch prompt must surface within minutes instead of reading as busy until the one-hour bound.
On 2026-09-21 a crewmate launched on the codex harness parked on that CLI's sign-in screen and did no work at all; because an interactive prompt during launch reads as a BUSY launch rather than a stopped one, no alert fired and the stuck worker was spotted by eye before supervision saw it.
The same shape covers a Pi folder-trust dialog on a fresh worktree - the harness-specific trust pre-registration filed as separate work addresses that one case and does not close this detection gap.
The recorded fix shape: make the launch path prove the worker actually began its brief, or classify a launch whose pane is parked on a recognized interactive prompt - harness trust dialog, sign-in screen, first-run menu - as not-started rather than busy, so the gap surfaces in minutes.
Keep the existing busy-bound semantics for a genuinely working launch, and do not shorten the general bound.
Verification expected: colocated tests for the not-started/busy classification, plus a live check that a worker parked on a harness prompt surfaces promptly.
What Changed
fm_busy_launch_prompt_parkedand a harness-scoped signature table tobin/fm-busy-lib.sh: a launch whose busy record is still the untouchedfm-spawnseed now classifies asunknown launch-promptinstead ofbusy fm-spawnwhen the captured pane matches that harness's own recognized trust, sign-in, or first-run dialog (Claude, Pi/pi-signed/omp, Gemini). Records advanced by any real hook event are never reclassified, and the general busy bound is unchanged.bin/fm-crew-state.shand pass the existing capture throughbin/fm-watch.sh, so crew-state reads and the watcher agree on the launch-prompt verdict.bin/fm-test-run.sh, and document the backstop indocs/architecture.md,docs/tmux-backend.md, anddocs/verification/runtime-backends.md.Risk Assessment
✅ Low: The change is a well-bounded, honestly-labeled best-effort detection backstop that only removes a busy verdict for untouched fm-spawn records and does not touch the general busy bound; the only findings are an unused env-override seam and a stale comment.
Testing
I drove the real product end to end for the four launch-prompt classification and crew-state scenarios: the opt-in live guard launched real claude, pi, and gemini binaries into isolated tmux panes, captured each genuine trust/auth prompt with the production capture shape, and confirmed both
fm_busy_classifyand the watcher's production absorb predicate treat the parked launch asunknown launch-prompt/not-busy. Separately I ran the realbin/fm-crew-state.shagainst a real parked Claude pane and gotstate: unknown · source: pane · harness state unavailable (unknown launch-prompt), proving the authoritative read no longer absorbs it as working. The four remaining boundary scenarios (working launch keeps busy, advanced-record immunity, no-tail fallback, and adversarial harness scoping) were only exercised through the colocatedtests/fm-busy-state.test.shunit suite, which is not the live running product, so they are reported as untested rather than pass. No UI is involved (backend/CLI classification), so terminal transcripts are the reviewer-visible artifacts.unknown launch-prompt, and the watcher's production absorb predicate treats it as not…FM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh(live claude 2.1.278) and artifactlive-launch-prompt-e2e.logTrust project folder?dialog is classified `unknown lau…FM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh(live pi 0.86.1) and artifactlive-launch-prompt-e2e.logunknown launch-prompt.FM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh(live gemini 0.60.0) and artifactlive-launch-prompt-e2e.logbin/fm-crew-state.sh) against a real parked Claude pane reportsunknown ... launch-prompt, neverworking, so the watcher's pause/absorb path cannot swallow the…ROOT="$PWD" bash ~/.no-mistakes/evidence/01M348CGYMPH2J3SAQ6WJV8PBQ/live-crew-state-parked.sh; artifactlive-crew-state-parked.logbusy fm-spawn; the backstop does not shorten or replace the existing busy-bound semantics.bash tests/fm-busy-state.test.shcasetest_launch_prompt_never_shortens_a_working_launch, which is not the live running product. No live launch…bash tests/fm-busy-state.test.shcasetest_launch_prompt_never_reclassifies_an_advanced_record, which is not the live running product. No real h…bash tests/fm-busy-state.test.shcasetest_launch_prompt_requires_a_captured_tail, which is not the live running product. No live call omitting…bash tests/fm-busy-state.test.shcasestest_launch_prompt_scoped_to_armed_harnessesandtest_launch_prompt_pi_requires_both_markers, which is…Evidence: Live launch-prompt signature guard against real claude/pi/gemini
Source: Live launch-prompt signature guard against real claude/pi/gemini
# live claude version: 2.1.278 (Claude Code) ok - claude: a real launch parked on its own rendered trust dialog surfaces through the watcher gate # live pi version: 0.86.1 ok - pi, pi-signed, omp: a real Pi-engine launch parked on its own rendered trust dialog surfaces through the watcher gate # live gemini version: 0.60.0 ok - gemini: a real launch parked on its own rendered auth or trust dialog surfaces through the watcher gate # checked 3 launch-prompt signature(s) against real installed binariesEvidence: Real claude trust dialog captured, then real fm-crew-state.sh reports unknown launch-prompt
Source: Real claude trust dialog captured, then real fm-crew-state.sh reports unknown launch-prompt
state: unknown · source: pane · harness state unavailable (unknown launch-prompt) fm_busy_classify -> unknown launch-prompt PASS: real parked launch reads unknown/launch-prompt, never workingEvidence: Driver for the live fm-crew-state parked-launch check
Source: Driver for the live fm-crew-state parked-launch check
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-busy-lib.sh:929- The six per-signature environment overrides introduced here (FM_BUSY_CLAUDE_TRUST_PROMPT_REGEX, FM_BUSY_CLAUDE_IMPORTS_PROMPT_REGEX, FM_BUSY_PI_LAUNCH_PROMPT_REGEX, FM_BUSY_GEMINI_TRUST_PROMPT_REGEX, FM_BUSY_GEMINI_AUTH_PROMPT_REGEX, FM_BUSY_GEMINI_APIKEY_PROMPT_REGEX) are not required by any stated intent requirement: nothing in the repository sets, documents, or tests any of them, so they are dead configurability that can silently disable the launch-prompt backstop. Their presence also diverges from the deliberate hardening asserted in tests/fm-agy-harness.test.sh (an environment override must not change the agy busy signature for the same class of rendered-text check). No intent requirement needs a mode/flag here, and the narrower required form is the hardcoded literal regex. Remedy: drop the ${VAR:-...} wrappers at lines 929, 933, 952, 979, 983 and 987 and use the literal patterns.bin/fm-watch.sh:349- Stale comment left by this change's new tail consumer: window_is_busy's doc still says '<tail40> ... is consumed only by the Grok-scoped fallback inside the contract.' bin/fm-busy-lib.sh's new launch-prompt backstop also consumes tail40 (for claude/pi/gemini), so the comment now understates the argument's role and could mislead a maintainer into dropping the tail capture from a caller, re-opening the fm-watch/fm-crew-state absorb path this change closes.✅ **Test** - passed
✅ No issues found.
unknown launch-prompt, and the watcher's production absorb predicate treats it as not…FM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh(live claude 2.1.278) and artifactlive-launch-prompt-e2e.logTrust project folder?dialog is classified `unknown lau…FM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh(live pi 0.86.1) and artifactlive-launch-prompt-e2e.logunknown launch-prompt.FM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh(live gemini 0.60.0) and artifactlive-launch-prompt-e2e.logbin/fm-crew-state.sh) against a real parked Claude pane reportsunknown ... launch-prompt, neverworking, so the watcher's pause/absorb path cannot swallow the…ROOT="$PWD" bash ~/.no-mistakes/evidence/01M348CGYMPH2J3SAQ6WJV8PBQ/live-crew-state-parked.sh; artifactlive-crew-state-parked.logbusy fm-spawn; the backstop does not shorten or replace the existing busy-bound semantics.bash tests/fm-busy-state.test.shcasetest_launch_prompt_never_shortens_a_working_launch, which is not the live running product. No live launch…bash tests/fm-busy-state.test.shcasetest_launch_prompt_never_reclassifies_an_advanced_record, which is not the live running product. No real h…bash tests/fm-busy-state.test.shcasetest_launch_prompt_requires_a_captured_tail, which is not the live running product. No live call omitting…bash tests/fm-busy-state.test.shcasestest_launch_prompt_scoped_to_armed_harnessesandtest_launch_prompt_pi_requires_both_markers, which is…bash tests/fm-busy-state.test.sh- all passed, including the 8 new launch-prompt classification cases (Claude trust/imports, Pi/pi-signed/omp trust, Gemini trust/auth/API-key, working-launch non-shortening, harness scoping, advanced-record immunity, no-tail fallback)bash tests/fm-crew-state.test.sh- all passed, includingtest_no_run_launch_prompt_parked_is_not_workingFM_LAUNCH_PROMPT_SIGNALS_LIVE=1 bash tests/fm-launch-prompt-signals-live-e2e.test.sh- drove real claude 2.1.278, pi 0.86.1, and gemini 0.60.0 into their genuine launch prompts, captured the real panes, and requiredunknown launch-promptplus a non-busy watcher gateROOT="$PWD" bash ~/.no-mistakes/evidence/01M348CGYMPH2J3SAQ6WJV8PBQ/live-crew-state-parked.sh- real claude parked on its trust dialog, then realbin/fm-crew-state.shreadstate: unknown · source: pane · ... (unknown launch-prompt), neverworking✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ **PR** - passed
✅ Pull request created and recorded by no-mistakes.
✅ **CI** - passed
✅ All 20 checks passed; the pull request was merged.