Skip to content

feat: add Antigravity CLI support for crewmates and scouts - #340

Merged
dnth merged 15 commits into
mainfrom
fm/fm-agy-harness-adapter
Dec 3, 2026
Merged

dnth merged 15 commits into
mainfrom
fm/fm-agy-harness-adapter

Conversation

@dnth

@dnth dnth commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds agy (Antigravity CLI) as a verified crew-only harness: Firstmate can now dispatch crewmates and scouts on agy over tmux or Herdr. Primary and secondmate use is refused, as it is for hermes and devin.
Ports upstream kunchenguid/firstmate#4200 (agy worker and scout adapter) and the swarm delegation stem from kunchenguid/firstmate#8838. Upstream's primary and secondmate promotion (kunchenguid/firstmate#7941) is deliberately left out.

sequenceDiagram
    participant Spawn as fm-spawn.sh
    participant Agy as agy (pane)
    participant Bridge as fm-agy-state.sh
    participant Busy as busy record / turn-end
    Spawn->>Spawn: preflight model+effort (agy --print, no turn)
    Spawn->>Agy: agy --settings state/<id>.agy-settings.json -i "<pointer to private brief copy>"
    Agy->>Bridge: title command with agent_state JSON on every state change
    Bridge->>Busy: working / tool_use / idle+task_count>0 -> busy
    Bridge->>Busy: idle after first turn -> idle + generation-bound turn end
    Bridge->>Busy: anything unverified -> unknown
    Spawn->>Busy: wait for first agy-title record, else fail + stop endpoint
Loading

Fork divergences from upstream 4200

  • Busy state comes from agy's own title callback (agent_state JSON), not upstream's rendered esc to cancel regex. This fork's busy contract forbids new rendered-text classification, and agy 1.5.21 runs a per-session title command on every state change.
  • Worktree trust is session-only: state/<id>.agy-settings.json trusts the exact worktree path. The captain's ~/.gemini/antigravity-cli/settings.json is never written. agy trusts exact paths only (a parent path still showed the dialog).
  • The brief body never goes on agy's command line. agy gets a short pointer to a mode-600 copy under the task's state.
  • Model and effort are checked before launch with agy --print '' … </dev/null, which refuses an unsupported pair (exit 1) without opening a turn.
  • agy sets no identity env marker, so bin/fm-harness.sh detects it by the anchored process name agy. The launch clears inherited foreign markers. A Firstmate session started inside agy refuses at spawn and at the session lock.
  • agy's input box is a > row framed by full-width ─ rules. Doorbells and typed commands to an agy pane need a proven-empty input box; a draft or an ambiguous frame holds them back.
bin/
├── fm-agy-state.sh           # new: agy title callback -> busy/idle/turn-end records
├── fm-spawn.sh               # agy launch, preflight, first-turn gate, crew-only refusals
├── fm-composer-lib.sh        # agy framed input-box reader (tmux + Herdr)
├── fm-backend.sh, fm-send.sh, fm-task-inbox-lib.sh   # agy proven-empty submit guard
├── fm-control*.sh            # Escape interrupt, /exit, relaunch
├── fm-harness.sh, fm-lock.sh, fm-session-*.sh        # agy process detection, primary refusal
└── fm-subagent-pretool-check.sh                      # swarm delegation stem (8838)
tests/
├── fm-agy-harness.test.sh    # new portable regression
└── fm-agy-live-e2e.test.sh   # new opt-in live guard (FM_AGY_LIVE_E2E=1)
docs/verification/runtime-backends.md, .agents/skills/harness-adapters/SKILL.md, AGENTS.md section 4, docs/configuration.md

34 files, +1906 / -119.

Related: none found in dnth/firstmate (searched issues and PRs for agy and antigravity). Upstream sources credited above.

