@sabaiway/agent-workflow-kit 19.2.0 → 19.3.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 CHANGED
@@ -4,6 +4,28 @@ 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
+ ## 19.3.0 — the orchestration note is written current with no question; a differing one is named with its route (AD-213)
8
+
9
+ **Your upgrade now writes the onboarding note of `docs/ai/orchestration.json` current, with no question and no copy
10
+ kept.** Before, the orchestration ensure wrote the note (its `_README` key) only when it was absent or matched a note
11
+ the kit had shipped; any other note was kept as found (`customized-preserved`), so an edited note stayed on old wording for good.
12
+ Now a current note is left (`already-current`), and an absent, earlier or any other note is written current
13
+ (`note-refreshed`, dry `would-refresh-note`), the note first and every activity, slot and key after it kept with its
14
+ value and in its order. A note the kit did not ship prints this line:
15
+
16
+ `docs/ai/orchestration.json: the current onboarding note was written over a different one (every recipe you set is kept); a note of your own goes in AGENTS.md, outside the two <!-- workflow: --> comment lines around the orchestration pointer`
17
+
18
+ - **An absent note says so**: `the onboarding note was absent and is now written (every recipe you set is kept)`.
19
+ - **`set-recipe` and the tier offer's slot write still keep a differing note**: the upgrade is the one writer over
20
+ one, so every such write is named by its line.
21
+ - **Nothing else moves.** The seed, a config that appears while the seed runs (now judged by the same rule), a
22
+ malformed config (`malformed-preserved`), a link or other node (`wrong-node-kind`) and a vanishing config
23
+ (`race-unresolved`) behave as before; `customized-preserved` stays for the navigator index, and no token or cause is
24
+ added.
25
+ - **The texts say the same.** `upgrade.md` (the orchestration token arm and paragraph), the `ensure-configs.mjs` header
26
+ and `--help`, and the guide's *Reserved names and channels*, which names the note as the kit's and points at the
27
+ ninth channel.
28
+
7
29
  ## 19.2.0 — the entry file's kit pointers and Memory Map rows are written current with no question; a differing one is named with its route (AD-212)
8
30
 
9
31
  **Your upgrade now writes the kit's three pointers in `AGENTS.md` current, with no question and no copy kept.**
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: '19.2.0'
6
+ version: '19.3.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-kit
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-kit",
5
5
  "kind": "composition-root",
6
- "version": "19.2.0",
6
+ "version": "19.3.0",
7
7
  "provides": [],
8
8
  "roles": {},
9
9
  "detect": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-kit",
3
- "version": "19.2.0",
3
+ "version": "19.3.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",
@@ -108,6 +108,9 @@ a copy matching none is the user's, left and named. Also the kit's: the three ki
108
108
  `docs/ai/agent_rules.md` (Communication, Story sessions and the planning/review lens), each
109
109
  written current on every upgrade with no question and no copy kept. Also the kit's: the three pointers of `AGENTS.md`
110
110
  and its Memory Map rows of the rules themes, each written current on every upgrade with no question and no copy kept.
111
+ Also the kit's: the onboarding note of `docs/ai/orchestration.json`, its `_README` key, written current on every
112
+ upgrade with no question and no copy kept, every recipe kept; a note of your own goes in `AGENTS.md`, outside the
113
+ two `<!-- workflow: -->` comment lines around the orchestration pointer.
111
114
  A declaration seeded once from a template and never
112
115
  replaced by the upgrade's ensures (a migration rewrites one only on the user's explicit yes) is the
113
116
  user's own file. A customization goes into one of nine channels instead:
@@ -33,9 +33,9 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
33
33
 
