@sabaiway/agent-workflow-kit 1.44.0 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +6 -3
  3. package/SKILL.md +9 -1
  4. package/bridges/antigravity-cli-bridge/SKILL.md +1 -1
  5. package/bridges/antigravity-cli-bridge/bin/agy-review.sh +87 -16
  6. package/bridges/antigravity-cli-bridge/bin/agy-review.test.mjs +3 -0
  7. package/bridges/antigravity-cli-bridge/bin/agy.test.mjs +4 -2
  8. package/bridges/antigravity-cli-bridge/capability.json +3 -2
  9. package/bridges/codex-cli-bridge/SKILL.md +1 -1
  10. package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +3 -0
  11. package/bridges/codex-cli-bridge/bin/codex-review.sh +90 -19
  12. package/bridges/codex-cli-bridge/bin/codex-review.test.mjs +4 -0
  13. package/bridges/codex-cli-bridge/capability.json +3 -2
  14. package/bridges/codex-cli-bridge/references/driving-codex.md +3 -2
  15. package/bridges/codex-cli-bridge/references/sandbox-and-flags.md +3 -2
  16. package/capability.json +1 -1
  17. package/package.json +1 -1
  18. package/references/modes/bootstrap.md +1 -1
  19. package/references/modes/grounding.md +8 -7
  20. package/references/modes/recommendations.md +14 -0
  21. package/references/modes/review-state.md +1 -1
  22. package/references/modes/sandbox-masks.md +15 -0
  23. package/references/modes/upgrade.md +10 -7
  24. package/references/modes/velocity.md +13 -2
  25. package/references/shared/composition-handoff.md +21 -16
  26. package/references/shared/report-footer.md +5 -1
  27. package/references/templates/AGENTS.md +2 -1
  28. package/references/templates/autonomy.json +3 -0
  29. package/tools/autonomy-config.mjs +13 -3
  30. package/tools/commands.mjs +15 -1
  31. package/tools/delegation.mjs +9 -5
  32. package/tools/detect-backends.mjs +2 -2
  33. package/tools/doc-parity.mjs +8 -0
  34. package/tools/engine-source.mjs +6 -0
  35. package/tools/family-registry.mjs +21 -7
  36. package/tools/fold-completeness-run.mjs +5 -0
  37. package/tools/grounding.mjs +139 -22
  38. package/tools/inject-methodology.mjs +117 -28
  39. package/tools/manifest/schema.md +20 -0
  40. package/tools/manifest/validate.mjs +26 -0
  41. package/tools/procedures.mjs +61 -8
  42. package/tools/recipes.mjs +94 -15
  43. package/tools/recommendations.mjs +469 -0
  44. package/tools/review-ledger-write.mjs +14 -0
  45. package/tools/review-ledger.mjs +3 -2
  46. package/tools/review-state.mjs +101 -24
  47. package/tools/run-gates.mjs +3 -0
  48. package/tools/sandbox-masks.mjs +370 -0
  49. package/tools/set-recipe.mjs +13 -1
  50. package/tools/velocity-profile.mjs +228 -22
package/CHANGELOG.md CHANGED
@@ -4,6 +4,58 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
4
4
  is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
5
5
  every `migrations/<version>-<slug>.md` newer than it, in semver order.
6
6
 
7
+ ## 1.45.0 — Autonomy series close: upgrade Recommendations, bridge-wrappers tier, review-domain mask fix (AD-044 Plan 4)
8
+
9
+ A **feature** release closing the AD-044 autonomy series (ships with memory 2.1.0, engine 1.15.0,
10
+ bridges 2.4.0; the deployment lineage head stays `2.0.0` — the new seed is ensure-if-missing,
11
+ stamp-independent). Three maintainer pains land as product:
12
+
13
+ - **`recommendations` mode — the mandatory upgrade advisor.** Read-only `recommendations.mjs`
14
+ renders a frozen 12-item registry as `{what is sub-optimal · one-line fact-true benefit · exact
15
+ apply one-liner}`; every `upgrade` run now ENDS with the section on BOTH exits (equal-head and
16
+ re-stamp), present-even-when-empty ("no recommendations — flow optimal."), BEFORE the report
17
+ footer and commit ask. Apply lines are PURE executable commands, cwd-independent (absolute
18
+ paths, pinned `--cwd`); probes degrade to stated skipped-item lines — an unreadable bundled
19
+ manifest or an uncaveated unknown-freshness row is a stated skip, a stray bundle-root file is
20
+ ignored, a duplicate-carrying bridge-settings file renders fix-duplicates-first instead of the
21
+ writer command it would refuse. The network-allowlist item is HAND-APPLY by design: the kit
22
+ never seeds `sandbox.network.allowedDomains`; hosts derive from the bridges' manifest
23
+ `networkHosts`, the paste value is PROJECT scope ∪ missing (a local-scope allowance counts
24
+ toward coverage but never widens into the committed file), and the item renders only on the
25
+ full two-surface tier proof. Autonomy facts resolve from the PROJECT ROOT on every paste
26
+ surface, and seed detection is STRUCTURAL via the shared `isSparseSeedConfig` predicate on all
27
+ four surfaces (an explicit declared-defaults policy still gets its render nudge — the red-line
28
+ ask rules ride the render).
29
+ - **`--bridge-tier` velocity lane — unattended council runs.** A frozen tier seeds, behind its own
30
+ consent flag, BOTH surfaces a promptless review run needs: `permissions.allow` prefix rules for
31
+ the review wrappers' CODE mode only (`Bash(codex-review code:*)`, `Bash(agy-review code:*)` —
32
+ plan/diff modes and the exec wrappers keep their human prompt) + the wrapper names in
33
+ `sandbox.excludedCommands` (the harness runs those outside the sandbox — no agent-side bypass).
34
+ The grounding pre-step rule seeds in the EXACT double-quoted byte-form the procedures advisor
35
+ renders (byte-parity pinned; derives only when agy-review is placed). Tier entries register at
36
+ all three audit points — the audit never flags an entry the tier itself seeded. The
37
+ exfiltration posture is INFORMED CONSENT, notice-pinned; the invocation-shape contract is
38
+ stated (prefix rules match only PLAIN invocations). `grounding --out` hardened: temp-only
39
+ outside-repo, create-only + exclusive fresh in-repo, non-regular-leaf refusals.
40
+ - **Review-domain device-mask fix + `sandbox-masks` lane.** Never-committable stat classes
41
+ (char/block devices, FIFOs, sockets) are filtered out of the ENTIRE review domain in lockstep —
42
+ node fingerprint/isTreeClean + both bash twins' payload, diff assembly and preflights + parity —
43
+ so the sandbox-mask fingerprint-divergence class is dead BY CONSTRUCTION (untracked symlinks and
44
+ directories/gitlinks stay in the domain). The GUARDED `sandbox-masks` tool adds the cosmetic
45
+ lane: read-only probe (derives/revalidates, refuses every non-mask class) + consent-gated
46
+ `--apply` full-block REPLACE of its own fence in `git-path info/exclude` (a stale-real-only
47
+ fence renders the `--clear` form on every surface); `review-state --check` advises the exact
48
+ one-liner when masks are visible. Honest residual: REGULAR fake-file injection is a new design
49
+ round if it appears.
50
+ - **Autonomy surfacing + seeds.** `recipes --status-line/--json/--active-line`, `set-recipe` echo
51
+ and `procedures` gained autonomy segments rendered from `resolveAutonomy` (MALFORMED-loud on
52
+ every paste surface; `procedures` also exits 1 on a malformed policy while still rendering);
53
+ the sparse defaults-equivalent `autonomy.json` template mirrors from memory; bootstrap seeds it,
54
+ upgrade ensures-if-missing. Manifests gained consult-locked `networkHosts` (observed-minimal
55
+ INCLUDING apex domains; validated by `--strict`; synthetic examples in schema.md); velocity.md
56
+ carries the honesty matrix (settings sandbox keys are INERT under harness-managed sandboxes —
57
+ live-observed). Tarball sentinel 145→150; router/read-set budgets took documented KB bumps.
58
+
7
59
  ## 1.44.0 — Autonomy provisioner: the consent-gated sandbox doctor (AD-044 Plan 2)
