@sabaiway/agent-workflow-memory 1.11.1 → 2.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 CHANGED
@@ -2,7 +2,78 @@
2
2
 
3
3
  All notable changes to the memory substrate. Versions are this **package's** npm versions;
4
4
  they are distinct from the **deployment-lineage** stamp written into a project's
5
- `docs/ai/.memory-version` (which tracks the shared `agent-workflow` lineage, head `1.3.0`).
5
+ `docs/ai/.memory-version` (which tracks the shared `agent-workflow` lineage, head `2.0.0`).
6
+
7
+ ## 2.0.0 — One-file-per-ADR store: the 3-tier decisions cascade retired (AD-051)
8
+
9
+ A **MAJOR** release (BREAKING; co-released with the workflow kit 1.42.0). The deployment-lineage
10
+ head bumps `1.3.0` → `2.0.0` — the first structural `docs/ai` change (a new `docs/ai/adr/` tree;
11
+ the WARM/COLD decisions-archive monolith tiers retired). **Nothing auto-migrates:** an existing
12
+ deployment keeps working on its old layout, old rotator included, until it opts in (below).
13
+
14
+ **Breaking.**
15
+ - `references/scripts/archive-decisions.mjs` is REPURPOSED in place (same path, same pre-commit
16
+ hook slot, same `decisions-rotation` gate id): instead of rotating HOT `decisions.md` → WARM
17
+ `history/decisions-archive.md` → a single COLD monolith whose cap was raised release after
18
+ release, the rotator now EXPLODES the oldest ADRs beyond the HOT cap into one immutable MADR
19
+ record per ADR at `docs/ai/adr/AD-NNN-slug.md` (body verbatim; inline 6-field frontmatter +
20
+ `status`/`date`/`supersedes`/`supersededBy` lifecycle keys; slug frozen at creation). A record
21
+ is O(1) forever — no archive cap is ever raised again, and there is no COLD tier to exhaust.
22
+ - A default or `--check` run that finds a legacy `history/decisions-archive*.md` monolith fails
23
+ LOUD ("run `--migrate` first") — the new rotator never half-explodes an un-migrated tree and
24
+ never reports green over one.
25
+ - The ADR id grammar widens to `AD-\d{3,}` with NUMERIC ordering everywhere (AD-200 precedes
26
+ AD-1000 — never lexical).
27
+
28
+ **Migration (opt-in, never automatic).**
29
+ - The one-time `--migrate` (dry-run by default; `--migrate --apply` to write) explodes the
30
+ monolith tiers into `adr/` records under a fail-loud conservation check: the full ADR corpus —
31
+ the union HOT ∪ monolith tiers ∪ any already-written `adr/` records (the crash-resumable core;
32
+ a same-id BODY CONFLICT across sources is refused) — must repartition EXACTLY into retained-HOT
33
+ ∪ written records, nothing lost, added, double-counted, or edited. Before any destructive write
34
+ it stores a durable timestamped snapshot of `decisions.md` + both monoliths into the GIT DIR
35
+ (a stated out-of-tree fallback on a non-git deployment; fails loud if neither is writable).
36
+ `docs/ai` is commonly git-ignored, so git history alone can NOT recover a deleted monolith —
37
+ the snapshot is the recovery path. The apply is idempotent and crash-resumable; removal never
38
+ precedes conservation + the snapshot.
39
+ - On an upgrade crossing this major, `bin/install.mjs` prints a GENERIC one-time advisory: run
40
+ your workflow toolkit's ADR-store migration command in each already-deployed project (it
41
+ snapshots, refreshes the enforcement scripts, and migrates in one consent-gated step). This
42
+ installer targets the global skill dir and never touches a project itself.
43
+
44
+ **New.**
45
+ - `docs/ai/adr/log.md` — the ON-DEMAND active-set navigator: currently-governing heads
46
+ (supersession COMPUTED corpus-wide from the two-way `supersedes`/`supersededBy` chain — a new
47
+ superseding ADR needs no predecessor-file edit) + a recent window; a superseded record drops out
48
+ of the list but stays reachable by filename, grep, and the chain. `--write-navigator`
49
+ regenerates it AND re-triggers the docs-index regen. No committed full O(n) ledger.
50
+ - `references/scripts/check-docs-size.mjs` — `docs/ai/adr/` collapses to ONE aggregate `index.md`
51
+ row (`adr/ — N records (AD-001 … AD-NNN)`), while every record body stays individually
52
+ cap-checked; `docs/ai/index.md` stays bounded at O(1) as records accumulate.
53
+ - Seeded templates: the new-scheme `decisions.md` HOT-window seed, the `adr-record.md` MADR
54
+ authoring reference (a skill-side reference — never copied into a project's `docs/ai/`), and a
55
+ seed `adr/log.md` byte-equal to the generator over the seeded HOT — a fresh bootstrap is
56
+ `--check`-green on its first commit.
57
+
58
+ ## 1.12.0 — Verification-profile template + the docs-index-on-rotation regen (BUGFREE-3, AD-049)
59
+
60
+ A **minor** release (deployment-lineage head stays `1.3.0` — no migration; co-released with the
61
+ workflow kit 1.40.0). The memory substrate gains the optional verification-profile config and closes
62
+ the docs-index-goes-stale-on-rotation cost (economics item (h)).
63
+
64
+ - **Verification-profile template** — a new seeded `references/templates/verification-profile.json`
65
+ (`schema:1`; the kit reads it, kit 1.40.0) is created on bootstrap and ensured-if-missing on
66
+ upgrade (the `gates.json` / `orchestration.json` twin); `SKILL.md`'s bootstrap/ensure prose now
67
+ names it. An **absent profile reproduces today's V8 + node:test behaviour exactly** — it only ADDS
68
+ an opt-in default a consumer edits for its own language/runner.
69
+ - **(h) a rotation regenerates `docs/ai/index.md`** — `references/scripts/archive-decisions.mjs`
70
+ regenerates the docs index after a successful rotation write (moves OR a normalize-only rewrite) by
71
+ reusing the now **root-parameterized** `check-docs-size.mjs --write-index --report` (the `--report`
72
+ isolates the index-write outcome from the docs-cap-check, so a benign over-cap sibling never reads
73
+ as a regeneration failure), with a loud instruct on absence/failure. An ADR rotation no longer
74
+ leaves the index stale to trip the `--check-index` gate mid-release-matrix.
75
+ - **§2.2 minimal-comments** — the `agent_rules` template states comments as minimal / only-vital,
76
+ a BASELINE a consumer project may tighten (e.g. comments forbidden entirely).
6
77
 
7
78
  ## 1.11.1 — One batched setup prompt (the F11 ask reword; AD-042)
8
79
 
package/README.md CHANGED
@@ -7,7 +7,7 @@ future agent — including a fresh session of yourself — can reconstruct proje
7
7
  ~60 seconds, find the current task, and avoid repeating past mistakes.
8
8
 
9
9
  This is the **memory layer** of the `agent-workflow` family.
10
- It owns the substrate only — `docs/ai/`, the entry point, caps / 3-tier archive / index gate,
10
+ It owns the substrate only — `docs/ai/`, the entry point, caps / rolling changelog archive / the one-file-per-ADR store / index gate,
11
11
  the Node enforcement scripts, the pre-commit hook, the templates, and the three setup
12
12
  contracts (visibility / conversational language / agent attribution). It deliberately **knows
13
13
  nobody else** in the `agent-workflow` family: the **workflow methodology** (plan → execute →
@@ -44,7 +44,7 @@ Open your agent inside a project and run the skill:
44
44
 
45
45
  Two independent axes: this package's **npm version** vs the **deployment-lineage** stamp the
46
46
  substrate writes into a project. They are not the same number. `.memory-version` tracks the
47
- shared `agent-workflow` deployment lineage (head `1.3.0` today), **not** this package's
47
+ shared `agent-workflow` deployment lineage (head `2.0.0` today), **not** this package's
48
48
  version. A project bootstrapped by the kit's fallback carries a `.workflow-version`; when this
49
49
  substrate is later installed, `migrations/legacy-stamp-takeover.md` copies that value verbatim
50
50
  into `.memory-version` and never deletes the legacy stamp. See `migrations/README.md`.
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-memory
3
3
  description: Deploy or upgrade a portable AI-agent memory substrate in any project — an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) and a structured `docs/ai/` context store with cap/archive/index enforcement. Use when the user wants to bootstrap `docs/ai/`, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-memory` / `/agent-workflow-memory upgrade`. Triggers on "set up the memory system", "deploy the AI memory here", "bootstrap docs/ai", "upgrade the memory substrate". This is the substrate only — the workflow methodology (plan→execute→review, queue, Cleanup) is owned elsewhere and injected into AGENTS.md by the family composition root.
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '1.11.1'
6
+ version: '2.0.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-memory
@@ -14,7 +14,7 @@ reconstruct project context in ~60 seconds, find the current task, and avoid rep
14
14
  mistakes.
15
15
 
16
16
  The substrate is **stack-agnostic memory** — `docs/ai/` structure, entry-point doc, session
17
- protocols, frontmatter caps, 3-tier archive, index-freshness gate. Enforcement ships as **Node
17
+ protocols, frontmatter caps, one-file-per-ADR archive, index-freshness gate. Enforcement ships as **Node
18
18
  `.mjs` scripts** (the reference implementation; non-Node stacks follow the same policy
19
19
  manually).
20
20
 
@@ -42,13 +42,14 @@ What this substrate owns vs what it only points at. The methodology + orchestrat
42
42
  | Concern | Owner | In the deployed `AGENTS.md` |
43
43
  |---|---|---|
44
44
  | Entry point, Memory Map, session protocols (Start / During / Complete) | **memory** (this skill) | authored from templates |
45
- | `docs/ai/` files, frontmatter caps, 3-tier archive, index-freshness gate | **memory** | `docs/ai/*` + scripts + hook |
45
+ | `docs/ai/` files, frontmatter caps, one-file-per-ADR archive, index-freshness gate | **memory** | `docs/ai/*` + scripts + hook |
46
46
  | Visibility / conversational-language / agent-attribution contracts | **memory** | the three `AGENTS.md` blocks |
47
47
  | Deployment-lineage stamp | **memory** | `docs/ai/.memory-version` |
48
48
  | Plan→Phase→Step vocabulary, lifecycle, `queue.md`, mandatory Cleanup | **methodology** (not this skill) | the empty `workflow:methodology` slot — filled by the composition root |
49
49
  | Orchestration recipes (Solo / Reviewed / Council / Delegated) | **methodology engine** (not this skill) | the empty `workflow:orchestration` slot — filled by the composition root |
50
50
  | Per-project recipe **CONFIG** (which recipe each activity/slot uses) | **memory** seeds an *editable default* | `docs/ai/orchestration.json` (agent-writable via the composition root's `set-recipe` writer, or hand-edited; the recipe **canon** + the slot **vocabulary** live in the engine / composition root, never here) |
51
51
  | Per-project **gate declaration** (which verification commands must be green) | **memory** seeds an *editable default* | `docs/ai/gates.json` (hand-editable; an empty list as shipped — the project declares its own commands; the **runner** lives in the composition root, never here) |
52
+ | Per-project **verification profile** (optional; the fold-completeness language-independence contract) | **memory** seeds an *editable default* | `docs/ai/verification-profile.json` (hand-editable; the seeded default reproduces the composition root's default V8 + node:test behaviour — delete it for exactly that; declares coverage source / single-test format / optional SARIF path; the **runner** lives in the composition root, never here) |
52
53
 
53
54
  ---
54
55
 
@@ -98,12 +99,17 @@ bootstrapping over a live system, but the user makes the final call.
98
99
  from `${CLAUDE_SKILL_DIR}/references/templates/AGENTS.md` and symlink `CLAUDE.md -> AGENTS.md`
99
100
  (`ln -s AGENTS.md CLAUDE.md`). **Leave BOTH pointer slots (`workflow:methodology` +
100
101
  `workflow:orchestration`) exactly as shipped — empty.** Filling them is the composition root's job.
101
- 6. **Deploy `docs/ai/`.** Create the files + `pages/` from
102
- `${CLAUDE_SKILL_DIR}/references/templates/` (every non-`AGENTS.md` template, including the two
103
- seeded, **user-editable** strict-JSON configs: `docs/ai/orchestration.json` the per-project
104
- recipe defaults the composition root's `procedures` advisor reads and `docs/ai/gates.json`
105
- the project's gate declaration, an empty list to fill with its own verification commands,
106
- consumed by the composition root's gate runner). Keep each `.md` file's frontmatter.
102
+ 6. **Deploy `docs/ai/`.** Create the files + `pages/` + the seed `adr/` store from
103
+ `${CLAUDE_SKILL_DIR}/references/templates/` (every non-`AGENTS.md`, non-`adr-record.md` template
104
+ the latter is a skill-home authoring reference, never deployed). This deploys the HOT ADR window
105
+ `docs/ai/decisions.md` **and** the seed navigator `docs/ai/adr/log.md` (its `adr/` subdir copies
106
+ in wholesale), plus the three seeded, **user-editable** strict-JSON configs:
107
+ `docs/ai/orchestration.json` the per-project recipe defaults the composition root's `procedures`
108
+ advisor reads — `docs/ai/gates.json` — the project's gate declaration, an empty list to fill with
109
+ its own verification commands, consumed by the composition root's gate runner — and
110
+ `docs/ai/verification-profile.json` — the OPTIONAL fold-completeness verification profile (the
111
+ language-independence contract; the seeded default reproduces the composition root's default V8 +
112
+ node:test behaviour, delete it for exactly that). Keep each `.md` file's frontmatter.
107
113
  7. **Fill templates** per the table below.
108
114
  8. **Install enforcement (Node projects).** Copy `${CLAUDE_SKILL_DIR}/references/scripts/*.mjs`
109
115
  (+ `*.test.mjs`) into the project's `scripts/`. **No Node runtime** → skip this + the hook;
@@ -116,7 +122,7 @@ bootstrapping over a live system, but the user makes the final call.
116
122
  append-only (never duplicate an existing line), then **verify `git status` shows them ignored**.
117
123
  Never the machine-global excludes; never edit `package.json`.
118
124
  10. **Stamp the deployment lineage.** Write the **deployment-lineage head** into
119
- `docs/ai/.memory-version` (one semver line). The lineage head is **`1.3.0`** (the
125
+ `docs/ai/.memory-version` (one semver line). The lineage head is **`2.0.0`** (the
120
126
  `LINEAGE_HEAD` constant in `scripts/stamp-takeover.mjs`) — the shared `agent-workflow`
121
127
  lineage, a **separate axis** from this package's npm version (the two may even coincide by
122
128
  accident; see *Stamp = lineage head, not package version*). Use the atomic writer in
@@ -142,7 +148,8 @@ Fill strategy:
142
148
  | `current_state.md`, `architecture.md`, `env_commands.md`, `technical_specification.md`, `pages/index.md` | Fill with **real** recon data. |
143
149
  | `tech_reference.md` | Carry over real configs/patterns found in deps. |
144
150
  | `active_plan.md`, `handover.md` | TODO seed. |
145
- | `decisions.md` | Seed `AD-001` (adopting this memory system). |
151
+ | `decisions.md` | The HOT ADR window — seed `AD-001` (adopting this memory system), newest at the bottom. |
152
+ | `adr/log.md` | The seed navigator — deployed as-is (the generator over the seeded HOT); regenerated by `archive-decisions.mjs`, never hand-edited. |
146
153
  | `known_issues.md`, `changelog.md`, `pages/shared-patterns.md` | Empty template / first bootstrap entry. |
147
154
 
148
155
  ### Mode: upgrade
@@ -154,7 +161,7 @@ Fill strategy:
154
161
  `scripts/stamp-takeover.mjs` decides the action per state; the Markdown migration is the
155
162
  no-Node manual fallback. If **no** stamp exists at all, offer a conservative re-bootstrap.
156
163
  2. **Never-downgrade gate FIRST, then the stamp-independent hidden-mode reconcile (D14).** Compare the
157
- stamp to the **deployment-lineage head** (`LINEAGE_HEAD`, `1.3.0`). **Greater than the head, or
164
+ stamp to the **deployment-lineage head** (`LINEAGE_HEAD`, `2.0.0`). **Greater than the head, or
158
165
  unparseable → STOP and report immediately, before ANY write** (never downgrade or guess, and never
159
166
  touch `.git/info/exclude`). This STOP is one of the only two places the number is shown (see
160
167
  *Version disclosure* below): tell the user **the `docs/ai` structure version** their deployment
@@ -171,23 +178,36 @@ Fill strategy:
171
178
  **untracked AND not ignored** → **AMBIGUOUS** → **ASK** the user before writing. This visibility check
172
179
  runs on **every** in-range upgrade, even at head — it is not gated by the stamp delta, but it is gated
173
180
  **behind** the never-downgrade STOP above. **Also stamp-independent (same gate, before the equal-head
174
- short-circuit): ensure BOTH seeded `.json` configs** — for `docs/ai/orchestration.json` AND
175
- `docs/ai/gates.json`, **create the file from its
181
+ short-circuit): ensure the THREE seeded `.json` configs** — for `docs/ai/orchestration.json`,
182
+ `docs/ai/gates.json`, AND `docs/ai/verification-profile.json`, **create the file from its
176
183
  `${CLAUDE_SKILL_DIR}/references/templates/` template if missing**, **preserve it byte-for-byte
177
184
  if it already exists** (a user may have edited it; never clobber it). The shipped
178
185
  `orchestration.json` template's `_README` already frames that config as agent-writable (set it
179
186
  with the `set-recipe` writer) and still hand-editable; `gates.json` is the project's own gate
180
- declaration (what to verify — consumed by the composition root's gate runner). (Refreshing the
187
+ declaration (what to verify — consumed by the composition root's gate runner);
188
+ `verification-profile.json` is the OPTIONAL fold-completeness verification profile — the seeded
189
+ default reproduces the composition root's default V8 + node:test behaviour, so a project deletes
190
+ it to fall back to exactly that, or edits it for another language/runner. (Refreshing the
181
191
  orchestration `_README` note in place on an existing file is the **composition root's** job on
182
192
  its own reconcile — this substrate is standalone and only seeds-or-preserves; it owns no
183
193
  cross-package refresh helper. The gates declaration gets no note-refresh at all — authored
184
- content, seed-or-preserve only.) This is why an equal-head (`1.3.0`) deployment still gains the
194
+ content, seed-or-preserve only.) This is why an equal-head (`2.0.0`) deployment still gains the
185
195
  config seeds **without a lineage-head bump or a migration file** (the
186
196
  stamp-independent-reconcile precedent — like the pointer slots + the hidden-mode footprint).
187
- **Same gate, also stamp-independent: ensure the ADR-cascade enforcement pair** — copy
197
+ **Same gate, also stamp-independent: ensure the ADR-store enforcement pair** — copy
188
198
  `archive-decisions.mjs` + `archive-decisions.test.mjs` from
189
199
  `${CLAUDE_SKILL_DIR}/references/scripts/` into the project's `scripts/` **if missing**
190
- (preserve an existing file byte-for-byte; skip on a No-Node project). The deployed pre-commit
200
+ (preserve an existing file byte-for-byte; skip on a No-Node project). **Legacy-monolith
201
+ gate:** if a retired `docs/ai/history/decisions-archive*.md` monolith is still on disk, do
202
+ **NOT** copy the pair as a silent ensure — the new-scheme rotator must **never sit beside
203
+ un-migrated monoliths** (its default/`--check` runs refuse such a tree). Instead ASK the
204
+ user; with their explicit consent copy the pair AND run the one-time conservation-checked
205
+ migration in the same step (`node scripts/archive-decisions.mjs --migrate` preview, then
206
+ `--migrate --apply` — it writes a durable pre-delete snapshot first); if the preview or the
207
+ apply FAILS, remove the just-copied pair (the pair was copied only because it was missing, so
208
+ removal restores the exact pre-ensure state) and report — the forbidden state (the new-scheme
209
+ rotator beside un-migrated monoliths) must never persist; without consent leave
210
+ the tree untouched and report the pending migration. The deployed pre-commit
191
211
  hook gains its `archive-decisions.mjs --check` line only when the hook is next refreshed via
192
212
  `node scripts/install-git-hooks.mjs`; an old hook without the line stays consistent-safe (the
193
213
  decisions gate is simply not enforced yet — never a broken hook). **Then**, if the stamp **equals** the head → the substrate is
@@ -257,7 +277,7 @@ memory substrate has none, so it relies on the STOP + the explicit ask — never
257
277
  - **Source vs target directory.** Templates/scripts are read from the skill's own dir; the
258
278
  **working directory is the target project** — never write substrate files back into the skill.
259
279
  - **Stamp = lineage head, not package version.** `.memory-version` carries the **deployment-lineage
260
- head** (`1.3.0`, the shared `agent-workflow` lineage) — a **separate axis** from this package's npm
280
+ head** (`2.0.0`, the shared `agent-workflow` lineage) — a **separate axis** from this package's npm
261
281
  version (the two may even coincide by accident). They move independently.
262
282
  - **Both pointer slots ship empty and stay the user's.** Never author methodology or orchestration
263
283
  text into them; on upgrade, preserve their content byte-for-byte. The composition root is their only
@@ -289,9 +309,10 @@ The three setup choices each have a full contract in
289
309
  - [`references/contracts.md`](references/contracts.md) — the three setup contracts in full.
290
310
  - [`references/templates/`](references/templates/) — stack-agnostic `AGENTS.md` (with the two empty
291
311
  pointer slots — methodology + orchestration), `agent_rules.md`, the seeded user-editable
292
- `orchestration.json` config, and all `docs/ai/` files to deploy.
312
+ `orchestration.json` config, the `adr-record.md` ADR authoring reference + the seed `adr/log.md`
313
+ navigator, and all `docs/ai/` files to deploy.
293
314
  - [`references/scripts/`](references/scripts/) — the Node enforcement scripts (caps + staleness +
294
- index-freshness gate, 3-tier archive, hook installer) and their unit tests.
315
+ index-freshness gate, one-file-per-ADR archive, hook installer) and their unit tests.
295
316
  - [`scripts/stamp-takeover.mjs`](scripts/stamp-takeover.mjs) — the upgrade-time lineage state
296
317
  machine (`LINEAGE_HEAD`, atomic stamp writes) + tests.
297
318
  - [`migrations/`](migrations/) — per-version upgrade steps, incl. `legacy-stamp-takeover.md`;
package/bin/install.mjs CHANGED
@@ -71,6 +71,36 @@ const compareSemver = (a, b) => {
71
71
  return firstDiff ?? 0;
72
72
  };
73
73
 
74
+ // The memory major that retired the 3-tier ADR cascade for the one-file-per-ADR store (AD-051).
75
+ const ADR_STORE_MAJOR = 2;
76
+
77
+ // A GENERIC, project-agnostic advisory is printed exactly once — when this runner crosses UP through
78
+ // the ADR-store major (installed below it → runner at or above it). The memory installer targets the
79
+ // GLOBAL skill dir and knows nothing about any project (the knows-nobody DAG), so it can never DETECT
80
+ // an old-layout deployment and must NEVER name a sibling package or a kit command — the kit's
81
+ // project-dir-aware surfaces (status / upgrade / the migration mode) own detection + the concrete
82
+ // command. A fresh install (installed === null) advises nothing (no prior deployment to migrate).
83
+ export const shouldAdviseAdrMigration = (installedVersion, runnerVersion) => {
84
+ const from = parseSemver(installedVersion);
85
+ const to = parseSemver(runnerVersion);
86
+ if (!from || !to) return false;
87
+ return from[0] < ADR_STORE_MAJOR && to[0] >= ADR_STORE_MAJOR;
88
+ };
89
+
90
+ // The advisory text is GENERIC and names NO sibling package or kit command (the knows-nobody DAG);
91
+ // the kit's project-aware surfaces own old-layout detection + the concrete migration command.
92
+ const ADR_MIGRATION_ADVISORY =
93
+ `[agent-workflow-memory] note: this major retired the 3-tier ADR archive for a one-file-per-ADR store.\n` +
94
+ ` A project you already deployed on the OLDER decisions-archive layout must be migrated before its\n` +
95
+ ` ADR rotation works again — run your workflow toolkit's ADR-store migration command in that project\n` +
96
+ ` (its status/upgrade points you at it). New deployments already seed the new store.`;
97
+
98
+ // Print the advisory exactly on a major-crossing update (AD-051). Pure over an injectable log so the
99
+ // crossing path is unit-testable in-process (main runs only as a subprocess).
100
+ export const maybeAdviseAdrMigration = (installedVersion, runnerVersion, log = console.log) => {
101
+ if (shouldAdviseAdrMigration(installedVersion, runnerVersion)) log(ADR_MIGRATION_ADVISORY);
102
+ };
103
+
74
104
  // Extract the version that is a DIRECT child of the top-level `metadata:` key — never a top-level or
75
105
  // deeper-nested decoy `version:` (mirrors the manifest validator + the kit installer). Pure walk.
76
106
  const metadataVersion = (frontmatter) => {
@@ -256,6 +286,8 @@ const main = async () => {
256
286
  : 'installed';
257
287
  console.log(`[agent-workflow-memory] ${verb} v${version} -> ${tildify(target)}`);
258
288
 
289
+ maybeAdviseAdrMigration(installedVersion, version); // generic major-crossing ADR-store advisory (AD-051)
290
+
259
291
  // Same-version re-run: state observable facts only. The copy DID run (repair-on-rerun is a feature —
260
292
  // it restores locally modified/deleted files), and whether npx served a cached build is NOT
261
293
  // observable here (no network), so the note never claims it; the @latest hint is conditional.
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-memory",
5
5
  "kind": "memory-substrate",
6
- "version": "1.11.1",
6
+ "version": "2.0.0",
7
7
  "provides": ["context"],
8
8
  "roles": {},
9
9
  "detect": {
@@ -13,7 +13,7 @@ releases add files/templates, which `upgrade` reconciles without a migration.
13
13
  `.memory-version` verbatim — see that migration.
14
14
  2. Select every migration whose `<version>` is **strictly newer** than the stamp.
15
15
  3. Apply them in **ascending semver order**.
16
- 4. Re-stamp `docs/ai/.memory-version` to the deployment-lineage head (`1.3.0` today — the shared
16
+ 4. Re-stamp `docs/ai/.memory-version` to the deployment-lineage head (`2.0.0` today — the shared
17
17
  lineage sequence, **not** this package's npm version). The legacy `.workflow-version`, if present,
18
18
  is never deleted.
19
19
 
@@ -13,13 +13,13 @@ any other migration.
13
13
 
14
14
  The deployment stamp moved from `.workflow-version` (owned by the kit) to `.memory-version`
15
15
  (owned by this substrate). They track the **same** shared deployment-lineage sequence — never
16
- their package versions. The current lineage head is **`1.3.0`** (`LINEAGE_HEAD`). This migration
16
+ their package versions. The current lineage head is **`2.0.0`** (`LINEAGE_HEAD`). This migration
17
17
  adopts an existing legacy stamp into the new file **without** changing the lineage value and
18
18
  **without** deleting the legacy stamp (both may coexist; each tool migrates from its own stamp).
19
19
 
20
20
  ## State table (idempotent)
21
21
 
22
- Look at `docs/ai/` and act by row. `V` is the legacy stamp's value; `head` = `1.3.0`.
22
+ Look at `docs/ai/` and act by row. `V` is the legacy stamp's value; `head` = `2.0.0`.
23
23
 
24
24
  | `docs/ai/` state | Action |
25
25
  |---|---|
@@ -42,7 +42,7 @@ Look at `docs/ai/` and act by row. `V` is the legacy stamp's value; `head` = `1.
42
42
  done
43
43
  ```
44
44
  2. **Validate** each value that exists: it must be `MAJOR.MINOR.PATCH`, non-empty, and **not** greater
45
- than `1.3.0`. If any present stamp is empty, unparseable, or in the future → **STOP and report**;
45
+ than `2.0.0`. If any present stamp is empty, unparseable, or in the future → **STOP and report**;
46
46
  do nothing else.
47
47
  3. **Apply** the matching row above. For the "only `.workflow-version=V`" row, copy verbatim and
48
48
  write **atomically** — create an exclusive randomized temp in `docs/ai/` (so a planted temp-name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-memory",
3
- "version": "1.11.1",
3
+ "version": "2.0.0",
4
4
  "description": "Portable, cross-agent memory substrate for AI coding agents — an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement, deployable standalone or as part of the agent-workflow family. The memory layer of the agent-workflow family.",
5
5
  "keywords": [
6
6
  "ai-agents",