@milehimikey/em 1.11.0 → 1.13.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.
Files changed (154) hide show
  1. package/.claude/skills/event-modeling/SKILL.md +4 -2
  2. package/.claude/skills/event-modeling-conform/SKILL.md +20 -9
  3. package/.claude/skills/event-modeling-conform/reference/conform.md +107 -10
  4. package/.claude/skills/event-modeling-design/SKILL.md +22 -6
  5. package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
  6. package/.claude/skills/event-modeling-implement/SKILL.md +12 -6
  7. package/.claude/skills/event-modeling-implement/reference/implement.md +165 -18
  8. package/.claude/skills/event-modeling-review/SKILL.md +5 -1
  9. package/.claude/skills/event-modeling-shared/reference/em-dsl.md +57 -8
  10. package/.claude/skills/event-modeling-shared/reference/operating-principles.md +13 -3
  11. package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +69 -0
  12. package/.claude/skills/event-modeling-shared/templates/conformance-report.md +8 -1
  13. package/.claude/skills/event-modeling-shared/templates/constitution.md +8 -1
  14. package/.claude/skills/event-modeling-shared/templates/state.md +3 -0
  15. package/README.md +1 -0
  16. package/dist/catalog/build.js +42 -1
  17. package/dist/catalog/build.js.map +1 -1
  18. package/dist/catalog/coverage.d.ts +15 -0
  19. package/dist/catalog/coverage.js +34 -0
  20. package/dist/catalog/coverage.js.map +1 -0
  21. package/dist/catalog/docJoin.d.ts +20 -2
  22. package/dist/catalog/docJoin.js +32 -4
  23. package/dist/catalog/docJoin.js.map +1 -1
  24. package/dist/catalog/docModelConsistencyValidate.js +1 -1
  25. package/dist/catalog/docModelConsistencyValidate.js.map +1 -1
  26. package/dist/catalog/driftSignal.d.ts +11 -5
  27. package/dist/catalog/driftSignal.js +18 -4
  28. package/dist/catalog/driftSignal.js.map +1 -1
  29. package/dist/catalog/modelVersionValidate.d.ts +9 -0
  30. package/dist/catalog/modelVersionValidate.js +38 -0
  31. package/dist/catalog/modelVersionValidate.js.map +1 -0
  32. package/dist/catalog/noteBindingValidate.js +18 -0
  33. package/dist/catalog/noteBindingValidate.js.map +1 -1
  34. package/dist/catalog/orphanedSliceDocValidate.d.ts +8 -1
  35. package/dist/catalog/orphanedSliceDocValidate.js +33 -6
  36. package/dist/catalog/orphanedSliceDocValidate.js.map +1 -1
  37. package/dist/catalog/pages.d.ts +16 -1
  38. package/dist/catalog/pages.js +16 -4
  39. package/dist/catalog/pages.js.map +1 -1
  40. package/dist/catalog/sliceDoc.d.ts +12 -0
  41. package/dist/catalog/sliceDoc.js +15 -0
  42. package/dist/catalog/sliceDoc.js.map +1 -1
  43. package/dist/catalog/sliceReadyValidate.d.ts +12 -1
  44. package/dist/catalog/sliceReadyValidate.js +4 -4
  45. package/dist/catalog/sliceReadyValidate.js.map +1 -1
  46. package/dist/cli/agentsMd.js +9 -3
  47. package/dist/cli/agentsMd.js.map +1 -1
  48. package/dist/cli/ciInit.js +20 -0
  49. package/dist/cli/ciInit.js.map +1 -1
  50. package/dist/cli/conformScope.d.ts +1 -0
  51. package/dist/cli/conformScope.js +13 -4
  52. package/dist/cli/conformScope.js.map +1 -1
  53. package/dist/cli/conformSupersede.d.ts +24 -2
  54. package/dist/cli/conformSupersede.js +44 -3
  55. package/dist/cli/conformSupersede.js.map +1 -1
  56. package/dist/cli/coverage.d.ts +34 -9
  57. package/dist/cli/coverage.js +61 -24
  58. package/dist/cli/coverage.js.map +1 -1
  59. package/dist/cli/findings.d.ts +134 -0
  60. package/dist/cli/findings.js +355 -0
  61. package/dist/cli/findings.js.map +1 -0
  62. package/dist/cli/markImplemented.js +12 -1
  63. package/dist/cli/markImplemented.js.map +1 -1
  64. package/dist/cli/metrics.d.ts +93 -0
  65. package/dist/cli/metrics.js +331 -0
  66. package/dist/cli/metrics.js.map +1 -0
  67. package/dist/cli/modelVersion.d.ts +139 -0
  68. package/dist/cli/modelVersion.js +256 -0
  69. package/dist/cli/modelVersion.js.map +1 -0
  70. package/dist/cli/ratify.js +17 -1
  71. package/dist/cli/ratify.js.map +1 -1
  72. package/dist/cli/reratify.d.ts +17 -0
  73. package/dist/cli/reratify.js +37 -2
  74. package/dist/cli/reratify.js.map +1 -1
  75. package/dist/cli/review.js +12 -1
  76. package/dist/cli/review.js.map +1 -1
  77. package/dist/cli/skillCheck.js +2 -2
  78. package/dist/cli/skillCheck.js.map +1 -1
  79. package/dist/cli/sliceConform.d.ts +50 -0
  80. package/dist/cli/sliceConform.js +206 -0
  81. package/dist/cli/sliceConform.js.map +1 -0
  82. package/dist/cli/sliceIndex.d.ts +2 -0
  83. package/dist/cli/sliceIndex.js +24 -7
  84. package/dist/cli/sliceIndex.js.map +1 -1
  85. package/dist/cli/sliceLink.js +16 -0
  86. package/dist/cli/sliceLink.js.map +1 -1
  87. package/dist/cli/sliceNew.d.ts +12 -0
  88. package/dist/cli/sliceNew.js +23 -0
  89. package/dist/cli/sliceNew.js.map +1 -1
  90. package/dist/cli/sliceStubAll.d.ts +76 -0
  91. package/dist/cli/sliceStubAll.js +189 -0
  92. package/dist/cli/sliceStubAll.js.map +1 -0
  93. package/dist/cli/stateFile.d.ts +63 -7
  94. package/dist/cli/stateFile.js +179 -18
  95. package/dist/cli/stateFile.js.map +1 -1
  96. package/dist/cli/status.d.ts +90 -1
  97. package/dist/cli/status.js +151 -16
  98. package/dist/cli/status.js.map +1 -1
  99. package/dist/cli/upgrade.d.ts +122 -0
  100. package/dist/cli/upgrade.js +476 -0
  101. package/dist/cli/upgrade.js.map +1 -0
  102. package/dist/cli.js +586 -66
  103. package/dist/cli.js.map +1 -1
  104. package/dist/emit/coverageJson.d.ts +2 -2
  105. package/dist/emit/coverageJson.js +6 -2
  106. package/dist/emit/coverageJson.js.map +1 -1
  107. package/dist/emit/freshnessJson.d.ts +1 -1
  108. package/dist/emit/freshnessJson.js +3 -1
  109. package/dist/emit/freshnessJson.js.map +1 -1
  110. package/dist/emit/json.d.ts +34 -1
  111. package/dist/emit/json.js +84 -2
  112. package/dist/emit/json.js.map +1 -1
  113. package/dist/emit/metricsJson.d.ts +7 -0
  114. package/dist/emit/metricsJson.js +27 -0
  115. package/dist/emit/metricsJson.js.map +1 -0
  116. package/dist/emit/statusJson.d.ts +1 -1
  117. package/dist/emit/statusJson.js +22 -1
  118. package/dist/emit/statusJson.js.map +1 -1
  119. package/dist/emit/upgradeJson.d.ts +5 -0
  120. package/dist/emit/upgradeJson.js +26 -0
  121. package/dist/emit/upgradeJson.js.map +1 -0
  122. package/dist/emit/validateJson.d.ts +10 -5
  123. package/dist/emit/validateJson.js +22 -8
  124. package/dist/emit/validateJson.js.map +1 -1
  125. package/dist/mcp/server.d.ts +1 -1
  126. package/dist/mcp/server.js +151 -22
  127. package/dist/mcp/server.js.map +1 -1
  128. package/dist/model/continuation.d.ts +23 -0
  129. package/dist/model/continuation.js +49 -0
  130. package/dist/model/continuation.js.map +1 -0
  131. package/dist/model/queryIndex.js +1 -1
  132. package/dist/model/queryIndex.js.map +1 -1
  133. package/dist/model/rules.d.ts +13 -0
  134. package/dist/model/rules.js +18 -0
  135. package/dist/model/rules.js.map +1 -1
  136. package/dist/model/sliceDocIndex.d.ts +12 -5
  137. package/dist/model/sliceDocIndex.js +18 -7
  138. package/dist/model/sliceDocIndex.js.map +1 -1
  139. package/dist/model/validate.d.ts +20 -0
  140. package/dist/model/validate.js +94 -45
  141. package/dist/model/validate.js.map +1 -1
  142. package/dist/render/sliceStatus.d.ts +3 -3
  143. package/dist/render/sliceStatus.js +27 -29
  144. package/dist/render/sliceStatus.js.map +1 -1
  145. package/dist/templates.d.ts +3 -3
  146. package/dist/templates.js +15 -2
  147. package/dist/templates.js.map +1 -1
  148. package/dist/util/localDate.d.ts +2 -0
  149. package/dist/util/localDate.js +17 -0
  150. package/dist/util/localDate.js.map +1 -0
  151. package/dist/util/semver.d.ts +19 -0
  152. package/dist/util/semver.js +54 -0
  153. package/dist/util/semver.js.map +1 -0
  154. package/package.json +1 -1