8
60
 
9
61
  A **feature** release (kit-only; memory/engine/bridges unchanged, lineage head stays `2.0.0`). New
package/README.md CHANGED
@@ -236,9 +236,11 @@ file), or run the guarded `/agent-workflow-kit uninstall`.
236
236
  | `/agent-workflow-kit procedures <activity>` | any time | **read-only** activity-procedures advisor: prints a named activity's ordered steps (`plan-authoring` / `plan-execution`) read **live** from the engine, plus the **resolved recipe per slot** from your `docs/ai/orchestration.json` (agent-writable via `set-recipe`, or hand-edited) + backend readiness (default Reviewed when a backend is ready, Council on request, slot-aware incl. Delegated) — and, for every dispatched backend, the **full driving contract at the point of use** (exact copy-pasteable invocation, grounding levers like agy's `--facts`/`--decided`, the round-2 `--continue` delta, guarded passthrough), verbatim from the bridge manifests (drift-guarded; each wrapper's `--help` prints the same). `--override <slot>=<recipe>` adjusts one slot per run. Composes with `recipes`; never writes, never commits, never runs a subscription CLI. |
237
237
  | `/agent-workflow-kit set-recipe` | any time | **config writer** for `docs/ai/orchestration.json`: tell the agent your preference in plain language and it maps it to explicit `--set <activity>.<slot>=<recipe>` / `--unset` ops; the kit validates, **previews by default**, and writes only on `--write` (deployment-gated, atomic, symlink/TOCTOU-safe), resolving the effective recipe vs live readiness. Writes **only** that file — **never runs a backend, never commits**; hand-editing stays fully supported. |
238
238
  | `/agent-workflow-kit review-state` | any time | **read-only review-receipt checker** — makes "reviewed ≠ shipped" detectable: the bridge review wrappers append a receipt per successful review (into a file inside the git dir — never committable); this checks that every backend your configured `plan-execution.review` recipe names holds a **fresh, grounded receipt for the current uncommitted tree** (any later edit moves the fingerprint and stales the receipt; a review continuation never re-attests a folded tree). `--check` gives a gate exit code to declare in `docs/ai/gates.json` **by hand or via the consent-gated seeder** (preview → your explicit yes; never without consent). `--await [--timeout <s>]` (AD-049) BLOCKS until every recipe-named backend has receipted the current tree — the durable completion signal is the receipt, never a process event — so you wait for the bridges instead of hand-polling. Never writes, never commits, never runs a subscription CLI; it spawns read-only `git` queries to fingerprint the tree — and `git commit --no-verify` stays possible (discipline, not a sandbox). |
239
- | `/agent-workflow-kit grounding` | any time | **grounded-review facts assembler** — mechanizes populating `agy-review --facts @f`: slices your entry-point's **Hard Constraints** section verbatim (exactly one match, else a loud stop) and/or a plan's decision-bearing sections (`## Approach` + `## Verification` required, `## Decisions (locked)` when present; duplicates stop), under the same byte budget the agy wrapper enforces (minus `--reserve-bytes` for the artifact share), with a loud tail-trim on overflow. `--ledger-summary` (AD-049) appends a COMPUTED review-ledger digest for the single in-flight segment (rounds · origins · classifications · verdicts · overridesunrelated loops excluded), so the reviewer sees the loop's own history without hand-copying. Prints to stdout; `--out` writes **one scratch file only** (gitignored / outside the repo a tracked or not-ignored in-repo path is refused). Never commits, never runs a subscription CLI. |
239
+ | `/agent-workflow-kit sandbox-masks` | any time | **cosmetic exclude lane for sandbox device masks** — an OS sandbox (Claude Code) injects character-device masks into the work tree as untracked `git status` noise; the review domain already ignores them **by construction** (never-committable untracked classes char/block devices, FIFOs, sockets are excluded from the fingerprint, the assembled review payload, and the clean checks). This mode hides them from `git status` too: flagless = read-only probe (derives the CURRENT mask set from the unfiltered walk + lstat never a frozen list and revalidates fenced entries, loudly flagging one that became a real path); `--apply` = consent-gated FULL-BLOCK replace of its own fenced block in `git rev-parse --git-path info/exclude` (stale masks drop by construction; `--clear` always means REMOVE the block it takes precedence over the derivation). Writes ONLY its fence never `.gitignore`, never global config; symlinked/non-regular exclude paths and malformed fences fail closed. Watch note: a real file at an excluded path is silently skipped by bulk staging (`git add -A`/`git add .`) delete the stale line first; the probe flags exactly this case. |
240
+ | `/agent-workflow-kit grounding` | any time | **grounded-review facts assembler** — mechanizes populating `agy-review --facts @f`: slices your entry-point's **Hard Constraints** section verbatim (exactly one match, else a loud stop) and/or a plan's decision-bearing sections (`## Approach` + `## Verification` required, `## Decisions (locked)` when present; duplicates stop), under the same byte budget the agy wrapper enforces (minus `--reserve-bytes` for the artifact share), with a loud tail-trim on overflow. `--autonomy` (AD-044) appends the COMPUTED effective autonomy policy from the git-top `docs/ai/autonomy.json` (every red-line + per-activity level, stated source line; absent file → the computed defaults ARE the policy, exit 0; a malformed policy fails CLOSED, exit 1). `--ledger-summary` (AD-049) appends a COMPUTED review-ledger digest for the single in-flight segment (rounds · origins · classifications · verdicts · overrides — unrelated loops excluded), so the reviewer sees the loop's own history without hand-copying. Prints to stdout; `--out` writes **one scratch file only** — system-temp outside the repo ($TMPDIR / /tmp, rewritable) or a **fresh** gitignored in-repo path (create-only, exclusive write; an existing in-repo file, even gitignored, is refused — the `.env` clobber class); tracked, not-ignored-in-repo, other outside-repo, and symlink/non-regular destinations are all refused. Never commits, never runs a subscription CLI. |
240
241
  | `/agent-workflow-kit review-ledger` | any time | **review-round ledger** — turns the review-loop stop rule into a **computed** signal: record each plan-execution review round, its triage, and any recorded **overrides** (`oracle-change` lifts named tampered test files; `red-proof` waives the observed-red proof for exactly one `testId`; v4 adds **`size-cap`** — the exact sanctioned magnitude for a surface over the diff cap, segment-scoped — all loud, durable, auditable waivers, never silent) into a JSONL ledger inside the git dir (never committable), and read the stop decision (`converged > resolved-residual > triage-required > continue`) from the records — never from a remembered rule. **Since v4 every record carries `base` = the HEAD commit and the whole loop is SEGMENT-scoped (AD-048):** round numbering, the caps, and every tooth reset ONLY at a gated commit — a multiphase plan records fully while round 4 within one segment stays refused; `gate-run` records (minted by `gates --record`) make gates-before-review a computed precondition; the triage class **`refuted`** is the honest phantom-finding lane (grounds mandatory); `--telemetry` renders counts-only gate-efficacy data across all loops and both ledgers. `--status` replaces the hand-composed per-round tally; `record --from-receipts` (AD-049) DRAFTS the `backends[]` from the current-fingerprint receipts (verdict per backend, counts from the supplied findings) instead of hand-composing them — a recipe-named backend with no receipt is a loud stop; `--check` is a fail-closed gate exit code for `docs/ai/gates.json` (by hand or via the consent-gated seeder). A `fixable-bug` triage **requires its red→green `testId`** (v1..v3 records stay valid on read — old records never enter a segment). The writer refuses a round (past the hard-max, while a triage is pending, or lacking a grounded review receipt) and refuses an override outside its single in-flight loop. Honest residual: records are forgeable — self-discipline, not a security boundary. Never commits, never runs a subscription CLI. |
241
242
  | `/agent-workflow-kit fold-completeness` | any time | **fold-completeness gate** — attests the review loop's folded fixes were proven the HONEST way (no fix theater): the runner executes your suite ONCE under `NODE_V8_COVERAGE`, checks every changed executable line is **executed**, probes every bound `testId` N times (`AW_FOLD_RERUNS`), records content hashes, and scans the test surface for tamper; the `--red` verb observes a test FAILING on the pre-fold tree — **BEFORE the fix** — and mints an **observed-red receipt**. The read-only checker (`--status` / `--check`) then requires, per bound test: the receipt, receipt-precedes-run order, N/N-green probes, and content **custody** (the green test is byte-identical to the one seen failing) — the receipt+custody half waivable for exactly one `testId` by a recorded `red-proof` override; mixed/timed-out probes are QUARANTINE (never converted, no override); **v3 records carry `base` and the proof is segment-scoped (AD-048)** — a committed phase's custody obligations close with its commit, and a receipt never crosses a commit boundary; tampered pre-existing test files fail closed unless covered by a recorded `oracle-change` override. Honest residuals: coverage proves **execution, not assertion**, and records are forgeable — self-discipline, not a security boundary. v1 scope is JS/V8 (pluggable via `AW_FOLD_BOUND_CMD`): changed TS/JSX fails closed, docs/config changes are listed but never block, and **no mutation testing ships**. Wire the gate by hand — the consent-gated seeder deliberately does not offer it yet (JS-only hold). Never commits, never runs a subscription CLI. |
243
+ | `/agent-workflow-kit recommendations` | any time (every `upgrade` ends with it) | **read-only deployment advisor** (AD-044) — computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, OS sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter) and renders each item as **{what · one-line benefit · the exact consent-gated apply one-liner}**; the agent pastes the section **verbatim** and runs EXACTLY the rendered one-liners only on your yes. Renders **present-even-when-empty** (`no recommendations — flow optimal.`); a failed probe degrades to a stated skip line. Benefit lines are fact-true frozen data (the bridge-wrappers item claims velocity only; risk-bearing items state their risk inline); the network-allowlist item is **HAND-APPLY** — the kit never seeds `sandbox.network.allowedDomains` / `filesystem.allowWrite` (the hosts are documented per bridge in `capability.json` `networkHosts`). `--cwd` is required (the target project is explicit); never writes, never commits, never runs a subscription CLI. |
242
244
  | `/agent-workflow-kit doc-parity` | any time | **read-only doc-parity lint** (AD-049) — kills the doc-drift class where a mode-contract doc silently lags a code constant (a `--check` doc still reading `300` after the diff cap moved to `400`): a **closed, exported registry** binds each live constant (review caps, schema versions, the ledger's own class/scope vocabulary, and the autonomy-doctor EXIT/status/trusted-dir contract) to the exact token its `references/modes/*.md` contract must carry, and asserts the CURRENT value renders into every bound file — a drifted doc, an unreadable file, or an absent token **fails closed**. The values are sourced from the live imports (never re-typed), so the lint can't itself go stale; adding a binding is adding a checked entry (closed-world, edit-safe). `--check` is a gate exit code for `docs/ai/gates.json`. Never writes, never commits, never runs a subscription CLI. |
243
245
  | `/agent-workflow-kit uninstall` | opt-in, any time | **guarded teardown** — the inverse of `init` / `setup`. Removes only what's **provably ours** (managed skill dirs + bridge wrappers; in a project, the hidden-mode git-ignore block it added + the pre-commit hook it installed); **never deletes** your `docs/ai` / `AGENTS.md` (prints the exact `rm` to run by hand) or your `.claude/settings.json` (prints an **edit** — remove the attribution key, review any velocity `permissions.*` — never an `rm`). Always `--dry-run` first; preflight-then-mutate; never commits. |
244
246
  | `/agent-workflow-kit velocity` | Claude Code · opt-in | **onboarding velocity profile** — seeds a fixed, audited **read-only** allowlist into `.claude/settings.json` so routine read-only commands stop idling on approval prompts while you're away; opt-in `acceptEdits`; plus a **read-only advisory** of likely project gate commands to add by hand. Writes **only** `.claude/settings.json` — **never** allowlists commit/push/publish, never writes `settings.local.json`, never commits. A seeded entry is a **trust posture, not a sandbox** (a runtime residual remains at the settings level — its guard ships as the opt-in `hook` command); a direct commit/push/publish still asks. `--dry-run` first. |
@@ -284,8 +286,9 @@ agent-workflow-kit — the composition root (installed via npx … init)
284
286
 
285
287
  - **Delegates** substrate deployment to **`@sabaiway/agent-workflow-memory`** when a healthy
286
288
  standalone copy is present, else uses its **bundled fallback** — same `docs/ai/` either way.
287
- - **Injects** two bounded pointers into the deployed `AGENTS.md` — the workflow **methodology** and the
288
- **orchestration recipes** (Solo / Reviewed / Council / Delegated) read **live** from the installed
289
+ - **Injects** three bounded pointers into the deployed `AGENTS.md` — the workflow **methodology**, the
290
+ **orchestration recipes** (Solo / Reviewed / Council / Delegated), and the **autonomy policy** (the
291
+ `docs/ai/autonomy.json` read contract) — read **live** from the installed
289
292
  **`agent-workflow-engine`** (the canonical narrative; a published member, never one of the shipped
290
293
  backends). `/agent-workflow-kit recipes` surfaces + plans a recipe for your environment, read-only.
291
294
  - **Detects & (opt-in) sets up** the optional `codex` / `agy` **bridges** — agent skills (not npm;
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-kit
3
3
  description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow".
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '1.44.0'
6
+ version: '1.45.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-kit
@@ -111,6 +111,10 @@ writer — read `${CLAUDE_SKILL_DIR}/references/modes/setup.md` before acting.
111
111
 
112
112
  read-only — read `${CLAUDE_SKILL_DIR}/references/modes/status.md` before acting.
113
113
 
114
+ ### Mode: recommendations
115
+
116
+ read-only — read `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md` before acting.
117
+
114
118
  ### Mode: recipes
115
119
 
116
120
  read-only — read `${CLAUDE_SKILL_DIR}/references/modes/recipes.md` before acting.
@@ -131,6 +135,10 @@ writer — read `${CLAUDE_SKILL_DIR}/references/modes/set-autonomy.md` before ac
131
135
 
132
136
  guarded — read `${CLAUDE_SKILL_DIR}/references/modes/autonomy-doctor.md` before acting.
133
137
 
138
+ ### Mode: sandbox-masks
139
+
140
+ guarded — read `${CLAUDE_SKILL_DIR}/references/modes/sandbox-masks.md` before acting.
141
+
134
142
  ### Mode: uninstall
135
143
 
136
144
  guarded — read `${CLAUDE_SKILL_DIR}/references/modes/uninstall.md` before acting.
@@ -2,7 +2,7 @@
2
2
  name: antigravity-cli-bridge
3
3
  description: Delegate work to Google's Antigravity CLI (`agy`) — the successor to Gemini CLI — to reach Gemini, Claude, and GPT-OSS models under a Google AI Pro/Ultra subscription from the terminal. Use when the user wants to run a headless `agy` prompt, hand a focused task or second-opinion review to `agy`, install or authenticate Antigravity CLI, check or economise its quota/models, bridge project context into `agy`, set up a second delegated-execution backend beside Codex, or troubleshoot `agy` flags, models, auth, conversations, or its no-JSON headless behaviour.
4
4
  metadata:
5
- version: '2.3.0'
5
+ version: '2.4.0'
6
6
  ---
7
7
 
8
8
  # antigravity-cli-bridge
@@ -79,7 +79,9 @@ Receipt:
79
79
  <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides; plan/diff outside
80
80
  a git tree: warn + skip unless overridden): fingerprint = sha256 over the canonical
81
81
  uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the
82
- review-payload domain) in code mode, the artifact-file sha256 in plan/diff mode; verdict
82
+ review-payload domain; never-committable untracked paths character/block devices, FIFOs,
83
+ sockets — are excluded from the domain entirely, untracked symlinks/directories ride as
84
+ name-only notes) in code mode, the artifact-file sha256 in plan/diff mode; verdict
83
85
  recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK);
