Files
PaperClipAI/tests/runner-e2e/ANTIGRAVITY-AGENT-JOURNEY.md
T
DottaandClaude Fable 5.2 78e4f4f130 feat(runner): Antigravity on ACP 1.5.2 with Linux, API-key auth and Gemini 4 Neon (still pending) (#22591)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The native Runner starts each agent harness and owns its lifecycle,
credentials and recovery
> - Google Antigravity is Google's only first-party coding harness, and
it is the harness for Gemini 4 Neon
> - The Runner had an Antigravity integration, but only as a pending
candidate: ACP server 1.4.3, macOS ARM64 only, Google sign-in only,
closed unless an operator opened it for one company and one model
> - Cloud sandboxes run Linux and use API keys, so the candidate could
not run there, and it had one attended test cell
> - This pull request moves the integration to ACP server 1.5.2, makes
it run on Linux and with a Gemini API key, adds the tests the other ACPX
harnesses have, and removes the code paths that would block recovery
after release
> - The benefit is that the release of Antigravity becomes a small
declaration change after the live suites pass. The profile stays
`pending` in this pull request.

## Linked Issues or Issue Description

Refs #98
Refs #6559
Refs #8523
Refs #21121 (a separate legacy-style `agy_local` adapter that uses the
CLI print protocol; this pull request does not replace or include it)

## What Changed

**Runtime**
- Pin Antigravity ACP server 1.5.2 (was 1.4.3). Owned admission patch is
`1.5.2-paperclip.2`.
- Verified patched closures for `darwin-arm64`, `linux-x64` and
`linux-arm64`. `darwin-x64` stays inventory-only.
- The patcher reads Mach-O and ELF builds. It signs macOS output only.
One admission source serves all platforms.
- Platform gates in TypeScript, Rust, the sidecar schema and the server
admit each host that has a verified closure.

**Auth and models**
- Gemini API-key auth reaches an exact-model session receipt. Admission
accepts a model only when the base model and the thinking level both
match the requested ID.
- API-key connections get a model list on local and cloud environments.
The list is generated at build time from the pinned runtime. The server
starts no process to read it.
- Gemini 4 Neon, Carbon, Argon and Hydrogen are selectable. The picker
marks them "needs a paid Gemini API plan" for API-key connections.
- One shared module maps model ID to family and thinking level.
- `google/gemini-4-neon` is added to the OpenCode model list. A new
model audit is in `doc/adapter-model-audit-2026-11-22.md`.

**Lifecycle and failures**
- A provider error no longer completes the turn. The driver classifies
it: overloaded, rate limit, quota, auth rejected, model unavailable.
- Overload retries are bounded (3 attempts, about 14 seconds).
- A refused session reload maps to incompatible saved state, so the
automatic replacement conversation applies.
- Server gates that refused restart recovery, remote targets and shared
state for Antigravity now apply only while the profile is pending.
- A Google sign-in connection with a cloud environment is refused at
save and at Test, with a plain message.
- A released profile rejects candidate grants in TypeScript and in Rust.

**Launch cost and integrity (all native ACPX providers)**
- Each closure is verified one time into a sealed read-only store. Later
launches check file identities and hash the exact executable they start.
- Remote provider-pack verification is recorded per sandbox lease. Later
runs check kernel identity and fall back to the full hash on any
difference.
- Superseded stores are removed in the background after a launch.

**Provider pack and image**
- The provider pack carries Antigravity for `linux-x64` as a candidate
provider. It becomes an ordinary provider from the profile status alone.
- The Daytona image build accepts the candidate. A credential-free smoke
runs in the build.

**Tests and CI**
- New `antigravity-qualification` suite: 24 cells, local and Daytona.
- New model lineup suites: 14 API-key cells and 14 Gemini 4 cells. Each
cell requires the exact model in the Runner receipt.
- Antigravity can run the `chat-features` cases with `--profile
runner-acpx-antigravity`.
- `runner-full-stack-e2e.yml` passes `GEMINI_API_KEY` for the new
profile and derives candidate providers from the selected Daytona cells.

**Docs**
- `doc/plans/2026-11-22-antigravity-qualification.md` is the current
release contract, acceptance ledger and operator recipe.

## Verification

Commands that passed on the final revision:

- `pnpm build`
- Typecheck for all packages, including the runner-e2e test projects
- `pnpm test:e2e:runner:unit`: 11,665 Vitest tests passed, 25 skipped;
386 node tests passed
- `cargo test -p paperclip-runner-core -- --test-threads=4`: 1,199
passed, 2 failed. The 2 failures are Codex transport timing tests that
pass alone and on `master`.
- `cargo fmt --check`, `check:acpx-profiles`, `check:protocol-types`,
`node scripts/check-maps.mjs`
- Native patch tests: 9 of 9 on `darwin-arm64` and 9 of 9 on `linux-x64`
- UI picker tests: 397 of 397

Known failures that also fail on `master`:

- 11 runner package script tests (browser, Pi and package-boundary
checks)
- 6 `runtime-selection` tests that read an untracked local skill file

Live evidence, without a prompt:

- Clean provisioning on `darwin-arm64` and on `linux-x64` in a Daytona
sandbox. The closure digests reproduce. A changed or missing file is
rejected.
- `initialize` reports 1.5.2. An API-key session returns a receipt for
exactly `gemini-3.8-flash-low` and the exact instruction bytes, on both
platforms.
- All 28 model IDs (14 Gemini 3, 14 Gemini 4) return an exact receipt
under an API key.
- A session survives a process kill and resumes in a new process with
exact receipts, on both platforms.
- The server's remote path verifies the provider pack in a Daytona
sandbox.
- Run start to native `initialize`: 3.45 s to 1.46 s on macOS, 3.65 s to
1.74 s on Linux x64, before the per-launch executable hash was restored
(about 60 ms on macOS; not measured on Linux).
- Remote pack verification on a reused sandbox lease: about 4.3 s to
about 0.25 s.

Live evidence, with a prompt, on an already-released harness:

- Pi native, `pi-native.runner-acpx-pi.local.agent-files-fresh-run`, on
`darwin-arm64` at `427e9b088b`: 1 of 1 passed, 14 of 14 checks, both
native runs succeeded (25.5 s and 25.7 s). The process started from the
new launch store with no fallback warning.
- The same cell and `native-pending-controller-restart` failed in the
paid workflow on this branch and on `master` in the same way, before any
native start. The workflow does not install the Pi runtime for local
cells, so the agent setup check fails. That is a workflow gap, not part
of this change.

**Not run.** No Antigravity prompt completed on 1.5.2 on any platform.
The only Gemini key available is on the free tier, and Google returned
503 or 429 for each attempt on two days. These gates are open:

- All 24 `antigravity-qualification` cells
- Both model lineup suites, including inference on Gemini 4 Neon
- The attended Google sign-in journey on 1.5.2
- The chat cases under Antigravity
- Image pull time and startup time on a published image
- A native start on `linux-arm64`
- A live provider-death cell for Kimi, Pi or Copilot on the new launch
store (one ordinary Pi cell passed live; see above)

## Risks

- **The launch store changes how every native ACPX provider starts**
(Kimi, Copilot, Cursor, Pi), not only Antigravity. A review found two
defects in the first version (an executable swap was possible, and Pi
launches broke). Both are fixed with tests. One live Pi cell passed on
this branch on macOS. No live provider-death cell and no Linux cell ran
for those providers.
- The profile digest changes. Saved Antigravity candidate sessions and
existing candidate grants stop working. The new release refuses old
state by name and starts a replacement conversation.
- The Linux provider pack and the Daytona image grow by about 834 MB
(about 274 MB compressed) when Antigravity is included.
- The pack verification record is in server memory. The first run after
a server restart pays the full hash again.
- Antigravity 1.5.2 reads the workspace `GEMINI.md` and `AGENTS.md` as
user rules. This is deliberate and matches Codex. Any other rule file is
refused.
- Orchestrator mode is not available. ACP server 1.5.2 does not expose
it.
- Antigravity stays `pending`. Normal users cannot run it until a later
change removes the pending status.

## Model Used

- Claude Fable 5.2 (`claude-fable-5-2`) planned, briefed and integrated
the work, with tool use.
- Claude Opus 5.5 (`claude-opus-5-5`) subagents wrote the code and ran
the tests, with tool use and code execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 08:21:11 -06:00

16 KiB

Antigravity additional-agent journey

antigravity-agent-journey.runner-antigravity.local.saved-subscription-two-turn converts the recorded 38-step setup/first-task and 9-step follow-up into one explicit-only Product E2E cell. It is excluded from --all and scheduled paid matrices. The conversion brief records all 47 source-step dispositions, immutable source hashes, original grades, earlier failures and evidence limits.

