@sabaiway/agent-workflow-kit 14.43.0 → 14.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/SKILL.md +1 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/contracts.md +2 -0
- package/references/modes/upgrade.md +3 -3
- package/tools/distribution-files/index.mjs +5 -0
- package/tools/distribution-files/kept-aside.mjs +83 -0
- package/tools/distribution-files/replace-set.mjs +69 -0
- package/tools/ensure-configs.mjs +28 -16
- package/tools/ensure-specs.mjs +40 -40
- package/tools/mcp-server.mjs +2 -1
- package/tools/plan-shape-facts.mjs +2 -2
- package/tools/repo-lex.mjs +4 -0
- package/tools/repo-search.mjs +9 -4
- package/tools/upgrade-runlist.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,56 @@ 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
|
+
## 14.45.0 — the kit's search and plan checks no longer walk into the folder of kept-aside copies (AD-197)
|
|
8
|
+
|
|
9
|
+
**A kept-aside copy no longer shows up beside the live file.** Since 14.44.0 the upgrade keeps a replaced edit at
|
|
10
|
+
`.agent-workflow/kept-aside/<16 hex>/<path>`. The kit's literal search (`tools/repo-search.mjs`, the MCP `repo_search`
|
|
11
|
+
tool) walked into that folder, so a project-wide search returned the stale copy next to the live file and an agent
|
|
12
|
+
could read or edit the wrong one; the plan-shape check walked into it too, so a short anchor such as
|
|
13
|
+
`check-docs-size.mjs` could match the copy as well as the live `scripts/check-docs-size.mjs`.
|
|
14
|
+
|
|
15
|
+
- **The search's walk never enters `.git`, `node_modules` or `.agent-workflow`, at any depth**, unless that folder or a
|
|
16
|
+
path inside it is named as a target (`--path`, `--paths-file`, the MCP `paths` field); below a named target the rule
|
|
17
|
+
applies again. A regular file with one of those names is still searched, and a symlink the walk meets is still a
|
|
18
|
+
counted skip. `--help` and the MCP `repo_search` `paths` description name the three folders.
|
|
19
|
+
- **The plan-shape checks never walk into those folders either**, for anchor candidates, the pin search and sweep
|
|
20
|
+
expansion; they have no named exemption.
|
|
21
|
+
- **One list.** `tools/repo-lex.mjs` exports `RESERVED_DIR` and `NEVER_WALKED`; the search and the plan-shape walk
|
|
22
|
+
import `NEVER_WALKED`, and the kept-aside writer imports `RESERVED_DIR`.
|
|
23
|
+
- **`--help` and `-h` are read only at a flag position.** Before, they were read anywhere in the arguments, so MCP
|
|
24
|
+
`repo_search {"pattern": "--help"}` answered with the help text and searched nothing; a pattern or a target spelled
|
|
25
|
+
`--help` is now searched. An unknown argument beside `--help` is a usage error.
|
|
26
|
+
- Contracts: repo-search revision 1 (new; the search had none), plan-review-loop revision 12.
|
|
27
|
+
|
|
28
|
+
## 14.44.0 — before the upgrade replaces a spec-layer file you edited, it keeps your edit aside and names it, under one replace block (AD-196)
|
|
29
|
+
|
|
30
|
+
**An edited spec-layer script is no longer lost on the upgrade's yes.** Before the bundled body replaces it, the
|
|
31
|
+
upgrade copies the edit, unchanged, to `.agent-workflow/kept-aside/<16 hex>/<path>`, reads the copy back and proves its
|
|
32
|
+
sha256; the replace block names that path before the ask, so the yes is given over the exact copy.
|
|
33
|
+
|
|
34
|
+
- **One replace block per run.** `ensure-configs.mjs --reconcile` prints ONE block, when any file's write waits for
|
|
35
|
+
the yes, after every op's lines and before the failure footer, on a plain run, a `--dry-run` and an `--only` run alike: one line per file whose write waits for
|
|
36
|
+
the yes, naming its kept-aside path and where an edit meant to last belongs (for the spec layer: a script or suite of
|
|
37
|
+
your own under its own name in `scripts/`, or a config the script reads), then one command line. The specs op no
|
|
38
|
+
longer prints a replace line of its own. Over the files the specs op names the digest is the one it printed before,
|
|
39
|
+
so a digest an earlier release printed stays valid.
|
|
40
|
+
- **The yes run** (`--replace-custom <digest>`) surveys first and writes nothing when files are still edited but
|
|
41
|
+
the set or its bytes changed since the block printed (`race-unresolved`, with a fresh block); otherwise it keeps every edit aside, proven, before
|
|
42
|
+
the first replace, then replaces, then regenerates the navigator only when nothing failed. Each bound file is
|
|
43
|
+
checked against its bound bytes again right before its own write. No token or cause is added.
|
|
44
|
+
- **`.agent-workflow/` is the family's reserved folder** (`references/contracts.md`). Its own `.gitignore`, holding
|
|
45
|
+
exactly `*` and a line feed, keeps git from seeing a copy in either visibility mode, with no edit of your `.gitignore` or git's
|
|
46
|
+
exclude: it is written when absent and proven before the first copy, and one holding other bytes stops the run with
|
|
47
|
+
nothing copied or replaced. A link or a non-directory on the way, or a copy already there with other bytes, stops
|
|
48
|
+
the run too. The kit never overwrites or deletes a kept-aside copy.
|
|
49
|
+
- The upgrade's row 3 and the `configs` run-list entry ask one yes naming every file the block names, each edit's
|
|
50
|
+
kept-aside copy and that the bundled body replaces it.
|
|
51
|
+
- Recorded debt (`docs/debt.md`): REPLACE-RUN-EMPTY-UNION-MISSES-A-NEW-EDIT — when a replace run's survey finds no
|
|
52
|
+
edited spec-layer file, a file that turns edited before the op's own survey is reported `customized-preserved` with
|
|
53
|
+
no ask; the next plain run asks.
|
|
54
|
+
|
|
55
|
+
Contracts: distribution-files revision 1 (new, under kit/install), docs-navigator revision 2.
|
|
56
|
+
|
|
7
57
|
## 14.43.0 — the commit hook runs your own scripts/pre-commit.local first, and the upgrade delivers that installer (AD-195)
|
|
8
58
|
|
|
9
59
|
**A deployment's own commit checks now go in `scripts/pre-commit.local`, with no edit of a kit file.** The bundled hook
|
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: '14.
|
|
6
|
+
version: '14.45.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": "14.
|
|
3
|
+
"version": "14.45.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
|
@@ -44,6 +44,8 @@ diverge:
|
|
|
44
44
|
|
|
45
45
|
The kit's OWN footprint (`KIT_OWN_PATHS`) — `AGENTS.md`, `CLAUDE.md`, `docs/ai/` (subsumes the stamp), the added `scripts/*.mjs`, `docs/plans/`, `.claude/settings.local.json`, `.claude/settings.json` (hidden-only — visible mode commits it), and `.mcp.json` (the `mcp` mode's registration; hidden-only for the same reason, and it carries an absolute machine path) — is always a candidate in hidden mode.
|
|
46
46
|
|
|
47
|
+
`.agent-workflow/` is the family's reserved folder. Before an upgrade replaces a kit file the user edited, it keeps the edit there, unchanged, at `.agent-workflow/kept-aside/<16 hex>/<path>`; the folder's own `.gitignore` (`*`) keeps git from seeing the copies in either visibility mode. The copies are the user's, outside the kit's own paths: no kit tool overwrites, deletes or hides them. The kit's literal search never walks into the reserved `.agent-workflow` folder, at any depth, unless that folder or a path inside it is named as a target, and the plan-shape checks never walk into it, so an unnamed kept-aside copy never stands beside the live file in their results.
|
|
48
|
+
|
|
47
49
|
Not in this version: a fully-external hidden mode (artifacts relocated outside the repo tree).
|
|
48
50
|
Deferred to a later release + migration.
|
|
49
51
|
|
|
@@ -12,7 +12,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
12
12
|
|
|
13
13
|
1. `pointers` — `node ${CLAUDE_SKILL_DIR}/tools/inject-methodology.mjs reconcile <project>/AGENTS.md` → per pointer: added · already present · skipped (reported) · a hard STOP; per Memory Map row of a rules theme: added · already present · refreshed · skipped (reported).
|
|
14
14
|
2. `footprint` — `node ${CLAUDE_SKILL_DIR}/tools/hide-footprint.mjs --dir <project> --reconcile --dry-run` → visibility: visible · ambiguous · hidden — consent (conditional): ambiguous → ask which it is BEFORE anything; hidden → the conditional re-run without `--dry-run` (its surfaced paths ask per bootstrap step 9).
|
|
15
|
-
3. `configs` — `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --cwd <project>` → one line per ensure: `seeded` / `note-refreshed` / `refreshed` / `regenerated` / `pending` / `already-current` / `customized-preserved` / `malformed-preserved` / `already-present` / `not-placed` / `skipped-no-node-evidence` / `old-adr-layout-migration-instructed` / `failed` — consent (conditional): a
|
|
15
|
+
3. `configs` — `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --cwd <project>` → one line per ensure: `seeded` / `note-refreshed` / `refreshed` / `regenerated` / `pending` / `already-current` / `customized-preserved` / `malformed-preserved` / `already-present` / `not-placed` / `skipped-no-node-evidence` / `old-adr-layout-migration-instructed` / `failed` — consent (conditional): a replace line → ONE yes naming every file its block names, each edit's kept-aside copy and that the bundled body replaces it, asked even on a non-zero exit; on the yes run the printed line, then STOP if that run fails or an op it does not re-run failed; on a no STOP on any failed op.
|
|
16
16
|
4. `gates-migration` — `node ${CLAUDE_SKILL_DIR}/references/scripts/migrate-gates.mjs --kit-tools ${CLAUDE_SKILL_DIR}/tools --cwd <project>` → the preview plan · INERT checker · CUSTOMIZED entries, each named — consent: apply only on an explicit yes, re-run with `--apply`.
|
|
17
17
|
5. `bridges` — `node ${CLAUDE_SKILL_DIR}/tools/setup-backends.mjs --refresh-placed` → per-bridge lines: refreshed · already current · skipped — with its stated reason (not placed / newer than the bundle / unsupported host) · `skipped-readonly` · could not refresh.
|
|
18
18
|
6. `lens` — `node ${CLAUDE_SKILL_DIR}/tools/lens-region.mjs reconcile <project>/docs/ai/agent_rules.md` → per section: refreshed · already current · custom edit preserved · file absent / engine too old — skipped · over the line cap — refused · section absent — noted · a fully absent/invalid engine → hard STOP.
|
|
@@ -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 — 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` / `customized-preserved` / `old-adr-layout-migration-instructed` / `skipped-no-node-evidence`; specs → `seeded` / `refreshed` / `already-present` / `customized-preserved` / `skipped-no-node-evidence`; rules → `seeded` / `refreshed` / `regenerated` / `pending` / `customized-preserved` / `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-layout-unverifiable`, `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
|
|
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 — 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` / `customized-preserved` / `old-adr-layout-migration-instructed` / `skipped-no-node-evidence`; specs → `seeded` / `refreshed` / `already-present` / `customized-preserved` / `skipped-no-node-evidence`; rules → `seeded` / `refreshed` / `regenerated` / `pending` / `customized-preserved` / `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-layout-unverifiable`, `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
|
|
|
@@ -47,7 +47,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
47
47
|
|
|
48
48
|
**What the navigator ensure does.** `docs/ai/index.md` is the always-loaded navigator the entry point declares, and it is GENERATED — no template ships it, so a deployment that never ran the generator boots from a broken entry point (and a Node project's hook fails its index check). The ensure runs the bundled generator's finalizer and reports `regenerated` (it was missing or stale — it was written) or `already-current` (nothing written); under a hook module that is not the bundled one, a write the project's own checker rejects is put back → `customized-preserved`. It never skips a No-Node project: the generator runs from `${CLAUDE_SKILL_DIR}/references/scripts/` on the agent host, not from the project's `scripts/`. **Its position in the run-list is EARLY and therefore NOT authoritative** — `lens` (and, on the migrated path, steps 6–7) still change `docs/ai` afterwards — so the authoritative run is the LATE `--only index` rung documented at both exits; the early one is idempotent: an untouched tree changes nothing.
|
|
49
49
|
|
|
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 replaced
|
|
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 legacy-ADR instruct never withholds it. **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
52
|
**What the project-rules ensure does.** Each theme's kit file `docs/ai/rules/<theme>.md` is seeded, refreshed only from a body a release shipped (an edit is kept, its line saying it carries your edit), and 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. A kit-file line saying it carries your edit, whatever the run's token, is offered `/agent-workflow-kit rules` to move the edit into the local file.
|
|
53
53
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// index.mjs — the one door into distribution-files/: what ensure-configs.mjs and ensure-specs.mjs
|
|
2
|
+
// import, each the very export of the leaf that owns it. No kit module outside this directory
|
|
3
|
+
// imports a leaf directly.
|
|
4
|
+
|
|
5
|
+
export { keptAsidePath, replaceBlock, runReplace } from './replace-set.mjs';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// kept-aside.mjs — where an upgrade keeps a user's edit before the bundled body replaces it:
|
|
2
|
+
// `.agent-workflow/kept-aside/<the first 16 hex of the replace set's digest>/<rel>` at the project
|
|
3
|
+
// root. Every copy is written create-only from the bytes the survey read (never a re-read of the
|
|
4
|
+
// source), read back and proven against the sha256 the digest bound, before anything is replaced.
|
|
5
|
+
// `.agent-workflow/.gitignore` holding exactly `*` and a line feed is proven before the first copy,
|
|
6
|
+
// so no stop leaves a copy git can see, with no edit of the user's own ignore files. The kit never
|
|
7
|
+
// overwrites or deletes a kept-aside copy: a copy with other bytes is the user's to move.
|
|
8
|
+
//
|
|
9
|
+
// Dependency-free, Node >= 22. Every fs primitive is injectable (deps.*). No side effects on import.
|
|
10
|
+
|
|
11
|
+
import { lstatSync, readFileSync } from 'node:fs';
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { lstatNoFollow, writeProjectFileCreateOnly } from '../atomic-write.mjs';
|
|
15
|
+
import { RESERVED_DIR } from '../repo-lex.mjs';
|
|
16
|
+
|
|
17
|
+
export const KEPT_ASIDE_DIR = `${RESERVED_DIR}/kept-aside`;
|
|
18
|
+
const IGNORE_REL = `${RESERVED_DIR}/.gitignore`;
|
|
19
|
+
const IGNORE_BODY = '*\n';
|
|
20
|
+
|
|
21
|
+
export const keptAsidePath = (digest, rel) => `${KEPT_ASIDE_DIR}/${digest.slice(0, 16)}/${rel}`;
|
|
22
|
+
|
|
23
|
+
const sha256 = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
24
|
+
const causeOf = (err) => String((err && err.message) || err);
|
|
25
|
+
const kindOf = (st) => (st.isSymbolicLink() ? 'a symlink' : st.isDirectory() ? 'a directory' : st.isFile() ? 'a regular file' : 'not a regular file');
|
|
26
|
+
const NOTHING_DONE = 'nothing was kept aside or replaced';
|
|
27
|
+
|
|
28
|
+
// The node-kind preflight, before anything is created: every directory from the project root down
|
|
29
|
+
// to each copy's parent must be a real directory, and each copy path and the ignore file a regular
|
|
30
|
+
// file when present. Returns the refusal line, or null.
|
|
31
|
+
const chainRefusal = (cwd, rels, lstat) => {
|
|
32
|
+
for (const rel of rels) {
|
|
33
|
+
const parts = rel.split('/');
|
|
34
|
+
for (let i = 1; i <= parts.length; i += 1) {
|
|
35
|
+
const sub = parts.slice(0, i).join('/');
|
|
36
|
+
const st = lstatNoFollow(join(cwd, sub), lstat);
|
|
37
|
+
const leaf = i === parts.length;
|
|
38
|
+
if (st && (leaf ? !st.isFile() : !st.isDirectory())) return `${sub}: exists but is ${kindOf(st)} — ${NOTHING_DONE}; resolve it by hand, then re-run`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const fail = (cause, line, kept) => {
|
|
45
|
+
const written = kept.filter((copy) => copy.created).map((copy) => copy.path);
|
|
46
|
+
const note = written.length > 0 ? [`the edits already kept aside stay where they are: ${written.join(', ')}`] : [];
|
|
47
|
+
return { failed: true, cause, lines: [line, ...note], kept };
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// keepAside({ cwd, digest, entries, deps }) → { failed: false, kept } with every edited entry's copy
|
|
51
|
+
// proven, or { failed: true, cause, lines, kept } naming why and which copies were already written.
|
|
52
|
+
// An absent entry gets no copy. `kept` lists { rel, path, created } per proven copy.
|
|
53
|
+
export const keepAside = ({ cwd, digest, entries, deps = {} }) => {
|
|
54
|
+
const lstat = deps.lstat ?? lstatSync;
|
|
55
|
+
const read = deps.readFile ?? readFileSync;
|
|
56
|
+
const edited = entries.filter((entry) => !entry.absent).sort((a, b) => (a.rel < b.rel ? -1 : 1));
|
|
57
|
+
const kept = [];
|
|
58
|
+
if (edited.length === 0) return { failed: false, kept };
|
|
59
|
+
const refusal = chainRefusal(cwd, [IGNORE_REL, ...edited.map((entry) => keptAsidePath(digest, entry.rel))], lstat);
|
|
60
|
+
if (refusal) return fail('wrong-node-kind', refusal, kept);
|
|
61
|
+
let at = IGNORE_REL;
|
|
62
|
+
try {
|
|
63
|
+
if (lstatNoFollow(join(cwd, IGNORE_REL), lstat) === null) {
|
|
64
|
+
writeProjectFileCreateOnly(cwd, IGNORE_REL, IGNORE_BODY, deps, { noun: 'the kept-aside ignore file' });
|
|
65
|
+
}
|
|
66
|
+
if (String(read(join(cwd, IGNORE_REL))) !== IGNORE_BODY) {
|
|
67
|
+
return fail('write-refused', `${IGNORE_REL}: holds other bytes — it must hold exactly "*" and a line feed, so git sees no kept-aside copy; ${NOTHING_DONE}`, kept);
|
|
68
|
+
}
|
|
69
|
+
for (const entry of edited) {
|
|
70
|
+
const path = keptAsidePath(digest, entry.rel);
|
|
71
|
+
const abs = join(cwd, path);
|
|
72
|
+
at = path;
|
|
73
|
+
const created = lstatNoFollow(abs, lstat) === null && writeProjectFileCreateOnly(cwd, path, entry.bytes, deps, { noun: 'a kept-aside copy' }).created;
|
|
74
|
+
if (sha256(read(abs)) !== entry.sha256) {
|
|
75
|
+
return fail('race-unresolved', `${path}: a copy with other bytes is there — it is the user's to move or delete before the yes is asked again; nothing was replaced`, kept);
|
|
76
|
+
}
|
|
77
|
+
kept.push({ rel: entry.rel, path, created });
|
|
78
|
+
}
|
|
79
|
+
} catch (err) {
|
|
80
|
+
return fail('write-refused', `${at}: ${causeOf(err)} — nothing was replaced`, kept);
|
|
81
|
+
}
|
|
82
|
+
return { failed: false, kept };
|
|
83
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// replace-set.mjs — the ONE replace block an upgrade prints over every file whose write waits for the
|
|
2
|
+
// user's yes, and the replace run that yes starts. An op that owns such writes reports entries on its
|
|
3
|
+
// outcome: { rel, sha256, bytes, channel } for an edited file, { rel, absent: true, channel } for an
|
|
4
|
+
// absent one. This module binds their union into one digest, prints one block over it, and on the yes
|
|
5
|
+
// keeps every edit aside (kept-aside.mjs) before any owning op replaces a byte. It never imports
|
|
6
|
+
// ensure-configs.mjs: the CLI hands it the ops it runs.
|
|
7
|
+
//
|
|
8
|
+
// Dependency-free, Node >= 22. No side effects on import.
|
|
9
|
+
|
|
10
|
+
import { createHash } from 'node:crypto';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { composeFailure } from '../ensure-ops.mjs';
|
|
13
|
+
import { shellQuoteArg } from '../repo-lex.mjs';
|
|
14
|
+
import { keepAside, keptAsidePath } from './kept-aside.mjs';
|
|
15
|
+
|
|
16
|
+
export { keptAsidePath };
|
|
17
|
+
|
|
18
|
+
const INDEX_NOT_RUN = 'the navigator step did not run: a replace run runs it only after the spec layer succeeds';
|
|
19
|
+
const RACE_LINE = 'the files to replace changed since the replace line was printed (another set or other bytes), so nothing was written — ask the user again over the fresh block below';
|
|
20
|
+
|
|
21
|
+
// The digest binds the set AND the bytes: `<rel> <sha256>` or `<rel> absent`, sorted by rel in
|
|
22
|
+
// code-unit order, LF-joined. Over an all-edited set it is the digest the specs op printed before.
|
|
23
|
+
const byRel = (a, b) => (a.rel < b.rel ? -1 : 1);
|
|
24
|
+
const digestLine = (entry) => `${entry.rel} ${entry.absent ? 'absent' : entry.sha256}`;
|
|
25
|
+
export const replaceSetDigest = (entries) => createHash('sha256').update([...entries].sort(byRel).map(digestLine).join('\n')).digest('hex');
|
|
26
|
+
|
|
27
|
+
const entryLine = (entry, digest) => (entry.absent
|
|
28
|
+
? `${entry.rel}: absent — the user's yes places the bundled body`
|
|
29
|
+
: `${entry.rel}: carries an edit — on the user's yes it is kept aside at ${keptAsidePath(digest, entry.rel)}, then the bundled body replaces it; an edit meant to last goes in ${entry.channel}`);
|
|
30
|
+
|
|
31
|
+
// One line per entry in rel order, then the ONE command line, its condition first and both paths
|
|
32
|
+
// shell-quoted; no line at all for an empty set.
|
|
33
|
+
export const replaceBlock = (entries, { kitRoot, cwd }) => {
|
|
34
|
+
if (entries.length === 0) return [];
|
|
35
|
+
const digest = replaceSetDigest(entries);
|
|
36
|
+
return [
|
|
37
|
+
...[...entries].sort(byRel).map((entry) => entryLine(entry, digest)),
|
|
38
|
+
`only on the user's yes, keep aside and replace the files named above: node ${shellQuoteArg(join(kitRoot, 'tools', 'ensure-configs.mjs'))} --reconcile --replace-custom ${digest} --cwd ${shellQuoteArg(cwd)}`,
|
|
39
|
+
];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// runReplace({ cwd, kitRoot, digest, owning, index, deps }) → { outcomes, block }. `owning` is
|
|
43
|
+
// [{ op, run }] in ENSURE_OPS order and `index` the navigator's run; each run(args) returns an
|
|
44
|
+
// outcome and never throws (the CLI wraps it). `block` carries the recomputed union only when the
|
|
45
|
+
// digest differs — every other outcome of a replace run prints no block.
|
|
46
|
+
export const runReplace = ({ cwd, kitRoot, digest, owning, index, deps = {} }) => {
|
|
47
|
+
const notRun = (outcome) => ({ ...outcome, lines: [...outcome.lines, INDEX_NOT_RUN] });
|
|
48
|
+
const surveys = [];
|
|
49
|
+
for (const { op, run } of owning) {
|
|
50
|
+
const survey = run({ cwd, kitRoot, dryRun: true, deps });
|
|
51
|
+
if (survey.failed) return { outcomes: [notRun(survey)], block: [] };
|
|
52
|
+
surveys.push({ run, entries: survey.entries ?? [] });
|
|
53
|
+
}
|
|
54
|
+
const union = surveys.flatMap((survey) => survey.entries);
|
|
55
|
+
const first = owning[0].op;
|
|
56
|
+
if (union.length > 0 && replaceSetDigest(union) !== digest) {
|
|
57
|
+
return { outcomes: [notRun(composeFailure(first, 'race-unresolved', RACE_LINE))], block: union };
|
|
58
|
+
}
|
|
59
|
+
const kept = keepAside({ cwd, digest, entries: union, deps });
|
|
60
|
+
if (kept.failed) return { outcomes: [notRun(composeFailure(first, kept.cause, ...kept.lines))], block: [] };
|
|
61
|
+
const outcomes = [];
|
|
62
|
+
for (const survey of surveys) {
|
|
63
|
+
const replace = union.length > 0 ? { digest, entries: survey.entries } : undefined;
|
|
64
|
+
const outcome = survey.run({ cwd, kitRoot, dryRun: false, deps, replace });
|
|
65
|
+
if (outcome.failed) return { outcomes: [...outcomes, notRun(outcome)], block: [] };
|
|
66
|
+
outcomes.push(outcome);
|
|
67
|
+
}
|
|
68
|
+
return { outcomes: [...outcomes, index({ cwd, kitRoot, dryRun: false, deps })], block: [] };
|
|
69
|
+
};
|
package/tools/ensure-configs.mjs
CHANGED
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
// • --dry-run reports `would-*` tokens and writes nothing — never a write token.
|
|
28
28
|
// • The ops run in a FIXED order and one op's failure NEVER skips the rest: every op reports its own
|
|
29
29
|
// token, and the exit is non-zero when any of them failed. The one exception is the replace run
|
|
30
|
-
// (--replace-custom <digest>)
|
|
30
|
+
// (--replace-custom <digest>), which distribution-files/ runs: each edit kept aside, then the
|
|
31
|
+
// owning ops (specs), then index only when none failed.
|
|
32
|
+
// • ONE replace block, after every op's lines and before the failure footer, over the entries of
|
|
33
|
+
// every op that ran: the files whose write waits for the user's yes, and the one command for it.
|
|
31
34
|
// • The deployment gate runs ONCE, before any op: an absent/symlinked docs/ai stops the whole run
|
|
32
35
|
// with the gate's own message rather than one copy of it per op.
|
|
33
36
|
//
|
|
@@ -45,12 +48,15 @@ import { ensureExecutor } from './ensure-executor.mjs';
|
|
|
45
48
|
import { ENSURE_OPS, OWN_IMPLEMENTATIONS, failedOutcome } from './ensure-ops.mjs';
|
|
46
49
|
import { ensureSpecs } from './ensure-specs.mjs';
|
|
47
50
|
import { ensureRules } from './project-rules/index.mjs';
|
|
51
|
+
import { replaceBlock, runReplace } from './distribution-files/index.mjs';
|
|
48
52
|
|
|
49
53
|
const KIT_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
50
54
|
|
|
51
55
|
// The op table this CLI walks — name → implementation, in ENSURE_OPS order. Composed HERE (the one
|
|
52
56
|
// consumer) because the executor, spec-layer and rules ensures import ensure-ops.mjs for their outcome door and probes.
|
|
53
57
|
export const ENSURE_IMPLEMENTATIONS = Object.freeze({ ...OWN_IMPLEMENTATIONS, executor: ensureExecutor, specs: ensureSpecs, rules: ensureRules });
|
|
58
|
+
// The ops whose writes wait for the user's yes and so own the replace run, in ENSURE_OPS order.
|
|
59
|
+
const OWNING_OPS = ['specs'];
|
|
54
60
|
|
|
55
61
|
const EXIT_OK = 0;
|
|
56
62
|
const EXIT_FAILED = 1;
|
|
@@ -66,7 +72,6 @@ const EMPTY_REPLACE = '--replace-custom needs the digest its replace line printe
|
|
|
66
72
|
const REPEATED_REPLACE = '--replace-custom was passed more than once — a replace run carries exactly ONE digest';
|
|
67
73
|
const REPLACE_WITH_ONLY = '--replace-custom runs the spec layer and then the navigator, so it cannot be combined with --only — nothing was run';
|
|
68
74
|
const REPLACE_WITH_DRY_RUN = "--replace-custom writes on the user's yes, so it cannot be combined with --dry-run — nothing was run";
|
|
69
|
-
const INDEX_NOT_RUN = 'the navigator step did not run: a replace run runs it only after the spec layer succeeds';
|
|
70
75
|
|
|
71
76
|
const HELP = `ensure-configs — the nine stamp-independent upgrade ensures, as ONE command.
|
|
72
77
|
|
|
@@ -78,9 +83,9 @@ Usage:
|
|
|
78
83
|
--dry-run report what each ensure WOULD do; write nothing
|
|
79
84
|
--only <op> run EXACTLY ONE of them (an unknown, missing or repeated value is a usage error)
|
|
80
85
|
--replace-custom <digest>
|
|
81
|
-
the replace run the
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
the replace run the replace block prints, run only on the user's yes: every edit its
|
|
87
|
+
digest names is kept aside under .agent-workflow/kept-aside/, then replaced, then index
|
|
88
|
+
runs when nothing failed (not with --only or --dry-run; an empty value is a usage error)
|
|
84
89
|
--cwd <dir> the target project (default: the current directory)
|
|
85
90
|
--help, -h this help
|
|
86
91
|
|
|
@@ -89,7 +94,7 @@ refreshed in place. Four ops refresh instead: the orchestration onboarding note,
|
|
|
89
94
|
matches a canonical the kit shipped (your own wording is preserved verbatim); the spec-layer reader
|
|
90
95
|
and checker pairs, only while a file's bytes are a body a release shipped (an edited file is
|
|
91
96
|
preserved, the writes that depend on it — the spec store root included — are withheld behind it,
|
|
92
|
-
and ONE printed replace
|
|
97
|
+
and ONE printed replace block keeps every edit aside and replaces it only on the user's yes); the project rules
|
|
93
98
|
kit file, only while its bytes are a body a release shipped (an edited one is kept), with the effective
|
|
94
99
|
file rebuilt as its copy and recorded where no local file exists; and the navigator index — a GENERATED artifact, regenerated
|
|
95
100
|
whenever it is missing or stale; where a module the project's hook loads is not the bundled one,
|
|
@@ -162,16 +167,20 @@ const runOne = (op, args) => {
|
|
|
162
167
|
|
|
163
168
|
// Run every op in ENSURE_OPS order. A throw from one op becomes THAT op's failed outcome — the
|
|
164
169
|
// remaining ops still run, because a project missing its gate declaration should not also be left
|
|
165
|
-
// without its autonomy seed just because the first ensure hit an unreadable file.
|
|
166
|
-
// the
|
|
170
|
+
// without its autonomy seed just because the first ensure hit an unreadable file. → { outcomes, block }:
|
|
171
|
+
// the block is the union of the entries of the ops that ran. The replace run is the one exception,
|
|
172
|
+
// handed to runReplace: it keeps every edit aside, runs the owning ops, then index only when none
|
|
173
|
+
// failed, and its block is non-empty only when the digest no longer matches.
|
|
167
174
|
export const runEnsures = ({ cwd, kitRoot, dryRun, deps, only, replaceCustom }) => {
|
|
168
|
-
if (replaceCustom
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
if (replaceCustom !== undefined) {
|
|
176
|
+
const owning = OWNING_OPS.map((op) => ({ op, run: (args) => runOne(op, args) }));
|
|
177
|
+
return runReplace({ cwd, kitRoot, digest: replaceCustom, owning, index: (args) => runOne('index', args), deps });
|
|
178
|
+
}
|
|
179
|
+
const outcomes = (only ? [only] : ENSURE_OPS).map((op) => runOne(op, { cwd, kitRoot, dryRun, deps }));
|
|
180
|
+
return { outcomes, block: outcomes.flatMap((o) => o.entries ?? []) };
|
|
172
181
|
};
|
|
173
182
|
|
|
174
|
-
const render = (outcomes, dryRun, only, replace) => {
|
|
183
|
+
const render = ({ outcomes, block }, { dryRun, only, replace, kitRoot, cwd }) => {
|
|
175
184
|
// The banner names the tool + the flag it ran under (both machine tokens the L2 rule exempts);
|
|
176
185
|
// the failure footer is a user-grade sentence — the composed-lines guard scans both.
|
|
177
186
|
const scope = only ? `, --only ${only}` : replace ? ', --replace-custom' : '';
|
|
@@ -180,6 +189,8 @@ const render = (outcomes, dryRun, only, replace) => {
|
|
|
180
189
|
lines.push(` ${o.op}: ${o.token}`);
|
|
181
190
|
for (const detail of o.lines) lines.push(` ${detail}`);
|
|
182
191
|
}
|
|
192
|
+
const blockLines = replaceBlock(block, { kitRoot, cwd });
|
|
193
|
+
if (blockLines.length > 0) lines.push('', ...blockLines.map((line) => ` ${line}`));
|
|
183
194
|
if (outcomes.some((o) => o.failed)) {
|
|
184
195
|
// No blanket claim about what was written: an op that copies file by file can stop PARTWAY, and
|
|
185
196
|
// its own lines are the only accurate account of what landed.
|
|
@@ -197,10 +208,11 @@ export const main = (argv = [], ctx = {}) => {
|
|
|
197
208
|
// ONE deployment gate for the whole run (see the header): with no docs/ai there is nothing to
|
|
198
209
|
// reconcile, and one identical STOP per op would read as that many separate problems.
|
|
199
210
|
assertDocsAiDeployment(cwd, deps, { noun: 'the project configuration', rel: 'under docs/ai' });
|
|
200
|
-
const
|
|
211
|
+
const kitRoot = ctx.kitRoot ?? KIT_ROOT;
|
|
212
|
+
const run = runEnsures({ cwd, kitRoot, dryRun: args.dryRun, deps, only: args.only, replaceCustom: args.replaceCustom });
|
|
201
213
|
return {
|
|
202
|
-
code: outcomes.some((o) => o.failed) ? EXIT_FAILED : EXIT_OK,
|
|
203
|
-
stdout: render(
|
|
214
|
+
code: run.outcomes.some((o) => o.failed) ? EXIT_FAILED : EXIT_OK,
|
|
215
|
+
stdout: render(run, { dryRun: args.dryRun, only: args.only, replace: args.replaceCustom !== undefined, kitRoot, cwd }),
|
|
204
216
|
stderr: '',
|
|
205
217
|
};
|
|
206
218
|
} catch (err) {
|
package/tools/ensure-specs.mjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// a FIXED order the measured coupling dictates:
|
|
4
4
|
// 1. the reader pair scripts/spec-schema.mjs + .test.mjs — created when absent; since 2a
|
|
5
5
|
// also REFRESHED when the deployed bytes are a body a release shipped (script-priors.mjs), a
|
|
6
|
-
// custom body preserved verbatim
|
|
7
|
-
//
|
|
6
|
+
// custom body preserved verbatim and reported as a replace entry (distribution-files/): the
|
|
7
|
+
// ONE replace block keeps it aside and replaces it only on the user's yes;
|
|
8
8
|
// 2. the checker pair scripts/check-docs-size.mjs + .test.mjs — the same prior-refresh lane, and
|
|
9
9
|
// only behind a reader pair this run leaves byte-current;
|
|
10
10
|
// 3. the store root docs/ai/specs/index.md — seeded (placeholders rendered)
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
// The state table (enumerate by PROOF, never by exclusion): every file is classified into exactly one
|
|
18
18
|
// of current | prior | custom | absent | wrong-kind before anything is written, each write admits
|
|
19
19
|
// through ONE conjunction of those facts (decideWrites), and every other cell is a stated refusal —
|
|
20
|
-
// a custom file of either pair preserves itself AND withholds every write that depends on it
|
|
21
|
-
//
|
|
22
|
-
//
|
|
20
|
+
// a custom file of either pair preserves itself AND withholds every write that depends on it. Under
|
|
21
|
+
// the replace the driver hands back (`replace: { digest, entries }`), the bound custom files are
|
|
22
|
+
// rewritten. Writes run in order and each is idempotent, so a stopped run converges on the next.
|
|
23
23
|
//
|
|
24
24
|
// Dependency-free, Node >= 22. Every fs primitive is injectable (deps.*). No side effects on import.
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ import { join } from 'node:path';
|
|
|
28
28
|
import { writeContainedFileAtomic, writeProjectFileCreateOnly } from './atomic-write.mjs';
|
|
29
29
|
import { classifyDeployedScript, digestOf } from './script-priors.mjs';
|
|
30
30
|
import { composeFailure, composeOutcome, nodeEvidenceRefusal, probeSeedTarget, tmpNote } from './ensure-ops.mjs';
|
|
31
|
-
import {
|
|
31
|
+
import { keptAsidePath } from './distribution-files/index.mjs';
|
|
32
32
|
|
|
33
33
|
const OP = 'specs';
|
|
34
34
|
const SCRIPTS_DIR = 'scripts';
|
|
@@ -36,13 +36,12 @@ const BUNDLED_SCRIPTS = ['references', 'scripts'];
|
|
|
36
36
|
const STORE_ROOT_REL = 'docs/ai/specs/index.md';
|
|
37
37
|
const STORE_ROOT_TEMPLATE = ['references', 'templates', 'specs', 'index.md'];
|
|
38
38
|
const DATE_PLACEHOLDER = '{{DATE}}';
|
|
39
|
+
const CHANNEL = 'a script or suite of your own under its own name in scripts/, or a config the script reads';
|
|
39
40
|
// Explicit pairs, deliberately NOT aliased to the catalog's PRIOR_FILES (which spans both): each
|
|
40
41
|
// file is surveyed exactly once. Exported so the suite pins pairs-union === catalog domain.
|
|
41
42
|
export const READER_PAIR = Object.freeze(['spec-schema.mjs', 'spec-schema.test.mjs']);
|
|
42
43
|
export const CHECKER_PAIR = Object.freeze(['check-docs-size.mjs', 'check-docs-size.test.mjs']);
|
|
43
44
|
|
|
44
|
-
const ok = (token, lines) => composeOutcome(OP, token, lines, false);
|
|
45
|
-
const loud = (cause, ...lines) => composeFailure(OP, cause, ...lines);
|
|
46
45
|
const causeOf = (err) => String((err && err.message) || err);
|
|
47
46
|
const todayIso = () => new Date().toISOString().slice(0, 10);
|
|
48
47
|
|
|
@@ -65,10 +64,6 @@ const surveyScript = ({ cwd, kitRoot, name, read, lstat }) => {
|
|
|
65
64
|
return { rel, name, state: classifyDeployedScript(bytes, name, bundle), bundle, bytes };
|
|
66
65
|
};
|
|
67
66
|
|
|
68
|
-
// The custom set's digest binds the set AND the bytes: the rel-sorted `<rel> <sha256>` lines, LF-joined.
|
|
69
|
-
export const customSetDigest = (files) =>
|
|
70
|
-
digestOf([...files].sort((a, b) => (a.rel < b.rel ? -1 : 1)).map((f) => `${f.rel} ${digestOf(f.bytes)}`).join('\n'));
|
|
71
|
-
|
|
72
67
|
const surveyStoreRoot = (cwd, lstat) => {
|
|
73
68
|
const probe = probeSeedTarget(join(cwd, STORE_ROOT_REL), lstat);
|
|
74
69
|
if (probe.wrongKind) return { rel: STORE_ROOT_REL, state: 'wrong-kind', wrongKind: probe.wrongKind };
|
|
@@ -110,14 +105,14 @@ export const decideWrites = ({ reader, checker, store }, replace = false) => {
|
|
|
110
105
|
// Every file's line is a function of its surveyed state and the FATE of its write this run:
|
|
111
106
|
// `written` · `stood` (lost the create-only race to the bundled body) · `would` (dry run) ·
|
|
112
107
|
// `withheld` (a custom file in the pair) · `stopped` (the run failed before reaching it) · `none`
|
|
113
|
-
// (no write was admitted or needed). A line never claims a write that did not happen.
|
|
108
|
+
// (no write was admitted or needed). A line never claims a write that did not happen. Under the
|
|
109
|
+
// replace a custom line names its kept-aside copy and never points at a block below.
|
|
114
110
|
const LEFT_FOR = { withheld: 'it waits on the pair named above', stopped: 'the run stopped before it' };
|
|
115
111
|
const SCRIPT_LINES = {
|
|
116
112
|
current: () => 'already the bundled body — nothing written',
|
|
117
|
-
custom: (fate) => ({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
})[fate] ?? "carries a body this kit did not ship as current — preserved verbatim; the writes that depend on it wait until it is replaced on the user's yes (the replace line below)",
|
|
113
|
+
custom: (fate, kept) => (fate === 'written' ? `carried an edit — kept aside at ${kept}, then replaced by the bundled body on the user's yes`
|
|
114
|
+
: kept !== undefined ? `carries an edit — not replaced${kept ? `; its copy kept aside at ${kept} stays` : ''}`
|
|
115
|
+
: "carries an edit — left as it stands until the user's yes keeps it aside and replaces it (the block below); the writes that depend on it wait"),
|
|
121
116
|
absent: (fate) => ({
|
|
122
117
|
written: 'copied from the bundled scripts',
|
|
123
118
|
stood: 'appeared while this run was seeding it — the bundled body stands',
|
|
@@ -128,7 +123,7 @@ const SCRIPT_LINES = {
|
|
|
128
123
|
would: 'would be refreshed to the bundled one',
|
|
129
124
|
})[fate] ?? `left as is; ${LEFT_FOR[fate]}`}`,
|
|
130
125
|
};
|
|
131
|
-
const scriptLine = (f, fate) => `${f.rel}: ${SCRIPT_LINES[f.state](fate)}`;
|
|
126
|
+
const scriptLine = (f, fate, keptOf) => `${f.rel}: ${SCRIPT_LINES[f.state](fate, keptOf?.(f.rel))}`;
|
|
132
127
|
const STORE_LINES = {
|
|
133
128
|
present: 'already present — preserved byte-for-byte, nothing written',
|
|
134
129
|
written: "created from the bundled template (today's date rendered)",
|
|
@@ -151,20 +146,18 @@ const fateOf = (rel, { writes, fates, withheld, stopped }) => {
|
|
|
151
146
|
if (writes.some((w) => relOf(w) === rel)) return stopped ? 'stopped' : 'would';
|
|
152
147
|
return withheld ? 'withheld' : 'none';
|
|
153
148
|
};
|
|
154
|
-
const composeLines = ({ reader, checker, store, writes, fates, withheld, stopped }) => {
|
|
149
|
+
const composeLines = ({ reader, checker, store, writes, fates, withheld, stopped, keptOf }) => {
|
|
155
150
|
const fate = (rel) => fateOf(rel, { writes, fates, withheld, stopped });
|
|
156
|
-
const lines = [...reader, ...checker].map((f) => scriptLine(f, fate(f.rel)));
|
|
151
|
+
const lines = [...reader, ...checker].map((f) => scriptLine(f, fate(f.rel), keptOf));
|
|
157
152
|
const storeFate = fate(STORE_ROOT_REL);
|
|
158
153
|
const custom = [...reader, ...checker].filter((f) => f.state === 'custom').map((f) => f.rel);
|
|
159
154
|
if (store.state === 'present' || storeFate !== 'none') lines.push(storeLine(store, storeFate, custom));
|
|
160
155
|
return lines;
|
|
161
156
|
};
|
|
162
157
|
|
|
163
|
-
//
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
]);
|
|
167
|
-
const RACE_LINE = 'the edited files changed since the replace line was printed (another set or other bytes), so nothing was written — ask the user again with the fresh replace line below';
|
|
158
|
+
// Under the replace the op's own survey must yield exactly the entries the yes bound.
|
|
159
|
+
const sameEntries = (own, bound) =>
|
|
160
|
+
own.length === bound.length && own.every((e) => bound.some((b) => b.rel === e.rel && !b.absent && b.sha256 === e.sha256));
|
|
168
161
|
|
|
169
162
|
// A per-file loop can stop partway; the run says which files already landed — never "nothing happened".
|
|
170
163
|
const partialNote = (count) =>
|
|
@@ -180,7 +173,7 @@ const renderStoreRoot = (kitRoot, read, today) => {
|
|
|
180
173
|
return body;
|
|
181
174
|
};
|
|
182
175
|
|
|
183
|
-
export const ensureSpecs = ({ cwd, kitRoot, dryRun = false, deps = {},
|
|
176
|
+
export const ensureSpecs = ({ cwd, kitRoot, dryRun = false, deps = {}, replace }) => {
|
|
184
177
|
const lstat = deps.lstat ?? lstatSync;
|
|
185
178
|
const read = deps.readFile ?? readFileSync;
|
|
186
179
|
const refusal = nodeEvidenceRefusal(OP, cwd, lstat);
|
|
@@ -190,21 +183,24 @@ export const ensureSpecs = ({ cwd, kitRoot, dryRun = false, deps = {}, replaceCu
|
|
|
190
183
|
const checker = CHECKER_PAIR.map(survey);
|
|
191
184
|
const store = surveyStoreRoot(cwd, lstat);
|
|
192
185
|
for (const f of [...reader, ...checker]) {
|
|
193
|
-
if (f.state === 'bundle-unreadable') return
|
|
186
|
+
if (f.state === 'bundle-unreadable') return composeFailure(OP, 'bundle-unreadable', `${f.rel}: the bundled script could not be read, so nothing was written — reinstall the kit. ${f.error}`);
|
|
194
187
|
}
|
|
195
188
|
for (const f of [...reader, ...checker, store]) {
|
|
196
|
-
if (f.state === 'wrong-kind') return
|
|
189
|
+
if (f.state === 'wrong-kind') return composeFailure(OP, 'wrong-node-kind', `${f.rel}: exists but is ${f.wrongKind} — nothing was read or written; resolve it by hand, then re-run`);
|
|
197
190
|
}
|
|
198
191
|
|
|
192
|
+
// The survey completed: its entries ride every outcome from here on, a failed one included.
|
|
199
193
|
const custom = [...reader, ...checker].filter((f) => f.state === 'custom');
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
|
|
194
|
+
const entries = custom.map((f) => ({ rel: f.rel, sha256: digestOf(f.bytes), bytes: f.bytes, channel: CHANNEL }));
|
|
195
|
+
const ok = (token, lines) => ({ ...composeOutcome(OP, token, lines, false), entries });
|
|
196
|
+
const loud = (cause, ...lines) => ({ ...composeFailure(OP, cause, ...lines), entries });
|
|
197
|
+
const bound = replace ? new Map(replace.entries.map((e) => [e.rel, e.sha256])) : null;
|
|
198
|
+
const keptOf = bound && ((rel) => (bound.has(rel) ? keptAsidePath(replace.digest, rel) : ''));
|
|
199
|
+
if (bound && !sameEntries(entries, replace.entries)) {
|
|
203
200
|
const asFound = decideWrites({ reader, checker, store });
|
|
204
|
-
return loud('race-unresolved',
|
|
201
|
+
return loud('race-unresolved', 'the edited spec-layer files are not the set the yes was given for (another set or other bytes), so nothing was written', ...composeLines({ reader, checker, store, ...asFound, fates: new Map(), stopped: true, keptOf }));
|
|
205
202
|
}
|
|
206
|
-
const { writes, withheld } = decideWrites({ reader, checker, store },
|
|
207
|
-
const tail = replace ? [] : replaceLine;
|
|
203
|
+
const { writes, withheld } = decideWrites({ reader, checker, store }, Boolean(bound));
|
|
208
204
|
const kinds = new Set(writes.map((w) => w.kind));
|
|
209
205
|
// ONE token by precedence — a write that happened (or, dry, would happen) always outranks the
|
|
210
206
|
// preserved-custom report, which names a run that wrote nothing behind an edited pair.
|
|
@@ -214,16 +210,16 @@ export const ensureSpecs = ({ cwd, kitRoot, dryRun = false, deps = {}, replaceCu
|
|
|
214
210
|
return withheld ? 'customized-preserved' : 'already-present';
|
|
215
211
|
};
|
|
216
212
|
const fates = new Map();
|
|
217
|
-
const linesNow = (stopped) => composeLines({ reader, checker, store, writes, fates, withheld, stopped });
|
|
213
|
+
const linesNow = (stopped) => composeLines({ reader, checker, store, writes, fates, withheld, stopped, keptOf });
|
|
218
214
|
const writtenCount = () => [...fates.values()].filter((fate) => fate === 'written').length;
|
|
219
|
-
if (dryRun) return ok(tokenFor(kinds.has('seed') || kinds.has('store'), kinds.has('refresh')),
|
|
215
|
+
if (dryRun) return ok(tokenFor(kinds.has('seed') || kinds.has('store'), kinds.has('refresh')), linesNow(false));
|
|
220
216
|
|
|
221
217
|
let storeBody = null;
|
|
222
218
|
if (kinds.has('store')) {
|
|
223
219
|
try {
|
|
224
220
|
storeBody = renderStoreRoot(kitRoot, read, deps.today ?? todayIso());
|
|
225
221
|
} catch (err) {
|
|
226
|
-
return loud('template-unreadable', `${STORE_ROOT_REL}: ${causeOf(err)}`, ...linesNow(true)
|
|
222
|
+
return loud('template-unreadable', `${STORE_ROOT_REL}: ${causeOf(err)}`, ...linesNow(true));
|
|
227
223
|
}
|
|
228
224
|
}
|
|
229
225
|
const writeOne = ({ kind, file }) => {
|
|
@@ -234,21 +230,25 @@ export const ensureSpecs = ({ cwd, kitRoot, dryRun = false, deps = {}, replaceCu
|
|
|
234
230
|
// A seed that lost the create-only race is re-PROVEN before anything that depends on it runs: the
|
|
235
231
|
// file that appeared must carry the bundled body, or the tree is changing underneath this run.
|
|
236
232
|
const stoodCurrent = ({ kind, file }) => kind === 'store' || classifyDeployedScript(read(join(cwd, file.rel)), file.name, file.bundle) === 'current';
|
|
233
|
+
const movedSinceBind = ({ kind, file }) => { if (kind !== 'refresh' || !bound?.has(file.rel)) return false; try { return digestOf(read(join(cwd, file.rel))) !== bound.get(file.rel); } catch { return true; } };
|
|
237
234
|
const notes = [];
|
|
238
235
|
for (const write of writes) {
|
|
239
236
|
const rel = relOf(write);
|
|
237
|
+
if (movedSinceBind(write)) {
|
|
238
|
+
return loud('race-unresolved', `${rel}: changed after this run read it — left as it stands and nothing further written`, ...linesNow(true), ...notes, ...partialNote(writtenCount()));
|
|
239
|
+
}
|
|
240
240
|
let result;
|
|
241
241
|
try {
|
|
242
242
|
result = writeOne(write);
|
|
243
243
|
} catch (err) {
|
|
244
|
-
return loud('write-refused', `${rel}: ${causeOf(err)}`, ...linesNow(true), ...notes, ...partialNote(writtenCount())
|
|
244
|
+
return loud('write-refused', `${rel}: ${causeOf(err)}`, ...linesNow(true), ...notes, ...partialNote(writtenCount()));
|
|
245
245
|
}
|
|
246
246
|
if (write.kind !== 'refresh' && !result.created && !stoodCurrent(write)) {
|
|
247
|
-
return loud('race-unresolved', `${rel}: appeared while this run was seeding it and does not carry the bundled body — something is writing there underneath this run; nothing further written, re-run when the tree is settled`, ...linesNow(true), ...notes, ...partialNote(writtenCount())
|
|
247
|
+
return loud('race-unresolved', `${rel}: appeared while this run was seeding it and does not carry the bundled body — something is writing there underneath this run; nothing further written, re-run when the tree is settled`, ...linesNow(true), ...notes, ...partialNote(writtenCount()));
|
|
248
248
|
}
|
|
249
249
|
fates.set(rel, write.kind !== 'refresh' && !result.created ? 'stood' : 'written');
|
|
250
250
|
notes.push(...tmpNote(rel, result.tmpLeftBehind));
|
|
251
251
|
}
|
|
252
252
|
const landed = (kind) => writes.some((w) => w.kind === kind && fates.get(relOf(w)) === 'written');
|
|
253
|
-
return ok(tokenFor(landed('seed') || landed('store'), landed('refresh')), [...linesNow(false), ...notes
|
|
253
|
+
return ok(tokenFor(landed('seed') || landed('store'), landed('refresh')), [...linesNow(false), ...notes]);
|
|
254
254
|
};
|
package/tools/mcp-server.mjs
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
HARD_MAX_FILE_BYTES,
|
|
30
30
|
HARD_MAX_TOTAL_BYTES as SEARCH_HARD_MAX_TOTAL_BYTES,
|
|
31
31
|
} from './repo-search.mjs';
|
|
32
|
+
import { NEVER_WALKED } from './repo-lex.mjs';
|
|
32
33
|
|
|
33
34
|
export const SERVER_NAME = 'agent-workflow';
|
|
34
35
|
const EXIT_OK = 0;
|
|
@@ -82,7 +83,7 @@ export const TOOLS = Object.freeze([
|
|
|
82
83
|
required: ['pattern'],
|
|
83
84
|
properties: {
|
|
84
85
|
pattern: { type: 'string', minLength: 1, description: 'The literal bytes to find; multiline allowed.' },
|
|
85
|
-
paths: pathList(
|
|
86
|
+
paths: pathList(`Project-relative search targets (default: the whole root). The walk never enters ${NEVER_WALKED.join(', ')} at any depth unless that folder or a path inside it is named here; below a named target the rule applies again.`),
|
|
86
87
|
max: count(HARD_MAX_RESULTS, 'Result ceiling.'),
|
|
87
88
|
maxBytes: count(HARD_MAX_FILE_BYTES, 'Per-file byte ceiling.'),
|
|
88
89
|
maxTotalBytes: count(SEARCH_HARD_MAX_TOTAL_BYTES, 'Whole-call byte ceiling.'),
|
|
@@ -8,10 +8,10 @@ import { listStories } from './claim-relation.mjs';
|
|
|
8
8
|
import { EPICS_REL, readEpicStore } from './epic-store.mjs';
|
|
9
9
|
import { sweepSiblings } from './epic-shape-ledger.mjs';
|
|
10
10
|
import { PIN_FILE } from './plan-shape-ownership.mjs';
|
|
11
|
+
import { NEVER_WALKED } from './repo-lex.mjs';
|
|
11
12
|
|
|
12
13
|
const SOURCE_SIZE_REL = 'docs/ai/source-size.json';
|
|
13
14
|
const PACKAGE_FILE = 'package.json';
|
|
14
|
-
const EXCLUDED_DIRECTORIES = new Set(['.git', 'node_modules']);
|
|
15
15
|
const NEGATED_CLASS = /\[[!^]/;
|
|
16
16
|
const UNSUPPORTED_GLOB = /[()\\\u0000-\u001f]/;
|
|
17
17
|
const STORE_REFUSED = 'refused';
|
|
@@ -38,7 +38,7 @@ const walkRegularFiles = (root, directory = root) => readdirSync(directory, { wi
|
|
|
38
38
|
.flatMap((entry) => {
|
|
39
39
|
const path = join(directory, entry.name);
|
|
40
40
|
const rel = toPosix(relative(root, path));
|
|
41
|
-
if (entry.isDirectory() && !
|
|
41
|
+
if (entry.isDirectory() && !NEVER_WALKED.includes(entry.name)) return walkRegularFiles(root, path);
|
|
42
42
|
return entry.isFile() ? [rel] : [];
|
|
43
43
|
});
|
|
44
44
|
|
package/tools/repo-lex.mjs
CHANGED
|
@@ -18,6 +18,10 @@ export const lexicalRepoRelative = (rel) => {
|
|
|
18
18
|
return { ok: true };
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
// ONE home of the family's reserved folder and of the names no repository walk enters (spec repo-search).
|
|
22
|
+
export const RESERVED_DIR = '.agent-workflow';
|
|
23
|
+
export const NEVER_WALKED = Object.freeze(['.git', 'node_modules', RESERVED_DIR]);
|
|
24
|
+
|
|
21
25
|
// POSIX single-quote for pasteable command rendering (display only — never an execution boundary).
|
|
22
26
|
export const shellQuoteArg = (s) => (/^[A-Za-z0-9_/.\-]+$/.test(s) ? s : `'${s.replace(/'/g, `'\\''`)}'`);
|
|
23
27
|
|
package/tools/repo-search.mjs
CHANGED
|
@@ -51,6 +51,7 @@ import { openSync, fstatSync, readSync, closeSync, opendirSync, realpathSync, ls
|
|
|
51
51
|
import { createHash } from 'node:crypto';
|
|
52
52
|
import { join, resolve, relative, isAbsolute, sep } from 'node:path';
|
|
53
53
|
import { isDirectRun } from './direct-run.mjs';
|
|
54
|
+
import { NEVER_WALKED } from './repo-lex.mjs';
|
|
54
55
|
|
|
55
56
|
export const EXIT_OK = 0;
|
|
56
57
|
export const EXIT_ERROR = 1;
|
|
@@ -80,7 +81,6 @@ const BINARY_SNIFF_BYTES = 8192;
|
|
|
80
81
|
// cap the stored size per match is a constant, so no size of pattern or file can grow it.
|
|
81
82
|
const SNIPPET_CONTEXT = 200;
|
|
82
83
|
const SNIPPET_MAX = 512;
|
|
83
|
-
const NEVER_WALKED = Object.freeze(['.git', 'node_modules']);
|
|
84
84
|
// O_NOFOLLOW refuses a symlinked leaf at open time; O_NONBLOCK means a FIFO that slipped in returns
|
|
85
85
|
// instead of hanging. Both are POSIX; on a platform lacking them the flags degrade to 0 and the
|
|
86
86
|
// fstat check below is the remaining guard.
|
|
@@ -123,7 +123,7 @@ export const parseCount = (raw, flag, ceiling) => {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
const parseArgs = (argv) => {
|
|
126
|
-
const opts = { pattern: null, patternFile: null, paths: [], pathsFile: null, max: DEFAULT_MAX_RESULTS, maxBytes: DEFAULT_MAX_FILE_BYTES, maxTotalBytes: DEFAULT_MAX_TOTAL_BYTES, json: false };
|
|
126
|
+
const opts = { help: false, pattern: null, patternFile: null, paths: [], pathsFile: null, max: DEFAULT_MAX_RESULTS, maxBytes: DEFAULT_MAX_FILE_BYTES, maxTotalBytes: DEFAULT_MAX_TOTAL_BYTES, json: false };
|
|
127
127
|
for (let i = 0; i < argv.length; i += 1) {
|
|
128
128
|
const arg = argv[i];
|
|
129
129
|
const next = () => {
|
|
@@ -139,8 +139,10 @@ const parseArgs = (argv) => {
|
|
|
139
139
|
else if (arg === '--max-bytes') opts.maxBytes = parseCount(next(), '--max-bytes', HARD_MAX_FILE_BYTES);
|
|
140
140
|
else if (arg === '--max-total-bytes') opts.maxTotalBytes = parseCount(next(), '--max-total-bytes', HARD_MAX_TOTAL_BYTES);
|
|
141
141
|
else if (arg === '--json') opts.json = true;
|
|
142
|
+
else if (arg === '--help' || arg === '-h') opts.help = true;
|
|
142
143
|
else throw new UsageError(`unknown argument: ${arg} (see --help)`);
|
|
143
144
|
}
|
|
145
|
+
if (opts.help) return opts;
|
|
144
146
|
if (opts.pattern !== null && opts.patternFile !== null) {
|
|
145
147
|
throw new UsageError('--pattern and --pattern-file are mutually exclusive — the lane must be unambiguous');
|
|
146
148
|
}
|
|
@@ -520,6 +522,9 @@ are done — this tool never writes. --paths-file format: one target per line, U
|
|
|
520
522
|
lines ignored; duplicates collapse; no comment syntax and no escaping, so a filename containing a
|
|
521
523
|
newline cannot be expressed by this lane. Both lane files are excluded from the search itself.
|
|
522
524
|
|
|
525
|
+
The walk never enters a directory named ${NEVER_WALKED.join(', ')}, at any depth, unless that folder
|
|
526
|
+
or a path inside it is named as a target; below a named target the rule applies again.
|
|
527
|
+
|
|
523
528
|
LITERAL only, multiline patterns supported. Reads regular files only, opened no-follow. Skipped
|
|
524
529
|
entries (symlinks, non-regular, binary, oversized, unreadable) are counted and reported, never
|
|
525
530
|
dropped silently; an oversized file additionally makes the whole search INCOMPLETE.
|
|
@@ -529,9 +534,9 @@ Exit codes: 0 search completed (matches or an explicitly empty result) · 1 I/O
|
|
|
529
534
|
|
|
530
535
|
export const main = (argv, ctx = {}) => {
|
|
531
536
|
try {
|
|
532
|
-
if (argv.includes('--help') || argv.includes('-h')) return { code: EXIT_OK, stdout: HELP, stderr: '', result: null };
|
|
533
|
-
const root = realpathSync(resolve(ctx.cwd ?? process.cwd()));
|
|
534
537
|
const opts = parseArgs(argv);
|
|
538
|
+
if (opts.help) return { code: EXIT_OK, stdout: HELP, stderr: '', result: null };
|
|
539
|
+
const root = realpathSync(resolve(ctx.cwd ?? process.cwd()));
|
|
535
540
|
const excludePaths = new Map();
|
|
536
541
|
// ONE reader for both out-of-band lanes, so their failure classification cannot drift: a missing,
|
|
537
542
|
// unreadable or non-regular lane file is an IoError (exit 1) for the pattern lane and for the
|
|
@@ -34,7 +34,7 @@ export const UPGRADE_RUNLIST = Object.freeze([
|
|
|
34
34
|
entry(
|
|
35
35
|
'configs',
|
|
36
36
|
'node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --cwd <project>',
|
|
37
|
-
|
|
37
|
+
"a replace line → ONE yes naming every file its block names, each edit's kept-aside copy and that the bundled body replaces it, asked even on a non-zero exit; on the yes run the printed line, then STOP if that run fails or an op it does not re-run failed; on a no STOP on any failed op. The printed line: node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --replace-custom <digest> --cwd <project>",
|
|
38
38
|
[
|
|
39
39
|
'seeded',
|
|
40
40
|
'note-refreshed',
|