@@ -0,0 +1,189 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // `em slice stub-all` (MIL-184): one stub doc per undocumented slice, in one command — the
3
+ // batch counterpart to `em slice new --stub`, for an exploratory/backbone model that wants
4
+ // status coloring without hand-running `slice new` once per slice. Ruled 2026-09-08 (owner,
5
+ // MIL-184, option (b) on GH #128): no DSL `status` clause — the doc stays the single source of
6
+ // truth for `status`; this command just makes writing that doc near-free. A "backbone" slice
7
+ // (established, already shipped) is `--status implemented --implemented-in <url>`, not a made-up
8
+ // fifth status value — the reporter's exploratory-model use case maps onto the same four
9
+ // lifecycle values every other `em` command already understands.
10
+ //
11
+ // For each slice, in model declaration order (deterministic, matching every other batch command
12
+ // in this codebase):
13
+ // - a continuation slice (MIL-208, an again-view-only instance) is skipped — it has no doc of
14
+ // its own to scaffold (see model/continuation.ts).
15
+ // - a slice whose doc join already resolves cleanly (`resolveSliceDocJoin`'s `reason === null`)
16
+ // is skipped — already documented, nothing to stub.
17
+ // - a slice `classifySlicePattern` can't assign one of the 4 doc `pattern` values to
18
+ // (`"unclassified"` — an empty or malformed slice `em validate` already flags elsewhere) is
19
+ // skipped — there's no frontmatter `pattern` value to write.
20
+ // - a `no-doc-bound` slice whose canonical `slices/<key>.md` path already holds a file on disk
21
+ // (an orphaned doc nothing notes) is skipped rather than silently overwritten — this command
22
+ // offers no `--force`, matching the "never clobber without an explicit, visible opt-in"
23
+ // discipline every frontmatter-surgery command here holds.
24
+ // - a `frontmatter-invalid` doc (the file exists, is noted, but its frontmatter doesn't parse)
25
+ // is skipped for the same reason — fix it by hand (`em validate` explains what's wrong).
26
+ // Everything else gets a stub: pattern from `classifySlicePattern`, swimlane derived from the
27
+ // slice's own shape (`deriveStubSwimlane` below), wired via the exact `wireSliceNote` `em slice
28
+ // new --wire` uses. A `binding-missing-file` doc (a note already points at the canonical path;
29
+ // just the file itself is missing) is stubbed WITHOUT re-wiring — the note is already there, and
30
+ // re-wiring would refuse ("already has a note clause").
31
+ //
32
+ // `--status` escalates a freshly-built `status: draft` stub past draft using the EXACT
33
+ // frontmatter writers `em slice review`/`em slice ratify`/`em slice mark-implemented` already
34
+ // own (`applyReviewFrontmatter`/`applyRatifyFrontmatter`/`applyImplementedFrontmatter`) — never a
35
+ // reimplementation of what "reviewed"/"ready-to-implement"/"implemented" write. Escalating to
36
+ // `reviewed` applies the review writer once; to `ready-to-implement` applies review then ratify
37
+ // (the freshly-reviewed doc always satisfies ratify's own review-gate check, so `--skip-review`
38
+ // is never needed here, unlike the standalone `em slice ratify`); to `implemented` applies
39
+ // review, then ratify, then mark-implemented. One `--by`/`on` pair stamps every escalated field
40
+ // this run touches — a batch scaffold, not a record of N separate human sessions.
41
+ import { existsSync, writeFileSync } from "node:fs";
42
+ import { join } from "node:path";
43
+ import { continuationOf } from "../model/continuation.js";
44
+ import { classifySlicePattern } from "../catalog/classify.js";
45
+ import { resolveSliceDocJoin } from "../catalog/docJoin.js";
46
+ import { wireSliceNote } from "./sliceLink.js";
47
+ import { buildStubDocContent } from "./sliceNew.js";
48
+ import { applyReviewFrontmatter } from "./review.js";
49
+ import { applyRatifyFrontmatter } from "./ratify.js";
50
+ import { applyImplementedFrontmatter } from "./markImplemented.js";
51
+ /** `--status`'s exact 4-value enum — the same lifecycle values every slice doc already uses
52
+ * (docs/slice-doc-schema.md); `stub-all` never invents a 5th "backbone"/"existing" value. */
53
+ export const STUB_STATUSES = ["draft", "reviewed", "ready-to-implement", "implemented"];
54
+ export function isStubStatus(value) {
55
+ return STUB_STATUSES.includes(value);
56
+ }
57
+ /**
58
+ * MIL-184: derive a stub's `swimlane` from the slice's own shape rather than asking for one per
59
+ * slice — the slice's first `ui` element's resolved `persona`, arrow-joined to its first `event`
60
+ * element's resolved `context`, both in declaration order (matching `wireSliceNote`'s own
61
+ * "first candidate wins" convention). Falls back to the literal placeholder `"— → —"` when either
62
+ * side is missing (a slice with no `ui` at all — a pure Automation/Translation reaction never
63
+ * has a screen of its own — or, vanishingly rare, no `event` either): a placeholder is honest
64
+ * about "nobody's filled this in yet," which is exactly a stub's whole premise, rather than
65
+ * guessing a lane from unrelated context.
66
+ */
67
+ export function deriveStubSwimlane(slice) {
68
+ const persona = slice.elements.find((el) => el.kind === "ui")?.persona;
69
+ const context = slice.elements.find((el) => el.kind === "event")?.context;
70
+ if (!persona || !context)
71
+ return "— → —";
72
+ return `${persona} → ${context}`;
73
+ }
74
+ /**
75
+ * Escalates a freshly-built `status: draft` stub's content to `status`, reusing review/ratify/
76
+ * mark-implemented's own pure frontmatter writers (see module header) — never a second
77
+ * implementation of what those statuses write. `by`/`on` are required by the CALLER (the CLI
78
+ * action, which enforces `--by` before compiling anything) whenever `status !== "draft"`; this
79
+ * function has no opinion about CLI flag requiredness, only about what each writer itself
80
+ * validates (a blank `by`, a malformed `on`). `implementedInUrl` only matters for `status ===
81
+ * "implemented"` — required there, ignored otherwise.
82
+ */
83
+ export function applyStubStatus(content, sliceKey, status, by, on, implementedInUrl) {
84
+ if (status === "draft")
85
+ return { ok: true, content };
86
+ const reviewed = applyReviewFrontmatter(content, by, on);
87
+ if (!reviewed.ok)
88
+ return reviewed;
89
+ if (status === "reviewed")
90
+ return { ok: true, content: reviewed.content };
91
+ const ratified = applyRatifyFrontmatter(reviewed.content, sliceKey, by, on);
92
+ if (!ratified.ok)
93
+ return ratified;
94
+ if (status === "ready-to-implement")
95
+ return { ok: true, content: ratified.content };
96
+ // status === "implemented"
97
+ if (!implementedInUrl) {
98
+ return { ok: false, message: "--implemented-in <url> is required for --status implemented" };
99
+ }
100
+ return applyImplementedFrontmatter(ratified.content, implementedInUrl);
101
+ }
102
+ /**
103
+ * Walks `model.slices` in declaration order and, for every slice with no resolvable doc, writes
104
+ * a stub `slices/<key>.md` (skipped entirely when `opts.dryRun`) and wires it into `source` —
105
+ * see the module header for the full per-slice decision tree. `baseDir` is the `.em` file's
106
+ * directory, same convention every doc/note path in `em` uses. Never throws on a per-slice
107
+ * problem — every failure becomes a `"skip"` outcome so one bad slice doesn't abort the batch.
108
+ */
109
+ export function runStubAll(model, refs, baseDir, source, opts) {
110
+ const outcomes = [];
111
+ let workingSource = source;
112
+ for (let i = 0; i < model.slices.length; i++) {
113
+ const slice = model.slices[i];
114
+ const sliceKey = refs.sliceKeys[i];
115
+ const continuation = continuationOf(model, refs, i);
116
+ if (continuation) {
117
+ outcomes.push({
118
+ kind: "skip",
119
+ sliceKey,
120
+ reason: `continuation of "${continuation.sliceKey}" (view again, MIL-208) — no doc of its own`,
121
+ });
122
+ continue;
123
+ }
124
+ const { doc } = resolveSliceDocJoin(model, refs, slice, sliceKey, baseDir, (id) => refs.refById.get(id));
125
+ if (doc.reason === null) {
126
+ outcomes.push({ kind: "skip", sliceKey, reason: `already documented (${doc.path})` });
127
+ continue;
128
+ }
129
+ const classified = classifySlicePattern(slice);
130
+ if (classified === "unclassified") {
131
+ outcomes.push({ kind: "skip", sliceKey, reason: "pattern is unclassified — nothing to stub" });
132
+ continue;
133
+ }
134
+ // Safe: every classifySlicePattern() value other than "unclassified" is one of the exact 4
135
+ // string literals sliceNew.ts's SlicePattern enumerates too.
136
+ const pattern = classified;
137
+ const absPath = join(baseDir, doc.path);
138
+ if (doc.reason === "no-doc-bound" && existsSync(absPath)) {
139
+ outcomes.push({
140
+ kind: "skip",
141
+ sliceKey,
142
+ reason: `${doc.path} already exists but isn't wired — bind or remove it by hand`,
143
+ });
144
+ continue;
145
+ }
146
+ if (doc.reason === "frontmatter-invalid") {
147
+ outcomes.push({
148
+ kind: "skip",
149
+ sliceKey,
150
+ reason: `${doc.path} exists but its frontmatter is invalid — fix it by hand (see em validate)`,
151
+ });
152
+ continue;
153
+ }
154
+ const swimlane = deriveStubSwimlane(slice);
155
+ const draftContent = buildStubDocContent(slice.name, pattern, swimlane);
156
+ const statusResult = applyStubStatus(draftContent, sliceKey, opts.status, opts.by ?? "", opts.on, opts.implementedInUrl);
157
+ if (!statusResult.ok) {
158
+ outcomes.push({ kind: "skip", sliceKey, reason: statusResult.message });
159
+ continue;
160
+ }
161
+ // `binding-missing-file`: a note already points at this exact path — re-wiring would refuse
162
+ // ("already has a note clause"), and there's nothing to wire anyway.
163
+ const needsWire = doc.reason !== "binding-missing-file";
164
+ let elementName = null;
165
+ if (needsWire) {
166
+ const wired = wireSliceNote(workingSource, model, refs, sliceKey, pattern, doc.path);
167
+ if (!wired.ok) {
168
+ outcomes.push({ kind: "skip", sliceKey, reason: `--wire failed: ${wired.message}` });
169
+ continue;
170
+ }
171
+ workingSource = wired.content;
172
+ elementName = wired.elementName;
173
+ }
174
+ if (!opts.dryRun)
175
+ writeFileSync(absPath, statusResult.content, "utf8");
176
+ outcomes.push({
177
+ kind: "stubbed",
178
+ sliceKey,
179
+ path: doc.path,
180
+ pattern,
181
+ swimlane,
182
+ status: opts.status,
183
+ wired: needsWire,
184
+ elementName,
185
+ });
186
+ }
187
+ return { outcomes, source: opts.dryRun ? source : workingSource };
188
+ }
189
+ //# sourceMappingURL=sliceStubAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sliceStubAll.js","sourceRoot":"","sources":["../../src/cli/sliceStubAll.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,2FAA2F;AAC3F,2FAA2F;AAC3F,4FAA4F;AAC5F,+FAA+F;AAC/F,6FAA6F;AAC7F,iGAAiG;AACjG,yFAAyF;AACzF,iEAAiE;AACjE,EAAE;AACF,gGAAgG;AAChG,qBAAqB;AACrB,gGAAgG;AAChG,uDAAuD;AACvD,kGAAkG;AAClG,wDAAwD;AACxD,uFAAuF;AACvF,gGAAgG;AAChG,iEAAiE;AACjE,iGAAiG;AACjG,iGAAiG;AACjG,4FAA4F;AAC5F,+DAA+D;AAC/D,iGAAiG;AACjG,6FAA6F;AAC7F,8FAA8F;AAC9F,gGAAgG;AAChG,+FAA+F;AAC/F,iGAAiG;AACjG,wDAAwD;AACxD,EAAE;AACF,uFAAuF;AACvF,8FAA8F;AAC9F,kGAAkG;AAClG,8FAA8F;AAC9F,gGAAgG;AAChG,gGAAgG;AAChG,2FAA2F;AAC3F,gGAAgG;AAChG,kFAAkF;AAElF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,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YACrF,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBACd,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACrF,SAAS;YACX,CAAC;YACD,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC;YAC9B,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACvE,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,SAAS;YACf,QAAQ;YACR,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO;YACP,QAAQ;YACR,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,SAAS;YAChB,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;AACpE,CAAC"}
@@ -8,7 +8,9 @@ export declare const PHASES: readonly ["discover", "extract", "model", "slice",
8
8
  export type Phase = (typeof PHASES)[number];
9
9
  export declare function isPhase(value: string): value is Phase;
10
10
  /** The state file's mechanical fields, decoded to plain data. `lastConformance`/`lastReview`
11
- * are `null` for the template's `never` marker (never run yet). */
11
+ * are `null` for the template's `never` marker (never run yet). `modelVersion`/`certified`
12
+ * (MIL-218) are `null` for their own `none`/`never` markers, INCLUDING when the bullet is
13
+ * missing entirely from an older state file — see module header. */
12
14
  export interface ParsedState {
13
15
  modelPath: string;
14
16
  phase: string;
@@ -18,7 +20,20 @@ export interface ParsedState {
18
20
  date: string;
19
21
  revision: string;
20
22
  report: string;
23
+ partial: boolean;
21
24
  } | null;
25
+ modelVersion: number | null;
26
+ certified: {
27
+ version: number;
28
+ revision: string;
29
+ date: string;
30
+ } | null;
31
+ /** MIL-219: the `Em version:` bullet's value, or `null` for the `unknown` sentinel (including
32
+ * when the bullet is missing entirely from a state file predating this feature — same
33
+ * migration-tolerant treatment `modelVersion`/`certified` get). Never validated as a real
34
+ * semver here — this module only reads/writes the bullet text; `util/semver.ts` is where a
35
+ * caller that needs to compare it against the installed version goes. */
36
+ emVersion: string | null;
22
37
  lastReview: string | null;
23
38
  }
24
39
  export type ParseStateResult = {
@@ -50,10 +65,13 @@ export type LoadResult = {
50
65
  };
51
66
  /** The one fs read every `em state` subcommand goes through. */
52
67
  export declare function loadStateFile(dirOrFile: string): LoadResult;
53
- /** Parse the six mechanical bullets out of a state file's raw text. `ok: false` when the file
54
- * is missing one of the bullet lines entirely, or when `Last conformance:`/`Last stakeholder
55
- * review:` holds neither `never` nor its documented format — both are the file failing to be
56
- * the thing resume/conform scoping needs, so both are reported the same way. */
68
+ /** Parse the mechanical bullets out of a state file's raw text. `ok: false` when the file is
69
+ * missing one of the six REQUIRED bullet lines entirely, or when `Last conformance:`/`Last
70
+ * stakeholder review:` holds neither `never` nor its documented format — both are the file
71
+ * failing to be the thing resume/conform scoping needs, so both are reported the same way.
72
+ * MIL-218: `Model version:`/`Certified:` are migration-tolerant — see module header — so a
73
+ * missing bullet there is never added to `missing`; it parses as the `none`/`never` default
74
+ * instead, same as if the bullet were present and held that literal value. */
57
75
  export declare function parseState(text: string): ParseStateResult;
58
76
  /** A state file is shared by every `.em` file in its directory (`.event-modeling.md` has no
59
77
  * per-model namespacing), but its `Model file:` bullet names exactly ONE of them — so a
@@ -72,8 +90,46 @@ export declare function setPhase(text: string, phase: Phase, today: string, step
72
90
  /** `em state set-conformance`: rewrite `Last conformance:` in the EXACT format
73
91
  * reference/conform.md's "keep the format exact" instruction specifies — the next conform
74
92
  * run's scoping (reference/conform.md step 1) parses this line back out — plus `Last
75
- * updated:`. */
76
- export declare function setConformance(text: string, revision: string, report: string, today: string): PatchResult;
93
+ * updated:`. `partial` (MIL-214, `--partial`) appends a ` (partial)` suffix — the marker for a
94
+ * conformance sweep whose findings weren't ALL ruled on before the marker was recorded
95
+ * (`em state set-conformance`'s own refusal, cli.ts, is what `--partial` escapes) — parsed back
96
+ * out by `LAST_CONFORMANCE_RE`/`ParsedState.lastConformance.partial` above, and surfaced by
97
+ * every reader of `Last conformance:` (conform-scope.ts, status.ts, freshnessJson.ts). */
98
+ export declare function setConformance(text: string, revision: string, report: string, today: string, partial?: boolean): PatchResult;
99
+ /** MIL-219: rewrite `Em version:` (inserting it right after `Model file:` — the state file's
100
+ * very first bullet, module header — the first time a migrated file is touched) plus `Last
101
+ * updated:`. `version` is trusted to already be the em that's doing the writing — every caller
102
+ * passes its own `PKG_VERSION`/installed version, never a value read back from somewhere else.
103
+ * The one writer every OTHER `em state` mutator's output is piped through (cli.ts's
104
+ * `writeStateUpdate`) — see module header — so this is rarely called directly outside that
105
+ * wrapper and `em upgrade`'s own final commit (src/cli/upgrade.ts). */
106
+ export declare function setEmVersion(text: string, version: string, today: string): PatchResult;
107
+ /** `em model version bump` (MIL-218): rewrite `Model version:` (inserting it right after `Last
108
+ * conformance:` the first time a migrated file is touched — see module header) plus `Last
109
+ * updated:`. `version` is trusted to already be the freshly-bumped design version — the CLI
110
+ * layer computes it via `modelVersion.ts`'s `runModelVersionBump` before calling this. */
111
+ export declare function setModelVersion(text: string, version: number, today: string): PatchResult;
112
+ /** `em state set-conformance` (non-`--partial`, MIL-218 ruling D): rewrite `Certified:` plus
113
+ * `Last updated:`. Inserting it for the first time anchors on `Model version:` when that
114
+ * bullet is already present (the ordinary case — a model version must exist before it can be
115
+ * certified, `runCertifyModelVersion`'s own refusal), so the canonical bullet order (`Last
116
+ * conformance`, `Model version`, `Certified`, `Last stakeholder review`) holds regardless of
117
+ * which of the two migration inserts happens first; falls back to `Last conformance:` only
118
+ * for the edge case of a state file that somehow carries `Certified:` without `Model
119
+ * version:` yet. `version`/`revision`/`date` are trusted to already be the just-recorded
120
+ * certification — the CLI layer computes them via `modelVersion.ts`'s
121
+ * `runCertifyModelVersion` before calling this. */
122
+ export declare function setCertified(text: string, version: number, revision: string, date: string, today: string): PatchResult;
123
+ /** `em upgrade`'s `state-file` step (MIL-219): insert whichever of `Model version:`/`Certified:`
124
+ * are missing from `text` ENTIRELY, each at its own template default (`none`/`never` — same
125
+ * sentinels `parseState` already tolerates when a bullet is absent) — everything else, byte for
126
+ * byte, untouched. Deliberately excludes `Em version:`: that bullet gets its own dedicated
127
+ * final commit from `em upgrade --apply` (src/cli/upgrade.ts), regardless of whether this step
128
+ * ran at all, so folding it in here would double-write it across two commits on a first-ever
129
+ * upgrade. A no-op (both bullets already present) returns `text` unchanged — the caller decides
130
+ * whether "nothing changed" means "nothing to commit," same idempotency contract every other
131
+ * upgrade step holds. */
132
+ export declare function ensureOptionalBullets(text: string, today: string): PatchResult;
77
133
  /** `em state set-review`: rewrite `Last stakeholder review:` (per templates/state.md's format)
78
134
  * plus `Last updated:`. `date` is trusted to already look like `YYYY-MM-DD` — the CLI layer
79
135
  * validates before calling this. */
@@ -1,20 +1,44 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  // Reads and writes the MECHANICAL fields of a model's resumable state file
3
3
  // (`.event-modeling.md`, see .claude/skills/event-modeling/templates/state.md): `Model file:`,
4
- // `Current phase:`, `Current step:`, `Last updated:`, `Last conformance:`, `Last stakeholder
5
- // review:`. This is the ONE parser for those bullets — `em changelog` (src/emit/changelog.ts,
6
- // parseDecisionsLog) parses a disjoint section of the same file (the `## Decisions log`) and
7
- // stays a separate function for that reason, but shares STATE_FILE_NAME with this module rather
8
- // than hard-coding the filename a second time.
4
+ // `Current phase:`, `Current step:`, `Last updated:`, `Last conformance:`, `Model version:`,
5
+ // `Certified:`, `Last stakeholder review:`. This is the ONE parser for those bullets — `em
6
+ // changelog` (src/emit/changelog.ts, parseDecisionsLog) parses a disjoint section of the same
7
+ // file (the `## Decisions log`) and stays a separate function for that reason, but shares
8
+ // STATE_FILE_NAME with this module rather than hard-coding the filename a second time.
9
9
  //
10
10
  // Deliberately narrow: judgment content (Session inputs, Participants, Decisions log, Usage
11
11
  // log, Open questions, Slice inventory) is agent-authored prose and out of scope here — this
12
- // module only ever touches the six mechanical bullets above, byte-for-byte leaving every other
12
+ // module only ever touches the mechanical bullets above, byte-for-byte leaving every other
13
13
  // line alone.
14
14
  //
15
- // Pure text in, text/data out (parseState, setPhase, setConformance, setReview); `loadStateFile`
16
- // is the one bit of fs I/O, kept here so both `em state` (src/cli.ts) and any future caller
17
- // share the same file-location convention instead of re-deriving it.
15
+ // MIL-218: `Model version:`/`Certified:` are a POINTER into the `model-versions/*.json`
16
+ // manifests (modelVersion.ts) — history lives there, not here. Both are MIGRATION-TOLERANT,
17
+ // unlike the other six bullets: a state file predating this feature parses as `modelVersion:
18
+ // null`/`certified: null` (the `none`/`never` markers) rather than failing outright — the
19
+ // existing "missing bullet is an error" behavior stays exactly as strict as before for every
20
+ // OTHER bullet. `setModelVersion`/`setCertified` insert the bullet (right after `Last
21
+ // conformance:`, the ruling's own placement) the first time a migrated file is touched, and
22
+ // update it in place afterward — the only two writers in this module that ever ADD a line
23
+ // rather than only ever replacing one that's already there.
24
+ //
25
+ // MIL-219: `Em version:` — which `em` last wrote this file — is a THIRD migration-tolerant
26
+ // bullet, same "absent parses as the sentinel, never an error" treatment (its sentinel is the
27
+ // literal `unknown`, not `none`/`never` — there's no meaningful zero value for "which em," just
28
+ // "we don't know"). Anchored right after `Model file:` (the state file's very first bullet)
29
+ // rather than beside the other two MIL-218 bullets — it's provenance about the TOOL, not about
30
+ // the model's own version history, so it reads first. Written by `em scaffold` (the installed
31
+ // em at scaffold time) and, per the MIL-219 ruling, by EVERY `em state` writer: cli.ts's shared
32
+ // `writeStateUpdate` helper stamps it on every successful write, since each of those write paths
33
+ // is already rewriting the file — see that function, not this module, for the actual stamping
34
+ // (this module only exposes the pure `setEmVersion` patch, same split every other bullet here
35
+ // holds). `em upgrade --apply` additionally writes it as its own dedicated final commit,
36
+ // regardless of whether any of its five mechanical steps applied — see src/cli/upgrade.ts.
37
+ //
38
+ // Pure text in, text/data out (parseState, setPhase, setConformance, setModelVersion,
39
+ // setCertified, setReview); `loadStateFile` is the one bit of fs I/O, kept here so both `em
40
+ // state` (src/cli.ts) and any future caller share the same file-location convention instead of
41
+ // re-deriving it.
18
42
  import { existsSync, readFileSync } from "node:fs";
19
43
  import { basename, join } from "node:path";
20
44
  /** Filename the skill scaffolds/reads at `<model-dir>/.event-modeling.md`. */
@@ -35,6 +59,14 @@ const LABELS = {
35
59
  lastConformance: "Last conformance",
36
60
  lastStakeholderReview: "Last stakeholder review",
37
61
  };
62
+ /** MIL-218/MIL-219: the three migration-tolerant bullets — see module header. Kept in a separate
63
+ * map from `LABELS` (rather than folded in) so `parseState`'s missing-bullet loop can treat them
64
+ * differently: absent is `none`/`never`/`unknown`, never a parse error. */
65
+ const OPTIONAL_LABELS = {
66
+ modelVersion: "Model version",
67
+ certified: "Certified",
68
+ emVersion: "Em version",
69
+ };
38
70
  function escapeForRegex(s) {
39
71
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
40
72
  }
@@ -63,12 +95,23 @@ export function loadStateFile(dirOrFile) {
63
95
  }
64
96
  return { ok: true, path, text: readFileSync(path, "utf8") };
65
97
  }
66
- const LAST_CONFORMANCE_RE = /^(\d{4}-\d{2}-\d{2}) @ (.+?) — report: (.+)$/;
98
+ // MIL-214: the `( (partial)`)?` tail is `--partial`'s marker — see `setConformance` below. The
99
+ // report capture stays non-greedy (`.+?`) so the optional suffix, not the report path, absorbs
100
+ // a trailing "(partial)" when present.
101
+ const LAST_CONFORMANCE_RE = /^(\d{4}-\d{2}-\d{2}) @ (.+?) — report: (.+?)( \(partial\))?$/;
67
102
  const LEADING_DATE_RE = /^(\d{4}-\d{2}-\d{2})\b/;
68
- /** Parse the six mechanical bullets out of a state file's raw text. `ok: false` when the file
69
- * is missing one of the bullet lines entirely, or when `Last conformance:`/`Last stakeholder
70
- * review:` holds neither `never` nor its documented format — both are the file failing to be
71
- * the thing resume/conform scoping needs, so both are reported the same way. */
103
+ // MIL-218: `Model version:` holds a bare positive integer or the literal `none`.
104
+ const MODEL_VERSION_RE = /^(\d+)$/;
105
+ // MIL-218: `Certified:` holds `v<N> @ <revision> (YYYY-MM-DD)` or the literal `never` — same
106
+ // `v<N>` prefix convention lineage refs use elsewhere in em (docs/dsl.md).
107
+ const CERTIFIED_RE = /^v(\d+) @ (.+) \((\d{4}-\d{2}-\d{2})\)$/;
108
+ /** Parse the mechanical bullets out of a state file's raw text. `ok: false` when the file is
109
+ * missing one of the six REQUIRED bullet lines entirely, or when `Last conformance:`/`Last
110
+ * stakeholder review:` holds neither `never` nor its documented format — both are the file
111
+ * failing to be the thing resume/conform scoping needs, so both are reported the same way.
112
+ * MIL-218: `Model version:`/`Certified:` are migration-tolerant — see module header — so a
113
+ * missing bullet there is never added to `missing`; it parses as the `none`/`never` default
114
+ * instead, same as if the bullet were present and held that literal value. */
72
115
  export function parseState(text) {
73
116
  const missing = [];
74
117
  const raw = {};
@@ -85,6 +128,11 @@ export function parseState(text) {
85
128
  message: `missing bullet line(s): ${missing.map((l) => `"- **${l}:**"`).join(", ")}`,
86
129
  };
87
130
  }
131
+ const optionalRaw = {};
132
+ for (const label of Object.values(OPTIONAL_LABELS)) {
133
+ const sentinel = label === OPTIONAL_LABELS.modelVersion ? "none" : label === OPTIONAL_LABELS.emVersion ? "unknown" : "never";
134
+ optionalRaw[label] = bulletValue(text, label) ?? sentinel;
135
+ }
88
136
  const modelPath = raw[LABELS.modelFile].replace(/^`|`$/g, "");
89
137
  const lastConformanceRaw = raw[LABELS.lastConformance];
90
138
  let lastConformance = null;
@@ -96,7 +144,7 @@ export function parseState(text) {
96
144
  message: `"- **Last conformance:**" doesn't match "YYYY-MM-DD @ <revision> — report: <path>" or "never": ${lastConformanceRaw}`,
97
145
  };
98
146
  }