The fixed browser driver starts on the company dashboard, follows Agents → New Agent, selects Google Antigravity in the ordinary grid with Advanced collapsed, reuses the saved personal Google subscription, selects the exact low model and Local environment, and runs the native prompt-free Test. Finish must reach actual readiness before task assignment is enabled. It checks the first composer for a stale paused warning, closes that empty composer, saves a nonce only through the agent's Instructions, then submits a task asking for the configured marker without supplying its value. An ordinary follow-up asks the same agent/task to preserve the first line and append a different nonce. Each real file and Done state must remain available after reload.

Selected setup and dependencies

The runnable setup attaches to an existing self-hosted loopback target on the same macOS ARM64 host. This narrower implementation lets the independent native observer verify owned process retirement and all three public-checkpoint provider lifetime fences. .local. identifies agent execution. It does not itself identify application hosting. Compatible Cloud/staging behavior remains a portability target, not an implemented or verified remote observer path.

Required existing state:

  • A dedicated test company and local execution environment; expected and observed serving commit and deployment mode must match. The harness never resets or restarts an attached target. Its roster already contains a nonterminated agent, so the measured creation is an additional-agent path.
  • A dedicated signed-in QA browser profile for the intended board operator, with company agent/instruction/task creation and saved-connection use rights. The normal profile ownership marker and exclusive lock apply; do not use a normal personal Chrome profile.
  • The same person's saved managed Google subscription, with its existing personal default grant. The private setup names exact connection, owner, company and environment references. Names alone do not establish the binding.
  • A current, finite trusted operator startup admission for that company, gemini-3.8-flash-low, local darwin-arm64, native version, profile and closure. The config's pins assert provenance; they cannot grant admission. The global release remains pending and closed by default.
  • Existing operator accounting policy permitting the two task turns, with held and unpriced usage reconciled through its ordinary owner. The harness preserves that policy and the new agent's inherited policy; it creates no agent budget policy or QA override. Missing subscription prices remain unknown.

No MCP connection is required by the browser driver, product agent or independent observer. Native product tools are used by the agent. No API key, mailbox, billing-management credential, fresh Google login or OAuth registration is part of this case. Authentication freshness is saved browser session + saved product connection, not fresh provider consent. Product-managed refresh stays inside the normal managed-account boundary.

After verified native retirement, a refreshed Google credential transfers to the existing encrypted, fsynced recovery journal before database rotation. The next authorized task, Test or model discovery recovers it with the same grant, generation and account checks. A failed journal write or unconfirmed retirement keeps the private home and blocks cleanup; a retry does not grant new authority.

One-time test-drive/bootstrap setup remains the operator's supported workspace owner responsibility. This suite does not implement a managed-local target bootstrap, mint candidate authority, install a provider through a test-only path, or import an operator's CLI credential home. Install the maintained native assets through paperclipai runtime setup antigravity as the OS user running Paperclip. Then use the existing product UI to establish the saved account once. Per-attempt preflight verifies those declared prerequisites; the measured new agent must remain absent until the visible creation flow.

Private setup file

Create an owner-only regular JSON file outside the repository (chmod 600). Replace every placeholder with an authorized binding; never put token/cookie, password, OAuth code or startup authority bytes in it. Relative profileDir is resolved against this file's directory. The browser must declare signed-in. If board sign-in needs assistance, use setup-only --antigravity-journey-preflight to save the dedicated browser session, then start a fresh measured attempt. A measured attempt that needed assisted sign-in stops before agent or provider setup and retains a blocked report.

{
  "version": 1,
  "setupId": "local-antigravity-saved-subscription",
  "hosting": "self-hosted",
  "executionEnvironment": "local",
  "target": {
    "mode": "attach",
    "baseURL": "http://127.0.0.1:YOUR_PORT",
    "expectedCommit": "EXACT_40_CHARACTER_SERVING_COMMIT",
    "deploymentMode": "local_trusted",
    "companyId": "EXISTING_TEST_COMPANY_UUID",
    "environmentId": "EXISTING_LOCAL_ENVIRONMENT_UUID"
  },
  "browser": {
    "headed": true,
    "channel": "chrome",
    "profileDir": "./qa-browser",
    "accountAlias": "browser-operator",
    "freshness": "signed-in",
    "loginTimeoutMs": 600000
  },
  "savedConnection": {
    "id": "EXISTING_GOOGLE_CONNECTION_UUID",
    "name": "YOUR_SAVED_SUBSCRIPTION_LABEL",
    "ownerUserId": "EXPECTED_BROWSER_USER_ID"
  },
  "candidate": {
    "platform": "darwin",
    "architecture": "arm64",
    "nativeVersion": "1.5.2-paperclip.2",
    "profileDigest": "sha256:61ac14bf03ce4bbf8afe1f5a263b854517ec588d8407fe2d8f17c9fc0c037c4b",
    "nativeClosureDigest": "sha256:ab9df40a64806a8e1812234ce5331e04d1c6b5f8c7e5bdbb456cd645e58c5aad"
  },
  "limits": {
    "durationMs": 1200000,
    "turnTimeoutMs": 300000,
    "maxRuns": 2,
    "budgetCents": 200
  },
  "retainAgent": true
}

