@sabaiway/agent-workflow-kit 23.11.0 → 24.0.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 +87 -0
- package/README.md +4 -4
- package/SKILL.md +1 -1
- package/bridges/codex-cli-bridge/SKILL.md +7 -2
- package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +11 -6
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +72 -33
- package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +111 -3
- package/bridges/codex-cli-bridge/bin/codex-fixtures-harness.test.mjs +16 -1
- package/bridges/codex-cli-bridge/bin/codex-model-posture.test.mjs +5 -3
- package/bridges/codex-cli-bridge/bin/codex-review.sh +1 -1
- package/bridges/codex-cli-bridge/capability.json +2 -2
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/advisor-writers.md +2 -0
- package/references/agents/author.md +21 -0
- package/references/agents/executor.md +12 -6
- package/references/contracts.md +4 -4
- package/references/hooks/gate-approve.mjs +7 -8
- package/references/hooks/stage-write-guard.mjs +314 -0
- package/references/modes/agents.md +6 -4
- package/references/modes/bootstrap.md +1 -1
- package/references/modes/control-bytes.md +38 -32
- package/references/modes/flow-writer.md +10 -2
- package/references/modes/hook.md +4 -1
- package/references/modes/now.md +1 -1
- package/references/modes/procedures.md +49 -10
- package/references/modes/recipes.md +7 -7
- package/references/modes/recommendations.md +5 -4
- package/references/modes/robustness-brief.md +9 -8
- package/references/modes/set-recipe.md +1 -1
- package/references/modes/state-block-guard.md +4 -3
- package/references/modes/status.md +1 -1
- package/references/modes/upgrade.md +1 -1
- package/references/modes/worktrees.md +28 -5
- package/references/rules/story-sessions.md +2 -2
- package/references/scripts/archives/archive-caps.mjs +1 -1
- package/references/scripts/archives/archive-changelog.mjs +8 -8
- package/references/scripts/archives/archive-decisions.mjs +7 -7
- package/references/scripts/archives/archive-issues.mjs +5 -5
- package/references/scripts/archives/rotation-conservation.mjs +2 -1
- package/references/scripts/docs-size/check-docs-size.mjs +15 -15
- package/references/scripts/family.json +2 -0
- package/references/scripts/gates/kit-command-gates.mjs +7 -8
- package/references/scripts/gates/migrate-gates.mjs +10 -10
- package/references/scripts/git-hooks/install-git-hooks.mjs +13 -13
- package/references/scripts/run.mjs +1 -2
- package/references/scripts/shared/index.mjs +2 -0
- package/references/scripts/shared/locations.mjs +103 -0
- package/references/scripts/spec-schema/spec-schema.mjs +2 -1
- package/references/templates/orchestration.json +1 -1
- package/tools/ack-store.mjs +2 -1
- package/tools/advisor-matrix.mjs +2 -1
- package/tools/advisor-skip/index.mjs +73 -0
- package/tools/apply-danger-check.mjs +20 -6
- package/tools/atomic-write.mjs +3 -2
- package/tools/attribution.mjs +2 -1
- package/tools/autonomy-config.mjs +2 -1
- package/tools/bridge-wiring.mjs +13 -11
- package/tools/carriers.mjs +54 -14
- package/tools/cheap-agents-read.mjs +28 -7
- package/tools/cheap-agents.mjs +15 -10
- package/tools/checker-gates-read.mjs +6 -5
- package/tools/commands.mjs +2 -2
- package/tools/control-bytes.mjs +43 -20
- package/tools/coverage-declared/config.mjs +2 -1
- package/tools/coverage-producer.mjs +10 -9
- package/tools/delegation.mjs +7 -6
- package/tools/detect-backends.mjs +1 -1
- package/tools/dispatch-baseline.mjs +2 -1
- package/tools/distribution-files/scripts.mjs +4 -4
- package/tools/doc-parity/index.mjs +46 -0
- package/tools/doc-parity.mjs +27 -47
- package/tools/ensure-configs.mjs +2 -2
- package/tools/ensure-ops.mjs +24 -24
- package/tools/ensure-specs.mjs +7 -7
- package/tools/epic-shape-cli.mjs +2 -2
- package/tools/epic-shape-ledger.mjs +5 -5
- package/tools/epic-shape.mjs +5 -3
- package/tools/epic-store.mjs +2 -1
- package/tools/family-members.mjs +7 -5
- package/tools/family-registry.mjs +36 -30
- package/tools/feedback-record-cli.mjs +4 -5
- package/tools/flow-writer.mjs +26 -15
- package/tools/gate-hook.mjs +33 -28
- package/tools/gates-declaration.mjs +2 -1
- package/tools/gates-init.mjs +6 -5
- package/tools/git-hooks.mjs +64 -41
- package/tools/grounding.mjs +3 -2
- package/tools/hide-footprint.mjs +2 -1
- package/tools/hook-writer/index.mjs +147 -0
- package/tools/init-preflight.mjs +5 -4
- package/tools/init-project.mjs +12 -11
- package/tools/inject-methodology.mjs +3 -2
- package/tools/jev-guide.mjs +2 -2
- package/tools/known-footprint.mjs +27 -25
- package/tools/mcp-registration.mjs +6 -5
- package/tools/migration-blocks.mjs +2 -1
- package/tools/migration-notes.mjs +2 -2
- package/tools/node-evidence.mjs +4 -4
- package/tools/now-facts.mjs +5 -5
- package/tools/now-status.mjs +1 -5
- package/tools/orchestration-config.mjs +2 -1
- package/tools/orchestration-readme.mjs +7 -2
- package/tools/plan-approval/cli.mjs +45 -0
- package/tools/plan-approval/entries.mjs +109 -0
- package/tools/plan-approval/index.mjs +2 -0
- package/tools/plan-approval/record.mjs +198 -0
- package/tools/plan-files.mjs +6 -4
- package/tools/plan-shape-cli.mjs +10 -64
- package/tools/plan-shape-facts.mjs +240 -83
- package/tools/plan-shape.mjs +173 -160
- package/tools/plan-structure/cli.mjs +79 -0
- package/tools/plan-structure/index.mjs +67 -0
- package/tools/procedures.mjs +21 -17
- package/tools/profile-gaps.mjs +4 -6
- package/tools/project-rules/rules-priors.mjs +2 -0
- package/tools/project-rules/themes.mjs +6 -4
- package/tools/recipes.mjs +44 -29
- package/tools/recommendations.mjs +90 -39
- package/tools/reference-profile.mjs +2 -2
- package/tools/release-scan/index.mjs +30 -0
- package/tools/release-scan.mjs +46 -25
- package/tools/renderers.mjs +14 -8
- package/tools/repo-lex.mjs +84 -0
- package/tools/robustness-brief.mjs +14 -11
- package/tools/sandbox-masks.mjs +6 -4
- package/tools/satellite-locator.mjs +3 -2
- package/tools/script-priors.mjs +3 -2
- package/tools/session-close-check.mjs +71 -15
- package/tools/set-flow.mjs +2 -2
- package/tools/set-recipe.mjs +17 -9
- package/tools/source-size/help.mjs +4 -4
- package/tools/source-size/layout.mjs +2 -1
- package/tools/source-size/piles.mjs +2 -2
- package/tools/source-size-config.mjs +3 -3
- package/tools/source-size-refusal.mjs +4 -3
- package/tools/source-size-report.mjs +41 -13
- package/tools/spec-check-cli.mjs +159 -21
- package/tools/spec-check-ops.mjs +74 -5
- package/tools/spec-check.mjs +54 -45
- package/tools/spec-coverage-cli.mjs +3 -2
- package/tools/stage-render/cli.mjs +231 -0
- package/tools/stage-render/index.mjs +340 -0
- package/tools/stage-render/stages.json +115 -0
- package/tools/stage-write-guard/cli.mjs +64 -0
- package/tools/stage-write-guard/index.mjs +56 -0
- package/tools/state-block-hook.mjs +38 -163
- package/tools/task-brief.mjs +8 -13
- package/tools/task-thread.mjs +3 -1
- package/tools/tier-guide-facts.mjs +23 -9
- package/tools/tier-preview.mjs +15 -19
- package/tools/transition/index.mjs +10 -9
- package/tools/uninstall.mjs +26 -12
- package/tools/vehicle-settings.mjs +2 -1
- package/tools/velocity-profile.mjs +5 -6
- package/tools/view-model.mjs +7 -4
- package/tools/worktree-prompt.mjs +7 -3
- package/tools/worktrees.mjs +235 -159
- package/tools/write-lanes.mjs +20 -14
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- opt-in-capability: none — an inspection surface that configures nothing -->
|
|
4
4
|
|
|
5
|
-
Read-only **activity-procedures advisor**. Answers *"what are the steps of this named activity, and which recipe applies at each slot here?"* It composes the orchestration recipes (`${CLAUDE_SKILL_DIR}/references/modes/recipes.md`) into **named activities** with **typed recipe slots**. It **never writes, never commits, never runs a subscription CLI** — the deterministic resolution lives in the kit; the orchestrator runs the resolved recipe via the bridge skills or the
|
|
5
|
+
Read-only **activity-procedures advisor**. Answers *"what are the steps of this named activity, and which recipe applies at each slot here?"* It composes the orchestration recipes (`${CLAUDE_SKILL_DIR}/references/modes/recipes.md`) into **named activities** with **typed recipe slots**. It **never writes, never commits, never runs a subscription CLI** — the deterministic resolution lives in the kit; the orchestrator runs the resolved recipe via the bridge skills, the executor vehicle for carry or the author vehicle for author, and **owns any commit when the activity has a commit boundary** (every other carrier never commits). Not every activity commits: `plan-authoring` ends at approval and produces no commit (plans are ephemeral, never committed); `plan-execution` commits the story once, after its diff review.
|
|
6
6
|
|
|
7
7
|
The six activities (canon in the **installed engine**, `references/procedures.md`; the registry is `tools/carriers.mjs`):
|
|
8
8
|
|
|
@@ -13,17 +13,45 @@ The six activities (canon in the **installed engine**, `references/procedures.md
|
|
|
13
13
|
- **`epic`** (slots: `author`, `review`) — brief → draft by the resolved `author` carrier → `epic-shape-cli --check` → **review {recipe}**: one review-lens read over the rendered review brief, whatever `epic.review` resolves to (no bridge wrapper, driving contract or grounding pre-step renders under it) → fold through the fold ask and `--fold`, at most two rounds → land.
|
|
14
14
|
- **`task`** (slots: `author`, `execute`) — the orchestrator writes one prompt from one ledger row, whatever `author` resolves to → with the story's changes staged, the resolved `execute` carrier runs it inside its Files (Delegated: `codex-exec --nonce <n> <prompt file>`) → the read after the hand-out restores writes outside the Files from the index and the copied excluded paths from their copy, then the row's tests → return into the story's row, a fold resuming the run's session from its exec receipt; no commit boundary or review of its own.
|
|
15
15
|
|
|
16
|
-
Value sets per slot type: `review` accepts `solo | reviewed | council`; `execute` (including `task.author` and `task.execute`) accepts `solo | delegated | subagent`; a carrier slot (`plan-authoring.author`, `plan-authoring.fold`, `routine.carrier`, `epic.author`) accepts `solo | subagent`; `parallel` is a **switch**, `on | off`, resolved outside the recipe lattice. Defaults when the config is silent: `review` → Reviewed if a review-capable backend is ready, else Solo; `author`, `fold`, `execute`, `carrier` → Solo (a placed
|
|
16
|
+
Value sets per slot type: `review` accepts `solo | reviewed | council`; `execute` (including `task.author` and `task.execute`) accepts `solo | delegated | subagent`; a carrier slot (`plan-authoring.author`, `plan-authoring.fold`, `routine.carrier`, `epic.author`) accepts `solo | subagent`; `parallel` is a **switch**, `on | off`, resolved outside the recipe lattice. Defaults when the config is silent: `review` → Reviewed if a review-capable backend is ready, else Solo; `author`, `fold`, `execute`, `carrier` → Solo (a placed vehicle never flips a default); `parallel` → on. The orchestrator owns every commit; every other carrier — a bridge or a subagent — never commits.
|
|
17
17
|
|
|
18
|
-
Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slot>=<value>]… [--json]`**. It reads the activity's steps live from the engine and prints them **verbatim**, then the **resolved effective recipe per slot** from the per-project config + the read-only backend detector:
|
|
18
|
+
Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slot>=<value>]… [--json]`**. It reads the activity's steps live from the engine and prints them **verbatim**, then the **resolved effective recipe per slot** from the per-project config + the read-only backend detector and both vehicle surveys:
|
|
19
19
|
|
|
20
20
|
1. **Config = `docs/ai/orchestration.json`** — strict JSON, **agent-writable via `/agent-workflow-kit set-recipe` (`${CLAUDE_SKILL_DIR}/references/modes/set-recipe.md`) OR hand-edited** (the kit reads + validates it; `procedures`/`recipes` stay read-only — the writer is `set-recipe`). Shape: `{ "<activity>": { "<slot>": "<value>" } }`; all slots optional (an absent slot → its computed default, stated); an optional `"_README"` string is allowed + ignored; a `"flow"` object must carry the NUMERIC `"schema": 1` (the kit's accepted flow schema version) and validates against the CLOSED structural schema-1 key set (unknown flow keys and malformed per-key shapes refuse loudly; deep environment floors stay on the `set-flow` arming path). `review` accepts `solo|reviewed|council`; `execute` (including `task.author` and `task.execute`) accepts `solo|delegated|subagent`; a carrier slot (`plan-authoring.author`, `plan-authoring.fold`, `routine.carrier`, `epic.author`) accepts `solo|subagent`; `parallel` accepts `on|off`. Seeded by `init` (a user-editable template) — see `${CLAUDE_SKILL_DIR}/references/modes/bootstrap.md`.
|
|
21
|
-
2. **Default resolution (config silent):** `review` → Reviewed if any review-capable backend is `ready`, else Solo (never Council by default); `execute`, `author`, `fold`, `carrier` → Solo (Delegated and Subagent are opt-in; a placed
|
|
21
|
+
2. **Default resolution (config silent):** `review` → Reviewed if any review-capable backend is `ready`, else Solo (never Council by default); `execute`, `author`, `fold`, `carrier` → Solo (Delegated and Subagent are opt-in; a placed vehicle never flips a default); `parallel` → on. **Degradation:** a config/computed default degrades **gracefully with a stated reason** (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the executor vehicle is missing or unusable for a carry-role slot, or when the author vehicle is not placed for an author-role slot, the reason naming the apply command; a switch never degrades); a per-run **`--override <slot>=<value>`** that can't be satisfied degrades **loudly** (a flagged warning, so you tell the user) — but is **still exit 0** (a valid request that gracefully degraded).
|
|
22
22
|
3. **Exit codes:** `0` success; `2` usage (unknown `<activity>` / bad `--override` — a bare `--override <recipe>`, an unknown slot, a value outside the slot's list, or a duplicate slot); `1` config error (malformed / schema-invalid / unreadable `orchestration.json`) **or** engine error (the installed engine is absent / invalid / **too old** to ship `references/procedures.md` — upgrade it with `npx @sabaiway/agent-workflow-engine@latest init`). A `1`/`2` failure is loud (`path: reason`), never a silent fallback. **Lagging-kit honesty:** a kit predating the `"flow"` key that reads a config carrying one fails this config load loudly (exit `1`, reddening its full gate matrix); the `set-flow` arming path now enforces the declared `kitMinVersion` floor with a null-guarded comparison (an unparseable version never passes), while tolerate-first ordering remains the only protection for readers older than the `"flow"` key itself — no in-config floor can reach a kit that dies on the unknown key.
|
|
23
23
|
|
|
24
|
-
**The dispatch form (a slot resolved to `subagent`).** A carrier that is only NAMED is a name, not an
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
**The dispatch form (a slot resolved to `subagent`).** A carrier that is only NAMED is a name, not an
|
|
25
|
+
instruction, so after such a slot's resolved-recipe line the advisor prints — indented under it, in place of
|
|
26
|
+
the one-line vehicle mention — the form the dispatch must take, in five parts: (1) what a SLICE is for THIS
|
|
27
|
+
slot — for `plan-execution.execute`, a set of file-disjoint ledger rows, wording copied verbatim where wording
|
|
28
|
+
is a red line; for `plan-authoring.author`, a brief naming the goal, the governing spec(s) and the ledger
|
|
29
|
+
constraints, whose returned draft the orchestrator reviews as its own; for `plan-authoring.fold`, the round's
|
|
30
|
+
findings with their dispositions, whose edits the orchestrator follows with the self-consistency read; for
|
|
31
|
+
`routine.carrier`, a bounded mechanical task, where a read-only chore (a sweep, gate triage) rides its placed
|
|
32
|
+
read-only vehicle — or is carried solo with a stated reason when that vehicle is absent — a write-capable one
|
|
33
|
+
(a regeneration, a fixture build) rides the executor, and the changelog stays the orchestrator's; for
|
|
34
|
+
`epic.author`, a brief naming the intent, the value, the non-goals and the stories in order, from which the
|
|
35
|
+
subagent drafts the epic file and the orchestrator runs the shape check on the draft as its own; for
|
|
36
|
+
`task.author`, no slice the flow dispatches, since the orchestrator writes each row's prompt itself whatever
|
|
37
|
+
the slot resolves to — that sentence renders alone, with none of the parts below; for `task.execute`, one
|
|
38
|
+
prompt the orchestrator wrote from one ledger row, run inside the Files the prompt names with the changed
|
|
39
|
+
paths reported and the row's tests run by the orchestrator;
|
|
40
|
+
(2) the vehicle and its surveyed state — for a carry-role slot, `.claude/agents/executor.md` (`placed` /
|
|
41
|
+
`customized` / `unusable` / `missing`, from the same survey `status` and the advisor read); for the
|
|
42
|
+
author-role slots `plan-authoring.author`, `plan-authoring.fold` and `epic.author`, `.claude/agents/author.md`
|
|
43
|
+
(ready only when `placed`) — dispatched **in the background**;
|
|
44
|
+
(3) for a carry-role slot, that the orchestrator **verifies every returned slice by running its suites
|
|
45
|
+
itself**; for an author-role slot, that the orchestrator reviews every returned draft as its own, with no
|
|
46
|
+
suite-run line; (4) that the subagent is **never told to commit, never a review backend, never a bridge
|
|
47
|
+
substitute**; (5) the **honest limit** — for a carry-role slot, a Claude Code lane: on a host that cannot
|
|
48
|
+
dispatch the vehicle, follow this form BY HAND and say so, never report it as a subagent dispatch. For an
|
|
49
|
+
author-role slot, a Claude Code lane loaded at session start: dispatch only when this session's agent list shows author with exactly Read, Grep, Glob,
|
|
50
|
+
Write and Edit; otherwise, a file placed or written during this session included, carry the slice solo and say
|
|
51
|
+
so; never another subagent. The wording is the kit's own (`tools/carriers.mjs`) and is printed, never
|
|
52
|
+
re-worded. The dispatch-form branch is unchanged for a slot resolved to `solo` or `delegated`.
|
|
53
|
+
|
|
54
|
+
**Fold lane (an execute slot the activity reads resolved to `delegated`).** `procedures plan-execution` reads `plan-execution.execute` and `task.execute`, `procedures task` reads `task.execute` alone, and `task.author` never counts; a per-run `--override` moves only the rendered activity's own slot. The lane renders once, immediately after the rendered activity's `execute` slot block (after its driving contract when that slot itself resolves to `delegated`), as one line: a fold of code a bridge wrote resumes that run's session, `codex-exec --resume <session id> --nonce <n> <prompt file>`, the session id read from the `sessionId` of the run's exec receipt, with a new prompt carrying the `aw-plan-approval` block and a fresh nonce. No delegation ledger and no HEAD are read, so the line is the same whatever a ledger holds. The block is advisory and never changes the exit code; `foldLane` carries the identical line under `--json`, and is `[]` for every other activity and whenever no slot the activity reads resolves to `delegated`.
|
|
27
55
|
|
|
28
56
|
**`routine`'s `parallel` switch renders against the EFFECTIVE carrier.** The flag always renders with its source (`parallel: on` / `parallel: off`); the concurrency claim — *file-disjoint slices dispatch concurrently* — renders **only** while the resolved `carrier` is `subagent`. Under a `solo` carrier the line states its own inertness instead, `(no effect while the carrier is solo)`: a switch never degrades, so the flag keeps the value you set and the render simply stops promising a concurrency nothing can perform. That makes four cells (`on`/`off` x `subagent`/`solo`), and only the `subagent`+`on` cell claims concurrency.
|
|
29
57
|
|
|
@@ -31,9 +59,20 @@ Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slo
|
|
|
31
59
|
|
|
32
60
|
**Flow armed-halves block (session-start read side).** When the config carries a `flow` block, the advisor also renders `Flow (schema 1) — armed halves (config · chain · bookkeeping):` — the **config half** (preset · councilRounds · kitMinVersion), the **chain half** (a light read-only probe of the flow store on the checker's fixed path: ARMED at an adoption record, UNARMED for an absent or unadopted store, fail-closed BROKEN wording for a malformed one), and the **bookkeeping half** (each declared path: declared non-excluded — the tracked-file floor verifies on the `set-flow` arming path — vs loudly DECLARED-EXCLUDED). A config with no `flow` block renders byte-identically to before and pays no store probe.
|
|
33
61
|
|
|
34
|
-
**Declared source-size practice block (
|
|
35
|
-
|
|
36
|
-
|
|
62
|
+
**Declared source-size practice block (D-17 U1).** When the project declares a source-size practice
|
|
63
|
+
in `docs/ai/source-size.json`, the advisor also renders `Declared source-size practice (docs/ai/source-size.json):`
|
|
64
|
+
with the caps, the five limits with their tolerances, whether layout is recorded, the `--write-baseline`
|
|
65
|
+
move on schema 1, what is recorded and the canonical WHY sentence. `--json` carries the SAME lines
|
|
66
|
+
under **`declaredPractice`** (an empty array when nothing is declared), so the human and structured
|
|
67
|
+
renders never diverge. The three config states each read as themselves: **ABSENT** renders nothing at
|
|
68
|
+
all (a project declaring no practice is handed no invented limits), **AUTHORED** is pre-mint (no file
|
|
69
|
+
size is recorded yet), **MINTED** carries the recorded count. A declaration that cannot be read
|
|
70
|
+
(malformed, unknown-keyed, a dangling symlink) renders ONE loud `UNREADABLE` line and the advisor
|
|
71
|
+
**still exits 0**. The practice's own checker owns the exit code for its config (exit 2 there) and
|
|
72
|
+
its declared gate reds the gate matrix. Read through the practice's pure read core, so this advisor
|
|
73
|
+
never reaches its writer half.
|
|
74
|
+
|
|
75
|
+
**Readers-sweep block (`plan-authoring` only, unconditional).** Before the review-loop block the advisor renders `Readers sweep (before the first review) — …`: the search form for every config key, registry entry, exported constant, receipt field or canon sentence the plan changes, searching by name and by value, bounded to what the search instrument lists, and the classification rule (a ledger row, a stated non-goal, or unchanged with its proof). The command line `run: node <kit>/tools/repo-search.mjs --pattern <the literal>` ALWAYS renders — bare wherever the `--kit-tools` tier could seed that path (the tier's own byte-form, the same predicate), and single-quoted otherwise (an unseedable path has no rule to match); `--pattern-file <f>` only for a pattern carrying a shell-significant byte; when the project's MCP registration is complete (`/agent-workflow-kit mcp`) a `use: repo_search {"pattern": "<the literal>"}` line renders ABOVE it — registration on disk, never a claim the tool is loaded in this session. `--json` carries the SAME lines under **`readersSweep`** (an empty array for the other activities).
|
|
37
76
|
|
|
38
77
|
**Slot-skew warning.** When the installed engine's canon `Slots:` line for the activity differs from this kit's registry, the advisor adds a `warnings` entry (a `⚠` line in the human render; exit 0; the resolved lines follow the registry) naming both lists — the engine and the kit are out of step; `/agent-workflow-kit status` names which member is behind. A section without a `Slots:` line is a customized canon and stays silent.
|
|
39
78
|
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- opt-in-capability: none — an inspection surface that configures nothing -->
|
|
4
4
|
|
|
5
|
-
Read-only **orchestration advisor**. Answers *"how should I compose the carriers of a step — the optional execution-backends
|
|
5
|
+
Read-only **orchestration advisor**. Answers *"how should I compose the carriers of a step — the optional execution-backends, the full-tool executor and the no-shell author vehicle — into plan → execute → review here, and which recipe fits?"* It **never writes, never commits, never runs a subscription CLI, and never executes a recipe** — the orchestrator (you) runs the chosen recipe through the bridge skills or the vehicle of the slot's role and makes the single commit; a backend or a subagent is advisory or delegated, never autonomous.
|
|
6
6
|
|
|
7
|
-
The five recipes (defined over each bridge's `provides` roles — `codex`: execute + review; `agy`: review + probe — plus the `carry` role the placed **executor vehicle** provides), canonical narrative in the **installed engine** (`references/orchestration.md`):
|
|
7
|
+
The five recipes (defined over each bridge's `provides` roles — `codex`: execute + review; `agy`: review + probe — plus the `carry` role the placed **executor vehicle** provides and the `author` role the placed **author vehicle** provides), canonical narrative in the **installed engine** (`references/orchestration.md`):
|
|
8
8
|
|
|
9
9
|
- **Solo** — you plan, execute, and self-review; no backend (always available; the floor).
|
|
10
10
|
- **Reviewed** — you execute; **one** backend reviews the result (advisory). Prefers `codex` when both are ready (`agy` carries a standing health caveat).
|
|
11
11
|
- **Council** — **both** backends review independently; you synthesize the two opinions.
|
|
12
12
|
- **Delegated** — you hand a **bounded** execution sub-task to a backend (`codex exec`), then review the returned diff and commit.
|
|
13
|
-
- **Subagent** — a **
|
|
13
|
+
- **Subagent** — a **frontier subagent** from the vehicle of the slot's role carries a bounded slice. Carry slots ride the full-tool executor (`.claude/agents/executor.md`) for a file-disjoint execution or write-capable routine slice, or one prompt the orchestrator wrote from one ledger row, run inside its Files (`task.execute`; `task.author` dispatches no slice: the orchestrator writes each row's prompt itself); you run its suites yourself. Author slots ride the no-shell author vehicle (`.claude/agents/author.md`) for a plan/contract brief, a round's fold or an epic brief; you review the draft as your own. You make the commit. Neither vehicle is a **review backend** or a **bridge substitute**, and neither is **told to commit**; a carry slot **degrades to Solo** on a `missing` or `unusable` executor, and an author slot on any author state but `placed`, each naming its vehicle and the reason. Readiness here is the **vehicle FILE, never the host** — a **Claude Code lane**, like the `agents` writer itself: on a host that cannot dispatch the vehicle, the rendered dispatch form is an instruction you follow by hand and report as such, never as a subagent dispatch.
|
|
14
14
|
|
|
15
|
-
1. Run **`node ${CLAUDE_SKILL_DIR}/tools/recipes.mjs`** (the read-only planner; `--json` for the structured form). It runs the backend detector, lists the five recipes, and prints — for the current environment — a **per-recipe dispatch plan that degrades with a stated reason** when a carrier isn't `ready` (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the executor
|
|
16
|
-
2. **Offer the choice** via **`AskUserQuestion` where your agent supports it** (`AskUserQuestion` in Claude Code) — one option per recipe, the `recommendRecipe` choice listed **first** — otherwise in prose. Then print `planRecipe(
|
|
15
|
+
1. Run **`node ${CLAUDE_SKILL_DIR}/tools/recipes.mjs`** (the read-only planner; `--json` for the structured form). It runs the backend detector, lists the five recipes (a Subagent plan per role), and prints — for the current environment — a **per-recipe dispatch plan that degrades with a stated reason** when a carrier isn't `ready` (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the carry slot's executor is `missing`/`unusable` or the author slot's author vehicle is not `placed`), plus advisory **quota/health notes** (each bridge runs the host posture the user set — a weaker model is the user's bridge setting, never a per-call choice; Council spends two backends' quota; `agy` may stall on substantive prompts — Issue-001, prefer `codex`).
|
|
16
|
+
2. **Offer the choice** via **`AskUserQuestion` where your agent supports it** (`AskUserQuestion` in Claude Code) — one option per recipe, the `recommendRecipe` choice listed **first** — otherwise in prose. Then, for a named slot, print `planRecipe(chosenId, detection, slotRole(activity, slot))`, where `chosenId` is the recipe id (the per-stage dispatch + degradation reasons + quota/health notes), so the user sees exactly what running it entails; when Subagent is chosen with no slot named, print both role-specific plans, as step 1 does.
|
|
17
17
|
3. **Availability = `readiness === ready`, full stop.** Every other readiness supplies the human reason (needs-skill → "not installed — `/agent-workflow-kit setup`"; needs-cli → "install the CLI"; needs-credentials → "log in"; degraded → "wrapper not on PATH — `/agent-workflow-kit setup`"). This is set-up state only — **never** a claim that a backend's service is responsive (the detector cannot observe a runtime stall; `agy`'s Issue-001 is a *standing advisory*, not a readiness signal).
|
|
18
18
|
|
|
19
|
-
**The activities and their slots.** One registry (`tools/carriers.mjs`, re-exported by `recipes.mjs`) names **six** activities and their typed slots: `plan-authoring` → `author`, `fold`, `review`; `plan-execution` → `execute`, `review`; `routine` → `carrier`, `parallel`; `feedback-triage` → `review`; `epic` → `author`, `review`; `task` → `author`, `execute`. Each slot's accepted values follow its TYPE — `review` (including `epic.review`) accepts `solo|reviewed|council`; `execute` (including `task.author` and `task.execute`) accepts `solo|delegated|subagent`; `carrier` (including `epic.author`) accepts `solo|subagent`. **`parallel` is a flag (`on|off`), not a recipe:** it resolves OUTSIDE the recipe lattice, never degrades, and never reaches the planner. A silent slot takes its **computed default** — `solo` for `author`, `fold`, `execute` and `carrier` (placing
|
|
19
|
+
**The activities and their slots.** One registry (`tools/carriers.mjs`, re-exported by `recipes.mjs`) names **six** activities and their typed slots: `plan-authoring` → `author`, `fold`, `review`; `plan-execution` → `execute`, `review`; `routine` → `carrier`, `parallel`; `feedback-triage` → `review`; `epic` → `author`, `review`; `task` → `author`, `execute`. Each slot's accepted values follow its TYPE — `review` (including `epic.review`) accepts `solo|reviewed|council`; `execute` (including `task.author` and `task.execute`) accepts `solo|delegated|subagent`; `carrier` (including `epic.author`) accepts `solo|subagent`. **`parallel` is a flag (`on|off`), not a recipe:** it resolves OUTSIDE the recipe lattice, never degrades, and never reaches the planner. A silent slot takes its **computed default** — `solo` for `author`, `fold`, `execute` and `carrier` (placing either vehicle never flips a default; the subagent carrier is opt-in exactly as `delegated` is), `reviewed`/`solo` by readiness for `review`, and `on` for `parallel`.
|
|
20
20
|
|
|
21
21
|
**The configured-recipe line (`--active-line`, read-only).** `node ${CLAUDE_SKILL_DIR}/tools/recipes.mjs --active-line` prints exactly **one** machine-composed line: the **CONFIGURED** recipe of every activity/slot, resolved from the target project's `docs/ai/orchestration.json` (read from the current directory) + live readiness — each slot with its source (configured vs computed default), its degradation stated, and its dispatched wrapper set — explicitly contrasted with the readiness **recommendation** (which is informational; the configured recipes are what runs). Paste it verbatim: it fills the session-start discovery step (the deployed `agent_rules.md` §1.1) and the handover "Active recipes:" slot; `set-recipe` echoes the same line after every successful write. A malformed config fails loud (exit 1), never a silent fallback.
|
|
22
22
|
|
|
23
23
|
On the status line, `ready` for a bridge means wired where the project settings enable the sandbox: the segment ` · sandbox: <condition>` states `ready means wired` where the host honors the settings sandbox keys when they enable it, `ready means installed` where they do not, or `unchecked — <reason>` when it cannot be judged. A ready bridge whose sandbox entries are missing shows `✗ not wired — <n> sandbox entr(ies) missing` (`✗ not wired (unused) — <n> sandbox entr(ies) missing` when no slot uses it) or `✗ unchecked — <reason>`. The recommended recipe stays the readiness one, its clause naming each ready bridge whose review surfaces are not wired (`not wired: <alias> (review)`) or unchecked; a bridge missing only its execution wrapper's entries shows in its cell and its not-wired line. After the recommended line, the recipes output lists one `not wired: <alias> — missing …; <condition>; <route>` line per such bridge and one `unchecked: <alias> — <reason>` line per unchecked bridge; the route is the chat yes of `/agent-workflow-kit upgrade` (once a slot uses an unused bridge for review).
|
|
24
24
|
|
|
25
|
-
**Invariants:** read-only · never runs a subscription CLI · never commits · the orchestrator executes the recipe via the bridge skills or the
|
|
25
|
+
**Invariants:** read-only · never runs a subscription CLI · never commits · the orchestrator executes the recipe via the bridge skills or the vehicle of the slot's role, not the kit.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md
|
|
6
6
|
|
|
7
|
-
The **read-only deployment advisor** — the deterministic section every `upgrade` run ends with, also invocable on its own. It computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, sandbox unavailable, gates undeclared, a declared gate matrix that verifies nothing, bridge friction, sandbox-mask clutter, a
|
|
7
|
+
The **read-only deployment advisor** — the deterministic section every `upgrade` run ends with, also invocable on its own. It computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, sandbox unavailable, gates undeclared, a declared gate matrix that verifies nothing, bridge friction, sandbox-mask clutter, a `subagent` slot whose vehicle is not ready, a difference from the reference profile the project has not declined, Jev not connected on this host, the Jev skill not installed for every agent) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · `lane: chat`, `lane: harness`, `lane: kit` or `lane: user` · an optional `recipe:` line (an item's own facts or its alternative, such as the `bridge-tier` missing-entries line or the `worktrees-dir` ack fallback) · a harness or kit item's `check:` line before its apply slot · the apply slot: a chat one-liner, a harness or kit item's apply line or a user item's own step}**. The tool computes deterministic English DATA; **you PRESENT the section in the user's conversational language** — every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings stay **byte-exact**; show the raw tool block on request (the AD-032 report-contract lane — the tool cannot know the dialogue language, so the language rendering is your presentation layer).
|
|
8
8
|
|
|
9
9
|
**Live host/session facts are tool-composed only.** Every fact this section states about the current
|
|
10
10
|
host or session — prompts fired, sandbox scope, whether a bypass was needed, network reachability,
|
|
@@ -16,7 +16,7 @@ host/session facts* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md`.
|
|
|
16
16
|
Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root> [--json]`:
|
|
17
17
|
|
|
18
18
|
1. **`--cwd` is REQUIRED** — the target project is explicit, never inferred from the shell's current directory (a subdirectory invocation still advises on the named root).
|
|
19
|
-
2. **Verdict first (present-even-when-empty, opening at the `## Recommendations (agent-workflow)` header).** With everything optimal the body is exactly `no recommendations — flow optimal.` — the empty-state line ALONE is the verdict, zero added lines. Every other state opens the body with ONE verdict line composed from the frozen templates: `{K} item(s) need attention` leads when any item's severity is `attention` (a CONFIGURED declaration that is broken, drifted, degrading or invalid — the deployment needs review); `{N} optional recommendation(s), apply any you want` covers the `optional` class (offers to enable an unconfigured capability), led by `nothing is broken` ONLY when no item needs attention AND no probe check was skipped (a skipped probe could hide an attention-class problem — the claim never overreaches); `optimality NOT attested — {M} probe check(s) skipped` is appended last whenever probe checks were skipped. A kit item counts in neither class (applied with no pick): with only kit items and no skip the verdict is `nothing is broken` alone. (The `(s)` invariant form IS the pinned pluralization — no singular/plural branching.) Items render attention-first, each tagged `needs attention:` / `optional:`. A failed probe renders as a stated `⚠ skipped item …` line
|
|
19
|
+
2. **Verdict first (present-even-when-empty, opening at the `## Recommendations (agent-workflow)` header).** With everything optimal the body is exactly `no recommendations — flow optimal.` — the empty-state line ALONE is the verdict, zero added lines. Every other state opens the body with ONE verdict line composed from the frozen templates: `{K} item(s) need attention` leads when any item's severity is `attention` (a CONFIGURED declaration that is broken, drifted, degrading or invalid — the deployment needs review); `{N} optional recommendation(s), apply any you want` covers the `optional` class (offers to enable an unconfigured capability), led by `nothing is broken` ONLY when no item needs attention AND no probe check was skipped (a skipped probe could hide an attention-class problem — the claim never overreaches); `optimality NOT attested — {M} probe check(s) skipped` is appended last whenever probe checks were skipped. A kit item counts in neither class (applied with no pick): with only kit items and no skip the verdict is `nothing is broken` alone. (The `(s)` invariant form IS the pinned pluralization — no singular/plural branching.) Items render attention-first, each tagged `needs attention:` / `optional:`. A failed probe renders as a stated `⚠ skipped item …` line, never a crash or a fabricated item; if the line lost anything, its whole reason follows on `|` lines: relay all.
|
|
20
20
|
3. **The apply-through-agent lane — an explicit informed-consent checkpoint:** the agent applies chat and harness items on the chat yes, harness items by the consent route below, and kit items with no question by the kit route below. A chat item is never retried outside the sandbox and every failure of a chat step is a STOP. A user item is the user's own step, handed over as worded with its posture note (e.g. `source-size.id-squatter`). After presenting, OFFER to apply; the user selects items in plain language; for each selected item you **surface its posture note inline** where one exists (the per-item notes below cover exactly the risk-marked keys). For a chat item: the user **explicitly confirms**, and **only then** — **no command runs before confirmation** — do you run the rendered command. Do NOT infer safety from the presence or absence of an `--apply` flag: most chat items' rendered command IS the mutation and completes on that one run, **including a no-`--apply` mutation** such as `spec-adoption`'s `ensure-configs --reconcile --only specs` (it writes an edited spec-layer file with the bundled body with no question, its line naming where an edit meant to last goes). Some items instead render a **dry-run preview** that changes nothing and prints an explicit follow-up `--apply`/mutating command to run NEXT (e.g. the `gates-declaration` seeder): after the SAME confirmation you run that printed follow-up command — no second ask, no improvisation (each writer keeps its own consent semantics: previews, `--apply` flags, refusals) — except profile-gap, whose apply line runs with --apply appended only on a second yes over the relayed preview. For `worktrees-dir` you apply the grant on the chat yes after its check, like every harness item, with no hand step to wait for; its `recipe:` line's `ack-write` preview is the ack fallback, run only on the user's word that the host ignores the settings key, instead of the grant, and against a trusted host NO no ack renders.
|
|
21
21
|
4. Registry strings (benefits + item texts) are frozen tool data, fact-true, ONE line under the pinned shape cap — posture/risk detail lives in the notes below at the consent moment, never inline in the overview. The dual velocity+security wording (`safer — blast radius bounded by the OS sandbox, not human attention`) rides ONLY the items with a real security delta (the autonomy render, the sandbox provisioning); the bridge-wrappers item claims **velocity only**.
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ The **consent route** for a harness item: run its `check:` line in the sandbox a
|
|
|
24
24
|
|
|
25
25
|
**The kit route** for a `lane: kit` item, which writes a kit file of a component the project already has or the host already accepted: ask no question and wait for no pick. Before offering the other items, run each kit item's `check:` line in the sandbox and show its result, then at once run its `apply:` line with that result's digest once, outside the sandbox; the harness's own dialog there is its consent, which the kit cannot remove. A changed digest (exit 5) re-runs the check once and applies with its new digest, still with no question; every other outcome leaves the item pending with its output shown, and the agent goes on; an auto-mode refusal gets the one plain step above. `init` checks and applies it on its one y, as a harness item.
|
|
26
26
|
|
|
27
|
-
**The `executor-vehicle` item (the carrier the project already CONFIGURED — beside the `agents` offer, never the same item).** It fires
|
|
27
|
+
**The `executor-vehicle` item (the carrier the project already CONFIGURED — beside the `agents` offer, never the same item).** It fires when a slot in `docs/ai/orchestration.json` names `subagent` and its role's vehicle is not ready: the author vehicle for author slots (`plan-authoring.author`, `plan-authoring.fold`, `epic.author`) in any state but `placed`, or the executor for carry slots in `missing` or `unusable`. Each affected slot resolves to solo. That is a broken declaration, hence **`attention`**, not an offer; its text names each unready vehicle, its state and reason, and how many slots are affected. **`placed` renders NOTHING** for that vehicle (a working vehicle is not a recommendation); the item yields to `agents.not-current`, the kit item the agent applies with no question, which places or writes kit agent files in a placed component, including a regular executor whose bytes differ, the check failing or not; a config naming no `subagent` slot renders no base item, and a config the validated reader refuses is a stated **skip**, never an item computed over a shape nothing accepted. It is deliberately DISTINCT from the `agents` offer and the review-recipe probe, neither of which can observe this state. The agent applies it on the chat yes after the check; `init` previews the agents writer's own `cheap-agents.mjs` and applies it with `--apply` on the terminal yes as a route the user may take instead. Its `recipe:` line carries each precondition the advisor observes beside the apply slot, followed by the hidden-mode reconcile follow-up (`hide-footprint --reconcile`), for a hidden deployment only. Honest limit on convergence: the apply places an ABSENT vehicle, so it clears `missing`; it STOPs on a symlink, so on `unusable` the `recipe:` line names each refusal as a precondition; a regular executor failing its check and a stale or widened author are written by the apply itself. Risk profile: writes under `.claude/agents/` only — every kit agent file written current with no question, the executor's and the review lens's bodies derived from `docs/ai/vehicles.json` — never `settings.json`, never a commit.
|
|
28
28
|
|
|
29
29
|
**Per-item posture notes (the consent moment — surface BEFORE running or handing over the apply):**
|
|
30
30
|
|
|
@@ -39,7 +39,8 @@ A variant's posture note, where its key has one, is printed by `init` from this
|
|
|
39
39
|
|
|
40
40
|
- `source-size` — the arms differ by what the declared gate IS. **`adopted-elsewhere`** — the gate runs a DIFFERENT real copy of this checker (a vendored deployment): the practice runs, the advisor cannot resolve it as its own sibling, and the realpath anchor does not widen (that stops a lookalike). So the convergence is the ack writer's preview (`--lane source-size-copy` → `sourceSizeCopyAck`), never `--adopt`, which would mint and then be refused by the fill on the declared id. The fingerprint binds the declared claims AS AUTHORED, sorted, not resolved paths, so a second external copy re-fires it. **`id-squatter`** — a gate carries the `source-size` id and is not this checker under any reading: the gate matrix reads as running the size check while it runs none, so it is the user's own step (rename the id, or repoint the cmd at this `--check`). **`unminted`**, for both copies: a gate refusing every run over an authored record (over an absent one the check judges layout alone), attention, and NO acknowledgement silences it; only the verb differs (with the gate declared elsewhere, `--write-baseline`); a line carrying the placeholder takes your own sentence, by the `recipe:` line. **`schema-1`** — the check stops on a minted schema-1 config, so this arm comes first: its `--write-baseline` line carries NO reason (a pinned one would launder a raise; a raise riding the move refuses, and the agent writes that raise's reason from what the run shows, with no question to the user), every run until the move. **`layout`** — on a config with no layout record, the record of the piles already there comes first, as its own item: a no writes nothing and the item returns every run; its `recipe:` line names the branch states, and `source-size.layout` is applied before the `hook-checks` check line runs, whose layout line follows that record. **`piles`** — each recorded pile with no queue row gets one, at the end of the queue's Later bucket; a write the queue's own declared check would refuse is not made and the stated skip says why. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file, so every arm here either records an acknowledgement or hands you an edit — the kit declares nothing on its own.
|
|
41
41
|
- `gate-hook` — the offer wires the hook on the harness lane: the agent applies it on the chat yes after the check; `init` previews and applies it on the terminal yes as the route the user may take instead. Over a wired hook the key renders the kit item `gate-hook.not-current` instead: the placed hook file is absent or differs from the body the kit writes for it. An older body validates your declaration through its OWN baked copy and goes dark on a key it does not know, such as `lcovProducer` (present, whatever its value), so every gate prompts again with no error anywhere. The agent applies the kit item with no question after the check, whose result names the file with its new digest, and the old one too over a differing file; it writes only the hook file. Risk profile: the offer places a hook file and wires one settings entry; the kit item writes one hook file with the kit's body; the declaration is never touched.
|
|
42
|
-
- `
|
|
42
|
+
- `stage-guard` — the offer wires the guard on the chat yes; over a wired guard, `stage-guard.not-current` writes its file.
|
|
43
|
+
- `enforcement` — copies the bundled runtime files of `references/scripts/` into the kit folder `scripts/agent-workflow/`, then runs the project's own hook installer, which installs the pre-commit hook. The lane is harness: the agent applies the item on the chat yes after the check, whose result shows each copy with its digest and the installer run with one digest of every deployed path; `init` applies it on the batch terminal yes as the route the user may take instead. The copy is create-only: an existing file stands and nothing is written through a link, and the offer renders only on no Node evidence. The hook invokes `node` directly, so a committer without it on PATH gets a loud failure. The installer refuses to overwrite a pre-commit hook it did not write: an install it refuses removes the scripts this apply copied, and the item is offered again with the installer's output shown; over a pre-commit hook the installer did not write the item is not offered — its skip names the user's own step. Risk profile: local tooling and a Git hook are added on the chat yes after the check, or on init's y.
|
|
43
44
|
- `hook-checks` — the agent applies the item on the chat yes after the check; `init` applies it on the terminal y as the route the user may take instead. Risk profile: future commits stop on the rules check and, where judged, on the size check's findings — lines and layout; over a clone with no pre-commit hook the installer writes its whole hook, so commits also stop on its docs and archive lines.
|
|
44
45
|
- `attribution` — the agent applies the item on the chat yes after the check, setting one key in the project `.claude/settings.json`; `init` applies it on the terminal y as the route the user may take instead. An existing "includeCoAuthoredBy": false already converges the item unless an "attribution" key sets a commit or PR text; a local-scope override is the user's own edit. Risk profile: one settings key, nothing widened.
|
|
45
46
|
- `footprint-global` — the agent applies the item on the chat yes after the check, which prints each line it removes; `init` applies it on the terminal y as the route the user may take instead. Another of the user's repositories may rely on the same lines: a no keeps the block, and the item returns at the next run. The apply prints the removed lines as a backup. Risk profile: lines removed from the machine-global excludes file.
|
|
@@ -11,14 +11,15 @@ no-process spawn error) that nobody had written into the brief. The list is data
|
|
|
11
11
|
renders it, so a retro extends the list instead of a reviewer re-finding a member.
|
|
12
12
|
|
|
13
13
|
**What it reads.** The plan file named by `--plan`, opened as a regular file no-follow through the
|
|
14
|
-
kit's capped descriptor read (1 MiB
|
|
15
|
-
under the realpath of the cwd (the project root the advisor renders the command from; no git is
|
|
14
|
+
kit's capped descriptor read (1 MiB, a bound of its own: a plan file past it is refused at the read in both modes)
|
|
15
|
+
with its realpath required under the realpath of the cwd (the project root the advisor renders the command from; no git is
|
|
16
16
|
asked): an absolute path outside, a `..` traversal out of it, a symlink leading out, a non-regular file and
|
|
17
17
|
an over-cap plan each refuse **exit 2** by name — the generator PRINTS row text, so unlike
|
|
18
18
|
plan-shape-cli's unbounded no-follow read it is bounded. The plan is judged on every rule of plan-shape's structural half (headings, section caps,
|
|
19
|
-
row grammar, ids, bytes, lexical containment, sweep form, duplicate paths,
|
|
20
|
-
acceptance and governing-spec presence rules
|
|
21
|
-
|
|
19
|
+
row grammar with the old form refused by name, ids, bytes, lexical containment, sweep form, duplicate paths, amendments, the
|
|
20
|
+
acceptance and governing-spec presence rules and the robust-tag rule, which is structural) over facts
|
|
21
|
+
holding only the list's class ids (`{ robustClasses }`); the facts-bound half — realpath containment
|
|
22
|
+
and sweep expansion — stays `plan-shape --check`'s. A plan
|
|
22
23
|
that fails the structural half is refused, never half-rendered. And the kit's own list through its
|
|
23
24
|
reader leaf (a list that fails the closed schema is refused by name; the tag grammar is that leaf's
|
|
24
25
|
`parseRobustTag`, ONE home). Nothing else: no git, no project config, no network.
|
|
@@ -46,9 +47,9 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/robustness-brief.mjs --plan <plan> [--row <i
|
|
|
46
47
|
4. Where it belongs (procedures.md `plan-execution` step 2): the dispatch brief — delegated or
|
|
47
48
|
subagent — carries the generated block for every tagged row; the procedures advisor renders the
|
|
48
49
|
populated command in the plan-execution render. Tag a row by writing `robust:<class>` in its
|
|
49
|
-
responsibility sentence;
|
|
50
|
-
(`robust-class`) and
|
|
51
|
-
5. **`--coverage`** judges every valid `create`/`modify` row except `.md`/`.txt` documents and the shipped list itself. A class is PRESENT when the row file's bytes carry a bounded member token of kind env/flag/ref/syscall/errno/argv; `state` is never searched, `uncovered = present − tagged`, delete and absent rows are listed, and sweep rows union every path expanded by `plan-shape-facts`' one glob compiler. Reads use the same 1 MiB capped no-follow primitive. The table exits `0` when covered, `1` with each `row:class:literal` when uncovered, and `2` on a named row-read refusal
|
|
50
|
+
responsibility sentence; plan-shape's structural rules refuse, in every arm, a tag the grammar
|
|
51
|
+
refuses or a class id the list does not carry (`robust-class`) and leave an untagged row unjudged.
|
|
52
|
+
5. **`--coverage`** judges every valid `create`/`modify` row except `.md`/`.txt` documents and the shipped list itself. A class is PRESENT when the row file's bytes carry a bounded member token of kind env/flag/ref/syscall/errno/argv; `state` is never searched, `uncovered = present − tagged`, delete and absent rows are listed, and sweep rows union every path expanded by `plan-shape-facts`' one glob compiler. Reads use the same 1 MiB capped no-follow primitive. The table exits `0` when covered, `1` with each `row:class:literal` when uncovered, and `2` on a named row-read refusal or a tag refusal on a row it judges (naming row and class); a structural `robust-class` finding is left to it, so a tag on a document row it skips is not judged here, and any other structural finding still exits `1`. Bootstrap: for rows up to the row that lands this mode, apply the rule by hand; thereafter run coverage before every dispatch and before `flow-writer adoption`.
|
|
52
53
|
|
|
53
54
|
**Honest bounds (stated, accepted):** the tag is the author's claim — the tool cannot know that an
|
|
54
55
|
untagged row touches git, the reviewer still can; the list names classes and carries only MEASURED
|
|
@@ -40,7 +40,7 @@ Run **`node ${CLAUDE_SKILL_DIR}/tools/set-recipe.mjs [--set <activity>.<slot>=<v
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
`parallel` is a **flag**, not a recipe: it resolves outside the recipe lattice and is never degraded. Examples: `--set routine.carrier=subagent`, `--set routine.parallel=off`, `--set plan-authoring.author=subagent`, `--set plan-authoring.fold=subagent`. A value outside its slot's list is a **usage** error (`2`) naming the accepted values, never a coercion to a neighbour.
|
|
43
|
-
2. **Preview by default** — prints `current → proposed` for the **changed** slots only, plus the **effective recipe resolved against live carrier readiness** (degradation stated honestly, e.g. *council requested, 1 ready reviewer → runs reviewed until a 2nd backend is ready*; *subagent requested, the
|
|
43
|
+
2. **Preview by default** — prints `current → proposed` for the **changed** slots only, plus the **effective recipe resolved against live carrier readiness** (degradation stated honestly, e.g. *council requested, 1 ready reviewer → runs reviewed until a 2nd backend is ready*; *subagent requested, the author vehicle for an author slot or the executor for a carry slot is `missing` → runs solo until its vehicle is placed, naming the vehicle and apply command*). A `parallel` value is reported as requested — a flag has nothing to degrade against. It writes **nothing**. Re-run with **`--write`** to apply (same effective/degradation note — a direct `--write` is never quieter than the preview). `--unset` returns a slot to its computed default (reverting needs no hand-edit either). A no-op `--set` (slot already equals) writes nothing and never re-seeds the onboarding note.
|
|
44
44
|
3. **`--write`** applies via a hardened, atomic write (deployment-gated — refuses to scatter a config into a repo with no `docs/ai`; exclusive-create temp + rename; symlink/TOCTOU-safe; last-writer-wins). It preserves the onboarding note + every untouched slot, normalizing to canonical 2-space JSON.
|
|
45
45
|
**Standing-consent advisory (after a successful `--write` only, and only when the written config names a `reviewed`, `council` or `delegated` recipe — a solo recipe gets NO advisory):** the upgrade's Recommendations `bridge-tier` item wires the used bridges on its chat yes — the used review wrappers' code-mode allow rules (and agy-review's quoted grounding pre-step rule), the `<wrapper> *` exclusions (`codex-exec *` where an execute slot delegates; it keeps its prompt), the hosts and the state dirs. Plan and diff review modes keep their prompt. State plainly: auto-approving a review wrapper **spends subscription quota without a per-run prompt** — that is exactly what standing consent means here, so it is the maintainer's call. The grounding pre-step writes one scratch facts file, covered by that consent; its rule matches the double-quoted path the procedures advisor renders.
|
|
46
46
|
4. **Exit codes:** `0` success (an explicit recipe that gracefully degrades is still `0`); `2` usage (a bare/duplicate op, or `--write` with no ops); `1` config error (malformed/unreadable config — the file is left **untouched**, never clobbered) or a write STOP (no deployment / a symlinked config). A `1`/`2` failure is loud; on a malformed config, offer to show the parse error so you can help the user fix the JSON.
|
|
@@ -87,9 +87,10 @@ not a configuration you can set today.
|
|
|
87
87
|
**The writer — `tools/state-block-hook.mjs`.** The `state-block` advisor item is a harness item:
|
|
88
88
|
the agent applies it on the chat yes after the danger check, and `init`, run in a console from the
|
|
89
89
|
project's folder, applies it on the terminal y as the route the user may take instead. Without
|
|
90
|
-
`--apply` the writer is a preview that writes nothing; `--apply` writes. It
|
|
91
|
-
writer
|
|
92
|
-
stamp refusals use that
|
|
90
|
+
`--apply` the writer is a preview that writes nothing; `--apply` writes. It runs on the kit's hook writer
|
|
91
|
+
`tools/hook-writer/index.mjs`, which imports the gate-approval writer's symlink, target and
|
|
92
|
+
settings-shape checks from `tools/gate-hook.mjs`; its unsafe-mode and stamp refusals use that
|
|
93
|
+
writer's error codes:
|
|
93
94
|
|
|
94
95
|
- the runtime goes to `.claude/hooks/state-block-guard.mjs` — created when absent, kept when
|
|
95
96
|
byte-equal, replaced in place when it differs (the preview says so, and the check's result names
|
|
@@ -16,7 +16,7 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/family-registry.mjs --json [--dir <project>]
|
|
|
16
16
|
- **recipes** — the effective recipe per slot, **one line per slot** over the six activities (`plan-authoring.author` / `.fold` / `.review`, `plan-execution.execute` / `.review`, `routine.carrier` / `.parallel`, `feedback-triage.review`, `epic.author` / `.review`, `task.author` / `.execute`); each line also carries **where the value came from** (`source` — the project's config, an explicit override, or a computed default) and, when the resolved recipe is not the one that was asked for, **what it degraded from** (`degradedFrom`). Say both in plain words (never the field names): an effective recipe alone cannot tell a deliberate choice from a default, nor a degrade from a config that really names the resolved recipe — and a slot showing `solo` after a degrade from `subagent` is exactly the case the **subagents** line below explains. Detail → `/agent-workflow-kit procedures` / `recipes`; a `recipes.detectError` → say the backends couldn't be checked, so bridge-backed recipes floored at solo; the executor vehicle is unaffected.
|
|
17
17
|
- **attribution** — `includeCoAuthoredBy` effective; call out a **local override** only when `local` is non-null **and** differs from `project` (a `null` `local` means the key is absent there, so the project value stands — that is not an override).
|
|
18
18
|
- **velocity** — the effective `permissions.defaultMode` + whether an allowlist is seeded (detail → `/agent-workflow-kit velocity`).
|
|
19
|
-
- **subagents** — how many of the kit's subagent vehicles are placed (`agents.placed` of `agents.bundled`; zero placed → the optional `/agent-workflow-kit agents` opt-in), then the **split the line always states separately**: the **read-only vehicles** (`agents.readOnly` — four; none of them grants a shell, three ride a cheap model for mechanical work and one is a read-only review lens) and the **ONE full-tool `executor`**, whose own state is `agents.executor`: *placed* / *customized* (both dispatchable) / *unusable* (`agents.executorReason` carries the reason — say it) / *missing*.
|
|
19
|
+
- **subagents** — how many of the kit's subagent vehicles are placed (`agents.placed` of `agents.bundled`; zero placed → the optional `/agent-workflow-kit agents` opt-in), then the **split the line always states separately**: the **read-only vehicles** (`agents.readOnly` — four; none of them grants a shell, three ride a cheap model for mechanical work and one is a read-only review lens), the **author vehicle** (`agents.author`: `placed` / `stale` / `widened` / `unusable` / `missing`; `agents.authorReason` carries the reason — say it), and the **ONE full-tool `executor`**, whose own state is `agents.executor`: *placed* / *customized* (both dispatchable) / *unusable* (`agents.executorReason` carries the reason — say it) / *missing*. Render `<placed>/<bundled> placed — <n> read-only, author <state>[ (<reason>)], executor <state>[ (<reason>)]`. For `subagent` to resolve, author slots need the author vehicle `placed`; carry slots need the executor `placed` or `customized`. Otherwise the slot runs solo, naming its vehicle, so surface the states beside the recipes lines and point at `/agent-workflow-kit agents`. They are claims about the FILE, never the host. For an absent author or executor state render `unknown (the installed kit predates the field)` rather than inventing a state.
|
|
20
20
|
- **gate hook** — wired / hook file placed / declaration present, plus **`hook.declaredGates`** (0 = absent or an empty list; `null` = present but unreadable → say *couldn't be counted*, never a number; detail → `/agent-workflow-kit hook` and the gates guide).
|
|
21
21
|
- **bridge knobs** — a settings entry carrying **`retired`** is a key that is CONFIGURED but arms nothing: say so plainly (the reason is in the field) and point at `bridge-settings --unset <KEY> --apply` to clear it. Never render a retired key as an active setting.
|
|
22
22
|
- Any area's **`error`** field → surface it **loudly** in plain language; the rest of `status` still renders (never a crash).
|
|
@@ -42,7 +42,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
|
|
|
42
42
|
|
|
43
43
|
**What the executor ensure does.** It never writes: a placed `.claude/agents/executor.md` whose bytes differ from the body derived from `docs/ai/vehicles.json` is `pending` and an absent one is `not-placed` — the advisor's `agents` item writes the derived body.
|
|
44
44
|
|
|
45
|
-
**What the enforcement-script ensure does.** It judges every kit script of the kit folder `scripts/agent-workflow/` — each deployed `*.mjs` of `${CLAUDE_SKILL_DIR}/references/scripts/` but the spec layer's pairs, the test reporter and `run.mjs`, which the spec-layer ensure places first — once the component is accepted: a kit script outside the seed names (memory's own copies) stands in the kit folder as a regular file, or a regular file stands in `scripts/` under the old flat name of the hook installer. Each file by proof, with no question and no copy kept: a shipped prior is refreshed, an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left.
|
|
45
|
+
**What the enforcement-script ensure does.** It judges every kit script of the kit folder `scripts/agent-workflow/` — each deployed `*.mjs` of `${CLAUDE_SKILL_DIR}/references/scripts/` but the spec layer's pairs, the test reporter and `run.mjs`, which the spec-layer ensure places first — once the component is accepted: a kit script outside the seed names (memory's own copies) stands in the kit folder as a regular file, or a regular file stands in `scripts/` under the old flat name of the hook installer. Each file by proof, with no question and no copy kept: a shipped prior is refreshed, an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left. Each file follows its imports. A closing line says the commit hook runs the files written. On a declined enforcement offer, a project with Node evidence gets every seed file, the decisions rotator and the modules it imports, kept current (an absent one placed); the run places no other kit script (one line says so) and words that hook-run line as a condition. **The ADR store, after the writes:** where the run judged the rotator, it runs the kit folder's rotator with `--ensure-current`, with no question, which brings the store current (an older layout moved) or writes nothing; its lines are relayed under `ADR store: `. A rotator that does not bring the store current is `failed` / `adr-store-not-current`, the scripts written above staying as written: its refusal stops the upgrade. **The move from the flat layout, the run's last act.** A deployment of an earlier release holds the kit's old files flat in `scripts/` (the names of `PRIOR_FILES` in `${CLAUDE_SKILL_DIR}/tools/script-priors.mjs`). After every write landed and the store run passed, and only while `scripts/agent-workflow/run.mjs` stands, each `scripts/<name>` of those names whose bytes are a body this kit shipped is removed, `scripts/<name>: removed — the kit's scripts live in scripts/agent-workflow/`, when its replacement `scripts/agent-workflow/<path>` stands or it has none (a suite, the test-support file, the gate migration); one whose replacement is not placed yet is kept with its line and waits for the next run, and so is every old file while `run.mjs` does not stand (under `--only scripts` the spec-layer ensure does not place it). A file whose bytes differ from every body this kit shipped is the user's, named and left, never written or removed; a link, a directory, an unreadable file or a failed unlink is named and left. A removal counts as `refreshed`; `--dry-run` removes nothing and prints what would be removed. After a removal the run prints one line per regular `scripts/*.test.mjs` left that is not the kit's (a suite of the user's own, which the kit's hook does not run: wire it with `node --test scripts/<file>` in `scripts/pre-commit.local`); inside a git work tree one `git grep` line over the old names, the kit folder excluded, and its boundary line (the hooks dir and ignored files are the user's to check), outside one a line saying so; and, in a visible deployment, one line to commit `scripts/agent-workflow/`, the removed files and, as the upgrade changed them, `docs/ai/gates.json` and `package.json` as one change, merged into every branch still committed or installed on. **Edit each grep hit in this upgrade:** a `node scripts/<file>` of a kit check becomes `node scripts/agent-workflow/run.mjs <name>` with its arguments; a path of a deployed file becomes `scripts/agent-workflow/<path>`; a suite and the test-support file have no deployed path (a suite of the user's own is the suite line's, and a file of the user's importing the support file keeps a copy under a name of its own); a hit of the gate migration is row 4's registry `gates-migration` command, never a path under the kit folder; a record in `docs/ai/source-size.json` is regenerated by the size check's `--write-baseline`. Edit `package.json`'s scripts in this upgrade too (the documented wiring of `contracts.md`): a `prepare` script fails at Node's cannot-find-module until then. Row 4's migration switches the old gates and the `hook-checks` item switches the managed commit hook. **What stays open:** a no on the hook item leaves every commit stopped at Node's error naming a removed file until the item is applied or `node scripts/agent-workflow/run.mjs install-git-hooks` is run; a gate row 4 keeps is named with its own line and runs as declared until that line is acted on; the hooks dir (another hook of the user's) and ignored files are outside the printed line; a checkout without the kit folder commits under the hook's checkout line and installs through its own old installer, which refuses the clone's name-free hook (exit 1, so a `prepare` there fails) until it takes the move; in a project named `agent-workflow` the new hook carries the old installer's marker, so that installer rewrites the hook to the old paths instead, and every commit of a moved checkout stops at Node's error naming a removed file until `node scripts/agent-workflow/run.mjs install-git-hooks`, run in a moved checkout, writes it back. The suite and grep lines print once, on the run that removed: an upgrade stopped after that run and before these edits finishes them from this paragraph — wire each regular `scripts/*.test.mjs` outside the names of `PRIOR_FILES` as a suite, and search with `git grep -n -F --untracked -e <name> … -- . ':!scripts/agent-workflow'`, one `-e` per name of `PRIOR_FILES`. Where the size practice measures `scripts/`, a write may grow a root past its record: the size check names its own reasoned `--write-baseline`. **Whether Node runs here is PROVEN, never proxied:** Node evidence is a regular root `package.json`, or a regular file, every folder above it a plain directory, at one of the kit's flat script names in `scripts/` or at a deployed path in `scripts/agent-workflow/`; `skipped-no-node-evidence` only when the probe finds none, a line naming every probe it checked, while the config ensures still run; a probe that cannot be read is `failed` with the cause `node-evidence-unverifiable`, nothing written. **A `skipped-*` outcome whose stated reason this tool could itself disprove may not exist**. A deployed pre-commit hook takes a new installer body only when the installer next runs: the `enforcement` check line and apply, by the consent route, re-run it (it refuses a non-marker hook as always); until then `scripts/pre-commit.local` does not run.
|
|
46
46
|
|
|
47
47
|
**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** — the `tier` offer (and, on the migrated path, steps 6–7) may 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.
|
|
48
48
|
|
|
@@ -28,7 +28,7 @@ TOKENS — not necessarily its bytes, since `rebasePins` may still rewrite absol
|
|
|
28
28
|
file on its own lane — and, where the settings file is readable, well-formed and actually carries
|
|
29
29
|
tokens, gets a neutral line naming them; orphanhood is claimed only where it is proven.
|
|
30
30
|
|
|
31
|
-
- `provision <slug> --plan <path> [--as <name>.md] [--dir <path>] [--branch <name>] [--include <path>]... [--install] [--resume]`
|
|
31
|
+
- `provision <slug> --plan <path> [--as <name>.md] [--dir <path>] [--branch <name>] [--include <path>]... [--install] [--resume] [--stage <id>]`
|
|
32
32
|
— create a feature worktree (default: the visible sibling `<repoParent>/<repoName>--<slug>`,
|
|
33
33
|
branch `aw/<slug>`) and populate it: the registry-derived footprint copy-if-missing (a tracked
|
|
34
34
|
file is NEVER overwritten, and `/.mcp.json` is never copied or owned — see below), EXACTLY ONE seeded
|
|
@@ -52,6 +52,27 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
|
|
|
52
52
|
`--resume <slug>` completes a half-done provision (identity fail-closed; handoff user sections,
|
|
53
53
|
the seeded plan, and edited copies are preserved byte-exact; the provision-record section is
|
|
54
54
|
refreshed atomically; copy-if-missing everywhere).
|
|
55
|
+
The record check (spec `kit/plan-approval`): fresh, with `--as` and with `--resume` alike,
|
|
56
|
+
provision acts on ONE plan instance — the plan placed in the worktree when one is placed, else the
|
|
57
|
+
`--plan` source — and proceeds only when that instance matches the worktree's own approval record
|
|
58
|
+
or matches in MAIN (`plan-approval/cli.mjs check`'s match, structure verdict included); a fresh
|
|
59
|
+
provision makes the MAIN match before `git worktree add`, a resume before any provision write.
|
|
60
|
+
When the match is MAIN's, its entry is appended to the worktree's own record as `from:
|
|
61
|
+
provision` once the plan is seeded. With `AW_REVIEW_RECEIPTS` non-empty, fresh provision and
|
|
62
|
+
`--resume` alike refuse at the record check before the first write, naming the variable and
|
|
63
|
+
asking that it be unset. Every other state refuses naming the record command
|
|
64
|
+
(`node <kit>/tools/plan-approval/cli.mjs record <plan> --essence-file <file>`).
|
|
65
|
+
`--stage <id>` (one of the record-gated stages `tests`, `code`, `diff-review`, `split-edits`;
|
|
66
|
+
`tests` when absent; any other id is a usage STOP) names the stage the worktree's slot file
|
|
67
|
+
`docs/plans/next-session.json` carries (spec `kit/stage-render`). Provision composes it with the
|
|
68
|
+
stage renderer's `composeSlotText` and writes it through its own journaled write after the plan is
|
|
69
|
+
seeded and its record carried, before the post-provision verify; it is the journaled surface `slot-file`, a path
|
|
70
|
+
an `--include` may not overlap, and a plans-chain path: tracked, it refuses in both lanes as the
|
|
71
|
+
handoff and the seeded plan do (below). A link or any other non-regular node at its path refuses
|
|
72
|
+
before the first provision write. With `--stage`, `--resume` rewrites the slot
|
|
73
|
+
file; without it, `--resume` writes the `tests` slot file when none is there, keeps one that
|
|
74
|
+
validates, names the placed plan and names a record-gated stage, and refuses any other naming it.
|
|
75
|
+
Every composed retry and fallback command keeps an explicitly given `--stage`.
|
|
55
76
|
Resume identity also binds the EXISTING handoff: at most one `handoff-<slug>.md` may exist and
|
|
56
77
|
its recorded slug AND branch must match the live invocation — a second handoff, a name/record
|
|
57
78
|
mismatch, or a handoff that is not a regular file is a typed STOP before anything is written
|
|
@@ -67,7 +88,7 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
|
|
|
67
88
|
The post-provision verify is lane-specific:
|
|
68
89
|
the resume verify proves only what THIS run placed or kept: every journaled leaf must be tracked or ignored in the worktree, an untracked owned leaf or any probe error stops the run naming the exact leaf, and every other path — the session's own work — is never probed and never a stop cause; a first provision keeps the blanket clean-tree verify.
|
|
69
90
|
The proof list is THIS run's live placement journal — the closed-world placement registry (the
|
|
70
|
-
handoff stub, the seeded plan, copy-set leaves, include leaves, the `node_modules` link,
|
|
91
|
+
handoff stub, the seeded plan, the slot file, copy-set leaves, include leaves, the `node_modules` link,
|
|
71
92
|
`.vscode/settings.json`, the pin-rebase targets, and the record refresh at its already-journaled
|
|
72
93
|
path), leaf-only (files and symlinks; directories are containers, never proof obligations) and
|
|
73
94
|
kind-gated: membership requires the live node's kind to match what that lane's SOURCE places, so
|
|
@@ -98,7 +119,7 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
|
|
|
98
119
|
inode, and kind of the canonical node) BEFORE `git worktree add`, and a root that is neither a
|
|
99
120
|
regular file nor a directory — or whose identity probe fails — is refused before any mutation.
|
|
100
121
|
An include that overlaps a path provision itself populates (the frozen registry footprint, the
|
|
101
|
-
seeded plan, the handoff) or another include root is refused pre-mutation too — an overlapped
|
|
122
|
+
seeded plan, the handoff, the slot file) or another include root is refused pre-mutation too — an overlapped
|
|
102
123
|
destination would meet the copy-if-missing kept-exit and skip the identity door. On a FRESH
|
|
103
124
|
(non-resume) provision an include destination that already exists at walk time is a fail-closed
|
|
104
125
|
STOP (nothing legitimate pre-populates it — filesystem aliasing the overlap compare missed is
|
|
@@ -131,8 +152,10 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
|
|
|
131
152
|
NAMED as a divergence beside the live one, with the cause its own source makes likely (a moved MAIN
|
|
132
153
|
or a hand edit for the MAIN-derived pair; a changed dependency declaration for the install
|
|
133
154
|
posture), and a field an earlier kit never wrote is no divergence at all. Every command the prompt
|
|
134
|
-
offers is a marked line naming WHO runs it: `MAIN $ …` for the landing, `HERE $ …` for
|
|
135
|
-
checkout's
|
|
155
|
+
offers is a marked line naming WHO runs it: `MAIN $ …` for the landing, `HERE $ …` for the render
|
|
156
|
+
command of this checkout's slot file (`node <kit>/tools/stage-render/cli.mjs
|
|
157
|
+
docs/plans/next-session.json` with `<kit>` resolved, the command the satellite session runs first)
|
|
158
|
+
and for this checkout's own install — including the removal of a provisioned `node_modules` symlink, which is
|
|
136
159
|
runnable even where the install command itself is not derivable. A posture with nothing to run
|
|
137
160
|
stays prose, and the recorded posture string is never printed loose: it IS a command in the
|
|
138
161
|
ordinary case, and an unattributed one reads as an instruction. A `node_modules` symlink is
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: rules
|
|
3
|
-
lastUpdated: 2026-
|
|
3
|
+
lastUpdated: 2026-11-25
|
|
4
4
|
scope: permanent
|
|
5
5
|
staleAfter: never
|
|
6
6
|
owner: kit
|
|
@@ -11,4 +11,4 @@ maxLines: 30
|
|
|
11
11
|
|
|
12
12
|
The kit block of AGENTS.md is the kit's and is rewritten on every upgrade; it and docs/ai/rules/effective/ govern over any copy of kit text elsewhere in this project's files; text of your own goes outside the block, and a change to a kit rule goes in its theme's file under docs/ai/rules/local/.
|
|
13
13
|
|
|
14
|
-
A story — one row of an epic's ledger, carried by one plan — runs as four sessions, each step in them giving one checked result: **spec and plan** (every contract the story creates or revises and the plan's ledger beside them, checked by the spec gate, the plan-shape gate and one review of at most two rounds that reads both, then the plan's approval), **tests** (only tests, each new one failing for the reason its scenario or acceptance bullet states, or on the absence of a name the plan adds, imported inside the test; no code and no prototype), **code** (code until the tests and the pre-review gates pass; a wrong test is changed only back to what its scenario states), and **diff review, release and record** (every committable output, tracked records included, staged first, the review of the staged diff in at most two rounds, the final gates and the release where the story ships one, then the plan's Phase: Cleanup). Tests and code never share a session. A storyless plan runs the same four. **Exception — a split:** moving code and its existing cases into modules, with no new logic and no new case, is one session
|
|
14
|
+
A story — one row of an epic's ledger, carried by one plan — runs as four sessions, each step in them giving one checked result: **spec and plan** (every contract the story creates or revises and the plan's ledger beside them, checked by the spec gate, the plan-shape gate and one review of at most two rounds that reads both, then the plan's approval, recorded on the yes; no code, no test, no copy of the tree and no trial suite), **tests** (only tests, each new one failing for the reason its scenario or acceptance bullet states, or on the absence of a name the plan adds, imported inside the test; no code and no prototype), **code** (code until the tests and the pre-review gates pass; a wrong test is changed only back to what its scenario states), and **diff review, release and record** (every committable output, tracked records included, staged first, the review of the staged diff in at most two rounds, the final gates and the release where the story ships one, then the plan's Phase: Cleanup). Each session starts from its stage's kit template, rendered by the one line under the handover's Next session, or in a linked work tree by its start prompt's command; an epic session and a design consult, like the spec and plan session, write no code and no test, copy no tree and run no trial suite. Tests and code never share a session. A storyless plan runs the same four. **Exception — a split:** moving code and its existing cases into modules, with no new logic and no new case, is one session in two parts: its Module list, approved and recorded like any plan, with no code and no test, then the split, the diff review, the release, Cleanup. A bridge executor gets a task only when it writes new tests or code, from one prompt of the orchestrator; a file the orchestrator already wrote is laid down by the orchestrator, never relayed through a bridge.
|
|
@@ -36,7 +36,7 @@ export const CAP_TABLE = Object.freeze({
|
|
|
36
36
|
// grows again, so its stamp is a fact about that month, not a forecast.
|
|
37
37
|
cold: Object.freeze({
|
|
38
38
|
floor: 1500,
|
|
39
|
-
ceiling:
|
|
39
|
+
ceiling: 4000,
|
|
40
40
|
remedy: 'compress that month harder — it is already one file per month, and sub-month sharding is NOT implemented (discovery matches YYYY-MM.md only, so a hand-split file would drop out of the corpus)',
|
|
41
41
|
}),
|
|
42
42
|
// WARM — docs/ai/history/recent.md: a rolling window of full-text entries, the widest tier.
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
import { readFileSync, mkdirSync, readdirSync, existsSync, realpathSync } from 'node:fs';
|
|
5
5
|
import { resolve, basename } from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import { tokenizeMarkdown, findParagraphBreak, fail, findProjectRoot,
|
|
8
|
-
|
|
7
|
+
import { tokenizeMarkdown, findParagraphBreak, fail, findProjectRoot, composeRedBlock, composeUsageRefusal, guardChecker,
|
|
8
|
+
CHANGELOG, CHANGELOG_LEGACY, CONDENSED_INDEX, HISTORY, PACKAGE_JSON, RECENT } from '../shared/index.mjs';
|
|
9
9
|
import { CAP_TABLE, capFor, countLines, shardingWarning } from './archive-caps.mjs';
|
|
10
10
|
import { fsIo, writeWhole } from './whole-write.mjs';
|
|
11
11
|
import { CARRY_REL, readCarry, renderCarry, unionEntries } from './rotation-conservation.mjs';
|
|
12
12
|
|
|
13
13
|
const ROOT = findProjectRoot(import.meta.url);
|
|
14
14
|
const CHECKER_NAME = 'archive-changelog';
|
|
15
|
-
const PACKAGE_REL =
|
|
15
|
+
const PACKAGE_REL = PACKAGE_JSON;
|
|
16
16
|
const GUARD = Object.freeze({ name: CHECKER_NAME, exitCode: 1, remedy: 'fix the cause the stack below names, then re-run' });
|
|
17
|
-
const INDEX_REL =
|
|
17
|
+
const INDEX_REL = CONDENSED_INDEX;
|
|
18
18
|
const shown = (text) => text.replace(/\r/g, '\\r').replace(/\n/g, '\\n');
|
|
19
19
|
const composeFailure = (failed, findings, remedy, after = []) => ({
|
|
20
20
|
exitCode: 1,
|
|
@@ -35,10 +35,10 @@ export const readProjectName = (root) => {
|
|
|
35
35
|
return basename(root);
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
const CHANGELOG_REL =
|
|
39
|
-
const HISTORY_REL =
|
|
40
|
-
const RECENT_REL =
|
|
41
|
-
const LEGACY_REL =
|
|
38
|
+
const CHANGELOG_REL = CHANGELOG;
|
|
39
|
+
const HISTORY_REL = HISTORY;
|
|
40
|
+
const RECENT_REL = RECENT;
|
|
41
|
+
const LEGACY_REL = CHANGELOG_LEGACY;
|
|
42
42
|
|
|
43
43
|
const DEFAULT_HOT_DAYS = 3;
|
|
44
44
|
const DEFAULT_WARM_DAYS = 30;
|
|
@@ -92,20 +92,20 @@ import { spawnSync } from 'node:child_process';
|
|
|
92
92
|
import { createHash } from 'node:crypto';
|
|
93
93
|
import { fsIo, writeWhole } from './whole-write.mjs';
|
|
94
94
|
import { tmpdir } from 'node:os';
|
|
95
|
-
import { tokenizeMarkdown, findProjectRoot } from '../shared/index.mjs';
|
|
95
|
+
import { tokenizeMarkdown, findProjectRoot, ADR_LOG, ADR_STORE, DECISIONS, DECISIONS_ARCHIVE, DECISIONS_ARCHIVE_EARLY, DOCS_TREE } from '../shared/index.mjs';
|
|
96
96
|
|
|
97
97
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
98
98
|
const DEFAULT_ROOT = findProjectRoot(import.meta.url);
|
|
99
99
|
// The command this rotator prints for itself is the stable kit command (spec kit-command).
|
|
100
100
|
const SELF = 'node scripts/agent-workflow/run.mjs archive-decisions';
|
|
101
101
|
|
|
102
|
-
export const HOT_REL =
|
|
102
|
+
export const HOT_REL = DECISIONS;
|
|
103
103
|
// The retired monolith tiers — still READ during migration (their entries explode into records) and
|
|
104
104
|
// still DETECTED by the legacy guard; never written by the new scheme.
|
|
105
|
-
export const WARM_REL =
|
|
106
|
-
export const COLD_REL =
|
|
107
|
-
export const ADR_DIR_REL =
|
|
108
|
-
export const NAV_REL =
|
|
105
|
+
export const WARM_REL = DECISIONS_ARCHIVE;
|
|
106
|
+
export const COLD_REL = DECISIONS_ARCHIVE_EARLY;
|
|
107
|
+
export const ADR_DIR_REL = ADR_STORE;
|
|
108
|
+
export const NAV_REL = ADR_LOG;
|
|
109
109
|
|
|
110
110
|
// A per-record cap (generous vs the largest real ADR ~74 lines; a body over it is a genuine smell) and
|
|
111
111
|
// the navigator's FLOOR: the navigator stamps 200 while it fits and its own line count past it, since
|
|
@@ -318,7 +318,7 @@ export const verifyConservation = (oldItems, newItems) => {
|
|
|
318
318
|
// Match contract (line-scoped; fenced lines never count): a textual occurrence of the
|
|
319
319
|
// source-file-plus-fragment form. The lookbehind rejects a longer filename
|
|
320
320
|
// (`other-decisions.md#…` is a different file, never a match); a bare `#ad-NNN` has no file part.
|
|
321
|
-
const DOCS_AI_REL =
|
|
321
|
+
const DOCS_AI_REL = DOCS_TREE;
|
|
322
322
|
const HOT_LINK_RE = /(?<![\w.-])decisions\.md#(ad-(\d{3,})[\w-]*)/g;
|
|
323
323
|
const MONOLITH_LINK_RE = /(?<![\w.-])(?:\.\.?\/)*(?:history\/)?decisions-archive(?:-early)?\.md#(ad-(\d{3,})[\w-]*)/g;
|
|
324
324
|
// The right boundary mirrors the lookbehind: `…md.bak` / `…md/child` are DIFFERENT targets, never
|