@sabaiway/agent-workflow-kit 22.1.0 → 23.0.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.
- package/CHANGELOG.md +43 -1
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/bridges/antigravity-cli-bridge/SKILL.md +1 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review.sh +2 -2
- package/bridges/antigravity-cli-bridge/capability.json +3 -4
- package/bridges/antigravity-cli-bridge/service-facts.txt +11 -0
- package/bridges/codex-cli-bridge/SKILL.md +1 -1
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +1 -1
- package/bridges/codex-cli-bridge/bin/codex-review.sh +1 -1
- package/bridges/codex-cli-bridge/capability.json +2 -3
- package/bridges/codex-cli-bridge/service-facts.txt +9 -0
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/modes/recommendations.md +3 -3
- package/references/modes/velocity.md +1 -1
- package/references/rules/communication.md +2 -1
- package/tools/bridge-sandbox-recipe.mjs +9 -6
- package/tools/bridge-state-dirs.mjs +2 -2
- package/tools/detect-backends.mjs +1 -1
- package/tools/manifest/schema.md +28 -47
- package/tools/manifest/validate.mjs +22 -60
- package/tools/procedures.mjs +1 -1
- package/tools/project-rules/rules-priors.mjs +1 -0
- package/tools/services/antigravity.json +17 -0
- package/tools/services/codex.json +15 -0
- package/tools/services/index.mjs +123 -0
- package/tools/services/jev.json +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,55 @@ 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
|
+
## 23.0.0 — the kit reads each bridge's hosts and state folders from a separate file for each service (AD-224)
|
|
8
|
+
|
|
9
|
+
**The network hosts and state folders the kit sets up for a bridge now come from a separate kit file for each service
|
|
10
|
+
the bridge uses: codex, antigravity and Jev.**
|
|
11
|
+
`tools/services/` holds `codex.json`, `antigravity.json` and `jev.json`; a bridge manifest names the services it uses
|
|
12
|
+
(`"services": ["codex", "jev"]`) instead of listing hosts and folders itself. The bridge tier, the danger check, the
|
|
13
|
+
autonomy preview and the Recommendations advisor read the hosts and folders from those files, so for the kit a host
|
|
14
|
+
change is one edit in one place; the bridge wrappers still have their own copies, held to the files by a drift
|
|
15
|
+
check, until a later release. What `/agent-workflow-kit velocity-profile --bridge-tier` writes into your project's
|
|
16
|
+
sandbox settings is byte for byte what it wrote before. Your next `/agent-workflow-kit upgrade` (or `init`)
|
|
17
|
+
refreshes the bridges you placed, with no question.
|
|
18
|
+
|
|
19
|
+
- **One reader, one door.** `tools/services/index.mjs` loads the files, merges the ones a manifest names in its order,
|
|
20
|
+
and renders each bridge folder's generated `service-facts.txt`. If one of these files cannot be read or is
|
|
21
|
+
malformed, the kit stops and says which file is broken and, for a wrong field, which field; it never works from
|
|
22
|
+
part of the set.
|
|
23
|
+
- **The validator.** A manifest naming `services` is judged against the fragments the kit ships; `networkHosts` or
|
|
24
|
+
`writableDirs` beside `services` is invalid. A manifest with no `services` key, the shape bridges shipped before this
|
|
25
|
+
release, stays valid, so a placed older bridge keeps working until the upgrade refreshes it.
|
|
26
|
+
- **Docs.** The manifest schema page gains a Services section; the README, `velocity.md`, `recommendations.md` and the
|
|
27
|
+
agy host-diff note name the hosts of the services a manifest names.
|
|
28
|
+
- **MAJOR:** `tools/manifest/validate.mjs` no longer exports `NETWORK_HOST_RE` and refuses the two retired fields
|
|
29
|
+
beside `services`.
|
|
30
|
+
|
|
31
|
+
## 22.2.0 — a question is answered, not acted on: one new bullet in your communication rules (AD-223)
|
|
32
|
+
|
|
33
|
+
**Your communication rules now say that a message which only asks changes nothing.** A message asking for information
|
|
34
|
+
or an opinion is answered, with a change proposed if one is needed; a request phrased as a question ("can you fix
|
|
35
|
+
it?") and work you already approved run as before. A change nobody asked for is a miss: the agent undoes it in the
|
|
36
|
+
same turn when it is its own and safely reversible, and otherwise says plainly what was changed, never handing it
|
|
37
|
+
back to you as a decision or a cleanup. Once `npx @sabaiway/agent-workflow-kit@latest init` has installed this kit,
|
|
38
|
+
your next `/agent-workflow-kit upgrade` brings the bullet with no question; `init` alone leaves your project's rules
|
|
39
|
+
files as they are.
|
|
40
|
+
|
|
41
|
+
- **Where it sits.** `references/rules/communication.md` gains the bullet right after `Lead with the result`; every
|
|
42
|
+
other bullet is unchanged and `Two blocks for the user` stays last.
|
|
43
|
+
- **A quiet refresh.** The body releases 20.0.0 to 22.1.0 shipped is now a known earlier body
|
|
44
|
+
(`tools/project-rules/rules-priors.mjs`), so the upgrade reports a `docs/ai/rules/communication.md` holding it as
|
|
45
|
+
refreshed from an earlier release, never as differing from every body the kit shipped. A file holding any other body is replaced by the template as before, with the line
|
|
46
|
+
naming `docs/ai/rules/local/communication.md` as the place for a rule of your own.
|
|
47
|
+
- Nothing is removed and no export changes (MINOR).
|
|
48
|
+
|
|
7
49
|
## 22.1.0 — the kit block loads your session-start files into Claude Code before its first word (AD-222)
|
|
8
50
|
|
|
9
51
|
**A Claude Code session started at your project root now holds your handover, your agent rules and every rules theme
|
|
10
52
|
in context from the start.** The kit block of `AGENTS.md` gains one `@` import line per session-start file
|
|
11
53
|
(`docs/ai/handover.md`, `docs/ai/agent_rules.md` and each `docs/ai/rules/effective/<theme>.md` the rules table lists)
|
|
12
54
|
and, under them, a fallback sentence telling an agent to read those files from disk when their content is not in its
|
|
13
|
-
context. Your next `/agent-workflow-kit upgrade`
|
|
55
|
+
context. Your next `/agent-workflow-kit upgrade` writes them with no question; a second run writes nothing.
|
|
14
56
|
|
|
15
57
|
- **Where they load.** A start at the project root loads every listed file with no dialog, whatever an earlier dialog
|
|
16
58
|
answered, and again after `/clear` and after compaction, read fresh from disk; a subagent that loads project
|
package/README.md
CHANGED
|
@@ -259,7 +259,7 @@ file), or run the guarded `/agent-workflow-kit uninstall`.
|
|
|
259
259
|
| `/agent-workflow-kit core-evidence` | any time | **the ONE loop-evidence writer** (strip-the-kit) — every core evidence record lands in a single append-only JSONL store inside the git dir (never committable; versioned schema, latest-per-key supersession, byte-identical duplicates refused, malformed lines fail every reader closed). `red-proof "<file>#<pattern>"` declares an observed-red **BEFORE a bugfix** (N/N red runs + content custody + base + the pre-fix fingerprint; green/mixed/timeout are DISTINGUISHED refusals — nothing written); `degrade --backend --reason` is the ONLY escape for an unavailable review backend (per-tree, never all backends); `summary` renders the whole loop state statelessly (gate result · per-backend verdicts · red-proofs · degrades) — no ledger, no rounds, nothing remembered. Honest residual: records are forgeable — self-discipline, not a security boundary. Never commits, never runs a subscription CLI. |
|
|
260
260
|
| `/agent-workflow-kit coverage-check` | any time | **the final-run checker** (D3(c)+(d)) — **certifies coverage ONLY inside the `--final` run that owns the lcov** (ownership is exclusive by CONVENTION over the fixed path, not enforced — a concurrent writer to it is a stated residual, queued as LCOV-EXCLUSIVE-OWNERSHIP): an artifact on disk proves nothing about the tree it came from, so a standalone run prints its findings and states `attested=no` / `NO VERDICT` rather than a PASS (an lcov that predates an edit would otherwise certify a line the suite never executed). `attested=` claims a verdict was ISSUED, pass or fail — a run over uncovered lines still reads `attested=yes` and still exits 1, and a run whose coverage arm never executed (no lcov) reads `attested=no` even inside `--final`, because nothing was read and nothing is certified. The runner passes a nonce whose one-way commitment over `{nonce, fingerprint, base}` is the `final-start.attempt` it recorded; a context describing another tree, or matching no recorded attempt, is a REFUSAL, never a verdict. Findings are unchanged — reads the lcov the declared `unit-tests` gate produced at the FIXED git-dir path and fails on any uncovered CHANGED executable Node line (listed `file:line`; a changed file absent from the map is a file-level red; out-of-domain/unsupported files are LISTED — the claim narrowed honestly); VERIFIES every current-base red-proof declaration (bound test exists · custody hash unchanged · green N/N now · pre-fix fingerprint differs); prints `lcov-sha256=<hex|none>` of the exact bytes it consumed — the sha the `--final` receipt binds and re-hashes. An absent lcov is a LOUD `skipped-no-lcov`; a symlinked path is a refusal. `--check` is the gate exit code — declare it as the LAST gate (`run-gates --final` refuses otherwise). Read-only. |
|
|
261
261
|
| `/agent-workflow-kit commit-guard` | any time | **the read-only pre-commit guard** (D10) — makes the commit capture the whole current working tree, so «verified» and «about to be committed» are the same bytes (the receipt itself has a stated residual — see the mode doc). FIRST it refuses an **INDEX that lags the verified working tree** (the gates and the fingerprint describe the WORKING tree while `git commit` takes the INDEX alone, and the fingerprint cannot tell them apart — so a lagging index used to ship a strict subset of what was verified): unstaged tracked paths or reviewable untracked-not-ignored paths, named up to a bounded cap with the remainder stated, a dirty tracked **submodule** named separately with its own recovery, and fail-closed on an undecidable probe. This deliberately blocks a partial commit. Then it binds the LATEST completed `run-gates --final` receipt to the EXACT current tree: refuses on a missing/red/stale receipt, fingerprint drift under the run, a dangling later attempt, declaration content drift, evidence-hash or lcov drift, or unsatisfied review obligations (the same review-state decision, recomputed over a sanitized env — forged out-of-repo stores never satisfy). Re-runs NO gate or test. Wire it into `.git/hooks/pre-commit` (the installer writes the RESOLVED invocation). `git commit --no-verify` stays the stated residual. |
|
|
262
|
-
| `/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, a feature-spec layer never adopted) and renders **verdict-first**: one composed verdict line (does anything need attention?), then each item as **{severity · what · one-line benefit · an optional `recipe:` line (the bridge-tier item's missing-entries line — each missing entry by kind: allow rules, exclusions, hosts, state dirs, then what the execution wrapper codex-exec needs, then the host condition; the worktrees-dir ack fallback for a host that ignores the settings key, the agents hidden-mode reconcile follow-up, a user item's own facts, the spec-adoption decline preview, or another offer's decline preview) · the exact consent-gated apply one-liner}**; `references/advisor-writers.md` names each variant's writer or user step. The agent PRESENTS the section in the user's conversational language — every fact and count, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; raw tool block on request — and runs EXACTLY the rendered one-liners and the follow-up commands required by the mode doc, only on the answer authorizing that step — your yes to apply or your explicit decline to record it — with a second yes where the mode doc requires it, surfacing each item's posture note first; a kit item it applies with no question, its check line first, the harness's own dialog the only ask, or the one plain step where auto mode refuses its check or apply. Renders **present-even-when-empty** (`no recommendations — flow optimal.`); a failed probe degrades to a stated skip line. Registry strings are fact-true frozen one-line data (posture/risk notes live in the mode doc at the consent moment); `velocity --bridge-tier` seeds the used bridges' review allow rules, `<wrapper> *` exclusions (`codex-exec *` where an execute slot delegates, keeping its permission prompt), declared hosts into `sandbox.network.allowedDomains`, and home-relative state dirs into `sandbox.filesystem.allowWrite`; hosts and dirs
|
|
262
|
+
| `/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, a feature-spec layer never adopted) and renders **verdict-first**: one composed verdict line (does anything need attention?), then each item as **{severity · what · one-line benefit · an optional `recipe:` line (the bridge-tier item's missing-entries line — each missing entry by kind: allow rules, exclusions, hosts, state dirs, then what the execution wrapper codex-exec needs, then the host condition; the worktrees-dir ack fallback for a host that ignores the settings key, the agents hidden-mode reconcile follow-up, a user item's own facts, the spec-adoption decline preview, or another offer's decline preview) · the exact consent-gated apply one-liner}**; `references/advisor-writers.md` names each variant's writer or user step. The agent PRESENTS the section in the user's conversational language — every fact and count, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; raw tool block on request — and runs EXACTLY the rendered one-liners and the follow-up commands required by the mode doc, only on the answer authorizing that step — your yes to apply or your explicit decline to record it — with a second yes where the mode doc requires it, surfacing each item's posture note first; a kit item it applies with no question, its check line first, the harness's own dialog the only ask, or the one plain step where auto mode refuses its check or apply. Renders **present-even-when-empty** (`no recommendations — flow optimal.`); a failed probe degrades to a stated skip line. Registry strings are fact-true frozen one-line data (posture/risk notes live in the mode doc at the consent moment); `velocity --bridge-tier` seeds the used bridges' review allow rules, `<wrapper> *` exclusions (`codex-exec *` where an execute slot delegates, keeping its permission prompt), declared hosts into `sandbox.network.allowedDomains`, and home-relative state dirs into `sandbox.filesystem.allowWrite`; hosts and dirs come from the kit service fragments (`agent-workflow-kit/tools/services/`) each bridge's `capability.json` names in `services`, and the advisor's `bridge-tier` item counts and names each missing one. `--cwd` is required (the target project is explicit); writes nothing, never commits, never runs a subscription CLI. |
|
|
263
263
|
| `/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 the gate exit code a kit maintainer runs: the lint checks the kit's own package. Never writes, never commits, never runs a subscription CLI. |
|
|
264
264
|
| `/agent-workflow-kit dispatch` | any time | **the delegation engine** — makes "how much does delegating a sub-task actually buy?" a measured number instead of a feeling. `check <file>` validates a sub-task brief's contract block and exits 0/1 naming the first violated field — **form only**: whether the task is genuinely bounded, its design decided and its acceptance adequate stays your judgment, and a well-formed absurdity passes here by construction. `advise --step-class <c>` answers the question that comes BEFORE that one — which vehicle should carry this kind of sub-task, whether it is even present on this machine, and what the ledger has already recorded for threads of that class (finished, failed, closed without a fold, and still open — counted separately) — and it decides nothing: it refuses no dispatch, gates no verb, and a choice that diverges from the advice is noted rather than blocked. It reads the filesystem only: nothing is launched to find out what is installed, an absent ledger prints "no recorded history", an unreadable one prints the store's own words, and either way the advice still prints. The same block appears as a footer under a form-valid `check` — never under a refusal, so it can never hide one. `register` pre-registers an acceptance wave (step classes, pairing key, minimum observations per class, the mean and first-pass thresholds) so the bar can never be chosen after the results it judges — immutable per wave. `observe` records ONE hand-written observation (`solo-construction`, the baseline whose ratio is 1 by construction — except over a scope measuring zero bytes, which has no ratio at all and is recorded ineligible by name — or `self-reported`) — delegated numbers are never hand-written, they are derived. The writer verbs are where that derivation happens: `open` puts a delegated thread on the record with every mint-time field copied from the brief's own header, refusing a deadline the wrapper's cap plus its kill grace would not fit inside, and recording whether the tree it started from was clean against the thread's base — HEAD by default, or the tree `--checkpoint <oid>` names, so the second task of a story is measured over the first one's uncommitted work instead of opening dirty (a dirty one makes the result honestly unmeasurable rather than quietly counted), while `--task <brief>` also records which task brief the thread carries out and the files that brief lists, refusing, since the last commit, a task thread whose files overlap by path prefix those of an open task thread or of a folded thread of another brief (`files-overlap`), and a mix of the two kinds — an untasked open beside an open task thread or, for a `code` open of backend `codex`, after a task fold, and a task open beside an open untasked thread (`mixed-open`), refusing at open a Files path the snapshot scope can never hold (`task-files-scope`), and measuring a task thread over its files alone, so `return` and `fold` refuse a changed path that no open or folded task thread on the same base claims (`out-of-files`); `await` waits for that one dispatch to answer and writes nothing — only the finished receipt satisfies it, a run still holding the nonce means keep waiting, and a wait that runs out says so with its own exit code, names whether the deadline or your own timeout ended it, and authorizes nothing: a wait that ended without an answer is a question for you, never permission to dispatch again; `return` absorbs the receipt the wrapper minted — only a finished one, checked against the contract it actually ran, its deadline and its own report, and refused outright when the tree hides changes from git or moves while the return is being computed — and derives the bytes from git rather than from anyone's claim; `fold` is the acceptance, and it refuses if the tree moved since the return — precisely, it re-confirms **equality of the visible canonical payload**, which is a change detector rather than a cryptographic identity of the tree: under the default head base that payload's untracked section is unframed and carries no file mode, so a content or symlink target that imitates the marker opening the next entry can alias two trees, and making an untracked file executable moves nothing (both named as residuals in the mode doc, with the fix queued); under a checkpoint base it is one indexed diff that carries modes. A change set carrying a binary, a non-regular path, a submodule, or a symlink whose target is not valid UTF-8 is **refused** at `return` and `fold` — CONSERVATIVELY, rather than promise what the default head payload may not be able to follow — and the same refusals hold for a checkpoint thread. `degrade` closes a thread that never earned a fold, on the record and with its reason. `aggregate` prints one wave: the registered thresholds, every observation as context, and per step class the finished threads — a folded success with git-provable bytes contributes its ratio, one whose bytes are unprovable is excluded from the mean but still counts in the first-pass rate, and a failed thread, a degrade-closed one, or one folded after failing acceptance each count as a real zero. Below the registered minimum nothing is computed (insufficient); at or above it is computed and labeled PILOT evidence. It REFUSES rather than guessing: no pre-registration, an unfinished thread in scope, a recorded refusal-to-delegate that never opened a thread, or an ambiguous wave each stop the computation by name. `handoff-return --slug <s>` closes the worktree loop after `land --prepare`: it re-attests that main still holds exactly the prepared tree under the same HEAD (both recorded in the handoff at prepare time), prints the satellite handoff's user-owned content byte for byte with its boundaries, byte lengths and the main-owned destinations each part folds into, prints the handoff digest and both OIDs as its proof, states the after-the-fold order (a fold landed after the gates leaves them stale), and records ONE self-reported worktree-stream observation only when the whole prepared change set is measurable — a deletion, a rename, a symlink, a submodule or a mode-only change ends with a named NOT RECORDED instead, never a partial number. Appends only to its own ledger inside the git dir (never committable); it also writes `handoff-return`'s `write-tree` tree object and, for a checkpoint measurement, the leaf's OWN temporary index file and the blobs its forced adds store — never a ref, never the real index; never commits, never runs a subscription CLI. |
|
|
265
265
|
| `/agent-workflow-kit worktrees` | any time | **parallel feature worktrees** — run several features in DIFFERENT agent sessions on one repo, zero interference on working-tree files (the ONE exception is the dependency cache, below): `provision <slug> --plan <file>` creates a sibling git worktree on branch `aw/<slug>` and populates it (registry-derived footprint copy-if-missing — a tracked file is never overwritten; EXACTLY ONE seeded feature plan; the `handoff-<slug>.md` record from minute zero; `node_modules` symlinked where the link stays ignored — a shared MUTABLE dependency cache: writes through it hit MAIN's node_modules; for isolation run the printed isolated-install command (`--install` only PRINTS it; on `--resume` run the printed unlink-first recovery first — printed only for a link whose RAW TARGET is MAIN's `node_modules`, since a foreign or unreadable link is reported as such with no removal advised); absolute root-pinned gate commands rebased on untracked copies only, and only while their bytes equal the MAIN source or its rebased form — user-modified copies stay untouched); `list` is read-only (slug, branch, base, dirty, handoff); `prompt <slug>` is read-only too and re-prints the satellite's cold-start prompt — the same text `provision` ends its report with: where the worktree is, its ONE seeded plan, the handoff as the one channel back, MAIN's orientation (shared series index, landing) and, under its own heading because it is probed on the satellite, that checkout's install posture — every value derived LIVE rather than replayed from the frozen provision record, a recorded value that no longer matches NAMED as a divergence (with the cause its source makes likely) instead of printed as the runnable one, every offered command marked with WHO runs it (`MAIN $ …` for the landing, `HERE $ …` for this checkout's own install, a posture with nothing to run staying prose), and a control character in any rendered value a typed STOP rather than a forged prompt line; `land <slug> --prepare` locks the common git dir, fail-closes on divergence or incomplete satellite state, transfers the complete accepted satellite diff onto a CLEAN main, runs sync plus the declared gates, and reports HEAD/TRANSFER/PREPARED OIDs — the commit ALWAYS stays a dialogue ask; `cleanup <slug>` takes the same lock and removes a LANDED worktree only after live landed-verification against main HEAD, while `--abandon` is the ONE destructive arm (destroys unlanded work; **no preview step** on any writer). The parent dir is the `docs/ai/worktrees.json` `parentDir` setting (default: the repo's sibling parent); an unwritable parent prints the `worktrees-dir` check line: the agent applies the grant on your chat yes after the check, one entry in this copy's `.claude/settings.local.json`, never the committed project settings (`init` is the route you may take instead, and the ack is the fallback for a host that ignores the key), else the printed terminal command runs it. Never commits, never pushes, never runs a subscription CLI. |
|
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". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '
|
|
6
|
+
version: '23.0.0'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# agent-workflow-kit
|
|
@@ -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 headless behaviour.
|
|
4
4
|
metadata:
|
|
5
|
-
version: '7.
|
|
5
|
+
version: '7.1.0'
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# antigravity-cli-bridge
|
|
@@ -94,7 +94,7 @@ Notes:
|
|
|
94
94
|
capability probe, not a version floor: agy --help must advertise --output-format and
|
|
95
95
|
--disable-slash-commands, node must be >= 22, and bin/agy-envelope.mjs must be present — otherwise
|
|
96
96
|
the review refuses before any run is spent and names the missing capability
|
|
97
|
-
pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff its
|
|
97
|
+
pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff the hosts of the services its manifest names
|
|
98
98
|
against the live sandbox allow-list — a missing host is surfaced to the maintainer BEFORE
|
|
99
99
|
dispatching, never fired into a known prompt
|
|
100
100
|
the review posture banner appends a banner-only source=model:<s> field — where the model came
|
|
@@ -389,7 +389,7 @@ aw_scrub_billing_keys() {
|
|
|
389
389
|
# Review-receipt identity (AD-038). AW_BRIDGE_VERSION mirrors this bridge's SKILL.md/capability.json
|
|
390
390
|
# version (drift-guarded by agy-review.test.mjs against capability.json).
|
|
391
391
|
AW_RECEIPT_BACKEND="agy"
|
|
392
|
-
AW_BRIDGE_VERSION="7.
|
|
392
|
+
AW_BRIDGE_VERSION="7.1.0" # aw-version-anchor
|
|
393
393
|
# D5 control-byte screen — IMMEDIATELY after resolution, BEFORE any interpolation can echo raw
|
|
394
394
|
# newline/ESC bytes into stderr/the terminal (round-2 fold).
|
|
395
395
|
if [[ "$AGY_MODEL" == *[$'\x01'-$'\x1f'$'\x7f']* ]]; then
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"name": "antigravity-cli-bridge",
|
|
5
5
|
"kind": "execution-backend",
|
|
6
|
-
"version": "7.
|
|
6
|
+
"version": "7.1.0",
|
|
7
7
|
"provides": ["review", "probe"],
|
|
8
8
|
"posture": { "model": "Gemini 3.8 Flash (High)" },
|
|
9
9
|
"roles": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"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; durationS = integer wall-clock seconds from CLI start through verdict parsing and the wrapper prints review duration: <n>s; blocking = the count of numbered items in the first ### Blocking section; artifactPath = the normalized realpath on plan/diff receipts only (repo-relative inside the work tree, absolute otherwise), while a double quote, backslash or control byte refuses pre-spend because the receipt encoder cannot carry it; verdict recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK); grounded = whether a NON-EMPTY --facts payload was supplied (code mode refuses pre-spend without one — no run, no receipt — unless --ungrounded/AGY_PROBE=1; in plan/diff 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); probe = whether the run relaxed the quality guards (AGY_PROBE=1), written on EVERY receipt so it self-declares — the kit's review-state gate rejects a probe-marked receipt (a probe review never attests) and equally rejects an unmarked one (silence is not a declaration); posture = the ACTUAL run posture {model} (agy has no tier), written on EVERY receipt (D5) — the gate rejects a receipt with an absent/invalid posture (a pre-D5 wrapper minted it; re-run the review), one stderr banner line states the same posture, a one-off model (an explicitly empty AGY_MODEL included) refuses pre-spend unless AGY_PROBE=1, and a model string carrying control bytes refuses pre-spend in every mode; delivery = how the change set REACHED the model, currently emitted as 'inline' (the whole set rode one prompt — proven by construction) or 'fed' (a chunked feed whose per-part echo proof verified); REQUIRED on every agy code receipt and its ABSENCE is what stops a pre-fed-lane receipt attesting, while the gate accepts any well-formed declaration rather than a particular value; absent by construction on plan/diff/continuation receipts, which carry no change set; a run whose output carries NO recognized '### Verdict' section — empty output included — exits 4 with NO receipt (D4: a FAILED review to RE-RUN, never a fatal session error); when the dispatch nonce seam is supplied — the AW_REVIEW_NONCE environment value or its plain-argument equivalent --nonce <n> (one seam: the flag assigns the same value; supplying both with different values refuses pre-spend) — under the safe grammar [A-Za-z0-9._-]{1,64} (anything else refuses pre-spend), the wrapper first mints the finding MANIFEST {schema, backend, nonce, fingerprint, findings} beside the receipts file (agent-workflow-finding-manifest-<backend>-<nonce>.json; atomic, no-clobber — a byte-identical rewrite is an idempotent no-op, different bytes refuse loudly) ORDERED before the receipt append — a failed manifest write EXCLUDES the receipt append, so a nonce-supplied dispatch can never land a receipt without its readable manifest; a nonce-less invocation adds NO nonce field and mints NO finding manifest (the existing wrapperVersion field still changes with each bridge release); a write failure warns, never fails the review",
|
|
35
35
|
"notes": [
|
|
36
36
|
"transport: every review dispatch drives the CLI in --output-format json (plus --disable-slash-commands) and the returned envelope is parsed in node (bin/agy-envelope.mjs) — the operator-facing invocations and flags above do NOT change, and on a ZERO exit the wrapper still PRINTS the review text, never JSON. A missing or unreadable envelope on a zero exit is a loud failure with NO receipt, never a downgraded verdict and never a fallback to raw-stdout parsing; a non-zero CLI exit keeps its own code and message, and publishes the captured stdout unchanged from the SINGLE dispatch or the FINAL fed turn (which may therefore be a JSON or partial payload — the envelope is parsed only on a zero exit); an INTERMEDIATE feed turn is the exception, its output stays private (Invariant E) and its failure prints only a named error. Enforced by a PRE-SPEND capability probe, not a version floor: agy --help must advertise --output-format and --disable-slash-commands, node must be >= 22, and bin/agy-envelope.mjs must be present — otherwise the review refuses before any run is spent and names the missing capability",
|
|
37
|
-
"pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff its
|
|
37
|
+
"pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff the hosts of the services its manifest names against the live sandbox allow-list — a missing host is surfaced to the maintainer BEFORE dispatching, never fired into a known prompt",
|
|
38
38
|
"the review posture banner appends a banner-only source=model:<s> field — where the model came from: default, setting or environment — then a banner-only timeout=<duration> field — exactly the duration agy-run hands to timeout(1); the hard-timeout preflight fails CLOSED when no timeout/gtimeout binary exists (the wrapper refuses by name before any CLI run, so an uncapped review run can no longer happen), and neither field enters the receipt posture or the D5 banner↔receipt parity",
|
|
39
39
|
"quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts"
|
|
40
40
|
]
|
|
@@ -240,8 +240,7 @@
|
|
|
240
240
|
"effect": "agy-review code: the ceiling on the SUM of all outgoing prompt bytes the chunked feed may send (every feed-turn framing block, every body, the final turn). Checked BEFORE the first turn is spent; past it the fed review refuses. An economy guard, not the correctness guard — correctness is the per-part delivery echo."
|
|
241
241
|
}
|
|
242
242
|
],
|
|
243
|
-
"
|
|
244
|
-
"writableDirs": [{ "env": null, "default": "~/.gemini/antigravity-cli" }],
|
|
243
|
+
"services": ["antigravity", "jev"],
|
|
245
244
|
"detect": {
|
|
246
245
|
"installed": {
|
|
247
246
|
"env": "ANTIGRAVITY_CLI_BRIDGE_DIR",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# generated from the kit's service fragments (agent-workflow-kit/tools/services/); do not edit
|
|
2
|
+
HOST=*.googleapis.com
|
|
3
|
+
HOST=accounts.google.com
|
|
4
|
+
HOST=antigravity-unleash.goog
|
|
5
|
+
HOST=lh3.googleusercontent.com
|
|
6
|
+
HOST=api.typesafe.ai
|
|
7
|
+
HOST=docs.typesafe.ai
|
|
8
|
+
RUN_HOST=api.typesafe.ai
|
|
9
|
+
RUN_HOST=docs.typesafe.ai
|
|
10
|
+
WRITABLE_DIR=:~/.gemini/antigravity-cli
|
|
11
|
+
PASSED_VARIABLE=TYPESAFE_API_KEY
|
|
@@ -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: '5.0
|
|
5
|
+
version: '5.1.0'
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# codex-cli-bridge
|
|
@@ -430,7 +430,7 @@ CHATGPT_LOGIN_GUARD="Logged in using ChatGPT"
|
|
|
430
430
|
# receipt this wrapper mints; scripts/release/version-sync.mjs bumps it under the one-anchor-per-file
|
|
431
431
|
# rule, so a release can never leave it behind (the AD-053 drift class).
|
|
432
432
|
AW_RECEIPT_BACKEND="codex"
|
|
433
|
-
AW_BRIDGE_VERSION="5.0
|
|
433
|
+
AW_BRIDGE_VERSION="5.1.0" # aw-version-anchor
|
|
434
434
|
# The kill grace handed to timeout(1) as --kill-after, and recorded in the receipt as killGraceS:
|
|
435
435
|
# ONE constant, so the number the ledger checks against the dispatch deadline is the number the run
|
|
436
436
|
# actually applied.
|
|
@@ -342,7 +342,7 @@ aw_scrub_billing_keys() {
|
|
|
342
342
|
# Review-receipt identity (AD-038). AW_BRIDGE_VERSION mirrors this bridge's SKILL.md/capability.json
|
|
343
343
|
# version (drift-guarded by codex-review.test.mjs against capability.json).
|
|
344
344
|
AW_RECEIPT_BACKEND="codex"
|
|
345
|
-
AW_BRIDGE_VERSION="5.0
|
|
345
|
+
AW_BRIDGE_VERSION="5.1.0" # aw-version-anchor
|
|
346
346
|
# Generous hard cap for a slow review at the host posture's effort (subscription latency varies).
|
|
347
347
|
CODEX_HARD_TIMEOUT="${CODEX_HARD_TIMEOUT:-1800}"
|
|
348
348
|
# Above this assembled-payload size (bytes), the diff goes via a git-dir-local temp
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"name": "codex-cli-bridge",
|
|
5
5
|
"kind": "execution-backend",
|
|
6
|
-
"version": "5.0
|
|
6
|
+
"version": "5.1.0",
|
|
7
7
|
"posture": { "model": "gpt-6.1-sol", "effort": "high", "tier": null },
|
|
8
8
|
"provides": ["execute", "review"],
|
|
9
9
|
"roles": {
|
|
@@ -228,8 +228,7 @@
|
|
|
228
228
|
"effect": "codex-review code: above this assembled-payload size (bytes) the diff rides via a git-dir temp file instead of inline — never truncated."
|
|
229
229
|
}
|
|
230
230
|
],
|
|
231
|
-
"
|
|
232
|
-
"writableDirs": [{ "env": "CODEX_HOME", "default": "~/.codex" }],
|
|
231
|
+
"services": ["codex", "jev"],
|
|
233
232
|
"detect": {
|
|
234
233
|
"installed": {
|
|
235
234
|
"env": "CODEX_CLI_BRIDGE_DIR",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# generated from the kit's service fragments (agent-workflow-kit/tools/services/); do not edit
|
|
2
|
+
HOST=chatgpt.com
|
|
3
|
+
HOST=*.chatgpt.com
|
|
4
|
+
HOST=api.typesafe.ai
|
|
5
|
+
HOST=docs.typesafe.ai
|
|
6
|
+
RUN_HOST=api.typesafe.ai
|
|
7
|
+
RUN_HOST=docs.typesafe.ai
|
|
8
|
+
WRITABLE_DIR=CODEX_HOME:~/.codex
|
|
9
|
+
PASSED_VARIABLE=TYPESAFE_API_KEY
|
package/capability.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sabaiway/agent-workflow-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "Portable, cross-agent memory & workflow for AI coding agents — Claude Code, Codex, Cursor, Devin Desktop. One command deploys an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement into any repo.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -30,7 +30,7 @@ The **consent route** for a harness item: run its `check:` line in the sandbox a
|
|
|
30
30
|
|
|
31
31
|
A variant's posture note, where its key has one, is printed by `init` from this installed mode doc (the one source); a variant without a note shows its preview, and a harness variant also the check's lines.
|
|
32
32
|
|
|
33
|
-
- `bridge-tier` — the lane is harness and env-dependent: the agent applies the item on the chat yes after the check, writing the project `.claude/settings.json`; `init` previews `velocity-profile --bridge-tier` and applies it on the terminal y as the route the user may take instead. It wires the USED bridges from the project's effective recipes and host readiness: each used review wrapper's `code`-mode allow rule (a wrapper then runs UNATTENDED: it reads any repo file it is pointed at and sends the assembled payload to its subscription backend), the quoted grounding pre-step rule when `agy-review` is used, `codex-review *` / `agy-review *` in `sandbox.excludedCommands`, and `codex-exec *` where an execute slot delegates (no execution allow rule: it keeps its prompt). It also seeds the used bridges'
|
|
33
|
+
- `bridge-tier` — the lane is harness and env-dependent: the agent applies the item on the chat yes after the check, writing the project `.claude/settings.json`; `init` previews `velocity-profile --bridge-tier` and applies it on the terminal y as the route the user may take instead. It wires the USED bridges from the project's effective recipes and host readiness: each used review wrapper's `code`-mode allow rule (a wrapper then runs UNATTENDED: it reads any repo file it is pointed at and sends the assembled payload to its subscription backend), the quoted grounding pre-step rule when `agy-review` is used, `codex-review *` / `agy-review *` in `sandbox.excludedCommands`, and `codex-exec *` where an execute slot delegates (no execution allow rule: it keeps its prompt). It also seeds the used bridges' hosts in `sandbox.network.allowedDomains` and resolved state dirs, home-relative where under home, in `sandbox.filesystem.allowWrite`; both come from the kit service fragments (`agent-workflow-kit/tools/services/`) their manifests name in `services`. Where the host honours the settings sandbox keys, an excluded wrapper runs outside the sandbox, every sandboxed command of the project can reach the seeded hosts, and every sandboxed command can write the seeded state dirs. The item fires while an allow rule, a `*` exclusion, a host or a state dir of a used bridge is missing. Its `recipe:` line names each missing entry by kind (allow rules, exclusions, hosts, state dirs), then what the execution wrapper `codex-exec` needs where an execute slot delegates, then, when the project settings enable the sandbox, "once added, wired where the host honors the settings sandbox keys", or "host condition unchecked" with the reason.
|
|
34
34
|
|
|
35
35
|
- `read-lane` — enabling the opt-in read-only compound lane auto-approves *compounds* (and singles) of the seeded read-only core that carry ZERO shell metaprogramming: an UNATTENDED trust extension, bounded by the audited read-only core (never a command outside it; prompt-bypass only, never a sandbox bypass) and applied regardless of which of those core commands you seeded as individual settings rules. It is a PROJECT-PERSISTENT declaration in `docs/ai/lanes.json` — every future session, subagents' Bash too where the host fires hooks on subagent Bash, and (committed) every checkout. The item renders while the hook is wired and the lane is off, whatever the placed hook's bytes; its apply is the `gate-hook --read-lane` preview, whose own currency check refuses a stale hook (a pre-1.48 hook never reads `lanes.json`). A stale or absent hook under it is a planned file of the kit item `gate-hook.not-current`, applied before the offers. The agent applies the enable offer on the chat yes, and the kit item with no question after the check; `init` applies that kit item on its one y as the route the user may take instead. Risk profile: a bounded read-only trust-posture extension — no write/exec exposure beyond the audited core.
|
|
36
36
|
- `worktrees-dir` — the agent applies the item on the chat yes after the check: one `sandbox.filesystem.allowWrite` entry naming the worktrees parent itself, written to this copy's `.claude/settings.local.json` only, never the committed project settings, the parent created when missing. `init` applies it on the batch terminal yes as the route the user may take instead. Where the host honors the key, the entry widens the OS-sandbox WRITE surface to the whole parent dir: every sibling path under it (other repositories included) becomes agent-writable, for every later session and every worktree provisioned afterwards. Narrow it BEFORE the first apply: point `docs/ai/worktrees.json` `parentDir` at a dedicated dir — no apply removes an entry, so an earlier one stays until the user deletes it. A parent that is the home or holds it renders `worktrees-dir.home` instead, the user's own step. **Convergence** is two-path: a declared `sandbox.filesystem.allowWrite` entry covering the probed dir (either settings scope — `~` and `~/…` resolve against home, and coverage is path-segment-aware, so a grant on a sibling or on a child never counts), or the dir-bound acknowledgement `worktreesDirAck` in the family-owned `docs/ai/acks.json`, recorded by the `ack-write --lane worktrees-dir` line the `recipe:` line carries — the ack fallback for a host that ignores the key, run only on the user's word, instead of the grant; against a trusted host NO no ack renders. Neither is proof of write CAPABILITY: the provision preflight's real create+delete probe stays the runtime truth, and the ack is bound to the **resolved probe dir**, so the item re-fires only when that resolved dir changes. Risk profile: a real write-surface widening where honored — scope it deliberately.
|
|
@@ -57,8 +57,8 @@ Only Claude Code on Linux/WSL2 is measured; Codex, Devin and agy as hosts and ma
|
|
|
57
57
|
A first session may meet ordinary prompts until the autonomy render lands; a chat apply is promptless only where the host auto-allows sandboxed commands.
|
|
58
58
|
|
|
59
59
|
- **Settings-native sandbox** (the harness reads the `.claude/settings.json` sandbox keys): where the harness honours the `--bridge-tier` wiring's `excludedCommands` entries (`codex-review *` / `agy-review *`, and `codex-exec *` where an execute slot delegates, keeping its prompt), the used bridges' wrappers run OUTSIDE the sandbox and never consult `allowedDomains`/`allowWrite` — nothing beyond the tier. A bare name matches only the argument-free command: observed 2026-10-06, Claude Code 2.1.291 ran an agent's plain `codex-review` inside its sandbox beside the bare entry; a harness may keep a `*`-excluded wrapper sandboxed too (unmeasured). There a recipe host outside `allowedDomains` is refused by the harness proxy or held for a network prompt (a refusal reads `Tunnel connection failed: 403` or `CONNECT tunnel failed, response 403` in the run). The lane for the hosts AND the state dirs is the `--bridge-tier` re-run: it seeds the used bridges' declared hosts into `sandbox.network.allowedDomains` and resolved state dirs into `sandbox.filesystem.allowWrite`, and the `bridge-tier` item offers it while any used-bridge surface is missing. Where the host honours the settings sandbox keys, every sandboxed command of the project can reach those hosts and every sandboxed command can write those state dirs.
|
|
60
|
-
- **Harness-managed sandbox** (an IDE/session-imposed sandbox that ignores the settings keys) — a NARROWEST-SCOPE ladder: (1) prefer wrapper/command-SCOPED sandbox rules where the harness offers them (only the review wrappers gain the egress + state-dir writes); (2) a SESSION-scoped allowance (the
|
|
61
|
-
- Either way the recipe is **observed-minimal, honestly incomplete** — a blocked host names itself at run time; the
|
|
60
|
+
- **Harness-managed sandbox** (an IDE/session-imposed sandbox that ignores the settings keys) — a NARROWEST-SCOPE ladder: (1) prefer wrapper/command-SCOPED sandbox rules where the harness offers them (only the review wrappers gain the egress + state-dir writes); (2) a SESSION-scoped allowance (the hosts of the services the manifests name + the resolved state dirs for the whole session) is an INFORMED WIDENING — it carries the same blast-radius class the `--bridge-tier` keys carry where a host honours them (every sandboxed command in the session gains that egress and write access to those state dirs), acceptable only as the maintainer's deliberate choice for a review-heavy session. (3) Else the per-run consented bypass. The kit writes no shape for this sandbox — the harness's own controls (its scoped rules, a session allowance, its consent at the point of action) govern there; an IDE-managed session sandbox was live-observed (2026-07-11/12) ignoring the settings security keys in BOTH scopes, and whether a session's sandbox honours them is not knowable from the advisor.
|
|
61
|
+
- Either way the recipe is **observed-minimal, honestly incomplete** — a blocked host names itself at run time; the service fragments (`agent-workflow-kit/tools/services/`) record what was observed.
|
|
62
62
|
|
|
63
63
|
**Invariants:** read-only (never writes, never commits, never runs a subscription CLI) · `--cwd` required · present-even-when-empty · verdict-first from frozen templates · probe failures degrade to stated skip lines · chat apply one-liners are cwd-independent (absolute tool paths + a pinned `--cwd`; the ONE exception is the `set-autonomy` item, a conversational skill invocation explicitly labeled *run IN the target project*) · the bare `sandbox-provision` item is the user's own step, pinned via a `cd <root> &&` prefix — the doctor reads its cwd · harness items carry a check and an apply bound to its digest; user items, including `family-freshness`, carry the user's own step · the used bridges' `sandbox.filesystem.allowWrite` and `sandbox.network.allowedDomains` are seeded only by the consented `velocity-profile --bridge-tier`; the worktrees grant is seeded into the local settings by the consented `velocity-profile --worktrees` · the `worktrees-dir` item converges on a declared `allowWrite` entry covering its probed dir in either scope, or on its `worktreesDirAck` in `docs/ai/acks.json`, recorded by the `ack-write` line its `recipe:` line carries, not by its apply line.
|
|
64
64
|
|
|
@@ -49,7 +49,7 @@ Honesty notes: tier entries get **NO PreToolUse-hook residual coverage — with
|
|
|
49
49
|
|
|
50
50
|
**The boundary of that qualifier, stated so it is not guessed.** It covers claims about `sandbox.*` keys — the block whose honouring was observed to vary by host. It deliberately does NOT cover `permissions.*` semantics (an allow rule auto-approving a command, `local > project` precedence for a non-sandbox key): that is the harness's own documented permission model, the layer this whole mode rests on, and hedging it would say nothing true. **Stated residual:** which sentences count as settings-derived runtime claims is decided by review, not by a checker — deciding whether a sentence asserts a runtime effect is a question about prose meaning, and this family deliberately has no mechanism that judges that (the same limit that retired the byte-scanning deny rung). A new claim-bearing line therefore has to carry the qualifier by authorship; the acceptance criterion is that every line stating what a `sandbox.*` key DOES carries it, and the tests pin the surfaces that exist today. What does NOT change is the CLASSIFICATION: which red-line a key would weaken, and that a proven bridge-tier exclusion is a note rather than a weakening, are properties of the declaration and stay flat statements.
|
|
51
51
|
|
|
52
|
-
**The `--bridge-tier` (own opt-in, AD-044).** Seeds the USED bridges from every recipe's review and execute slots in `docs/ai/orchestration.json`, resolved over host readiness to the effective recipe: a degraded recipe uses its resolved providers; an absent config takes the computed default. A bridge no slot uses gets nothing. Per used review role it seeds `Bash(<wrapper> code:*)` into `permissions.allow` and, with agy-review used, the quoted grounding pre-step rule. Per used role it seeds `<wrapper> *` into `sandbox.excludedCommands`,
|
|
52
|
+
**The `--bridge-tier` (own opt-in, AD-044).** Seeds the USED bridges from every recipe's review and execute slots in `docs/ai/orchestration.json`, resolved over host readiness to the effective recipe: a degraded recipe uses its resolved providers; an absent config takes the computed default. A bridge no slot uses gets nothing. Per used review role it seeds `Bash(<wrapper> code:*)` into `permissions.allow` and, with agy-review used, the quoted grounding pre-step rule. Per used role it seeds `<wrapper> *` and the excluded commands of the services its manifest names into `sandbox.excludedCommands`, those services' hosts into `sandbox.network.allowedDomains`, and their resolved state dirs into `sandbox.filesystem.allowWrite`, home-relative under the home and absolute outside it, with env overrides honoured. All entries land in the **project** `.claude/settings.json`, preserving existing entries and sibling keys. **Where the host honors the settings sandbox keys**, an exclusion means the wrapper runs outside the sandbox; a host means every sandboxed command of the project can reach it; a dir means every sandboxed command can write it — each widening is part of this consent. A session-imposed sandbox may ignore those keys; its lane is in `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`. An exclusion placed only in `settings.local.json` was live-observed NOT to route the command outside the sandbox (2026-07-11: the wrapper then starts sandboxed and dies on a read-only HOME), so hand-wiring the local file is no substitute for this tier. Under a harness-managed session sandbox (live-observed 2026-07-11/12) an IDE-managed sandbox ignores `sandbox.network.allowedDomains` and `sandbox.filesystem.allowWrite` in BOTH settings scopes — its own per-host consents govern egress, and the durable lanes there are the session sandbox config (the hosts plus the CLI state-dir writes) or the per-run consented bypass. Each bridge's observed egress hosts come from the kit service fragments (`agent-workflow-kit/tools/services/`) its `capability.json` names in `services` — the single documentation source (this doc retypes no host list); an apex domain is NOT covered by its `*.`-wildcard form, so the fragments carry both forms where observed. The upgrade Recommendations advisor's `bridge-tier` item offers this tier while any used-bridge surface is missing, its `recipe:` line naming each missing entry; an acknowledgement the retired session-sandbox-recipe item recorded in `docs/ai/acks.json` is never read, relabelled or removed — it keeps the meaning "seen". **Bare-entry reading (measured 2026-10-06):** an exclusion uses Bash rule syntax; a bare name matches only the argument-free command, so the tier writes the form with ` *`; an earlier bare entry stays and does not satisfy that surface. Where an execute slot delegates, codex-exec gets its exclusion, hosts and state dirs, but no allow rule, so a delegated run keeps its prompt. Only the code review mode is auto-allowed; plan/diff keep their prompt. The grounding rule uses the double-quoted absolute kit path the procedures advisor renders; an unseedable path is a stated skip. Its writer guard accepts only system-temp scratch or a fresh gitignored in-repo destination, refusing tracked, non-ignored, existing in-repo, outside-repo non-temp and symlink/non-regular destinations. The seeded byte-forms (this list IS the documented-invocation source for the bridge tier):
|
|
53
53
|
|
|
54
54
|
- `Bash(codex-review code:*)` — the review code-mode allow rule; `codex-review *` — its sandbox.excludedCommands entry.
|
|
55
55
|
- `Bash(agy-review code:*)` — the review code-mode allow rule; `agy-review *` — its sandbox.excludedCommands entry; `Bash(node "${CLAUDE_SKILL_DIR}/tools/grounding.mjs":*)` — its quoted grounding pre-step rule.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: rules
|
|
3
|
-
lastUpdated: 2026-
|
|
3
|
+
lastUpdated: 2026-11-02
|
|
4
4
|
scope: permanent
|
|
5
5
|
staleAfter: never
|
|
6
6
|
owner: kit
|
|
@@ -14,6 +14,7 @@ The kit block of AGENTS.md is the kit's and is rewritten on every upgrade; it an
|
|
|
14
14
|
- **Plain language.** User-facing narration is short, clear, plain words of the dialogue language; when the dialogue language is not English, transliterated English jargon is banned — an English term survives only as the NAME of a thing (a flag / command / file / test), glossed in plain words when helpful; plain English stays plain for English-dialogue users.
|
|
15
15
|
- **Deliver the artifact IN the message** — paste the prompt / diff / version / command inline; never "see §X / open the file / run it and you'll see" as a *substitute* for showing what was asked.
|
|
16
16
|
- **Lead with the result**, then the details; show exactly what was asked — no deflection, no "almost done" when the ask was the finished thing.
|
|
17
|
+
- **A question is answered, not acted on.** A message that only asks for information or an opinion changes nothing: answer it, and propose a change if one is needed. A request phrased as a question ("can you fix it?") and work the user already approved run as before. A change nobody asked for is a miss: undo it yourself in the same turn when it is your own and safely reversible — nothing else has touched it since — and otherwise say plainly what was changed; never hand it back as a decision or a cleanup for the user.
|
|
17
18
|
- **No condescension, no filler.** Own a miss plainly and fix it in the same message.
|
|
18
19
|
- **Large artifact (≈>100 lines):** deliver a real summary or the key excerpt inline **and** link the file — never flood the reader with a 2000-line paste, never hide the answer behind a bare pointer.
|
|
19
20
|
- **Live host/session facts are tool-composed only.** Any claim about the current host or session state (prompts fired, sandbox scope, whether a bypass was needed, network reachability, approval counts) must trace to **live tool output** from **this session**; a memory/handover snapshot is **context, never report facts**, and a claim with no live signal is **omitted or explicitly marked unverified** — never asserted from recollection.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// bridge-sandbox-recipe.mjs — the one reader of the bundled bridges'
|
|
1
|
+
// bridge-sandbox-recipe.mjs — the one reader of the bundled bridges' sandbox surfaces (their roles and
|
|
2
|
+
// the kit service fragments their manifests name, spec kit/services) and
|
|
2
3
|
// the one derivation of the bridge tier (contract: bridges/velocity-profile, revision 4). The tier
|
|
3
4
|
// writer, the advisor's delta, the danger check and the autonomy preview read the same
|
|
4
5
|
// `bundledSandboxRecipe(usedBridges(...))`, so the four cannot drift.
|
|
@@ -13,6 +14,7 @@ import { ACTIVITIES, BACKEND_PRIORITY, REVIEW_CMD_ALIASES } from './carriers.mjs
|
|
|
13
14
|
import { planRecipe, resolveActivityRecipe } from './recipes.mjs';
|
|
14
15
|
import { isReadyMember } from './review-roster-resolve.mjs';
|
|
15
16
|
import { isSeedablePathToken } from './repo-lex.mjs';
|
|
17
|
+
import { loadServiceFragments, mergeServices } from './services/index.mjs';
|
|
16
18
|
|
|
17
19
|
// The review wrappers, spelled bare as invoked. Only their `code` mode is auto-allowed: a bare
|
|
18
20
|
// `Bash(<wrapper>:*)` prefix would also cover the plan/diff file-argument modes, whose targets can
|
|
@@ -80,6 +82,7 @@ export const bundledSandboxRecipe = (used, deps = {}) => {
|
|
|
80
82
|
const readFile = deps.readFile ?? readFileSync;
|
|
81
83
|
const readDir = deps.readdir ?? readdirSync;
|
|
82
84
|
const bundleRoot = deps.bundleRoot ?? DEFAULT_BUNDLE_ROOT;
|
|
85
|
+
const fragments = loadServiceFragments({ servicesDir: deps.servicesDir });
|
|
83
86
|
const allow = [];
|
|
84
87
|
const excludedCommands = [];
|
|
85
88
|
const hosts = [];
|
|
@@ -116,11 +119,11 @@ export const bundledSandboxRecipe = (used, deps = {}) => {
|
|
|
116
119
|
});
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
const services = mergeServices(manifest.services ?? [], fragments);
|
|
123
|
+
for (const command of services.excludedCommands) pushOnce(excludedCommands, command);
|
|
124
|
+
for (const host of services.hosts) pushOnce(hosts, host);
|
|
125
|
+
for (const entry of services.dirEntries) {
|
|
126
|
+
if (!dirEntries.some((taken) => JSON.stringify(taken) === JSON.stringify(entry))) dirEntries.push(entry);
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
return { allow, excludedCommands, hosts, dirEntries, skips };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// bridge-state-dirs.mjs — the one leaf that turns
|
|
2
|
-
// (
|
|
1
|
+
// bridge-state-dirs.mjs — the one leaf that turns kit service fragments' state dir entries, through
|
|
2
|
+
// mergeServices (spec kit/services), into `sandbox.filesystem.allowWrite` entries (contract: bridges/velocity-profile).
|
|
3
3
|
// The bridge tier writes them, the advisor counts them, the danger check admits them, the autonomy
|
|
4
4
|
// preview names them: one resolution, one home-relative spelling, one merge, so the four cannot drift.
|
|
5
5
|
//
|
|
@@ -142,7 +142,7 @@ const RAW_BACKENDS = [
|
|
|
142
142
|
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; durationS = integer wall-clock seconds from CLI start through verdict parsing and the wrapper prints review duration: <n>s; blocking = the count of numbered items in the first ### Blocking section; artifactPath = the normalized realpath on plan/diff receipts only (repo-relative inside the work tree, absolute otherwise), while a double quote, backslash or control byte refuses pre-spend because the receipt encoder cannot carry it; verdict recorded verbatim from the mandated '### Verdict' section (SHIP / SHIP WITH NITS / REWORK); grounded = whether a NON-EMPTY --facts payload was supplied (code mode refuses pre-spend without one — no run, no receipt — unless --ungrounded/AGY_PROBE=1; in plan/diff 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); probe = whether the run relaxed the quality guards (AGY_PROBE=1), written on EVERY receipt so it self-declares — the kit's review-state gate rejects a probe-marked receipt (a probe review never attests) and equally rejects an unmarked one (silence is not a declaration); posture = the ACTUAL run posture {model} (agy has no tier), written on EVERY receipt (D5) — the gate rejects a receipt with an absent/invalid posture (a pre-D5 wrapper minted it; re-run the review), one stderr banner line states the same posture, a one-off model (an explicitly empty AGY_MODEL included) refuses pre-spend unless AGY_PROBE=1, and a model string carrying control bytes refuses pre-spend in every mode; delivery = how the change set REACHED the model, currently emitted as 'inline' (the whole set rode one prompt — proven by construction) or 'fed' (a chunked feed whose per-part echo proof verified); REQUIRED on every agy code receipt and its ABSENCE is what stops a pre-fed-lane receipt attesting, while the gate accepts any well-formed declaration rather than a particular value; absent by construction on plan/diff/continuation receipts, which carry no change set; a run whose output carries NO recognized '### Verdict' section — empty output included — exits 4 with NO receipt (D4: a FAILED review to RE-RUN, never a fatal session error); when the dispatch nonce seam is supplied — the AW_REVIEW_NONCE environment value or its plain-argument equivalent --nonce <n> (one seam: the flag assigns the same value; supplying both with different values refuses pre-spend) — under the safe grammar [A-Za-z0-9._-]{1,64} (anything else refuses pre-spend), the wrapper first mints the finding MANIFEST {schema, backend, nonce, fingerprint, findings} beside the receipts file (agent-workflow-finding-manifest-<backend>-<nonce>.json; atomic, no-clobber — a byte-identical rewrite is an idempotent no-op, different bytes refuse loudly) ORDERED before the receipt append — a failed manifest write EXCLUDES the receipt append, so a nonce-supplied dispatch can never land a receipt without its readable manifest; a nonce-less invocation adds NO nonce field and mints NO finding manifest (the existing wrapperVersion field still changes with each bridge release); a write failure warns, never fails the review",
|
|
143
143
|
notes: [
|
|
144
144
|
'transport: every review dispatch drives the CLI in --output-format json (plus --disable-slash-commands) and the returned envelope is parsed in node (bin/agy-envelope.mjs) — the operator-facing invocations and flags above do NOT change, and on a ZERO exit the wrapper still PRINTS the review text, never JSON. A missing or unreadable envelope on a zero exit is a loud failure with NO receipt, never a downgraded verdict and never a fallback to raw-stdout parsing; a non-zero CLI exit keeps its own code and message, and publishes the captured stdout unchanged from the SINGLE dispatch or the FINAL fed turn (which may therefore be a JSON or partial payload — the envelope is parsed only on a zero exit); an INTERMEDIATE feed turn is the exception, its output stays private (Invariant E) and its failure prints only a named error. Enforced by a PRE-SPEND capability probe, not a version floor: agy --help must advertise --output-format and --disable-slash-commands, node must be >= 22, and bin/agy-envelope.mjs must be present — otherwise the review refuses before any run is spent and names the missing capability',
|
|
145
|
-
'pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff its
|
|
145
|
+
'pre-dispatch host-diff: before the FIRST dispatch of this bridge, diff the hosts of the services its manifest names against the live sandbox allow-list — a missing host is surfaced to the maintainer BEFORE dispatching, never fired into a known prompt',
|
|
146
146
|
'the review posture banner appends a banner-only source=model:<s> field — where the model came from: default, setting or environment — then a banner-only timeout=<duration> field — exactly the duration agy-run hands to timeout(1); the hard-timeout preflight fails CLOSED when no timeout/gtimeout binary exists (the wrapper refuses by name before any CLI run, so an uncapped review run can no longer happen), and neither field enters the receipt posture or the D5 banner↔receipt parity',
|
|
147
147
|
'quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts',
|
|
148
148
|
],
|
package/tools/manifest/schema.md
CHANGED
|
@@ -18,8 +18,7 @@ expansion), never via the shell. The validator is [`validate.mjs`](./validate.mj
|
|
|
18
18
|
| `roles` | object | yes | keys ⊆ `provides`; see *Roles* |
|
|
19
19
|
| `detect` | object | no | `installed` (skill on the machine) + `deployed` (substrate set up in cwd) |
|
|
20
20
|
| `settings` | array | no | the bridge's **settings-file surface** (typed; see *Settings*). Unlike `contract`, a malformed entry **fails** `--strict`. |
|
|
21
|
-
| `
|
|
22
|
-
| `writableDirs` | object[] | no | the backend CLI's **writable state-dir declarations** — `{env, default}` entries (see *Writable dirs*). A malformed list **fails** `--strict`. |
|
|
21
|
+
| `services` | string[] | no | the ids of the kit service fragments the bridge uses — a non-empty list of unique ids (see *Services*); with it, `networkHosts` and `writableDirs` are refused. |
|
|
23
22
|
| `modeCatalog` | object[] | no | the bridge's **user-facing operating modes** — what each mode is FOR and when to reach for it (see *Mode catalog*). A malformed block **fails** `--strict`. |
|
|
24
23
|
| `install` / `uninstall` | object | no | `install.npm` is a package name, not a path |
|
|
25
24
|
| `cost` / `quota` / `provenance` | misc | no | informational |
|
|
@@ -95,49 +94,31 @@ Wrappers never parse JSON at run time: each carries its own shell registry/valid
|
|
|
95
94
|
drift-guarded set-equal to this block by the bridge `bin/*.test.mjs` suites (help section keys,
|
|
96
95
|
`aw_settings_known` registry, `AW_SETTINGS_APPLIED` subset, `aw_settings_valid` typed arms).
|
|
97
96
|
|
|
98
|
-
##
|
|
99
|
-
|
|
100
|
-
`
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
dir from an env override first (e.g. `CODEX_HOME` as `~`, `~/…`, absolute or relative), so the
|
|
124
|
-
declared path is only the **default under no override**. Rules:
|
|
125
|
-
|
|
126
|
-
- Each entry: `env` is `null` or an **UPPER_SNAKE_CASE env-var name**; `default` is a
|
|
127
|
-
**`~/`-anchored or absolute POSIX path** — no globs, no trailing slash, no `..` traversal.
|
|
128
|
-
Defaults must be unique. A malformed list **fails** `--strict` (the resolved dir is written into
|
|
129
|
-
`sandbox.filesystem.allowWrite` and rendered on the Recommendations advisor's one-line `recipe:` line).
|
|
130
|
-
- **Resolution is the advisor's, at run time, mirroring the wrapper's byte-semantics:** a
|
|
131
|
-
NON-EMPTY env value wins (an EMPTY env value ≡ unset — the `${VAR:-default}` form); the
|
|
132
|
-
wrapper's exact case-arms apply — `~`, `~/…` and absolute forms ride as-given, EVERY other
|
|
133
|
-
form (including `~user/…`, which the wrappers never resolve as a home path) anchors like a
|
|
134
|
-
relative path. The advisor anchors those to the **target project root** (its pinned `--cwd`),
|
|
135
|
-
matching what a wrapper invoked from the project root resolves — the documented dispatch form
|
|
136
|
-
(the wrapper itself anchors to its invocation `$PWD`); else the `default` applies.
|
|
137
|
-
- **The `--bridge-tier` seeds every used bridge's state dirs**, home-relative under the home
|
|
138
|
-
(absolute outside it), into `sandbox.filesystem.allowWrite` beside the wrapper's `<wrapper> *`
|
|
139
|
-
exclusion (`codex-exec *` for the execution wrapper) — the advisor's `bridge-tier` item counts
|
|
140
|
-
and names each missing dir.
|
|
97
|
+
## Services
|
|
98
|
+
|
|
99
|
+
`services` names the kit service fragments under `agent-workflow-kit/tools/services/` that the
|
|
100
|
+
bridge uses. The module's `mergeServices` supplies their hosts, state dirs and excluded commands.
|
|
101
|
+
A fragment is a closed object of five required keys (`hosts`, `writableDirs`, `excludedCommands`,
|
|
102
|
+
`passedVariables`, `runReachesHosts`), enforced by the module's loader in
|
|
103
|
+
[`../services/index.mjs`](../services/index.mjs); the host and state-dir rules are the ones these
|
|
104
|
+
retired manifest fields carried.
|
|
105
|
+
|
|
106
|
+
A present `services` must be a non-empty array of unique string ids, each naming a loaded fragment. With that key present, `networkHosts` and `writableDirs` are
|
|
107
|
+
refused whatever their values. A manifest without `services` stays valid in its earlier shape:
|
|
108
|
+
no fragments are read and the retired keys are read by nothing. The validator loads fragments only
|
|
109
|
+
when `services` is present; a loader refusal makes the manifest invalid, naming the fragment file
|
|
110
|
+
or services directory, rather than throwing. An invalid manifest **fails** `--strict`.
|
|
111
|
+
|
|
112
|
+
**The `--bridge-tier` seed is the primary lane** (AD-172): for every used bridge it merges the
|
|
113
|
+
services' hosts into `sandbox.network.allowedDomains`, resolved state dirs into
|
|
114
|
+
`sandbox.filesystem.allowWrite` (home-relative under the home, absolute outside it, env overrides
|
|
115
|
+
honoured), and excluded commands after the used roles' `<wrapper> *` exclusions (`codex-exec *`
|
|
116
|
+
for the execution wrapper). The advisor's `bridge-tier` item counts and names each missing entry.
|
|
117
|
+
A settings-native harness that drops the exclusion still admits the hosts; that pre-allow widens
|
|
118
|
+
egress for **every** sandboxed command, which the tier's consent states. A harness-managed sandbox
|
|
119
|
+
that ignores the settings keys keeps its own controls — scoped rules, a session allowance and
|
|
120
|
+
consent at the point of action — and the kit writes no shape for it. The hosts record what was
|
|
121
|
+
observed: a blocked host names itself at run time, and its service fragment is the place to extend.
|
|
141
122
|
|
|
142
123
|
## Mode catalog (BRIDGE-MODES-CATALOG)
|
|
143
124
|
|
|
@@ -203,8 +184,8 @@ with no control characters — the surface is a terminal-width list and a pasted
|
|
|
203
184
|
## Path-field rules (Windows-safe, traversal-safe)
|
|
204
185
|
|
|
205
186
|
These rules govern the **repo/project-relative path fields** enumerated below (`source`,
|
|
206
|
-
`template`, `detect.*`)
|
|
207
|
-
|
|
187
|
+
`template`, `detect.*`). Service fragments' state-dir defaults are deliberately `~/`-anchored or
|
|
188
|
+
absolute **host** paths under the fragment rules in *Services* above.
|
|
208
189
|
|
|
209
190
|
- **No absolute paths**, **no `..` traversal** in the fields below; **no unresolved placeholders**
|
|
210
191
|
(`{{…}}` / `${…}`) in any field.
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import { readFileSync, existsSync } from 'node:fs';
|
|
22
22
|
import { resolve, join, isAbsolute } from 'node:path';
|
|
23
23
|
import { isDirectRun } from '../direct-run.mjs';
|
|
24
|
+
import { loadServiceFragments } from '../services/index.mjs';
|
|
24
25
|
|
|
25
26
|
export const FAMILY = 'agent-workflow';
|
|
26
27
|
export const SUPPORTED_SCHEMA = 1;
|
|
@@ -89,10 +90,6 @@ const CONTROL_CHAR_RE = /[\x00-\x1f\x7f]/;
|
|
|
89
90
|
const hasTraversal = (p) => p.split(/[\\/]/).includes('..');
|
|
90
91
|
const isUnresolved = (s) => /\{\{|\}\}|\$\{/.test(s);
|
|
91
92
|
|
|
92
|
-
// A `networkHosts` entry: a bare dotted hostname, optionally a `*.` family wildcard — never a
|
|
93
|
-
// scheme, a path, a port, or whitespace (the entry is pasted verbatim into an allowlist line).
|
|
94
|
-
export const NETWORK_HOST_RE = /^(\*\.)?[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;
|
|
95
|
-
|
|
96
93
|
// Cross-platform "absolute-like": POSIX root (/x), Windows drive (C:\ or C:/), UNC (\\host),
|
|
97
94
|
// or a leading backslash. node:path.isAbsolute() alone is platform-dependent, so a Windows path
|
|
98
95
|
// would slip through unchecked on a POSIX CI runner — Windows-safety requires rejecting both.
|
|
@@ -436,7 +433,7 @@ const validateModeCatalog = (catalog, roles, errors) => {
|
|
|
436
433
|
});
|
|
437
434
|
};
|
|
438
435
|
|
|
439
|
-
export const validateManifest = (skillDir) => {
|
|
436
|
+
export const validateManifest = (skillDir, options = {}) => {
|
|
440
437
|
const manifestPath = join(skillDir, 'capability.json');
|
|
441
438
|
let raw;
|
|
442
439
|
try {
|
|
@@ -637,63 +634,28 @@ export const validateManifest = (skillDir) => {
|
|
|
637
634
|
}
|
|
638
635
|
}
|
|
639
636
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
// sandboxed command, stated at that consent. A malformed list FAILS --strict like `settings`:
|
|
644
|
-
// the tier writes it and the Recommendations advisor renders it verbatim, so a bad entry would corrupt a seeded line.
|
|
645
|
-
const networkHosts = manifest.networkHosts;
|
|
646
|
-
if (networkHosts != null) {
|
|
647
|
-
if (!Array.isArray(networkHosts) || networkHosts.length === 0) {
|
|
648
|
-
errors.push('`networkHosts` must be a non-empty array of host strings');
|
|
649
|
-
} else {
|
|
650
|
-
const seenHosts = new Set();
|
|
651
|
-
networkHosts.forEach((host, i) => {
|
|
652
|
-
if (typeof host !== 'string' || !NETWORK_HOST_RE.test(host)) {
|
|
653
|
-
errors.push(`\`networkHosts[${i}]\` must be a bare hostname or a *.family wildcard (${JSON.stringify(host)})`);
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
if (seenHosts.has(host)) errors.push(`duplicate networkHosts entry "${host}" (\`networkHosts[${i}]\`)`);
|
|
657
|
-
else seenHosts.add(host);
|
|
658
|
-
});
|
|
637
|
+
if (Object.hasOwn(manifest, 'services')) {
|
|
638
|
+
for (const key of ['networkHosts', 'writableDirs']) {
|
|
639
|
+
if (Object.hasOwn(manifest, key)) errors.push(`\`services\` must not coexist with retired key \`${key}\``);
|
|
659
640
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const at = `\`writableDirs[${i}]\``;
|
|
675
|
-
if (entry == null || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
676
|
-
errors.push(`${at} must be an {env, default} object`);
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
if (entry.env !== null && (typeof entry.env !== 'string' || !/^[A-Z][A-Z0-9_]*$/.test(entry.env))) {
|
|
680
|
-
errors.push(`${at}.env must be null or an UPPER_SNAKE_CASE env-var name (${JSON.stringify(entry.env)})`);
|
|
681
|
-
}
|
|
682
|
-
const dir = entry.default;
|
|
683
|
-
if (typeof dir !== 'string' || !(dir.startsWith('~/') || dir.startsWith('/'))) {
|
|
684
|
-
errors.push(`${at}.default must be a \`~/\`-anchored or absolute POSIX path (${JSON.stringify(dir)})`);
|
|
685
|
-
return;
|
|
641
|
+
try {
|
|
642
|
+
const fragments = loadServiceFragments({ servicesDir: options.servicesDir });
|
|
643
|
+
const services = manifest.services;
|
|
644
|
+
if (!Array.isArray(services) || services.length === 0) {
|
|
645
|
+
errors.push('`services` must be a non-empty array of unique service ids');
|
|
646
|
+
} else {
|
|
647
|
+
const seenServices = new Set();
|
|
648
|
+
for (const id of services) {
|
|
649
|
+
if (typeof id !== 'string' || !Object.hasOwn(fragments, id)) {
|
|
650
|
+
errors.push(`\`services\` has an unknown or non-string id: ${JSON.stringify(id)}`);
|
|
651
|
+
} else if (seenServices.has(id)) {
|
|
652
|
+
errors.push(`\`services\` has a duplicate id: ${JSON.stringify(id)}`);
|
|
653
|
+
}
|
|
654
|
+
seenServices.add(id);
|
|
686
655
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
// eslint-disable-next-line no-control-regex
|
|
691
|
-
if (/[\x00-\x1f\x7f]/.test(dir)) errors.push(`${at}.default must not carry control characters (${JSON.stringify(dir)})`);
|
|
692
|
-
if (dir.endsWith('/')) errors.push(`${at}.default must not end with a trailing slash ("${dir}")`);
|
|
693
|
-
if (hasTraversal(dir)) errors.push(`${at}.default must not contain ".." traversal ("${dir}")`);
|
|
694
|
-
if (seenDefaults.has(dir)) errors.push(`duplicate writableDirs default "${dir}" (${at})`);
|
|
695
|
-
else seenDefaults.add(dir);
|
|
696
|
-
});
|
|
656
|
+
}
|
|
657
|
+
} catch (error) {
|
|
658
|
+
errors.push(`\`services\`: ${error.message}`);
|
|
697
659
|
}
|
|
698
660
|
}
|
|
699
661
|
|
package/tools/procedures.mjs
CHANGED
|
@@ -476,7 +476,7 @@ const costLanesAdvice = () => [
|
|
|
476
476
|
' • L2 subscription bridge (codex / agy) — reviews per the resolved recipe above, on each bridge\'s host posture (the model the user set, else the bridge default); a weaker model is the user\'s setting, never a per-call choice — a probe is the one route to a one-off and its review receipt never attests.',
|
|
477
477
|
' • L3 frontier — judgment: plan/fold/synthesis, ADR/handover/changelog-entry wording, persuasive copy, go/no-go, real code.',
|
|
478
478
|
' • A step with no named guardrail does not move down a lane; red lines never move down (council review models · real code · memory/copy wording · the maintainer approval asks).',
|
|
479
|
-
' • Sandbox lanes (under an OS sandbox): the L0 surfaces are sandbox-safe — gates/ledger/state/fold checks, git reads, plain no-network tests; the bridge wrappers are genuinely unsandboxed (network); npm-cache-touching commands are COMMAND-SHAPE dependent — first try the sandbox-safe shape (cache under $TMPDIR, offline/notifier off). Move ONLY the failing command out of the sandbox, never its class; BATCH consecutive unsandboxed calls. Pre-dispatch host-diff: before the FIRST dispatch of each bridge, diff its manifest
|
|
479
|
+
' • Sandbox lanes (under an OS sandbox): the L0 surfaces are sandbox-safe — gates/ledger/state/fold checks, git reads, plain no-network tests; the bridge wrappers are genuinely unsandboxed (network); npm-cache-touching commands are COMMAND-SHAPE dependent — first try the sandbox-safe shape (cache under $TMPDIR, offline/notifier off). Move ONLY the failing command out of the sandbox, never its class; BATCH consecutive unsandboxed calls. Pre-dispatch host-diff: before the FIRST dispatch of each bridge, diff the hosts of the services its manifest names against the live sandbox allow-list — a missing host is surfaced to the maintainer BEFORE dispatching, never fired into a known prompt. Nested-sandbox honesty: a backend CLI shipping its OWN OS sandbox cannot run nested inside a harness sandbox — route it outside (excludedCommands / a per-run consented bypass) on the OBSERVED failure, never a preemptive blanket.',
|
|
480
480
|
' • Prompt economy (autonomy-preserving dispatch): read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator\'s own shell form is ONE plain pipeline per call (a ;/&& chain or env-prefixed invocation never matches a prefix allow rule); a fan-out LAUNCHER that gates per call yields to the agent-spawn lane. Capability-gated: on a host with restricted-tool subagent vehicles use them; without restricted-tool vehicles (a host offering only full-tool agents included), read-only research stays in the orchestrator\'s own context — never a vehicle mandate a host cannot satisfy.',
|
|
481
481
|
' • Writer economy (autonomy-preserving dispatch): a stage\'s repeated WRITER commands batch into ONE invocation — combine a stage\'s writers via one batched write or one launcher per stage; never one writer call at a time (each write is its own prompt).',
|
|
482
482
|
' • The prompt-economy clause narrows TOOLS for read-only work only — judgment, code, synthesis stay at the frontier lane; a task that genuinely needs to run or write keeps a full-tool subagent. Honest limit: no deterministic gate classifies a dispatch — enforcement is the canon at the point of use + the placed vehicles + the retro loop.',
|
|
@@ -6,6 +6,7 @@ import { digestOf } from './rules-check.mjs';
|
|
|
6
6
|
export const RULES_PRIORS = Object.freeze([
|
|
7
7
|
Object.freeze({ theme: 'project-layout', release: '14.37.0', sha256: 'b79f19a9e0583f1e0619ee6aca06feb2c359b9655f1d260e87d8d5647bd1de19' }),
|
|
8
8
|
Object.freeze({ theme: 'project-layout', release: '19.4.0', sha256: 'ec4ef10c05ba365e73df96d175042314ea120f3fe1c946fdd94d3d1237de8be9' }),
|
|
9
|
+
Object.freeze({ theme: 'communication', release: '20.0.0', sha256: 'ce0ebcab194b21fedd96c389daefb92be3cf2b5fe15f3c40b0485c32a2575e1f' }),
|
|
9
10
|
]);
|
|
10
11
|
|
|
11
12
|
// isKnownPrior(theme, bytes, catalog?) → true exactly when the bytes hash to an entry of that theme.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hosts": [
|
|
3
|
+
"*.googleapis.com",
|
|
4
|
+
"accounts.google.com",
|
|
5
|
+
"antigravity-unleash.goog",
|
|
6
|
+
"lh3.googleusercontent.com"
|
|
7
|
+
],
|
|
8
|
+
"writableDirs": [
|
|
9
|
+
{
|
|
10
|
+
"env": null,
|
|
11
|
+
"default": "~/.gemini/antigravity-cli"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"excludedCommands": [],
|
|
15
|
+
"passedVariables": [],
|
|
16
|
+
"runReachesHosts": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
export const SERVICE_FACTS_FILE = 'service-facts.txt';
|
|
6
|
+
const SERVICES_DIRECTORY = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
+
const FRAGMENT_EXTENSION = '.json';
|
|
8
|
+
const FRAGMENT_KEYS = ['hosts', 'writableDirs', 'excludedCommands', 'passedVariables', 'runReachesHosts'];
|
|
9
|
+
const NETWORK_HOST_RE = /^(\*\.)?[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;
|
|
10
|
+
const VARIABLE_RE = /^[A-Z][A-Z0-9_]*$/;
|
|
11
|
+
const EXCLUDED_COMMAND_RE = /^[A-Za-z0-9][A-Za-z0-9._-]* \*$/;
|
|
12
|
+
const GLOB_RE = /[*?[\]]/;
|
|
13
|
+
const CONTROL_CHAR_RE = /[\x00-\x1f\x7f]/;
|
|
14
|
+
const FACTS_HEADER = "# generated from the kit's service fragments (agent-workflow-kit/tools/services/); do not edit";
|
|
15
|
+
const FACT_GROUPS = [
|
|
16
|
+
['HOST', 'hosts'], ['RUN_HOST', 'runHosts'], ['WRITABLE_DIR', 'dirEntries'],
|
|
17
|
+
['EXCLUDED_COMMAND', 'excludedCommands'], ['PASSED_VARIABLE', 'passedVariables'],
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const isObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
21
|
+
const hasTraversal = (path) => path.split(/[\\/]/).includes('..');
|
|
22
|
+
const isVariable = (value) => typeof value === 'string' && VARIABLE_RE.test(value);
|
|
23
|
+
const isDirectoryEntry = (entry) => {
|
|
24
|
+
if (!isObject(entry) || !(entry.env === null || isVariable(entry.env))) return false;
|
|
25
|
+
const directory = entry.default;
|
|
26
|
+
return typeof directory === 'string'
|
|
27
|
+
&& (directory.startsWith('~/') || directory.startsWith('/'))
|
|
28
|
+
&& !GLOB_RE.test(directory) && !CONTROL_CHAR_RE.test(directory)
|
|
29
|
+
&& !directory.endsWith('/') && !hasTraversal(directory);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const refuseSchema = (path, key, reason) => {
|
|
33
|
+
throw new Error(`${path}: ${key} ${reason}`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const validateList = (value, path, key, accepts, identify = (entry) => entry) => {
|
|
37
|
+
if (!Array.isArray(value)) refuseSchema(path, key, 'must be an array');
|
|
38
|
+
const seen = new Set();
|
|
39
|
+
for (const entry of value) {
|
|
40
|
+
if (!accepts(entry)) refuseSchema(path, key, `has an invalid entry ${JSON.stringify(entry)}`);
|
|
41
|
+
const identity = identify(entry);
|
|
42
|
+
if (seen.has(identity)) refuseSchema(path, key, `has a duplicate entry ${JSON.stringify(identity)}`);
|
|
43
|
+
seen.add(identity);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const validateFragment = (fragment, path) => {
|
|
48
|
+
if (!isObject(fragment)) refuseSchema(path, 'root', 'must be an object');
|
|
49
|
+
for (const key of Object.keys(fragment)) {
|
|
50
|
+
if (!FRAGMENT_KEYS.includes(key)) refuseSchema(path, key, 'is unknown');
|
|
51
|
+
}
|
|
52
|
+
for (const key of FRAGMENT_KEYS) {
|
|
53
|
+
if (!Object.hasOwn(fragment, key)) refuseSchema(path, key, 'is required');
|
|
54
|
+
}
|
|
55
|
+
validateList(fragment.hosts, path, 'hosts',
|
|
56
|
+
(host) => typeof host === 'string' && NETWORK_HOST_RE.test(host));
|
|
57
|
+
validateList(fragment.writableDirs, path, 'writableDirs', isDirectoryEntry, (entry) => entry.default);
|
|
58
|
+
validateList(fragment.excludedCommands, path, 'excludedCommands',
|
|
59
|
+
(command) => typeof command === 'string' && EXCLUDED_COMMAND_RE.test(command));
|
|
60
|
+
validateList(fragment.passedVariables, path, 'passedVariables', isVariable);
|
|
61
|
+
if (typeof fragment.runReachesHosts !== 'boolean') refuseSchema(path, 'runReachesHosts', 'must be a boolean');
|
|
62
|
+
return fragment;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const readFragment = (path, readFile) => {
|
|
66
|
+
const fragment = (() => {
|
|
67
|
+
try {
|
|
68
|
+
return JSON.parse(readFile(path, 'utf8'));
|
|
69
|
+
} catch (error) {
|
|
70
|
+
throw new Error(`${path}: cannot read or parse service fragment: ${error.message}`, { cause: error });
|
|
71
|
+
}
|
|
72
|
+
})();
|
|
73
|
+
return validateFragment(fragment, path);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const loadServiceFragments = (deps = {}) => {
|
|
77
|
+
const servicesDir = deps.servicesDir ?? SERVICES_DIRECTORY;
|
|
78
|
+
const readdir = deps.readdir ?? readdirSync;
|
|
79
|
+
const readFile = deps.readFile ?? readFileSync;
|
|
80
|
+
const entries = (() => {
|
|
81
|
+
try {
|
|
82
|
+
return readdir(servicesDir);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
throw new Error(`${servicesDir}: cannot read services directory: ${error.message}`, { cause: error });
|
|
85
|
+
}
|
|
86
|
+
})();
|
|
87
|
+
return Object.fromEntries(entries.filter((name) => name.endsWith(FRAGMENT_EXTENSION)).sort().map((name) => [
|
|
88
|
+
name.slice(0, -FRAGMENT_EXTENSION.length), readFragment(join(servicesDir, name), readFile),
|
|
89
|
+
]));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const takeUnique = (entries, identify = (entry) => entry) => {
|
|
93
|
+
const seen = new Set();
|
|
94
|
+
return entries.filter((entry) => {
|
|
95
|
+
const identity = identify(entry);
|
|
96
|
+
if (seen.has(identity)) return false;
|
|
97
|
+
seen.add(identity);
|
|
98
|
+
return true;
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const mergeServices = (ids, fragments) => {
|
|
103
|
+
const selected = ids.map((id) => {
|
|
104
|
+
if (!Object.hasOwn(fragments, id)) throw new Error(`Unknown service id: ${id}`);
|
|
105
|
+
return fragments[id];
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
hosts: takeUnique(selected.flatMap((fragment) => fragment.hosts)),
|
|
109
|
+
dirEntries: takeUnique(selected.flatMap((fragment) => fragment.writableDirs),
|
|
110
|
+
(entry) => JSON.stringify([entry.env, entry.default]))
|
|
111
|
+
.map((entry) => ({ env: entry.env, default: entry.default })),
|
|
112
|
+
excludedCommands: takeUnique(selected.flatMap((fragment) => fragment.excludedCommands)),
|
|
113
|
+
passedVariables: takeUnique(selected.flatMap((fragment) => fragment.passedVariables)),
|
|
114
|
+
runHosts: takeUnique(selected.filter((fragment) => fragment.runReachesHosts).flatMap((fragment) => fragment.hosts)),
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const renderServiceFacts = (merged) => [
|
|
119
|
+
FACTS_HEADER,
|
|
120
|
+
...FACT_GROUPS.flatMap(([key, field]) => merged[field].map((entry) =>
|
|
121
|
+
`${key}=${field === 'dirEntries' ? `${entry.env ?? ''}:${entry.default}` : entry}`)),
|
|
122
|
+
'',
|
|
123
|
+
].join('\n');
|