Skip to content

feat: add Antigravity primary harness support - #7114

Closed
oguzalp7 wants to merge 6 commits into
kunchenguid:mainfrom
oguzalp7:feat/antigravity-adapter
Closed

oguzalp7 wants to merge 6 commits into
kunchenguid:mainfrom
oguzalp7:feat/antigravity-adapter

Conversation

@oguzalp7

@oguzalp7 oguzalp7 commented Oct 12, 2026 •

Copy link
Copy Markdown

Intent

feat:

What Changed

  • Added bin/fm-antigravity-lib.sh and updated bin/fm-harness.sh and bin/fm-session-lock-lib.sh to support Antigravity (agy) executable resolution, harness marker and process detection, and session lock acquisition.
  • Added docs/supervision-protocols/antigravity.md and updated bin/fm-supervision-instructions.sh to render Antigravity agentic supervision protocols with reactive wakeup.
  • Registered Antigravity as a verified primary harness in documentation and adapter references, and added harness verification test cases in tests/fm-agy-harness.test.sh.

Risk Assessment

✅ Low: The branch changes cleanly implement Antigravity harness and supervision protocol integration while verifying and resolving previous findings regarding session-lock anchoring, pgrep isolation, and configuration hygiene.

Testing

Executed targeted unit tests (tests/fm-agy-harness.test.sh, 35/35 assertions ok) and drove 4 live end-to-end scenarios against the real Firstmate scripts and a disposable lab home. Verified Antigravity binary resolution of the host's agy.exe CLI, harness marker and ancestry detection, generation of the native Antigravity supervision instructions, strict regex anchoring that rejects unanchored decoys (magy, agysync, bagy), and full session start and lock acquisition under an Antigravity primary process. All scenarios passed cleanly with zero findings.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Detect Antigravity primary harness and emit Antigravity supervision protocol ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/harness-detection-and-supervision.txt
Resolve live Antigravity CLI binary and verify active harness detection ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/binary-resolution-and-status.txt
Enforce anchored session lock regex and reject unanchored decoy processes ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/session-lock-anchoring-and-adversarial-rejection.txt
Acquire session lock and initialize disposable lab home under Antigravity harness ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/session-start-digest-agy.txt
Evidence: harness-detection-and-supervision

Source: harness-detection-and-supervision

=== HARNESS MARKER DETECTION === ANTIGRAVITY_AGENT=1 bin/fm-harness.sh marker => agy AGY_AGENT=1 bin/fm-harness.sh marker => agy ANTIGRAVITY_AGENT=1 bin/fm-harness.sh => agy === SUPERVISION INSTRUCTIONS (--harness agy) === Mode: Antigravity agentic supervision.

=== HARNESS MARKER DETECTION ===
ANTIGRAVITY_AGENT=1 bin/fm-harness.sh marker => agy
AGY_AGENT=1 bin/fm-harness.sh marker => agy
ANTIGRAVITY_AGENT=1 bin/fm-harness.sh => agy

=== SUPERVISION INSTRUCTIONS (--harness agy) ===
================================================================================
SUPERVISION OPERATING INSTRUCTIONS - primary harness: agy
================================================================================
Current state:
- Lock: held by this session; this session owns normal supervision unless away mode says otherwise.
- Away/quiet mode: inactive.
- X mode: inactive; use the default watcher cadence.
- Ordinary wake: follow the continuation in the harness protocol below; do not use shell &.

Mode: Antigravity agentic supervision.

When this session owns supervision and away mode is not active:
1. Drain first with `bin/fm-wake-drain.sh`.
   After handling all emitted wakes and reconciling open decisions and unread status lines, run the exact `--ack-through` command printed as `WAKE_ACK_REQUIRED`; until then the work remains durable for idempotent re-handling after interruption.
2. Source `~/.no-mistakes/worktrees/50e9b9d71306/01M4R5KRRYDC6QB6ZED4BB590D/config/x-mode.env` first when Relay is active.
3. Ordinary wake: drain queued wakes, handle that wake, reconcile open decisions and unread status lines, and run the printed `--ack-through` command.
4. Supervision: Antigravity manages background tasks through its native agentic runtime (`manage_task`, `run_command`, `schedule`, `invoke_subagent`).
   Reactive wakeup is handled automatically by the Antigravity messaging system when background tasks complete.
   For fleet-wide watcher polling, run `bin/fm-watch.sh` or `bin/fm-watch-checkpoint.sh`.


=== SUPERVISION INSTRUCTIONS (--harness antigravity) ===
================================================================================
SUPERVISION OPERATING INSTRUCTIONS - primary harness: antigravity
================================================================================
Current state:
- Lock: held by this session; this session owns normal supervision unless away mode says otherwise.
- Away/quiet mode: inactive.
- X mode: inactive; use the default watcher cadence.
- Ordinary wake: follow the continuation in the harness protocol below; do not use shell &.

Mode: Antigravity agentic supervision.

When this session owns supervision and away mode is not active:
1. Drain first with `bin/fm-wake-drain.sh`.
   After handling all emitted wakes and reconciling open decisions and unread status lines, run the exact `--ack-through` command printed as `WAKE_ACK_REQUIRED`; until then the work remains durable for idempotent re-handling after interruption.
2. Source `~/.no-mistakes/worktrees/50e9b9d71306/01M4R5KRRYDC6QB6ZED4BB590D/config/x-mode.env` first when Relay is active.
3. Ordinary wake: drain queued wakes, handle that wake, reconcile open decisions and unread status lines, and run the printed `--ack-through` command.
4. Supervision: Antigravity manages background tasks through its native agentic runtime (`manage_task`, `run_command`, `schedule`, `invoke_subagent`).
   Reactive wakeup is handled automatically by the Antigravity messaging system when background tasks complete.
   For fleet-wide watcher polling, run `bin/fm-watch.sh` or `bin/fm-watch-checkpoint.sh`.
Evidence: binary-resolution-and-status

Source: binary-resolution-and-status

RESOLVED_BIN=/mnt/c/Users/oguz_/AppData/Local/agy/bin/agy.exe ACTIVE_ANTIGRAVITY=true ACTIVE_AGY=true ACTIVE_GEMINI=false

RESOLVED_BIN=/mnt/c/Users/oguz_/AppData/Local/agy/bin/agy.exe
ACTIVE_ANTIGRAVITY=true
ACTIVE_AGY=true
ACTIVE_GEMINI=false
Evidence: session-lock-anchoring-and-adversarial-rejection

Source: session-lock-anchoring-and-adversarial-rejection

MATCH_AGY=ok MATCH_ANTIGRAVITY=ok MATCH_AGY_EXE=ok MATCH_ANTIGRAVITY_EXE=ok MATCH_PATH_AGY=ok DECOY_MAGY=ok DECOY_AGYSYNC=ok DECOY_BAGY=ok DECOY_PYTHON_ARGS=ok RE_AGY=ok RE_ANTIGRAVITY=ok RE_MAGY=ok RE_AGYSYNC=ok === ADVERSARIAL PROCESS ANCESTRY LOCK ATTEMPTS === magy ancestry exit code: 1 magy stderr: error: cannot locate harness process in ancestry agysync ancestry exit code: 1 agysync stderr: error: cannot locate harness process in ancestry

MATCH_AGY=ok
MATCH_ANTIGRAVITY=ok
MATCH_AGY_EXE=ok
MATCH_ANTIGRAVITY_EXE=ok
MATCH_PATH_AGY=ok
DECOY_MAGY=ok
DECOY_AGYSYNC=ok
DECOY_BAGY=ok
DECOY_PYTHON_ARGS=ok
RE_AGY=ok
RE_ANTIGRAVITY=ok
RE_MAGY=ok
RE_AGYSYNC=ok

=== ADVERSARIAL PROCESS ANCESTRY LOCK ATTEMPTS ===
magy ancestry exit code: 1
magy stderr: error: cannot locate harness process in ancestry

agysync ancestry exit code: 1
agysync stderr: error: cannot locate harness process in ancestry
Evidence: session-start-digest-agy

Source: session-start-digest-agy

=== SESSION START - disposable lab home === LOCK -------------------------------------------------------------------------------- lock acquired: harness pid 63640 === SUPERVISION OPERATING INSTRUCTIONS - primary harness: agy === Mode: Antigravity agentic supervision.


================================================================================
SESSION START - /tmp/fm-lab.tyc74_4v
================================================================================

LOCK
--------------------------------------------------------------------------------
lock acquired: harness pid 81829

