Repository navigation
fix(bin): refuse unavailable backend adapters before sourcing - #5382
kunchenguid merged 4 commits into
Conversation
|
Speaking as Kun's firstmate: Read in full (body; no comments/reviews). Inspected tip Tip vs main: VISION (per-rule):
Contract-class: restore — existing backend-source contract already required a real adapter; tip closes the Bash 3.2 status-loss hole on that path. Gates: attestation MATCH. Fork CI/NM 35825127962 / 35825127991 approved this pass after diff review (ci.yml change is test-only; no sudo/ |
|
Speaking as Kun's firstmate: this is merged. Thank you @Lakescape — really appreciate you taking the time on this. |
* feat: cut validation token cost without lowering review rigor Classify documentation-only changes as direct-PR surfaces on no-mistakes-prod-only projects, fold small pre-merge follow-ups into the open task's branch for one validation of the final head, document the machine-global per-purpose model routing no-mistakes supports (economical agent_config default with strong review_agents pins and its unsupported per-step boundary), and pin the repo-side boundary with a deterministic contract test. * no-mistakes(review): Prioritize full validation over every lighter delivery category * no-mistakes(document): Remove machine-specific claims from validation routing documentation * fix: submit stuck inbox doorbells instead of skipping them (kunchenguid#5374) * fix(bin): submit our own stuck doorbell instead of skipping every later ring * no-mistakes(review): Confirm and retry Enter once on stuck-doorbell submit * no-mistakes(document): Clarify doorbell retry and pending-composer documentation * docs: state the captain-approved model-routing boundary precisely Strong models serve review and review fixes; economical models serve all other validation work and fixes, which is the approved policy rather than an unsupported claim that difficult non-review fixes get stronger models. * feat: add opt-in fleet activity ledger (kunchenguid#5375) * feat(bin): add the opt-in fleet activity ledger Homes that create config/fleet-ledger get an append-only JSONL file, state/fleet-ledger.jsonl, recording task.dispatched, task.status, task.merged, and task.cleaned_up so outside tools can follow a fleet. With the flag absent each producer does one file test and nothing else. docs/fleet-ledger.md owns the record contract and its documented limits. * no-mistakes(review): Record task.status text verbatim after the first colon * no-mistakes(document): Clarify fleet ledger status and setup documentation * no-mistakes(ci): Fixed a timing race in tests/fm-pi-branch-extension.test.sh: the replacement-wake test now waits for the prompt to start before releasing it. The focused test passed twice, and git diff --check passed * fix: validate public follow-up deliverables and wake on rejection (kunchenguid#5352) * fix(bin): format, validate, and surface public-followup deliverables brief pre-fills report_path=data/<work-id>/report.md and states the accepted format of every value it cannot know instead of a bare <value> placeholder. fm-public-followup-emit.sh refuses a deliverable tasks-axi would refuse, in both the direct and staged destinations, naming the key, value, and format. consume records the specific deliverable, outcome, or missing key behind a tasks-axi refusal, and each refusal wakes the owning home once through the existing relay poll. * no-mistakes(review): refuse emits missing a required deliverable in both destinations * no-mistakes(review): require promised deliverables and keep rejections recoverable * no-mistakes(review): mirror tasks-axi's canonical pull request URL rule * no-mistakes(review): keep a rejection wake whose line cannot be read * no-mistakes(review): key emit-time rules on the promise, not the outcome * no-mistakes(review): bound deliverable keys and values as tasks-axi does * no-mistakes(review): state rejection wakes as at-least-once and pin it * no-mistakes(review): enforce the promised contract tasks-axi holds at emit * no-mistakes(review): stop inferring a staged promise from its outcome * no-mistakes(document): Refresh public follow-up documentation * no-mistakes(ci): Fixed both CI flakes. Watcher cleanup is now installed before singleton acquisition, preventing timeout races from leaving stale locks while preserving recovery-failure evidence. Bearings render fixtures now publish a valid isolated Lavish session store and retire each listener after rendering, eliminating false unowned-source races. Verified with checkpoint stress, fm-watch-checkpoint, fm-watcher-lock, repeated fm-bearings-board-render runs, project lint, syntax checks, and git diff checks * Revert unrelated CI auto-fix edits to the watcher and bearings board test The CI step's automatic repair changed bin/fm-watch.sh and tests/fm-bearings-board-render.test.sh to chase two intermittent CI failures that also occur on main and are not part of this change. Restore both files so this branch carries only the public-followup deliverable fix. * no-mistakes(review): Refuse a repeated --deliverable key at emit argument parsing * no-mistakes(document): Clarify public-followup validation and rejection-wake documentation * feat: add Devin CLI crewmate and scout adapter (kunchenguid#5380) * Add verified Devin CLI worker adapter * no-mistakes(review): Drop Devin resolver refusal and launch marker * no-mistakes(review): Verify devin in bootstrap, fold kind rule, update docs * no-mistakes(document): Document Devin sidecar, resume, and worker-only facts * no-mistakes(document): Document Devin interrupt, liveness anchor, composer signals * fix(control): never pair Devin interrupt presses on an idle agent A fast double Escape on an idle Devin opens its /revert picker, where Enter reverts file changes. fm-control now sends the second press only after the first renders Devin's 'esc again to interrupt' armed hint, never sooner than 0.5 s, closes a revert picker a mistimed press opened with one Escape, and refuses to type the exit command while that picker is open. An unarmed interrupt reports cancel=not-running and leaves the busy record untouched. * fix(devin): disable Claude hook import and commit attribution for workers The per-task Devin config now forces read_config_from.claude=false, so a worker no longer runs the user's or project's Claude Code hooks (including Herdr's Claude agent-state hook), and attribution=false, so Devin adds no Co-Authored-By trailer or Generated-with line to commits and PRs. * test(devin): extend live guard and record Herdr and revert-picker evidence The credentialed live guard now fails if an imported Claude Code hook runs, if the worker's commit carries Devin attribution, if an idle interrupt sends more than one press or opens the revert picker, or if an open picker lets exit through or is closed with a revert. The Devin reference, agent-control doc, and verification records carry the 2026-09-22 tmux and Herdr lab results, including the Herdr exit refusal. * no-mistakes(document): Correct Devin documentation links and lifecycle guidance --------- Co-authored-by: Denis Beliaev <[email protected]> * fix(bin): recognize passed-with-skips as a passing outcome (kunchenguid#5322) fm-crew-state classifies the no-mistakes outcome 'passed-with-skips' as unknown, so a finished worker awaiting merge is re-alerted as stale. The same blind spot lets fm-teardown's pre-teardown terminal-run check refuse a legitimate abort race that lands on this outcome. Map passed-with-skips to done in crew-state resolution, keeping the skipped publication/CI verification visible in the detail rather than reporting a clean pass, and recognize it as terminal during teardown. * fix(bin): refuse unavailable backend adapters before sourcing (kunchenguid#5382) * fix: refuse missing backend adapter before source * no-mistakes(review): Gate backend precheck under stock Bash * no-mistakes(document): Clarify adapter precheck docs * no-mistakes(lint): Suppress intentional child Bash ShellCheck warning * test: repair base-red liveness, export-DOM, and wake-queue self-tests (kunchenguid#5338) * fix(test): repair tmux liveness and calm follow-up loaded_off regressions Both self-tests fail on untouched main on a host whose coreutils are a multicall binary and whose Chrome has no pre-warmed profile, and each failure masks the other's file. tests/fm-tmux-agent-liveness.test.sh - the stand-in harness processes were symlinks to the host's `sleep`. A single-purpose `sleep` runs happily under another name, but a multicall coreutils binary (uutils or busybox) resolves its applet from argv[0]: `claude-link -> sleep` invoked under the harness name runs the wrong applet and exits immediately, so no foreground process exists and every positive case reads not-alive ("last verdict for liveness:agent was missing (expected alive); title=sh comms=[sh ]"). Build a dedicated spinner as the stand-in target, exactly the way the version-string case already builds its executable, and require the fallback target to demonstrably survive the rename before using it. Every assertion is untouched; the stand-in identity signal is unchanged (the kernel still records the symlink name as the executable identity). tests/fm-calm-pi-extension.test.sh - render_export_dom pinned a brand-new `--user-data-dir` per attempt. On Google Chrome for Testing 151.0.7922.34 that pristine profile makes Chrome's first-run initialization never complete: the browser and its renderers start, but --dump-dom never returns, so all three bounded attempts end exit=0 timed_out=yes bytes=0 and the DOM assertions never run ("could not render calm-mode HTML export DOM"). Chrome's own profile creation under a fresh HOME renders the same document in about a second, so the helper now gives Chrome a private per-attempt HOME instead of the explicit profile flag. Each attempt still gets an isolated profile, and every DOM assertion is unchanged. Root-cause evidence: a pristine --user-data-dir with `--headless=new --dump-dom` had not returned after 150s, while the same command with an empty HOME and no --user-data-dir returned the full DOM in ~1s, and reusing an already-populated profile also returned it in ~1s. The render failure masked the rest of the file: with it repaired, the Pi follow-up loaded_off case passes unmodified against an installed @earendil-works/pi-coding-agent package. These two failures block downstream validation of every lane on hosts with multicall coreutils or a fresh Chrome profile. Verification: - timeout 300 bash tests/fm-tmux-agent-liveness.test.sh -> exit 0, 16 assertions ok - timeout 700 bash tests/fm-calm-pi-extension.test.sh -> exit 0, 13 assertions ok, including the Pi operational follow-up loaded_off case - bash -n and shellcheck clean on both touched files - rest of tests/: bin/fm-test-run.sh --all bounded by timeout 900 completed 17 files with 0 failures (fm-afk-contract.test.sh through fm-backend-herdr-launcher-workspace-e2e.test.sh), then the bound cut off the 18th (fm-backend-herdr-presentation-e2e.test.sh, a real-herdr-gated lab test) with no failure recorded * fix(test): give wake-queue observation checkpoints the alerting ceiling tests/fm-wake-queue.test.sh's secondmate stall case runs bounded foreground watcher checkpoints whose job is to record an observation, with the alerting checkpoint that follows asserting the stall. A checkpoint's exit publishes a downtime marker, and the next checkpoint consumes it only by reaching the end of the watcher's poll loop, where the recovery surfacing runs after the stall tick; the observation itself is recorded by that same stall tick. On a loaded host a 1s ceiling sits under the cost of that iteration (which includes a pane capture in the active-turn gate), so the observation was never recorded, the downtime marker stayed pending, and the alerting checkpoint surfaced `check: rearm-resurface` instead of the stall it asserts: not ok - a foreign queue with no progress did not alert: check: rearm-resurface not ok - a frozen reprovisioned queue generation was hidden: check: rearm-resurface Give the observation checkpoints that feed a later alert the same 4s ceiling the file already documents for alerting checkpoints. The ceiling is only a bound - a checkpoint still returns on its first actionable wake - so no assertion is weakened, and the quiet windows get longer, not shorter. * no-mistakes(document): docs: correct export-DOM Chrome render root cause * no-mistakes(review): Isolate Chrome profile on macOS, dedupe tmux CC_BIN lookup * chore: re-trigger fork workflow approval for triage --------- Co-authored-by: Captain <[email protected]> Co-authored-by: kunchenguid <[email protected]> * fix: keep watcher status classification bounded to new log spans (kunchenguid#5383) * fix(bin): classify a status span without re-folding the whole log A watcher poll could take minutes, so its liveness beacon aged past the guard's 300s grace and the Stop auto-arm reported the watcher down. On the main home, cycles ended with beacon_age 91-235s while healthy and 534-706s while the laptop was CPU-starved. Cause: whenever a newly appended status span held a keyed needs-decision or blocked line, status_span_first_actionable_record re-read and re-folded the ENTIRE log to decide whether that opening was still live, forking several subshells per line. On a remote second mate's mirrored parent channel (1.2MB, ~2300 lines) that is 13-20k subshells, about 17s per log per classification when idle, paid by every signal and heartbeat scan. Nothing regressed recently: subshell counts per classification were 20,272 from kunchenguid#3268 (2026-08-29, which introduced the whole-log fold) and 13,188 from kunchenguid#3753 onward through HEAD. The cost grew with log size, since parent-channel logs only grow. Fix: fold only the captured span. An accepted opening does not depend on earlier lines and only later lines close or supersede it, and every later line lies inside the span, so the span fold names the same live openings at a cost bounded by the span. Old and new classification outputs are byte-identical across 51 span offsets of real-shaped secondmate and ship logs. A real-watcher regression test records every read the classification makes through the span-reader seam and asserts none reaches before the classified offset; it fails on the old code (5,157 bytes read from offset 0 to classify an 84-byte span). * no-mistakes(document): Clarify span classification and watcher regression coverage * test: close pr-check watcher test gaps (original flake already fixed by kunchenguid#5362 and kunchenguid#4878) (kunchenguid#5381) * test: fix watcher timing flakes in fm-pr-check-security The bounded watcher's hang guard now counts only the watcher's own time: a case marks the intervals where it holds the watcher on injected work or makes it wait on concurrent work, and those no longer count against its budget. The budget itself stays at main's sixty seconds. The helper also stops forcing a one-second per-check timeout, which killed a correct merged poll whenever that poll took longer than a second, so the watcher only retried it or exited on a later check's wake without the merge. The concurrent-publication case pauses the guard while its arming is in flight, and its task now sorts before the contributions observer the arming also registers, so the watcher stops on the poll under test before running that unrelated fleet snapshot. The case also prints the watcher's stderr when it fails. The replacement case pauses the guard while the re-arm runs inside the watcher, runs that injected arming with the fixture root every other arming here uses, and waits on the replacement merge's process instead of a two-second cap. Merged-poll runs retire the contributions observer before the watcher starts, since no case here exercises it. The returned-descendant case no longer races a four-second sleep or a TERM landing at an arbitrary point in the watcher's idle loop: its descendant holds until killed, and a second check in the same cycle witnesses that it was drained and stops the watcher. * no-mistakes(ci): Reproduced the intermittent board-render failure. Its Lavish stub listed an open session but omitted the session-state record required by the listener, so the build could race the listener’s exit. Added matching fixture state; the affected suite passed three consecutive runs, and shell syntax and diff checks passed * Revert "no-mistakes(ci): Reproduced the intermittent board-render failure. Its Lavish stub listed an open session but omitted the session-state record required by the listener, so the build could race the listener’s exit. Added matching fixture state; the affected suite passed three consecutive runs, and shell syntax and diff checks passed" This reverts commit 6a59859. * feat: record fleet status immediately and emit PR-ready events (kunchenguid#5385) * feat: record task.pr_ready in the fleet ledger when a task PR is registered * feat: record worker status lines in the fleet ledger as they are written * no-mistakes(review): Keep worker status append failures and pass the resolved config to the ledger * no-mistakes(review): Resolve relative config override before embedding in worker command * no-mistakes(document): Clarify fleet ledger status capture timing * test: synchronize foreign queue stall checks with watcher progress (kunchenguid#5386) * test: synchronize foreign secondmate stall legs on the watcher's recorded observation Each leg of test_secondmate_foreign_queue_stall_tracks_progress_and_alerts_once ran the watcher under a 1s or 4s wall-clock checkpoint, but every later leg depends on the progress observation the previous leg's watcher recorded. Under load the watcher was killed before its first stall tick, the observation was never written, and the next leg treated its own sighting as the first one, so the stall alert never fired. Run the watcher directly and end each leg on its observable outcome: the progress marker recording the expected observation, or the watcher's own first wake. Also move a comment orphaned above this test back to the drain liveness test it describes. * no-mistakes(review): Wait for full stall reset before stopping watcher leg * test: isolate the bearings render fixture from the shared Lavish store (kunchenguid#5391) The listener resolves its server from that store before it polls. Without a session for this board, it exits in the gap after the build has already sampled a live claim. * fix(bin): prune a torn-down task's wake rows at teardown (kunchenguid#5390) * fix(bin): prune a torn-down task's wake rows at teardown Prune pending durable wake rows (.wake-queue) for a task when it is torn down, clearing stale wakes for its target window, signal wakes for its status or turn-ended files, and task-specific check wakes. Fixes kunchenguid#3419. Adjacent to kunchenguid#5252. - bin/fm-wake-lib.sh: add fm_wake_queue_prune_task - bin/fm-teardown.sh: call fm_wake_queue_prune_task in cleanup_firstmate_home_children and main teardown - tests/fm-wake-queue.test.sh: add test_wake_queue_prune_task * no-mistakes(document): docs: note teardown prunes a task's wake rows --------- Co-authored-by: Captain <[email protected]> * test: align portable test expectations with resolved host paths and fixture readiness (kunchenguid#5392) * Make portable tests match resolved host paths Summary: - Match macOS full Node command paths by basename in the Gemini behavior test. - Mirror symlink-resolved Nix PATH behavior and give the loaded-host race bounded headroom. Testing: - bin/fm-lint.sh - bin/fm-test-run.sh tests/fm-on.test.sh tests/fm-gemini-harness.test.sh tests/fm-procevent.test.sh Related: - None * no-mistakes(review): Mirror production PATH helper rules per directory group in tests * no-mistakes(test): Wait for orphan runner start marker instead of fixed sleep * no-mistakes(document): Clarify gemini ancestry test comment for versioned node comm --------- Co-authored-by: Sandeep Salwan <[email protected]> * no-mistakes(document): Correct capture inbox ownership reference --------- Co-authored-by: Kun Chen <[email protected]> Co-authored-by: Denis Beliaev <[email protected]> Co-authored-by: Mickaël Rémond <[email protected]> Co-authored-by: NATHAN Menkin <[email protected]> Co-authored-by: blackxwhite88 <[email protected]> Co-authored-by: Captain <[email protected]> Co-authored-by: kunchenguid <[email protected]> Co-authored-by: Sandeep Salwan <[email protected]> Co-authored-by: Sandeep Salwan <[email protected]>
…nguid#5382) * fix: refuse missing backend adapter before source * no-mistakes(review): Gate backend precheck under stock Bash * no-mistakes(document): Clarify adapter precheck docs * no-mistakes(lint): Suppress intentional child Bash ShellCheck warning
…link fix Extend the kunchenguid#5382 fm_backend_source pre-source guard with a `bash -n` pre-parse: bash 3.2 + set -e fires the EXIT trap with $? = 0 on a failed '. file' inside a function, so a present, readable but syntactically broken adapter would still exit 0 through the same trap. A new syntax-broken condition in test_backend_source_requires_adapter_file covers it. Also apply the fm-muse-harness AMFI symlink fix to the two sibling suites: tests that cp $(command -v bash) under a fake harness name are SIGKILLed at exec (rc 137) on macOS, while a symlink resolves to the signed binary and still presents the renamed name to ps -o comm=.
…nguid#5382) * fix: refuse missing backend adapter before source * no-mistakes(review): Gate backend precheck under stock Bash * no-mistakes(document): Clarify adapter precheck docs * no-mistakes(lint): Suppress intentional child Bash ShellCheck warning
Intent
Nate wants First Mate cleaned up and current while preserving unlanded work. Port only the proven missing backend-adapter readable-file precheck from preserved local commit 1151849 onto current upstream, with executable regression proof; do not change OMP posture, raw-launch policy, Orca composite-ID policy, dirty worktrees, session ownership, or merge authority. Keep this one narrow safety slice and report exact gates.
What Changed
fm_backend_sourceto resolve the adapter path once and reject missing or unreadable backend adapter files before dot-sourcing them.FM_TEST_ONLYsupport for the backend suite and runs the adapter-file regression in CI under stock/bin/bash, expecting the two backend precheck cases.Risk Assessment
Testing
Targeted validation passed: stock macOS
/bin/bash3.2 exercised the new missing and unreadable adapter regression, the CLI transcript demonstrates the end-user shell failure mode without lifecycle continuation, the workflow YAML consumer test passed, and the fullfm-backendsubject passed after hermetic test-harness fixes; no UI artifact was applicable because this is shell/CI behavior.Evidence: Stock Bash adapter precheck regression after fixes
Source: Stock Bash adapter precheck regression after fixes
Evidence: CLI behavior demo for missing/unreadable adapter precheck
Source: CLI behavior demo for missing/unreadable adapter precheck
Evidence: Backend subject test after hermetic harness fixes
Source: Backend subject test after hermetic harness fixes
Evidence: CI workflow semantic contract test
Source: CI workflow semantic contract test
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-backend.test.sh:538- The required regression proof is Bash-3.2-specific, but this new case invokes plainbash -c, so on the normal Ubuntu/modern-Bash lanes the test can pass before the fix because Bash 5 already exits nonzero for the missing dot-source path. The existing stock macOS Bash CI job does not runtests/fm-backend.test.sh, so no source-owned gate currently forces this new case through the affected Bash 3.2 shell. Pin this case to the stock-Bash path in that lane, or add a focusedFM_TEST_ONLYhook and invoke it from the existing macOS stock-Bash job.🔧 Fix: Gate backend precheck under stock Bash
1 warning still open:
bin/fm-backend.sh:624- The new adapter precheck returns failure for a known-but-missing or unreadable adapter without printing any diagnostic. A concrete caller path isfm-spawn.sh: afterfm_backend_validate_spawn "$BACKEND"succeeds,fm_backend_source "$BACKEND" || exit 1exits silently when the tracked adapter file is absent or unreadable. Since this change is specifically protecting missing backend prerequisites, emit a stderr refusal naming the adapter before returning.✅ **Test** - passed
✅ No issues found.
Verified checkout context for target37d9831f5ae4d8c2cb80c34ede6c376a04da3a15against basee7cb23e6a7c4882cea83717a8fa80c2e6d7292d3and inspected the changed surface:.github/workflows/ci.yml,bin/fm-backend.sh, andtests/fm-backend.test.sh.FM_TEST_ONLY=test_backend_source_requires_adapter_file FM_TEST_BASH=/bin/bash /bin/bash tests/fm-backend.test.shManual CLI demo using/bin/bashto sourcebin/fm-backend.sh, load an existingtmuxadapter successfully, then pointFM_BACKEND_LIB_DIRat missing and unreadablebackends/tmux.shfixtures underset -eand verifyshell_exit=1,trap_status=1, andcontinuation=absent.bin/fm-test-run.sh tests/fm-ci-workflow.test.shDiagnostic triage while repairing the backend subject harness:FM_TEST_ONLY=test_spawn_symlinked_project_prefix_avoids_false_refusal /bin/bash tests/fm-backend.test.sh,tasks-axi --version, andtasks-axi hold/update/mv --help.bin/fm-test-run.sh tests/fm-backend.test.shafter the test-harness fixes.✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Suppress intentional child Bash ShellCheck warning
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.