34
34
  **`footprint` — hidden-mode footprint reconcile (D9 / AD-014).** A deployment does not record whether it chose `hidden`, so first **infer visibility** — the dry-run writes **zero bytes** and reports one of — **visible** (the entry point is tracked) → nothing to do; **ambiguous** (untracked but not ignored — could be a fresh uncommitted repo, or a hide that broke) → **ASK** the user which it is, never guess; **hidden** → re-run without `--dry-run` to migrate any older **machine-global** hide to the **project-local** `.git/info/exclude` (one managed block; folds in the legacy `.claude/skills/` line), idempotently (a clean re-run is zero-diff). Handle its surfaced paths exactly as bootstrap step 9 (`${CLAUDE_SKILL_DIR}/references/modes/bootstrap.md`) (already-committed → show `git rm --cached`, ask before `--include`; generic-name present file → ask; **a leftover machine-wide ignore block is kept + reported — the advisor's `footprint-global` item removes it**). This runs on **every** hidden upgrade, like the methodology slot — no lineage-head bump, no migration file.
35
35
 
36
- **`configs` — the project-configuration ensures, ONE run.** The ONE command performs **all nine** ensures — orchestration config · gate declaration · autonomy declaration · vehicles declaration · executor check · enforcement scripts · spec layer · project rules · navigator index — in a fixed order, and prints **one outcome line per ensure**: paste those lines into the step 4 / step 8 success report. Every SEED is **create-only** (an existing file is preserved byte-for-byte); a refresh-class op rewrites only what it owns, and the scripts op's store run moves ADR entries, rewrites their inbound links in `docs/ai` pages and regenerates the index, as the rotator does — the outcome tokens by ensure, below, name each arm. One ensure failing **never** skips the others: each reports its own outcome and the run exits non-zero when any of them `failed`. The outcome tokens, by ensure: orchestration → `seeded` / `note-refreshed` / `already-current` / `customized-preserved` / `malformed-preserved`; gates, autonomy and vehicles → `seeded` / `already-present`; executor → `not-placed` / `already-current` / `pending`; scripts → `seeded` / `refreshed` / `already-present` / `not-placed` / `skipped-no-node-evidence`; specs → `seeded` / `refreshed` / `already-present` / `skipped-no-node-evidence`; rules → `seeded` / `refreshed` / `regenerated` / `pending` / `already-current`; index → `regenerated` / `already-current` / `customized-preserved`; and any ensure may report `failed`, whose line OPENS with the cause (relay it with that cause — never soften it into a skip; an op that copies file by file also states when it stopped partway). The cause vocabulary is CLOSED — one of `race-unresolved`, `template-unreadable`, `bundle-unreadable`, `adr-store-not-current`, `node-evidence-unverifiable`, `wrong-node-kind`, `vehicle-settings-unreadable`, `write-refused`, `unexpected-error`, `generator-unlaunchable`, `generator-failed`, `index-probe-failed`, `index-stale-after-write` — and every cause that can only arise AFTER the generator ran (`generator-failed`, and `index-probe-failed` / `index-stale-after-write` when they follow a reported regeneration) DISCLOSES in its own line that a write may already have landed. **A non-zero exit STOPs this upgrade** — 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**.
36
+ **`configs` — the project-configuration ensures, ONE run.** The ONE command performs **all nine** ensures — orchestration config · gate declaration · autonomy declaration · vehicles declaration · executor check · enforcement scripts · spec layer · project rules · navigator index — in a fixed order, and prints **one outcome line per ensure**: paste those lines into the step 4 / step 8 success report. Every SEED is **create-only** (an existing file is preserved byte-for-byte); a refresh-class op rewrites only what it owns, and the scripts op's store run moves ADR entries, rewrites their inbound links in `docs/ai` pages and regenerates the index, as the rotator does — the outcome tokens by ensure, below, name each arm. One ensure failing **never** skips the others: each reports its own outcome and the run exits non-zero when any of them `failed`. The outcome tokens, by ensure: orchestration → `seeded` / `note-refreshed` / `already-current` / `malformed-preserved`; gates, autonomy and vehicles → `seeded` / `already-present`; executor → `not-placed` / `already-current` / `pending`; scripts → `seeded` / `refreshed` / `already-present` / `not-placed` / `skipped-no-node-evidence`; specs → `seeded` / `refreshed` / `already-present` / `skipped-no-node-evidence`; rules → `seeded` / `refreshed` / `regenerated` / `pending` / `already-current`; index → `regenerated` / `already-current` / `customized-preserved`; and any ensure may report `failed`, whose line OPENS with the cause (relay it with that cause — never soften it into a skip; an op that copies file by file also states when it stopped partway). The cause vocabulary is CLOSED — one of `race-unresolved`, `template-unreadable`, `bundle-unreadable`, `adr-store-not-current`, `node-evidence-unverifiable`, `wrong-node-kind`, `vehicle-settings-unreadable`, `write-refused`, `unexpected-error`, `generator-unlaunchable`, `generator-failed`, `index-probe-failed`, `index-stale-after-write` — and every cause that can only arise AFTER the generator ran (`generator-failed`, and `index-probe-failed` / `index-stale-after-write` when they follow a reported regeneration) DISCLOSES in its own line that a write may already have landed. **A non-zero exit STOPs this upgrade** — 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
- **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.)
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, the current note is left and an absent, prior or any other note is written current with no question and no copy kept, **every activity and slot the user set kept** (CRLF/whitespace normalized first) → `note-refreshed`; a differing note's line names the route — a note of your own goes in AGENTS.md, outside the two `<!-- workflow: -->` comment lines around the orchestration pointer; 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 or keeps the file (memory upgrade step 2) and this ensure writes the note; in the **fallback** path it does both. (Memory stays standalone.)
39
39
 
40
40
  **What the gate-declaration ensure does.** `docs/ai/gates.json` must exist: created from `${CLAUDE_SKILL_DIR}/references/templates/gates.json` if missing — the kit's OWN template twin, so a memory substrate predating the gates feature never silently loses it; **an existing file is preserved byte-for-byte** (a declared gate matrix is authored content; no note-refresh here).
