@sabaiway/agent-workflow-kit 15.0.0 → 15.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 +21 -0
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/contracts.md +3 -2
- package/references/modes/rules.md +3 -4
- package/references/modes/upgrade.md +2 -2
- package/tools/ensure-configs.mjs +7 -5
- package/tools/project-rules/rules-ensure.mjs +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ 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
|
+
## 15.1.0 — the upgrade writes the kit rules file current with no question; the rules mode no longer moves an edit (AD-205)
|
|
8
|
+
|
|
9
|
+
**`/agent-workflow-kit upgrade` now puts the kit's rules file back to the kit's template, whatever it holds.** Before,
|
|
10
|
+
a `docs/ai/rules/<theme>.md` that differed from every body a release shipped was kept byte for byte and the kit's
|
|
11
|
+
updates to that file waited; a file with no frontmatter was kept and nothing else was written for its theme. Now any
|
|
12
|
+
such body (an edit, a body this kit does not know, a file with no frontmatter) is replaced by the bundled template
|
|
13
|
+
with no question and no copy kept, and the step reports `refreshed`.
|
|
14
|
+
Its line reads `differs from every body this kit knows it shipped — replaced by the bundled template; a rule meant to
|
|
15
|
+
last goes in docs/ai/rules/local/<theme>.md, where it wins`.
|
|
16
|
+
|
|
17
|
+
- **Your own rules live in the local file.** `docs/ai/rules/local/<theme>.md` is never written by the upgrade, and its
|
|
18
|
+
rules win over the kit's. If you edited the kit file, move the edit there before you upgrade.
|
|
19
|
+
- **With a local file, the record is judged against the template.** When the record already holds the merge built
|
|
20
|
+
from the template, replacing an edited kit file writes only that file; otherwise the step reports `pending`, and the
|
|
21
|
+
record command it prints carries the template's digest.
|
|
22
|
+
- **`/agent-workflow-kit rules` offers three routes:** change a rule, drop your local rules, or change a number. The
|
|
23
|
+
route that moved an edit of the kit file into the local file is gone, with the README row's clause about it.
|
|
24
|
+
- **The texts say the same.** The upgrade mode's project-rules paragraph and its `rules` token list (no
|
|
25
|
+
`customized-preserved`), the header and `--help` of `tools/ensure-configs.mjs`, and the guide's *Reserved names and
|
|
26
|
+
channels*, which now names the kit rules files among the files the next upgrade writes over.
|
|
27
|
+
|
|
7
28
|
## 15.0.0 — the opt-in ADR migration mode retires; status names the upgrade for an older ADR layout (AD-204)
|
|
8
29
|
|
|
9
30
|
**MAJOR: `/agent-workflow-kit migrate-adr-store` is gone, with no alias.** Since 14.50.0 the upgrade moves an older
|
package/README.md
CHANGED
|
@@ -252,7 +252,7 @@ file), or run the guarded `/agent-workflow-kit uninstall`.
|
|
|
252
252
|
| `/agent-workflow-kit review-state` | any time | **read-only review-receipt checker** — makes "reviewed ≠ shipped" detectable: the bridge review wrappers append a receipt per successful review (into a file inside the git dir — never committable); this checks that every backend your configured `plan-execution.review` recipe names holds a **fresh, grounded receipt for the current uncommitted tree** (any later edit the payload can see moves the fingerprint and stales the receipt; a review continuation never re-attests a folded tree). `--check` gives a gate exit code to declare in `docs/ai/gates.json` **by hand or via the consent-gated seeder** (preview → your explicit yes; never without consent). `--await [--timeout <s>]` (AD-049) BLOCKS until every recipe-named backend has receipted the current tree — the durable completion signal is the receipt, never a process event — so you wait for the bridges instead of hand-polling. Never writes, never commits, never runs a subscription CLI; it spawns read-only `git` queries to fingerprint the tree — and `git commit --no-verify` stays possible (discipline, not a sandbox). |
|
|
253
253
|
| `/agent-workflow-kit sandbox-masks` | any time | **exclude lane for sandbox masks** — an OS sandbox (Claude Code) masks work-tree paths with a device or, on Linux, a foreign bind mount, as untracked `git status` noise; the review domain already ignores a **device mask** **by construction** (never-committable untracked classes — char/block devices, FIFOs, sockets — are excluded from the fingerprint, the assembled review payload, and the clean checks), while a **mount-only mask** rides the fingerprint and `git add -A` while git does not ignore it (load-bearing there). This mode hides them from `git status` too: flagless = read-only probe (derives the CURRENT mask set from the unfiltered walk + lstat + `/proc/self/mountinfo` — never a frozen list; off Linux the mount signal is not read and it says so, an unreadable or malformed table refuses — and revalidates fenced entries, loudly flagging one that became a real path); `--apply` = consent-gated FULL-BLOCK replace of its own fenced block in `git rev-parse --git-path info/exclude` (stale masks drop by construction; `--clear` always means REMOVE the block — it takes precedence over the derivation). Writes ONLY its fence — never `.gitignore`, never global config; symlinked/non-regular exclude paths and malformed fences fail closed. Watch note: a real file at an excluded path is silently skipped by bulk staging (`git add -A`/`git add .`) — delete the stale line first; the probe flags exactly this case. |
|
|
254
254
|
| `/agent-workflow-kit mcp` | Claude Code · opt-in | **typed-channel registration** — the kit ships a read-only stdio **MCP server** exposing its two promptless readers as TYPED tools (`path_inventory`: exists / type / size / line count / listing / a small file's text, many paths in ONE call; `repo_search`: literal search, the pattern a JSON string). Their arguments are named JSON fields rather than a string handed to a shell, so a pipe, a redirect or a quote inside a pattern or a path stays DATA and is never interpreted — legal bytes to search for, with no shell to read them as operators. Shipping the server does nothing on its own — a client sees it only once the project declares it, and this mode is that declaration: the `agent-workflow` entry in **`.mcp.json`** (command `node`, args = the absolute path of the RUNNING kit's server) plus `enabledMcpjsonServers` and the two derived tool allow rules in **`.claude/settings.json`**. Preview by default and the **exact entry is printed before consent** (registering a server means your client will run that command); `--apply` writes `.mcp.json` FIRST, then settings, merge-don't-clobber with each file's EOL kept, and a re-apply adds nothing twice. An existing `agent-workflow` entry that **structurally differs** from what this kit copy would write is refused unwritten unless `--replace` is given (the comparison ignores key order, so re-serialized identical bytes are the same registration) — silently changing what an MCP server launches is what consent must not slide past. `--replace` prints the entry standing in `.mcp.json` and the entry it would write, and replaces it only with `--apply`. An existing `.mcp.json` or `.claude/settings.json` is written in place: it keeps its inode, never removed or renamed over; an absent file is created. Where an OS sandbox masks `.mcp.json` with a device node, it writes nothing, exits 0 and names the advisor's `mcp-channel` item, which applies the registration by the consent route. The server is a read-only child of your client (no write, no exec API) running outside the Bash sandbox as the client does. Never writes `settings.local.json`; never commits. |
|
|
255
|
-
| `/agent-workflow-kit rules` | any time | **your project rules** — the kit lays down default rules per theme (the first is project layout: where code, tests and specs live) in `docs/ai/rules/<theme>.md`; your own rules go into `docs/ai/rules/local/<theme>.md` and win where they differ. Tell the agent in plain words what to change: it shows the exact text first and writes your local file only on your yes, then rebuilds the effective file `docs/ai/rules/effective/<theme>.md` that agents read (merging your rules over the kit’s by meaning) and checks it is current. It also
|
|
255
|
+
| `/agent-workflow-kit rules` | any time | **your project rules** — the kit lays down default rules per theme (the first is project layout: where code, tests and specs live) in `docs/ai/rules/<theme>.md`; your own rules go into `docs/ai/rules/local/<theme>.md` and win where they differ. Tell the agent in plain words what to change: it shows the exact text first and writes your local file only on your yes, then rebuilds the effective file `docs/ai/rules/effective/<theme>.md` that agents read (merging your rules over the kit’s by meaning) and checks it is current. It also drops your local rules on request. Never commits. |
|
|
256
256
|
| `/agent-workflow-kit grounding` | any time | **grounded-review facts assembler** — mechanizes populating `agy-review --facts @f`: slices your entry-point's **Hard Constraints** section verbatim (exactly one match, else a loud stop) and/or a plan's three canon sections (`## Goal and boundary` + `## Module ledger` + `## Verification`, each required; duplicates stop), under the same byte budget the agy wrapper enforces (minus `--reserve-bytes` for the artifact share), with a loud tail-trim on overflow. `--autonomy` (AD-044) appends the COMPUTED effective autonomy policy from the git-top `docs/ai/autonomy.json` (every red-line + per-activity level, stated source line; absent file → the computed defaults ARE the policy, exit 0; a malformed policy fails CLOSED, exit 1). `--extra <text|@file>` (repeatable) appends your own facts **byte-verbatim** after the mechanical sections, so the merge is a tool input rather than a shell append — an `@file` must sit inside the proven git work tree (never the git dir) or the system temp surface, and is read through a no-follow descriptor (a FIFO cannot block it, a symlink leaf cannot substitute its target). Prints to stdout; `--out` writes **one scratch file only** — system-temp outside the repo ($TMPDIR / /tmp, rewritable) or a **fresh** gitignored in-repo path (create-only, exclusive write; an existing in-repo file, even gitignored, is refused — the `.env` clobber class); tracked, not-ignored-in-repo, other outside-repo, and symlink/non-regular destinations are all refused. Never commits, never runs a subscription CLI. |
|
|
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. |
|
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: '15.
|
|
6
|
+
version: '15.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": "15.
|
|
3
|
+
"version": "15.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",
|
package/references/contracts.md
CHANGED
|
@@ -94,8 +94,9 @@ On `upgrade`, a pre-1.2.0 deployment with no block gets one (the agent asks, def
|
|
|
94
94
|
## Reserved names and channels
|
|
95
95
|
|
|
96
96
|
Every name the kit bundles and writes over on an upgrade is the kit's, and an edit there is never a
|
|
97
|
-
customization: the kit's scripts outside the spec layer
|
|
98
|
-
by the next upgrade with no question and no copy
|
|
97
|
+
customization: the kit's scripts outside the spec layer, the hook installer set and the kit rules
|
|
98
|
+
files `docs/ai/rules/<theme>.md` are written over by the next upgrade with no question and no copy
|
|
99
|
+
kept. The spec layer's pair files are replaced on
|
|
99
100
|
the upgrade's one yes, the edit kept aside first. A declaration seeded once from a template and never
|
|
100
101
|
replaced by the upgrade's ensures (a migration rewrites one only on the user's explicit yes) is the
|
|
101
102
|
user's own file. A customization goes into one of five channels instead:
|
|
@@ -8,17 +8,16 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/command-shapes.md
|
|
|
8
8
|
|
|
9
9
|
**1. Start with the ensure.** Run `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --only rules --cwd <project>` and relay its line in plain words. The effective file is built, never written by hand: this mode moves no edit out of it, and the ensure's rebuild or the next merge replaces one.
|
|
10
10
|
|
|
11
|
-
**2. Do what the user asks — one of
|
|
11
|
+
**2. Do what the user asks — one of three.**
|
|
12
12
|
|
|
13
13
|
- **Change a rule.** The user says in plain words what to change. Show the exact text you will write to `docs/ai/rules/local/<theme>.md`, its frontmatter included, holding only the user's own rules and never a copy of the kit's, and write it on the user's yes. That request and that yes are the consent for the write of the local file.
|
|
14
|
-
- **Move an edit of the kit file.** When an ensure line for the kit file says it `carries your edit`, whatever token the run printed (`pending` and `regenerated` included), offer the move: compare `docs/ai/rules/<theme>.md` with the bundled `${CLAUDE_SKILL_DIR}/references/rules/<theme>.md`, write the user's changes, by meaning, into the local file (shown first, written on the yes), then delete the kit file. The next ensure seeds it again from the template, so the kit file keeps its one writer.
|
|
15
14
|
- **Drop the local rules.** On the user's request, delete the local file; the next ensure rebuilds the effective file from the kit file and records it.
|
|
16
15
|
- **Change a number.** A request to change a number, a limit's value or its tolerance, is never written into a rules file: the rules are prose and carry no numbers; the kit keeps its numbers in its code, and a project's own number is a reasoned override in the size check's config. Show the exact `node ${CLAUDE_SKILL_DIR}/tools/source-size-check.mjs --override <id> [--value <n>] [--tolerance <p>] --reason "<text>" --cwd <project>` command, passing only the numbers the user named (an option left out keeps the limit's current value or tolerance; `files-per-root` takes `--tolerance` only), with `--kit-default` in their place to return to the kit's numbers; run it on the user's yes and relay its lines. This route ends there: it runs no ensure, merge, record or closing check.
|
|
17
16
|
|
|
18
|
-
**3. After each of the
|
|
17
|
+
**3. After each of the two rules routes, run the ensure again.** On `pending`, do the merge its line states, show the user what changed in the final rules, then run the record command the line prints with the sha256 of the merged file (one plain command for the digest, per the shared command-shapes contract).
|
|
19
18
|
|
|
20
19
|
**It stops on a refusal.** When an ensure run answers `failed`, the record command exits non-zero, or the `--override` command exits non-zero, relay the line and stop: write, delete and record nothing further, and run no closing check as if the change held.
|
|
21
20
|
|
|
22
21
|
**4. End with the checks.** Run `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --only index --cwd <project>`, then `node ${CLAUDE_SKILL_DIR}/tools/project-rules/rules-cli.mjs --check --cwd <project>`, which answers `current` for every theme; relay both in plain words.
|
|
23
22
|
|
|
24
|
-
**What it never does.** It never writes the effective file except with the merge a `pending` line states, never changes the kit file's text
|
|
23
|
+
**What it never does.** It never writes the effective file except with the merge a `pending` line states, never changes the kit file's text, and never writes a local file without the user's request.
|
|
@@ -33,7 +33,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
33
33
|
|
|
34
34
|
**`footprint` — hidden-mode footprint reconcile (D9 / AD-014).** A deployment does not record whether it chose `hidden`, so first **infer visibility** — the dry-run writes **zero bytes** and reports one of — **visible** (the entry point is tracked) → nothing to do; **ambiguous** (untracked but not ignored — could be a fresh uncommitted repo, or a hide that broke) → **ASK** the user which it is, never guess; **hidden** → re-run without `--dry-run` to migrate any older **machine-global** hide to the **project-local** `.git/info/exclude` (one managed block; folds in the legacy `.claude/skills/` line), idempotently (a clean re-run is zero-diff). Handle its surfaced paths exactly as bootstrap step 9 (`${CLAUDE_SKILL_DIR}/references/modes/bootstrap.md`) (already-committed → show `git rm --cached`, ask before `--include`; generic-name present file → ask; **a leftover machine-wide ignore block is kept + reported — the advisor's `footprint-global` item removes it**). This runs on **every** hidden upgrade, like the methodology slot — no lineage-head bump, no migration file.
|
|
35
35
|
|
|
36
|
-
**`configs` — the project-configuration ensures, ONE run.** The ONE command performs **all nine** ensures — orchestration config · gate declaration · autonomy declaration · vehicles declaration · executor check · enforcement scripts · spec layer · project rules · navigator index — in a fixed order, and prints **one outcome line per ensure**: paste those lines into the step 4 / step 8 success report. Every SEED is **create-only** (an existing file is preserved byte-for-byte); a refresh-class op rewrites only what it owns, and the scripts op's store run moves ADR entries, rewrites their inbound links in `docs/ai` pages and regenerates the index, as the rotator does — the outcome tokens by ensure, below, name each arm. One ensure failing **never** skips the others: each reports its own outcome and the run exits non-zero when any of them `failed`. The outcome tokens, by ensure: orchestration → `seeded` / `note-refreshed` / `already-current` / `customized-preserved` / `malformed-preserved`; gates, autonomy and vehicles → `seeded` / `already-present`; executor → `not-placed` / `already-current` / `pending`; scripts → `seeded` / `refreshed` / `already-present` / `not-placed` / `skipped-no-node-evidence`; specs → `seeded` / `refreshed` / `already-present` / `customized-preserved` / `skipped-no-node-evidence`; rules → `seeded` / `refreshed` / `regenerated` / `pending` / `
|
|
36
|
+
**`configs` — the project-configuration ensures, ONE run.** The ONE command performs **all nine** ensures — orchestration config · gate declaration · autonomy declaration · vehicles declaration · executor check · enforcement scripts · spec layer · project rules · navigator index — in a fixed order, and prints **one outcome line per ensure**: paste those lines into the step 4 / step 8 success report. Every SEED is **create-only** (an existing file is preserved byte-for-byte); a refresh-class op rewrites only what it owns, and the scripts op's store run moves ADR entries, rewrites their inbound links in `docs/ai` pages and regenerates the index, as the rotator does — the outcome tokens by ensure, below, name each arm. One ensure failing **never** skips the others: each reports its own outcome and the run exits non-zero when any of them `failed`. The outcome tokens, by ensure: orchestration → `seeded` / `note-refreshed` / `already-current` / `customized-preserved` / `malformed-preserved`; gates, autonomy and vehicles → `seeded` / `already-present`; executor → `not-placed` / `already-current` / `pending`; scripts → `seeded` / `refreshed` / `already-present` / `not-placed` / `skipped-no-node-evidence`; specs → `seeded` / `refreshed` / `already-present` / `customized-preserved` / `skipped-no-node-evidence`; rules → `seeded` / `refreshed` / `regenerated` / `pending` / `already-current`; index → `regenerated` / `already-current` / `customized-preserved`; and any ensure may report `failed`, whose line OPENS with the cause (relay it with that cause — never soften it into a skip; an op that copies file by file also states when it stopped partway). The cause vocabulary is CLOSED — one of `race-unresolved`, `template-unreadable`, `bundle-unreadable`, `adr-store-not-current`, `node-evidence-unverifiable`, `wrong-node-kind`, `vehicle-settings-unreadable`, `write-refused`, `unexpected-error`, `generator-unlaunchable`, `generator-failed`, `index-probe-failed`, `index-stale-after-write` — and every cause that can only arise AFTER the generator ran (`generator-failed`, and `index-probe-failed` / `index-stale-after-write` when they follow a reported regeneration) DISCLOSES in its own line that a write may already have landed. **A non-zero exit STOPs this upgrade — once row 3's replace ask is answered when a replace line printed, then as that ask says** — before the equal-head exit, the migrations and the re-stamp. Add `--dry-run` to preview without writing a byte. Like the pointer slots + the footprint reconcile, all nine reach an equal-head deployment **without a lineage-head bump or a migration file**.
|
|
37
37
|
|
|
38
38
|
**What the orchestration-config ensure does.** `docs/ai/orchestration.json` must exist **and its onboarding note must be current**: created from the canonical seed if missing; if it already exists, **every activity/slot the user set is preserved** and ONLY the `_README` note is refreshed, and only when the existing one still matches a known prior canonical — `refreshIfCanonical` / `refreshReadme` in `tools/orchestration-config.mjs` decide it (CRLF/whitespace normalized first; a *customized* `_README` is preserved verbatim → `customized-preserved`; a *malformed* existing config is **preserved untouched + LOUD** → `malformed-preserved`, never clobbered and never silently skipped). The current note points at `/agent-workflow-kit set-recipe`. **Kit-owned:** in the **delegated** path memory only seeds/preserves the file (memory upgrade step 2) and this ensure applies the `_README` refresh; in the **fallback** path it does both. (Memory stays standalone.)
|
|
39
39
|
|
|
@@ -49,7 +49,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
49
49
|
|
|
50
50
|
**What the spec-layer ensure does.** A deployment older than the feature-spec layer lacks `scripts/spec-schema.mjs` and `docs/ai/specs/index.md`, and its deployed `check-docs-size.mjs` predates the store collapse. In ONE order: the reader pair, then the checker pair — each seeded when absent and REFRESHED only while a file's bytes are a body a release shipped (an append-only digest catalog → `refreshed`; an edited body is preserved verbatim and withholds the writes that depend on it, the checker lane waiting on a byte-current reader pair); the store root is seeded from the bundled template, date rendered, ONLY behind a checker pair current after the run — an older or edited checker renders the store row by row and reds the hook's `--check-index`; edited files are kept aside and replaced on row 3's yes. One token by precedence: `seeded` > `refreshed` > `customized-preserved` (an edited pair, and this run wrote nothing) > `already-present`; `skipped-no-node-evidence` only when neither a root `package.json` nor any kit-seeded `scripts/*.mjs` is present (the same Node-evidence probe the enforcement-script ensure uses; an unreadable probe is `failed` / `node-evidence-unverifiable`). **The adoption state this seed leaves behind is reported, never assumed:** the Recommendations section (step 4 / 8) carries the `spec-adoption` item — `not adopted` (the store is absent: the seed offered, the decline the agent records), `adopting` (a store with no live contract: the decline offered), silenced by a recorded decline (`ack-write --lane spec-adoption`), and a store the probe cannot read is a stated skip — and `status` prints the same state on its own line.
|
|
51
51
|
|
|
52
|
-
**What the project-rules ensure does.** Each theme's kit file `docs/ai/rules/<theme>.md` is seeded, refreshed
|
|
52
|
+
**What the project-rules ensure does.** Each theme's kit file `docs/ai/rules/<theme>.md` is seeded, refreshed from a body a release shipped, and any other body replaced by the template with no question and no copy kept, its line naming the local rules file `docs/ai/rules/local/<theme>.md` for a rule meant to last; with no local file its effective copy and record are rebuilt. With a local file it writes neither: `pending` prints the merge to do and its record command — do the merge, show the user what changed, then run that command.
|
|
53
53
|
|
|
54
54
|
**`gates-migration` — legacy gates.json migration (consented preview — D8).** An EXISTING declaration may still carry the retired review-ledger / fold-completeness checks. Run the preview (dry-run — writes NOTHING), show the user the exact plan, and only on an explicit yes re-run it with `--apply`: canonical legacy entries (matched by their documented single-invocation cmd forms) are REMOVED, the canonical `unit-tests` cmd gains the built-in lcov reporters, and the coverage-check gate is ADDED last — atomic and COMPLETE, so the migrated declaration satisfies `run-gates --final`. **The checker rides a PRODUCER or is not declared at all** (`${CLAUDE_SKILL_DIR}/references/modes/gates.md`): with no gate producing the lcov it reads, the migration does NOT add it, an already-declared one is reported INERT, the result is not called final-run-capable, and the preview prints the paste-ready suite cmd to declare by hand — nothing is ever removed for you. CUSTOMIZED entries are NEVER auto-touched: the preview names each with a paste-ready recovery, and the commit guard must NOT be installed until they are resolved. Of step 3's run-list, only this migration and `tools/checker-gates.mjs` under the `tier` ask change an existing gates.json (the FILL preview runs at init).
|
|
55
55
|
|
package/tools/ensure-configs.mjs
CHANGED
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
// specs scripts/<spec layer> reader + checker pairs seeded when absent, refreshed only on
|
|
14
14
|
// + docs/ai/specs/index.md a shipped prior body, an edited one replaced only on the
|
|
15
15
|
// user's yes; store root seeded behind a current checker
|
|
16
|
-
// rules docs/ai/rules/<theme>.md the kit file seeded,
|
|
17
|
-
// + effective/ + sources.json
|
|
18
|
-
//
|
|
16
|
+
// rules docs/ai/rules/<theme>.md the kit file seeded, refreshed on a shipped prior body, or any
|
|
17
|
+
// + effective/ + sources.json other body replaced, with no question and no copy kept; with no
|
|
18
|
+
// local file the effective copy and its record rebuilt; with one
|
|
19
|
+
// the merge an agent does is named, never done
|
|
19
20
|
// index docs/ai/index.md regenerate-if-missing-or-stale (a GENERATED artifact); under
|
|
20
21
|
// a project hook module that is not the bundled one, a write
|
|
21
22
|
// the project's own checker rejects is put back
|
|
@@ -99,8 +100,9 @@ matches a canonical the kit shipped (your own wording is preserved verbatim); th
|
|
|
99
100
|
and checker pairs, only while a file's bytes are a body a release shipped (an edited file is
|
|
100
101
|
preserved, the writes that depend on it — the spec store root included — are withheld behind it,
|
|
101
102
|
and ONE printed replace block keeps every edit aside and replaces it only on the user's yes); the project rules
|
|
102
|
-
kit file,
|
|
103
|
-
file rebuilt as its copy and recorded where no local file
|
|
103
|
+
kit file, refreshed while its bytes are a body a release shipped and any other body replaced by the template,
|
|
104
|
+
with no question and no copy kept, the effective file rebuilt as its copy and recorded where no local file
|
|
105
|
+
exists; and the navigator index — a GENERATED artifact, regenerated
|
|
104
106
|
whenever it is missing or stale; where a module the project's hook loads is not the bundled one,
|
|
105
107
|
the project's own checker judges the navigator and a write it rejects is put back byte for byte.
|
|
106
108
|
The executor ensure writes nothing: a placed .claude/agents/executor.md whose bytes differ from the
|
|
@@ -7,7 +7,6 @@ import { join } from 'node:path';
|
|
|
7
7
|
import { writeDocsAiFileAtomic, writeProjectFileCreateOnly } from '../atomic-write.mjs';
|
|
8
8
|
import { composeFailure, composeOutcome, tmpNote } from '../ensure-ops.mjs';
|
|
9
9
|
import { shellQuoteArg } from '../repo-lex.mjs';
|
|
10
|
-
import { parseFrontmatter } from '../../references/scripts/check-docs-size.mjs';
|
|
11
10
|
import { digestOf, readRecord, readUnder } from './rules-check.mjs';
|
|
12
11
|
import { writeRecord } from './rules-record.mjs';
|
|
13
12
|
import { RULES_PRIORS, isKnownPrior } from './rules-priors.mjs';
|
|
@@ -58,24 +57,22 @@ const survey = ({ themes, cwd, kitRoot, readFile, deps }) => {
|
|
|
58
57
|
const classifyKit = (name, kit, template, priors) => {
|
|
59
58
|
if (kit.outcome === 'absent') return 'absent';
|
|
60
59
|
if (kit.bytes.equals(template)) return 'current';
|
|
61
|
-
return isKnownPrior(name, kit.bytes, priors) ? 'prior' : '
|
|
60
|
+
return isKnownPrior(name, kit.bytes, priors) ? 'prior' : 'other';
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
const planTheme = ({ theme, paths, template, reads }, record, priors) => {
|
|
65
64
|
const { kit, local, effective } = reads;
|
|
66
65
|
const kitState = classifyKit(theme.name, kit, template, priors);
|
|
67
|
-
const
|
|
68
|
-
const kitWrite = { absent: 'seed', prior: 'refresh' }[kitState] ?? null;
|
|
66
|
+
const kitWrite = { absent: 'seed', prior: 'refresh', other: 'refresh' }[kitState] ?? null;
|
|
69
67
|
const entry = record.ok ? record.themes[theme.name] : undefined;
|
|
70
|
-
const base = { name: theme.name, paths, kitState, kitBytes, kitWrite, effectiveWrite: null, recordWrite: false };
|
|
68
|
+
const base = { name: theme.name, paths, kitState, kitBytes: template, kitWrite, effectiveWrite: null, recordWrite: false };
|
|
71
69
|
if (local.outcome === 'ok') {
|
|
72
|
-
const merged = entry !== undefined && effective.outcome === 'ok' && entry.kit === digestOf(
|
|
70
|
+
const merged = entry !== undefined && effective.outcome === 'ok' && entry.kit === digestOf(template)
|
|
73
71
|
&& entry.local === digestOf(local.bytes) && entry.effective === digestOf(effective.bytes);
|
|
74
72
|
return { ...base, mode: merged ? 'merged' : 'pending', localDigest: digestOf(local.bytes) };
|
|
75
73
|
}
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const passed = { kit: digestOf(kitBytes), local: 'absent', effective: digestOf(kitBytes) };
|
|
74
|
+
const effectiveWrite = effective.outcome === 'absent' ? 'seed' : effective.bytes.equals(template) ? null : 'rebuild';
|
|
75
|
+
const passed = { kit: digestOf(template), local: 'absent', effective: digestOf(template) };
|
|
79
76
|
const recorded = entry !== undefined && entry.kit === passed.kit && entry.local === 'absent' && entry.effective === passed.effective;
|
|
80
77
|
const droppedEdit = effectiveWrite === 'rebuild' && entry !== undefined && entry.effective !== digestOf(effective.bytes);
|
|
81
78
|
return { ...base, mode: 'copy', effectiveWrite, recordWrite: effectiveWrite !== null || !recorded, passed, droppedEdit };
|
|
@@ -86,13 +83,13 @@ const planTheme = ({ theme, paths, template, reads }, record, priors) => {
|
|
|
86
83
|
const KIT_LINES = {
|
|
87
84
|
absent: { written: 'created from the bundled template', stood: 'appeared while this run was creating it and holds the bundled template — it stands', would: 'absent — would be created from the bundled template' },
|
|
88
85
|
prior: { written: 'held the body an earlier release shipped — refreshed to the bundled template', would: 'holds the body an earlier release shipped — would be refreshed to the bundled template' },
|
|
86
|
+
other: { written: 'differs from every body this kit knows it shipped — replaced by the bundled template', would: 'differs from every body this kit knows it shipped — would be replaced by the bundled template' },
|
|
89
87
|
};
|
|
90
88
|
const kitLine = (plan, fate) => {
|
|
91
89
|
const { kit, local } = plan.paths;
|
|
92
90
|
if (plan.kitState === 'current') return `${kit}: already the bundled template — nothing written`;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return `${kit}: ${KIT_LINES[plan.kitState][fate]}`;
|
|
91
|
+
const lasting = plan.kitState === 'other' ? `; a rule meant to last goes in ${local}, where it wins` : '';
|
|
92
|
+
return `${kit}: ${KIT_LINES[plan.kitState][fate]}${lasting}`;
|
|
96
93
|
};
|
|
97
94
|
|
|
98
95
|
const effectiveLine = (plan, fate) => {
|
|
@@ -141,7 +138,7 @@ const tokenOf = (plans, wrote, dryRun) => {
|
|
|
141
138
|
if (plans.some((plan) => plan.kitWrite === 'seed' && wrote(plan, 'kit'))) return token('seeded');
|
|
142
139
|
if (plans.some((plan) => plan.kitWrite === 'refresh' && wrote(plan, 'kit'))) return token('refreshed');
|
|
143
140
|
if (plans.some((plan) => wrote(plan, 'effective') || wrote(plan, 'record'))) return token('regenerated');
|
|
144
|
-
return
|
|
141
|
+
return 'already-current';
|
|
145
142
|
};
|
|
146
143
|
|
|
147
144
|
// ── the writes, in order; the first that fails stops the run ─────────────────────────────────────
|