Skip to content

feat(bin): verify agy as a crewmate and scout harness adapter - #4195

Closed
auss wants to merge 5 commits into
kunchenguid:mainfrom
auss:fm/fm-agy-adapter
Closed

auss wants to merge 5 commits into
kunchenguid:mainfrom
auss:fm/fm-agy-adapter

Conversation

@auss

@auss auss commented Sep 11, 2026

Copy link
Copy Markdown

Intent

Captain (2026-09-10 ~17:35 UTC), answering firstmate's proposal to verify Antigravity (agy) as a worker runtime in firstmate, so the fleet has capacity in reserve when Claude and Codex quotas are exhausted: "tak, zlec" (yes, commission it). The proposal's scope: full adapter verification of agy per the harness-adapters contract - detection, spawn, busy state, composer, lifecycle, live guard. Installed agy 1.2.0 offers --model, --effort low|medium|high, --prompt-interactive, --continue/--conversation, and --dangerously-skip-permissions. Captain (~17:45 UTC), on how to deliver it given there is no push access to kunchenguid/firstmate: "2. Fork i PR" - push to the fork https://github.com/auss/firstmate and open a public PR against kunchenguid/firstmate. Captain (~18:45 UTC), choosing the worker model: "ok, pusc astre".

What Changed

  • Added detection, spawn, control, and busy-state support for the agy (Antigravity 1.2.0) harness across bin/fm-harness.sh, bin/fm-spawn.sh, bin/fm-control-lib.sh, bin/fm-busy-lib.sh, bin/fm-bootstrap.sh, and bin/backends/tmux.sh — including its launch template (--dangerously-skip-permissions --prompt-interactive), --model/--effort low|medium|high flags, interrupt/exit key mapping, and a crewmate/scout-only restriction (no secondmate support)
  • Marked agy's busy classification as unknown agy-unverified since no semantic busy signal is verified yet, and added it to the crew-dispatch validator's verified-harness and effort-level lists
  • Added the adapter reference doc (.agents/skills/harness-adapters/references/harness/agy.md), registered it in the harness-adapters skill and documentation-audiences manifest, and recorded the dated live-guard verification evidence in docs/verification/runtime-backends.md
  • Added tests/fm-agy-harness.test.sh and tests/fm-agy-signals-live-e2e.test.sh, and extended tests/fm-bootstrap.test.sh, tests/fm-spawn-dispatch-profile.test.sh, and tests/fm-tmux-agent-liveness.test.sh to cover the new adapter

🤖 Generated with Claude Code

Risk Assessment

✅ Low: Both fix-round commits are minimal, scoped exactly to the two previously-approved findings (crew-dispatch validator/docs and tmux liveness classifier), correctly mirror sibling adapter patterns (grok's effort set, omp's bare-word anchoring), and are verified against the actual fm-spawn.sh secondmate-restriction logic they document.

Testing