41
41
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // ensure-configs.mjs — ONE runnable command for the stamp-independent upgrade ensures:
3
3
  //
4
- // orchestration docs/ai/orchestration.json seed, or refresh a still-canonical onboarding note
4
+ // orchestration docs/ai/orchestration.json seed, or the onboarding note written current (a differing one's line names its route)
5
5
  // gates docs/ai/gates.json seed-if-missing (an existing declaration is authored content)
6
6
  // autonomy docs/ai/autonomy.json seed-if-missing (same)
7
7
  // vehicles docs/ai/vehicles.json seed-if-missing (same)
@@ -78,10 +78,10 @@ Usage:
78
78
  --help, -h this help
79
79
 
80
80
  Every SEED is CREATE-ONLY: an existing file is preserved byte-for-byte, never clobbered and never
81
- refreshed in place. Four ops refresh instead: the orchestration onboarding note, only while it still
82
- matches a canonical the kit shipped (your own wording is preserved verbatim); the spec-layer reader
83
- and checker pairs, with no question and no copy kept: a body a release shipped is refreshed, an
84
- edited one replaced (its line names where an edit meant to last goes) and an absent one placed,
81
+ refreshed in place. Four ops refresh instead: the orchestration onboarding note, written current over any other
82
+ note with no question and no copy kept, every recipe kept (a differing note's line names where a note of your
83
+ own goes); the spec-layer reader and checker pairs, with no question and no copy kept: a body a release shipped
84
+ is refreshed, an edited one replaced (its line names where an edit meant to last goes) and an absent one placed,
85
85
  the reader pair, then the checker pair, then the spec store root seeded create-only; the project rules
86
86
  kit file, refreshed while its bytes are a body a release shipped and any other body replaced by the template,
87
87
  with no question and no copy kept, the effective file rebuilt as its copy and recorded where no local file
@@ -11,10 +11,11 @@
11
11
  //
12
12
  // The invariants every op holds (they are what the tests pin):
13
13
  // • CREATE-ONLY seeds. A seed never clobbers: the write is the link-based create-only arm of
14
- // atomic-write.mjs, so a file that appears between the probe and the write survives byte-for-byte
15
- // and the op says `already-present` rather than reporting a write it did not do.
16
- // • The DECISION lives where it already lived. The orchestration `_README` refresh asks
17
- // orchestration-config.mjs (refreshReadme / the known-prior canonical set) and writes through
14
+ // atomic-write.mjs, so the seed never publishes over a file that appears between the probe and the
15
+ // write: a template seed says `already-present`, and the orchestration op reads the file once more and
16
+ // judges it as a present config.
17
+ // • The DECISION lives where the note lives. The orchestration op asks orchestration-readme.mjs
18
+ // (readmeState / withCurrentReadme) and writes every note but the current one current through
18
19
  // orchestration-write.mjs — the file's one writer. Nothing here re-derives either.
19
20
  // • Every token names a state this run PROVED. `already-present` follows a probe; `skipped-no-node-evidence`
20
21
  // names every Node probe that answered absent (the refusal the kit-script and spec-layer ensures
@@ -27,7 +28,8 @@
27
28
  import { readFileSync, lstatSync, unlinkSync } from 'node:fs';
28
29
  import { spawnSync } from 'node:child_process';
29
30
  import { join } from 'node:path';
30
- import { CANON_README, CONFIG_REL, SEED_CONFIG, loadConfig, normalizeCanonical, refreshReadme } from './orchestration-config.mjs';
31
+ import { CONFIG_REL, SEED_CONFIG, loadConfig } from './orchestration-config.mjs';
32
+ import { NOTE_ROUTE, readmeState, withCurrentReadme } from './orchestration-readme.mjs';
31
33
  import { seedConfig, writeConfig } from './orchestration-write.mjs';
32
34
  import { lstatNoFollow, writeDocsAiFileAtomic } from './atomic-write.mjs';
33
35
  import { GATES_REL } from './gates-declaration.mjs';
