@sabaiway/agent-workflow-kit 16.0.0 → 16.1.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 +23 -0
- package/README.md +2 -2
- package/SKILL.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/advisor-writers.md +2 -2
- package/references/modes/agents.md +4 -4
- package/references/modes/recommendations.md +6 -4
- package/references/modes/upgrade.md +4 -4
- package/tools/apply-danger-check.mjs +7 -7
- package/tools/cheap-agents.mjs +44 -32
- package/tools/distribution-files/scripts.mjs +7 -3
- package/tools/ensure-configs.mjs +1 -1
- package/tools/ensure-executor.mjs +2 -2
- package/tools/init-project.mjs +2 -2
- package/tools/recommendations.mjs +19 -20
- package/tools/write-lanes.mjs +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ 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
|
+
## 16.1.0 — the agent writes a differing executor vehicle with no question: a new advisor lane `kit` (AD-207)
|
|
8
|
+
|
|
9
|
+
**A placed `.claude/agents/executor.md` that differs from the body derived from `docs/ai/vehicles.json` is now
|
|
10
|
+
written back with no question.** Before, the advisor's `executor-vehicle.differing` item waited for your pick and
|
|
11
|
+
your yes, and its apply ran the whole agents writer. Now it is the first item of a fourth lane, `lane: kit`: the agent
|
|
12
|
+
runs its check line in the sandbox, shows the result, and at once runs its apply line once outside the sandbox. The
|
|
13
|
+
harness's own dialog there is the only ask. The item reads `the placed executor vehicle differs from the body derived
|
|
14
|
+
from docs/ai/vehicles.json — the derived body is written with no question`.
|
|
15
|
+
|
|
16
|
+
- **One file, one form.** The item's form is the new `cheap-agents.mjs --executor`: it plans the executor alone and
|
|
17
|
+
reads no orchestration config, so its `--apply` writes `.claude/agents/executor.md` and no other file. The advisor,
|
|
18
|
+
the danger check and the apply judge the same dry run, and the check admits only that file. The other vehicles are
|
|
19
|
+
left byte for byte.
|
|
20
|
+
- **The executor's line names where to change it:** `.claude/agents/executor.md: differs from the body derived from the
|
|
21
|
+
vehicle settings — written with that body; its model and effort are set in docs/ai/vehicles.json` (on a dry run,
|
|
22
|
+
`would be written with that body`).
|
|
23
|
+
- **The verdict line counts a kit item in neither class.** With only kit items and no skipped check, it reads
|
|
24
|
+
`nothing is broken`.
|
|
25
|
+
- **`init` checks and applies the item on its one y**, as it does a harness item.
|
|
26
|
+
- **The texts say the same:** the executor ensure's `pending` line and the `ensure-configs.mjs` help, the advisor's
|
|
27
|
+
help, `references/advisor-writers.md`, the recommendations, upgrade and agents modes, and the README's
|
|
28
|
+
recommendations and velocity rows.
|
|
29
|
+
|
|
7
30
|
## 16.0.0 — the upgrade writes the spec layer current with no question; `--replace-custom` and the kept-aside copy retire (AD-206)
|
|
8
31
|
|
|
9
32
|
**MAJOR: the `--replace-custom` flag is removed, and the upgrade no longer asks a yes before it writes a spec-layer
|
package/README.md
CHANGED
|
@@ -257,12 +257,12 @@ file), or run the guarded `/agent-workflow-kit uninstall`.
|
|
|
257
257
|
| `/agent-workflow-kit core-evidence` | any time | **the ONE loop-evidence writer** (strip-the-kit) — every core evidence record lands in a single append-only JSONL store inside the git dir (never committable; versioned schema, latest-per-key supersession, byte-identical duplicates refused, malformed lines fail every reader closed). `red-proof "<file>#<pattern>"` declares an observed-red **BEFORE a bugfix** (N/N red runs + content custody + base + the pre-fix fingerprint; green/mixed/timeout are DISTINGUISHED refusals — nothing written); `degrade --backend --reason` is the ONLY escape for an unavailable review backend (per-tree, never all backends); `summary` renders the whole loop state statelessly (gate result · per-backend verdicts · red-proofs · degrades) — no ledger, no rounds, nothing remembered. Honest residual: records are forgeable — self-discipline, not a security boundary. Never commits, never runs a subscription CLI. |
|
|
258
258
|
| `/agent-workflow-kit coverage-check` | any time | **the final-run checker** (D3(c)+(d)) — **certifies coverage ONLY inside the `--final` run that owns the lcov** (ownership is exclusive by CONVENTION over the fixed path, not enforced — a concurrent writer to it is a stated residual, queued as LCOV-EXCLUSIVE-OWNERSHIP): an artifact on disk proves nothing about the tree it came from, so a standalone run prints its findings and states `attested=no` / `NO VERDICT` rather than a PASS (an lcov that predates an edit would otherwise certify a line the suite never executed). `attested=` claims a verdict was ISSUED, pass or fail — a run over uncovered lines still reads `attested=yes` and still exits 1, and a run whose coverage arm never executed (no lcov) reads `attested=no` even inside `--final`, because nothing was read and nothing is certified. The runner passes a nonce whose one-way commitment over `{nonce, fingerprint, base}` is the `final-start.attempt` it recorded; a context describing another tree, or matching no recorded attempt, is a REFUSAL, never a verdict. Findings are unchanged — reads the lcov the declared `unit-tests` gate produced at the FIXED git-dir path and fails on any uncovered CHANGED executable Node line (listed `file:line`; a changed file absent from the map is a file-level red; out-of-domain/unsupported files are LISTED — the claim narrowed honestly); VERIFIES every current-base red-proof declaration (bound test exists · custody hash unchanged · green N/N now · pre-fix fingerprint differs); prints `lcov-sha256=<hex|none>` of the exact bytes it consumed — the sha the `--final` receipt binds and re-hashes. An absent lcov is a LOUD `skipped-no-lcov`; a symlinked path is a refusal. `--check` is the gate exit code — declare it as the LAST gate (`run-gates --final` refuses otherwise). Read-only. |
|
|
259
259
|
| `/agent-workflow-kit commit-guard` | any time | **the read-only pre-commit guard** (D10) — makes the commit capture the whole current working tree, so «verified» and «about to be committed» are the same bytes (the receipt itself has a stated residual — see the mode doc). FIRST it refuses an **INDEX that lags the verified working tree** (the gates and the fingerprint describe the WORKING tree while `git commit` takes the INDEX alone, and the fingerprint cannot tell them apart — so a lagging index used to ship a strict subset of what was verified): unstaged tracked paths or reviewable untracked-not-ignored paths, named up to a bounded cap with the remainder stated, a dirty tracked **submodule** named separately with its own recovery, and fail-closed on an undecidable probe. This deliberately blocks a partial commit. Then it binds the LATEST completed `run-gates --final` receipt to the EXACT current tree: refuses on a missing/red/stale receipt, fingerprint drift under the run, a dangling later attempt, declaration content drift, evidence-hash or lcov drift, or unsatisfied review obligations (the same review-state decision, recomputed over a sanitized env — forged out-of-repo stores never satisfy). Re-runs NO gate or test. Wire it into `.git/hooks/pre-commit` (the installer writes the RESOLVED invocation). `git commit --no-verify` stays the stated residual. |
|
|
260
|
-
| `/agent-workflow-kit recommendations` | any time (every `upgrade` ends with it) | **read-only deployment advisor** (AD-044) — computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, OS sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter, a feature-spec layer never adopted) and renders **verdict-first**: one composed verdict line (does anything need attention?), then each item as **{severity · what · one-line benefit · an optional `recipe:` line (the bridge-tier item's missing-entries line — each missing entry by kind: allow rules, exclusions, hosts, state dirs, then what the execution wrapper codex-exec needs, then the host condition; the worktrees-dir ack fallback for a host that ignores the settings key, the agents hidden-mode reconcile follow-up, a user item's own facts, the spec-adoption decline preview, or another offer's decline preview) · the exact consent-gated apply one-liner}**; `references/advisor-writers.md` names each variant's writer or user step. The agent PRESENTS the section in the user's conversational language — every fact and count, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; raw tool block on request — and runs EXACTLY the rendered one-liners and the follow-up commands required by the mode doc, only on the answer authorizing that step — your yes to apply or your explicit decline to record it — with a second yes where the mode doc requires it, surfacing each item's posture note first. Renders **present-even-when-empty** (`no recommendations — flow optimal.`); a failed probe degrades to a stated skip line. Registry strings are fact-true frozen one-line data (posture/risk notes live in the mode doc at the consent moment); `velocity --bridge-tier` seeds the used bridges' review allow rules, `<wrapper> *` exclusions (`codex-exec *` where an execute slot delegates, keeping its permission prompt), declared hosts into `sandbox.network.allowedDomains`, and home-relative state dirs into `sandbox.filesystem.allowWrite`; hosts and dirs are declared per bridge in `capability.json` `networkHosts` + `writableDirs`, and the advisor's `bridge-tier` item counts and names each missing one. `--cwd` is required (the target project is explicit); writes nothing, never commits, never runs a subscription CLI. |
|
|
260
|
+
| `/agent-workflow-kit recommendations` | any time (every `upgrade` ends with it) | **read-only deployment advisor** (AD-044) — computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, OS sandbox unavailable, gates undeclared, bridge friction, sandbox-mask clutter, a feature-spec layer never adopted) and renders **verdict-first**: one composed verdict line (does anything need attention?), then each item as **{severity · what · one-line benefit · an optional `recipe:` line (the bridge-tier item's missing-entries line — each missing entry by kind: allow rules, exclusions, hosts, state dirs, then what the execution wrapper codex-exec needs, then the host condition; the worktrees-dir ack fallback for a host that ignores the settings key, the agents hidden-mode reconcile follow-up, a user item's own facts, the spec-adoption decline preview, or another offer's decline preview) · the exact consent-gated apply one-liner}**; `references/advisor-writers.md` names each variant's writer or user step. The agent PRESENTS the section in the user's conversational language — every fact and count, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; raw tool block on request — and runs EXACTLY the rendered one-liners and the follow-up commands required by the mode doc, only on the answer authorizing that step — your yes to apply or your explicit decline to record it — with a second yes where the mode doc requires it, surfacing each item's posture note first; a kit item it applies with no question, its check line first, the harness's own dialog the only ask, or the one plain step where auto mode refuses its check or apply. Renders **present-even-when-empty** (`no recommendations — flow optimal.`); a failed probe degrades to a stated skip line. Registry strings are fact-true frozen one-line data (posture/risk notes live in the mode doc at the consent moment); `velocity --bridge-tier` seeds the used bridges' review allow rules, `<wrapper> *` exclusions (`codex-exec *` where an execute slot delegates, keeping its permission prompt), declared hosts into `sandbox.network.allowedDomains`, and home-relative state dirs into `sandbox.filesystem.allowWrite`; hosts and dirs are declared per bridge in `capability.json` `networkHosts` + `writableDirs`, and the advisor's `bridge-tier` item counts and names each missing one. `--cwd` is required (the target project is explicit); writes nothing, never commits, never runs a subscription CLI. |
|
|
261
261
|
| `/agent-workflow-kit doc-parity` | any time | **read-only doc-parity lint** (AD-049) — kills the doc-drift class where a mode-contract doc silently lags a code constant (a `--check` doc still reading `300` after the diff cap moved to `400`): a **closed, exported registry** binds each live constant (review caps, schema versions, the ledger's own class/scope vocabulary, and the autonomy-doctor EXIT/status/trusted-dir contract) to the exact token its `references/modes/*.md` contract must carry, and asserts the CURRENT value renders into every bound file — a drifted doc, an unreadable file, or an absent token **fails closed**. The values are sourced from the live imports (never re-typed), so the lint can't itself go stale; adding a binding is adding a checked entry (closed-world, edit-safe). `--check` is the gate exit code a kit maintainer runs: the lint checks the kit's own package. Never writes, never commits, never runs a subscription CLI. |
|
|
262
262
|
| `/agent-workflow-kit dispatch` | any time | **the delegation engine** — makes "how much does delegating a sub-task actually buy?" a measured number instead of a feeling. `check <file>` validates a sub-task brief's contract block and exits 0/1 naming the first violated field — **form only**: whether the task is genuinely bounded, its design decided and its acceptance adequate stays your judgment, and a well-formed absurdity passes here by construction. `advise --step-class <c>` answers the question that comes BEFORE that one — which vehicle should carry this kind of sub-task, whether it is even present on this machine, and what the ledger has already recorded for threads of that class (finished, failed, closed without a fold, and still open — counted separately) — and it decides nothing: it refuses no dispatch, gates no verb, and a choice that diverges from the advice is noted rather than blocked. It reads the filesystem only: nothing is launched to find out what is installed, an absent ledger prints "no recorded history", an unreadable one prints the store's own words, and either way the advice still prints. The same block appears as a footer under a form-valid `check` — never under a refusal, so it can never hide one. `register` pre-registers an acceptance wave (step classes, pairing key, minimum observations per class, the mean and first-pass thresholds) so the bar can never be chosen after the results it judges — immutable per wave. `observe` records ONE hand-written observation (`solo-construction`, the baseline whose ratio is 1 by construction — except over a scope measuring zero bytes, which has no ratio at all and is recorded ineligible by name — or `self-reported`) — delegated numbers are never hand-written, they are derived. The writer verbs are where that derivation happens: `open` puts a delegated thread on the record with every mint-time field copied from the brief's own header, refusing a deadline the wrapper's cap plus its kill grace would not fit inside, and recording whether the tree it started from was clean against the thread's base — HEAD by default, or the tree `--checkpoint <oid>` names, so the second task of a story is measured over the first one's uncommitted work instead of opening dirty (a dirty one makes the result honestly unmeasurable rather than quietly counted), while `--task <brief>` also records which task brief the thread carries out and the files that brief lists, refusing, since the last commit, a task thread whose files overlap by path prefix those of an open task thread or of a folded thread of another brief (`files-overlap`), and a mix of the two kinds — an untasked open beside an open task thread or, for a `code` open of backend `codex`, after a task fold, and a task open beside an open untasked thread (`mixed-open`), refusing at open a Files path the snapshot scope can never hold (`task-files-scope`), and measuring a task thread over its files alone, so `return` and `fold` refuse a changed path that no open or folded task thread on the same base claims (`out-of-files`); `await` waits for that one dispatch to answer and writes nothing — only the finished receipt satisfies it, a run still holding the nonce means keep waiting, and a wait that runs out says so with its own exit code, names whether the deadline or your own timeout ended it, and authorizes nothing: a wait that ended without an answer is a question for you, never permission to dispatch again; `return` absorbs the receipt the wrapper minted — only a finished one, checked against the contract it actually ran, its deadline and its own report, and refused outright when the tree hides changes from git or moves while the return is being computed — and derives the bytes from git rather than from anyone's claim; `fold` is the acceptance, and it refuses if the tree moved since the return — precisely, it re-confirms **equality of the visible canonical payload**, which is a change detector rather than a cryptographic identity of the tree: under the default head base that payload's untracked section is unframed and carries no file mode, so a content or symlink target that imitates the marker opening the next entry can alias two trees, and making an untracked file executable moves nothing (both named as residuals in the mode doc, with the fix queued); under a checkpoint base it is one indexed diff that carries modes. A change set carrying a binary, a non-regular path, a submodule, or a symlink whose target is not valid UTF-8 is **refused** at `return` and `fold` — CONSERVATIVELY, rather than promise what the default head payload may not be able to follow — and the same refusals hold for a checkpoint thread. `degrade` closes a thread that never earned a fold, on the record and with its reason. `aggregate` prints one wave: the registered thresholds, every observation as context, and per step class the finished threads — a folded success with git-provable bytes contributes its ratio, one whose bytes are unprovable is excluded from the mean but still counts in the first-pass rate, and a failed thread, a degrade-closed one, or one folded after failing acceptance each count as a real zero. Below the registered minimum nothing is computed (insufficient); at or above it is computed and labeled PILOT evidence. It REFUSES rather than guessing: no pre-registration, an unfinished thread in scope, a recorded refusal-to-delegate that never opened a thread, or an ambiguous wave each stop the computation by name. `handoff-return --slug <s>` closes the worktree loop after `land --prepare`: it re-attests that main still holds exactly the prepared tree under the same HEAD (both recorded in the handoff at prepare time), prints the satellite handoff's user-owned content byte for byte with its boundaries, byte lengths and the main-owned destinations each part folds into, prints the handoff digest and both OIDs as its proof, states the after-the-fold order (a fold landed after the gates leaves them stale), and records ONE self-reported worktree-stream observation only when the whole prepared change set is measurable — a deletion, a rename, a symlink, a submodule or a mode-only change ends with a named NOT RECORDED instead, never a partial number. Appends only to its own ledger inside the git dir (never committable); it also writes `handoff-return`'s `write-tree` tree object and, for a checkpoint measurement, the leaf's OWN temporary index file and the blobs its forced adds store — never a ref, never the real index; never commits, never runs a subscription CLI. |
|
|
263
263
|
| `/agent-workflow-kit worktrees` | any time | **parallel feature worktrees** — run several features in DIFFERENT agent sessions on one repo, zero interference on working-tree files (the ONE exception is the dependency cache, below): `provision <slug> --plan <file>` creates a sibling git worktree on branch `aw/<slug>` and populates it (registry-derived footprint copy-if-missing — a tracked file is never overwritten; EXACTLY ONE seeded feature plan; the `handoff-<slug>.md` record from minute zero; `node_modules` symlinked where the link stays ignored — a shared MUTABLE dependency cache: writes through it hit MAIN's node_modules; for isolation run the printed isolated-install command (`--install` only PRINTS it; on `--resume` run the printed unlink-first recovery first — printed only for a link whose RAW TARGET is MAIN's `node_modules`, since a foreign or unreadable link is reported as such with no removal advised); absolute root-pinned gate commands rebased on untracked copies only, and only while their bytes equal the MAIN source or its rebased form — user-modified copies stay untouched); `list` is read-only (slug, branch, base, dirty, handoff); `prompt <slug>` is read-only too and re-prints the satellite's cold-start prompt — the same text `provision` ends its report with: where the worktree is, its ONE seeded plan, the handoff as the one channel back, MAIN's orientation (shared series index, landing) and, under its own heading because it is probed on the satellite, that checkout's install posture — every value derived LIVE rather than replayed from the frozen provision record, a recorded value that no longer matches NAMED as a divergence (with the cause its source makes likely) instead of printed as the runnable one, every offered command marked with WHO runs it (`MAIN $ …` for the landing, `HERE $ …` for this checkout's own install, a posture with nothing to run staying prose), and a control character in any rendered value a typed STOP rather than a forged prompt line; `land <slug> --prepare` locks the common git dir, fail-closes on divergence or incomplete satellite state, transfers the complete accepted satellite diff onto a CLEAN main, runs sync plus the declared gates, and reports HEAD/TRANSFER/PREPARED OIDs — the commit ALWAYS stays a dialogue ask; `cleanup <slug>` takes the same lock and removes a LANDED worktree only after live landed-verification against main HEAD, while `--abandon` is the ONE destructive arm (destroys unlanded work; **no preview step** on any writer). The parent dir is the `docs/ai/worktrees.json` `parentDir` setting (default: the repo's sibling parent); an unwritable parent prints the `worktrees-dir` check line: the agent applies the grant on your chat yes after the check, one entry in this copy's `.claude/settings.local.json`, never the committed project settings (`init` is the route you may take instead, and the ack is the fallback for a host that ignores the key), else the printed terminal command runs it. Never commits, never pushes, never runs a subscription CLI. |
|
|
264
264
|
| `/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. |
|
|
265
|
-
| `/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; every allowlist apply (flagless, `--kit-tools`, `--bridge-tier`) also seeds one `permissions.ask` rule, so all work can stay in auto mode: without it auto mode refuses a harness apply (the `apply:` line of each harness item the upgrade advisor renders) and you must leave auto mode for it; with it the harness shows its usual dialog — the rule allows nothing; opt-in `acceptEdits`; plus a **read-only advisory** of likely project gate commands to add by hand. Writes `.claude/settings.json`; a fourth opt-in, `--worktrees`, writes the worktrees grant into the local settings, `.claude/settings.local.json`, alone — **never** allowlists commit/push/publish, 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. |
|
|
265
|
+
| `/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; every allowlist apply (flagless, `--kit-tools`, `--bridge-tier`) also seeds one `permissions.ask` rule, so all work can stay in auto mode: without it auto mode refuses a harness or kit apply (the `apply:` line of each harness or kit item the upgrade advisor renders) and you must leave auto mode for it; with it the harness shows its usual dialog — the rule allows nothing; opt-in `acceptEdits`; plus a **read-only advisory** of likely project gate commands to add by hand. Writes `.claude/settings.json`; a fourth opt-in, `--worktrees`, writes the worktrees grant into the local settings, `.claude/settings.local.json`, alone — **never** allowlists commit/push/publish, 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. |
|
|
266
266
|
| `/agent-workflow-kit agents` | Claude Code · opt-in | **subagent vehicles** — places the five bundled subagent definitions into `.claude/agents/`: **four read-only vehicles + one full-tool `executor`**. **No read-only vehicle gets `Bash`**, and that is the load-bearing property: a read-only fan-out on a full-tool subagent shells out for facts it could have read, and every shelled command is an approval prompt you never needed to see. Three of the four ride a **cheap model** (haiku, low effort) for mechanical work — extraction sweeps, changelog fact-skeletons, gate-failure triage; the fourth, **`review-lens`**, is an ADDITIONAL independent read-only review opinion on code your configured backends have already seen (never a replacement for your plan or diff review recipe, advisory like every review; an epic is reviewed by the lens alone, whatever `epic.review` resolves to). The fifth, **`executor`** (all tools; model and effort from `docs/ai/vehicles.json`), is the ONE vehicle with a shell and the instrument behind the **Subagent** recipe: dispatched only for a bounded, file-disjoint execution / authoring / routine slice you verify afterwards — never for read-only work, never as a review backend, and it never commits. Its state (`placed` / `customized` / `unusable` / `missing`) is what a `subagent` slot's readiness resolves from. Writing code and running gates stay off the four read-only vehicles; the executor carries a bounded slice you re-verify on your main lane, and every vehicle's output is verified. Preview by default (`--apply` writes); an existing customized read-only vehicle or roster-derived lens is **preserved, never overwritten**; the executor's body and the bundled `review-lens`'s (opus / high by default, set in the file's optional `review-lens` section) are re-derived from `docs/ai/vehicles.json` (the earlier body is replaced); never touches `settings*.json`, never commits. |
|
|
267
267
|
| `/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). Detection is a conservative string scan, so it over-asks on a byte that is ordinary text — searching for `=>`, or a read wearing `2>/dev/null`, prompts. That is a documented open limit: 4.1.0 built three mechanisms to narrow it and removed all three in review, each counterexample kept as a test (see Mode: hook). 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; a stale or diverged placed hook is replaced by the reseed route (`--apply --reseed`, the bundled bytes in place). Preview by default; never writes `settings.local.json`; never commits. |
|
|
268
268
|
| `/agent-workflow-kit state-block-guard` | Claude Code · opt-in | **closing-block detector** — a `Stop` hook that reads the turn's final assistant message and warns when the closing state block is defective: the «what I need from you» slot answering *nothing* (a turn that ENDS always needs a resume, so the answer is false, not merely unhelpful), or a first-person promise of imminent work in a turn that is over. Judged on the slot's first clause, so a real ask followed by a clause break and "nothing else" passes, and a promise gated on something named passes; matching is word-bounded and Unicode-aware, quoted and fenced examples are stripped, and the last STARTED block decides — an incomplete tail counts as no block rather than falling back to an earlier one. A message carrying no block at all is silent unless you pass `--require-block` — this kit does not mandate the block, and a hook that runs every turn must not warn every turn. The judgement is lexical and the mode doc names every residual it leaves. **Detection, never prevention** — a `Stop` hook cannot un-send the message it judges; what it buys is that a silent recurrence becomes a visible one. Warns via `systemMessage` and **exits 0 on every path**: never `deny`, never blocks the stop, never re-enters the model. Reads nothing but the message, makes no network call, approves nothing. Its writer is `tools/state-block-hook.mjs`: it places the self-contained hook and merges its `Stop` entry into `.claude/settings.json` by the three merge cases, keeping every foreign hook — the agent applies it on the chat yes after the danger check. |
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agent-workflow-kit
|
|
|
3
3
|
description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '16.
|
|
6
|
+
version: '16.1.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": "16.
|
|
3
|
+
"version": "16.1.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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Advisor writers
|
|
2
2
|
|
|
3
|
-
`tools/write-lanes.mjs` is the one source of the advisor's variant set and lanes; each row below names a variant's lane and its writer — a harness form's file, a chat apply's writers or writer mode — or `user step`.
|
|
3
|
+
`tools/write-lanes.mjs` is the one source of the advisor's variant set and lanes; each row below names a variant's lane and its writer — a harness or kit form's file, a chat apply's writers or writer mode — or `user step`.
|
|
4
4
|
|
|
5
5
|
| variant | lane | writer |
|
|
6
6
|
| --- | --- | --- |
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
| mcp-channel.differing | harness | mcp.mjs |
|
|
38
38
|
| agents | harness | cheap-agents.mjs |
|
|
39
39
|
| executor-vehicle | harness | cheap-agents.mjs |
|
|
40
|
-
| executor-vehicle.differing |
|
|
40
|
+
| executor-vehicle.differing | kit | cheap-agents.mjs |
|
|
41
41
|
| attribution | harness | attribution.mjs |
|
|
42
42
|
| footprint-global | harness | hide-footprint.mjs |
|
|
43
43
|
| family-freshness | user | user step |
|
|
@@ -16,10 +16,10 @@ Writing code, running gates, and user-facing copy never move to these four vehic
|
|
|
16
16
|
|
|
17
17
|
**Its readiness is the vehicle FILE.** `surveyExecutorVehicle` answers exactly one of four states: **`placed`** (bytes equal to the body derived from `docs/ai/vehicles.json` at `.claude/agents/executor.md`), **`customized`** (a readable regular file whose frontmatter names `executor` and whose tools are not read-only), **`unusable`** (a symlink, a non-regular or unreadable file, one failing that check, or an unreadable `docs/ai/vehicles.json` — with the reason), **`missing`**. `placed` and `customized` are dispatchable; on `unusable` or `missing` a `subagent` slot **degrades to Solo** with a reason naming this mode's apply command (and `docs/ai/vehicles.json` when that file is unreadable). `/agent-workflow-kit status` shows the state in its `agents` block and the deployment advisor raises it when a configured slot names `subagent` and the vehicle is `unusable` or `missing` — that item is **`executor-vehicle`** (attention-class: a configured declaration that is broken), a DIFFERENT capability from this mode's placement offer (`agents`), which converges the moment nothing is left to place and the bundled review lens matches its derived body, and therefore can never observe a present-but-unusable vehicle. It is a claim about the FILE, never about the host: a Claude Code lane, like this mode itself.
|
|
18
18
|
|
|
19
|
-
Run `node ${CLAUDE_SKILL_DIR}/tools/cheap-agents.mjs [--dry-run | --apply] [--cwd <dir>]`:
|
|
19
|
+
Run `node ${CLAUDE_SKILL_DIR}/tools/cheap-agents.mjs [--dry-run | --apply] [--executor] [--cwd <dir>]`:
|
|
20
20
|
|
|
21
|
-
1. **`--dry-run` first, always** (the default — changes nothing). It previews, per bundled vehicle, whether it **would place** the file, finds it **already current**, or finds a **customized** file (different content) that will be **preserved, never overwritten** (delete the file to reseed it from the bundle) — except the executor and the bundled `review-lens`, whose differing bytes
|
|
22
|
-
2. **Only on an explicit yes**, re-run with `--apply`. It writes **only** under `.claude/agents/` — never `settings.json` / `settings.local.json`, never a commit. `--apply` is deployment-gated (the stamp must be at the lineage head) and symlink-safe (a symlinked project root / `.claude` / `.claude/agents` / target file is a STOP, in a `--dry-run` too).
|
|
23
|
-
3. **Hidden-mode deployments:** after apply
|
|
21
|
+
1. **`--dry-run` first, always** (the default — changes nothing). It previews, per bundled vehicle, whether it **would place** the file, finds it **already current**, or finds a **customized** file (different content) that will be **preserved, never overwritten** (delete the file to reseed it from the bundle) — except the executor and the bundled `review-lens`, whose differing bytes are rewritten on `--apply` with the body derived from `docs/ai/vehicles.json` (the earlier body is replaced, never preserved). The executor's line reads `.claude/agents/executor.md: differs from the body derived from the vehicle settings — would be written with that body; its model and effort are set in docs/ai/vehicles.json` (on `--apply`, `written with that body`). The lens takes its model and effort from that file's optional `review-lens` section — `opus` / `high` by default — and the report prints its posture line beside the executor's.
|
|
22
|
+
2. **Only on an explicit yes**, re-run with `--apply`. It writes **only** under `.claude/agents/` — never `settings.json` / `settings.local.json`, never a commit. `--apply` is deployment-gated (the stamp must be at the lineage head) and symlink-safe (a symlinked project root / `.claude` / `.claude/agents` / target file is a STOP, in a `--dry-run` too). **`--executor`** is the form of the advisor's `executor-vehicle.differing` kit item, which the agent applies with no question: it plans the executor alone and reads no orchestration config, so its `--apply` writes `.claude/agents/executor.md` and no other file.
|
|
23
|
+
3. **Hidden-mode deployments:** after an apply without `--executor`, run the hide-footprint reconcile (`node ${CLAUDE_SKILL_DIR}/tools/hide-footprint.mjs --dir <project> --reconcile`) so the placed files stay invisible to `git status` — `/.claude/agents/` is in the known-footprint registry; the apply report reminds you.
|
|
24
24
|
|
|
25
25
|
**Invariants:** writer (writes only `.claude/agents/`) · preview by default · a diverged existing file is reported and preserved, never clobbered — except the executor and the review lens, re-derived from `docs/ai/vehicles.json` on apply · never touches settings · never commits · **no READ-ONLY vehicle grants `Bash`, and exactly one bundled vehicle, `executor`, grants a shell** · the cheap-lane vehicles are pinned to `model: haiku` + `effort: low`, and the bundled review lens file is pinned OFF the cheap model (`opus` / `high`), its placed copy taking the posture `docs/ai/vehicles.json` sets — `opus` / `high` when unset (all content-tested).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md
|
|
6
6
|
|
|
7
|
-
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, a declared gate matrix that verifies nothing, bridge friction, sandbox-mask clutter, a configured `subagent` carrier whose executor vehicle cannot carry it, a difference from the reference profile the project has not declined, Jev not connected on this host, the Jev skill not installed for every agent) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · `lane: chat`, `lane: harness` or `lane: user` · an optional `recipe:` line (an item's own facts or its alternative, such as the `bridge-tier` missing-entries line or the `worktrees-dir` ack fallback) · a harness item's `check:` line before its apply slot · the apply slot: a chat one-liner, a harness item's apply line or a user item's own step}**. 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).
|
|
7
|
+
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, a declared gate matrix that verifies nothing, bridge friction, sandbox-mask clutter, a configured `subagent` carrier whose executor vehicle cannot carry it, a difference from the reference profile the project has not declined, Jev not connected on this host, the Jev skill not installed for every agent) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · `lane: chat`, `lane: harness`, `lane: kit` or `lane: user` · an optional `recipe:` line (an item's own facts or its alternative, such as the `bridge-tier` missing-entries line or the `worktrees-dir` ack fallback) · a harness or kit item's `check:` line before its apply slot · the apply slot: a chat one-liner, a harness or kit item's apply line or a user item's own step}**. 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).
|
|
8
8
|
|
|
9
9
|
**Live host/session facts are tool-composed only.** Every fact this section states about the current
|
|
10
10
|
host or session — prompts fired, sandbox scope, whether a bypass was needed, network reachability,
|
|
@@ -16,13 +16,15 @@ host/session facts* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`.
|
|
|
16
16
|
Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root> [--json]`:
|
|
17
17
|
|
|
18
18
|
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).
|
|
19
|
-
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.
|
|
20
|
-
3. **The apply-through-agent lane — an explicit informed-consent checkpoint:** the agent applies chat and harness items on the chat yes, harness items by the consent route below. A chat item is never retried outside the sandbox and every failure of a chat step is a STOP. A user item is the user's own step, handed over as worded with its posture note (e.g. `source-size.id-squatter`). 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 a chat item: 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 chat items' rendered command IS the mutation and completes on that one run, **including a no-`--apply` mutation** such as `spec-adoption`'s `ensure-configs --reconcile --only specs` (it writes an edited spec-layer file with the bundled body with no question, its line naming where an edit meant to last goes). 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. 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) — except profile-gap, whose apply line runs with --apply appended only on a second yes over the relayed preview. For `worktrees-dir` you apply the grant on the chat yes after its check, like every harness item, with no hand step to wait for; its `recipe:` line's `ack-write` preview is the ack fallback, run only on the user's word that the host ignores the settings key, instead of the grant, and against a trusted host NO no ack renders.
|
|
19
|
+
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. A kit item counts in neither class (applied with no pick): with only kit items and no skip the verdict is `nothing is broken` alone. (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.
|
|
20
|
+
3. **The apply-through-agent lane — an explicit informed-consent checkpoint:** the agent applies chat and harness items on the chat yes, harness items by the consent route below, and kit items with no question by the kit route below. A chat item is never retried outside the sandbox and every failure of a chat step is a STOP. A user item is the user's own step, handed over as worded with its posture note (e.g. `source-size.id-squatter`). 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 a chat item: 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 chat items' rendered command IS the mutation and completes on that one run, **including a no-`--apply` mutation** such as `spec-adoption`'s `ensure-configs --reconcile --only specs` (it writes an edited spec-layer file with the bundled body with no question, its line naming where an edit meant to last goes). 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. 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) — except profile-gap, whose apply line runs with --apply appended only on a second yes over the relayed preview. For `worktrees-dir` you apply the grant on the chat yes after its check, like every harness item, with no hand step to wait for; its `recipe:` line's `ack-write` preview is the ack fallback, run only on the user's word that the host ignores the settings key, instead of the grant, and against a trusted host NO no ack renders.
|
|
21
21
|
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**.
|
|
22
22
|
|
|
23
23
|
The **consent route** for a harness item: run its `check:` line in the sandbox and show its result. On the check's `masked:` line, say so and run that same check line once more outside the sandbox, so it re-judges in the apply's own environment; the yes is taken on the outside result. Take the user's yes on that result and run its `apply:` line with that result's digest once, outside the sandbox at once, so the harness asks at the point of action (with the apply ask rule seeded, its own dialog); never another line, never unseen. When velocity-core, kit-tools-tier or bridge-tier is among the user's picks (velocity-core preferred), check, confirm and apply it, or leave it pending, before any other pick's check runs, so its apply seeds the ask rule before the other harness applies. When the harness's auto mode refuses the check or the apply, say so and give the one plain step: leave auto mode for this one action (Shift+Tab in the terminal, the mode indicator in an editor) and say yes, or run `npx @sabaiway/agent-workflow-kit@latest init` in a terminal of your own. On the user's word, run the same line once more when they left auto mode, never another, never unseen; when they ran `init` instead, run the advisor again and offer only what is still pending, each through this route from its check (after a restart `init` asked for, the next session's upgrade does it). When that refusal hits the velocity-core, kit-tools-tier or bridge-tier pick taken first, run no other pick's check until the user answers the plain step. A check that refuses (exit 1) leaves the item unapplied and pending, its result shown; a changed digest (exit 5) applies nothing, shows the new result and asks a new yes. A no, a harness refusal and any other failure of a harness apply leave the item pending with its output shown, and the agent continues. `init`, run in a console from the project's folder, is the route the user may take instead.
|
|
24
24
|
|
|
25
|
-
**The
|
|
25
|
+
**The kit route** for a `lane: kit` item, which writes a kit file of a component the project already has: ask no question and wait for no pick. Before offering the other items, run each kit item's `check:` line in the sandbox and show its result, then at once run its `apply:` line with that result's digest once, outside the sandbox; the harness's own dialog there is its consent, which the kit cannot remove. A changed digest (exit 5) re-runs the check once and applies with its new digest, still with no question; every other outcome leaves the item pending with its output shown, and the agent goes on; an auto-mode refusal gets the one plain step above. `init` checks and applies it on its one y, as a harness item.
|
|
26
|
+
|
|
27
|
+
**The `executor-vehicle` item (the carrier the project already CONFIGURED — beside the `agents` offer, never the same item).** It fires on ONE pair of facts: a slot in `docs/ai/orchestration.json` names `subagent` while the executor vehicle (`.claude/agents/executor.md`) is `missing` or `unusable` — so every such slot silently degrades to solo. That is a configured declaration that is broken, hence **`attention`**, not an offer; its text names the state, its reason and how many configured slots are affected across the six activities (`plan-authoring`, `plan-execution`, `routine`, `feedback-triage`, `epic`, `task`), covering the subagent-capable slots `plan-authoring.author`, `plan-authoring.fold`, `plan-execution.execute`, `routine.carrier`, `epic.author`, `task.author` and `task.execute`. **`placed` renders NOTHING** (a working vehicle is not a recommendation); a differing executor body is the optional `executor-vehicle.differing` arm, a kit item the agent applies with no question, a config naming no `subagent` slot renders no base item, and a config the validated reader refuses is a stated **skip**, never an item computed over a shape nothing accepted. It is deliberately DISTINCT from the `agents` offer and the review-recipe probe, neither of which can observe this state. The agent applies it on the chat yes after the check; `init` previews the agents writer's own `cheap-agents.mjs` and applies it with `--apply` on the terminal yes as a route the user may take instead. Its `recipe:` line carries each precondition the advisor observes beside the apply slot, followed by the hidden-mode reconcile follow-up (`hide-footprint --reconcile`), for a hidden deployment only. Honest limit on convergence: the apply places an ABSENT vehicle, so it clears `missing`; it STOPs on a symlink, so on `unusable` the `recipe:` line names each refusal as a precondition; an executor whose frontmatter is invalid is re-derived by the apply itself. Risk profile: writes under `.claude/agents/` only — the executor's and the review lens's bodies re-derived from `docs/ai/vehicles.json` (the lens opus/high by default), every other vehicle create-only — never `settings.json`, never a commit.
|
|
26
28
|
|
|
27
29
|
**Per-item posture notes (the consent moment — surface BEFORE running or handing over the apply):**
|
|
28
30
|
|
|
@@ -41,7 +41,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
41
41
|
|
|
42
42
|
**What the autonomy-declaration ensure does.** `docs/ai/autonomy.json` must exist: created from `${CLAUDE_SKILL_DIR}/references/templates/autonomy.json` if missing (the kit's own template twin — a stale memory never silently loses the seed); **an existing file is preserved byte-for-byte** (a declared policy is authored content). The seed is SPARSE (the onboarding note only) and **defaults-equivalent** — deploying it never changes behavior (the computed defaults stay the policy until the user declares levels with `/agent-workflow-kit set-autonomy` or by hand).
|
|
43
43
|
|
|
44
|
-
**What the executor ensure does.** It never writes: a placed `.claude/agents/executor.md` whose bytes differ from the body derived from `docs/ai/vehicles.json` is `pending` — the advisor's `executor-vehicle.differing` item
|
|
44
|
+
**What the executor ensure does.** It never writes: a placed `.claude/agents/executor.md` whose bytes differ from the body derived from `docs/ai/vehicles.json` is `pending` — the advisor's `executor-vehicle.differing` item, which the agent applies with no question, writes the derived body — and an absent one is `not-placed` (the agents mode places it on consent).
|
|
45
45
|
|
|
46
46
|
**What the enforcement-script ensure does.** It judges every kit script — each `*.mjs` of `${CLAUDE_SKILL_DIR}/references/scripts/` but the spec-layer pairs — once the component is accepted: a kit script outside the seed names (memory's own copies) stands in `scripts/` as a regular file. Each file by proof, with no question and no copy kept: a shipped prior is refreshed, an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left. The hook installer and its two suites go first; a closing line says the commit hook runs the files written. A declined enforcement offer keeps the standing seed files current with the modules they import, places no other kit script (one line says so) and words that hook-run line as a condition. With no kit script there: `not-placed`, nothing written. **The ADR store, after the writes:** where the run judged the rotator, it runs `scripts/archive-decisions.mjs --ensure-current`, with no question, which brings the store current (an older layout moved) or writes nothing; its lines are relayed under `ADR store: `. A rotator that does not bring the store current is `failed` / `adr-store-not-current`, the scripts written above staying as written: its refusal stops the upgrade. Where the size practice measures `scripts/`, a write may grow a root past its record: the size check names its own reasoned `--write-baseline`. **Whether Node runs here is PROVEN, never proxied:** the ensure runs on a regular `package.json` at the root OR on any kit-seeded `scripts/*.mjs` already deployed; only when every probe answers absent does it report `skipped-no-node-evidence`, a line naming every probe it checked, while the config ensures still run; a probe that cannot be read is `failed` with the cause `node-evidence-unverifiable`, nothing written. **A `skipped-*` outcome whose stated reason this tool could itself disprove may not exist**. A deployed pre-commit hook takes a new installer body only when the installer next runs: the `enforcement` check line and apply, by the consent route, re-run it (it refuses a non-marker hook as always); until then `scripts/pre-commit.local` does not run.
|
|
47
47
|
|
|
@@ -115,12 +115,12 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
115
115
|
- **A skip line that contradicts the observed tree is a FINDING, never pasted as neutral.** Every ensure skip names the fact it proved (the probes that answered absent); if the tree you can see disproves that reason — a "no Node" skip beside deployed Node scripts, a "not deployed" skip beside a stamped `docs/ai` — do not relay the line as an outcome: raise it in the report as a defect of the tool, with the contradicting fact named, and stop short of any step that would build on the skip.
|
|
116
116
|
- **Report step 3's outcome in plain language** — for **each** `pointers` slot (workflow-methodology, orchestration-recipes and autonomy-policy) whether it was *added*, was *already present* (nothing changed), or was *skipped* (the soft-skip from step 3, with its reason — over the line limit / engine too old / the autonomy pointer's anchor absent), and each Memory Map row the same way (or *refreshed*); the **nine project-configuration ensure** (`configs`) lines exactly as the one ensure run composed them (the ensures and their outcome tokens are enumerated in step 3), each rendered in plain language: what was created, what was left exactly as the user wrote it, and — for a `failed` line — what stopped it; for the navigator, relay the **late** `--only index` line, not the early one; the **`gates-migration`** result — *nothing to migrate*, the shown plan *applied* on your explicit yes, or the plan *left unapplied* (consent not given), with any INERT checker or CUSTOMIZED entries named; the **placed-bridge refresh** (`bridges`) outcome — paste the tool's per-bridge lines verbatim (they are already plain: *refreshed* / *already current* / *skipped — not placed* / `skipped-readonly` with its re-scan verdict / *could not refresh* + recovery); the **agent-rules lens** (`lens`) outcome (*refreshed* / *already current* / *custom edit preserved + note* / *file absent* / *engine too old* / *over the line cap*) and the **Communication-section** outcome (its own set: refreshed / already current / custom preserved + note / section absent — noted / over the cap — refused) and the **story-sessions section** outcome (its own set: refreshed / already current / custom edit preserved + note / section absent — noted / over the file's line cap — refused); the **full-flow offer** (`tier`) lines; the **bridge-settings reconcile** (`bridge-settings`) outcome (paste the tool's line(s) verbatim); and, for a hidden deployment, whether the hidden-mode footprint (`footprint`) was *moved to project-local*, was *already project-local* (nothing changed), or needed a question (ambiguous visibility). Plain wording only — never the reconcile/slot/anchor/marker terms (the never-leak-kit-internals Gotcha — `${CLAUDE_SKILL_DIR}/references/shared/deploy-tail.md`).
|
|
117
117
|
- **Never surface the structure number on this exit.** Whatever step 3 did, do **not** recite the `docs/ai` structure version, the internal versioning vocabulary, or the two-axes note here — the number is inert on an equal-head exit; it belongs to *Version disclosure* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md` (shown at the never-downgrade STOP, the explicit status view, or on an explicit ask). Frame the success itself per the final bullet: if step 3 changed anything, say **what changed** in plain human terms; only a pure zero-diff no-op is *settings already current — no update needed*.
|
|
118
|
-
- **Render the mandatory Recommendations section — on this exit too, BEFORE the footer.** Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root>` and PRESENT its output — from the `## Recommendations (agent-workflow)` header — in the user's conversational language: every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; show the raw tool block on request. The section is present-even-when-empty (with everything optimal the body is exactly `no recommendations — flow optimal.`) and VERDICT-FIRST — the composed verdict line renders from the frozen templates `{K} item(s) need attention` / `nothing is broken` / `{N} optional recommendation(s), apply any you want` / `optimality NOT attested — {M} probe check(s) skipped`. Then OFFER the consent route: the user picks items in plain language; surface each picked item's posture note and get the explicit confirm; run its lane's rendered lines — chat: the one-liner; harness: the check line, then on the yes to its result the apply line; user: the user's own step — per the full consent route in `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`. Pinned order on this exit: Recommendations block → optional applies → report footer → the commit ask (the advisor/apply lane never lands after the commit ask).
|
|
119
|
-
- **Recommendations lanes — both exits.** The
|
|
118
|
+
- **Render the mandatory Recommendations section — on this exit too, BEFORE the footer.** Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root>` and PRESENT its output — from the `## Recommendations (agent-workflow)` header — in the user's conversational language: every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; show the raw tool block on request. The section is present-even-when-empty (with everything optimal the body is exactly `no recommendations — flow optimal.`) and VERDICT-FIRST — the composed verdict line renders from the frozen templates `{K} item(s) need attention` / `nothing is broken` / `{N} optional recommendation(s), apply any you want` / `optimality NOT attested — {M} probe check(s) skipped`. Then apply each kit item by the kit route, with no question: its check line in the sandbox, then at once its apply line once outside it. Then OFFER the consent route: the user picks items in plain language; surface each picked item's posture note and get the explicit confirm; run its lane's rendered lines — chat: the one-liner; harness: the check line, then on the yes to its result the apply line; user: the user's own step — per the full consent route in `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`. Pinned order on this exit: Recommendations block → optional applies → report footer → the commit ask (the advisor/apply lane never lands after the commit ask).
|
|
119
|
+
- **Recommendations lanes — both exits.** The four lanes (`chat`, `harness`, `kit`, `user`), the consent route and the kit route live in `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`; `init` stays a route the user may take.
|
|
120
120
|
- **Live host/session facts are tool-composed only.** Any claim this report makes about the current host or session state — prompts fired, sandbox scope, whether a bypass was needed, network reachability, approval counts — must trace to **live tool output** from **this session** (the lines you just composed, or a probe you ran this run); a memory/handover snapshot is **context, never report facts**, and a claim with no live signal is **omitted or explicitly marked unverified** — never asserted from recollection. Full clause: *Live host/session facts* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`.
|
|
121
121
|
- **Print the report footer** in the canonical order (version block → one-line backend-status line → welcome mat — the shared contracts in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`; rendered from the helpers, same host-can't-run skip-with-reason). The welcome mat closes on **one** caveat-aware next step (a behind member first, else `setup` / `recipes` / `velocity` / `agents` / `hook`).
|
|
122
122
|
- **Then ask before committing — never auto-commit.** If step 3 added the slot (or anything else changed), report it and ask. If step 3 was a pure zero-diff no-op and nothing else changed, give the plain **settings already current — no update needed** message (the *Success state* contract in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`) and still print the read-only version block (installed package versions) + backend line — but **no `docs/ai` structure version and no two-axes note** (nothing changed, so the number is inert here).
|
|
123
123
|
5. Show the relevant `${CLAUDE_SKILL_DIR}/CHANGELOG.md` diff (entries newer than the project's stamp).
|
|
124
124
|
6. **Collect the migration answers FIRST, then apply.** Run `node ${CLAUDE_SKILL_DIR}/tools/migration-notes.mjs --cwd <project>` and relay its stdout lines verbatim, in order; a non-zero exit relays its one named line and STOPs, except `stamp-absent`, which routes back to step 1. Then run the preview `node ${CLAUDE_SKILL_DIR}/tools/migration-blocks.mjs --cwd <project>`. If its lines say both blocks are missing (pre-1.1.0), ask the two questions as ONE structured multi-question prompt; record each answer individually, write nothing until ALL are answered, and carry the answers into the migrations below: a migration whose answer was already collected never re-asks; a single missing block keeps its single ask (step 7). Then apply exactly the notes the tool listed, in its order ("only those newer than the project's stamp" is why, never a second selection). Migrations are **idempotent** — safe to re-run.
|
|
125
125
|
7. Reconcile drift: add any kernel files/scripts the project is missing; never clobber project-authored content (their `decisions.md`, `known_issues.md`, page specs stay). Any user question a migration raises follows the same rule as bootstrap — **structured multiple-choice where supported** (`AskUserQuestion` in Claude Code), otherwise prose. For a block the preview names as needing its answer, **ask the user their conversational language** (`--language`) or **whether the agent may attribute work to itself / AI** (`--attribution`, defaulting to `off`), never re-asking a step-6 answer; then re-run the preview with `--apply` and the answers, relaying its lines. Exit 1 `answer-missing`: ask exactly what its lines name and re-run `--apply` once; a second one STOPs. Any other exit 1 is a named refusal: relay it with its recovery (`cap`: trim `AGENTS.md`, re-run) and STOP before the finalizer and the stamp. **Then, before the stamp, re-run the LATE navigator finalizer:** the migrations of steps 6–7 may have changed `docs/ai` files, so run the one op again — `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --only index --cwd <project>` — and relay THAT line in the step-8 report (idempotent: an untouched tree changes nothing; a failure STOPs this upgrade like any other ensure).
|
|
126
|
-
8. Re-stamp `docs/ai/.workflow-version` to the **deployment-lineage head** (`4.0.0`, not the package version — mechanics unchanged: the atomic write to the stamp file). In the report, **describe what the upgrade changed in plain human terms** — which parts of their `docs/ai` are now different (the migrations that ran), plus the step-3 run-list outcomes, each as step 4 words it: the `pointers` slots and Memory Map rows, the `footprint` visibility verdict (and what a consented re-run migrated), the **nine project-configuration ensure** (`configs`) lines (enumerated in step 3) — the navigator one being the late `--only index` run at the end of step 7, the **`gates-migration`** result, the **placed-bridge refresh** (`bridges`) lines (pasted verbatim), the **agent-rules lens** (`lens`) + **Communication-section** + **story-sessions section** outcomes (same outcome sets as step 4), the **full-flow offer** (`tier`) outcome, and the **bridge-settings reconcile** (`bridge-settings`) outcome (line(s) pasted verbatim) — rather than reciting a version number; **omit the raw structure number**, and do **not** print the two-axes note here (it belongs to *Version disclosure* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`, on demand only). Then **render the mandatory Recommendations section**: run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root>` and PRESENT its output — from the `## Recommendations (agent-workflow)` header — in the user's conversational language (every fact, count and item, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; raw tool block on request; present-even-when-empty: `no recommendations — flow optimal.`), then OFFER the consent route (per picked item: posture note → explicit confirm → chat: the one-liner; harness: the check line, then on the yes to its result the apply line; user: the user's own step — `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`). **Every current host/session claim in this report is tool-composed only** — prompts fired, sandbox scope, whether a bypass was needed, network reachability and approval counts must trace to **live tool output** from **this session**, a memory/handover snapshot is **context, never report facts**, and an unbacked claim is **omitted or explicitly marked unverified** (full clause: *Live host/session facts* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`). Then **print the report footer** in the canonical order (version block → one-line backend-status line → welcome mat — the shared contracts in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`; rendered from the helpers, same host-can't-run skip-with-reason; the welcome mat closes on one caveat-aware next step). Then **ask before committing** — the pinned order on this exit is: Recommendations block → optional applies → report footer → the commit ask.
|
|
126
|
+
8. Re-stamp `docs/ai/.workflow-version` to the **deployment-lineage head** (`4.0.0`, not the package version — mechanics unchanged: the atomic write to the stamp file). In the report, **describe what the upgrade changed in plain human terms** — which parts of their `docs/ai` are now different (the migrations that ran), plus the step-3 run-list outcomes, each as step 4 words it: the `pointers` slots and Memory Map rows, the `footprint` visibility verdict (and what a consented re-run migrated), the **nine project-configuration ensure** (`configs`) lines (enumerated in step 3) — the navigator one being the late `--only index` run at the end of step 7, the **`gates-migration`** result, the **placed-bridge refresh** (`bridges`) lines (pasted verbatim), the **agent-rules lens** (`lens`) + **Communication-section** + **story-sessions section** outcomes (same outcome sets as step 4), the **full-flow offer** (`tier`) outcome, and the **bridge-settings reconcile** (`bridge-settings`) outcome (line(s) pasted verbatim) — rather than reciting a version number; **omit the raw structure number**, and do **not** print the two-axes note here (it belongs to *Version disclosure* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`, on demand only). Then **render the mandatory Recommendations section**: run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root>` and PRESENT its output — from the `## Recommendations (agent-workflow)` header — in the user's conversational language (every fact, count and item, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; raw tool block on request; present-even-when-empty: `no recommendations — flow optimal.`), then apply each kit item by the kit route (no question: its check line, then at once its apply line), then OFFER the consent route (per picked item: posture note → explicit confirm → chat: the one-liner; harness: the check line, then on the yes to its result the apply line; user: the user's own step — `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`). **Every current host/session claim in this report is tool-composed only** — prompts fired, sandbox scope, whether a bypass was needed, network reachability and approval counts must trace to **live tool output** from **this session**, a memory/handover snapshot is **context, never report facts**, and an unbacked claim is **omitted or explicitly marked unverified** (full clause: *Live host/session facts* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`). Then **print the report footer** in the canonical order (version block → one-line backend-status line → welcome mat — the shared contracts in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`; rendered from the helpers, same host-can't-run skip-with-reason; the welcome mat closes on one caveat-aware next step). Then **ask before committing** — the pinned order on this exit is: Recommendations block → optional applies → report footer → the commit ask.
|
|
@@ -19,7 +19,7 @@ import { HOOK_FILE_REL, HOOKS_DIR, buildHookSettingsEntry, mergeHookEntry, write
|
|
|
19
19
|
import { STATE_BLOCK_HOOK_FILE_REL, buildStopHookEntry, mergeStopEntry, writeStateBlockHook } from './state-block-hook.mjs';
|
|
20
20
|
import { writeMcp } from './mcp.mjs';
|
|
21
21
|
import { ENABLED_KEY, MCP_JSON_REL, SERVERS_KEY, SERVER_NAME, allowRulesFor, buildServerEntry } from './mcp-registration.mjs';
|
|
22
|
-
import { AGENTS_DIR, writeCheapAgents } from './cheap-agents.mjs';
|
|
22
|
+
import { AGENTS_DIR, EXECUTOR_VEHICLE_REL, writeCheapAgents } from './cheap-agents.mjs';
|
|
23
23
|
import { planFor } from './jev-skill.mjs';
|
|
24
24
|
import { SKILL_FILES, claudeDirOf, skillTargets } from './jev-facts.mjs';
|
|
25
25
|
import { findOnPath } from './detect-backends.mjs';
|
|
@@ -37,13 +37,13 @@ const RESEED_VARIANTS = ['gate-hook.marker-stale', 'read-lane.stale'];
|
|
|
37
37
|
const HOOK_VARIANTS = ['gate-hook', 'read-lane.missing', ...RESEED_VARIANTS];
|
|
38
38
|
const STOP = 'state-block';
|
|
39
39
|
const MCP_VARIANTS = ['mcp-channel', 'mcp-channel.differing'];
|
|
40
|
-
const
|
|
40
|
+
const EXECUTOR_KIT = 'executor-vehicle.differing';
|
|
41
|
+
const AGENT_VARIANTS = ['agents', 'executor-vehicle', EXECUTOR_KIT];
|
|
41
42
|
const GIT_VARIANTS = ['enforcement', 'commit-guard', 'hook-checks'];
|
|
42
43
|
const WORKTREES = 'worktrees-dir';
|
|
43
44
|
const ATTRIBUTION = 'attribution';
|
|
44
45
|
const FOOTPRINT = 'footprint-global';
|
|
45
|
-
const VARIANTS = [...VELOCITY_VARIANTS, 'autonomy-render', ...HOOK_VARIANTS, STOP, ...MCP_VARIANTS, ...AGENT_VARIANTS,
|
|
46
|
-
...SKILL_VARIANTS, ...GIT_VARIANTS, WORKTREES, ATTRIBUTION, FOOTPRINT];
|
|
46
|
+
const VARIANTS = [...VELOCITY_VARIANTS, 'autonomy-render', ...HOOK_VARIANTS, STOP, ...MCP_VARIANTS, ...AGENT_VARIANTS, ...SKILL_VARIANTS, ...GIT_VARIANTS, WORKTREES, ATTRIBUTION, FOOTPRINT];
|
|
47
47
|
const HOOK_KEYS = ['hooks.PreToolUse', 'hooks.Stop'];
|
|
48
48
|
const CREDENTIALS = 'sandbox.credentials.envVars';
|
|
49
49
|
const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
@@ -236,8 +236,8 @@ export const scopeOf = (variant, facts, deps = {}) => {
|
|
|
236
236
|
|| (VELOCITY_VARIANTS.includes(variant) && key === 'permissions.ask');
|
|
237
237
|
return correctFile && (!gains || change === 'added') && !(key === ATTRIBUTION_KEY && change === 'removed') && Boolean(allowed[key]?.(value));
|
|
238
238
|
},
|
|
239
|
-
admitsPath: (path, directory = false) => directory ? directories.includes(path)
|
|
240
|
-
|
|
239
|
+
admitsPath: (path, directory = false) => directory ? directories.includes(path) : filePaths.includes(path)
|
|
240
|
+
|| (variant === EXECUTOR_KIT ? path === join(facts.root, EXECUTOR_VEHICLE_REL) : AGENT_VARIANTS.includes(variant) && covers(join(facts.root, AGENTS_DIR), path)),
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
|
|
@@ -300,7 +300,7 @@ export const plannedChange = (variant, facts, deps = {}) => {
|
|
|
300
300
|
if (plan.writeMcpJson) addFile(MCP_JSON_REL, registration.mcpJson.data, JSON.parse(plan.mcpBody));
|
|
301
301
|
if (plan.writeSettings) addFile(SETTINGS_FILE, registration.settings.data, JSON.parse(plan.settingsBody));
|
|
302
302
|
} else if (AGENT_VARIANTS.includes(variant)) {
|
|
303
|
-
const plan = writeCheapAgents({ cwd: facts.root, dryRun: true }, writerDeps);
|
|
303
|
+
const plan = writeCheapAgents({ cwd: facts.root, dryRun: true, executorOnly: variant === EXECUTOR_KIT }, writerDeps);
|
|
304
304
|
for (const item of plan.plan.filter(({ action }) => ['place', 're-derive'].includes(action))) {
|
|
305
305
|
writes.push({ path: item.abs, bytes: item.content });
|
|
306
306
|
}
|
package/tools/cheap-agents.mjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// (the lens from its review-lens section, opus and high by default), replacing the earlier body;
|
|
20
20
|
// an identical file is `already current` (idempotent re-run);
|
|
21
21
|
// • writes ONLY under .claude/agents/ — never settings.json / settings.local.json, never
|
|
22
|
-
// commits.
|
|
22
|
+
// commits; `--executor` plans and writes the executor alone (the advisor's kit item).
|
|
23
23
|
//
|
|
24
24
|
// Claude-Code-specific (like velocity): .claude/agents/ is a Claude Code surface; other agent
|
|
25
25
|
// hosts ignore it. In a HIDDEN-mode deployment, run the hide-footprint reconcile after apply so
|
|
@@ -42,6 +42,7 @@ import { deriveLensTemplate, lensVehicleSpec } from './review-roster-resolve.mjs
|
|
|
42
42
|
import { loadVehicles, resolveExecutor, resolveReviewLens } from './vehicle-settings.mjs';
|
|
43
43
|
import { safeLine } from './carriers.mjs';
|
|
44
44
|
import { writeContainedFileAtomic } from './atomic-write.mjs';
|
|
45
|
+
import { fileLine } from './distribution-files/index.mjs';
|
|
45
46
|
// The READ core, never a second copy: the bundle, the placement plan and the executor survey live
|
|
46
47
|
// there so the read-only advisor graph can reach them without reaching this writer.
|
|
47
48
|
import {
|
|
@@ -56,7 +57,6 @@ import {
|
|
|
56
57
|
CHEAP_AGENTS_CONFIG,
|
|
57
58
|
CHEAP_AGENTS_VEHICLES,
|
|
58
59
|
EXECUTOR_VEHICLE,
|
|
59
|
-
REVIEW_LENS_VEHICLE,
|
|
60
60
|
executorTemplate,
|
|
61
61
|
reviewLensTemplate,
|
|
62
62
|
makeCheapAgentsError,
|
|
@@ -99,7 +99,7 @@ const EXIT_USAGE = 2;
|
|
|
99
99
|
// never silent).
|
|
100
100
|
export const FALLBACK_LENS_ADDITIONAL_ONLY = 'review-lens is an ADDITIONAL read-only review opinion, not a replacement for your plan or diff review recipe.';
|
|
101
101
|
|
|
102
|
-
const USAGE = `usage: cheap-agents [--dry-run | --apply] [--cwd <dir>] [--help]
|
|
102
|
+
const USAGE = `usage: cheap-agents [--dry-run | --apply] [--executor] [--cwd <dir>] [--help]
|
|
103
103
|
|
|
104
104
|
Places the bundled subagent definitions into the project's ${AGENTS_DIR}/. Four vehicles grant NO
|
|
105
105
|
shell: three ride a cheap model (haiku/low) for mechanical work — extraction sweeps, changelog
|
|
@@ -112,7 +112,9 @@ Configured derived review lenses are planned and placed beside the bundled vehic
|
|
|
112
112
|
An existing file with DIFFERENT content is preserved and reported, never overwritten, except the executor
|
|
113
113
|
and the review lens. The executor's model and effort come from docs/ai/vehicles.json, the review lens's
|
|
114
114
|
from its review-lens section there (opus and high by default), and a placed executor or review-lens.md
|
|
115
|
-
whose bytes differ from its derived body is re-derived on --apply (the earlier body is replaced, never preserved)
|
|
115
|
+
whose bytes differ from its derived body is re-derived on --apply (the earlier body is replaced, never preserved).
|
|
116
|
+
--executor plans the executor alone and reads no orchestration config, so its --apply writes
|
|
117
|
+
${AGENTS_DIR}/executor.md and no other file.`;
|
|
116
118
|
|
|
117
119
|
export const fail = (exitCode, message) => Object.assign(new Error(message), { exitCode });
|
|
118
120
|
|
|
@@ -132,11 +134,12 @@ const refuseSymlinkedRoot = (projectDir, deps) => {
|
|
|
132
134
|
if (stat.isSymbolicLink()) throw makeCheapAgentsError(CHEAP_AGENTS_SYMLINK, `the project root ${root} is a symlink — refusing to write through it`);
|
|
133
135
|
};
|
|
134
136
|
|
|
135
|
-
|
|
137
|
+
// alone: plan the derived templates only (the --executor form), no bundled vehicle beside them.
|
|
138
|
+
export const preflightCheapAgents = ({ cwd, derived = [], alone = false }, deps = {}) => {
|
|
136
139
|
const fs = readFsDeps(deps);
|
|
137
140
|
const projectDir = cwd ?? process.cwd();
|
|
138
141
|
refuseSymlinkedRoot(projectDir, deps);
|
|
139
|
-
const templatesByName = new Map(readBundledAgents(deps).map((template) => [template.name, template]));
|
|
142
|
+
const templatesByName = new Map(alone ? [] : readBundledAgents(deps).map((template) => [template.name, template]));
|
|
140
143
|
for (const template of derived) templatesByName.set(template.name, template);
|
|
141
144
|
const templates = [...templatesByName.values()];
|
|
142
145
|
const stamp = readStamp(join(projectDir, WORKFLOW_STAMP), fs);
|
|
@@ -178,20 +181,21 @@ const configuredDerivedTemplates = (cwd, deps) => {
|
|
|
178
181
|
return [...templates.values()];
|
|
179
182
|
};
|
|
180
183
|
|
|
181
|
-
export const applyCheapAgentsCommand = (root) =>
|
|
182
|
-
`node ${shellQuoteArg(fileURLToPath(import.meta.url))} --apply --cwd ${shellQuoteArg(root)}`;
|
|
184
|
+
export const applyCheapAgentsCommand = (root, executorOnly = false) =>
|
|
185
|
+
`node ${shellQuoteArg(fileURLToPath(import.meta.url))} --apply${executorOnly ? ' --executor' : ''} --cwd ${shellQuoteArg(root)}`;
|
|
183
186
|
|
|
184
187
|
// ── the writer ────────────────────────────────────────────────────────────────────────
|
|
185
188
|
|
|
186
|
-
|
|
189
|
+
// executorOnly (--executor): the executor template alone, no orchestration config read.
|
|
190
|
+
export const writeCheapAgents = ({ cwd, dryRun = true, executorOnly = false } = {}, deps = {}) => {
|
|
187
191
|
const fs = writeFsDeps(deps);
|
|
188
192
|
const projectDir = cwd ?? process.cwd();
|
|
189
193
|
refuseSymlinkedRoot(projectDir, deps);
|
|
190
194
|
const { posture, lensPosture } = loadPosturesOrStop(projectDir, deps);
|
|
191
|
-
const derived = [
|
|
195
|
+
const derived = executorOnly ? [executorTemplate(posture, deps)] : [
|
|
192
196
|
executorTemplate(posture, deps), reviewLensTemplate(lensPosture, deps), ...configuredDerivedTemplates(projectDir, deps),
|
|
193
197
|
];
|
|
194
|
-
const preflight = preflightCheapAgents({ cwd: projectDir, derived }, deps);
|
|
198
|
+
const preflight = { executorOnly, ...preflightCheapAgents({ cwd: projectDir, derived, alone: executorOnly }, deps) };
|
|
195
199
|
if (dryRun) return { wrote: false, dryRun: true, posture, lensPosture, ...preflight };
|
|
196
200
|
|
|
197
201
|
if (!preflight.stampOk) {
|
|
@@ -217,12 +221,19 @@ export const writeCheapAgents = ({ cwd, dryRun = true } = {}, deps = {}) => {
|
|
|
217
221
|
const ACTION_LABEL = {
|
|
218
222
|
place: 'place',
|
|
219
223
|
'already-current': 'already current',
|
|
220
|
-
're-derive': 're-derived — a hand edit was replaced; set the model in docs/ai/vehicles.json',
|
|
221
224
|
'customized-preserved': 'customized — preserved (delete the file to reseed from the bundle)',
|
|
222
225
|
};
|
|
223
226
|
const LENS_REDERIVE_LABEL = 're-derived — the earlier body was replaced; set its model and effort in docs/ai/vehicles.json';
|
|
224
|
-
|
|
225
|
-
|
|
227
|
+
// The executor's re-derive line is the distribution-files composer's, over the state `derived`.
|
|
228
|
+
const rowLine = (item, dryRun) => {
|
|
229
|
+
if (item.action === 're-derive' && item.name === EXECUTOR_VEHICLE) {
|
|
230
|
+
return fileLine({ rel: item.rel, name: item.name, state: 'derived' }, dryRun ? undefined : 'written', dryRun);
|
|
231
|
+
}
|
|
232
|
+
const verb = dryRun && item.action === 'place' ? 'would place'
|
|
233
|
+
: dryRun && item.action === 're-derive' ? 'would re-derive'
|
|
234
|
+
: item.action === 're-derive' ? LENS_REDERIVE_LABEL : ACTION_LABEL[item.action];
|
|
235
|
+
return `${item.rel}: ${verb}`;
|
|
236
|
+
};
|
|
226
237
|
|
|
227
238
|
export const formatResult = (result) => {
|
|
228
239
|
const { posture, lensPosture } = result;
|
|
@@ -231,29 +242,29 @@ export const formatResult = (result) => {
|
|
|
231
242
|
? 'agent-workflow subagent vehicles — DRY RUN (no changes)'
|
|
232
243
|
: 'agent-workflow subagent vehicles — APPLY',
|
|
233
244
|
];
|
|
234
|
-
for (const item of result.plan) {
|
|
235
|
-
const verb = result.dryRun && item.action === 'place' ? 'would place'
|
|
236
|
-
: result.dryRun && item.action === 're-derive' ? 'would re-derive' : labelOf(item);
|
|
237
|
-
lines.push(` - ${item.rel}: ${verb}`);
|
|
238
|
-
}
|
|
245
|
+
for (const item of result.plan) lines.push(` - ${rowLine(item, result.dryRun)}`);
|
|
239
246
|
if (!result.stampOk) {
|
|
240
247
|
lines.push(`note: no current deployment stamp found (${result.stamp ?? 'none'}) — --apply will refuse until init/upgrade runs.`);
|
|
241
248
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
if (!result.executorOnly) {
|
|
250
|
+
const readOnlyCount = result.plan.filter((item) => item.name !== EXECUTOR_VEHICLE).length;
|
|
251
|
+
lines.push(
|
|
252
|
+
`${readOnlyCount} vehicles are Claude Code subagents with READ-ONLY tools and NO shell as bundled or derived (a customized file keeps whatever it grants) — so a fan-out on the shipped templates can never turn into a wave of approval prompts.`,
|
|
253
|
+
`three of those ride the cheap lane (model: haiku, effort: low) for mechanical work; ${FALLBACK_LENS_ADDITIONAL_ONLY}`,
|
|
254
|
+
'executor is the one FULL-TOOL vehicle: dispatched only for a bounded execution, authoring, or write-capable routine slice the orchestrator verifies, never for read-only work, and it never commits.',
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
lines.push(`executor posture: model=${safeLine(posture.model)} effort=${safeLine(posture.effort)} fallback=${safeLine(posture.fallback)} (source: ${safeLine(posture.source)}) — set in docs/ai/vehicles.json`);
|
|
258
|
+
if (!result.executorOnly) {
|
|
259
|
+
lines.push(`review-lens posture: model=${safeLine(lensPosture.model)} effort=${safeLine(lensPosture.effort)} (source: ${safeLine(lensPosture.source)}) — set in docs/ai/vehicles.json`);
|
|
260
|
+
}
|
|
250
261
|
// A preview must print the EXACT command that applies it. The advisor renders this dry-run as an
|
|
251
262
|
// item's one-liner, and that flow's contract is "run the printed command, no improvisation" — a
|
|
252
263
|
// bare "re-run with --apply" would leave the caller to reconstruct --cwd and its quoting.
|
|
253
264
|
if (result.dryRun && result.plan.some((item) => item.action === 'place' || item.action === 're-derive')) {
|
|
254
|
-
lines.push(`to apply, run exactly: ${applyCheapAgentsCommand(result.projectDir)}`);
|
|
265
|
+
lines.push(`to apply, run exactly: ${applyCheapAgentsCommand(result.projectDir, result.executorOnly)}`);
|
|
255
266
|
}
|
|
256
|
-
if (!result.dryRun && result.wrote) {
|
|
267
|
+
if (!result.dryRun && result.wrote && !result.executorOnly) {
|
|
257
268
|
lines.push('hidden-mode note: if this deployment is hidden, run the hide-footprint reconcile so the placed files stay out of `git status`.');
|
|
258
269
|
}
|
|
259
270
|
return lines.join('\n');
|
|
@@ -262,12 +273,13 @@ export const formatResult = (result) => {
|
|
|
262
273
|
// ── CLI ───────────────────────────────────────────────────────────────────────────────
|
|
263
274
|
|
|
264
275
|
export const parseArgs = (argv) => {
|
|
265
|
-
const opts = { dryRunFlag: false, apply: false, cwd: undefined, help: false };
|
|
276
|
+
const opts = { dryRunFlag: false, apply: false, executorOnly: false, cwd: undefined, help: false };
|
|
266
277
|
for (let i = 0; i < argv.length; i += 1) {
|
|
267
278
|
const arg = argv[i];
|
|
268
279
|
if (arg === '--help' || arg === '-h') opts.help = true;
|
|
269
280
|
else if (arg === '--dry-run') opts.dryRunFlag = true;
|
|
270
281
|
else if (arg === '--apply') opts.apply = true;
|
|
282
|
+
else if (arg === '--executor') opts.executorOnly = true;
|
|
271
283
|
else if (arg === '--cwd') {
|
|
272
284
|
i += 1;
|
|
273
285
|
if (argv[i] === undefined || argv[i].startsWith('-')) throw fail(EXIT_USAGE, '--cwd needs a directory argument');
|
|
@@ -277,7 +289,7 @@ export const parseArgs = (argv) => {
|
|
|
277
289
|
}
|
|
278
290
|
}
|
|
279
291
|
if (opts.dryRunFlag && opts.apply) throw fail(EXIT_USAGE, '--dry-run and --apply cannot be used together');
|
|
280
|
-
return { help: opts.help, dryRun: !opts.apply, cwd: opts.cwd };
|
|
292
|
+
return { help: opts.help, dryRun: !opts.apply, executorOnly: opts.executorOnly, cwd: opts.cwd };
|
|
281
293
|
};
|
|
282
294
|
|
|
283
295
|
export const main = (argv = process.argv.slice(2), deps = {}) => {
|
|
@@ -289,7 +301,7 @@ export const main = (argv = process.argv.slice(2), deps = {}) => {
|
|
|
289
301
|
log(USAGE);
|
|
290
302
|
return EXIT_OK;
|
|
291
303
|
}
|
|
292
|
-
const result = writeCheapAgents({ cwd: args.cwd ?? process.cwd(), dryRun: args.dryRun }, deps);
|
|
304
|
+
const result = writeCheapAgents({ cwd: args.cwd ?? process.cwd(), dryRun: args.dryRun, executorOnly: args.executorOnly }, deps);
|
|
293
305
|
log(formatResult(result));
|
|
294
306
|
return EXIT_OK;
|
|
295
307
|
} catch (err) {
|
|
@@ -16,6 +16,7 @@ import { lstatNoFollow, writeContainedFileAtomic, writeProjectFileCreateOnly } f
|
|
|
16
16
|
import { composeFailure, composeOutcome, nodeEvidenceRefusal, probeSeedTarget, tmpNote } from '../ensure-ops.mjs';
|
|
17
17
|
import { BUNDLED_SCRIPT_NAMES } from '../node-evidence.mjs';
|
|
18
18
|
import { CHECKER_PAIR, INSTALLER_SET, READER_PAIR, SCRIPT_PRIORS, classifyDeployedScript } from '../script-priors.mjs';
|
|
19
|
+
import { VEHICLES_REL } from '../vehicle-settings.mjs';
|
|
19
20
|
|
|
20
21
|
const OP = 'scripts';
|
|
21
22
|
const SCRIPTS_DIR = 'scripts';
|
|
@@ -23,6 +24,7 @@ const BUNDLED = ['references', 'scripts'];
|
|
|
23
24
|
// Where an edit meant to last goes: the installer's in the local hook file, every other file's beside it.
|
|
24
25
|
export const SCRIPT_CHANNEL = 'a script or suite of your own under its own name in scripts/, or a config the script reads';
|
|
25
26
|
export const LOCAL_HOOK_CHANNEL = 'the local hook file scripts/pre-commit.local, which the commit hook runs first';
|
|
27
|
+
export const VEHICLE_CHANNEL = VEHICLES_REL;
|
|
26
28
|
// The family files memory copies on Node evidence alone, accepted or not (the suite derives them).
|
|
27
29
|
export const SEED_NAMES = Object.freeze(['_expect-shim.mjs', 'archive-decisions.mjs', 'archive-decisions.test.mjs', 'markdown-blocks.mjs']);
|
|
28
30
|
const ROTATOR = 'archive-decisions.mjs';
|
|
@@ -78,13 +80,15 @@ const survey = ({ cwd, kitRoot, deps, read, lstat }) => {
|
|
|
78
80
|
// A fate is `written`, `stood` (an absent file that appeared with the bundled body), `refused` (its
|
|
79
81
|
// write failed), or none: the run stopped before it, or, dry, would write it. The spec layer's pair
|
|
80
82
|
// lines are these too, through the module's index.
|
|
81
|
-
const VERBS = { prior: ['refreshed', 'refreshed to the bundled one'], custom: ['replaced', 'replaced by the bundled body'], absent: ['placed', 'placed from the bundled scripts'] };
|
|
82
|
-
const HEADS = { prior: 'matches a body an earlier release shipped', custom: 'differs from every body this kit knows it shipped', absent: 'absent' };
|
|
83
|
+
const VERBS = { prior: ['refreshed', 'refreshed to the bundled one'], custom: ['replaced', 'replaced by the bundled body'], absent: ['placed', 'placed from the bundled scripts'], derived: ['written', 'written with that body'] };
|
|
84
|
+
const HEADS = { prior: 'matches a body an earlier release shipped', custom: 'differs from every body this kit knows it shipped', absent: 'absent', derived: 'differs from the body derived from the vehicle settings' };
|
|
85
|
+
const channelOf = (f) => (f.state === 'derived' ? `; its model and effort are set in ${VEHICLE_CHANNEL}`
|
|
86
|
+
: f.state === 'custom' ? `; an edit meant to last goes in ${f.name === INSTALLER_SET[0] ? LOCAL_HOOK_CHANNEL : SCRIPT_CHANNEL}` : '');
|
|
83
87
|
export const fileLine = (f, fate, dryRun) => {
|
|
84
88
|
if (fate === 'stood') return `${f.rel}: appeared while this run was placing it — the bundled body stands, nothing written`;
|
|
85
89
|
const [verb, done] = VERBS[f.state];
|
|
86
90
|
const tail = fate === 'written' ? done : dryRun ? `would be ${done}` : `not ${verb}; ${fate === 'refused' ? 'its write was refused (above)' : 'the run stopped before it'}`;
|
|
87
|
-
return `${f.rel}: ${HEADS[f.state]} — ${tail}${f
|
|
91
|
+
return `${f.rel}: ${HEADS[f.state]} — ${tail}${channelOf(f)}`;
|
|
88
92
|
};
|
|
89
93
|
const NOT_ACCEPTED = `${SCRIPTS_DIR}/: the enforcement scripts were not accepted in this project, so no other kit script is placed`;
|
|
90
94
|
// The hook-run line, once after the file lines of a run that wrote (or, dry, would write) a file.
|
package/tools/ensure-configs.mjs
CHANGED
|
@@ -90,7 +90,7 @@ whenever it is missing or stale; where a module the project's hook loads is not
|
|
|
90
90
|
the project's own checker judges the navigator and a write it rejects is put back byte for byte.
|
|
91
91
|
The executor ensure writes nothing: a placed .claude/agents/executor.md whose bytes differ from the
|
|
92
92
|
body derived from docs/ai/vehicles.json is pending — the advisor's executor-vehicle.differing item
|
|
93
|
-
|
|
93
|
+
writes the derived body with no question; an absent file is never placed here.
|
|
94
94
|
A fifth writes too: once a kit script outside the seed names stands in scripts/, the enforcement-script
|
|
95
95
|
ensure writes every kit script that is not the bundled body, the hook installer and its two suites
|
|
96
96
|
first, with no question and no copy kept: a body a release shipped is refreshed, an edited one replaced
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ensure-executor.mjs — the EIGHTH upgrade ensure, fifth in the fixed order right after `vehicles`:
|
|
2
2
|
// the placed executor vehicle (.claude/agents/executor.md) judged against the body derived from
|
|
3
3
|
// docs/ai/vehicles.json. It never writes: the agents writer PLACES the vehicle on consent, and a placed
|
|
4
|
-
// body that differs is reported `pending` — the advisor's executor-vehicle.differing item
|
|
4
|
+
// body that differs is reported `pending` — the advisor's executor-vehicle.differing item writes it.
|
|
5
5
|
//
|
|
6
6
|
// The state table, in the order the cells are proven:
|
|
7
7
|
// | cell | .claude, .claude/agents | placed path | docs/ai/vehicles.json | answer | read before answering |
|
|
@@ -66,5 +66,5 @@ export const ensureExecutor = ({ cwd, kitRoot, deps = {} }) => {
|
|
|
66
66
|
if (!executorBodyDiffers(cwd, bundleDeps)) {
|
|
67
67
|
return ok('already-current', [`${EXECUTOR_VEHICLE_REL}: the body derived from ${VEHICLES_REL} (model=${posture.model}, effort=${posture.effort}, source ${posture.source}) — nothing written`]);
|
|
68
68
|
}
|
|
69
|
-
return ok('pending', [`${EXECUTOR_VEHICLE_REL}: differs from the body derived from ${VEHICLES_REL} — nothing written; the advisor's executor-vehicle.differing item
|
|
69
|
+
return ok('pending', [`${EXECUTOR_VEHICLE_REL}: differs from the body derived from ${VEHICLES_REL} — nothing written; the advisor's executor-vehicle.differing item, which the agent applies with no question, writes the derived body`]);
|
|
70
70
|
};
|
package/tools/init-project.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { preflightInit } from './init-preflight.mjs';
|
|
|
13
13
|
import { buildRecommendations, hostFacts } from './recommendations.mjs';
|
|
14
14
|
import { compareSemver } from './semver-lite.mjs';
|
|
15
15
|
import { EXPECTED_WORKFLOW_VERSION } from './velocity-profile.mjs';
|
|
16
|
-
import { LANE_HARNESS, VARIANT_LANES, consoleArgv, isEnvDependent, isProtectedPath, isRejudged, laneOf, writesOf } from './write-lanes.mjs';
|
|
16
|
+
import { LANE_HARNESS, LANE_KIT, VARIANT_LANES, consoleArgv, isEnvDependent, isProtectedPath, isRejudged, laneOf, writesOf } from './write-lanes.mjs';
|
|
17
17
|
|
|
18
18
|
const INSIDE_LINE = 'you are inside an agent; run this in your own terminal';
|
|
19
19
|
const APPLY_PROMPT = 'apply? y/N: ';
|
|
@@ -218,7 +218,7 @@ const previewQueue = async (context, queue) => {
|
|
|
218
218
|
const tuple = result.stdout.match(/--apply\s+(\S+)/)?.[1];
|
|
219
219
|
const facts = { ...context.facts, env: context.spawnEnv, tuple };
|
|
220
220
|
let checkDigest = null;
|
|
221
|
-
if (laneOf(item.variant)
|
|
221
|
+
if ([LANE_HARNESS, LANE_KIT].includes(laneOf(item.variant))) {
|
|
222
222
|
try {
|
|
223
223
|
const { lines, refused, digest } = context.checkApply(item.variant, facts, {});
|
|
224
224
|
for (const line of lines) context.print(line);
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
} from './velocity-profile.mjs';
|
|
47
47
|
import { loadAutonomy, isSparseSeedConfig, AUTONOMY_REL } from './autonomy-config.mjs';
|
|
48
48
|
import { deriveDoctorPlan, TRUSTED_DIRS } from './autonomy-doctor.mjs';
|
|
49
|
-
import { laneOf, applySlot, consoleArgv } from './write-lanes.mjs';
|
|
49
|
+
import { LANE_KIT, laneOf, applySlot, consoleArgv } from './write-lanes.mjs';
|
|
50
50
|
import { STATE_BLOCK_HOOK_COMMAND, STATE_BLOCK_HOOK_RUNTIME, isStopHookWired } from './state-block-hook.mjs';
|
|
51
51
|
import { detectBackends } from './detect-backends.mjs';
|
|
52
52
|
import { isDirectRun } from './direct-run.mjs';
|
|
@@ -212,8 +212,8 @@ export const SEVERITIES = Object.freeze({
|
|
|
212
212
|
// names the subagent carrier over a vehicle that cannot carry it — a configured declaration that
|
|
213
213
|
// is broken, which is what attention means.
|
|
214
214
|
'executor-vehicle': SEVERITY_ATTENTION,
|
|
215
|
-
// A hand edit of the placed executor is not a broken declaration — the vehicle still carries — so
|
|
216
|
-
//
|
|
215
|
+
// A hand edit of the placed executor is not a broken declaration — the vehicle still carries — so it is optional;
|
|
216
|
+
// its lane is kit, so the agent writes it with no pick and the verdict counts it in neither class.
|
|
217
217
|
'executor-vehicle.differing': SEVERITY_OPTIONAL,
|
|
218
218
|
// The AGENTS.md block is a configured choice the harness does not honour.
|
|
219
219
|
attribution: SEVERITY_ATTENTION,
|
|
@@ -249,16 +249,15 @@ const fillTemplate = (template, values) => template.replace(/\{([A-Za-z]+)\}/g,
|
|
|
249
249
|
// composeVerdict(counts) → the ONE verdict line, or null for the optimal state (D1 state matrix).
|
|
250
250
|
// attention>0 leads; the "nothing is broken" wording renders ONLY when attention==0 AND skipped==0
|
|
251
251
|
// (a skipped probe could hide an attention-class problem, so the claim would overreach; it renders
|
|
252
|
-
//
|
|
253
|
-
// appended last.
|
|
254
|
-
export const composeVerdict = ({ attention, optional, skipped }) => {
|
|
255
|
-
if (attention === 0 && optional === 0 && skipped === 0) return null;
|
|
252
|
+
// as the lead-in to the optional offer, or alone beside kit items only, which count in neither class:
|
|
253
|
+
// the agent applies them with no pick); the skips part is appended last.
|
|
254
|
+
export const composeVerdict = ({ attention, optional, skipped, kit = 0 }) => {
|
|
255
|
+
if (attention === 0 && optional === 0 && skipped === 0 && kit === 0) return null;
|
|
256
256
|
const parts = [];
|
|
257
257
|
if (attention > 0) parts.push(fillTemplate(VERDICT_ATTENTION_TEMPLATE, { K: attention }));
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
258
|
+
const offer = optional > 0 ? fillTemplate(VERDICT_OPTIONAL_TEMPLATE, { N: optional }) : null;
|
|
259
|
+
if (attention === 0 && skipped === 0) parts.push(offer ? `${VERDICT_NOTHING_BROKEN} — ${offer}` : VERDICT_NOTHING_BROKEN);
|
|
260
|
+
else if (offer) parts.push(offer);
|
|
262
261
|
if (skipped > 0) parts.push(fillTemplate(VERDICT_SKIPS_TEMPLATE, { M: skipped }));
|
|
263
262
|
return parts.join('; ');
|
|
264
263
|
};
|
|
@@ -307,7 +306,7 @@ export const WHATS = Object.freeze({
|
|
|
307
306
|
agents: '{n} bundled subagent vehicle(s) not placed (Claude Code) — {ro} read-only, {ex} the full-tool executor; the apply PREVIEWS first',
|
|
308
307
|
'agents.lens-rederive': 'the placed review-lens.md differs from its body derived from docs/ai/vehicles.json; {n} vehicle(s) to place ({ro} read-only, {ex} executor)',
|
|
309
308
|
'executor-vehicle': '{n} slot(s) configured subagent but the executor vehicle is {state}{reason} — every such slot runs solo until it is usable',
|
|
310
|
-
'executor-vehicle.differing': 'the placed executor vehicle differs from the body derived from docs/ai/vehicles.json —
|
|
309
|
+
'executor-vehicle.differing': 'the placed executor vehicle differs from the body derived from docs/ai/vehicles.json — the derived body is written with no question',
|
|
311
310
|
attribution: 'AGENTS.md says attribution off but .claude/settings.json does not hide the harness trailer and PR text',
|
|
312
311
|
'footprint-global': 'legacy kit ignore line(s) sit in {file} — they ignore kit paths in every repository here',
|
|
313
312
|
'family-freshness': '{parts}',
|
|
@@ -387,7 +386,7 @@ export const BENEFITS = Object.freeze({
|
|
|
387
386
|
});
|
|
388
387
|
// The one arm whose gain differs from its base item's (BENEFITS stays keyed by item key).
|
|
389
388
|
export const VARIANT_BENEFITS = Object.freeze({
|
|
390
|
-
'executor-vehicle.differing': 'carrier fidelity — the placed executor runs the model and effort docs/ai/vehicles.json names
|
|
389
|
+
'executor-vehicle.differing': 'carrier fidelity — the placed executor runs the model and effort docs/ai/vehicles.json names',
|
|
391
390
|
'source-size.layout': 'layout — piles past the layout limits become recorded, reasoned debt, so the commit hook can judge new ones once its layout line is armed',
|
|
392
391
|
});
|
|
393
392
|
|
|
@@ -1208,10 +1207,10 @@ const probeExecutorVehicle = ({ root, deps, add, skip }) => {
|
|
|
1208
1207
|
if (renderBrokenExecutor({ root, deps, add, skip })) return;
|
|
1209
1208
|
try {
|
|
1210
1209
|
if (!executorBodyDiffers(root, deps)) return;
|
|
1211
|
-
|
|
1210
|
+
// The executor-only dry run: the call the check makes, so the arm, the check and the apply judge one plan.
|
|
1211
|
+
const plan = writeCheapAgents({ cwd: root, dryRun: true, executorOnly: true }, deps);
|
|
1212
1212
|
if (!plan.stampOk) throw new Error(`run /agent-workflow-kit upgrade first (deployment stamp ${plan.stamp ?? 'none'}, expected ${EXPECTED_WORKFLOW_VERSION})`);
|
|
1213
|
-
add('executor-vehicle', WHATS['executor-vehicle.differing'], formsApply('executor-vehicle.differing', root),
|
|
1214
|
-
'executor-vehicle.differing', HIDDEN_AGENTS_FOLLOW_UP(root));
|
|
1213
|
+
add('executor-vehicle', WHATS['executor-vehicle.differing'], formsApply('executor-vehicle.differing', root), 'executor-vehicle.differing');
|
|
1215
1214
|
} catch (err) {
|
|
1216
1215
|
skip('executor-vehicle', err);
|
|
1217
1216
|
}
|
|
@@ -1761,8 +1760,8 @@ export const buildRecommendations = ({ cwd, deps = {} } = {}) => {
|
|
|
1761
1760
|
// facts/counts complete, commands byte-exact; the raw block on request) ─────────────────────────
|
|
1762
1761
|
export const formatRecommendations = ({ items, skips }) => {
|
|
1763
1762
|
const lines = [RECOMMENDATIONS_SECTION_HEADER, ''];
|
|
1764
|
-
const attention = items.filter((i) => i.severity === SEVERITY_ATTENTION).length;
|
|
1765
|
-
const verdict = composeVerdict({ attention, optional: items.length - attention, skipped: skips.length });
|
|
1763
|
+
const [kit, attention] = [items.filter((i) => i.lane === LANE_KIT).length, items.filter((i) => i.lane !== LANE_KIT && i.severity === SEVERITY_ATTENTION).length];
|
|
1764
|
+
const verdict = composeVerdict({ attention, optional: items.length - attention - kit, skipped: skips.length, kit });
|
|
1766
1765
|
if (verdict == null) {
|
|
1767
1766
|
// The flow-optimal claim renders ONLY when every probe ran and none fired — an empty item
|
|
1768
1767
|
// list beside skipped checks would falsely attest optimality (Segment B).
|
|
@@ -1800,7 +1799,7 @@ Computes the deterministic Recommendations section every kit upgrade ends with
|
|
|
1800
1799
|
one composed verdict line opens every non-optimal render, then per item {severity · what is
|
|
1801
1800
|
sub-optimal · the benefit in one plain line · the lane · an optional \`recipe:\` line (an item's own
|
|
1802
1801
|
facts or its alternative, such as the bridge-tier missing-entries line or
|
|
1803
|
-
the worktrees-dir ack fallback) · the harness check line · the exact consent-gated apply one-liner}. --cwd is
|
|
1802
|
+
the worktrees-dir ack fallback) · the harness or kit check line · the exact consent-gated apply one-liner}. --cwd is
|
|
1804
1803
|
REQUIRED (the target project is explicit, never inferred from the shell's current directory). The
|
|
1805
1804
|
section renders present-even-when-empty ("${RECOMMENDATIONS_EMPTY_LINE}"); a probe failure is a
|
|
1806
1805
|
stated skipped-item line. Apply lines are cwd-independent (absolute tool paths, a pinned --cwd;
|
|
@@ -1811,7 +1810,7 @@ allow rules, <wrapper> * exclusions (codex-exec * where an execute slot delegate
|
|
|
1811
1810
|
sandbox.network.allowedDomains and state dirs in sandbox.filesystem.allowWrite. Where the host
|
|
1812
1811
|
honors the settings sandbox keys, an excluded wrapper runs outside the sandbox, every sandboxed
|
|
1813
1812
|
command of the project can reach each host, and every sandboxed command can write each state dir;
|
|
1814
|
-
plan/diff review modes and delegated execution keep their prompt.
|
|
1813
|
+
plan/diff review modes and delegated execution keep their prompt. A kit item the agent applies with no question, after its check.
|
|
1815
1814
|
A user item stays the user's own step.
|
|
1816
1815
|
|
|
1817
1816
|
Read-only: never writes, never commits, never runs a subscription CLI. Exit codes: 0 report
|
package/tools/write-lanes.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { GATES_REL } from './gates-declaration.mjs';
|
|
|
11
11
|
export const LANE_CHAT = 'chat';
|
|
12
12
|
export const LANE_HARNESS = 'harness';
|
|
13
13
|
export const LANE_USER = 'user';
|
|
14
|
+
export const LANE_KIT = 'kit';
|
|
14
15
|
|
|
15
16
|
export const VARIANT_LANES = Object.freeze({
|
|
16
17
|
'velocity-core': LANE_HARNESS,
|
|
@@ -46,7 +47,7 @@ export const VARIANT_LANES = Object.freeze({
|
|
|
46
47
|
'mcp-channel.differing': LANE_HARNESS,
|
|
47
48
|
agents: LANE_HARNESS,
|
|
48
49
|
'executor-vehicle': LANE_HARNESS,
|
|
49
|
-
'executor-vehicle.differing':
|
|
50
|
+
'executor-vehicle.differing': LANE_KIT,
|
|
50
51
|
attribution: LANE_HARNESS,
|
|
51
52
|
'footprint-global': LANE_HARNESS,
|
|
52
53
|
'family-freshness': LANE_USER,
|
|
@@ -161,7 +162,8 @@ const FORMS = Object.freeze({
|
|
|
161
162
|
['--replace', '--cwd', '<root>'], ['--replace', '--apply', '--cwd', '<root>'], MCP_WRITES),
|
|
162
163
|
agents: AGENT_FORM,
|
|
163
164
|
'executor-vehicle': AGENT_FORM,
|
|
164
|
-
'executor-vehicle.differing':
|
|
165
|
+
'executor-vehicle.differing': createForm('cheap-agents.mjs',
|
|
166
|
+
['--executor', '--cwd', '<root>'], ['--apply', '--executor', '--cwd', '<root>'], [join('.claude', 'agents', 'executor.md')]),
|
|
165
167
|
attribution: createForm('attribution.mjs', ['--cwd', '<root>'], ['--apply', '--cwd', '<root>'], SETTINGS_WRITES),
|
|
166
168
|
'footprint-global': createForm('hide-footprint.mjs',
|
|
167
169
|
['--remove-global', '--dry-run', '--dir', '<root>'], ['--remove-global', '--dir', '<root>'], [], false, null, true),
|
|
@@ -246,7 +248,7 @@ export const isRejudged = (variant) => {
|
|
|
246
248
|
export const applySlot = (variant, facts) => {
|
|
247
249
|
const lane = laneOf(variant);
|
|
248
250
|
const form = FORMS[variant];
|
|
249
|
-
if (lane === LANE_HARNESS) {
|
|
251
|
+
if (lane === LANE_HARNESS || lane === LANE_KIT) {
|
|
250
252
|
const args = ['node', join(facts.toolsDir, 'apply-danger-check.mjs'), '--variant', variant, '--cwd', facts.root];
|
|
251
253
|
const skillArgs = form === SKILL_FORM ? form.preview.map((arg) => resolveArgument(arg, facts)) : [];
|
|
252
254
|
const check = formatCommand([...args, ...skillArgs]);
|