Use authenticated when it is the target's actual deployment mode; do not change the server to match the example. The maximum whole attempt is 30 minutes and each turn at most 10 minutes. budgetCents is an observed known-cost stop threshold (at most 1,000 cents), not a hard currency cap or a product-policy write. It cannot cap missing prices, unknown subscription charges or already in-flight usage. The finite execution boundary is one selected case, one attempt, exactly two task runs, finite deadlines and the startup authority's TTL. Native Test performs account/model admission and cleanup without a model prompt. An unexpected work run or inference edge must be recorded, not omitted from accounting.

Commands

Run from the Paperclip repository root, with its normal workspace dependencies installed. The maintained source files own all behavior; no author-local helper script is required. Discovery and credential-free checks do no provider work:

pnpm test:e2e:runner -- --list --suite antigravity-agent-journey
pnpm test:e2e:runner:typecheck
pnpm test:e2e:runner:unit
pnpm test:e2e:runner:browser-support -- antigravity-journey-browser.spec.ts

The browser calibration is included in the canonical browser-support target and uses local fixtures, including the real activity renderer. It checks selectors and stale UI states without an account connection, an agent setup or a provider run; it is separate from live qualification.

Read-only readiness validates the target revision/mode, signed-in consuming identity, exact personal default grant, local environment and candidate catalog. It does not run native Test, create a task or dispatch a provider prompt:

pnpm test:e2e:runner -- \
  --id antigravity-agent-journey.runner-antigravity.local.saved-subscription-two-turn \
  --antigravity-journey-config /absolute/private/antigravity.json \
  --antigravity-journey-preflight \
  --max-automatic-retries 0

After readiness, run only the exact authorized cell. A new campaign preserves previous attempts and uses no automatic retry:

pnpm test:e2e:runner -- \
  --id antigravity-agent-journey.runner-antigravity.local.saved-subscription-two-turn \
  --antigravity-journey-config /absolute/private/antigravity.json \
  --max-automatic-retries 0

Campaigns live under tests/runner-e2e/results/antigravity-journey-<timestamp>-<nonce>/. Retain their normal result, evidence manifest, checkpoint images, actual byte/hash receipts, timings, effective setup/revisions, billing and cleanup alongside failures. Run the normal importer separately to verify a retained report; it makes zero new model calls. Environment variables, not positional report arguments, select it:

PAPERCLIP_RUNNER_E2E_REPORT_ROOT=/absolute/private/campaign \
PAPERCLIP_RUNNER_E2E_REPORT_OUT=/absolute/private/rebuilt-report \
PAPERCLIP_RUNNER_E2E_EXPECTED_IDS='["antigravity-agent-journey.runner-antigravity.local.saved-subscription-two-turn"]' \
  pnpm test:e2e:runner:report

The importer must preserve the attempt verdict, cleanup outcome, duration, known input/output/cache tokens and unknown prices. A rebuilt dashboard is a presentation check, not another provider measurement. Missing final proof cannot be repaired by inventing a screenshot or rewriting an old grade.

If packaging fails, attempt-result.json preserves the primary measurement and packaging-error.json records the separate reporting failure. Any partially written result and manifest are copied before the retained presentation is marked failed with journey_report_packaging_failed. Cleanup, usage and original screenshots remain available; the normal importer can rebuild that failed presentation without changing the original outcome or supplying missing proof.

Independent acceptance and retained evidence

Success requires the correct browser controls and persisted object identity, exact actual downloaded bytes for both distinct run-bound artifacts, requested and effective low model, same full tagged native conversation, accepted result, committed finalization and an applied Done decision for each own settlement. The session-ID equality gate is an observed property of this exact native .5 integration, corroborated by both retained real task checkpoints; it is not a general ACP invariant. The first settlement is captured before reopening; later legitimate reassessment may supersede its current pointer without invalidating that historical lineage. The final task's visible status and both outputs must survive reload. Narrative claims, hidden status labels, a matching filename or a stale first artifact do not satisfy those gates.