99
- lastConformance = { date: m[1], revision: m[2], report: m[3] };
147
+ lastConformance = { date: m[1], revision: m[2], report: m[3], partial: m[4] !== undefined };
100
148
  }
101
149
  const lastReviewRaw = raw[LABELS.lastStakeholderReview];
102
150
  let lastReview = null;
@@ -110,6 +158,32 @@ export function parseState(text) {
110
158
  }
111
159
  lastReview = m[1];
112
160
  }
161
+ const modelVersionRaw = optionalRaw[OPTIONAL_LABELS.modelVersion];
162
+ let modelVersion = null;
163
+ if (modelVersionRaw !== "none") {
164
+ const m = MODEL_VERSION_RE.exec(modelVersionRaw);
165
+ if (!m) {
166
+ return {
167
+ ok: false,
168
+ message: `"- **Model version:**" doesn't match a bare integer or "none": ${modelVersionRaw}`,
169
+ };
170
+ }
171
+ modelVersion = Number(m[1]);
172
+ }
173
+ const certifiedRaw = optionalRaw[OPTIONAL_LABELS.certified];
174
+ let certified = null;
175
+ if (certifiedRaw !== "never") {
176
+ const m = CERTIFIED_RE.exec(certifiedRaw);
177
+ if (!m) {
178
+ return {
179
+ ok: false,
180
+ message: `"- **Certified:**" doesn't match "v<N> @ <revision> (YYYY-MM-DD)" or "never": ${certifiedRaw}`,
181
+ };
182
+ }
183
+ certified = { version: Number(m[1]), revision: m[2], date: m[3] };
184
+ }
185
+ const emVersionRaw = optionalRaw[OPTIONAL_LABELS.emVersion];
186
+ const emVersion = emVersionRaw === "unknown" ? null : emVersionRaw;
113
187
  return {
114
188
  ok: true,
115
189
  state: {
@@ -118,6 +192,9 @@ export function parseState(text) {
118
192
  step: raw[LABELS.currentStep],
119
193
  lastUpdated: raw[LABELS.lastUpdated],
120
194
  lastConformance,
195
+ modelVersion,
196
+ certified,
197
+ emVersion,
121
198
  lastReview,
122
199
  },
123
200
  };
@@ -159,6 +236,26 @@ function applyBulletUpdates(text, updates) {
159
236
  }
160
237
  return { ok: true, text: result };
161
238
  }
