@sabaiway/agent-workflow-kit 23.0.0 → 23.2.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 +50 -0
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/bridges/antigravity-cli-bridge/SKILL.md +11 -10
- package/bridges/antigravity-cli-bridge/bin/agy-jev.test.mjs +56 -7
- package/bridges/antigravity-cli-bridge/bin/agy-review.sh +80 -62
- package/bridges/antigravity-cli-bridge/bin/agy-review.test.mjs +0 -21
- package/bridges/antigravity-cli-bridge/bin/agy.sh +86 -12
- package/bridges/antigravity-cli-bridge/capability.json +2 -2
- package/bridges/antigravity-cli-bridge/references/models-and-flags.md +3 -3
- package/bridges/antigravity-cli-bridge/setup/README.md +1 -1
- package/bridges/codex-cli-bridge/SKILL.md +23 -24
- package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +82 -47
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +133 -52
- package/bridges/codex-cli-bridge/bin/codex-review-jev.test.mjs +44 -14
- package/bridges/codex-cli-bridge/bin/codex-review.sh +103 -30
- package/bridges/codex-cli-bridge/capability.json +6 -6
- package/bridges/codex-cli-bridge/references/driving-codex.md +6 -7
- package/bridges/codex-cli-bridge/references/sandbox-and-flags.md +8 -11
- package/bridges/codex-cli-bridge/setup/README.md +3 -3
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/modes/recommendations.md +2 -2
- package/references/modes/setup.md +2 -0
- package/references/modes/upgrade.md +3 -3
- package/references/modes/velocity.md +1 -1
- package/tools/apply-danger-check.mjs +1 -1
- package/tools/bridge-sandbox-recipe.mjs +7 -3
- package/tools/bridge-settings-read.mjs +2 -0
- package/tools/detect-backends.mjs +22 -14
- package/tools/fs-safe.mjs +2 -2
- package/tools/manifest/schema.md +2 -2
- package/tools/refresh-parity.mjs +3 -3
- package/tools/services/antigravity.json +3 -0
- package/tools/services/codex.json +5 -0
- package/tools/services/index.mjs +49 -5
- package/tools/services/jev.json +1 -0
- package/tools/setup-backends.mjs +37 -48
- package/tools/velocity-profile.mjs +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"name": "codex-cli-bridge",
|
|
5
5
|
"kind": "execution-backend",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "6.0.0",
|
|
7
7
|
"posture": { "model": "gpt-6.1-sol", "effort": "high", "tier": null },
|
|
8
8
|
"provides": ["execute", "review"],
|
|
9
9
|
"roles": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"nested-sandbox limit: codex-exec ships its OWN OS sandbox (bwrap workspace-write) and cannot run nested inside a harness sandbox (the FS turns read-only) — route it OUTSIDE the harness sandbox (excludedCommands / a per-run consented bypass) on the OBSERVED bwrap/EPERM failure, never a preemptive blanket",
|
|
32
32
|
"exec posture banner: ONE stderr line before dispatch states the ACTUAL run posture — exec posture: model=… effort=… tier=… sandbox=jev-profile|workspace-write session=fresh|resume:<id> jev=… source=… timeout=… — from RESOLVED post-validation values; the resume id is validated pre-spend, control bytes in a model, effort, tier or timeout value refuse pre-spend, and a jev= reason shows a control byte as ?",
|
|
33
33
|
"threat model: the sidecar byte and grammar screens detect corrupted input under a trusted parent environment. A hostile parent environment — including exported shell functions or PATH substitution of core/backend commands — is outside the threat model and can substitute the backend itself. Targeted shadow-proof resolution protects banner/dispatch honesty from accidental shadowing; it is not an environment security boundary",
|
|
34
|
-
"the exec posture banner states what the run reaches in a jev= field:
|
|
34
|
+
"the exec posture banner states what the run reaches in a jev= field: the run hosts its service-facts.txt lists when the run carries the permissions profile `jev` (Linux, codex-cli 0.160.0 or newer, a repository outside every temp root, a version and profile digest not recorded as refused), else jev=unreachable (<reason>) on today's workspace-write flags with network off; a run whose codex refuses the profile exits 72 with no success receipt and, for a refused profile key, records its version and digest when the state file can be written, so the next run on them takes today's flags; then a banner-only source=model:<s>,effort:<s> field — where each value came from: default, setting or environment — then a banner-only timeout=<duration|uncapped> field — exactly the duration handed to timeout(1), uncapped when no timeout/gtimeout binary caps the run; INFORMATIONAL only: none of the three is persisted in a receipt or session sidecar",
|
|
35
35
|
"quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts",
|
|
36
36
|
"every-run nested-sandbox scan (DUAL policy, deliberately two different rules): the scan runs on EVERY completed run, not only a failed one, because a run that SURVIVES the nested-sandbox failure exits 0 with an ungrounded answer and nothing said so. Failed run (rc != 0): the existing loose whole-trace combination rule prints the recovery hint. Successful run (rc == 0): a warning fires ONLY on precise per-item evidence — both a sandbox-mechanism token AND a permission/read-only failure token inside the aggregated_output of ONE command_execution item whose failure is PROVEN (a nonzero exit_code, or the serialized status \"failed\"); a null exit_code is never failure by itself, tokens split across two items never fire, and a successful command's output never fires. The answer is printed FIRST on stdout, then the warning on stderr. HONEST RESIDUAL: the exit status does NOT change on that lane (a distinct nonzero exit would give a heuristic scan DENY polarity, refusing real work whenever the scan over-warns), so an orchestrator keying on exit status alone can still bank an ungrounded answer — the stderr warning is the signal"
|
|
37
37
|
]
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"continue": [],
|
|
52
52
|
"receipt": "side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain; never-committable untracked paths — character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked symlinks/directories ride as name-only notes) in code mode, the artifact-file sha256 in plan mode; durationS = integer wall-clock seconds from CLI start through verdict parsing and the wrapper prints review duration: <n>s; blocking = the count of [blocker] and [major] lines (schema mode: findings with either severity; a payload whose findings cannot be counted fails the run, no receipt); artifactPath = the normalized realpath on plan 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 parsed from the mandated literal verdict line (schema mode: the verdict field); always fresh:true (one-shot) + grounded:true (native AGENTS.md auto-merge, factsHash null); probe = whether the run relaxed the quality guards (CODEX_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, effort, tier} (tier null on the standard 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, and a posture value carrying control bytes refuses pre-spend in every mode; a run whose final message carries NO recognized 'Verdict: <ship|revise|rethink>' line — empty or missing 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",
|
|
53
53
|
"notes": [
|
|
54
|
-
"the review posture banner states what the run reaches in a jev= field:
|
|
54
|
+
"the review posture banner states what the run reaches in a jev= field: the run hosts its service-facts.txt lists when the run carries the read-only permissions profile `jev` (Linux, codex-cli 0.160.0 or newer, a version and profile digest not recorded as refused), else jev=unreachable (<reason>) under --sandbox read-only; a run whose codex refuses the profile exits 72 with no receipt; then a banner-only source=model:<s>,effort:<s> field — where each value came from: default, setting or environment — then a banner-only timeout=<duration> field — exactly the duration handed 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 none of the three fields enters the receipt posture or the D5 banner↔receipt parity",
|
|
55
55
|
"quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts"
|
|
56
56
|
]
|
|
57
57
|
}
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
{ "slot": "<extra codex flags...>", "required": false, "description": "extra codex flags, filtered by the guarded passthrough tiers" }
|
|
82
82
|
],
|
|
83
83
|
"guardrails": [
|
|
84
|
-
{ "value": "runs under codex's OWN OS sandbox: the permissions profile `jev` (workspace writes, network to
|
|
84
|
+
{ "value": "runs under codex's OWN OS sandbox: the permissions profile `jev` (workspace writes, network to the run hosts its service-facts.txt lists), else workspace-write with network off", "enforcement": "enforced", "condition": "profile: run hosts in service-facts.txt, Linux, codex-cli 0.160.0+, repo outside temp roots, no recorded refusal; cannot nest in a sandbox — route outside on OBSERVED failure", "source": "capability.json roles.execute.contract.notes" },
|
|
85
85
|
{ "value": "the guarded passthrough blocks model / sandbox / approval overrides", "enforcement": "enforced", "condition": "under the permissions profile `jev` even CODEX_PROBE=1 refuses --add-dir, -C, --cd, --enable and --disable", "source": "bin/codex-exec.sh" },
|
|
86
86
|
{ "value": "hard wall-clock cap CODEX_HARD_TIMEOUT (built-in default 3600s)", "enforcement": "enforced", "condition": "only while timeout(1)/gtimeout is on PATH — otherwise the wrapper warns and runs uncapped, and a NONCED run refuses pre-spend", "source": "capability.json settings.CODEX_HARD_TIMEOUT" },
|
|
87
87
|
{ "value": "ONE exec posture stderr banner line states the ACTUAL run posture before dispatch (session=fresh|resume:<id>; jev= names the reachable hosts or why none; jev= and timeout= are banner-only)", "enforcement": "enforced", "source": "bin/codex-exec.sh" },
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
{ "slot": "[--nonce <n>]", "required": false, "description": "the flow dispatch nonce — the plain-argument lane onto the AW_REVIEW_NONCE seam (round-open prints the value; flag and a non-empty env must agree)" }
|
|
141
141
|
],
|
|
142
142
|
"guardrails": [
|
|
143
|
-
{ "value": "read-only — the permissions profile `jev` with no write entry, else --sandbox read-only: codex cannot edit, create or delete a file", "enforcement": "enforced", "condition": "
|
|
143
|
+
{ "value": "read-only — the permissions profile `jev` with no write entry, else --sandbox read-only: codex cannot edit, create or delete a file", "enforcement": "enforced", "condition": "Linux, codex-cli 0.160.0+, no recorded version/profile-digest refusal; reaches the run hosts its service-facts.txt lists", "source": "bin/codex-review.sh" },
|
|
144
144
|
{ "value": "runs on the host posture's model and effort", "enforcement": "enforced", "condition": "a one-off is refused pre-spend unless CODEX_PROBE=1 marks a throwaway probe", "source": "bin/codex-review.sh" },
|
|
145
145
|
{ "value": "a successful review appends one receipt line the review-state gate reads", "enforcement": "enforced", "condition": "a receipt write failure warns and the review still succeeds — the tree then reads un-receipted", "source": "capability.json roles.review.contract.receipt" }
|
|
146
146
|
],
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
{ "slot": "[extra focus...]", "required": false, "description": "extra focus words appended to the review directive" }
|
|
164
164
|
],
|
|
165
165
|
"guardrails": [
|
|
166
|
-
{ "value": "read-only — the permissions profile `jev` with no write entry, else --sandbox read-only: codex cannot edit, create or delete a file", "enforcement": "enforced", "condition": "
|
|
166
|
+
{ "value": "read-only — the permissions profile `jev` with no write entry, else --sandbox read-only: codex cannot edit, create or delete a file", "enforcement": "enforced", "condition": "Linux, codex-cli 0.160.0+, no recorded version/profile-digest refusal; reaches the run hosts its service-facts.txt lists", "source": "bin/codex-review.sh" },
|
|
167
167
|
{ "value": "an oversized change set rides via a git-dir temp file, never truncated", "enforcement": "enforced", "source": "bin/codex-review.sh" },
|
|
168
168
|
{ "value": "a successful review appends one receipt line the review-state gate reads", "enforcement": "enforced", "condition": "a receipt write failure warns and the review still succeeds — the tree then reads un-receipted", "source": "capability.json roles.review.contract.receipt" }
|
|
169
169
|
],
|
|
@@ -38,7 +38,7 @@ Every dispatch states its ACTUAL posture on ONE stderr line: `codex-exec` emits
|
|
|
38
38
|
(fresh and resume alike, only after the resume id is resolved and validated), `codex-review` emits
|
|
39
39
|
`review posture: model=… effort=… tier=… jev=… source=… timeout=…`. When you label a dispatch for a user or a
|
|
40
40
|
record, **quote the posture banner verbatim** — the banner is the machine-stated posture; a prose
|
|
41
|
-
re-type drifts. The `jev=` field says what the run reaches:
|
|
41
|
+
re-type drifts. The `jev=` field says what the run reaches: the run hosts its service-facts.txt lists under
|
|
42
42
|
the permissions profile `jev`, else `jev=unreachable (<reason>)` on today's flags (`codex-exec`:
|
|
43
43
|
`sandbox=workspace-write`, network off; `codex-review`: `--sandbox read-only`); a run whose codex refuses
|
|
44
44
|
the profile exits 72. The `jev=`, `source=` (`model:<s>,effort:<s>`, each `default`, `setting` or
|
|
@@ -50,7 +50,7 @@ CLOSED pre-spend there) — informational, never part of a receipt or the banner
|
|
|
50
50
|
|
|
51
51
|
Use **`codex-exec`** when there is a concrete plan or focused instruction to implement, the project
|
|
52
52
|
declares Hard Constraints + gates in `AGENTS.md`, the work fits `workspace-write` with no network beyond
|
|
53
|
-
|
|
53
|
+
the run hosts its service-facts.txt lists, and you can review the resulting diff.
|
|
54
54
|
|
|
55
55
|
Use **`codex-review plan`** for a cold second opinion on a plan before executing it (risks, missing or
|
|
56
56
|
mis-ordered steps, scope creep, missing gates).
|
|
@@ -97,9 +97,9 @@ codex-exec --resume <session-id> <file|-> # explicit session id
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Resume continues the SAME codex session, so you avoid re-sending the original context. It runs through
|
|
100
|
-
the wrapper, which **re-establishes every invariant** (the subscription-only key rule — every
|
|
101
|
-
|
|
102
|
-
full posture via `-c`** — because `codex exec resume` resets the sandbox/approval/network posture and
|
|
100
|
+
the wrapper, which **re-establishes every invariant** (the subscription-only key rule — unset every
|
|
101
|
+
`*_API_KEY` except the passed variables its service-facts.txt lists — `--ignore-user-config`, the host
|
|
102
|
+
posture's model/effort) and **restates the full posture via `-c`** — because `codex exec resume` resets the sandbox/approval/network posture and
|
|
103
103
|
rejects `-s`/`--add-dir`/`-C`, the wrapper passes `-c approval_policy=never` and the posture it chooses
|
|
104
104
|
afresh for this run: the profile `jev`'s four overrides, or `-c sandbox_mode=workspace-write -c
|
|
105
105
|
sandbox_workspace_write.network_access=false`. A resume takes no passthrough flags and an
|
|
@@ -117,8 +117,7 @@ iterating on the same task; start a fresh `codex-exec` when the task changes.
|
|
|
117
117
|
boundary must be a real executable; the real git path is baked into the shim, not exposed as an env
|
|
118
118
|
var). `git config` is read-only too (blocked on a write flag or a `<name> <value>` set form). The
|
|
119
119
|
orchestrator commits after review.
|
|
120
|
-
- **New dependencies / network installs** are done by hand (exec reaches
|
|
121
|
-
`docs.typesafe.ai`), then codex is re-dispatched.
|
|
120
|
+
- **New dependencies / network installs** are done by hand (exec reaches only the run hosts its service-facts.txt lists), then codex is re-dispatched.
|
|
122
121
|
- **A hung run** is killed at `CODEX_HARD_TIMEOUT` (exec 3600s / review 1800s) and reported (exit
|
|
123
122
|
124/137); raise it for a known-healthy slow run.
|
|
124
123
|
|
|
@@ -9,7 +9,7 @@ wrapper commands are `codex-exec` and `codex-review`, backed by `bin/codex-exec.
|
|
|
9
9
|
|
|
10
10
|
| Level | Can write? | Network? | Wrapper that uses it |
|
|
11
11
|
|---|---|---|---|
|
|
12
|
-
| permissions profile `jev` | exec: the repository, `/tmp` and `$TMPDIR`; review: nothing |
|
|
12
|
+
| permissions profile `jev` | exec: the repository, `/tmp` and `$TMPDIR`; review: nothing | the run hosts its service-facts.txt lists | both wrappers on Linux with codex-cli 0.160.0 or newer (conditions below) |
|
|
13
13
|
| `read-only` | no | no | `codex-review`, the fallback (codex only reads + emits findings) |
|
|
14
14
|
| `workspace-write` | repository, `/tmp` and `$TMPDIR` | off (forced off) | `codex-exec`, the fallback (codex edits the repo) |
|
|
15
15
|
| `danger-full-access` | anywhere | yes | never used by this skill |
|
|
@@ -37,11 +37,11 @@ On Linux with codex-cli 0.160.0 or newer, from a repository outside every temp r
|
|
|
37
37
|
version and profile digest recorded as refused, the first two
|
|
38
38
|
posture flags (`--sandbox workspace-write` and the `network_access=false` override) give way to the
|
|
39
39
|
permissions profile `jev` — four overrides, never beside `--sandbox` or `sandbox_mode` (codex refuses
|
|
40
|
-
both together):
|
|
40
|
+
both together). Here `$run_domains` is the domain table rendered from the run hosts its service-facts.txt lists:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
-c default_permissions=jev -c permissions.jev.network.enabled=true \
|
|
44
|
-
-c
|
|
44
|
+
-c "permissions.jev.network.domains=$run_domains" \
|
|
45
45
|
-c 'permissions.jev.filesystem={":root"="read",":tmpdir"="write",":slash_tmp"="write",":workspace_roots"={"."="write"}}'
|
|
46
46
|
```
|
|
47
47
|
|
|
@@ -104,10 +104,9 @@ Note that `--skip-git-repo-check` (tier 2) only relaxes **codex's own** git-repo
|
|
|
104
104
|
preflight still **requires a git work tree and a root `AGENTS.md`** and STOPs first if either is
|
|
105
105
|
missing — passing it does not let `codex-exec` run outside a repo.
|
|
106
106
|
|
|
107
|
-
## Network
|
|
107
|
+
## Network
|
|
108
108
|
|
|
109
|
-
A run reaches
|
|
110
|
-
host; on today's flags `codex-exec` keeps the network off. Either way **new dependencies and any other
|
|
109
|
+
A run reaches the run hosts its service-facts.txt lists under the permissions profile `jev`; on today's flags `codex-exec` keeps the network off. Either way **new dependencies and any other
|
|
111
110
|
network step are installed by a human**, not by codex: if a task needs a new package, codex must STOP
|
|
112
111
|
and report it; the orchestrator installs it, then re-dispatches. The profile runs on Linux with
|
|
113
112
|
codex-cli 0.160.0 or newer, off a codex version and profile digest recorded as refused and, for
|
|
@@ -207,9 +206,8 @@ no-op — while `codex-review` **refuses pre-spend** (the fail-closed hard-timeo
|
|
|
207
206
|
|
|
208
207
|
Both wrappers, before invoking codex:
|
|
209
208
|
|
|
210
|
-
- **unset** `OPENAI_BASE_URL` and every `*_API_KEY` except
|
|
211
|
-
|
|
212
|
-
passes as given (empty stays empty, unset stays unset) and changes no flag;
|
|
209
|
+
- **unset** `OPENAI_BASE_URL` and every `*_API_KEY` except the passed variables its service-facts.txt lists,
|
|
210
|
+
so a stray key can't switch to paid api-key billing; those variables pass as given (empty stays empty, unset stays unset) and change no flag;
|
|
213
211
|
- pass **`--ignore-user-config`** so a personal `~/.codex/config.toml` cannot change behaviour. Auth
|
|
214
212
|
still works: codex reads the cached login from `CODEX_HOME` (`~/.codex`) regardless of that flag;
|
|
215
213
|
- preflight `codex login status` and refuse unless it contains `Logged in using ChatGPT`;
|
|
@@ -264,8 +262,7 @@ exec` over the precomputed diff instead, keeping every invariant intact.
|
|
|
264
262
|
from the target project root.
|
|
265
263
|
- **`exceeded the hard cap`** (exit 124/137): the run hit `CODEX_HARD_TIMEOUT` — raise it for a
|
|
266
264
|
known-healthy slow run, or narrow the task, then re-dispatch.
|
|
267
|
-
- **codex wants to install a dependency**: it can't (exec reaches
|
|
268
|
-
`docs.typesafe.ai`) — install it by hand, then re-dispatch.
|
|
265
|
+
- **codex wants to install a dependency**: it can't (exec reaches only the run hosts its service-facts.txt lists) — install it by hand, then re-dispatch.
|
|
269
266
|
- **exit 72**: codex refused the permissions profile `jev` (the message is on stderr). A refused profile
|
|
270
267
|
key, codex's error item before the first turn, is recorded for that wrapper's profile digest when the
|
|
271
268
|
state file can be written (otherwise the wrapper prints one warning naming the file), so that wrapper's
|
|
@@ -29,7 +29,7 @@ codex login status # expect: Logged in using ChatGPT
|
|
|
29
29
|
This caches credentials under `CODEX_HOME` (`~/.codex`, e.g. `~/.codex/auth.json`). That directory is
|
|
30
30
|
**personal** — never copy, commit, package, print, or share it. This skill needs **no API keys** and
|
|
31
31
|
must not be configured with api-key billing; both wrappers unset `OPENAI_BASE_URL` and every
|
|
32
|
-
`*_API_KEY` except
|
|
32
|
+
`*_API_KEY` except the passed variables its service-facts.txt lists (which pass as given) and pass
|
|
33
33
|
`--ignore-user-config`, so billing can never silently fall back to pay-as-you-go and a personal
|
|
34
34
|
`~/.codex/config.toml` can never change behaviour.
|
|
35
35
|
|
|
@@ -72,8 +72,8 @@ if it reports a missing git work tree or root `AGENTS.md`, run it from a project
|
|
|
72
72
|
- The wrappers are **subscription-only** by design and will not use api-key billing.
|
|
73
73
|
- `codex-exec` runs **workspace-write**; `codex-review` runs **read-only**. On Linux with codex-cli
|
|
74
74
|
0.160.0 or newer, off a codex version and profile digest recorded as refused and, for `codex-exec`, from
|
|
75
|
-
a repository outside every temp root, both carry the permissions profile `jev`, whose network reaches
|
|
76
|
-
|
|
75
|
+
a repository outside every temp root, both carry the permissions profile `jev`, whose network reaches the run hosts its service-facts.txt
|
|
76
|
+
lists; elsewhere the network stays off. They also run on the host posture — `CODEX_MODEL` / `CODEX_EFFORT` from the
|
|
77
77
|
bridge settings file, else `gpt-6.1-sol` / `high` — checked against the installed CLI's catalog,
|
|
78
78
|
and refuse a one-off model or effort unless `CODEX_PROBE=1` (see `../SKILL.md`), enforce a hard
|
|
79
79
|
timeout, capture only codex's final message, and block codex from writing git via a shim — see
|
package/capability.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sabaiway/agent-workflow-kit",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.2.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' 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.
|
|
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`, then from your own services list (`services.json` beside the bridge settings file, Mode: setup); it also seeds your list's excluded commands into `sandbox.excludedCommands`. Where the host honours the settings sandbox keys, an excluded wrapper, and each excluded command of your list, 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,7 +57,7 @@ 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 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.
|
|
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 and of your own services list + 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
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.
|
|
@@ -43,6 +43,8 @@ For each backend it:
|
|
|
43
43
|
2. **Links its wrappers** (`codex-exec` / `codex-review`; `agy-review` / `agy-run`) onto `--bindir` via **managed symlinks** — replacing only a symlink that already points at our source. A non-symlink or a foreign symlink → **STOP**; it **preflights every target first**, so a conflict on one wrapper makes **zero** changes. If `--bindir` is not on `PATH`, it prints the one-line `export PATH=…` to add — it never edits a shell rc.
|
|
44
44
|
3. **Guides the manual, secret-bearing steps it will NOT automate** — the binary install (each bridge's `setup/README.md` §1) and the one-time interactive subscription login (`codex login` / `agy`) — printing the exact command for whichever axis is still missing (axis-aware: it can ask for both the CLI and the login at once).
|
|
45
45
|
|
|
46
|
+
**Your own services list.** A service a bridge run must reach that the kit does not ship goes into one strict JSON file of your own, `services.json` beside the bridge settings file (`$XDG_CONFIG_HOME/agent-workflow/services.json`, default `~/.config/agent-workflow/services.json`); the kit only reads it. Its root maps a service id (lowercase letters, digits and `-`, starting with a letter, never a kit service id) to an object with exactly the six keys of a kit service fragment (`agent-workflow-kit/tools/services/`, schema in `${CLAUDE_SKILL_DIR}/tools/manifest/schema.md`): `hosts`, `writableDirs`, `excludedCommands`, `passedVariables`, `billingVariables`, `runReachesHosts`. A passed variable equal to any billing variable is refused. Every service in it joins every placed bridge, in two phases: (1) this step's place and every refresh (`init`, `/agent-workflow-kit upgrade`) write each placed bridge's `service-facts.txt` from the bridge's own services then yours; (2) the `velocity --bridge-tier` item adds your hosts, state dirs and excluded commands to the project `.claude/settings.json` for every used bridge. A list the loader refuses stops the place (`stop`) or the refresh (`could not refresh`) with zero writes in that bridge's folder, and stops the tier with zero writes: the line names the file — fix or remove it, then run the same step again. **Removal:** a service you delete from the list leaves each placed facts file at the next refresh; the sandbox entries the tier already added stay (the tier only adds) — remove them from `.claude/settings.json` yourself.
|
|
47
|
+
|
|
46
48
|
**Close-the-loop output (surface both, localized).** The tool prints, after the per-backend report:
|
|
47
49
|
- a **bridge version** on each skill line — `(vX)` for a fresh place / equal refresh, `(vOld → vNew)` when a refresh bumps the bridge (never `vnull → …`);
|
|
48
50
|
- a **status pointer** — the full family + deployment version view lives in `/agent-workflow-kit status`;
|
|
@@ -58,7 +58,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
58
58
|
current* / *skipped — not placed* / `skipped-readonly` / *could not refresh* + its recovery). It
|
|
59
59
|
is **refresh-only**: it refreshes a bridge **`setup` already placed** from this kit's bundled copies
|
|
60
60
|
and re-links its wrappers; an **absent** bridge is a stated skip, **never a first placement**
|
|
61
|
-
(placement stays the opt-in `${CLAUDE_SKILL_DIR}/references/modes/setup.md`
|
|
61
|
+
(placement stays the opt-in `${CLAUDE_SKILL_DIR}/references/modes/setup.md`), a placed bridge
|
|
62
62
|
**newer** than the bundle is a stated skip naming the kit update (**never a downgrade**), and
|
|
63
63
|
`skipped-readonly` is an equal-version re-sync a **read-only** skills dir blocked this session (a
|
|
64
64
|
stated skip, exit 0 — not a failure). That line never guesses at the tree: it carries one **proven**
|
|
@@ -69,8 +69,8 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
69
69
|
write, an incompatible node kind, a foreign wrapper target; those are named apart as
|
|
70
70
|
resolve-by-hand-then-rerun), or `unverifiable` (every uncomparable item **named**, the remaining
|
|
71
71
|
need for repair unknown). The line carries the exact cause per item — relay it as worded, never
|
|
72
|
-
soften `unverifiable` into "already fine", never relay a resolve-by-hand item as rerun-fixable
|
|
73
|
-
Runs on **every** upgrade
|
|
72
|
+
soften `unverifiable` into "already fine", never relay a resolve-by-hand item as rerun-fixable;
|
|
73
|
+
on `drifted`/`unverifiable` rerun it outside the sandbox. Runs on **every** upgrade
|
|
74
74
|
(equal-head too), no lineage-head bump; a *could not refresh* line is non-fatal — relay it plainly
|
|
75
75
|
with its recovery.
|
|
76
76
|
|
|
@@ -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> *` 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):
|
|
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`, then from your own services list (`services.json` beside the bridge settings file, Mode: setup), whose services every used bridge also gets — the single documentation source (this doc retypes no host list); a list its loader refuses stops the tier with zero writes, naming the file; 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.
|
|
@@ -185,7 +185,7 @@ export const scopeOf = (variant, facts, deps = {}) => {
|
|
|
185
185
|
if (variant === 'bridge-tier') {
|
|
186
186
|
const detect = deps.detect ?? facts.detect ?? (() => detectAtRoot(facts.root, { env: facts.env, home: facts.home }));
|
|
187
187
|
const used = usedBridges(loadConfig(facts.root).config, detect());
|
|
188
|
-
const recipe = bundledSandboxRecipe(used, { groundingAbsPath: join(facts.toolsDir, '..', KIT_GROUNDING_TOOL) });
|
|
188
|
+
const recipe = bundledSandboxRecipe(used, { env: facts.env, home: facts.home, groundingAbsPath: join(facts.toolsDir, '..', KIT_GROUNDING_TOOL) });
|
|
189
189
|
allow.push(...recipe.allow);
|
|
190
190
|
set('sandbox.excludedCommands', recipe.excludedCommands);
|
|
191
191
|
set('sandbox.network.allowedDomains', recipe.hosts);
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
// Dependency-free, Node >= 22. No side effects on import.
|
|
8
8
|
|
|
9
9
|
import { readFileSync, readdirSync } from 'node:fs';
|
|
10
|
+
import { homedir } from 'node:os';
|
|
10
11
|
import { dirname, join, resolve } from 'node:path';
|
|
11
12
|
import { fileURLToPath } from 'node:url';
|
|
12
|
-
import { DEFAULT_BUNDLE_ROOT } from './bridge-settings-read.mjs';
|
|
13
|
+
import { DEFAULT_BUNDLE_ROOT, userServicesFile } from './bridge-settings-read.mjs';
|
|
13
14
|
import { ACTIVITIES, BACKEND_PRIORITY, REVIEW_CMD_ALIASES } from './carriers.mjs';
|
|
14
15
|
import { planRecipe, resolveActivityRecipe } from './recipes.mjs';
|
|
15
16
|
import { isReadyMember } from './review-roster-resolve.mjs';
|
|
16
17
|
import { isSeedablePathToken } from './repo-lex.mjs';
|
|
17
|
-
import { loadServiceFragments, mergeServices } from './services/index.mjs';
|
|
18
|
+
import { loadServiceFragments, loadUserServices, mergeServices } from './services/index.mjs';
|
|
18
19
|
|
|
19
20
|
// The review wrappers, spelled bare as invoked. Only their `code` mode is auto-allowed: a bare
|
|
20
21
|
// `Bash(<wrapper>:*)` prefix would also cover the plan/diff file-argument modes, whose targets can
|
|
@@ -83,6 +84,9 @@ export const bundledSandboxRecipe = (used, deps = {}) => {
|
|
|
83
84
|
const readDir = deps.readdir ?? readdirSync;
|
|
84
85
|
const bundleRoot = deps.bundleRoot ?? DEFAULT_BUNDLE_ROOT;
|
|
85
86
|
const fragments = loadServiceFragments({ servicesDir: deps.servicesDir });
|
|
87
|
+
const userFragments = deps.userServices === false ? {} : loadUserServices(fragments, {
|
|
88
|
+
file: deps.userServicesFile ?? userServicesFile({ env: deps.env ?? process.env, home: deps.home ?? homedir() }),
|
|
89
|
+
});
|
|
86
90
|
const allow = [];
|
|
87
91
|
const excludedCommands = [];
|
|
88
92
|
const hosts = [];
|
|
@@ -119,7 +123,7 @@ export const bundledSandboxRecipe = (used, deps = {}) => {
|
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
|
-
const services = mergeServices(manifest.services ?? [], fragments);
|
|
126
|
+
const services = mergeServices(manifest.services ?? [], fragments, userFragments);
|
|
123
127
|
for (const command of services.excludedCommands) pushOnce(excludedCommands, command);
|
|
124
128
|
for (const host of services.hosts) pushOnce(hosts, host);
|
|
125
129
|
for (const entry of services.dirEntries) {
|
|
@@ -84,6 +84,8 @@ export const allowedLabel = (entry) => {
|
|
|
84
84
|
|
|
85
85
|
export const settingsDir = (ctx) => join(resolveDir(SETTINGS_XDG, ctx.getenv ?? process.env, ctx.home ?? homedir()), SETTINGS_SUBDIR);
|
|
86
86
|
export const settingsPath = (ctx) => join(settingsDir(ctx), SETTINGS_FILENAME);
|
|
87
|
+
export const userServicesFile = ({ env = process.env, home = homedir() } = {}) =>
|
|
88
|
+
join(resolveDir(SETTINGS_XDG, env, home), SETTINGS_SUBDIR, 'services.json');
|
|
87
89
|
|
|
88
90
|
// Lines with a single trailing newline normalized away, so edits operate on an exact line array and
|
|
89
91
|
// re-serialize with one trailing newline (comments/blank lines in the middle survive verbatim).
|
|
@@ -23,6 +23,7 @@ import { existsSync, statSync, accessSync, realpathSync, constants } from 'node:
|
|
|
23
23
|
import { join } from 'node:path';
|
|
24
24
|
import os from 'node:os';
|
|
25
25
|
import { isDirectRun } from './direct-run.mjs';
|
|
26
|
+
import { loadServiceFragments } from './services/index.mjs';
|
|
26
27
|
import { validateManifest, UNSUPPORTED, INVALID } from './manifest/validate.mjs';
|
|
27
28
|
|
|
28
29
|
// Probe states. `unknown` (a wrapped fs error) NEVER counts as present in any readiness rule.
|
|
@@ -50,7 +51,7 @@ const EXPECTED_KIND = 'execution-backend';
|
|
|
50
51
|
|
|
51
52
|
// The kit-owned registry: the per-backend facts the detector needs even when a bridge is NOT
|
|
52
53
|
// installed (no manifest on disk to read). Kept in lockstep with the in-repo manifests by the
|
|
53
|
-
// drift-guard test.
|
|
54
|
+
// drift-guard test. Credential directories come from the named service fragment.
|
|
54
55
|
// `roleCmds` is the role-keyed source of truth (role → the PATH wrapper cmd), mirroring each bridge
|
|
55
56
|
// manifest `roles[role].cmd`, drift-guarded. Two derivations ride on it, both drift-guarded against the
|
|
56
57
|
// manifests: `wrapperCmds` (the deduped set the readiness probe checks — a stale install missing one
|
|
@@ -85,7 +86,7 @@ const RAW_BACKENDS = [
|
|
|
85
86
|
'nested-sandbox limit: codex-exec ships its OWN OS sandbox (bwrap workspace-write) and cannot run nested inside a harness sandbox (the FS turns read-only) — route it OUTSIDE the harness sandbox (excludedCommands / a per-run consented bypass) on the OBSERVED bwrap/EPERM failure, never a preemptive blanket',
|
|
86
87
|
'exec posture banner: ONE stderr line before dispatch states the ACTUAL run posture — exec posture: model=… effort=… tier=… sandbox=jev-profile|workspace-write session=fresh|resume:<id> jev=… source=… timeout=… — from RESOLVED post-validation values; the resume id is validated pre-spend, control bytes in a model, effort, tier or timeout value refuse pre-spend, and a jev= reason shows a control byte as ?',
|
|
87
88
|
'threat model: the sidecar byte and grammar screens detect corrupted input under a trusted parent environment. A hostile parent environment — including exported shell functions or PATH substitution of core/backend commands — is outside the threat model and can substitute the backend itself. Targeted shadow-proof resolution protects banner/dispatch honesty from accidental shadowing; it is not an environment security boundary',
|
|
88
|
-
"the exec posture banner states what the run reaches in a jev= field:
|
|
89
|
+
"the exec posture banner states what the run reaches in a jev= field: the run hosts its service-facts.txt lists when the run carries the permissions profile `jev` (Linux, codex-cli 0.160.0 or newer, a repository outside every temp root, a version and profile digest not recorded as refused), else jev=unreachable (<reason>) on today's workspace-write flags with network off; a run whose codex refuses the profile exits 72 with no success receipt and, for a refused profile key, records its version and digest when the state file can be written, so the next run on them takes today's flags; then a banner-only source=model:<s>,effort:<s> field — where each value came from: default, setting or environment — then a banner-only timeout=<duration|uncapped> field — exactly the duration handed to timeout(1), uncapped when no timeout/gtimeout binary caps the run; INFORMATIONAL only: none of the three is persisted in a receipt or session sidecar",
|
|
89
90
|
'quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts',
|
|
90
91
|
'every-run nested-sandbox scan (DUAL policy, deliberately two different rules): the scan runs on EVERY completed run, not only a failed one, because a run that SURVIVES the nested-sandbox failure exits 0 with an ungrounded answer and nothing said so. Failed run (rc != 0): the existing loose whole-trace combination rule prints the recovery hint. Successful run (rc == 0): a warning fires ONLY on precise per-item evidence — both a sandbox-mechanism token AND a permission/read-only failure token inside the aggregated_output of ONE command_execution item whose failure is PROVEN (a nonzero exit_code, or the serialized status "failed"); a null exit_code is never failure by itself, tokens split across two items never fire, and a successful command\'s output never fires. The answer is printed FIRST on stdout, then the warning on stderr. HONEST RESIDUAL: the exit status does NOT change on that lane (a distinct nonzero exit would give a heuristic scan DENY polarity, refusing real work whenever the scan over-warns), so an orchestrator keying on exit status alone can still bank an ungrounded answer — the stderr warning is the signal',
|
|
91
92
|
],
|
|
@@ -99,7 +100,7 @@ const RAW_BACKENDS = [
|
|
|
99
100
|
continue: [],
|
|
100
101
|
receipt: 'side effect — a successful review appends one JSON receipt line to <git dir>/agent-workflow-review-receipts.jsonl (AW_REVIEW_RECEIPTS overrides): fingerprint = sha256 over the canonical uncommitted-state payload (staged diff + unstaged diff + untracked-not-ignored contents — the review-payload domain; never-committable untracked paths — character/block devices, FIFOs, sockets — are excluded from the domain entirely, untracked symlinks/directories ride as name-only notes) in code mode, the artifact-file sha256 in plan mode; durationS = integer wall-clock seconds from CLI start through verdict parsing and the wrapper prints review duration: <n>s; blocking = the count of [blocker] and [major] lines (schema mode: findings with either severity; a payload whose findings cannot be counted fails the run, no receipt); artifactPath = the normalized realpath on plan 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 parsed from the mandated literal verdict line (schema mode: the verdict field); always fresh:true (one-shot) + grounded:true (native AGENTS.md auto-merge, factsHash null); probe = whether the run relaxed the quality guards (CODEX_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, effort, tier} (tier null on the standard 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, and a posture value carrying control bytes refuses pre-spend in every mode; a run whose final message carries NO recognized \'Verdict: <ship|revise|rethink>\' line — empty or missing 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',
|
|
101
102
|
notes: [
|
|
102
|
-
'the review posture banner states what the run reaches in a jev= field:
|
|
103
|
+
'the review posture banner states what the run reaches in a jev= field: the run hosts its service-facts.txt lists when the run carries the read-only permissions profile `jev` (Linux, codex-cli 0.160.0 or newer, a version and profile digest not recorded as refused), else jev=unreachable (<reason>) under --sandbox read-only; a run whose codex refuses the profile exits 72 with no receipt; then a banner-only source=model:<s>,effort:<s> field — where each value came from: default, setting or environment — then a banner-only timeout=<duration> field — exactly the duration handed 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 none of the three fields enters the receipt posture or the D5 banner↔receipt parity',
|
|
103
104
|
'quote the posture banner verbatim when labeling this dispatch — the banner is the machine-stated posture; a prose re-type drifts',
|
|
104
105
|
],
|
|
105
106
|
},
|
|
@@ -108,7 +109,7 @@ const RAW_BACKENDS = [
|
|
|
108
109
|
// The per-backend receipt-deadline default (seconds) the capability block reports — the review
|
|
109
110
|
// wrapper's built-in hard cap (CODEX_HARD_TIMEOUT review default), an OFFLINE registry fact.
|
|
110
111
|
deadlineDefaultS: 1800,
|
|
111
|
-
credential: {
|
|
112
|
+
credential: { service: 'codex', file: 'auth.json' },
|
|
112
113
|
setupUrl: 'https://github.com/sabaiway/agent-workflow/blob/main/codex-cli-bridge/setup/README.md',
|
|
113
114
|
setupPathLocal: 'setup/README.md',
|
|
114
115
|
// The short canonical guided commands. Binary-install is platform-variant and longer, so it is
|
|
@@ -151,7 +152,7 @@ const RAW_BACKENDS = [
|
|
|
151
152
|
bin: 'agy',
|
|
152
153
|
// AGY_HARD_TIMEOUT's built-in review default is 30m — reported in seconds, an OFFLINE registry fact.
|
|
153
154
|
deadlineDefaultS: 1800,
|
|
154
|
-
credential: {
|
|
155
|
+
credential: { service: 'antigravity', file: 'antigravity-oauth-token' },
|
|
155
156
|
setupUrl: 'https://github.com/sabaiway/agent-workflow/blob/main/antigravity-cli-bridge/setup/README.md',
|
|
156
157
|
setupPathLocal: 'setup/README.md',
|
|
157
158
|
guide: { setupRef: 'antigravity-cli-bridge/setup/README.md', loginCmd: 'agy', verifyCmd: 'echo "say OK" | agy-run -' },
|
|
@@ -263,13 +264,19 @@ const probeFile = (file, deps = {}) => {
|
|
|
263
264
|
// "authed?" = existence of the credential-marker file (read-only). NEVER runs the subscription CLI.
|
|
264
265
|
// Report wording is "credentials present/missing/unknown", never "authenticated".
|
|
265
266
|
export const probeCredential = (entry, deps = {}) => {
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
deps.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
267
|
+
const service = entry.credential.service;
|
|
268
|
+
try {
|
|
269
|
+
const fragment = (deps.loadServiceFragments ?? loadServiceFragments)()?.[service];
|
|
270
|
+
if (!fragment) return { state: UNKNOWN, path: null, reason: `${service}: service fragment missing` };
|
|
271
|
+
if (!Array.isArray(fragment.writableDirs) || fragment.writableDirs.length !== 1) {
|
|
272
|
+
return { state: UNKNOWN, path: null, reason: `${service}: expected exactly one writableDirs entry` };
|
|
273
|
+
}
|
|
274
|
+
const dir = resolveDir(fragment.writableDirs[0], deps.getenv ?? process.env, deps.home ?? os.homedir());
|
|
275
|
+
const file = join(dir, entry.credential.file);
|
|
276
|
+
return { state: probeFile(file, deps), path: file };
|
|
277
|
+
} catch (error) {
|
|
278
|
+
return { state: UNKNOWN, path: null, reason: `${service}: ${error?.message ?? String(error)}` };
|
|
279
|
+
}
|
|
273
280
|
};
|
|
274
281
|
|
|
275
282
|
const computeReadiness = (manifestState, cli, credentials, wrappers) => {
|
|
@@ -348,7 +355,7 @@ export const detectBackend = (entry, deps = {}) => {
|
|
|
348
355
|
manifestReason,
|
|
349
356
|
skillDir: installed ? resolvedDir : null,
|
|
350
357
|
cli: { bin: entry.bin, state: cliProbe.state, path: cliProbe.path ?? null },
|
|
351
|
-
credentials: { state: credentials.state, path: credentials.path },
|
|
358
|
+
credentials: { state: credentials.state, path: credentials.path, ...(credentials.reason ? { reason: credentials.reason } : {}) },
|
|
352
359
|
wrappers,
|
|
353
360
|
readiness,
|
|
354
361
|
setupHint,
|
|
@@ -384,7 +391,7 @@ export const guideFor = (status) => {
|
|
|
384
391
|
if (status.credentials.state !== PRESENT) {
|
|
385
392
|
out.push({
|
|
386
393
|
need: 'credentials',
|
|
387
|
-
hint: `sign in once (subscription): ${guide?.loginCmd ?? 'see the setup README'} (verify: ${guide?.verifyCmd ?? 'see the setup README'})`,
|
|
394
|
+
hint: status.credentials.reason ?? `sign in once (subscription): ${guide?.loginCmd ?? 'see the setup README'} (verify: ${guide?.verifyCmd ?? 'see the setup README'})`,
|
|
388
395
|
});
|
|
389
396
|
}
|
|
390
397
|
return out;
|
|
@@ -400,6 +407,7 @@ const setupTarget = (s) => s.setupHint.local ?? s.setupHint.url;
|
|
|
400
407
|
// Next-step hint per readiness. Deliberately never says "authenticated"/"authed" — only
|
|
401
408
|
// "credentials present/missing" (detection is file-presence, not a live login check).
|
|
402
409
|
const nextStep = (s) => {
|
|
410
|
+
if (s.credentials.reason) return s.credentials.reason;
|
|
403
411
|
switch (s.readiness) {
|
|
404
412
|
case READY:
|
|
405
413
|
return null;
|
package/tools/fs-safe.mjs
CHANGED
|
@@ -71,14 +71,14 @@ export const assertContainedRealPath = (root, dest, deps = {}) => {
|
|
|
71
71
|
// Read-only write-boundary tagging (REFRESH-EROFS-HONESTY / AD-056). A DESTINATION-side write failure
|
|
72
72
|
// of the read-only class is TAGGED (err.readonlyWriteBoundary) so the refresh-only driver can classify
|
|
73
73
|
// an equal-version repair-on-rerun that cannot write as a STATED skip — never a false red. The tag is
|
|
74
|
-
// applied ONLY around
|
|
74
|
+
// applied ONLY around a write primitive, so a READ-side failure (bundle read / dir listing)
|
|
75
75
|
// is never absorbed: the degrade classifies at the write boundary, not by a broad err.code sniff over
|
|
76
76
|
// the whole copy. EROFS is destination-side by nature; mkdir/symlink write only the dest; an
|
|
77
77
|
// EACCES/EPERM at copyFile (which also READS the source) is destination-provable ONLY when the source
|
|
78
78
|
// is readable — else it is a source-side read failure that must stay loud.
|
|
79
79
|
const READONLY_WRITE_ERRNOS = new Set(['EROFS', 'EACCES', 'EPERM']);
|
|
80
80
|
export const isReadonlyWriteBoundary = (err) => Boolean(err && err.readonlyWriteBoundary);
|
|
81
|
-
const throwTaggedReadonly = (err, primitive, src, readFile) => {
|
|
81
|
+
export const throwTaggedReadonly = (err, primitive, src, readFile) => {
|
|
82
82
|
if (err && READONLY_WRITE_ERRNOS.has(err.code)) {
|
|
83
83
|
let destinationSide = err.code === 'EROFS' || primitive !== 'copyFile';
|
|
84
84
|
if (!destinationSide) {
|
package/tools/manifest/schema.md
CHANGED
|
@@ -98,8 +98,8 @@ drift-guarded set-equal to this block by the bridge `bin/*.test.mjs` suites (hel
|
|
|
98
98
|
|
|
99
99
|
`services` names the kit service fragments under `agent-workflow-kit/tools/services/` that the
|
|
100
100
|
bridge uses. The module's `mergeServices` supplies their hosts, state dirs and excluded commands.
|
|
101
|
-
A fragment is a closed object of
|
|
102
|
-
`passedVariables`, `runReachesHosts`), enforced by the module's loader in
|
|
101
|
+
A fragment is a closed object of six required keys (`hosts`, `writableDirs`, `excludedCommands`,
|
|
102
|
+
`passedVariables`, `billingVariables`, `runReachesHosts`), enforced by the module's loader in
|
|
103
103
|
[`../services/index.mjs`](../services/index.mjs); the host and state-dir rules are the ones these
|
|
104
104
|
retired manifest fields carried.
|
|
105
105
|
|
package/tools/refresh-parity.mjs
CHANGED
|
@@ -75,7 +75,7 @@ const probe = (path, fs) => {
|
|
|
75
75
|
// Plus `modes`: the placed mode of every node the walk actually reached as a regular file. It exists
|
|
76
76
|
// so the wrapper axis can judge a source's mode WITHOUT a second lstat of its own — a separate stat
|
|
77
77
|
// could traverse a symlinked ancestor this walk already refused, and produce a contradicting verdict.
|
|
78
|
-
export const scanBundleOwnedDrift = (bundleDir, skillDir, fs) => {
|
|
78
|
+
export const scanBundleOwnedDrift = (bundleDir, skillDir, fs, expectedBytes = {}) => {
|
|
79
79
|
const drifted = [];
|
|
80
80
|
const unreadable = [];
|
|
81
81
|
const absent = [];
|
|
@@ -126,7 +126,7 @@ export const scanBundleOwnedDrift = (bundleDir, skillDir, fs) => {
|
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
if (typeof placed.mode === 'number') modes.set(rel, placed.mode);
|
|
129
|
-
const srcBytes = fs.readFile(src);
|
|
129
|
+
const srcBytes = Object.hasOwn(expectedBytes, rel) ? expectedBytes[rel] : fs.readFile(src);
|
|
130
130
|
const destBytes = (() => {
|
|
131
131
|
try {
|
|
132
132
|
return fs.readFile(dest);
|
|
@@ -243,7 +243,7 @@ export const readonlySkipLine = (name, version, verdict) => {
|
|
|
243
243
|
// repair" over both would promise a repair that never happens.
|
|
244
244
|
const said = [];
|
|
245
245
|
if (verdict.drifted.length > 0) {
|
|
246
|
-
said.push(`A read-only re-scan found ${count(verdict.drifted)} still differing from the
|
|
246
|
+
said.push(`A read-only re-scan found ${count(verdict.drifted)} still differing from what the refresh writes: ` +
|
|
247
247
|
`${verdict.drifted.join(', ')} — ${READONLY_RERUN_HINT} to repair.`);
|
|
248
248
|
}
|
|
249
249
|
if (verdict.conflicts.length > 0) {
|