Native public lease release, exact owned process absence and reacquisition/release of all three observed provider fence ports establish local retirement. The two turns must have different independently captured primary Runner PID/OS-birth identities, each verified against the exact run and per_turn argv. Their session-scoped Runner instance ID may remain the same; a different sidecar does not prove a fresh primary. The observer reads no private database or raw provider reasoning. Its exact local target constraint is part of the case, not portable host proof. A genuine failed finish remains failed while prior successful native file activities stay completed; the happy path does not deliberately manufacture that rejection.

Synthetic positive/negative/missing-proof controls use the same oracle and normal report boundary. They cover wrong object/run/model/conversation, stale or wrong bytes, incomplete settlement/retirement, missing final screenshot and unknown price preservation. Browser calibration includes hidden duplicate/menu/SVG Done text beside the intended visible task status. Synthetic fixtures establish these gates, not Google behavior or discoverability.

Raw authenticated setup screenshots, concrete account/company/agent/task/native session identifiers, browser state and ownership receipts stay private. Do not mark these captures public-runner-fixture, publish original walkthrough HTML, or copy provider payloads into public evidence. Source aliases and hashes are safe provenance; any public projection remains the existing sanitizer's allowlist.

Cleanup and interrupted recovery

Before forwarding the ordinary wizard's draft POST unchanged, the campaign journals only its future setupId, exact company/name/origin, intended harness and preflight browser-user identity. It does not store the full request body or credentials. The private journal serializes snapshots, fsyncs a private temporary file, atomically renames it, and fsyncs its directory; failure aborts forwarding. The response must match that future ID and creator. If the response is lost, recovery reads that exact ID, verifies company/name/creator and uniqueness, then persists the verified ID before cleanup mutations. A pending creation returning 404 remains unconfirmed; a name match alone grants no ownership. Existing receipts with a known response and no new optional witness remain supported. The receipt binds target/company, execution/attempt and immutable created resources before later task dispatch. Cleanup stops only owned active work, verifies settlement and native retirement, then pauses/removes the owned agent according to retainAgent. Supplied company/environment/browser identity and saved Google connection/default grant remain intact and are reverified. It never revokes a shared credential or resets the target. Retained task history remains inspectable. Use retainAgent: true for accounted work: cleanup leaves the owned agent paused and preserves its task and cost history. Purge remains subject to the product's ledger constraints; the fixture never removes accounting rows to force deletion. For cancellation before native selection, cleanup instead persists a closed no-launch receipt from the server's settled preparation and explicit null native ownership fields, settled accounting, and exact company/run/environment lease. That lease must have a concrete release timestamp no later than preparation settlement; expired is accepted only in this no-launch variant. Missing or pending receipts retain the agent. This branch creates no physical capture proof.

A Test that fails or times out before the product confirms probe retirement leaves its setup probe marked unconfirmed. The harness keeps that agent paused and retained. Public task-run absence cannot prove that a setup probe has retired; recovery needs authoritative proof from the product cleanup owner.

On interruption, preserve the result and receipt first. Recover with the same private target binding and the exact receipt; no name-based broad cleanup:

pnpm test:e2e:runner -- \
  --id antigravity-agent-journey.runner-antigravity.local.saved-subscription-two-turn \
  --antigravity-journey-config /absolute/private/antigravity.json \
  --antigravity-journey-recover /absolute/private/campaign/owned-resources.json \
  --max-automatic-retries 0

Recovery validates ownership before stopping recorded/new owned-agent runs or removing its agent. An uncertain mutation is reconciled before retrying. Cleanup failure stays separate from primary failure; late recovery produces a separate receipt without upgrading the original cleanup grade. Do not start another paid attempt while owned work or the browser profile lock remains unresolved.

Verification scope

The source .5 browser walkthrough and independent retained oracle passed on the declared attended local saved-subscription/low-model candidate. Native instruction wire receipts were not archived; Instructions-only provenance plus actual file bytes proves resulting behavior. HTML gallery navigation was blocked by the host's local-file preview policy and is unverified. Earlier failed/partial .4 and package-admission attempts retain their original grades.

The converted fixed driver, credential-free calibration, fresh live attempt and normal report results are recorded separately in PR/attempt evidence. A registry listing or unit pass does not qualify a live provider. Fresh OAuth, API-key live operation, Cloud, staging/remote targets, other models/platforms, failure controls, reliability repetitions and unattended execution remain outside this selection.