Ran four targeted test scripts against the real toolchain (real jq, real tmux 3.3a, and a real installed Antigravity CLI 1.2.0 + Herdr 0.9.0 binary set): the crew-dispatch validator test (covers the new agy verified-harness entry and agy low/medium/high effort acceptance plus xhigh rejection), the tmux liveness classifier test (agy's bare process name now classifies alive; agyw/magyar decoys correctly stay ambiguous), the portable agy adapter contract test (detection, lifecycle/kind support, busy state, composer classification), the spawn dispatch profile test (agy launch flags/model/effort), and the credentialed live e2e guard, which actually spawned a live agy 1.2.0 scout through Herdr, confirmed the folder-trust flow, in-session harness detection, empty/pending composer states, and interrupt/exit/relaunch control — all exited 0 with no failures. No leftover state or processes remained afterward.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
crew-dispatch validator accepts agy and its effort levels ✅ pass live bash bin/fm-test-run.sh tests/fm-bootstrap.test.sh — passed, exercising the new 'agy shared efforts are accepted' (low/medium/high) and 'unsupported agy xhigh effort is flagged' cases against the re…
tmux backend classifies a live agy pane as alive, not ambiguous ✅ pass live bash bin/fm-test-run.sh tests/fm-tmux-agent-liveness.test.sh against real tmux 3.3a — 'tmux liveness: agy's bare binary name classifies alive' and 'unrelated agy-containing command names stay ambigu…
harness enumeration docs mention agy alongside sibling adapters ⏸️ untested no Prose-only documentation completeness fix (docs/architecture.md, docs/trace-context.md) with no executable interface or generated artifact to drive; per the test-quality rule this is not verifiable vi…
agy adapter detection, lifecycle, busy-state and composer contract ✅ pass live bash bin/fm-test-run.sh tests/fm-agy-harness.test.sh tests/fm-spawn-dispatch-profile.test.sh — all cases passed, including real-executable ancestry detection, ship/scout-only lifecycle, unknown-agy-…
end-to-end live guard: real agy 1.2.0 process spawned, detected, and controlled through Herdr ✅ pass live FM_AGY_LIVE=1 bash bin/fm-test-run.sh tests/fm-agy-signals-live-e2e.test.sh spawned a live Antigravity CLI 1.2.0 scout via the real herdr binary, accepted the folder-trust dialog, confirmed in-sessi…
decoy process names (agyw, magyar) do not falsely register as live agy agents ✅ pass live Same tmux liveness run: both decoys classified 'ambiguous' as required, proving the anchored glob does not widen into a substring match
Evidence: crew-dispatch validator test (agy verified/effort cases)
ok - bootstrap validates crew-dispatch.json and reports malformed or unverified configs
FM_TEST_END ... tests/fm-bootstrap.test.sh exit=0
Evidence: tmux liveness classifier for agy
ok - tmux liveness: agy's bare binary name classifies alive
ok - tmux liveness: unrelated agy-containing command names stay ambiguous
Evidence: agy adapter contract + spawn dispatch profile
ok - agy native marker and executable ancestry work independently
ok - agy lifecycle is worker-only and busy state remains unknown
ok - agy composer requires identity, container and footer together
ok - agy palette placeholder stays ghost while typed input stays pending
ok - agy launch carries model and supported effort without Gemini settings
Evidence: live agy 1.2.0 spawn via Herdr (credentialed e2e)
spawned probe harness=agy kind=scout window=fm-lab-agy-live-3098849-29991:w1:p1
interrupt-delivered probe harness=agy backend=herdr verified=agent-alive cancel=unconfirmed
stopped probe harness=agy backend=herdr
relaunched probe harness=agy from=agy model=default effort=low backend=herdr
stopped probe harness=agy backend=herdr
ok - agy 1.2.0 canonical launch, composer, interrupt, exit and relaunch
FM_TEST_END ... exit=0

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (2) ✅
  • ⚠️ bin/fm-bootstrap.sh:1107 - bin/fm-bootstrap.sh's crew_dispatch_validate() jq validator (the config/crew-dispatch.json linter run at session bootstrap) still hardcodes verified($h) as ["claude","codex","opencode","pi","pi-signed","grok","kimi","cursor","muse","rovo","omp"] and effort_ok has no agy branch. Every other adapter this feature mirrors (muse, rovo, omp) got a matching update here plus a tests/fm-bootstrap.test.sh case (e.g. line 1132's 'muse shared efforts are accepted'), but agy got neither. Since the user intent's whole motivation is reserving agy as fallback crewmate/scout capacity when Claude/Codex quotas are exhausted - exactly the use case config/crew-dispatch.json exists for - a dispatch rule naming "agy" will make session bootstrap print a false 'CREW_DISPATCH: invalid config/crew-dispatch.json - unverified harness: agy' diagnostic even though bin/fm-spawn.sh and bin/fm-control-lib.sh fully support launching and controlling it. This doesn't block manual --harness agy launches, but it breaks the config-driven dispatch path the feature was commissioned for.
  • ℹ️ docs/architecture.md:257 - docs/architecture.md:257 ('That keeps spawn launch compatible across claude, codex, opencode, pi, pi-signed, grok, kimi, cursor, gemini, muse, rovo, and omp...') and docs/trace-context.md:26 (the unconditional pre-launch TRACEPARENT injection coverage list) both exhaustively enumerate every verified adapter and were kept in sync for muse/rovo/omp's additions, but neither was updated to add agy in this change, even though both mechanisms (effort-flag omission, TRACEPARENT injection) are harness-agnostic and already cover agy functionally. Purely a documentation completeness gap, not a behavior bug.

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/backends/tmux.sh:178 - fm_backend_tmux_classify_process_name (bin/backends/tmux.sh:161-193), the single owner of the process-name vocabulary that fm_backend_tmux_agent_state uses to decide alive/dead/ambiguous for the tmux backend, has no entry for agy. Every other primary/crewmate adapter this change's sibling commits (muse, rovo, omp) added got a matching entry here (rovo via the glob at line 178, muse and omp anchored exactly at lines 174/171) plus decoy-name test coverage in tests/fm-tmux-agent-liveness.test.sh, but agy got neither, even though .agents/skills/harness-adapters/references/harness/agy.md:9 states 'the native executable reports process name agy' - the same bare-word shape omp needed anchoring for. Since tmux is firstmate's default backend (bin/fm-spawn.sh:70: 'absent backend= means tmux') and agy has no backend restriction in fm-spawn.sh, spawning an agy crewmate/scout without an explicit --backend flag reaches this classifier: agy matches none of *claude*|*codex*|*opencode*|*grok*|*kimi*|*rovo*|pi|pi-signed|pi-launcher|Pi|omp, falls through to fm_harness_path_name (whose FM_HARNESS_NAMES in bin/fm-session-lock-lib.sh also omits agy) and fm_cursor_process_matches (cursor-specific), and returns 'other'. fm_backend_tmux_agent_state then reports 'ambiguous' instead of 'alive' for a live, busy agy pane - a wrong liveness label that fm-watch.sh, fm-crew-state.sh, and fm-teardown.sh all consume for the exact 'live guard'/'lifecycle' capabilities the user intent's proposal named as in-scope for agy's verification. Teardown does fail safe on ambiguous (refuses automatic teardown per bin/fm-teardown.sh:949), so this doesn't destroy state, but it breaks correct status reporting and automated lifecycle handling for agy on the default backend.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
crew-dispatch validator accepts agy and its effort levels ✅ pass live bash bin/fm-test-run.sh tests/fm-bootstrap.test.sh — passed, exercising the new 'agy shared efforts are accepted' (low/medium/high) and 'unsupported agy xhigh effort is flagged' cases against the re…
tmux backend classifies a live agy pane as alive, not ambiguous ✅ pass live bash bin/fm-test-run.sh tests/fm-tmux-agent-liveness.test.sh against real tmux 3.3a — 'tmux liveness: agy's bare binary name classifies alive' and 'unrelated agy-containing command names stay ambigu…
harness enumeration docs mention agy alongside sibling adapters ⏸️ untested no Prose-only documentation completeness fix (docs/architecture.md, docs/trace-context.md) with no executable interface or generated artifact to drive; per the test-quality rule this is not verifiable vi…
agy adapter detection, lifecycle, busy-state and composer contract ✅ pass live bash bin/fm-test-run.sh tests/fm-agy-harness.test.sh tests/fm-spawn-dispatch-profile.test.sh — all cases passed, including real-executable ancestry detection, ship/scout-only lifecycle, unknown-agy-…
end-to-end live guard: real agy 1.2.0 process spawned, detected, and controlled through Herdr ✅ pass live FM_AGY_LIVE=1 bash bin/fm-test-run.sh tests/fm-agy-signals-live-e2e.test.sh spawned a live Antigravity CLI 1.2.0 scout via the real herdr binary, accepted the folder-trust dialog, confirmed in-sessi…
decoy process names (agyw, magyar) do not falsely register as live agy agents ✅ pass live Same tmux liveness run: both decoys classified 'ambiguous' as required, proving the anchored glob does not widen into a substring match
  • bash bin/fm-test-run.sh tests/fm-bootstrap.test.sh
  • bash bin/fm-test-run.sh tests/fm-tmux-agent-liveness.test.sh
  • bash bin/fm-test-run.sh tests/fm-agy-harness.test.sh tests/fm-spawn-dispatch-profile.test.sh
  • FM_AGY_LIVE=1 bash bin/fm-test-run.sh tests/fm-agy-signals-live-e2e.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Tip 9e8b0b0b27f0f7e55bf054f4a439988c42722e74 vs main 4768e98d469b7216569acf6e7a5cc696ecd15c2e. MERGEABLE/UNSTABLE. Attestation MATCH.

Contract-class opt-in (agy harness selected explicitly via spawn/adapter name — not a new always-on default; secondmate refused). Full file-list/diff reviewed: no .github/workflows/*, no secrets exfil. Launch template uses agy --dangerously-skip-permissions (documented in the agy harness note / live verification) — security FYI tip-only, not a captain card; same pattern as other autonomy-flag adapters and gated behind explicit harness choice.

Overlapping open agy adapter work (help existing; not closing this PR just for overlap unless captain lands one): preferred recent #4086 (jlucaso1); also #3858, #3524, #3008, #1408, #4139, #3721, #3805, #2366, #2186, #2639, and related. Prefer converging on the preferred lane rather than competing landings.

Approved tip runs: CI 34566199503, Require no-mistakes 34566199429.

Waiting on CI, not on you and not on the captain. Do not merge until checks go green (and prefer aligning with the preferred overlap lane). Merge? N.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants