Skip to content

fix: support agy trust for standalone relaunches - #8840

Open
khaira777 wants to merge 8 commits into
kunchenguid:mainfrom
khaira777:fm-up-agy-relaunch-trust
Open

khaira777 wants to merge 8 commits into
kunchenguid:mainfrom
khaira777:fm-up-agy-relaunch-trust

Conversation

@khaira777

@khaira777 khaira777 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Part 2 of #8835 (new-default, security-sensitive agy trust store widening): tighten bin/fm-agy-trust.sh --relaunch-copy so that outside the project's common git dir it accepts only a standalone clone (WT_GIT_DIR == WT_COMMON, refusing linked worktrees of different repos) that shares at least one root commit with the project (refusing unrelated git repositories), while keeping --is-trusted strictly read-only and refusing the project's primary checkout; add refusal regression tests in tests/fm-agy-harness.test.sh.

What Changed

  • Allow agy relaunch trust registration for project worktrees and standalone clones that share a root commit, while refusing the primary checkout and unrelated repositories or their linked worktrees.
  • Reuse an existing logical-path trust entry when relaunch registration fails, using a read-only trust probe.
  • Add harness coverage for relaunch registration, existing trust, and refused paths; update the verification documentation.

Risk Assessment

✅ Low: The trust registration changes are bounded by the stated scope checks, and the review found no substantiated material defect.

Testing

Live trust registration, refusal, and read-only probe scenarios passed, and the focused harness test passed. Real Antigravity relaunch remains untested because the disposable home requires authentication.

  • Live validation: ⚠️ inconclusive - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Register a related standalone clone and a linked worktree of the project in an isolated trust store ✅ pass live Live trust-helper scenarios
Reject the primary checkout, an unrelated repository, and a different repository's linked worktree ✅ pass live Live trust-helper scenarios
Probe trusted and untrusted paths without changing or creating settings ✅ pass live Live trust-helper scenarios
Relaunch a real Antigravity worker in a standalone clone, including the already-trusted fallback ⏸️ untested no The installed CLI was launched with an isolated home and reached its Google sign-in prompt. Completing the real worker relaunch requires an authenticated disposable Antigravity account; signing in or…
Evidence: Live trust-helper scenarios

Source: Live trust-helper scenarios


Probe before settings exist
exit=1
missing settings remained absent

Register standalone clone sharing root
trusted: {run-worktree}/.agy-live.PBMzue/clone
exit=0

Register project linked worktree
trusted: {run-worktree}/.agy-live.PBMzue/linked
exit=0

Probe registered clone
exit=0

Probe unrelated repository
exit=1
settings bytes unchanged after probes

Refuse project primary checkout
error: refusing to pre-register agy trust: '{run-worktree}/.agy-live.PBMzue/project' is the project primary checkout, not an isolated relaunch copy
exit=1

Refuse unrelated standalone repository
error: refusing to pre-register agy trust: '{run-worktree}/.agy-live.PBMzue/unrelated' does not share git history with project '{run-worktree}/.agy-live.PBMzue/project'
exit=1

Refuse linked worktree of a different repository despite shared root
error: refusing to pre-register agy trust: '{run-worktree}/.agy-live.PBMzue/foreign-linked' is a linked worktree of a different repository, not a relaunch copy of '{run-worktree}/.agy-live.PBMzue/project'
exit=1
settings bytes unchanged after refusals
clone recorded=true
linked recorded=true
project recorded=false
unrelated recorded=false
foreign recorded=false
  • Outcome: ⚠️ 1 warning across 1 run (2m33s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (3 of 4 scenarios were driven live against the product); untested: Relaunch a real Antigravity worker in a standalone clone, including the already-trusted fallback
  • Live validation: ⚠️ inconclusive - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Register a related standalone clone and a linked worktree of the project in an isolated trust store ✅ pass live Live trust-helper scenarios
Reject the primary checkout, an unrelated repository, and a different repository's linked worktree ✅ pass live Live trust-helper scenarios
Probe trusted and untrusted paths without changing or creating settings ✅ pass live Live trust-helper scenarios
Relaunch a real Antigravity worker in a standalone clone, including the already-trusted fallback ⏸️ untested no The installed CLI was launched with an isolated home and reached its Google sign-in prompt. Completing the real worker relaunch requires an authenticated disposable Antigravity account; signing in or…
  • Executed bin/fm-agy-trust.sh against disposable Git repositories and an isolated settings store; recorded the CLI output and persisted trust state.
  • Ran bash tests/fm-agy-harness.test.sh - passed, including fake-pane relaunch coverage.
  • Launched agy in an isolated home with a sized pseudo-terminal - reached the sign-in prompt; stopped the process and removed the fixture.
  • Ran git status --short, git diff --stat, and git diff --check - no worktree changes or whitespace errors.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Issues

Closes #8835

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable defects were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable defects were found.

Reviews (4) · Last reviewed commit: "no-mistakes(document): Clarify relaunch ..." · Reviewed by Greptile

Comment thread tests/fm-agy-harness.test.sh Resolved
Comment thread tests/fm-agy-harness.test.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @khaira777 for taking part 2 of #8835.

One thing from you first: the attestation binds b23fd3f3 but shows intent: skipped. The no-mistakes gate here only counts a run with zero skipped steps. Please re-raise once with git push no-mistakes and let every step run. I haven't approved fork runs 46162928050 / 46162927970 / 46162947019, because a re-raise replaces them.

Diff review of b23fd3f3: no P1, one finding.

  • Fresh spawns still go through the unchanged worktree mode, and --is-trusted is strictly read-only: it parses the store in node and only sets an exit code. Both good.
  • P2, scope: --relaunch-copy refuses only the project's own primary checkout and its git dir. Any other git repository passes, including an unrelated one and a linked worktree of a different project. fm-spawn.sh only calls it with the recorded $WT on --relaunch, so today's caller is safe. But the trust-store writer is the boundary. Please make --relaunch-copy prove the copy belongs to this project before it writes, for example by requiring a remote or common history that matches the project, or by taking the task id and matching its recorded worktree=.

Live: 2 of 3 scenarios. The end-to-end relaunch stopped at agy's sign-in. That's live-testable, so I'll want it, or a run on a signed-in agy, before this goes to Kun.

Contract class: new-default, security-sensitive. It widens what agy trust pre-registration accepts on the default relaunch path, and it writes your agy trust store. Once the gates hold and the full suite is green, this goes to Kun as a merge-or-leave decision. It won't auto-merge.

VISION, rule by rule: One captain, one interface: aligns (no surprise dialog on relaunch). Authority is explicit: captain-gated, because it widens a trust grant. Scripts own the mechanics: aligns. A restart is a non-event: aligns, which is the point of it. Delegation with a spine: aligns once the copy is bound to its task. Fleet outlives any vendor: aligns, the change stays in the agy adapter. Scope: aligns.

@khaira777
khaira777 force-pushed the fm-up-agy-relaunch-trust branch from b23fd3f to aecba9c Compare November 28, 2026 20:00
@khaira777 khaira777 changed the title fix: support agy workspace trust for standalone relaunches fix: support agy trust for standalone relaunches Nov 28, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@kunchenguid Thanks for the review - resolved all three items on head aecba9ce:

  1. Clean attestation (zero skipped steps): Re-ran directly via no-mistakes axi run --intent ... so every step (intent through push) now records completed with zero skipped steps; Greptile is 5/5 with 0 unresolved threads.
  2. P2 scope boundary in bin/fm-agy-trust.sh --relaunch-copy: Tightened --relaunch-copy so that when WT_COMMON != PROJ_COMMON, it now requires BOTH:
    • a standalone clone (WT_GIT_DIR == WT_COMMON, refusing linked worktrees of a different repository), AND
    • shared git history with <project> via at least one common root commit (git rev-list --max-parents=0 HEAD, fail-closed if empty/unreadable, refusing unrelated repositories).
      Added two new refusal regression assertions in tests/fm-agy-harness.test.sh proving --relaunch-copy refuses both an unrelated git repo and a linked worktree of a different repo without touching settings.json.
  3. Live signed-in agy 1.5.19 standalone-clone relaunch proof: Tested against real signed-in agy 1.5.19 inside an isolated Herdr lab session (fm-lab-agylive-92160-6824 via bin/fm-herdr-lab.sh, cleaning the temporary /tmp trust entry afterward):
    • bin/fm-agy-trust.sh --relaunch-copy /tmp/fm-agylive.1btny0/clone /tmp/fm-agylive.1btny0/proj -> trusted: ...
    • bin/fm-agy-trust.sh --is-trusted /tmp/fm-agylive.1btny0/clone -> exit 0
    • Launched agy --prompt-interactive 'Reply with exactly AGY_LIVE_OK and nothing else' --model gemini-3.8-flash-low --effort low --dangerously-skip-permissions in the standalone clone -> entered its turn directly with zero folder-trust dialog and printed AGY_LIVE_OK.

Ready for fork CI approval and your review whenever you are!

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @khaira777, all three points are handled.

Gates on aecba9ce (main 30dae608, green; merges cleanly): the attestation binds this head with every step completed, including intent. Greptile is 5/5 on this head with no threads. Live is now 3 of 3, with the signed-in agy 1.5.19 standalone-clone relaunch going straight into its turn with no folder-trust dialog.

Diff review of aecba9ce: safe, no P1. My P2 is fixed. Outside the project's common git dir, --relaunch-copy now accepts only a standalone clone (git-dir == common-dir, so a linked worktree of another repo is refused) that shares at least one root commit with <project>, and it refuses when either root list can't be read. The primary checkout and its git dir are still refused, ordinary worktree mode still refuses a standalone clone, and --is-trusted is still read-only. The two new refusal tests cover an unrelated repo and a foreign linked worktree. A note for Kun, not a blocker: a shared root commit proves lineage, not identity, so any clone of the same history passes. Today's only caller passes the task's recorded $WT. No workflow, network or credential changes.

Fork CI: I approved this head's runs (46184056692, 46184056694, 46184102966). Once the quick checks pass, full-ci is next. This pass's three new labels are already used, so that happens next pass.

Contract class: new-default, security-sensitive (it widens what agy trust pre-registration accepts on relaunch). A green full suite takes it to Kun as a merge-or-leave decision. It won't auto-merge. VISION: unchanged from my last note. Every rule aligns, and the trust-store writer now proves its scope. Status: nothing is waiting on you.

@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 29, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: as promised, full-ci is on now. Head aecba9ce hasn't changed since my review, the quick checks pass, and main b72ed7d8 is green.

Everything from my last note still holds. The attestation binds this head with no skipped steps, Greptile is 5/5 with no threads, live is 3/3 with signed-in agy 1.5.19, and my review is safe, no P1. Contract class: new-default, security-sensitive (it widens what agy trust pre-registration accepts on relaunch). A green full suite takes it to Kun as a merge-or-leave decision. Status: nothing is waiting on you.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: the full suite is green on aecba9ce (run 46221008995). The head hasn't changed since my review.

All gates hold. The attestation binds this head with every step completed, Greptile is 5/5 with no threads, the quick checks pass, live is 3/3 with a signed-in agy 1.5.19, my review is safe, no P1, and GitHub reports it CLEAN. Contract class: new-default, security-sensitive. It widens what agy trust pre-registration accepts on a standalone relaunch: the root-commit lineage check and the linked-worktree refusal stay in place.

This now goes to Kun as merge-or-leave. That's the captain's decision, and nothing is waiting on you, @khaira777.

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

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agy: block swarm delegation in subagent guard and support standalone clone relaunch trust

2 participants