@@ -102,29 +104,24 @@ export const probeSeedTarget = (abs, lstat) => {
102
104
  export const tmpNote = (rel, tmpLeftBehind) =>
103
105
  (tmpLeftBehind ? [`${rel}: the write stands, but its temp file could not be removed — delete it by hand: ${tmpLeftBehind}`] : []);
104
106
 
105
- // ── orchestration.json — seed, or refresh ONLY a still-canonical onboarding note ────────────────
107
+ // ── orchestration.json — seed, or write the onboarding note current ──────────────────────────────
106
108
 
107
- // Which no-change outcome is it? refreshReadme returns `changed: false` for two very different trees:
108
- // a note that already IS the current canonical, and a note the user rewrote. Reporting both as
109
- // "already current" would claim the second is something it is not.
110
- const unchangedNoteToken = (config) =>
111
- normalizeCanonical(config?._README ?? '') === normalizeCanonical(CANON_README) ? 'already-current' : 'customized-preserved';
109
+ // The note is the kit's part of a shared file: every state but `current` is written current, every
110
+ // activity and slot kept, and only a differing note's line names where a note of one's own goes.
111
+ const NOTE_LINES = {
112
+ absent: ['the onboarding note is absent and would be written', 'the onboarding note was absent and is now written'],
113
+ prior: ['the onboarding note matches a previous canonical and would be refreshed', 'the onboarding note was refreshed to the current canonical'],
114
+ differing: ['the current onboarding note would be written over a different one', 'the current onboarding note was written over a different one'],
115
+ };
112
116
 
113
117
  const applyNoteRefresh = (cwd, config, dryRun, deps) => {
114
- const { config: next, changed } = refreshReadme(config);
115
- if (!changed) {
116
- const token = unchangedNoteToken(config);
117
- return ok(
118
- 'orchestration',
119
- token,
120
- token === 'already-current'
121
- ? `${CONFIG_REL}: the onboarding note is the current canonical — nothing written`
122
- : `${CONFIG_REL}: the onboarding note carries your own wording — preserved verbatim, nothing written`,
123
- );
124
- }
125
- if (dryRun) return ok('orchestration', 'would-refresh-note', `${CONFIG_REL}: the onboarding note matches a previous canonical and would be refreshed (every recipe you set is kept)`);
126
- writeConfig(cwd, next, deps);
127
- return ok('orchestration', 'note-refreshed', `${CONFIG_REL}: the onboarding note was refreshed to the current canonical (every recipe you set is kept)`);
118
+ const state = readmeState(config);
119
+ if (state === 'current') return ok('orchestration', 'already-current', `${CONFIG_REL}: the onboarding note is the current canonical — nothing written`);
120
+ const route = state === 'differing' ? `; ${NOTE_ROUTE}` : '';
121
+ const [wouldBe, written] = NOTE_LINES[state].map((line) => `${CONFIG_REL}: ${line} (every recipe you set is kept)${route}`);
122
+ if (dryRun) return ok('orchestration', 'would-refresh-note', wouldBe);
123
+ writeConfig(cwd, withCurrentReadme(config), deps);
124
+ return ok('orchestration', 'note-refreshed', written);
128
125
  };
129
126
 
130
127
  // A load failure is not automatically "malformed": a file that VANISHED between the reader's own
@@ -162,8 +159,8 @@ export const ensureOrchestration = ({ cwd, dryRun = false, deps = {} }) => {
162
159
  const { created, tmpLeftBehind } = seedConfig(cwd, SEED_CONFIG, deps);
163
160
  const seedNote = tmpNote(CONFIG_REL, tmpLeftBehind);
164
161
  if (created) return ok('orchestration', 'seeded', `${CONFIG_REL}: created from the canonical seed`, ...seedNote);
165
- // It appeared between the probe and the write. Nothing was overwritten; read it once more and
166
- // report what it now IS, rather than a claim about the file we did not write.
162
+ // It appeared between the probe and the write. The seed published nothing over it; read it once
163
+ // more and judge it as a present config, rather than claim the seed this run did not write.
167
164
  let second;
168
165
  try {
169
166
  second = loadConfig(cwd, read, lstat);
@@ -82,7 +82,21 @@ export const refreshReadme = (config) => {
82
82
  ? CANON_README
83
83
  : refreshIfCanonical(current, KNOWN_PRIOR_README, CANON_README);
84
84
  if (readme === current) return { config, changed: false };
85
- const next = { _README: readme };
85
+ return { config: withCurrentReadme(config), changed: true };
86
+ };
87
+
88
+ export const NOTE_ROUTE = 'a note of your own goes in AGENTS.md, outside the two <!-- workflow: --> comment lines around the orchestration pointer';
89
+
90
+ export const readmeState = (config) => {
91
+ if (!Object.hasOwn(config, '_README')) return 'absent';
92
+ if (typeof config._README !== 'string') return 'differing';
93
+ const normalized = normalizeCanonical(config._README);
94
+ if (normalized === normalizeCanonical(CANON_README)) return 'current';
95
+ return KNOWN_PRIOR_README.some((prior) => normalizeCanonical(prior) === normalized) ? 'prior' : 'differing';
96
+ };
97
+
98
+ export const withCurrentReadme = (config) => {
99
+ const next = { _README: CANON_README };
86
100
  for (const [key, value] of Object.entries(config)) if (key !== '_README') next[key] = value;
87
- return { config: next, changed: true };
101
+ return next;
88
102
  };