84
86
  grounded = whether a NON-EMPTY --facts payload was supplied (an empty payload records
85
87
  grounded:false — fail-closed, the state gate rejects it), factsHash = sha256 of the facts
@@ -192,7 +194,7 @@ DEFAULT_AGY_REVIEW_MODEL="Gemini 3.1 Pro (High)"
192
194
  # Review-receipt identity (AD-038). AW_BRIDGE_VERSION mirrors this bridge's SKILL.md/capability.json
193
195
  # version (drift-guarded by agy-review.test.mjs against capability.json).
194
196
  AW_RECEIPT_BACKEND="agy"
195
- AW_BRIDGE_VERSION="2.3.0"
197
+ AW_BRIDGE_VERSION="2.4.0"
196
198
  # `-` not `:-` so an EXPLICIT empty AGY_MODEL= survives (drop --model, use settings.json — agy.sh:52).
197
199
  AGY_MODEL="${AGY_MODEL-$DEFAULT_AGY_REVIEW_MODEL}"
198
200
  # Frontier review models. ANY model is allowed; a sub-frontier one only earns a soft, silenceable warning.
@@ -306,11 +308,76 @@ sha256_stdin() {
306
308
  fi
307
309
  }
308
310
 
311
+ # Never-committable untracked stat class (Decision 1, AD-044 Plan 4): character/block devices,
312
+ # FIFOs, sockets — git content can never carry them, so they are excluded from the ENTIRE review
313
+ # domain (fingerprint payload, assembled change set, status section, no-diff preflight). Symlinks
314
+ # (checked first, never followed) and directories (an embedded repo lists as `dir/` — a committable
315
+ # gitlink) STAY in the domain. The class surfaces where a sandbox injects device masks whose dirent
316
+ # LIES to git's walk; the stat here sees the truth.
317
+ is_never_committable_untracked() {
318
+ [[ ! -L "$1" && ( -p "$1" || -S "$1" || -c "$1" || -b "$1" ) ]]
319
+ }
320
+
321
+ # The ONE untracked-not-ignored walk every review-domain surface iterates (fingerprint payload,
322
+ # assembled change set, no-diff preflight): NUL-delimited paths with the never-committable classes
323
+ # filtered out.
324
+ emit_untracked_paths_z() {
325
+ local path
326
+ while IFS= read -r -d '' path; do
327
+ if is_never_committable_untracked "$path"; then continue; fi
328
+ printf '%s\0' "$path"
329
+ done < <(git ls-files --others --exclude-standard -z)
330
+ }
331
+
332
+ # True when at least one untracked-not-ignored path survives the never-committable filter — the
333
+ # no-diff preflight twin of the fingerprint walk (a tree whose ONLY untracked paths are
334
+ # device/FIFO/socket masks reads clean).
335
+ has_reviewable_untracked() {
336
+ [[ "$(emit_untracked_paths_z | wc -c)" -gt 0 ]]
337
+ }
338
+
339
+ # `git status --porcelain=v1` with never-committable untracked records dropped, so the assembled
340
+ # review payload is byte-identical with and without a device mask (the fingerprint==payload domain
341
+ # identity). Quote/space-safe: each filtered path's DISPLAYED line comes from git itself (never a
342
+ # re-implemented C-quoting), then exact whole-line removal — only untracked (??) records can match
343
+ # by construction. A mask nested in an otherwise-empty untracked directory leaves the collapsed
344
+ # `?? dir/` record (a directory is not in the filtered class); the real sandbox masks land beside
345
+ # tracked content, where status lists them individually.
346
+ emit_status_porcelain_filtered() {
347
+ local path line drop=""
348
+ while IFS= read -r -d '' path; do
349
+ if is_never_committable_untracked "$path"; then
350
+ line="$(git status --porcelain=v1 -- ":(literal)$path")"
351
+ if [[ -n "$line" ]]; then drop+="$line"$'\n'; fi
352
+ fi
353
+ done < <(git ls-files --others --exclude-standard -z)
354
+ if [[ -z "$drop" ]]; then
355
+ git status --porcelain=v1
356
+ else
357
+ git status --porcelain=v1 | grep -Fvxf <(printf '%s' "$drop") || true
358
+ fi
359
+ }
360
+
361
+ # ONE non-failing advisory when the walk observes never-committable untracked paths: they are
362
+ # ignored by the review domain BY CONSTRUCTION; the kit's sandbox-masks lane can hide them from
363
+ # `git status` too. Never an error, never a detector.
364
+ warn_never_committable_untracked() {
365
+ local path n=0
366
+ while IFS= read -r -d '' path; do
367
+ if is_never_committable_untracked "$path"; then n=$((n + 1)); fi
368
+ done < <(git ls-files --others --exclude-standard -z)
369
+ if (( n > 0 )); then
370
+ echo "notice: $n never-committable untracked path(s) (device/FIFO/socket) ignored by the review domain — for a clean 'git status' see the kit's sandbox-masks lane (/agent-workflow-kit sandbox-masks)." >&2
371
+ fi
372
+ }
373
+
309
374
  # The canonical uncommitted-state fingerprint payload (code mode). Domain == the review payload:
310
- # tracked staged + unstaged changes + untracked-not-ignored file contents (binary/symlink/non-regular
311
- # untracked paths ride as name-only notes, mirroring the assembled change set). The prose definition
312
- # lives in capability.json roles.review.contract.receipt (both bridges, lockstep); the kit checker
313
- # (tools/review-state.mjs) implements the SAME serialization in node — cross-checked by the kit's
375
+ # tracked staged + unstaged changes + untracked-not-ignored file contents (binary untracked files,
376
+ # symlinks, and directories/gitlinks ride as name-only notes, mirroring the assembled change set;
377
+ # never-committable untracked paths devices/FIFOs/sockets are EXCLUDED entirely, see
378
+ # emit_untracked_paths_z). The prose definition lives in capability.json
379
+ # roles.review.contract.receipt (both bridges, lockstep); the kit checker (tools/review-state.mjs)
380
+ # implements the SAME serialization in node — cross-checked by the kit's
314
381
  # review-fingerprint-parity.test.mjs.
315
382
  emit_fingerprint_payload() {
316
383
  git diff --cached --no-ext-diff
@@ -327,7 +394,7 @@ emit_fingerprint_payload() {
327
394
  printf 'untracked:%s\n' "$path"
328
395
  cat -- "$path"
329
396
  fi
330
- done < <(git ls-files --others --exclude-standard -z)
397
+ done < <(emit_untracked_paths_z)
331
398
  }
332
399
 
333
400
  # sha256 of the canonical payload, emitted from the work-tree ROOT (a subdir invocation hashes the
@@ -383,16 +450,18 @@ parse_agy_verdict() { # $1 = captured-output file
383
450
  esac
384
451
  }
385
452
 
386
- # Emit the full code-review surface: repo map, status, staged + unstaged diffs, and the CONTENTS of
387
- # every untracked REGULAR file (NUL-safe iteration). Symlinks are shown as their target (never
388
- # followed no out-of-repo leak); other non-regular paths (FIFO/socket/device/dir) are skipped.
389
- # Ported verbatim from codex-cli-bridge/bin/codex-review.sh.
453
+ # Emit the full review surface to stdout: repo map, status (never-committable untracked records
454
+ # filtered), staged + unstaged diffs, and the CONTENTS of every untracked REGULAR file (NUL-safe
455
+ # iteration over the SAME filtered walk as the fingerprint the payload is byte-identical with
456
+ # and without a device mask). Symlinks are shown as their target (never followed — no out-of-repo
457
+ # leak); directories/vanished paths are noted, never read (a `cat` on a FIFO would hang BEFORE the
458
+ # hard timeout applies — that class never reaches this loop).
390
459
  assemble_code_diff() {
391
460
  echo "=== repo file map (git ls-files) ==="
392
461
  git ls-files
393
462
  echo
394
463
  echo "=== git status (porcelain) ==="
395
- git status --porcelain=v1
464
+ emit_status_porcelain_filtered
396
465
  echo
397
466
  echo "=== staged diff (git diff --cached) ==="
398
467
  git diff --cached --no-ext-diff
@@ -414,7 +483,7 @@ assemble_code_diff() {
414
483
  cat -- "$path"
415
484
  printf '\n'
416
485
  fi
417
- done < <(git ls-files --others --exclude-standard -z)
486
+ done < <(emit_untracked_paths_z)
418
487
  }
419
488
 
420
489
  # --- Resume detection (must be the FIRST argument) ---------------------------
@@ -593,12 +662,14 @@ else
593
662
  exit 2
594
663
  fi
595
664
  cd "$(git rev-parse --show-toplevel)"
596
- # No-diff preflight — never spend a run on a clean tree.
597
- if git diff --quiet && git diff --cached --quiet \
598
- && [[ -z "$(git ls-files --others --exclude-standard)" ]]; then
665
+ # No-diff preflight — never spend a run on a clean tree. Never-committable untracked masks do
666
+ # not count: the FILTERED domain is the review surface.
667
+ if git diff --quiet && git diff --cached --quiet && ! has_reviewable_untracked; then
599
668
  echo "agy-review: no uncommitted changes to review — the working tree is clean." >&2
669
+ warn_never_committable_untracked
600
670
  exit 0
601
671
  fi
672
+ warn_never_committable_untracked
602
673
  # The canonical fingerprint of the tree agy is about to review — computed at assembly time,
603
674
  # so the receipt attests exactly the reviewed state.
604
675
  REVIEW_ARTIFACT="code"
@@ -101,6 +101,9 @@ const run = (sb, { args, env = {}, cwd } = {}) => {
101
101
  env: {
102
102
  HOME: home,
103
103
  PATH: `${bin}:${farm}`,
104
+ // Keep the wrapper's mktemp working when the suite runs inside an OS sandbox whose /tmp is
105
+ // read-only (only $TMPDIR is writable there).
106
+ TMPDIR: process.env.TMPDIR ?? '/tmp',
104
107
  AGY_FAKE_ARGV: cap.argv, AGY_FAKE_ENV: cap.env, AGY_FAKE_PROMPT: cap.prompt,
105
108
  AGY_FAKE_SENTINEL: cap.sentinel, AGY_FAKE_ADDDIR: cap.adddir, AGY_FAKE_ADDDIR_MODE: cap.adddirMode,
106
109
  AGY_FAKE_ARTIFACT_MODE: cap.artifactMode, AGY_FAKE_ARTIFACT_COPY: cap.artifactCopy,
@@ -24,7 +24,9 @@ const makeSandbox = (stubBody) => {
24
24
 
25
25
  const runWrapper = (home, env, prompt = 'hello') =>
26
26
  spawnSync('bash', [WRAPPER, prompt], {
27
- env: { HOME: home, PATH: `${join(home, '.local', 'bin')}:${process.env.PATH}`, ...env },
27
+ // TMPDIR rides along so the wrapper's mktemp keeps working when the suite itself runs inside
28
+ // an OS sandbox whose /tmp is read-only (only $TMPDIR is writable there).
29
+ env: { HOME: home, PATH: `${join(home, '.local', 'bin')}:${process.env.PATH}`, TMPDIR: process.env.TMPDIR ?? '/tmp', ...env },
28
30
  encoding: 'utf8',
29
31
  timeout: 20000,
30
32
  });
@@ -73,7 +75,7 @@ const RECORDING_STUB = [
73
75
  // and optional stdin. AGY_MODEL='' drops --model so the stub argv stays clean.
74
76
  const runArgs = (home, { args, env = {}, input } = {}) =>
75
77
  spawnSync('bash', [WRAPPER, ...args], {
76
- env: { HOME: home, PATH: `${join(home, '.local', 'bin')}:${process.env.PATH}`, AGY_MODEL: '', ...env },
78
+ env: { HOME: home, PATH: `${join(home, '.local', 'bin')}:${process.env.PATH}`, TMPDIR: process.env.TMPDIR ?? '/tmp', AGY_MODEL: '', ...env },
77
79
  encoding: 'utf8',
78
80
  timeout: 20000,
79
81
  input,
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "antigravity-cli-bridge",
5
5
  "kind": "execution-backend",
6
- "version": "2.3.0",
6
+ "version": "2.4.0",
7
7
  "provides": ["review", "probe"],
8
8
  "roles": {
9
9
  "review": {
@@ -28,7 +28,7 @@
28
28
  "agy-review --continue [--decided @f] [--focus \"…\"]",
29
29
  "agy-review --conversation <id> [--decided @f] [--focus \"…\"]"
30
30
  ],
31
- "receipt": "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides; plan/diff outside a git tree: warn + skip unless overridden): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain) in code mode, the artifact-file sha256 in plan/diff mode; verdict recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK); grounded = whether a NON-EMPTY --facts payload was supplied (an empty payload records grounded:false — fail-closed, the state gate rejects it), factsHash = sha256 of the facts payload; a continuation receipt is fresh:false (informational-only — it cannot attest the folded tree); a write failure warns, never fails the review"
31
+ "receipt": "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides; plan/diff outside a git tree: warn + skip unless overridden): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain; never-committable untracked paths — character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked symlinks/directories ride as name-only notes) in code mode, the artifact-file sha256 in plan/diff mode; verdict recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK); grounded = whether a NON-EMPTY --facts payload was supplied (an empty payload records grounded:false — fail-closed, the state gate rejects it), factsHash = sha256 of the facts payload; a continuation receipt is fresh:false (informational-only — it cannot attest the folded tree); a write failure warns, never fails the review"
32
32
  }
33
33
  },
34
34
  "probe": { "cmd": "agy-run", "source": "bin/agy.sh", "output": "advisory" }
@@ -49,6 +49,7 @@
49
49
  "effect": "1 ⇒ an oversized code review offloads the change set to a private --add-dir staging dir (re-enables the Issue-001 stall risk; the hard timeout bounds it). Default 0: an oversized prompt refuses instead."
50
50
  }
51
51
  ],
52
+ "networkHosts": ["*.googleapis.com", "accounts.google.com", "antigravity-unleash.goog", "lh3.googleusercontent.com"],
52
53
  "detect": {
53
54
  "installed": {
54
55
  "env": "ANTIGRAVITY_CLI_BRIDGE_DIR",
@@ -2,7 +2,7 @@
2
2
  name: codex-cli-bridge
3
3
  description: Delegate work to the OpenAI Codex CLI (`codex`) under a ChatGPT subscription — run plan/instruction EXECUTION in a sandboxed workspace, or get a read-only ADVISORY review of a plan or working-tree diff — as a second delegated-execution backend beside Antigravity. Use when the user wants to hand a bounded coding task or plan to `codex exec`, get a second-opinion review from codex, install or authenticate Codex CLI, understand its sandbox/network/approval policy, drive codex efficiently from the main agent (exec vs review, resume, the commit boundary), bridge project context (`AGENTS.md`) into codex, or troubleshoot codex flags, models, auth, or its no-TTY headless behaviour.
4
4
  metadata:
5
- version: '2.3.0'
5
+ version: '2.4.0'
6
6
  ---
7
7
 
8
8
  # codex-cli-bridge
@@ -107,6 +107,9 @@ const run = ({ repo, bin }, { args = ['-'], input = 'do the thing', env = {}, pa
107
107
  env: {
108
108
  PATH: path || `${bin}:${process.env.PATH}`,
109
109
  HOME: repo,
110
+ // Keep the wrapper's mktemp working when the suite runs inside an OS sandbox whose /tmp is
111
+ // read-only (only $TMPDIR is writable there).
112
+ TMPDIR: process.env.TMPDIR ?? '/tmp',
110
113
  CODEX_FAKE_ARGV: argvFile,
111
114
  CODEX_FAKE_ENV: envFile,
112
115
  CODEX_FAKE_STDIN: stdinFile,
@@ -13,8 +13,9 @@
13
13
  #
14
14
  # For `code`, the wrapper PRECOMPUTES the full change set (repo map, git status,
15
15
  # staged + unstaged diffs, untracked file CONTENTS — binaries skipped, symlinks
16
- # shown as targets, other non-regular paths skipped) and feeds it in, so codex does
17
- # not burn a run rediscovering it by roaming the filesystem. A clean tree exits 0
16
+ # shown as targets, directories/vanished paths noted; never-committable untracked
17
+ # paths (devices/FIFOs/sockets) are excluded from the review domain entirely) and
18
+ # feeds it in, so codex does not burn a run rediscovering it. A clean tree exits 0
18
19
  # BEFORE a run is spent; an oversized payload goes via a git-dir-local temp file
19
20
  # (never silently truncated). Optionally (CODEX_REVIEW_SCHEMA=1) the findings come
20
21
  # back as a validated JSON object, with a raw-text fallback.
@@ -56,7 +57,9 @@ Receipt:
56
57
  side effect — a successful review appends one JSON receipt line to
57
58
  <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides): fingerprint =
58
59
  sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff +
59
- untracked-not-ignored contents — the review-payload domain) in code mode, the artifact-file
60
+ untracked-not-ignored contents — the review-payload domain; never-committable untracked paths
61
+ character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked
62
+ symlinks/directories ride as name-only notes) in code mode, the artifact-file
60
63
  sha256 in plan mode; verdict parsed from the mandated literal verdict line (schema mode: the
61
64
  verdict field); always fresh:true (one-shot) + grounded:true (native AGENTS.md auto-merge,
62
65
  factsHash null); a write failure warns, never fails the review
@@ -169,7 +172,7 @@ DEFAULT_CODEX_EFFORT="xhigh"
169
172
  # Review-receipt identity (AD-038). AW_BRIDGE_VERSION mirrors this bridge's SKILL.md/capability.json
170
173
  # version (drift-guarded by codex-review.test.mjs against capability.json).
171
174
  AW_RECEIPT_BACKEND="codex"
172
- AW_BRIDGE_VERSION="2.3.0"
175
+ AW_BRIDGE_VERSION="2.4.0"
173
176
  CODEX_MODEL="${CODEX_MODEL:-$DEFAULT_CODEX_MODEL}"
174
177
  CODEX_EFFORT="${CODEX_EFFORT:-$DEFAULT_CODEX_EFFORT}"
175
178
  # Generous hard cap for a slow xhigh review (subscription latency varies).
@@ -292,11 +295,76 @@ sha256_stdin() {
292
295
  fi
293
296
  }
294
297
 
298
+ # Never-committable untracked stat class (Decision 1, AD-044 Plan 4): character/block devices,
299
+ # FIFOs, sockets — git content can never carry them, so they are excluded from the ENTIRE review
300
+ # domain (fingerprint payload, assembled change set, status section, no-diff preflight). Symlinks
301
+ # (checked first, never followed) and directories (an embedded repo lists as `dir/` — a committable
302
+ # gitlink) STAY in the domain. The class surfaces where a sandbox injects device masks whose dirent
303
+ # LIES to git's walk; the stat here sees the truth.
304
+ is_never_committable_untracked() {
305
+ [[ ! -L "$1" && ( -p "$1" || -S "$1" || -c "$1" || -b "$1" ) ]]
306
+ }
307
+
308
+ # The ONE untracked-not-ignored walk every review-domain surface iterates (fingerprint payload,
309
+ # assembled change set, no-diff preflight): NUL-delimited paths with the never-committable classes
310
+ # filtered out.
311
+ emit_untracked_paths_z() {
312
+ local path
313
+ while IFS= read -r -d '' path; do
314
+ if is_never_committable_untracked "$path"; then continue; fi
315
+ printf '%s\0' "$path"
316
+ done < <(git ls-files --others --exclude-standard -z)
317
+ }
318
+
319
+ # True when at least one untracked-not-ignored path survives the never-committable filter — the
320
+ # no-diff preflight twin of the fingerprint walk (a tree whose ONLY untracked paths are
321
+ # device/FIFO/socket masks reads clean).
322
+ has_reviewable_untracked() {
323
+ [[ "$(emit_untracked_paths_z | wc -c)" -gt 0 ]]
324
+ }
325
+
326
+ # `git status --porcelain=v1` with never-committable untracked records dropped, so the assembled
327
+ # review payload is byte-identical with and without a device mask (the fingerprint==payload domain
328
+ # identity). Quote/space-safe: each filtered path's DISPLAYED line comes from git itself (never a
329
+ # re-implemented C-quoting), then exact whole-line removal — only untracked (??) records can match
330
+ # by construction. A mask nested in an otherwise-empty untracked directory leaves the collapsed
331
+ # `?? dir/` record (a directory is not in the filtered class); the real sandbox masks land beside
332
+ # tracked content, where status lists them individually.
333
+ emit_status_porcelain_filtered() {
334
+ local path line drop=""
335
+ while IFS= read -r -d '' path; do
336
+ if is_never_committable_untracked "$path"; then
337
+ line="$(git status --porcelain=v1 -- ":(literal)$path")"
338
+ if [[ -n "$line" ]]; then drop+="$line"$'\n'; fi
339
+ fi
340
+ done < <(git ls-files --others --exclude-standard -z)
341
+ if [[ -z "$drop" ]]; then
342
+ git status --porcelain=v1
343
+ else
344
+ git status --porcelain=v1 | grep -Fvxf <(printf '%s' "$drop") || true
345
+ fi
346
+ }
347
+
348
+ # ONE non-failing advisory when the walk observes never-committable untracked paths: they are
349
+ # ignored by the review domain BY CONSTRUCTION; the kit's sandbox-masks lane can hide them from
350
+ # `git status` too. Never an error, never a detector.
351
+ warn_never_committable_untracked() {
352
+ local path n=0
353
+ while IFS= read -r -d '' path; do
354
+ if is_never_committable_untracked "$path"; then n=$((n + 1)); fi
355
+ done < <(git ls-files --others --exclude-standard -z)
356
+ if (( n > 0 )); then
357
+ echo "notice: $n never-committable untracked path(s) (device/FIFO/socket) ignored by the review domain — for a clean 'git status' see the kit's sandbox-masks lane (/agent-workflow-kit sandbox-masks)." >&2
358
+ fi
359
+ }
360
+
295
361
  # The canonical uncommitted-state fingerprint payload (code mode). Domain == the review payload:
296
- # tracked staged + unstaged changes + untracked-not-ignored file contents (binary/symlink/non-regular
297
- # untracked paths ride as name-only notes, mirroring the assembled change set). The prose definition
298
- # lives in capability.json roles.review.contract.receipt (both bridges, lockstep); the kit checker
299
- # (tools/review-state.mjs) implements the SAME serialization in node — cross-checked by the kit's
362
+ # tracked staged + unstaged changes + untracked-not-ignored file contents (binary untracked files,
363
+ # symlinks, and directories/gitlinks ride as name-only notes, mirroring the assembled change set;
364
+ # never-committable untracked paths devices/FIFOs/sockets are EXCLUDED entirely, see
365
+ # emit_untracked_paths_z). The prose definition lives in capability.json
366
+ # roles.review.contract.receipt (both bridges, lockstep); the kit checker (tools/review-state.mjs)
367
+ # implements the SAME serialization in node — cross-checked by the kit's
300
368
  # review-fingerprint-parity.test.mjs.
301
369
  emit_fingerprint_payload() {
302
370
  git diff --cached --no-ext-diff
@@ -313,7 +381,7 @@ emit_fingerprint_payload() {
313
381
  printf 'untracked:%s\n' "$path"
314
382
  cat -- "$path"
315
383
  fi
316
- done < <(git ls-files --others --exclude-standard -z)
384
+ done < <(emit_untracked_paths_z)
317
385
  }
318
386
 
319
387
  # sha256 of the canonical payload, emitted from the work-tree ROOT (a subdir invocation hashes the
@@ -355,17 +423,18 @@ write_review_receipt() {
355
423
  fi
356
424
  }
357
425
 
358
- # Emit the full review surface to stdout: repo map, status, staged + unstaged
359
- # diffs, and the CONTENTS of every untracked REGULAR file (NUL-safe iteration).
360
- # Symlinks are shown as their target (never followedno out-of-repo leak); other
361
- # non-regular paths (FIFO/socket/device) are skipped (a `cat` on a FIFO would hang
362
- # BEFORE the codex hard timeout applies).
426
+ # Emit the full review surface to stdout: repo map, status (never-committable untracked records
427
+ # filtered), staged + unstaged diffs, and the CONTENTS of every untracked REGULAR file (NUL-safe
428
+ # iteration over the SAME filtered walk as the fingerprint the payload is byte-identical with
429
+ # and without a device mask). Symlinks are shown as their target (never followed no out-of-repo
430
+ # leak); directories/vanished paths are noted, never read (a `cat` on a FIFO would hang BEFORE the
431
+ # hard timeout applies — that class never reaches this loop).
363
432
  assemble_code_diff() {
364
433
  echo "=== repo file map (git ls-files) ==="
365
434
  git ls-files
366
435
  echo
367
436
  echo "=== git status (porcelain) ==="
368
- git status --porcelain=v1
437
+ emit_status_porcelain_filtered
369
438
  echo
370
439
  echo "=== staged diff (git diff --cached) ==="
371
440
  git diff --cached --no-ext-diff
@@ -387,7 +456,7 @@ assemble_code_diff() {
387
456
  cat -- "$path"
388
457
  printf '\n'
389
458
  fi
390
- done < <(git ls-files --others --exclude-standard -z)
459
+ done < <(emit_untracked_paths_z)
391
460
  }
392
461
 
393
462
  mode="${1:-}"
@@ -416,12 +485,14 @@ case "$mode" in
416
485
  prompt="${directive}"$'\n\nPLAN:\n'"$(cat -- "$target")"
417
486
  ;;
418
487
  code)
419
- # No-diff preflight — never spend a subscription run on a clean tree.
420
- if git diff --quiet && git diff --cached --quiet \
421
- && [[ -z "$(git ls-files --others --exclude-standard)" ]]; then
488
+ # No-diff preflight — never spend a subscription run on a clean tree. Never-committable
489
+ # untracked masks do not count: the FILTERED domain is the review surface.
490
+ if git diff --quiet && git diff --cached --quiet && ! has_reviewable_untracked; then
422
491
  echo "codex-review: no uncommitted changes to review — the working tree is clean." >&2
492
+ warn_never_committable_untracked
423
493
  exit 0
424
494
  fi
495
+ warn_never_committable_untracked
425
496
  # The canonical fingerprint of the tree codex is about to review — computed at assembly time
426
497
  # (BEFORE the EXIT trap can fire), so the receipt attests exactly the reviewed state.
427
498
  REVIEW_ARTIFACT="code"
@@ -106,6 +106,10 @@ const run = ({ repo, bin }, { args = ['code'], env = {}, path, cwd } = {}) => {
106
106
  env: {
107
107
  PATH: path || `${bin}:${process.env.PATH}`,
108
108
  HOME: repo,
109
+ // The wrapper's mktemp must keep working when the suite itself runs inside an OS sandbox
110
+ // whose /tmp is read-only (only $TMPDIR is writable there) — the built-from-scratch env
111
+ // would otherwise drop it and fail every spawn.
112
+ TMPDIR: process.env.TMPDIR ?? '/tmp',
109
113
  CODEX_HOME: codexHome,
110
114
  CODEX_FAKE_ARGV: argvFile,
111
115
  CODEX_FAKE_ENV: envFile,
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "codex-cli-bridge",
5
5
  "kind": "execution-backend",
6
- "version": "2.3.0",
6
+ "version": "2.4.0",
7
7
  "provides": ["execute", "review"],
8
8
  "roles": {
9
9
  "execute": {
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "grounding": "automatic — the wrapper precomputes the full working-tree change set (repo map, status, diffs, untracked contents) and codex auto-merges the root AGENTS.md; no grounding flags",
41
41
  "continue": [],
42
- "receipt": "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain) in code mode, the artifact-file sha256 in plan mode; verdict parsed from the mandated literal verdict line (schema mode: the verdict field); always fresh:true (one-shot) + grounded:true (native AGENTS.md auto-merge, factsHash null); a write failure warns, never fails the review"
42
+ "receipt": "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain; never-committable untracked paths — character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked symlinks/directories ride as name-only notes) in code mode, the artifact-file sha256 in plan mode; verdict parsed from the mandated literal verdict line (schema mode: the verdict field); always fresh:true (one-shot) + grounded:true (native AGENTS.md auto-merge, factsHash null); a write failure warns, never fails the review"
43
43
  }
44
44
  }
45
45
  },
@@ -71,6 +71,7 @@
71
71
  "effect": "codex-review code: above this assembled-payload size (bytes) the diff rides via a git-dir temp file instead of inline — never truncated."
72
72
  }
73
73
  ],
74
+ "networkHosts": ["chatgpt.com", "*.chatgpt.com"],
74
75
  "detect": {
75
76
  "installed": {
76
77
  "env": "CODEX_CLI_BRIDGE_DIR",