239
+ /** MIL-218: update `label`'s bullet if present, else INSERT it right after `afterLabel`'s own
240
+ * bullet line — the one-time migration act for a state file predating `Model version:`/
241
+ * `Certified:` (module header). Matches the line-ending style already in use right after
242
+ * `afterLabel`'s line (CRLF if that's what follows, else LF) so a migrated file doesn't end up
243
+ * with mixed endings. `afterLabel` is trusted to already exist (`setModelVersion`/
244
+ * `setCertified` only ever anchor on `Last conformance:`, one of the six REQUIRED bullets
245
+ * `loadStateFile`'s caller has already confirmed is present via a successful `parseState`). */
246
+ function insertOrUpdateBullet(text, label, value, afterLabel) {
247
+ const re = bulletLineRegex(label);
248
+ if (re.test(text)) {
249
+ return text.replace(re, () => `- **${label}:** ${value}`);
250
+ }
251
+ const afterRe = bulletLineRegex(afterLabel);
252
+ const m = afterRe.exec(text);
253
+ if (!m)
254
+ return text; // afterLabel missing — shouldn't happen on a real caller's already-parsed text
255
+ const insertPos = m.index + m[0].length;
256
+ const eol = text.slice(insertPos, insertPos + 2) === "\r\n" ? "\r\n" : "\n";
257
+ return `${text.slice(0, insertPos)}${eol}- **${label}:** ${value}${text.slice(insertPos)}`;
258
+ }
162
259
  /** `em state set-phase`: rewrite `Current phase:` (and `Current step:` when `step` is given)
163
260
  * plus `Last updated:`. `phase` is trusted to already be a validated `Phase` — the CLI layer
164
261
  * checks against `PHASES` before calling this so the enum has exactly one home. */