Evidence

  • Before: agy was not a verified harness. A raw agy launch in a named Herdr lab stopped on Do you trust the contents of this project? (Herdr reported agent_status=blocked).
    After: a supervised trial in the named Herdr lab fm-lab-fm-agy-harness-a-2309114-31595 on 2026-12-02, agy 1.5.21, spawned a managed agy crewmate. It took an fm-send steer as a new turn, appended status lines, fired the turn-end signal, and ran the /no-mistakes skill to a real no-mistakes axi run stopping at its first gate on a throwaway repo. Escape interrupt, /exit, resume and relaunch all worked, and the secondmate refusal fired. The exact commands are in docs/verification/runtime-backends.md ("agy crew lifecycle").
  • Live guard on agy 1.5.22 (ran, 2026-12-03, at d2d254af): FM_AGY_LIVE_E2E=1 tests/fm-agy-live-e2e.test.sh against the signed-in agy printed
    ok - agy 1.5.22: session trust, title-command busy/idle and turn end, background-task busy, framed composer, and /exit conversation matched the retained pointer.
  • Selection preflight (ran, agy 1.5.22): gemini-4-neon --effort low exits 0. --effort max exits 1 with gemini-4-neon has no "max" effort (0 turns, 0 tokens). An unknown model exits 1.
  • Pipeline live validation: its first test round failed two live scenarios, both fixed in d2d254af. Herdr sends agy's placeholder colour as indexed colour 8, so the reader now normalises it and an untouched input box reads empty. An unsupported effort was not refused before launch, so the selection preflight above was added. Its second round was inconclusive because its disposable agy home was not signed in: 3 of 11 scenarios (signed-in launch, signed-in steer and lifecycle, /no-mistakes first gate) did not run. The lifecycle and first-gate trial ran on agy 1.5.21, not 1.5.22; the 1.5.22 evidence is the live guard and preflight above.
  • Portable tests and CI: tests/fm-agy-harness.test.sh (new) plus updated fm-bootstrap, fm-hermes-harness and fm-subagent-pretool-check. All 20 PR checks pass on 8c8e6d61, after the pipeline's CI repair of three failing checks (shell lint and two portable shards).
  • Local environment-only failures (also fail on origin/main or off a feature branch on this machine; not caused by this change): fm-composer-lib (Bun width), fm-kimi-harness (python3 3.10 lacks tomllib), fm-omp-branch-types and fm-pi-primary-types (TypeScript errors in untouched files), fm-boat-lifecycle (no python yaml), fm-omp-relaunch-guard (fails on base too), fm-secondmate-harness (worktree-tangle banner on a feature-branch checkout; passes off one).

Accepted narrower evidence (captain)

  • The tmux agy -> alive liveness branch was not observed live; live evidence is the process name (ps -o comm= and Herdr process-info both report agy).
  • The literal swarm stem rests on upstream's vendor evidence for agy 1.5.18 and 1.5.19 plus the local classification test. No version-matched live trial exists. On 1.5.22 a lab probe saw /swarm delegate through invoke_subagent, which the existing stems already deny.
  • The Herdr agy input-box check is portable-fixture only; it changed after the live Herdr steer and /no-mistakes send.
  • The agy-primary refusal is shown by a portable test under a renamed stand-in binary, not a live Firstmate primary inside agy.

Merge Danger

Door: two-way. The adapter is additive and opt-in by harness choice; reverting removes agy and leaves no data to migrate. Task records it leaves (<id>.agy-*) are removed by teardown.

Blast Radius: crew dispatch. Most new branches are agy-only, but they sit in shared paths: fm-spawn, the inbox doorbell, typed fm-send, fm-control exit and relaunch, teardown, and the session lock. A regression there would hit every harness.

Known limitations (declined by the captain)

Finding Disposition
agy-primary-refusal-after-guard-mutation declined: a spawn attempt from inside agy can claim the stale-watcher warning before refusing; warning state only.
agy-pane-alias-bypasses-draft-protection declined: addressing an agy pane by raw tmux position (session:2.0) skips the agy draft check.
agy-concurrent-writers-can-merge-submissions declined: no per-task delivery lock for agy, the same as every non-Hermes harness.

Follow-up candidates

  • quota-axi support for the agy subscription. Typed dispatch requires an explicit provider on agy profiles until then.
  • A draft check before typed /no-mistakes and /exit for every harness (shared code; out of scope here).
  • A shared per-task delivery lock covering typed sends and doorbells.
  • agy-earlier-quote-vetoes-current-frame: an older wide rule plus a > line in scrollback can make an empty agy input box read unknown. It fails safe: the message stays queued.
  • agy-current-herdr-composer-gate-lacks-live-proof: re-prove the current Herdr input-box check live.
  • agy-private-brief-copy-exceeds-argv-fix: point agy at the authoritative brief instead of a private copy.
  • agy-primary-refusal-live-evidence-missing: live proof of the primary refusal.

Pipeline

Updates from git push no-mistakes

