This repository was archived by the owner on Nov 5, 2026. It is now read-only.
Repository navigation
feat(harness): verify agy (Antigravity) as a crewmate and scout adapter - #1
Merged
Merged
Conversation
…henguid#4288) Every other make_hold_home caller in this file skips when tasks-axi is absent; this test was the one unguarded call, so hosts without tasks-axi hard-fail the fixture build instead of skipping.
… scout-only status and anchoring
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
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". Captain (2026-09-1112): run the real agy end-to-end test with recorded evidence, then finish validation. Captain (2026-09-12 ~11): implement agy quota-fallback support as a quickfix - provider mapping agy in fm-quota-choose.sh, quota source agy-cli-manager with short_usage_value and weekly_usage_value meaning percent REMAINING, and test coverage replacing the old rejection. Captain (2026-09-12): resume and finish the validation, then put the PR up in our own repository (auss/firstmate).What Changed
agy) as a verified crewmate/scout adapter: detection via theANTIGRAVITY_AGENT=1marker andagyprocess name, a spawn template using--dangerously-skip-permissions --prompt-interactivewith--modeland--effort low|medium|high, Escape interrupt and/exitcontrol verbs, secondmate launches refused like muse/gemini, and busy state reported asunknown agy-unverifieduntil a semantic source is verified.>composer inside solid rule pairs, accepting both the 1.2.0? for shortcutsfooter and the 1.2.1 constant status bar anchored on| ctx:, and extended the shared ghost stripper with an opt-in palette-index foreground class (38;5;8) so agy's de-emphasized mode placeholder never reads as typed input; the tmux liveness detector and crew-dispatch/bootstrap harness enumeration now include agy.agyprovider infm-quota-choose.sh(percent-remaining semantics from agy-cli-manager) so it participates in quota-fallback worker selection, replacing the previous rejection, and pinned the adapter with new portable (tests/fm-agy-harness.test.sh) and live (tests/fm-agy-signals-live-e2e.test.sh) tests plus a verified tool record (.agents/skills/harness-adapters/references/harness/agy.md) and dated live-guard evidence indocs/verification/runtime-backends.md.Risk Assessment
✅ Low: The change is a well-bounded adapter verification whose review-prescribed fixes all landed exactly as authorized; the last fixer commit strictly deleted duplicated machinery while manual tracing confirmed both default and agy-specific stripping behavior is preserved, leaving no substantiated defect.
Testing
Drove the full live agy adapter surface against the real product: the captain-ordered live guard ran a real agy 1.2.2 scout end-to-end (launch, trust, detection, composer, interrupt, exit, relaunch) and passed, real-agy liveness was verified through both the tmux backend and the shared process classifier, and quota fallback was exercised with the real agy-cli-manager quota through the real chooser; every targeted portable suite passed with no failures. Two supporting behaviors — bootstrap crew-dispatch acceptance of agy rules and the fm-spawn agy launch profile flags — were covered only by portable fixture suites and remain live-untested.
Evidence: Live e2e guard: real agy 1.2.2 canonical launch, composer, interrupt, exit and relaunch
Source: Live e2e guard: real agy 1.2.2 canonical launch, composer, interrupt, exit and relaunch
spawned probe harness=agy kind=scout window=fm-lab-agy-live-1783276-7763:w1:p1 interrupt-delivered probe harness=agy backend=herdr verified=agent-alive cancel=unconfirmed relaunched probe harness=agy from=agy model=default effort=low backend=herdr ok - agy 1.2.2 canonical launch, composer, interrupt, exit and relaunchEvidence: Manual live drives: real agy tmux liveness, shared classifier, detection, and real-quota fallback
Source: Manual live drives: real agy tmux liveness, shared classifier, detection, and real-quota fallback
real agy pane pid=1801012 comm=agy -> tmux backend state=alive shared classifier: agy -> agent chooser (claude, codex exhausted; real agy 81.59% remaining): agy default chooser (agy exhausted_now): pi default ALL MANUAL LIVE DRIVES PASSEDEvidence: Portable agy contract suite (detection, worker-only lifecycle, 1.2.0/1.2.1 composer shapes)
Source: Portable agy contract suite (detection, worker-only lifecycle, 1.2.0/1.2.1 composer shapes)
Evidence: Composer ghost/lib suites after the shared palette-class stripper fold
Source: Composer ghost/lib suites after the shared palette-class stripper fold
Evidence: Quota chooser suite including agy acceptance and exhausted-agy fallback
Source: Quota chooser suite including agy acceptance and exhausted-agy fallback
Evidence: tmux liveness suite including real agy-name and decoy panes
Source: tmux liveness suite including real agy-name and decoy panes
Evidence: Bootstrap crew-dispatch validation suite (agy rules accepted, agy:xhigh flagged)
Source: Bootstrap crew-dispatch validation suite (agy rules accepted, agy:xhigh flagged)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (2) ✅
bin/fm-agent-process-lib.sh:43- agy was added to tmux's liveness classifier only, via the local wrapper fm_backend_tmux_classify_process_name (bin/backends/tmux.sh:160-168, prior fix round a6d6d66), but the shared owner fm_agent_process_classify_name (bin/fm-agent-process-lib.sh:43, case list 'claude|codex|opencode|grok|kimi|rovo|pi|pi-signed|pi-launcher|Pi|omp') still has no agy entry, and FM_HARNESS_NAMES (bin/fm-session-lock-lib.sh:28) omits it too. This violates the library's own documented invariant (fm-agent-process-lib.sh:12-15: the two backends 'must agree on what a given process name means, or a harness one backend recognizes silently reads as a dead pane on the other') and leaves the herdr backend - the backend agy was verified on - misclassifying a liveagyprocess. Concrete paths: (1) every fm_backend_herdr_pane_process_state read of a live agy pane classifies its foregroundagyasother(bin/backends/herdr.sh:2150), so the resample loop that only retriesotherburns the full settle window (FM_BACKEND_HERDR_IDLE_SHELL_PROOF_POLLS=10 x 0.1s plus 10 herdr CLI round trips) on every husk check, crew-state, watch, and relaunch-state read, before concluding other->live; (2) a wrong result without erroring: when the agy TUI is alive but outside the pane's foreground group - the suspended/backgrounded/nested-shell shape the descendant walk at bin/backends/herdr.sh:2175 exists to defend (issue Recovery classifier trusts a stale herdr agent registration as 'live', blocking relaunch/spawn after a Pi crew exits to a shell kunchenguid/firstmate#4115 'crew shape'), or an agy Bash tool command holding the tty foreground with a shell kernel name - the descendant walk fails to recognize the live agy process, returnsshell, and fm_backend_herdr_pane_agent_state reports stale-agent -> fm_backend_herdr_agent_state reportsdead. Thatdeadverdict is what fm-spawn.sh:1351 requires to license a relaunch (a second agent launched into the same endpoint/worktree while the first agy is still alive) and what bin/fm-watch.sh:447 uses to mark steering unavailable for a live worker. Remedy: add an anchoredagyto the shared case in fm_agent_process_classify_name next to omp/muse (a one-line mechanical fix fully inside the change's stated intent - every other verified adapter is listed there), which also makes the tmux-local wrapper a redundant parallel copy of the rule that can be folded back to direct fm_agent_process_classify_name calls.🔧 Fix applied.
2 issues (1 warning, 1 info) still open:
bin/fm-composer-lib.sh:1475- _fm_composer_agy_strip_ghost duplicates fm_composer_strip_ghost's entire SGR-parsing machinery (sgr_code, skip_color_payload, and the byte-scanner loop are copied verbatim, ~60 lines) with only the de-emphasis predicate swapped (38;5;8 palette foreground instead of dark-truecolor luma). The library's own header declares fm_composer_strip_ghost 'the ONE fleet-wide ANSI-aware extractor', so there are now two owners of that parser and any future parser fix (e.g. the OSC-leak or payload-skipping edge both copies share) must land twice. The capability itself is required - the verified 1.2.0/1.2.1 mode placeholder must not read as typed input - but a strictly narrower form satisfies it: parameterize the one shared extractor with an agy-only extra ghost class (e.g. a palette-colour argument) instead of a second parser copy. Remedy is removal of the duplicate machinery, not hardening; because it touches the fleet-wide load-bearing function the change's own comment deliberately scoped away ('no other harness's styling vocabulary is load-bearing here'), the fold needs user authorization.bin/fm-harness.sh:43- The new ANTIGRAVITY_AGENT=1 check runs before every other harness's own marker (cursor, gemini, rovo, omp, claude, pi, grok), and no other harness's launch template unsets ANTIGRAVITY_AGENT. A non-agy firstmate component started by hand from inside an agy process tree (agy exports the marker to its tool subprocesses) would self-detect as agy - e.g. a claude primary started from an agy session would resolve fm_supervision_model to 'persistent' instead of 'autoarm'. This mirrors the repo's already-accepted claude-under-cursor shape (claude's template does not unset CURSOR_AGENT either), and no in-fleet fm-spawn path nests a non-agy worker under an agy ancestor since agy is worker-only and never spawns, so it is informational. If it ever matters, the remedy is -u ANTIGRAVITY_AGENT in the other templates or omp-style ancestry corroboration of the marker.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
FM_AGY_LIVE=1 bin/fm-test-run.sh tests/fm-agy-signals-live-e2e.test.sh (real agy 1.2.2 scout via isolated fm-lab-agy-live-* Herdr session: launch, trust, marker detection, composer empty/pending, interrupt verified=agent-alive, exit, relaunch)bin/fm-test-run.sh tests/fm-agy-harness.test.sh (detection precedence/ancestry, worker-only lifecycle, 1.2.0 palette-placeholder and 1.2.1 status-bar composer shapes)bin/fm-test-run.sh tests/fm-composer-ghost.test.sh tests/fm-composer-lib.test.sh (fleet-wide default ghost-stripping unchanged after folding agy into the shared palette-class stripper)bin/fm-test-run.sh tests/fm-quota-choose.test.sh (agy provider mapping, healthy selection, exhausted yields to later candidate)bin/fm-test-run.sh tests/fm-tmux-agent-liveness.test.sh (agy bare name alive; agyw/magyar decoys ambiguous)bin/fm-test-run.sh tests/fm-bootstrap.test.sh (crew-dispatch.json rules naming agy accepted; agy:xhigh flagged)bin/fm-test-run.sh tests/fm-spawn-dispatch-profile.test.sh (agy model/effort flags, worker-only boundary, no Gemini settings leakage)Manual live drive: real agy TUI pane in a real private tmux server -> fm_backend_agent_state tmux = alive; real comm 'agy' -> fm_agent_process_classify_name = agentManual live drive: ANTIGRAVITY_AGENT=1 outranks CLAUDECODE, ANTIGRAVITY_AGENT=0 rejected, real agy-named parent detected by ancestry via bin/fm-harness.shManual live drive: bin/fm-quota-choose.sh with a schema-5 snapshot whose agy row carries the real ~/.venv/bin/agy-cli-manager refresh-usage values (healthy selects agy after exhausted claude/codex; exhausted_now agy selects later pi candidate)docs/agent-control.md:51- The resume-shape enumeration this change extended still omits muse (muse.md verifiesmuse resume <session-uuid>from a session id printed at exit, thoughmuse resume --lastalso exists) and rovo (rovo.md records only the printed--restore <session-id>hint, never an exercised restore). Both omissions predate this change; completing or scoping that enumeration is a judgment call left for a follow-up because rovo's pane-resume was never verified to the sentence's bar.bin/fm-session-lock-lib.sh:21- The FM_HARNESS_RE/FM_HARNESS_NAMES comment says "extend when a new adapter is verified", but the tables omit every crewmate/scout-only adapter: gemini, muse, rovo, and now agy. Either the comment's contract should be scoped to harnesses that can hold a home session lock (primary/secondmate-capable, which matches the tables' actual contents including kimi) or the tables need the crewmate-only names; extending the tables is an executable-behavior change outside this document phase, and the file documents its cursor exclusion but not this one, so the intent is ambiguous.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.