@@ -172,14 +269,78 @@ export function setPhase(text, phase, today, step) {
172
269
  /** `em state set-conformance`: rewrite `Last conformance:` in the EXACT format
173
270
  * reference/conform.md's "keep the format exact" instruction specifies — the next conform
174
271
  * run's scoping (reference/conform.md step 1) parses this line back out — plus `Last
175
- * updated:`. */
176
- export function setConformance(text, revision, report, today) {
177
- const value = `${today} @ ${revision} — report: ${report}`;
272
+ * updated:`. `partial` (MIL-214, `--partial`) appends a ` (partial)` suffix — the marker for a
273
+ * conformance sweep whose findings weren't ALL ruled on before the marker was recorded
274
+ * (`em state set-conformance`'s own refusal, cli.ts, is what `--partial` escapes) — parsed back
275
+ * out by `LAST_CONFORMANCE_RE`/`ParsedState.lastConformance.partial` above, and surfaced by
276
+ * every reader of `Last conformance:` (conform-scope.ts, status.ts, freshnessJson.ts). */
277
+ export function setConformance(text, revision, report, today, partial = false) {
278
+ const value = `${today} @ ${revision} — report: ${report}${partial ? " (partial)" : ""}`;
178
279
  return applyBulletUpdates(text, [
179
280
  { label: LABELS.lastConformance, value },
180
281
  { label: LABELS.lastUpdated, value: today },
181
282
  ]);
182
283
  }
284
+ /** MIL-219: rewrite `Em version:` (inserting it right after `Model file:` — the state file's
285
+ * very first bullet, module header — the first time a migrated file is touched) plus `Last
286
+ * updated:`. `version` is trusted to already be the em that's doing the writing — every caller
287
+ * passes its own `PKG_VERSION`/installed version, never a value read back from somewhere else.
288
+ * The one writer every OTHER `em state` mutator's output is piped through (cli.ts's
289
+ * `writeStateUpdate`) — see module header — so this is rarely called directly outside that
290
+ * wrapper and `em upgrade`'s own final commit (src/cli/upgrade.ts). */
291
+ export function setEmVersion(text, version, today) {
292
+ const withVersion = insertOrUpdateBullet(text, OPTIONAL_LABELS.emVersion, version, LABELS.modelFile);
293
+ return applyBulletUpdates(withVersion, [{ label: LABELS.lastUpdated, value: today }]);
294
+ }
295
+ /** `em model version bump` (MIL-218): rewrite `Model version:` (inserting it right after `Last
296
+ * conformance:` the first time a migrated file is touched — see module header) plus `Last
297
+ * updated:`. `version` is trusted to already be the freshly-bumped design version — the CLI
298
+ * layer computes it via `modelVersion.ts`'s `runModelVersionBump` before calling this. */
299
+ export function setModelVersion(text, version, today) {
300
+ const withVersion = insertOrUpdateBullet(text, OPTIONAL_LABELS.modelVersion, String(version), LABELS.lastConformance);
301
+ return applyBulletUpdates(withVersion, [{ label: LABELS.lastUpdated, value: today }]);
302
+ }
303
+ /** `em state set-conformance` (non-`--partial`, MIL-218 ruling D): rewrite `Certified:` plus
304
+ * `Last updated:`. Inserting it for the first time anchors on `Model version:` when that
305
+ * bullet is already present (the ordinary case — a model version must exist before it can be
306
+ * certified, `runCertifyModelVersion`'s own refusal), so the canonical bullet order (`Last
307
+ * conformance`, `Model version`, `Certified`, `Last stakeholder review`) holds regardless of
308
+ * which of the two migration inserts happens first; falls back to `Last conformance:` only
309
+ * for the edge case of a state file that somehow carries `Certified:` without `Model
310
+ * version:` yet. `version`/`revision`/`date` are trusted to already be the just-recorded
311
+ * certification — the CLI layer computes them via `modelVersion.ts`'s
312
+ * `runCertifyModelVersion` before calling this. */
313
+ export function setCertified(text, version, revision, date, today) {
314
+ const value = `v${version} @ ${revision} (${date})`;
315
+ const anchor = bulletLineRegex(OPTIONAL_LABELS.modelVersion).test(text) ? OPTIONAL_LABELS.modelVersion : LABELS.lastConformance;
316
+ const withCertified = insertOrUpdateBullet(text, OPTIONAL_LABELS.certified, value, anchor);
317
+ return applyBulletUpdates(withCertified, [{ label: LABELS.lastUpdated, value: today }]);
318
+ }
319
+ /** `em upgrade`'s `state-file` step (MIL-219): insert whichever of `Model version:`/`Certified:`
320
+ * are missing from `text` ENTIRELY, each at its own template default (`none`/`never` — same
321
+ * sentinels `parseState` already tolerates when a bullet is absent) — everything else, byte for
322
+ * byte, untouched. Deliberately excludes `Em version:`: that bullet gets its own dedicated
323
+ * final commit from `em upgrade --apply` (src/cli/upgrade.ts), regardless of whether this step
324
+ * ran at all, so folding it in here would double-write it across two commits on a first-ever
325
+ * upgrade. A no-op (both bullets already present) returns `text` unchanged — the caller decides
326
+ * whether "nothing changed" means "nothing to commit," same idempotency contract every other
327
+ * upgrade step holds. */
328
+ export function ensureOptionalBullets(text, today) {
329
+ let result = text;
330
+ let changed = false;
331
+ if (!bulletLineRegex(OPTIONAL_LABELS.modelVersion).test(result)) {
332
+ result = insertOrUpdateBullet(result, OPTIONAL_LABELS.modelVersion, "none", LABELS.lastConformance);
333
+ changed = true;
334
+ }
335
+ if (!bulletLineRegex(OPTIONAL_LABELS.certified).test(result)) {
336
+ const anchor = bulletLineRegex(OPTIONAL_LABELS.modelVersion).test(result) ? OPTIONAL_LABELS.modelVersion : LABELS.lastConformance;
337
+ result = insertOrUpdateBullet(result, OPTIONAL_LABELS.certified, "never", anchor);
338
+ changed = true;
339
+ }
340
+ if (!changed)
341
+ return { ok: true, text };
342
+ return applyBulletUpdates(result, [{ label: LABELS.lastUpdated, value: today }]);
343
+ }
183
344
  /** `em state set-review`: rewrite `Last stakeholder review:` (per templates/state.md's format)
184
345
  * plus `Last updated:`. `date` is trusted to already look like `YYYY-MM-DD` — the CLI layer
185
346
  * validates before calling this. */
@@ -1 +1 @@
1
- {"version":3,"file":"stateFile.js","sourceRoot":"","sources":["../../src/cli/stateFile.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,2EAA2E;AAC3E,+FAA+F;AAC/F,6FAA6F;AAC7F,8FAA8F;AAC9F,6FAA6F;AAC7F,gGAAgG;AAChG,+CAA+C;AAC/C,EAAE;AACF,4FAA4F;AAC5F,6FAA6F;AAC7F,+FAA+F;AAC/F,cAAc;AACd,EAAE;AACF,iGAAiG;AACjG,4FAA4F;AAC5F,qEAAqE;AAErE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAEpD;;;2FAG2F;AAC3F,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAGvH,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAQ,MAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,MAAM,GAAG;IACb,SAAS,EAAE,YAAY;IACvB,YAAY,EAAE,eAAe;IAC7B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,kBAAkB;IACnC,qBAAqB,EAAE,yBAAyB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