@sabaiway/agent-workflow-kit 1.47.0 → 1.48.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 +42 -0
- package/README.md +2 -2
- package/SKILL.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/agents/changelog-skeleton.md +1 -0
- package/references/agents/gate-triage.md +1 -0
- package/references/agents/mechanical-sweep.md +1 -0
- package/references/hooks/gate-approve.mjs +120 -18
- package/references/modes/hook.md +6 -1
- package/references/modes/recommendations.md +8 -6
- package/references/modes/velocity.md +4 -2
- package/tools/ack-write.mjs +186 -0
- package/tools/doc-parity.mjs +7 -0
- package/tools/gate-hook.mjs +193 -4
- package/tools/recommendations.mjs +171 -17
- package/tools/velocity-profile.mjs +13 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,48 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
|
|
|
4
4
|
is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
|
|
5
5
|
every `migrations/<version>-<slug>.md` newer than it, in semver order.
|
|
6
6
|
|
|
7
|
+
## 1.48.0 — Family-owned neutral ack store + read-prompt-economy hook lane (AD-055, the CLAUDE-CODE-HARNESS-FRICTION cluster)
|
|
8
|
+
|
|
9
|
+
A **feature** release (kit-only — engine 1.17.0, memory 2.3.0, bridges 2.7.0/2.6.0 unchanged) that
|
|
10
|
+
closes two sibling defects where the kit fought the Claude Code host surface. Both land under one ADR
|
|
11
|
+
(AD-055), two commit-anchored segments.
|
|
12
|
+
|
|
13
|
+
- **Part I — the neutral ack store relocates off the host settings schema.** The `sandbox-lane`
|
|
14
|
+
upgrade recommendation converged by writing `agentWorkflow.sandboxLaneAck` into
|
|
15
|
+
`.claude/settings.local.json` — an advertised apply path a Claude Code host blocks twice (the
|
|
16
|
+
Edit-tool settings validator rejects the unknown key; the command sandbox EROFS-denies
|
|
17
|
+
`.claude/settings*.json`). The neutral fingerprint acknowledgement now lives in a **family-owned
|
|
18
|
+
`docs/ai/acks.json`** no host validator guards, written by a new consent-gated **ack writer**
|
|
19
|
+
(`tools/ack-write.mjs`); the legacy settings-scope key is still read for one deprecation window
|
|
20
|
+
(until the next MAJOR). The recommendation's apply line is an executable writer one-liner again.
|
|
21
|
+
- **Part II — the read-prompt-economy hook lane kills read-side Bash prompts at the source.** A
|
|
22
|
+
Claude Code prefix allow rule can never match a `;`/`&&`/`|` COMPOUND even when every segment is
|
|
23
|
+
seeded, so routine read compounds still prompt. The placed gate hook gains an **opt-in read-lane**
|
|
24
|
+
(rung c): with `docs/ai/lanes.json` set to `{ "readLane": true }` (read live per call, fail-closed),
|
|
25
|
+
a command whose every separator-split segment is a plain frozen read-only core command with **zero
|
|
26
|
+
shell metaprogramming** is auto-approved — a conservative closed-world allow bounded by the audited
|
|
27
|
+
core (a standalone opt-in grant). `lanes.json` is a **separate** kit-owned file — `gates.json`, its
|
|
28
|
+
validators and the byte-mirrored template stay untouched. The residual guard (settings-allowed
|
|
29
|
+
singles) additionally trips the bash-5.3 funsub openers, a backslash-newline line-continuation
|
|
30
|
+
splice, and a de-spliced re-scan of quote/backslash/bracket/brace `--output` reconstruction.
|
|
31
|
+
- **`gate-hook --read-lane`** is the consent-gated writer for `lanes.json`: it verifies the placed
|
|
32
|
+
hook is byte-current **and** wired **and** at the deployment stamp head before enabling (a pre-1.48
|
|
33
|
+
hook never reads `lanes.json`), refusing a stale/unwired hook with the delete-to-reseed recovery
|
|
34
|
+
(absolute paths). The upgrade Recommendations advisor surfaces the **read-lane offer** once the hook
|
|
35
|
+
is placed+wired (RISK_NOTED, with a consent-moment posture note; ATTENTION variants when the placed
|
|
36
|
+
hook is stale or missing — no silent dark lane).
|
|
37
|
+
- **Canon honesty.** `velocity.md` (read-side invocation shape), `hook.md` (rung c + `lanes.json` +
|
|
38
|
+
the currency check + delete-to-reseed), the three cheap-agent templates (they grant no Bash — a
|
|
39
|
+
missing `Grep`/`Glob` falls back to the Read tool; a harness-forced Bash read stays plain-single),
|
|
40
|
+
and the README hook row.
|
|
41
|
+
|
|
42
|
+
Reviewed by the codex + agy council across three rounds (agy SHIP ×3; every fixable fold red-first);
|
|
43
|
+
the surviving word-construction-on-a-single major is a documented inherent-layer-residual — a
|
|
44
|
+
string-based residual guard cannot close every shell reconstruction of a write flag without a full
|
|
45
|
+
shell parser or an over-ASK that would defeat the read-prompt-economy goal (rung b is a trust-posture
|
|
46
|
+
convenience, not a sandbox). Dogfooded live on this host: the read-lane currency guard passed on the
|
|
47
|
+
re-placed 1.48 hook and wrote `lanes.json`.
|
|
48
|
+
|
|
7
49
|
## 1.47.0 — REPORT-FACTS train: live-fact report contract · batched ledger writer · version-sync wrapper lane · sandbox-lanes canon & bridge contract twins (AD-054)
|
|
8
50
|
|
|
9
51
|
A **feature** release (ships with engine 1.17.0, memory 2.3.0, bridges 2.7.0/2.6.0 bundled) that
|
package/README.md
CHANGED
|
@@ -240,12 +240,12 @@ file), or run the guarded `/agent-workflow-kit uninstall`.
|
|
|
240
240
|
| `/agent-workflow-kit grounding` | any time | **grounded-review facts assembler** — mechanizes populating `agy-review --facts @f`: slices your entry-point's **Hard Constraints** section verbatim (exactly one match, else a loud stop) and/or a plan's decision-bearing sections (`## Approach` + `## Verification` required, `## Decisions (locked)` when present; duplicates stop), under the same byte budget the agy wrapper enforces (minus `--reserve-bytes` for the artifact share), with a loud tail-trim on overflow. `--autonomy` (AD-044) appends the COMPUTED effective autonomy policy from the git-top `docs/ai/autonomy.json` (every red-line + per-activity level, stated source line; absent file → the computed defaults ARE the policy, exit 0; a malformed policy fails CLOSED, exit 1). `--ledger-summary` (AD-049) appends a COMPUTED review-ledger digest for the single in-flight segment (rounds · origins · classifications · verdicts · overrides — unrelated loops excluded), so the reviewer sees the loop's own history without hand-copying. Prints to stdout; `--out` writes **one scratch file only** — system-temp outside the repo ($TMPDIR / /tmp, rewritable) or a **fresh** gitignored in-repo path (create-only, exclusive write; an existing in-repo file, even gitignored, is refused — the `.env` clobber class); tracked, not-ignored-in-repo, other outside-repo, and symlink/non-regular destinations are all refused. Never commits, never runs a subscription CLI. |
|
|
241
241
|
| `/agent-workflow-kit review-ledger` | any time | **review-round ledger** — turns the review-loop stop rule into a **computed** signal: record each plan-execution review round, its triage, and any recorded **overrides** (`oracle-change` lifts named tampered test files; `red-proof` waives the observed-red proof for exactly one `testId`; v4 adds **`size-cap`** — the exact sanctioned magnitude for a surface over the diff cap, segment-scoped — all loud, durable, auditable waivers, never silent) into a JSONL ledger inside the git dir (never committable), and read the stop decision (`converged > resolved-residual > triage-required > continue`) from the records — never from a remembered rule. **Since v4 every record carries `base` = the HEAD commit and the whole loop is SEGMENT-scoped (AD-048):** round numbering, the caps, and every tooth reset ONLY at a gated commit — a multiphase plan records fully while round 4 within one segment stays refused; `gate-run` records (minted by `gates --record`) make gates-before-review a computed precondition; the triage class **`refuted`** is the honest phantom-finding lane (grounds mandatory); `--telemetry` renders counts-only gate-efficacy data across all loops and both ledgers. `--status` replaces the hand-composed per-round tally; `record --from-receipts` (AD-049) DRAFTS the `backends[]` from the current-fingerprint receipts (verdict per backend, counts from the supplied findings) instead of hand-composing them — a recipe-named backend with no receipt is a loud stop; a **`batch`** verb applies an ordered list of record/classify/override ops in ONE writer call (the prompt-economy lane — the whole envelope is validated structurally first with zero writes, then ops apply sequentially and fail-fast; prior ops stay recorded, append-only); `--check` is a fail-closed gate exit code for `docs/ai/gates.json` (by hand or via the consent-gated seeder). A `fixable-bug` triage **requires its red→green `testId`** (v1..v3 records stay valid on read — old records never enter a segment). The writer refuses a round (past the hard-max, while a triage is pending, or lacking a grounded review receipt) and refuses an override outside its single in-flight loop. Honest residual: records are forgeable — self-discipline, not a security boundary. Never commits, never runs a subscription CLI. |
|
|
242
242
|
| `/agent-workflow-kit fold-completeness` | any time | **fold-completeness gate** — attests the review loop's folded fixes were proven the HONEST way (no fix theater): the runner executes your suite ONCE under `NODE_V8_COVERAGE`, checks every changed executable line is **executed**, probes every bound `testId` N times (`AW_FOLD_RERUNS`), records content hashes, and scans the test surface for tamper; the `--red` verb observes a test FAILING on the pre-fold tree — **BEFORE the fix** — and mints an **observed-red receipt**. The read-only checker (`--status` / `--check`) then requires, per bound test: the receipt, receipt-precedes-run order, N/N-green probes, and content **custody** (the green test is byte-identical to the one seen failing) — the receipt+custody half waivable for exactly one `testId` by a recorded `red-proof` override; mixed/timed-out probes are QUARANTINE (never converted, no override); **v3 records carry `base` and the proof is segment-scoped (AD-048)** — a committed phase's custody obligations close with its commit, and a receipt never crosses a commit boundary; tampered pre-existing test files fail closed unless covered by a recorded `oracle-change` override. Honest residuals: coverage proves **execution, not assertion**, and records are forgeable — self-discipline, not a security boundary. v1 scope is JS/V8 (pluggable via `AW_FOLD_BOUND_CMD`): changed TS/JSX fails closed, docs/config changes are listed but never block, and **no mutation testing ships**. Wire the gate by hand — the consent-gated seeder deliberately does not offer it yet (JS-only hold). Never commits, never runs a subscription CLI. |
|
|
243
|
-
| `/agent-workflow-kit recommendations` | any time (every `upgrade` ends with it) | **read-only deployment advisor** (AD-044) — computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, OS sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter, an unacknowledged sandbox recipe) and renders **verdict-first**: one composed verdict line (does anything need attention?), then each item as **{severity · what · one-line benefit · the exact consent-gated apply one-liner}**. 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 only on your yes, surfacing each item's posture note first. 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); the
|
|
243
|
+
| `/agent-workflow-kit recommendations` | any time (every `upgrade` ends with it) | **read-only deployment advisor** (AD-044) — computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, OS sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter, an unacknowledged sandbox recipe) 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 (sandbox-lane only) · the exact consent-gated apply one-liner}**. 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 only on your yes, surfacing each item's posture note first. 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); the kit never seeds `sandbox.network.allowedDomains` / `filesystem.allowWrite` (**HAND-APPLY** territory), and the sandbox-lane item's convergence is a neutral fingerprint acknowledgement recorded by a consent-gated ack writer into `docs/ai/acks.json` — never a security key (the recipe is documented per bridge in `capability.json` `networkHosts` + `writableDirs`). `--cwd` is required (the target project is explicit); never writes, never commits, never runs a subscription CLI. |
|
|
244
244
|
| `/agent-workflow-kit doc-parity` | any time | **read-only doc-parity lint** (AD-049) — kills the doc-drift class where a mode-contract doc silently lags a code constant (a `--check` doc still reading `300` after the diff cap moved to `400`): a **closed, exported registry** binds each live constant (review caps, schema versions, the ledger's own class/scope vocabulary, and the autonomy-doctor EXIT/status/trusted-dir contract) to the exact token its `references/modes/*.md` contract must carry, and asserts the CURRENT value renders into every bound file — a drifted doc, an unreadable file, or an absent token **fails closed**. The values are sourced from the live imports (never re-typed), so the lint can't itself go stale; adding a binding is adding a checked entry (closed-world, edit-safe). `--check` is a gate exit code for `docs/ai/gates.json`. Never writes, never commits, never runs a subscription CLI. |
|
|
245
245
|
| `/agent-workflow-kit uninstall` | opt-in, any time | **guarded teardown** — the inverse of `init` / `setup`. Removes only what's **provably ours** (managed skill dirs + bridge wrappers; in a project, the hidden-mode git-ignore block it added + the pre-commit hook it installed); **never deletes** your `docs/ai` / `AGENTS.md` (prints the exact `rm` to run by hand) or your `.claude/settings.json` (prints an **edit** — remove the attribution key, review any velocity `permissions.*` — never an `rm`). Always `--dry-run` first; preflight-then-mutate; never commits. |
|
|
246
246
|
| `/agent-workflow-kit velocity` | Claude Code · opt-in | **onboarding velocity profile** — seeds a fixed, audited **read-only** allowlist into `.claude/settings.json` so routine read-only commands stop idling on approval prompts while you're away; opt-in `acceptEdits`; plus a **read-only advisory** of likely project gate commands to add by hand. Writes **only** `.claude/settings.json` — **never** allowlists commit/push/publish, never writes `settings.local.json`, never commits. A seeded entry is a **trust posture, not a sandbox** (a runtime residual remains at the settings level — its guard ships as the opt-in `hook` command); a direct commit/push/publish still asks. `--dry-run` first. |
|
|
247
247
|
| `/agent-workflow-kit agents` | Claude Code · opt-in | **cheap-lane subagents** — places bundled subagent definitions (`.claude/agents/`) pinned to a **cheap model** (haiku, low effort, read-only tools) for mechanical work: extraction sweeps, changelog fact-skeletons, gate-failure triage. Judgment, review, and real code stay on your main lane — these vehicles only extract and draft, and their output is verified. Preview by default (`--apply` writes); an existing customized file is **preserved, never overwritten**; never touches `settings*.json`, never commits. |
|
|
248
|
-
| `/agent-workflow-kit hook` | Claude Code · opt-in | **gate-approval hook** — places a self-contained PreToolUse hook (`.claude/hooks/`) and wires it into `.claude/settings.json`: a Bash command **byte-identical** to a gate you declared in `docs/ai/gates.json` (run from the project root) is auto-approved — no prompt, no idle; a seeded read-only command carrying a runtime residual (output redirection, command substitution, `--output` writes) now **asks** even where an allow rule would have silently passed it (proven live — hook `ask` overrides an allow rule). Exact matches only, never patterns; never `deny`; a broken `gates.json` only disables auto-approval, never the guard. Preview by default; never writes `settings.local.json`; never commits. |
|
|
248
|
+
| `/agent-workflow-kit hook` | Claude Code · opt-in | **gate-approval hook** — places a self-contained PreToolUse hook (`.claude/hooks/`) and wires it into `.claude/settings.json`: a Bash command **byte-identical** to a gate you declared in `docs/ai/gates.json` (run from the project root) is auto-approved — no prompt, no idle; a seeded read-only command carrying a runtime residual (output redirection, command substitution, `--output` writes) now **asks** even where an allow rule would have silently passed it (proven live — hook `ask` overrides an allow rule). Exact matches only, never patterns; never `deny`; a broken `gates.json` only disables auto-approval, never the guard. An opt-in **read-lane** (`--read-lane` → `docs/ai/lanes.json`, a **separate** file from `gates.json`) additionally auto-approves *compounds* of seeded read-only commands carrying no shell metaprogramming; `--apply --read-lane` verifies the placed hook is current first (delete-to-reseed otherwise). Preview by default; never writes `settings.local.json`; never commits. |
|
|
249
249
|
| `/agent-workflow-kit bridge-settings` | opt-in, any time | **host-level bridge settings** — read or change the bridges' `KEY=VALUE` config file (`${XDG_CONFIG_HOME:-~/.config}/agent-workflow/bridge-settings.conf`), the **one place a knob survives kit upgrades** (it lives outside every kit tree; a refresh never touches it, and now states loudly if it ever overwrote a local edit). First knobs: the **codex Fast tier** (`CODEX_SERVICE_TIER=priority` — ~1.5× speed at a **2.5× credit rate**, quality-neutral, default off — a consented spend), the codex/agy hard timeouts, the review byte cap, the oversized-review add-dir toggle. Allowed keys + value rules come from the bundled bridge manifests; **model/effort are never settable** (the quality guard is untouched). **Previews by default**; refuses an unknown key, an out-of-range value, or a duplicate-carrying file; writes atomically (symlink/TOCTOU-safe). Never commits, never runs a subscription CLI. |
|
|
250
250
|
| `/agent-workflow-kit autonomy-doctor` | opt-in, any time | **guarded sandbox provisioner "doctor"** — can this machine run the Claude sandbox, and (only with your consent) fix it: macOS Seatbelt built-in / Linux+WSL2 needs `bwrap`+`socat` / native Windows → WSL2. Flagless = **FS-only preview** (the diagnosis, the exact absolute-path command it WOULD run, the exact `--apply <pm>:<pkgs>` consent tuple — runs nothing, never claims ready); `--verify` runs the unprivileged proof (a `bwrap` user-namespace smoke + `socat -V`) — the **only** source of a Linux "ready (verified)" claim; `--apply <pm>:<pkgs>` is the consent-gated privileged install (the tuple must equal the previewed plan; everything executed resolves to absolute paths inside `/usr/bin:/bin:/usr/sbin:/sbin`; the exact command is re-printed immediately before execution), then verifies. Honest loud degrades (unknown PM, untrusted location, nested-sandbox INDETERMINATE, root-unproven) and a stated restart step. Sits **outside every velocity auto-approve tier**; never auto-runs, never writes repo files, never commits. |
|
|
251
251
|
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agent-workflow-kit
|
|
|
3
3
|
description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow".
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '1.
|
|
6
|
+
version: '1.48.0'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# agent-workflow-kit
|
package/capability.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sabaiway/agent-workflow-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.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",
|
|
@@ -21,3 +21,4 @@ Rules:
|
|
|
21
21
|
- Mark anything uncertain as `VERIFY:` rather than asserting it.
|
|
22
22
|
- No superlatives, no persuasion, no summary paragraph — that is the frontier's red-line work.
|
|
23
23
|
- Read-only: you never modify files.
|
|
24
|
+
- Tooling note: this vehicle grants `Read`/`Grep`/`Glob` only — **no `Bash`**. If a harness omits `Grep`/`Glob`, fall back to the `Read` tool (whole-file reads), never a shelled-out command. Should a harness nonetheless route your reads through `Bash`, keep each one a **plain single read-only command** (`grep …`, `ls …`, `cat …`) — never a `;`/`&&`/`|` chain, never `node -e`; where the maintainer enabled the opt-in **read-lane** (`docs/ai/lanes.json`), the gate hook keeps those seeded-read-only Bash reads promptless (it fires on subagent Bash too).
|
|
@@ -21,3 +21,4 @@ Rules:
|
|
|
21
21
|
- Output: one section per failing gate, ordered as the run reported them. No fix suggestions,
|
|
22
22
|
no root-cause speculation beyond the failure class, no code.
|
|
23
23
|
- Read-only: you never modify files, never re-run commands.
|
|
24
|
+
- Tooling note: this vehicle grants `Read`/`Grep`/`Glob` only — **no `Bash`**. If a harness omits `Grep`/`Glob`, fall back to the `Read` tool (whole-file reads), never a shelled-out command. Should a harness nonetheless route your reads through `Bash`, keep each one a **plain single read-only command** (`grep …`, `ls …`, `cat …`) — never a `;`/`&&`/`|` chain, never `node -e`; where the maintainer enabled the opt-in **read-lane** (`docs/ai/lanes.json`), the gate hook keeps those seeded-read-only Bash reads promptless (it fires on subagent Bash too).
|
|
@@ -18,3 +18,4 @@ Rules:
|
|
|
18
18
|
- Output format: the structure the prompt asks for (list / table / JSON). No preamble, no
|
|
19
19
|
commentary, no recommendations — the orchestrator applies judgment, you supply facts.
|
|
20
20
|
- Read-only: you never modify files, never run commands, never propose edits.
|
|
21
|
+
- Tooling note: this vehicle grants `Read`/`Grep`/`Glob` only — **no `Bash`**. If a harness omits `Grep`/`Glob`, fall back to the `Read` tool (whole-file reads), never a shelled-out command. Should a harness nonetheless route your reads through `Bash`, keep each one a **plain single read-only command** (`grep …`, `ls …`, `cat …`) — never a `;`/`&&`/`|` chain, never `node -e`; where the maintainer enabled the opt-in **read-lane** (`docs/ai/lanes.json`), the gate hook keeps those seeded-read-only Bash reads promptless (it fires on subagent Bash too).
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
// RUNTIME_RESIDUAL_FORMS — drift-guarded by the kit's test/gate-hook-core-parity.test.mjs.
|
|
12
12
|
//
|
|
13
13
|
// It reads <project root>/docs/ai/gates.json LIVE on every invocation (AD-035: one declaration,
|
|
14
|
-
// two consumers — editing gates.json never requires re-wiring)
|
|
15
|
-
//
|
|
16
|
-
//
|
|
14
|
+
// two consumers — editing gates.json never requires re-wiring) and, for the opt-in read-lane
|
|
15
|
+
// (rung c), <project root>/docs/ai/lanes.json LIVE as well (AD-055 Part II — a SEPARATE kit-owned
|
|
16
|
+
// file; gates.json, both its validators and the byte-mirrored template stay untouched). The project
|
|
17
|
+
// root resolves from $CLAUDE_PROJECT_DIR (the stdin `cwd` may be a subdirectory), falling back to
|
|
18
|
+
// the stdin `cwd` only when the env is absent.
|
|
17
19
|
//
|
|
18
20
|
// Decision ladder for every Bash PreToolUse call — first match wins:
|
|
19
21
|
// (a) declared-gate EXACT match → allow. Byte-identical (leading/trailing trim only — no
|
|
@@ -31,13 +33,20 @@
|
|
|
31
33
|
// and conservative (no shell parsing in a dependency-free hook): a quoted metacharacter
|
|
32
34
|
// may over-ASK, never under-allow. Covers the kit-SEEDED core only, never arbitrary
|
|
33
35
|
// user-added rules.
|
|
34
|
-
// (c)
|
|
36
|
+
// (c) read-lane allow (OPT-IN) → allow. Only when docs/ai/lanes.json enables it
|
|
37
|
+
// (`{ "readLane": true }`, read LIVE per call, fail-closed): a command every separator-split
|
|
38
|
+
// segment of which is a plain frozen read-only core prefix, with ZERO shell metaprogramming
|
|
39
|
+
// anywhere — a conservative CLOSED-WORLD allow (any doubt → fall through, never a widening).
|
|
40
|
+
// Mode-fenced like (a); cwd-agnostic (a read is a read from any directory). Runs AFTER (b),
|
|
41
|
+
// so a residual-carrying core command still ASKs (most-restrictive-wins by ladder order).
|
|
42
|
+
// (d) everything else → NO decision: exit 0, no output — the normal permission flow proceeds
|
|
35
43
|
// unchanged. The hook NEVER emits `deny`.
|
|
36
44
|
//
|
|
37
45
|
// Fail-safe invariant, decoupled per function: a DECLARATION anomaly (missing / unreadable /
|
|
38
46
|
// malformed / schema-invalid gates.json) disables ONLY exact-gate approval (a) — the residual
|
|
39
47
|
// guard (b) needs no declaration and keeps running (a broken gates.json must not silently
|
|
40
|
-
// reopen the seeded-allowlist hole).
|
|
48
|
+
// reopen the seeded-allowlist hole). A lanes.json anomaly (absent / malformed / non-boolean) merely
|
|
49
|
+
// leaves rung (c) DARK (fail-closed) — rungs (a)/(b) are unaffected. Only an INPUT anomaly (unparseable stdin, non-Bash
|
|
41
50
|
// tool_name) disables the whole hook. EVERY anomaly path exits 0 — never exit 2 (exit 2 is an
|
|
42
51
|
// immediate block; a hook that fires on every Bash call must never become the blocker or the
|
|
43
52
|
// noise — run-gates.mjs already yells about a broken declaration at its own point of use).
|
|
@@ -54,6 +63,10 @@ import { pathToFileURL } from 'node:url';
|
|
|
54
63
|
export const HOOK_EVENT_NAME = 'PreToolUse';
|
|
55
64
|
export const BASH_TOOL_NAME = 'Bash';
|
|
56
65
|
export const GATES_REL = 'docs/ai/gates.json';
|
|
66
|
+
// The opt-in read-lane toggle (rung c) — a SEPARATE kit-owned strict-JSON file (AD-055 Part II);
|
|
67
|
+
// gates.json's schema/validators/template are untouched by design.
|
|
68
|
+
export const LANES_REL = 'docs/ai/lanes.json';
|
|
69
|
+
export const READ_LANE_KEY = 'readLane';
|
|
57
70
|
export const PROJECT_DIR_ENV = 'CLAUDE_PROJECT_DIR';
|
|
58
71
|
export const DECISION_ALLOW = 'allow';
|
|
59
72
|
export const DECISION_ASK = 'ask';
|
|
@@ -103,8 +116,16 @@ export const RESIDUAL_FORMS = Object.freeze({
|
|
|
103
116
|
writeRedirections: Object.freeze(['>', '>>', '1>', '2>', '&>', '>|']),
|
|
104
117
|
// `$(…)` + backtick + process substitution `<(…)` all RUN a nested command (`>(…)` is caught by
|
|
105
118
|
// the `>` redirection scan). Bare `<` is input redirection (reads a file — read-only commands may
|
|
106
|
-
// already do that), so it is deliberately NOT here.
|
|
107
|
-
|
|
119
|
+
// already do that), so it is deliberately NOT here. The bash-5.3 function substitutions `${ cmd; }`
|
|
120
|
+
// (a blank — space/tab/newline/CR — right after `${`) and `${| cmd; }` also RUN a nested command —
|
|
121
|
+
// matched as the literal openers `${ ` / `${\t` / `${\n` / `${\r` / `${|` (AD-055 Part II). Ordinary
|
|
122
|
+
// `${VAR}` has no blank after `${`, so it trips none of these (kept rung-(b)-silent).
|
|
123
|
+
commandSubstitutions: Object.freeze(['$(', '`', '<(', '${ ', '${\t', '${\n', '${\r', '${|']),
|
|
124
|
+
// A backslash immediately before a newline/CR is a bash LINE CONTINUATION: bash removes it and
|
|
125
|
+
// splices the two lines into ONE word, reconstructing a residual token (`--output`, `$(`, `${ …; }`)
|
|
126
|
+
// a raw substring scan on the pre-splice string misses. Guards a settings-allowed SINGLE (rung c
|
|
127
|
+
// already forbids backslash in every segment). AD-055 Part II council fold.
|
|
128
|
+
lineContinuations: Object.freeze(['\\\n', '\\\r']),
|
|
108
129
|
// The `--output` write-flag family, matched as a raw SUBSTRING of the whole command (never a
|
|
109
130
|
// whitespace-token check): the hook sees the pre-shell command string, so `--output=f`,
|
|
110
131
|
// `"--output=f"`, `'--output' f`, and `\--output` must all trip it — over-asking on a benign
|
|
@@ -115,6 +136,7 @@ export const RESIDUAL_FORMS = Object.freeze({
|
|
|
115
136
|
export const RESIDUAL_CLASS_REDIRECTION = 'output redirection';
|
|
116
137
|
export const RESIDUAL_CLASS_SUBSTITUTION = 'command substitution';
|
|
117
138
|
export const RESIDUAL_CLASS_OUTPUT_FLAG = 'a bounded --output write flag';
|
|
139
|
+
export const RESIDUAL_CLASS_CONTINUATION = 'a line-continuation splice';
|
|
118
140
|
|
|
119
141
|
const EXIT_OK = 0;
|
|
120
142
|
const UTF8 = 'utf8';
|
|
@@ -170,6 +192,25 @@ export const readDeclarationGates = (projectRoot, deps = {}) => {
|
|
|
170
192
|
}
|
|
171
193
|
};
|
|
172
194
|
|
|
195
|
+
// Read the opt-in read-lane toggle LIVE per call — the gates.json live-read pattern, over the
|
|
196
|
+
// SEPARATE kit-owned docs/ai/lanes.json (Decisions 5). Fail-closed: an absent / unreadable /
|
|
197
|
+
// malformed / non-object file, or a `readLane` that is not the boolean literal `true`, leaves the
|
|
198
|
+
// lane DARK (returns false → rung (c) never fires; rungs (a)/(b) unaffected). Only an explicit
|
|
199
|
+
// `{ "readLane": true }` opens the lane. A PRE-1.48 placed hook never calls this, so enabling the
|
|
200
|
+
// lane against a stale placed copy is simply a no-op (the gate-hook writer's currency check makes
|
|
201
|
+
// that loud at consent time).
|
|
202
|
+
export const readReadLaneEnabled = (projectRoot, deps = {}) => {
|
|
203
|
+
const readFile = deps.readFile ?? readFileSync;
|
|
204
|
+
if (typeof projectRoot !== 'string' || projectRoot === '') return false;
|
|
205
|
+
try {
|
|
206
|
+
const parsed = JSON.parse(readFile(join(projectRoot, LANES_REL), UTF8));
|
|
207
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) return false;
|
|
208
|
+
return parsed[READ_LANE_KEY] === true;
|
|
209
|
+
} catch {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
173
214
|
// ── seeded-core prefix + residual detection (ladder b) ────────────────────────────────
|
|
174
215
|
|
|
175
216
|
const getAllowCommandPrefix = (pattern) => {
|
|
@@ -200,23 +241,75 @@ export const matchSeededCorePrefix = (command) => {
|
|
|
200
241
|
// substring scan (never a whitespace-token check — a token check misses `"--output=f"` / `'>' f`
|
|
201
242
|
// where the quotes are still in the string but the shell will strip them). A quoted metacharacter
|
|
202
243
|
// or write flag may over-ASK, never under-allow (no shell parsing in a dependency-free hook).
|
|
244
|
+
// Word-construction — quoting (`"`/`'`), backslash, brace, glob (`[]`/`{}`/`*`/`?`) — can splice a
|
|
245
|
+
// residual token back together AFTER a raw substring scan: `--out"put"=f` / `--outpu[t]=f` /
|
|
246
|
+
// `--out{put}=f` all collapse to `--output=f` when Bash strips the construction (council R2-M1). The
|
|
247
|
+
// scan re-runs against a DE-SPLICED copy (those characters removed) so a settings-allowed SINGLE
|
|
248
|
+
// carrying such a reconstruction still trips. De-splicing only ever ADDS matches — over-ASK, the safe
|
|
249
|
+
// direction (rung (c) forbids every construction character per segment, so this guards rung (b) singles).
|
|
250
|
+
const WORD_CONSTRUCTION_CHARS = /["'\\[\]{}*?]/gu;
|
|
251
|
+
|
|
203
252
|
export const detectResidualClasses = (command) => {
|
|
253
|
+
const deSpliced = command.replace(WORD_CONSTRUCTION_CHARS, '');
|
|
254
|
+
const scan = (form) => command.includes(form) || deSpliced.includes(form);
|
|
204
255
|
const classes = [];
|
|
205
|
-
if (RESIDUAL_FORMS.writeRedirections.some(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (RESIDUAL_FORMS.
|
|
209
|
-
classes.push(RESIDUAL_CLASS_SUBSTITUTION);
|
|
210
|
-
}
|
|
211
|
-
if (RESIDUAL_FORMS.boundedWriteFlags.some((flag) => command.includes(flag))) {
|
|
212
|
-
classes.push(RESIDUAL_CLASS_OUTPUT_FLAG);
|
|
213
|
-
}
|
|
256
|
+
if (RESIDUAL_FORMS.writeRedirections.some(scan)) classes.push(RESIDUAL_CLASS_REDIRECTION);
|
|
257
|
+
if (RESIDUAL_FORMS.commandSubstitutions.some(scan)) classes.push(RESIDUAL_CLASS_SUBSTITUTION);
|
|
258
|
+
if (RESIDUAL_FORMS.boundedWriteFlags.some(scan)) classes.push(RESIDUAL_CLASS_OUTPUT_FLAG);
|
|
259
|
+
if (RESIDUAL_FORMS.lineContinuations.some(scan)) classes.push(RESIDUAL_CLASS_CONTINUATION);
|
|
214
260
|
return classes;
|
|
215
261
|
};
|
|
216
262
|
|
|
263
|
+
// ── read-lane classifier (ladder c; Decisions 6-8) ────────────────────────────────────
|
|
264
|
+
// The opt-in read-lane's closed-world allow: a command is lane-safe ONLY when it is a compound (or
|
|
265
|
+
// single) of frozen read-only core commands with ZERO shell metaprogramming anywhere. Conservative
|
|
266
|
+
// by construction — any doubt returns false (no decision; the command keeps today's flow, the hook
|
|
267
|
+
// still never denies). The lane is BOUNDED BY THE FROZEN AUDITED read-only core (the set velocity
|
|
268
|
+
// seeds) — a standalone opt-in grant, never a command OUTSIDE that audited core. Enabling it
|
|
269
|
+
// auto-approves compounds (and singles) of that audited core REGARDLESS of which of those commands
|
|
270
|
+
// the user seeded as individual settings rules (the opt-in consent covers exactly the audited core,
|
|
271
|
+
// not strictly a subset of the current settings).
|
|
272
|
+
|
|
273
|
+
// Documented command separators (bash / Claude Code): the split points between independently-run
|
|
274
|
+
// segments. Longest-first so `&&`/`||`/`|&` win over the bare `|`; newline + CR included. No capture
|
|
275
|
+
// groups → `String.split` drops the separators. A bare `&` (backgrounding) is deliberately ABSENT
|
|
276
|
+
// here — it is caught as a forbidden per-segment character (so `ls & grep x` never rides the lane).
|
|
277
|
+
const LANE_SEPARATOR_PATTERN = /&&|\|\||\|&|;|\||\n|\r/u;
|
|
278
|
+
|
|
279
|
+
// Any of these characters in a post-split SEGMENT puts the whole command OUTSIDE the lane:
|
|
280
|
+
// expansion (`$`), substitution (backtick), quoting (`"` `'`), backslash splice (`\`), brace
|
|
281
|
+
// expansion (`{` `}`), glob (`*` `?` `[` `]`), redirection/subshell (`<` `>` `(` `)`),
|
|
282
|
+
// home/history/comment (`~` `!` `#`), and a leftover backgrounding/pipe operator (`&` `|`). The
|
|
283
|
+
// word-construction vectors (quote/backslash/brace/glob) are closed CONSERVATIVELY here — each can
|
|
284
|
+
// reconstruct a write/exec token after a raw scan (Decisions 7; the council B1 fold added the glob
|
|
285
|
+
// character-class brackets `[`/`]` after `--outpu[t]=f` was shown to reconstruct `--output`). The
|
|
286
|
+
// multi-char `--output` write flag is caught by detectResidualClasses over the raw string, not here.
|
|
287
|
+
const LANE_FORBIDDEN_SEGMENT_CHARS = Object.freeze([
|
|
288
|
+
'$', '`', '"', "'", '\\', '{', '}', '*', '?', '[', ']', '<', '>', '(', ')', '~', '!', '#', '&', '|',
|
|
289
|
+
]);
|
|
290
|
+
|
|
291
|
+
const hasForbiddenSegmentChar = (segment) => LANE_FORBIDDEN_SEGMENT_CHARS.some((ch) => segment.includes(ch));
|
|
292
|
+
|
|
293
|
+
// True iff every separator-split segment is a non-empty, metacharacter-free, frozen read-only core
|
|
294
|
+
// command. Quote-BLIND by design (the splitter never interprets quotes): over-splitting can only
|
|
295
|
+
// REDUCE the set of allowed commands, never widen it. An empty segment (adjacent/leading/trailing
|
|
296
|
+
// separator) never allows; a residual anywhere over the raw string (redirection, `$(`/backtick/`<(`,
|
|
297
|
+
// funsub, `--output`) takes the command out of the lane before the split even runs.
|
|
298
|
+
export const isReadLaneCommand = (command) => {
|
|
299
|
+
const trimmed = command.trim();
|
|
300
|
+
if (trimmed === '') return false;
|
|
301
|
+
if (detectResidualClasses(trimmed).length > 0) return false;
|
|
302
|
+
return trimmed.split(LANE_SEPARATOR_PATTERN).every((segment) => {
|
|
303
|
+
const seg = segment.trim();
|
|
304
|
+
if (seg === '') return false;
|
|
305
|
+
if (hasForbiddenSegmentChar(seg)) return false;
|
|
306
|
+
return matchSeededCorePrefix(seg) !== null;
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
|
|
217
310
|
// ── the decision ladder (pure core) ───────────────────────────────────────────────────
|
|
218
311
|
|
|
219
|
-
export const decideBashCall = ({ command, permissionMode, cwdIsProjectRoot, gates }) => {
|
|
312
|
+
export const decideBashCall = ({ command, permissionMode, cwdIsProjectRoot, gates, readLaneOn = false }) => {
|
|
220
313
|
const trimmed = command.trim();
|
|
221
314
|
// (a) declared-gate exact match — all three invariants (declaration valid, cwd = project
|
|
222
315
|
// root, mode in the allow fence) must hold; otherwise fall through, never error.
|
|
@@ -240,7 +333,15 @@ export const decideBashCall = ({ command, permissionMode, cwdIsProjectRoot, gate
|
|
|
240
333
|
};
|
|
241
334
|
}
|
|
242
335
|
}
|
|
243
|
-
// (c)
|
|
336
|
+
// (c) read-lane allow — opt-in (lanes.json), mode-fenced like (a) but cwd-agnostic (a read is a
|
|
337
|
+
// read from any directory). Runs AFTER (b), so a residual-carrying core command still ASKs.
|
|
338
|
+
if (readLaneOn === true && ALLOW_PERMISSION_MODES.includes(permissionMode) && isReadLaneCommand(trimmed)) {
|
|
339
|
+
return {
|
|
340
|
+
permissionDecision: DECISION_ALLOW,
|
|
341
|
+
permissionDecisionReason: `agent-workflow read-lane: every command segment is a frozen read-only core prefix with no shell metaprogramming — auto-approved (opt-in ${LANES_REL})`,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
// (d) no decision — the normal permission flow proceeds unchanged.
|
|
244
345
|
return null;
|
|
245
346
|
};
|
|
246
347
|
|
|
@@ -285,6 +386,7 @@ export const runHook = (rawInput, deps = {}) => {
|
|
|
285
386
|
permissionMode: input.permission_mode,
|
|
286
387
|
cwdIsProjectRoot: rootReal !== null && cwdReal !== null && rootReal === cwdReal,
|
|
287
388
|
gates: readDeclarationGates(projectRoot, deps),
|
|
389
|
+
readLaneOn: readReadLaneEnabled(projectRoot, deps),
|
|
288
390
|
});
|
|
289
391
|
};
|
|
290
392
|
|
package/references/modes/hook.md
CHANGED
|
@@ -4,12 +4,15 @@ The opt-in **gate-approval PreToolUse hook** — the family's third `.claude/` w
|
|
|
4
4
|
|
|
5
5
|
- **Auto-approve** a command **byte-identical** (leading/trailing trim only — no whitespace collapsing, no quote/glob/variable interpretation, no prefix or pattern matching, ever: patterns are what made AD-021 auto-seeding rejected) to a gate `cmd` declared in `docs/ai/gates.json` — read **LIVE on every call** (editing gates.json never needs re-wiring; one declaration, two consumers with `${CLAUDE_SKILL_DIR}/references/modes/gates.md`) — invoked **from the project root** (gates run from the root by contract; the same bytes from a subdirectory are NOT approved) and under `default`/`acceptEdits` permission mode (an approval never loosens `plan`/`bypassPermissions`).
|
|
6
6
|
- **Ask** on a command whose leading tokens match the velocity **seeded read-only core** when it carries the documented runtime residual — output redirection, command substitution, or the bounded `--output` write-flag family — surfacing a human prompt even where a seeded allow rule would have silently approved (**hook `ask` overrides an allow rule — proven live**: on Claude Code 2.1.185 a seeded `Bash(git log:*)` silently wrote a file via `git log --output=…`; with the hook wired the same call prompts). Detection is string-level and conservative: a quoted metacharacter may over-ask, never under-allow.
|
|
7
|
+
- **Auto-approve a read-only COMPOUND** (opt-in — dark unless enabled): when `docs/ai/lanes.json` sets `{ "readLane": true }` (read **LIVE on every call**), a command whose EVERY separator-split segment is a plain seeded read-only core command, carrying **zero shell metaprogramming** anywhere (no `$`/expansion, quoting, backslash, brace, glob, redirection, substitution, `--output`, env-assignment prefix, or backgrounding), is auto-approved — a conservative **closed-world** allow (any doubt falls through, never a widening). Mode-fenced like gate auto-approval; **cwd-agnostic** (a read is a read from any directory). It runs AFTER the residual ask, so a core command that carries a residual still prompts (most-restrictive-wins). The lane is **bounded by the frozen audited read-only core** (the set velocity seeds) — a **standalone opt-in grant**, never a command OUTSIDE that audited core; enabling it auto-approves compounds (and singles) of that audited core **regardless of which of those commands you seeded** as individual settings rules (that is the trust the opt-in consent covers — not strictly a subset of your current settings).
|
|
7
8
|
- **Stay silent otherwise** — the normal permission flow proceeds unchanged. The hook **never emits `deny`**; nothing is hard-blocked.
|
|
8
9
|
|
|
9
10
|
**Honest residual status (AD-037):** current engine builds already intercept `>` redirection and `$()` substitution upstream (observed headless on 2.1.185); the **`--output` family was proven open** and is the seam this hook demonstrably closes. The guard still covers all three documented classes (defense-in-depth — engine behavior may vary across surfaces/versions). **Fail-safe, decoupled:** a missing/broken/invalid `gates.json` disables ONLY gate auto-approval — the residual guard keeps running; every anomaly path exits 0 (the hook is never the blocker or the noise — the `gates` runner reports a broken declaration at its own point of use). **Not a sandbox:** it closes the named residual for the seeded core and auto-approves declared gates; it does not police arbitrary commands or user-added rules.
|
|
10
11
|
|
|
11
12
|
**Trust posture (state it plainly when asking consent):** the hook removes the PROMPT only for commands the human already declared in `docs/ai/gates.json` — the same trust boundary as the `gates` runner, which executes them with the caller's privileges. **gates.json thereby becomes a privileged file**: whoever can edit it can get its commands auto-approved. An invalid declaration approves NOTHING (strict parse, exact validation parity with the runner).
|
|
12
13
|
|
|
14
|
+
**The read-lane (opt-in, AD-055 Part II).** The toggle lives in `docs/ai/lanes.json` — a **SEPARATE kit-owned strict-JSON file** (`{ "readLane": true }`); `docs/ai/gates.json`, both its validators and the byte-mirrored template are **untouched** (the gates schema has no lane/model/routing fields — that claim stays true). The hook reads `lanes.json` LIVE per call, **fail-closed**: an absent / malformed / non-object file, or a `readLane` that is not the boolean `true`, leaves the lane dark (gate auto-approval and the residual ask are unaffected). `lanes.json` becomes a **privileged file** exactly like `gates.json` — an auto-approved read chain runs **unattended** and can read any file you can (the same trust boundary as the audited read-only core velocity seeds, extended to compounds (and singles) of that core; **prompt-bypass only, never a sandbox bypass**). Enable it with `--read-lane` (below), which runs a **currency check** first: it refuses unless the PLACED hook is byte-identical to the current bundle — a **pre-1.48 hook never reads `lanes.json`**, so enabling the lane against a stale placed copy would be a silent no-op the user paid consent for. The stale-hook silent-blackout class is dead **by construction** (an old hook merely lacks the rung; nothing existing changes behavior); the currency refusal names the **delete-to-reseed** recovery (`rm .claude/hooks/agent-workflow-gates.mjs` + the `--apply` one-liner) — there is **no refresh-only hook lane** this release (a diverged wired copy stays preserved, unchanged).
|
|
15
|
+
|
|
13
16
|
**Version-status routing** like the other writer modes (stamp head `2.0.0`; `--apply` enforces it in code).
|
|
14
17
|
|
|
15
18
|
Run `node ${CLAUDE_SKILL_DIR}/tools/gate-hook.mjs [--dry-run | --apply] [--cwd <dir>]`:
|
|
@@ -19,6 +22,8 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/gate-hook.mjs [--dry-run | --apply] [--cwd <
|
|
|
19
22
|
3. **Only on an explicit yes**, re-run with `--apply`. It places the file FIRST, then wires settings (a wired-but-missing entry would error on every Bash call); merge-don't-clobber (foreign hooks/matchers/keys and existing permissions preserved; re-apply never duplicates); **settings hot-reload — the hook is active for new Bash calls, no session restart needed**. An identical existing file is *already current*; a diverged-but-already-wired file is reported, never clobbered or unwired.
|
|
20
23
|
4. **Hidden-mode deployments:** after apply, run the hide-footprint reconcile (`node ${CLAUDE_SKILL_DIR}/tools/hide-footprint.mjs --dir <project> --reconcile`) — `/.claude/hooks/` is in the known-footprint registry; the apply report reminds you.
|
|
21
24
|
|
|
22
|
-
**
|
|
25
|
+
**Enabling the read-lane:** `node ${CLAUDE_SKILL_DIR}/tools/gate-hook.mjs --read-lane [--dry-run | --apply] [--cwd <dir>]`. `--dry-run` (the default) previews the `lanes.json` edit, the hook-currency status, and the trust posture; `--apply --read-lane` runs the **currency check** (above), then writes `{ "readLane": true }` into `docs/ai/lanes.json` — create-if-absent, merge-preserve every key, symlink / non-regular refusal, malformed-JSON fail-closed, atomic. It **never touches** `.claude/settings.json` or `docs/ai/gates.json`. The upgrade Recommendations advisor surfaces this as the `read-lane` offer once the hook is placed **and** wired.
|
|
26
|
+
|
|
27
|
+
**Invariants:** the base flow writes ONLY `.claude/hooks/agent-workflow-gates.mjs` + `.claude/settings.json`; `--read-lane` writes ONLY `docs/ai/lanes.json` (never settings, never `gates.json`) · never `settings.local.json` · never commits · exact-match approval only (no patterns) · never `deny` · never auto-wired by `init`/`upgrade` (placement stays opt-in — the AD-011/AD-034 boundary: init/upgrade may refresh placed things, never place new ones).
|
|
23
28
|
|
|
24
29
|
**Exit codes:** `0` done / dry-run (incl. the reported diverged-but-wired state); `1` a precondition STOP; `2` bad arguments.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md
|
|
4
4
|
|
|
5
|
-
The **read-only deployment advisor** — the deterministic section every `upgrade` run ends with, also invocable on its own. It computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter, an unacknowledged sandbox recipe) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · the exact consent-gated apply one-liner}**. The tool computes deterministic English DATA; **you PRESENT the section in the user's conversational language** — every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings stay **byte-exact**; show the raw tool block on request (the AD-032 report-contract lane — the tool cannot know the dialogue language, so the language rendering is your presentation layer).
|
|
5
|
+
The **read-only deployment advisor** — the deterministic section every `upgrade` run ends with, also invocable on its own. It computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter, an unacknowledged sandbox recipe) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · an optional `recipe:` line (the `sandbox-lane` live recipe — egress hosts + resolved writable dirs — only) · the exact consent-gated apply one-liner}**. The tool computes deterministic English DATA; **you PRESENT the section in the user's conversational language** — every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings stay **byte-exact**; show the raw tool block on request (the AD-032 report-contract lane — the tool cannot know the dialogue language, so the language rendering is your presentation layer).
|
|
6
6
|
|
|
7
7
|
**Live host/session facts are tool-composed only.** Every fact this section states about the current
|
|
8
8
|
host or session — prompts fired, sandbox scope, whether a bypass was needed, network reachability,
|
|
@@ -15,20 +15,22 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root> [--
|
|
|
15
15
|
|
|
16
16
|
1. **`--cwd` is REQUIRED** — the target project is explicit, never inferred from the shell's current directory (a subdirectory invocation still advises on the named root).
|
|
17
17
|
2. **Verdict first (present-even-when-empty, opening at the `## Recommendations (agent-workflow)` header).** With everything optimal the body is exactly `no recommendations — flow optimal.` — the empty-state line ALONE is the verdict, zero added lines. Every other state opens the body with ONE verdict line composed from the frozen templates: `{K} item(s) need attention` leads when any item's severity is `attention` (a CONFIGURED declaration that is broken, drifted, degrading or invalid — the deployment needs review); `{N} optional recommendation(s), apply any you want` covers the `optional` class (offers to enable an unconfigured capability), led by `nothing is broken` ONLY when no item needs attention AND no probe check was skipped (a skipped probe could hide an attention-class problem — the claim never overreaches); `optimality NOT attested — {M} probe check(s) skipped` is appended last whenever probe checks were skipped. (The `(s)` invariant form IS the pinned pluralization — no singular/plural branching.) Items render attention-first, each tagged `needs attention:` / `optional:`. A failed probe renders as a stated `⚠ skipped item …` line — never a crash, never a fabricated item.
|
|
18
|
-
3. **The apply-through-agent lane — an explicit informed-consent checkpoint:** after presenting, OFFER to apply; the user selects items in plain language; for each selected item you **surface its posture note inline** where one exists (the per-item notes below cover exactly the risk-marked keys; for `sandbox-lane` the note INCLUDES the sandbox-lanes ladder — present the whole ladder inline at the consent moment, never as a bare pointer).
|
|
18
|
+
3. **The apply-through-agent lane — an explicit informed-consent checkpoint:** after presenting, OFFER to apply; the user selects items in plain language; for each selected item you **surface its posture note inline** where one exists (the per-item notes below cover exactly the risk-marked keys; for `sandbox-lane` the note INCLUDES the sandbox-lanes ladder — present the whole ladder inline at the consent moment, never as a bare pointer). The user **explicitly confirms**, and **only then** — **no command runs before confirmation** — do you run the rendered command. Do NOT infer safety from the presence or absence of an `--apply` flag: most items' rendered command IS the mutation and completes on that one run, **including a no-`--apply` mutation** such as `family-freshness`'s `npx … init`. Some items instead render a **dry-run preview** that changes nothing and prints an explicit follow-up `--apply`/mutating command to run NEXT (e.g. `sandbox-lane`'s ack-write — a NEUTRAL recipe fingerprint into the family-owned `docs/ai/acks.json`, never a security key — and the `gates-declaration` seeder): after the SAME confirmation you run that printed follow-up command — no second ask, no improvisation (each writer keeps its own consent semantics: previews, `--apply` flags, refusals). An item marked **HAND-APPLY** (e.g. `agy-adddir`) is **never run by you and never written by the kit** — hand the user its rendered line together with its posture note.
|
|
19
19
|
4. Registry strings (benefits + item texts) are frozen tool data, fact-true, ONE line under the pinned shape cap — posture/risk detail lives in the notes below at the consent moment, never inline in the overview. The dual velocity+security wording (`safer — blast radius bounded by the OS sandbox, not human attention`) rides ONLY the items with a real security delta (the autonomy render, the sandbox provisioning); the bridge-wrappers item claims **velocity only**.
|
|
20
20
|
|
|
21
21
|
**Per-item posture notes (the consent moment — surface BEFORE running or handing over the apply):**
|
|
22
22
|
|
|
23
23
|
- `agy-adddir` — enabling the add-dir offload re-enables the Issue-001 stall risk (the wrapper's hard timeout bounds it); with the knob off an oversized agy code review refuses instead. Risk profile: availability only, no security delta.
|
|
24
|
-
- `sandbox-lane` — surface this note TOGETHER with the sandbox-lanes ladder below (the ladder IS the practical half of the note — inline, never a pointer). Pure DISCOVERABILITY: it surfaces the manifest-declared observed session-sandbox recipe (egress hosts ∪ resolved writable state dirs — `networkHosts` ∪ `writableDirs` of the wired bridges' `capability.json`, the single documentation source) and converges on a NEUTRAL fingerprint acknowledgement (`"agentWorkflow": { "sandboxLaneAck": … }
|
|
24
|
+
- `sandbox-lane` — surface this note TOGETHER with the sandbox-lanes ladder below (the ladder IS the practical half of the note — inline, never a pointer). Pure DISCOVERABILITY: it surfaces the manifest-declared observed session-sandbox recipe (egress hosts ∪ resolved writable state dirs — `networkHosts` ∪ `writableDirs` of the wired bridges' `capability.json`, the single documentation source) and converges on a NEUTRAL fingerprint acknowledgement recorded by the consent-gated **ack writer** into the family-owned `docs/ai/acks.json` (`sandboxLaneAck`; a changed recipe re-fires the item). The store is family-owned so no host settings validator guards it (AD-055 relocated the ack off the Claude Code settings schema, which rejected the unknown key); the legacy `"agentWorkflow": { "sandboxLaneAck": … }` settings-scope key is still READ for one deprecation window (until the next kit MAJOR). It never claims the settings security keys take effect on any host class, never recommends writing them, and the kit never seeds `sandbox.network.allowedDomains` / `sandbox.filesystem.allowWrite` (bridge council 2026-07-11, both backends concur: a network pre-allow widens egress for EVERY sandboxed command; a write allowance on CLI state dirs would expose credential dirs). Posture history: an IDE-managed session sandbox was live-observed (2026-07-11/12) ignoring hand-applied settings security keys in BOTH scopes, and codex needs a writable HOME (EROFS `~/.codex` in-sandbox); whether a session's sandbox honors the settings keys is runtime-unknowable from the advisor (a denial-only signal) — which is exactly why the item states only detectable facts and no zero-prompt promise on any host class.
|
|
25
|
+
|
|
26
|
+
- `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 apply depends on state: when the lane is OFF, it is the `gate-hook --read-lane` preview (whose own currency check refuses a stale hook — a pre-1.48 hook never reads `lanes.json`); when the placed hook is STALE (an enabled lane over an old hook) or MISSING, the item instead surfaces a **delete-to-reseed** / re-place recovery (a destructive `rm` + `--apply`, an attention item — never the safe preview). Risk profile: a bounded read-only trust-posture extension — no write/exec exposure beyond the audited core.
|
|
25
27
|
|
|
26
28
|
**Sandbox lanes (what to DO with the `sandbox-lane` recipe, per host class):**
|
|
27
29
|
|
|
28
|
-
- **Settings-native sandbox** (the harness reads the `.claude/settings.json` sandbox keys): nothing beyond the `--bridge-tier` wiring — the tier's `excludedCommands` already routes the wrappers OUTSIDE the sandbox, so they never consult `allowedDomains`/`allowWrite`. Record the ack once the tier is confirmed.
|
|
29
|
-
- **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 manifest hosts + the resolved state dirs for the whole session) is an INFORMED WIDENING — it carries the same blast-radius class the settings security keys were rejected for (every sandboxed command in the session gains that egress and those writable credential dirs), acceptable only as the maintainer's deliberate choice for a review-heavy session; (3)
|
|
30
|
+
- **Settings-native sandbox** (the harness reads the `.claude/settings.json` sandbox keys): nothing beyond the `--bridge-tier` wiring — the tier's `excludedCommands` already routes the wrappers OUTSIDE the sandbox, so they never consult `allowedDomains`/`allowWrite`. Record the ack (the ack-write one-liner) once the tier is confirmed.
|
|
31
|
+
- **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 manifest hosts + the resolved state dirs for the whole session) is an INFORMED WIDENING — it carries the same blast-radius class the settings security keys were rejected for (every sandboxed command in the session gains that egress and those writable credential dirs), acceptable only as the maintainer's deliberate choice for a review-heavy session. Its **paste-ready hand-apply shape** (the kit never writes these keys) is, in `.claude/settings.json`, `"sandbox": { "network": { "allowedDomains": ["<egress host>", …] }, "filesystem": { "allowWrite": ["<writable state dir>", …] } }` — fill `<egress host>` / `<writable state dir>` from THIS recipe (the wired bridges' `capability.json` `networkHosts` ∪ resolved `writableDirs`); one consent then lands durably in config. (3) Else the per-run consented bypass. Record the ack (the ack-write one-liner) once a lane is chosen — choosing the bypass, or consciously declining, also counts.
|
|
30
32
|
- Either way the recipe is **observed-minimal, honestly incomplete** — a blocked host names itself at run time; extend by hand and re-ack (the fingerprint moves with the recipe, not with your extensions).
|
|
31
33
|
|
|
32
|
-
**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 · apply one-liners are cwd-independent (absolute tool paths + a pinned `--cwd`; the sandbox-provision item pins via a `cd <root> &&` prefix — the doctor reads its cwd; the ONE exception is the `set-autonomy` item, a conversational skill invocation explicitly labeled *run IN the target project*) · the kit never seeds `sandbox.network.allowedDomains` / `sandbox.filesystem.allowWrite` (hand-apply territory
|
|
34
|
+
**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 · apply one-liners are cwd-independent (absolute tool paths + a pinned `--cwd`; the sandbox-provision item pins via a `cd <root> &&` prefix — the doctor reads its cwd; the ONE exception is the `set-autonomy` item, a conversational skill invocation explicitly labeled *run IN the target project*) · the kit never seeds `sandbox.network.allowedDomains` / `sandbox.filesystem.allowWrite` (hand-apply territory) · the sandbox-lane convergence is a neutral acknowledgement recorded into `docs/ai/acks.json` by the consent-gated ack writer (the legacy settings-scope key read for one deprecation window), never a security key.
|
|
33
35
|
|
|
34
36
|
**Exit codes:** `0` report rendered (items or the empty state); `1` error (e.g. `--cwd` is not a directory); `2` usage.
|
|
@@ -25,13 +25,13 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/velocity-profile.mjs [--dry-run | --apply] [
|
|
|
25
25
|
- `node ${CLAUDE_SKILL_DIR}/tools/manifest/validate.mjs --strict <skill-dir>` (wildcard)
|
|
26
26
|
- `node ${CLAUDE_SKILL_DIR}/tools/release-scan.mjs <path>` (wildcard)
|
|
27
27
|
- `node ${CLAUDE_SKILL_DIR}/tools/run-gates.mjs --cwd ${PROJECT_ROOT}` — **EXACT byte-string only**, and honestly **project-exec, not read-only**: it runs YOUR declared `docs/ai/gates.json` commands — the same trust boundary the opt-in hook grants byte-exact per-cmd. A wildcard would be BROADER than that boundary (`--cwd <dir>` executes another project's declared gates), so the bare cwd-defaulting form, any other `--cwd`, `--only`, and **`--record`** forms all still prompt (`--record` WRITES a gate-run record into the review ledger — a recording run is never auto-approved, AD-048).
|
|
28
|
-
- Writer previews, **exact arg-free dry-run byte-strings only** (
|
|
28
|
+
- Writer previews, **exact arg-free dry-run byte-strings only** (the SEEDED tier byte-string is the arg-free preview of each): `node ${CLAUDE_SKILL_DIR}/tools/velocity-profile.mjs` · `node ${CLAUDE_SKILL_DIR}/tools/cheap-agents.mjs` · `node ${CLAUDE_SKILL_DIR}/tools/gate-hook.mjs` — every `--apply`/`--write`/`--yes` still prompts, always. (`gate-hook` also has a **`--read-lane`** flagged preview — the opt-in read-only compound lane, `${CLAUDE_SKILL_DIR}/references/modes/hook.md`; that flagged form is NOT the seeded arg-free byte-string, so it may **prompt once** — it IS a consent flow, stated, no silent cap.)
|
|
29
29
|
|
|
30
30
|
Honesty notes: tier entries get **NO PreToolUse-hook residual coverage** — the opt-in hook's residual ask-net guards only the seeded read-only CORE prefixes, so the tier rides the same settings-level residual posture as the core (redirection / command substitution are not inspectable at the settings layer; see the residual notice). A skill or project path that cannot survive UNQUOTED in a byte-exact rule (spaces, metacharacters, non-POSIX) **STOPs the tier up front with a clear error** — nothing is seeded. Anything you want covered beyond the tier — such paths, this repo's own relative-path spellings, other tools — stays a **BY-HAND add** to your settings, with the path your project actually reaches the kit by. Pre-existing `node …` allow entries that do NOT match the seeded tier byte-forms stay flagged by the advisory for hand review.
|
|
31
31
|
|
|
32
32
|
**Invariants:** creates `.claude/` if absent and writes **only** `.claude/settings.json` (no other file); **never** allowlists commit/push/publish; **never** writes `settings.local.json`; never commits; opt-in `acceptEdits`, never silent.
|
|
33
33
|
|
|
34
|
-
**The `--bridge-tier` (own opt-in, AD-044).** Seeds what a promptless council review run needs — BOTH surfaces: `permissions.allow` prefix rules AND the wrapper names in `sandbox.excludedCommands` (the harness runs an excluded command OUTSIDE the sandbox — the wrappers need network — so a plain allowlisted invocation triggers no sandbox-bypass approval). Both land in the **project** `.claude/settings.json` — the file this writer owns; 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 + a network prompt), so hand-wiring the local file is not a working substitute for this tier. **Honesty note:** a session whose sandbox is imposed by the harness runtime itself (e.g. an IDE-managed session sandbox) may ignore settings-level exclusions entirely — there the wrappers need the session-level sandbox config (or a per-run consented bypass); the tier's seeded posture is correct for the settings-native sandbox and simply prompts again elsewhere (fail-safe, never a silent widening). Each bridge's observed egress hosts are declared in its `capability.json` `networkHosts` — the single documentation source (observed-minimal — a blocked host names itself at run time; read the manifests, this doc deliberately retypes no host list). The kit **never seeds** `sandbox.network.allowedDomains` or `sandbox.filesystem.allowWrite` (bridge council 2026-07-11, both backends concur): a network pre-allow widens egress for EVERY sandboxed command, and a write allowance on CLI state dirs (`~/.codex`, `~/.gemini/…`) would make credential dirs writable to every sandboxed command. Per-bridge picture under a harness-managed sandbox (live-observed 2026-07-11/12): an IDE-managed session sandbox ignores hand-applied `sandbox.network.allowedDomains` / `sandbox.filesystem.allowWrite` in BOTH settings scopes — its own per-host network consents govern egress; the durable zero-prompt lanes there are the session/host sandbox config (hosts from `networkHosts` + the CLI state-dir writes) or the per-run consented bypass. codex additionally needs a writable HOME (EROFS `~/.codex`); note the apex-vs-wildcard nuance — an apex domain is NOT covered by its `*.`-wildcard form, so the manifests carry both forms where observed (the blocked host names itself at run time). The upgrade Recommendations advisor surfaces exactly this recipe (hosts ∪ resolved `writableDirs`) as the
|
|
34
|
+
**The `--bridge-tier` (own opt-in, AD-044).** Seeds what a promptless council review run needs — BOTH surfaces: `permissions.allow` prefix rules AND the wrapper names in `sandbox.excludedCommands` (the harness runs an excluded command OUTSIDE the sandbox — the wrappers need network — so a plain allowlisted invocation triggers no sandbox-bypass approval). Both land in the **project** `.claude/settings.json` — the file this writer owns; 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 + a network prompt), so hand-wiring the local file is not a working substitute for this tier. **Honesty note:** a session whose sandbox is imposed by the harness runtime itself (e.g. an IDE-managed session sandbox) may ignore settings-level exclusions entirely — there the wrappers need the session-level sandbox config (or a per-run consented bypass); the tier's seeded posture is correct for the settings-native sandbox and simply prompts again elsewhere (fail-safe, never a silent widening). Each bridge's observed egress hosts are declared in its `capability.json` `networkHosts` — the single documentation source (observed-minimal — a blocked host names itself at run time; read the manifests, this doc deliberately retypes no host list). The kit **never seeds** `sandbox.network.allowedDomains` or `sandbox.filesystem.allowWrite` (bridge council 2026-07-11, both backends concur): a network pre-allow widens egress for EVERY sandboxed command, and a write allowance on CLI state dirs (`~/.codex`, `~/.gemini/…`) would make credential dirs writable to every sandboxed command. Per-bridge picture under a harness-managed sandbox (live-observed 2026-07-11/12): an IDE-managed session sandbox ignores hand-applied `sandbox.network.allowedDomains` / `sandbox.filesystem.allowWrite` in BOTH settings scopes — its own per-host network consents govern egress; the durable zero-prompt lanes there are the session/host sandbox config (hosts from `networkHosts` + the CLI state-dir writes) or the per-run consented bypass. codex additionally needs a writable HOME (EROFS `~/.codex`); note the apex-vs-wildcard nuance — an apex domain is NOT covered by its `*.`-wildcard form, so the manifests carry both forms where observed (the blocked host names itself at run time). The upgrade Recommendations advisor surfaces exactly this recipe (hosts ∪ resolved `writableDirs`) as the `sandbox-lane` discoverability item — a consent-gated **ack writer** converging on a neutral fingerprint acknowledgement recorded into the family-owned `docs/ai/acks.json` (the kit still never seeds the security keys — those stay hand-apply), with the posture notes at the consent moment (`${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`). Membership is the FROZEN review-wrapper constant, **never** the execution/probe wrappers (`codex-exec`, `agy-run` keep their human prompt — delegated execution is not covered by this consent; codex-exec's nested-sandbox recovery is the canon's observed-failure lane, not a preemptive tier seed), and only the **`code` review mode** — a `plan`/`diff` invocation takes a file argument that can point OUTSIDE the repo, so those modes keep their prompt; each wrapper entry derives ONLY when its bridge is **placed on PATH** (an absent bridge is a stated skip). The seeded byte-forms (this list IS the documented-invocation source for the bridge tier):
|
|
35
35
|
|
|
36
36
|
- `Bash(codex-review code:*)` — the code-mode prefix, args wildcard; plus `codex-review` in `sandbox.excludedCommands`
|
|
37
37
|
- `Bash(agy-review code:*)` — the code-mode prefix, args wildcard; plus `agy-review` in `sandbox.excludedCommands`
|
|
@@ -41,6 +41,8 @@ Honesty notes: tier entries get **NO PreToolUse-hook residual coverage** — the
|
|
|
41
41
|
|
|
42
42
|
**Invocation shape (why a run still prompts):** a prefix allow rule matches only a **PLAIN invocation starting with the wrapper name** — `codex-review code`, `agy-review code --facts @f`. An env-var prefix (`AGY_PROBE=1 agy-review …`) or a compound chain (`agy-review … && …`; `;`-joined statements) can NEVER match a prefix rule (observed live); output redirects are fine. Drive the wrappers as plain single commands.
|
|
43
43
|
|
|
44
|
+
**Read-side invocation shape (why routine reads prompt, and the fix).** The same rule binds EVERY prefix allow entry, seeded read-only core included: a **compound chain** (`grep … && …`, `;`/`|`-joined reads), an **env-var prefix** (`FOO=bar grep …`), a **`$`/`${…}`/`$(…)` expansion**, or an **inline `node -e '…'`** never matches a prefix rule — so read *compounds* keep prompting at the settings layer even when each command is individually seeded. The mechanism that clears them is the opt-in **read-lane** in the PreToolUse hook (`${CLAUDE_SKILL_DIR}/references/modes/hook.md`): it auto-approves a compound whose every separator-split segment is a plain seeded read-only core command with **zero shell metaprogramming**. A scripted probe stays allow-listable by being a **WRITTEN scratch file run as `node <file>`** (a byte-exact declared gate, or a kit-tool tier entry) — **never** `node -e '…'`, which is unclassifiable and always prompts.
|
|
45
|
+
|
|
44
46
|
**Exit codes:** `0` done / dry-run; `1` a precondition STOP (stamp not current, unsafe mode, malformed settings, symlinked `.claude` / non-regular target); `2` bad arguments.
|
|
45
47
|
|
|
46
48
|
---
|