diff --git a/config/agents.toml b/config/agents.toml index 0d8a44e..62fafb0 100644 --- a/config/agents.toml +++ b/config/agents.toml @@ -700,6 +700,15 @@ label = "Mistral Vibe CLI" command = "vibe" adapter = "passthrough" +# Antigravity CLI (agy): Google AI Pro subscription auth via OS keyring, no +# Infisical secret. `agent agy` / `agent native agy` run it untouched; the +# read-only visual review contract lives in `agent review` (agy-review.ts, +# ADR-0023), not in a provider route. +[harnesses.agy] +label = "Antigravity" +command = "agy" +adapter = "passthrough" + # Claude adapter environment names (Claude Code's own protocol contract). # These are names, never values; values are derived at launch time. [harnesses.claude.env] diff --git a/docs/adr/ADR-0023.md b/docs/adr/ADR-0023.md new file mode 100644 index 0000000..0e94d06 --- /dev/null +++ b/docs/adr/ADR-0023.md @@ -0,0 +1,103 @@ +# ADR-0023: Antigravity visual review harness (`agent review`) + +- Status: Accepted +- Date: 2026-11-23 +- Layer: Current practice / execution contract, not Constitution +- Related: [#219](https://github.com/rebuildup/dotfiles/issues/219), [ADR-0022](ADR-0022.md), [#218](https://github.com/rebuildup/dotfiles/issues/218) +- Research: [docs/research/antigravity-cli-2026-11-23.md](../research/antigravity-cli-2026-11-23.md) + +## Context + +Issue #219 asks for a Google AI Pro visual review harness on top of the +`agy` integration delivered by #218/ADR-0022. The operator requirements: + +- single-shot `agy -p` execution; no ACP daemon, no persistent agent runtime; +- review inputs (images + spec) must be isolated from the reviewed repository; +- the original repository must be unwritable at the OS level, not merely by + model permission; +- results must be structured and failures/unverified runs must be classified + explicitly — `agy -p` reports `status: "SUCCESS"` even when forbidden + operations were attempted and denied (ADR-0022, research memo); +- quota information must be retrievable; +- direct execution and Herdr-mediated execution must share one contract; +- quota sharing control / scheduling is out of scope unless trivially small. + +## Decision + +### 1. One module, two transports + +`script/agent/agy-review.ts` implements the whole contract. `agent review run` +executes locally; `agent review run --executor herdr` materializes the request +into an isolated workdir and re-enters `agent review run-file ` +inside a Herdr pane (`herdr workspace create` + `pane run`, existing +`script/agent/herdr.ts` primitives — no new worker registry, no second task +state model). The inner run is the same code path, so the result schema, +isolation layers and classification are identical by construction. + +### 2. Input isolation + +The model only ever sees copies. Images are validated (absolute path, no +`..`, allowlisted extension, size cap) and copied into +`$AGENT_STATE_DIR/agy-review//inputs/`; the spec and JSON schema are +materialized beside them. The prompt references only the copies. The reviewed +repository is never the working directory and its path is never handed to +the model. + +### 3. Layered read-only enforcement + +1. **Permission layer** — `agy --settings` carries the ADR-0022 deny payload + (`write_file`, `command`, `read_url`, `execute_url`, `mcp`, `unsandboxed`). + The managed file `~/.config/agy/review.settings.json` is preferred; an + identical inline fallback keeps the harness fail-closed before `script/link` + has run. +2. **OS layer** — on macOS the child runs under `sandbox-exec` (Seatbelt) + with `deny file-write*` outside an explicit allowlist (review workdir, + `~/.gemini`, `~/.cache`, Antigravity app-support, temp dirs). SBSL deny + uses `require-not`/`require-any` because a later `(allow ...)` does not + override an earlier `(deny ...)`. Non-macOS records + `osSandbox: "unsupported"` in the result — reduced assurance, not silent. +3. **Post-run verification** — independent signals, never the CLI status + alone: `denied_actions`, permission-error markers in the response, + protected-path `git status --porcelain` snapshot diff (`--protect`), and + required-key validation of the structured verdict. + +### 4. Result contract and classification + +`AgyReviewResult` (versioned `"1.0.0"`) records the agy envelope fields, the +readonly evidence, isolation facts, quota snapshot and `reasons[]`. +`classification` is one of `review-completed`, `agy-error`, `auth-required`, +`timeout`, `invalid-output`, `readonly-violation`, `executor-error`. +Any denied action, in-band permission error, or protected-path mutation +forces `readonly-violation` even when the envelope says SUCCESS. `verified` +is true only for a completed review whose supplied verification layers all +passed. Exit code is 0 only for `review-completed`, so schedulers fail +closed. + +### 5. Quota + +`fetchAgyQuota()` runs `agy -p "/quota" --output-format json` once per review +(skip with `--no-quota`) and normalizes the observed TSV format +(`\t