... (13 earlier update rounds omitted to keep the PR body within GitHub's 65536-char limit; full history is in the run log.)

⚠️ **Review** - 8 issues (4 errors, 4 warnings)

🔧 Fix applied.
9 issues (4 errors, 5 warnings) still open:

  • ⚠️ bin/fm-spawn.sh:1039 - An unsupported agy primary can still change watcher warning state on every direct spawn attempt with the normal guard enabled. fm-spawn.sh:398 invokes the mutating watcher guard before the refusal at line 1039. If the home has work in flight and a stale watcher, fm-guard.sh:217–224 can claim the warning through its write at line 107, so the next legitimate primary sees only a reminder. Round 3 closed the session-lock write path at bin/fm-session-lock-lib.sh:145, bin/fm-lock.sh:23–29, and bin/fm-session-start.sh:384–387, but this spawn-side write remains open. Move the existing refusal ahead of the watcher guard. The fixture at tests/fm-agy-harness.test.sh:127 bypasses the guard and cannot detect this ordering.
  • 🚨 bin/fm-send.sh:545 - Round 6 left a draft-protection bypass through documented tmux pane addresses. A managed agy task records session:fm-&lt;id&gt; at bin/fm-spawn.sh:3971, but an operator can address the same pane as session:2.0. The exact string lookup at bin/fm-backend.sh:559 misses the record, the existence check at bin/fm-backend.sh:895 accepts the alias, and bin/fm-send.sh:1377 passes an empty harness to the new guard at bin/fm-backend.sh:768. The literal write and Enter at bin/fm-tmux-lib.sh:502 and :444 can then submit the existing draft with the supplied text. Resolve accepted pane aliases to their managed task before choosing the typed delivery path.
  • 🚨 bin/fm-backend.sh:755 - Round 6 checks the composer before typing, but leaves the check and submission open to competing Firstmate writes. When the watcher re-rings an idle agy worker just as the operator sends /no-mistakes, both callers can see an empty composer and then type before either presses Enter. The existing per-task delivery lock at bin/fm-task-inbox-lib.sh:365 covers Hermes only. Serialize the agy check, literal write, and Enter across the initial send and watcher re-ring at bin/fm-task-inbox-lib.sh:317–322, typed sends at bin/fm-send.sh:1377, and exit and relaunch at bin/fm-control.sh:658–682. Both backend writers must be covered, including bin/fm-tmux-lib.sh:502 and bin/backends/herdr.sh:3558–3594.
  • 🚨 bin/fm-agy-state.sh:52 - AC2 says “an unverified state stays unknown.” The callback instead flattens agent_state, conversation_id, and task_count into a pipe-delimited line and turns an invalid task count into zero. After a real turn starts, a vendor callback such as {&#34;agent_state&#34;:&#34;idle&#34;,&#34;task_count&#34;:&#34;unknown&#34;} therefore emits idle and a turn-end marker even though background completion is unproven. An unverified raw state named idle-background-tasks also sets the latch at bin/fm-agy-state.sh:92 and can open the first-turn gate at bin/fm-spawn.sh:4565–4567. A delimiter in conversation_id can truncate the saved selector at bin/fm-agy-state.sh:71–76 and corrupt the count. Validate each JSON field independently at the callback boundary and keep the derived background verdict separate from the vendor enum.
  • ⚠️ bin/fm-send.sh:1411 - A successful fm-send.sh &lt;agy-id&gt; /exit can report delivery failure every time the agent exits before readback. The exit removes the frame, so bin/fm-tmux-lib.sh:351 and :465 return unknown after Enter. The Herdr fallback at bin/backends/herdr.sh:3642–3664 can reach the same verdict when registration disappears. Round 6 wired the correct stopped-endpoint postcondition into fm-control exit and relaunch at bin/fm-control.sh:682–687, but left the documented typed /exit path to report failure at bin/fm-send.sh:1477–1482. Use the same owned-endpoint stop proof for agy on that path.
  • 🚨 bin/backends/herdr.sh:2951 - The intent requires that “Every ported fact must still be proven by a live trial in a named Herdr lab session.” The recorded Herdr steer and skill send at docs/verification/runtime-backends.md:1717–1719 predate round 3's Herdr-specific frame reader at bin/backends/herdr.sh:2951 and round 6's mandatory typed precheck at bin/fm-backend.sh:755. The opt-in guard exercises the tmux reader at tests/fm-agy-live-e2e.test.sh:106–113, while the Herdr fixture at tests/fm-agy-harness.test.sh:598–605 substitutes canned capture output. Every managed Herdr steer, typed command, and controlled exit now depends on this read. The accepted evidence exceptions at docs/verification/runtime-backends.md:1727–1730 do not cover it. Confirm whether to accept portable-only evidence for the current Herdr check or require a narrow live trial.
  • ⚠️ tests/fm-agy-harness.test.sh:67 - Round 6's positive controlled-exit fixture marks the pane stopped when it receives literal /exit. The assertion at tests/fm-agy-harness.test.sh:310–317 can therefore pass if the transport drops Enter entirely. The verified agy command contract at .agents/skills/harness-adapters/SKILL.md:579 requires Enter. Stage the literal in the fixture and change the pane state only when Enter submits it.
  • ⚠️ tests/fm-agy-live-e2e.test.sh:107 - The opt-in guard starts tmux with -L at tests/fm-agy-live-e2e.test.sh:73, which honors TMUX_TMPDIR, but points the composer check at a hardcoded /tmp socket. Every invocation with a custom TMUX_TMPDIR, a setup already used by tests/fm-hermes-live-e2e.test.sh:360, can pass the first turn and then fail the composer check against the wrong socket. Read the socket path from the server the guard started.
  • ⚠️ tests/fm-agy-live-e2e.test.sh:28 - If mktemp fails, for example when an operator's TMPDIR points at a removed directory, the live guard continues with an empty TMP. Setup at tests/fm-agy-live-e2e.test.sh:36–43 then targets /repo and /state, and a privileged runner can overwrite /repo/README.md outside its scratch space. Stop before deriving any paths when scratch directory creation fails.

🔧 Fix applied.
8 issues (3 errors, 5 warnings) still open:

  • ⚠️ bin/fm-spawn.sh:1039 - An unsupported agy primary can still change watcher warning state on every direct spawn attempt with the normal guard enabled. fm-spawn.sh:398 invokes the mutating watcher guard before the refusal at line 1039. If the home has work in flight and a stale watcher, fm-guard.sh:217–224 can claim the warning through its write at line 107, so the next legitimate primary sees only a reminder. Round 3 closed the session-lock write path at bin/fm-session-lock-lib.sh:145, bin/fm-lock.sh:23–29, and bin/fm-session-start.sh:384–387, but this spawn-side write remains open. Move the existing refusal ahead of the watcher guard. The fixture at tests/fm-agy-harness.test.sh:127 bypasses the guard and cannot detect this ordering.
  • 🚨 bin/fm-send.sh:545 - Round 6 left a draft-protection bypass through documented tmux pane addresses. A managed agy task records session:fm-&lt;id&gt; at bin/fm-spawn.sh:3971, but an operator can address the same pane as session:2.0. The exact string lookup at bin/fm-backend.sh:559 misses the record, the existence check at bin/fm-backend.sh:895 accepts the alias, and bin/fm-send.sh:1377 passes an empty harness to the new guard at bin/fm-backend.sh:768. The literal write and Enter at bin/fm-tmux-lib.sh:502 and :444 can then submit the existing draft with the supplied text. Resolve accepted pane aliases to their managed task before choosing the typed delivery path.
  • 🚨 bin/fm-backend.sh:755 - Round 6 checks the composer before typing, but leaves the check and submission open to competing Firstmate writes. When the watcher re-rings an idle agy worker just as the operator sends /no-mistakes, both callers can see an empty composer and then type before either presses Enter. The existing per-task delivery lock at bin/fm-task-inbox-lib.sh:365 covers Hermes only. Serialize the agy check, literal write, and Enter across the initial send and watcher re-ring at bin/fm-task-inbox-lib.sh:317–322, typed sends at bin/fm-send.sh:1377, and exit and relaunch at bin/fm-control.sh:658–682. Both backend writers must be covered, including bin/fm-tmux-lib.sh:502 and bin/backends/herdr.sh:3558–3594.
  • ⚠️ tests/fm-agy-live-e2e.test.sh:107 - The opt-in guard starts tmux with -L at tests/fm-agy-live-e2e.test.sh:73, which honors TMUX_TMPDIR, but points the composer check at a hardcoded /tmp socket. Every invocation with a custom TMUX_TMPDIR, a setup already used by tests/fm-hermes-live-e2e.test.sh:360, can pass the first turn and then fail the composer check against the wrong socket. Read the socket path from the server the guard started.
  • ⚠️ tests/fm-agy-live-e2e.test.sh:28 - If mktemp fails, for example when an operator's TMPDIR points at a removed directory, the live guard continues with an empty TMP. Setup at tests/fm-agy-live-e2e.test.sh:36–43 then targets /repo and /state, and a privileged runner can overwrite /repo/README.md outside its scratch space. Stop before deriving any paths when scratch directory creation fails.
  • 🚨 docs/verification/runtime-backends.md:1727 - AC1 requires agy to refuse primary and secondmate use, “proven by a portable test and a real supervised trial in the Herdr lab session.” The round-5 evidence records a live secondmate refusal and a portable primary refusal using Bash named agy. The primary check matters whenever an operator tries to start Firstmate from a real agy session. The recorded exceptions at docs/verification/runtime-backends.md:1730–1732 name tmux liveness, the literal swarm tool, and the current Herdr composer checks. Supply the live primary-refusal evidence or record explicit approval for portable-only coverage of bin/fm-harness.sh:186 and bin/fm-lock.sh:23, including the startup caller at bin/fm-session-start.sh:384.
  • ⚠️ bin/fm-composer-lib.sh:90 - The round-3 frame reader measures the widest rule anywhere in the capture, and round 4 kept that selection when tightening draft handling. On Herdr, a retained 100-column transcript separator above a current 80-column ─, &gt;, ─ composer makes the parser discard both actual borders and return unknown. This can recur after a resize while the wider row remains in scrollback, and each subsequent steer retry or typed command can be refused until it scrolls out. Scope the width comparison to the active composer region, preserving refusal when that region is ambiguous. Sibling sites are bin/backends/herdr.sh:2952 (200 recent rows), bin/fm-tmux-lib.sh:354 (cursor-aware caller), bin/fm-backend.sh:755 (typed-submit gate), bin/fm-task-inbox-lib.sh:318 (doorbell gate), and bin/fm-control.sh:637 (exit and relaunch precheck).
  • ⚠️ tests/fm-agy-live-e2e.test.sh:182 - The live guard claims to check that session trust leaves the captain’s settings untouched, but it only looks for the scratch path after the run. On any opt-in run, a vendor regression that rewrites existing trust entries, removes the file, or creates a new settings file without that path can still pass. Use the pre-launch file presence and contents as the oracle and compare them after exit. The same no-write contract is stated at tests/fm-agy-live-e2e.test.sh:8 and docs/verification/runtime-backends.md:1677.

🔧 Fix applied.
8 issues (4 errors, 4 warnings) still open:

  • ⚠️ bin/fm-spawn.sh:1039 - An unsupported agy primary can still change watcher warning state on every direct spawn attempt with the normal guard enabled. fm-spawn.sh:398 invokes the mutating watcher guard before the refusal at line 1039. If the home has work in flight and a stale watcher, fm-guard.sh:217–224 can claim the warning through its write at line 107, so the next legitimate primary sees only a reminder. Round 3 closed the session-lock write path at bin/fm-session-lock-lib.sh:145, bin/fm-lock.sh:23–29, and bin/fm-session-start.sh:384–387, but this spawn-side write remains open. Move the existing refusal ahead of the watcher guard. The fixture at tests/fm-agy-harness.test.sh:127 bypasses the guard and cannot detect this ordering.
  • 🚨 bin/fm-send.sh:545 - Round 6 left a draft-protection bypass through documented tmux pane addresses. A managed agy task records session:fm-&lt;id&gt; at bin/fm-spawn.sh:3971, but an operator can address the same pane as session:2.0. The exact string lookup at bin/fm-backend.sh:559 misses the record, the existence check at bin/fm-backend.sh:895 accepts the alias, and bin/fm-send.sh:1377 passes an empty harness to the new guard at bin/fm-backend.sh:768. The literal write and Enter at bin/fm-tmux-lib.sh:502 and :444 can then submit the existing draft with the supplied text. Resolve accepted pane aliases to their managed task before choosing the typed delivery path.
  • 🚨 bin/fm-backend.sh:755 - Round 6 checks the composer before typing, but leaves the check and submission open to competing Firstmate writes. When the watcher re-rings an idle agy worker just as the operator sends /no-mistakes, both callers can see an empty composer and then type before either presses Enter. The existing per-task delivery lock at bin/fm-task-inbox-lib.sh:365 covers Hermes only. Serialize the agy check, literal write, and Enter across the initial send and watcher re-ring at bin/fm-task-inbox-lib.sh:317–322, typed sends at bin/fm-send.sh:1377, and exit and relaunch at bin/fm-control.sh:658–682. Both backend writers must be covered, including bin/fm-tmux-lib.sh:502 and bin/backends/herdr.sh:3558–3594.
  • 🚨 docs/verification/runtime-backends.md:1727 - AC1 requires agy to refuse primary and secondmate use, “proven by a portable test and a real supervised trial in the Herdr lab session.” The round-5 evidence records a live secondmate refusal and a portable primary refusal using Bash named agy. The primary check matters whenever an operator tries to start Firstmate from a real agy session. The recorded exceptions at docs/verification/runtime-backends.md:1730–1732 name tmux liveness, the literal swarm tool, and the current Herdr composer checks. Supply the live primary-refusal evidence or record explicit approval for portable-only coverage of bin/fm-harness.sh:186 and bin/fm-lock.sh:23, including the startup caller at bin/fm-session-start.sh:384.
  • ⚠️ bin/fm-composer-lib.sh:90 - The round-3 frame reader measures the widest rule anywhere in the capture, and round 4 kept that selection when tightening draft handling. On Herdr, a retained 100-column transcript separator above a current 80-column ─, &gt;, ─ composer makes the parser discard both actual borders and return unknown. This can recur after a resize while the wider row remains in scrollback, and each subsequent steer retry or typed command can be refused until it scrolls out. Scope the width comparison to the active composer region, preserving refusal when that region is ambiguous. Sibling sites are bin/backends/herdr.sh:2952 (200 recent rows), bin/fm-tmux-lib.sh:354 (cursor-aware caller), bin/fm-backend.sh:755 (typed-submit gate), bin/fm-task-inbox-lib.sh:318 (doorbell gate), and bin/fm-control.sh:637 (exit and relaunch precheck).
  • ⚠️ bin/fm-composer-lib.sh:92 - Round 8 still lets earlier transcript text block a valid agy composer. If a resize leaves a 100-column rule followed by a line beginning &gt; above the current 80-column empty frame, wider_open survives the scan and returns unknown, even when tmux's cursor is inside the current frame. This can recur while those rows remain in the capture, deferring queued steers at bin/fm-task-inbox-lib.sh:318 and refusing typed skills, exit, and relaunch at bin/fm-backend.sh:771 and bin/fm-control.sh:637. Scope frame and width checks to the active region in the shared reader used by bin/fm-tmux-lib.sh:355 and bin/backends/herdr.sh:2952. The regression at tests/fm-agy-harness.test.sh:695 covers a wider rule followed by ordinary text and misses the &gt; case.
  • 🚨 docs/verification/runtime-backends.md:1732 - AC3 requires that “a real agy trial crewmate received an fm-send steer” and “loaded a skill” to reach the first gate. The verification record says the Herdr steer and /no-mistakes send predate the current composer reader and typed-command precheck. Round 7 documented this gap, and Round 8 changed that reader again. Both the first normal steer and the first skill invocation now depend on the new check at bin/fm-backend.sh:755 and bin/backends/herdr.sh:2952. The opt-in guard uses direct tmux keystrokes at tests/fm-agy-live-e2e.test.sh:131 and :189, so it cannot refresh that Herdr evidence. Record a supervised trial through the current fm-send path in the named Herdr lab, or obtain an explicit exception for the current gate.
  • ⚠️ bin/fm-spawn.sh:5286 - Round 5 added a second private brief file on every managed agy launch and relaunch. The approved fix keeps the brief body out of argv. No intent requirement calls for a second stored copy, and the normal fm-brief.sh path already creates the authoritative brief under umask 077 at bin/fm-brief.sh:389. Keep the encoded file pointer at bin/fm-spawn.sh:1808 and point it at the authoritative brief. Remove the copy, its template substitution at bin/fm-spawn.sh:5626, and the separate cleanup at bin/fm-spawn.sh:1419 and bin/fm-teardown.sh:2994 and :3381. Update the corresponding fixture and documentation.
⚠️ **Test** - 2 warnings
  • 🚨 bin/fm-composer-lib.sh:63 - Herdr 0.9.5 serializes agy’s bright-black placeholder as SGR 38;5;8. The reader accepts only SGR 90, so an untouched empty composer defers the first steer and refuses controlled exit. The color-enabled replay showed distinct ANSI bytes for the placeholder and an identical typed draft. Recognize the equivalent indexed color while preserving draft protection.
  • 🚨 bin/fm-spawn.sh:6106 - A managed spawn with --model gemini-4-neon --effort max exited 0 and recorded Max while agy 1.5.22 started the brief in High. Raw interactive agy reproduced the fallback and headless agy rejected the same flags. The lifecycle gate proves a turn started while the required model and effort selection remains unverified. Reject the unsupported selection before the brief runs using a verified vendor check.
  • 🚨 live validation verdict: no-go (10 of 12 scenarios were driven live against the product); failed: Request an unsupported effort on a managed agy scout and receive a failed spawn before the brief starts, Exit a freshly idle Herdr worker without touching its empty composer
  • Live validation: ❌ no-go - 10 of 12 scenarios driven live against the product
Scenario Result Live Evidence
Launch an agy scout and a local-only crewmate in isolated Herdr sessions and observe each synthetic brief append its status ✅ pass live Managed Herdr launch, draft protection, steer, and skill; Herdr interruption, stop, and fresh recovery generation
Try to spawn an agy secondmate and receive a crew-only refusal ✅ pass live Managed Herdr launch, draft protection, steer, and skill; bash tests/fm-agy-harness.test.sh
Request an unsupported effort on a managed agy scout and receive a failed spawn before the brief starts ❌ fail live Firstmate records Max while interactive agy runs High; Vendor headless model and effort rejection
Run a real agy worker with exact-path session trust and observe busy, background busy, settled idle, and turn end in tmux ✅ pass live Real tmux and agy lifecycle guard
Submit malformed synthetic payloads to the real agy callback and verify that they cannot settle a turn ✅ pass live Synthetic callback and dispatch profile results
Try a skill command over an operator draft, then clear the draft and deliver a steer and skill through fm-send ✅ pass live Managed Herdr launch, draft protection, steer, and skill
Exit a freshly idle Herdr worker without touching its empty composer ❌ fail live Herdr refuses an untouched composer with color enabled
Interrupt an active agy turn, stop the worker, resume the saved conversation, and apply a relaunch note in a fresh generation ✅ pass live Herdr interruption, stop, and fresh recovery generation; Explicit conversation resume; Managed Herdr launch, draft protection, steer, and skill
Submit typed agy profiles to the local Firstmate resolver with and without an explicit provider ✅ pass live Synthetic callback and dispatch profile results
Submit a synthetic literal Swarm tool event to the real primary guard and receive a deny decision ✅ pass live Synthetic primary PreToolUse decisions
Repeat the supervised adapter trial on exactly agy 1.5.21 ⏸️ untested no The installed binary and official Linux manifest both returned 1.5.22. A version query still returned 1.5.22, the versioned manifest returned 404, and the vendor bucket requires list permission. A ver…
Invoke /no-mistakes from a managed agy worker and reach the first gate on a disposable repository ⏸️ untested no The managed Herdr trial invoked a disposable slash skill and observed its receipt. Starting a nested no-mistakes run is prohibited in this test phase. The repository records the historical first-gate…
  • bash tests/fm-agy-harness.test.sh
  • agy --version, agy models, and headless agy -p with supported and unsupported model and effort selections in an isolated home
  • FM_AGY_LIVE_E2E=1 bash tests/fm-agy-live-e2e.test.sh on private tmux
  • fm-spawn.sh for a Herdr scout, a local-only crewmate, a refused secondmate, and an unsupported effort
  • fm-send.sh for ordinary steering, /validation-ack, and /exit, with an operator draft present and after clearing it
  • fm-control.sh interrupt, exit, and relaunch, plus headless agy --conversation
  • herdr pane read --source recent --lines 200 --format ansi with and without NO_COLOR, comparing the untouched placeholder against a literal draft
  • fm-busy-event.sh arm, fm-agy-state.sh, fm-dispatch-resolve.sh, and fm-subagent-pretool-check.sh --claude with synthetic inputs
  • Captured and rendered the live Herdr terminal and checked the official Linux release manifest for 1.5.21

🔧 Fix applied.
2 warnings still open:

  • ⚠️ The step could not verify the core signed-in launch and worker lifecycle. The disposable agy 1.5.22 home required sign-in for model selection and interactive turns. Provide a signed-in disposable agy profile to repeat those checks. The outer executor owns any fresh first-gate trial.
  • ⚠️ live validation verdict: inconclusive (8 of 11 scenarios were driven live against the product); untested: Launch a signed-in agy scout with a supported model and effort, then reject an unsupported pair before the brief runs, Steer a signed-in agy worker, observe its status and turn-end events, then interrupt, exit, resume, and relaunch it, Send the no-mistakes skill to a real agy worker and observe the first gate on a disposable repository
  • Live validation: ⚠️ inconclusive - 8 of 11 scenarios driven live against the product
Scenario Result Live Evidence
Request an agy secondmate in a disposable Herdr lab and receive the crew-only refusal ✅ pass live Herdr composer checks, secondmate refusal, and model preflight refusal
Request a managed scout whose model selection cannot be verified and see Firstmate refuse before creating a task ✅ pass live Herdr composer checks, secondmate refusal, and model preflight refusal
Launch a scout in a clean agy home and see Firstmate record failure, stop the Herdr endpoint, and remove its session settings when the first turn never starts ✅ pass live Herdr first-turn failure and endpoint cleanup
Check a synthetic agy placeholder, identical draft, and bare shell prompt through real Herdr panes ✅ pass live Herdr composer checks, secondmate refusal, and model preflight refusal
Send synthetic lifecycle events to the Firstmate callback and publish turn end only after verified idle ✅ pass live Lifecycle callback, dispatch configuration, and delegation guard
Launch the real agy TUI in a private tmux window and see Firstmate identify the foreground process as alive ✅ pass live Live agy process classification in tmux
Configure an agy dispatch profile in a disposable home and see the typed resolver require its explicit provider ✅ pass live Lifecycle callback, dispatch configuration, and delegation guard
Submit synthetic swarm and read_file requests to the real primary delegation guard ✅ pass live Lifecycle callback, dispatch configuration, and delegation guard
Launch a signed-in agy scout with a supported model and effort, then reject an unsupported pair before the brief runs ⏸️ untested no Managed Herdr spawn, direct agy preflights for both effort values, and agy models all reached authentication before vendor selection. An authorized disposable agy profile with active model access is n…
Steer a signed-in agy worker, observe its status and turn-end events, then interrupt, exit, resume, and relaunch it ⏸️ untested no The private tmux launch reached the sign-in screen, the opt-in guard timed out at the first lifecycle event, and managed Herdr spawn stopped at the first-turn gate. These controls require a disposable…
Send the no-mistakes skill to a real agy worker and observe the first gate on a disposable repository ⏸️ untested no The isolated worker could not reach a first turn without sign-in. The current test phase also forbids starting another pipeline. A fresh trial requires a disposable signed-in agy home and an outer-exe…
  • FM_GATE_REFUSE_BYPASS=1 bash tests/fm-agy-harness.test.sh
  • FM_GATE_REFUSE_BYPASS=1 bash tests/fm-busy-state.test.sh
  • FM_GATE_REFUSE_BYPASS=1 bash tests/fm-subagent-pretool-check.test.sh
  • FM_AGY_LIVE_E2E=1 bash tests/fm-agy-live-e2e.test.sh with isolated HOME, TMPDIR, and TMUX_TMPDIR
  • agy --version, agy models, and agy --print &#39;&#39; --input-format stream-json --output-format stream-json --model gemini-4-neon --effort max|low with EOF in a clean home
  • bin/fm-herdr-lab.sh provision and teardown, with synthetic composer panes and real fm-spawn.sh secondmate, model preflight, and first-turn failure checks
  • fm_backend_agent_state tmux probe:fm-probe and tmux capture-pane against real agy in a private 170×40 pane
  • fm-busy-event.sh arm, fm-agy-state.sh, and fm_busy_record_read with synthetic vendor callback inputs
  • fm-harness.sh crew, fm-harness.sh crew-fallback-profile, detect-only fm-bootstrap.sh, and fm-dispatch-resolve.sh against disposable dispatch configuration
  • fm-subagent-pretool-check.sh --tool swarm and --tool read_file in a disposable primary home
  • Rendered the real tmux sign-in capture to PNG and verified disposable process teardown and worktree cleanup
✅ **Document** - passed

✅ No issues found.

🔧 **Lint** - 1 issue found → auto-fixed ✅
  • ⚠️ linter found issues (exit code 1)

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

✅ **Push** - passed

✅ No issues found.

dnth added 15 commits December 2, 2026 15:24
Port the Antigravity CLI (agy) worker and scout adapter from upstream
kunchenguid#4200 and the swarm delegation stem from
kunchenguid#8838; upstream's primary and secondmate promotion
(kunchenguid#7941) stays out of this fork.

Every ported fact was re-proven on the installed agy 1.5.21 in a named
Herdr lab trial. Where 1.5.21 exposes a structural source the upstream
agy 1.2.0 adapter lacked, the port uses it:
- busy state comes from agy's own agent_state through a per-session
  --settings title command (bin/fm-agy-state.sh, source agy-title) instead
  of the upstream rendered-tail regex, and idle with a running background
  task stays busy because agy resumes the agent by itself;
- worktree trust rides the same session-only settings file instead of
  writing the captain's ~/.gemini/antigravity-cli/settings.json;
- the spawn gate waits for an agy-title record and stops the endpoint on
  failure so an unconfirmed brief never runs outside task control;
- the tmux composer reader recognizes agy's rule-framed > prompt and
  the shared idle list carries its auto-mode placeholder.

agy is crew-only: secondmate launches and dispatch from an agy primary are
refused. Dispatch profiles, the control plane, detection, teardown, and the
harness-adapters skill now cover it, with a portable regression and an
opt-in live guard.
Name the signed-in account as an agy crew precondition and route an
authentication prompt to a credential blocker instead of pane input.
fm-spawn --help now names agy alongside Hermes and Devin as crew-only;
update the Hermes help-scope contract assertion to the new wording.
@dnth
dnth merged commit 99cf0b9 into main Dec 3, 2026
21 checks passed
@dnth
dnth deleted the fm/fm-agy-harness-adapter branch December 3, 2026 02:23
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.

1 participant