BOOTSTRAP
--------------------------------------------------------------------------------
PRESENTATION_UNAVAILABLE: lavish-axi (requires >=0.1.77; install: npm install -g lavish-axi && lavish-axi setup hooks) - nonvisual work may proceed with plain-text decisions and reports; install or upgrade before using Lavish

WAKE QUEUE
--------------------------------------------------------------------------------
(no queued wakes)
================================================================================
SUPERVISION OPERATING INSTRUCTIONS - primary harness: agy
================================================================================
Current state:
- Lock: held by this session; this session owns normal supervision unless away mode says otherwise.
- Away/quiet mode: inactive.
- X mode: inactive; use the default watcher cadence.
- Ordinary wake: follow the continuation in the harness protocol below; do not use shell &.

Mode: Antigravity agentic supervision.

When this session owns supervision and away mode is not active:
1. Drain first with `bin/fm-wake-drain.sh`.
   After handling all emitted wakes and reconciling open decisions and unread status lines, run the exact `--ack-through` command printed as `WAKE_ACK_REQUIRED`; until then the work remains durable for idempotent re-handling after interruption.
2. Source `/tmp/fm-lab.tyc74_4v/config/x-mode.env` first when Relay is active.
3. Ordinary wake: drain queued wakes, handle that wake, reconcile open decisions and unread status lines, and run the printed `--ack-through` command.
4. Supervision: Antigravity manages background tasks through its native agentic runtime (`manage_task`, `run_command`, `schedule`, `invoke_subagent`).
   Reactive wakeup is handled automatically by the Antigravity messaging system when background tasks complete.
   For fleet-wide watcher polling, run `bin/fm-watch.sh` or `bin/fm-watch-checkpoint.sh`.


================================================================================
READ-ONCE CONTRACT
================================================================================
Everything below is printed in full for this session start: every state/*.meta,
a compact data/backlog.md listing, a bounded tail of every state/*.status,
data/projects.md, data/secondmates.md, data/captain.md, data/captain-shared.md,
and data/learnings.md.
Do NOT re-read any of them after reading this digest, and do NOT bulk-read
data/backlog.md or state/*.status: re-reading everything defeats the entire
point of this command.

Go to a source directly only when:
  - this digest flagged it ABSENT (then rebuild or create it per AGENTS.md),
  - its contents looked unparseable or corrupt,
  - an individual full status log is needed for older wake-event history, or a
    status line was capped and its tail matters (each task's full log path is
    printed with its tail),
  - a full task body is needed (bin/fm-tasks-axi.sh show <id> --full, or data/backlog.md),
  - the backlog listing disclosed omitted queued items and this turn needs them,
  - the NETWORK CHECKS section reported its checks still IN PROGRESS and this
    turn needs their verdict (bin/fm-startup-network.sh report),
  - or a STARTUP TRUNCATED banner named the stage that would have printed it, in
    which case that stage's sources were never emitted and must be reconciled.

================================================================================
FLEET STATE
================================================================================

data/backlog.md
--------------------------------------------------------------------------------
ABSENT

Work under way (state/*.meta)
--------------------------------------------------------------------------------
(none)

Orphan status logs (state/*.status without matching .meta)
--------------------------------------------------------------------------------
(none)

AFK
--------------------------------------------------------------------------------
absent

================================================================================
NETWORK CHECKS
================================================================================
IN PROGRESS - the deferred network checks have not finished yet.
NOT yet confirmed: GitHub authentication, dead-secondmate relaunch, secondmate convergence, pending handoff delivery, project clone refresh with its drift reporting, and inactive terminal-outcome reconciliation.
Started 1s ago, bounded at 120s.
Only a FAILED or otherwise actionable result arrives as a `check: startup-network` wake; a clean success stays silent.
The durable result is readable on demand with ~/.no-mistakes/worktrees/50e9b9d71306/01M4R5KRRYDC6QB6ZED4BB590D/bin/fm-startup-network.sh report; until it finishes, treat none of it as confirmed.

================================================================================
CONTEXT
================================================================================

data/projects.md
--------------------------------------------------------------------------------
ABSENT

data/secondmates.md
--------------------------------------------------------------------------------
ABSENT

data/captain.md
--------------------------------------------------------------------------------
ABSENT

data/captain-shared.md (shared, main-authoritative, read-only in secondmate homes)
--------------------------------------------------------------------------------
ABSENT

data/learnings.md
--------------------------------------------------------------------------------
ABSENT

================================================================================
NEXT STEP
================================================================================
Follow the supervision operating instructions block above for harness 'agy'.
This script never starts supervision itself.

The digest above is complete for this session start. The READ-ONCE CONTRACT
section near the top of it governs what may still be read from disk.

=== LOCK STATUS AFTER PROCESS EXIT ===
lock: stale (pid 81829 dead or not a harness)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Detect Antigravity primary harness and emit Antigravity supervision protocol ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/harness-detection-and-supervision.txt
Resolve live Antigravity CLI binary and verify active harness detection ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/binary-resolution-and-status.txt
Enforce anchored session lock regex and reject unanchored decoy processes ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/session-lock-anchoring-and-adversarial-rejection.txt
Acquire session lock and initialize disposable lab home under Antigravity harness ✅ pass live ~/.no-mistakes/evidence/01M4R5KRRYDC6QB6ZED4BB590D/session-start-digest-agy.txt
  • tests/fm-agy-harness.test.sh
  • bin/fm-harness.sh marker and bin/fm-harness.sh under ANTIGRAVITY_AGENT=1 and AGY_AGENT=1
  • bin/fm-supervision-instructions.sh --harness agy and --harness antigravity
  • bin/fm-antigravity-lib.sh:fm_antigravity_resolve_binary with host PATH and fm_antigravity_is_active
  • bin/fm-session-lock-lib.sh:fm_harness_process_matches and FM_HARNESS_RE regex with authentic and decoy process names
  • bin/fm-session-start.sh and bin/fm-lock.sh inside disposable lab home (bin/fm-lab-home.sh create) with agy ancestry
✅ **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: thanks @oguzalp7. I compared head 059a252f against main a1ecefb4 (and the just-merged Forgejo tip).

Contract-class: opt-in. Antigravity/agy only activates when config/harness (or primary-harness) names it, or when ANTIGRAVITY_AGENT/AGY_AGENT is set. That matches the fleet-outlives-vendor harness-adapter pattern.

VISION.md, rule by rule

  • One captain, one interface: aligns (supervision protocol doc only).
  • Authority is explicit: aligns (no new autonomy grant).
  • Scripts own the mechanics: aligns.
  • A restart is a non-event: aligns (session-lock path).
  • Delegation with a spine: cannot tell — no behavioral tests in the diff, and the PR was not raised through no-mistakes.
  • The fleet outlives any vendor: aligns in intent (another harness adapter), but see findings below.
  • Scope: aligns.

Findings before this can proceed

  1. no-mistakes is blocking. There is no no-mistakes-pipeline-attestation on this body, and the Require no-mistakes gate has not passed for this head. Please re-raise through git push no-mistakes so the tip carries its own attestation and live evidence.
  2. Hardcoded personal path in fm_antigravity_resolve_binary: /mnt/c/Users/oguz_/AppData/Local/agy/bin/agy.exe — please drop machine-specific paths; command -v / documented install locations are enough.
  3. fm_antigravity_is_active treats GEMINI_AGENT=1 as Antigravity — that conflates a different harness. Please remove that branch.
  4. The diff removes existing explanatory comments in harness_marker (Cursor/Grok marker ordering). Please restore those, or move the notes rather than deleting them.
  5. No new tests accompany the new lib / detect paths.

CI: I reviewed the diff (no workflow, secret, or new network surface beyond process identity) and approved Require no-mistakes 38209187821. CI 38209187903 was already queued. Those runs will tell us more once NM is re-raised.

Next step: waiting on you for a no-mistakes re-raise that addresses the findings above. Nothing here is waiting on Kun. Thank you, no rush.

@oguzalp7
oguzalp7 force-pushed the feat/antigravity-adapter branch from 059a252 to dd36860 Compare October 12, 2026 07:02
@faridghar

Copy link
Copy Markdown

Thanks @kunchenguid for the thorough review! We have addressed all five findings on the rebased branch:

  1. no-mistakes Attestation: The branch was submitted and verified through the no-mistakes pipeline (all steps passed: intent, rebase, review, test with live validation evidence, document, lint, and push). The full attestation and live execution proof are available on the attested tip (15ea0812b4fc181630bbb274e94f44812db03325), pushed to faridghar/firstmate:feat/antigravity-adapter and mirrored in PR feat(fm-antigravity): Implement antigravity adapter #7122.
  2. Personal Path Removed: Removed /mnt/c/Users/oguz_/AppData/Local/agy/bin/agy.exe from fm_antigravity_resolve_binary in bin/fm-antigravity-lib.sh. Binary lookup now relies strictly on PATH, standard ~/.local/bin/agy, and /usr/local/bin/agy.
  3. GEMINI_AGENT Conflation: Removed GEMINI_AGENT=1 from fm_antigravity_is_active and session PID detection in bin/fm-antigravity-lib.sh.
  4. Restored Comments: Restored the Cursor and Grok marker ordering comments in harness_marker in bin/fm-harness.sh, and consolidated duplicate agy pattern matching in harness_process_verdict.
  5. Dedicated Behavioral Tests & Isolation:
    • Added unit test suite tests/fm-antigravity-lib.test.sh covering fm_antigravity_resolve_binary, fm_antigravity_process_matches, fm_antigravity_is_active (verifying GEMINI_AGENT rejection), FM_TEST_SEAM isolation, ANTIGRAVITY_PID/AGY_PID overrides, and process PID discovery via pgrep (all 9 tests passing).
    • Fixed test isolation in tests/fm-agy-harness.test.sh to prevent false positive detection from inherited environment variables (all 29 tests passing).
    • Added anchored pattern matching for process names (^|/)(antigravity|agy)(\.exe)?( |$) to avoid partial match collisions.

@oguzalp7 You can fast-forward your branch feat/antigravity-adapter directly to commit 15ea0812b4fc181630bbb274e94f44812db03325 to update PR #7114 with the signed pipeline attestation, or maintainers can merge PR #7122 directly.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @oguzalp7 — and thanks @faridghar for the follow-up on this thread. Tip moved to dd36860afa65 since the waiting-author stamp on 059a252f.

Contract-class: opt-in (unchanged). Antigravity activates only when config/harness / primary-harness names it, or ANTIGRAVITY_AGENT / AGY_AGENT is set.

What I see on this tip vs the five findings

  1. no-mistakes attestation: still MISSING on this body/tip — Require no-mistakes will keep blocking until this head is re-raised through git push no-mistakes.
  2. Personal /mnt/c/Users/oguz_/... path: gone from product code. Good.
  3. GEMINI_AGENT conflation: gone; tests assert it does not activate. Good.
  4. Harness marker comments: look restored. Good.
  5. Tests: tests/fm-agy-harness.test.sh grew coverage; dedicated fm-antigravity-lib.test.sh is still only on the sibling tip.

Overlap: #7122 (15ea0812, @faridghar) carries the full attested tip with live 1/1, anchored pgrep, and the dedicated lib suite. Prefer one lane. Easiest path: fast-forward this branch to 15ea0812 (as faridghar offered) so #7114 keeps authorship and gains the attestation — or close this in favor of #7122. I will progress #7122 on its own merits meanwhile; I will not merge both.

Fork CI for this tip approved (CI 38215619867, NM 38215619749) so checks can speak once NM is re-raised.

Status: waiting-author on a no-mistakes re-raise (or FF to the attested sibling tip). No rush.

@oguzalp7 oguzalp7 changed the title feat(harness): add Antigravity primary harness and session lock support feat: add Antigravity primary harness support Oct 12, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @oguzalp7 — tip moved to 7bc3ccfc and the body attestation now MATCHes that head. Live evidence rows are present in the body.

Contract-class: opt-in (unchanged). Antigravity activates via config/harness / primary-harness or ANTIGRAVITY_AGENT / AGY_AGENT; unconfigured non-agy path unchanged.

Overlap update: #7122 was closed by @faridghar in favor of #7017 (fuller native agy primary/crew/secondmate lane). #7114 and #7017 still overlap on harness detection, session-lock vocabulary, supervision protocol, and fm-agy-harness tests — I will not merge both. I will keep progressing #7017 on its own merits (that one is new-default → captain when green). If you want this lighter opt-in tip to be the landing lane instead, say so; otherwise closing in favor of #7017 once it lands is the cleanest end state. No rush either way.

Diff review: adapter lib, harness/session-lock, docs, tests — no workflows/secrets. Fork CI approved: CI 38261714751, Require no-mistakes 38261953926.

Status: waiting-ci. When green this would be auto-merge eligible as opt-in only if #7017 has not landed / is not the chosen lane.

@oguzalp7

Copy link
Copy Markdown
Author

Closing in favor of #7017.

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.

3 participants