@milehimikey/em 1.16.1 → 1.17.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/.claude/skills/event-modeling/SKILL.md +1 -1
- package/.claude/skills/event-modeling-conform/SKILL.md +3 -2
- package/.claude/skills/event-modeling-conform/reference/conform.md +7 -0
- package/.claude/skills/event-modeling-design/SKILL.md +1 -1
- package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
- package/.claude/skills/event-modeling-engagement/SKILL.md +22 -5
- package/.claude/skills/event-modeling-engagement/reference/engagement.md +5 -4
- package/.claude/skills/event-modeling-implement/SKILL.md +1 -1
- package/.claude/skills/event-modeling-implement/reference/implement.md +10 -8
- package/.claude/skills/event-modeling-review/SKILL.md +1 -1
- package/.claude/skills/event-modeling-shared/reference/em-dsl.md +17 -5
- package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +26 -13
- package/.claude-plugin/marketplace.json +2 -2
- package/dist/catalog/docJoin.d.ts +13 -5
- package/dist/catalog/docJoin.js +6 -1
- package/dist/catalog/docJoin.js.map +1 -1
- package/dist/catalog/signedBodyValidate.d.ts +7 -0
- package/dist/catalog/signedBodyValidate.js +29 -0
- package/dist/catalog/signedBodyValidate.js.map +1 -0
- package/dist/catalog/sliceDoc.d.ts +53 -7
- package/dist/catalog/sliceDoc.js +89 -10
- package/dist/catalog/sliceDoc.js.map +1 -1
- package/dist/catalog/sliceReadyValidate.d.ts +15 -2
- package/dist/catalog/sliceReadyValidate.js +19 -19
- package/dist/catalog/sliceReadyValidate.js.map +1 -1
- package/dist/cli/defer.d.ts +32 -17
- package/dist/cli/defer.js +100 -82
- package/dist/cli/defer.js.map +1 -1
- package/dist/cli/engagement.d.ts +46 -0
- package/dist/cli/engagement.js +133 -1
- package/dist/cli/engagement.js.map +1 -1
- package/dist/cli/engagementFoundation.d.ts +47 -0
- package/dist/cli/engagementFoundation.js +164 -0
- package/dist/cli/engagementFoundation.js.map +1 -0
- package/dist/cli/frontmatterSurgery.d.ts +5 -0
- package/dist/cli/frontmatterSurgery.js +15 -0
- package/dist/cli/frontmatterSurgery.js.map +1 -1
- package/dist/cli/ledgerCheck.d.ts +5 -1
- package/dist/cli/ledgerCheck.js +50 -20
- package/dist/cli/ledgerCheck.js.map +1 -1
- package/dist/cli/ratify.d.ts +14 -2
- package/dist/cli/ratify.js +34 -6
- package/dist/cli/ratify.js.map +1 -1
- package/dist/cli/refsCheck.d.ts +78 -0
- package/dist/cli/refsCheck.js +153 -0
- package/dist/cli/refsCheck.js.map +1 -0
- package/dist/cli/revise.d.ts +10 -3
- package/dist/cli/revise.js +36 -8
- package/dist/cli/revise.js.map +1 -1
- package/dist/cli/sliceConform.js +9 -0
- package/dist/cli/sliceConform.js.map +1 -1
- package/dist/cli/status.d.ts +5 -4
- package/dist/cli/status.js +3 -3
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +113 -3
- package/dist/cli/upgrade.js.map +1 -1
- package/dist/cli.js +147 -31
- package/dist/cli.js.map +1 -1
- package/dist/emit/engagementJson.d.ts +4 -1
- package/dist/emit/engagementJson.js +25 -1
- package/dist/emit/engagementJson.js.map +1 -1
- package/dist/emit/json.d.ts +1 -1
- package/dist/emit/json.js +4 -1
- package/dist/emit/json.js.map +1 -1
- package/dist/emit/ledgerJson.d.ts +1 -1
- package/dist/emit/ledgerJson.js +6 -1
- package/dist/emit/ledgerJson.js.map +1 -1
- package/dist/emit/refsJson.d.ts +4 -0
- package/dist/emit/refsJson.js +19 -0
- package/dist/emit/refsJson.js.map +1 -0
- package/dist/emit/validateJson.d.ts +2 -2
- package/dist/emit/validateJson.js +7 -2
- package/dist/emit/validateJson.js.map +1 -1
- package/dist/mcp/server.js +37 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/rules.d.ts +18 -1
- package/dist/model/rules.js +20 -3
- package/dist/model/rules.js.map +1 -1
- package/dist/parser/lexer.d.ts +7 -1
- package/dist/parser/lexer.js +13 -2
- package/dist/parser/lexer.js.map +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/shared/reference/em-dsl.md +17 -5
- package/plugin/shared/reference/slice-doc-schema.md +26 -13
- package/plugin/skills/conform/SKILL.md +3 -2
- package/plugin/skills/conform/reference/conform.md +7 -0
- package/plugin/skills/design/SKILL.md +1 -1
- package/plugin/skills/discover/SKILL.md +1 -1
- package/plugin/skills/engagement/SKILL.md +22 -5
- package/plugin/skills/engagement/reference/engagement.md +5 -4
- package/plugin/skills/event-modeling/SKILL.md +1 -1
- package/plugin/skills/implement/SKILL.md +1 -1
- package/plugin/skills/implement/reference/implement.md +10 -8
- package/plugin/skills/review/SKILL.md +1 -1
|
@@ -121,6 +121,11 @@ export interface SliceDoc {
|
|
|
121
121
|
* contract differently (`--contract-change "<why>"`), surrounding quotes stripped; null when
|
|
122
122
|
* absent. Written only by `em slice ratify`/`reratify`. */
|
|
123
123
|
contractChange: string | null;
|
|
124
|
+
/** GH #260: `reviewSkipped:` — the status `em slice ratify --skip-review` ratified from
|
|
125
|
+
* (`draft`, `reviewed`-less states…) when the bypass is what let the ratification through;
|
|
126
|
+
* null when the ratification passed the review gate, or the doc predates 1.17. Written only
|
|
127
|
+
* by `em slice ratify`, cleared by `em slice revise` with the rest of the sign-off. */
|
|
128
|
+
reviewSkipped: string | null;
|
|
124
129
|
/** True when a well-formed leading `---`/`---` frontmatter fence was found and
|
|
125
130
|
* closed — independent of which keys it contained. False for a legacy
|
|
126
131
|
* status-bullet-only doc, a doc with no frontmatter at all, or an
|
|
@@ -198,12 +203,53 @@ export interface ShippedRecord {
|
|
|
198
203
|
* state) included; `driftSignal` reads that as `unpropagated-delta`, as it always did.
|
|
199
204
|
*/
|
|
200
205
|
export declare function shippedRecordOf(doc: Pick<SliceDoc, "status" | "version" | "implementedIn" | "ratifiedRef" | "shippedVersion" | "shippedRef" | "shippedOn">): ShippedRecord | null;
|
|
201
|
-
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
206
|
+
/**
|
|
207
|
+
* GH #253: the text `ratifiedHash` is computed over — the body minus what describes a LATER
|
|
208
|
+
* version. Inside the `## Open Questions` section (heading to the next `#`/`##` heading or EOF)
|
|
209
|
+
* the heading line itself, blank lines, and every `deferred to v<n>` item are dropped; everything
|
|
210
|
+
* else — every other section, the section's answered `- [x]` history, any `- [ ]` — is kept, in
|
|
211
|
+
* order. Trailing whitespace is trimmed last, so appending a deferred item (and, on a doc with no
|
|
212
|
+
* section, the heading before it) never moves the hash. The blank lines go because `appendBullet`
|
|
213
|
+
* (cli/defer.ts) inserts one after a bare heading; keeping them would make an empty section and
|
|
214
|
+
* a one-item section hash differently.
|
|
215
|
+
*/
|
|
216
|
+
export declare function ratifiedBody(body: string): string;
|
|
217
|
+
/** GH #261: how a `conformedAt:` value (or an `em slice conform --at` argument) is read. A bare
|
|
218
|
+
* value is a TARGET-repo git revision, as it always was. A `<kind>:<id>` value — `build:1234`,
|
|
219
|
+
* `deploy:eu-1-2026-10-15`, `env:pr-57` — names the thing the sweep actually exercised when that
|
|
220
|
+
* is not a commit reachable from the target branch (a per-PR environment whose branch HEAD a
|
|
221
|
+
* squash or rebase merge will orphan, a build or image id). `kind` is lowercase
|
|
222
|
+
* `[a-z][a-z0-9-]*`; git refnames cannot contain `:` and SHAs are hex, so the form is
|
|
223
|
+
* unambiguous. Readers that resolve revisions (GH #258's reachability check) act on
|
|
224
|
+
* `kind === "git"` only. */
|
|
225
|
+
export interface ConformedAtRef {
|
|
226
|
+
/** `"git"` for a bare revision, else the declared kind. */
|
|
227
|
+
kind: string;
|
|
228
|
+
/** The revision, or the opaque identifier after the kind's `:`. */
|
|
229
|
+
id: string;
|
|
230
|
+
}
|
|
231
|
+
export declare function parseConformedAt(value: string): ConformedAtRef;
|
|
232
|
+
/** MIL-284 / GH #253: the identity `em slice ratify` records as `ratifiedHash:` and
|
|
233
|
+
* `--slice-ready` checks against: `sha256:<hex>` over `ratifiedBody()` of the doc BODY —
|
|
234
|
+
* everything after the closing frontmatter fence (or the whole doc when there is none), EOLs
|
|
235
|
+
* normalised to `\n` by `splitFrontmatter`'s split/join. Frontmatter is excluded on purpose: the
|
|
236
|
+
* ratify edit itself, `mark-implemented` and `conform` touch only frontmatter, without changing
|
|
237
|
+
* what was ratified. Since 1.17.0 the `## Open Questions` heading and its `deferred to v<n>`
|
|
238
|
+
* items are excluded too, so `em slice defer` can record a question on a ratified or shipped doc
|
|
239
|
+
* (GH #253, superseding GH #236's state-file queue). */
|
|
208
240
|
export declare function sliceDocBodyHash(markdown: string): string;
|
|
241
|
+
/** The pre-1.17.0 scope: the whole body (GH #236 kept `## Open Questions` inside it). Readers
|
|
242
|
+
* still accept a hash in this scope — `ratifiedHashScope()` — and `em upgrade`'s
|
|
243
|
+
* `ratified-hash-scope` step (or `em slice defer`, on first touch) re-stamps it. */
|
|
244
|
+
export declare function sliceDocLegacyBodyHash(markdown: string): string;
|
|
245
|
+
/** How a recorded `ratifiedHash:` relates to the doc as it stands: `current` (matches the 1.17
|
|
246
|
+
* scope), `legacy` (matches only the pre-1.17 whole-body scope — the body is intact, the stamp
|
|
247
|
+
* is old), or `mismatch` (the body moved after sign-off). Every reader that judges "was the
|
|
248
|
+
* body edited after ratification" goes through this, never through `===` on one hash. */
|
|
249
|
+
export declare function ratifiedHashScope(markdown: string, recorded: string): "current" | "legacy" | "mismatch";
|
|
250
|
+
/** GH #253: how many `## Open Questions` items are deferred to a version later than `version` —
|
|
251
|
+
* the known work waiting on a later version that `em status` / `em export` report as
|
|
252
|
+
* `queuedForNext` (the name predates #253: GH #236's state-file queue reported the same fact
|
|
253
|
+
* for the one release when a ratified doc could not carry it). 0 when `version` is null. */
|
|
254
|
+
export declare function countDeferredBeyond(body: string, version: number | null): number;
|
|
209
255
|
export declare function parseSliceDoc(markdown: string): SliceDoc;
|
package/dist/catalog/sliceDoc.js
CHANGED
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
// `ratifiedRef`/`ratifiedHash` and `shippedVersion`/`shippedRef`/`shippedOn` (MIL-284, the
|
|
71
71
|
// additive half of MIL-283 "ratification has an address") give the two lifecycle facts an exact
|
|
72
72
|
// identity. `ratifiedRef` is the commit whose tree holds the ratified body and `ratifiedHash` the
|
|
73
|
-
// `sha256:` of that body
|
|
73
|
+
// `sha256:` of that body minus what describes a later version (`sliceDocBodyHash` over
|
|
74
|
+
// `ratifiedBody`, below — GH #253) — written only by `em slice ratify`, which
|
|
74
75
|
// refuses a doc with uncommitted changes so the ref really does hold what was signed. The
|
|
75
76
|
// `shipped*` trio is written only by `em slice mark-implemented` beside `implementedIn`: the
|
|
76
77
|
// version that shipped, the ref it was ratified at, the local date. Flat keys, not a nested
|
|
@@ -224,16 +225,93 @@ export function shippedRecordOf(doc) {
|
|
|
224
225
|
}
|
|
225
226
|
return null;
|
|
226
227
|
}
|
|
227
|
-
/**
|
|
228
|
-
*
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
228
|
+
/** A checked `## Open Questions` item carrying `em slice defer`'s marker (cli/defer.ts writes
|
|
229
|
+
* exactly this shape): `- [x] <q> — v<N>: <decision>; deferred to v<n> (<date>[, <by>])`. */
|
|
230
|
+
const DEFERRED_ITEM = /^[ \t]*[-*]\s*\[[xX]\]\s.* — v\d+: .*; deferred to v(\d+) \(.*\)\s*$/;
|
|
231
|
+
/**
|
|
232
|
+
* GH #253: the text `ratifiedHash` is computed over — the body minus what describes a LATER
|
|
233
|
+
* version. Inside the `## Open Questions` section (heading to the next `#`/`##` heading or EOF)
|
|
234
|
+
* the heading line itself, blank lines, and every `deferred to v<n>` item are dropped; everything
|
|
235
|
+
* else — every other section, the section's answered `- [x]` history, any `- [ ]` — is kept, in
|
|
236
|
+
* order. Trailing whitespace is trimmed last, so appending a deferred item (and, on a doc with no
|
|
237
|
+
* section, the heading before it) never moves the hash. The blank lines go because `appendBullet`
|
|
238
|
+
* (cli/defer.ts) inserts one after a bare heading; keeping them would make an empty section and
|
|
239
|
+
* a one-item section hash differently.
|
|
240
|
+
*/
|
|
241
|
+
export function ratifiedBody(body) {
|
|
242
|
+
const lines = body.split("\n");
|
|
243
|
+
const start = lines.findIndex((l) => OPEN_QUESTIONS_HEADING.test(l));
|
|
244
|
+
if (start === -1)
|
|
245
|
+
return body.trimEnd();
|
|
246
|
+
const out = lines.slice(0, start);
|
|
247
|
+
let i = start + 1;
|
|
248
|
+
for (; i < lines.length; i++) {
|
|
249
|
+
const line = lines[i];
|
|
250
|
+
if (/^#{1,2}\s/.test(line))
|
|
251
|
+
break;
|
|
252
|
+
if (line.trim() === "" || DEFERRED_ITEM.test(line))
|
|
253
|
+
continue;
|
|
254
|
+
out.push(line);
|
|
255
|
+
}
|
|
256
|
+
out.push(...lines.slice(i));
|
|
257
|
+
return out.join("\n").trimEnd();
|
|
258
|
+
}
|
|
259
|
+
function sha256(text) {
|
|
260
|
+
return `sha256:${createHash("sha256").update(text, "utf8").digest("hex")}`;
|
|
261
|
+
}
|
|
262
|
+
const CONFORMED_AT_KIND = /^([a-z][a-z0-9-]*):(.+)$/;
|
|
263
|
+
export function parseConformedAt(value) {
|
|
264
|
+
const m = CONFORMED_AT_KIND.exec(value);
|
|
265
|
+
return m ? { kind: m[1], id: m[2] } : { kind: "git", id: value };
|
|
266
|
+
}
|
|
267
|
+
/** MIL-284 / GH #253: the identity `em slice ratify` records as `ratifiedHash:` and
|
|
268
|
+
* `--slice-ready` checks against: `sha256:<hex>` over `ratifiedBody()` of the doc BODY —
|
|
269
|
+
* everything after the closing frontmatter fence (or the whole doc when there is none), EOLs
|
|
270
|
+
* normalised to `\n` by `splitFrontmatter`'s split/join. Frontmatter is excluded on purpose: the
|
|
271
|
+
* ratify edit itself, `mark-implemented` and `conform` touch only frontmatter, without changing
|
|
272
|
+
* what was ratified. Since 1.17.0 the `## Open Questions` heading and its `deferred to v<n>`
|
|
273
|
+
* items are excluded too, so `em slice defer` can record a question on a ratified or shipped doc
|
|
274
|
+
* (GH #253, superseding GH #236's state-file queue). */
|
|
234
275
|
export function sliceDocBodyHash(markdown) {
|
|
235
|
-
|
|
236
|
-
|
|
276
|
+
return sha256(ratifiedBody(splitFrontmatter(markdown).body));
|
|
277
|
+
}
|
|
278
|
+
/** The pre-1.17.0 scope: the whole body (GH #236 kept `## Open Questions` inside it). Readers
|
|
279
|
+
* still accept a hash in this scope — `ratifiedHashScope()` — and `em upgrade`'s
|
|
280
|
+
* `ratified-hash-scope` step (or `em slice defer`, on first touch) re-stamps it. */
|
|
281
|
+
export function sliceDocLegacyBodyHash(markdown) {
|
|
282
|
+
return sha256(splitFrontmatter(markdown).body);
|
|
283
|
+
}
|
|
284
|
+
/** How a recorded `ratifiedHash:` relates to the doc as it stands: `current` (matches the 1.17
|
|
285
|
+
* scope), `legacy` (matches only the pre-1.17 whole-body scope — the body is intact, the stamp
|
|
286
|
+
* is old), or `mismatch` (the body moved after sign-off). Every reader that judges "was the
|
|
287
|
+
* body edited after ratification" goes through this, never through `===` on one hash. */
|
|
288
|
+
export function ratifiedHashScope(markdown, recorded) {
|
|
289
|
+
if (recorded === sliceDocBodyHash(markdown))
|
|
290
|
+
return "current";
|
|
291
|
+
if (recorded === sliceDocLegacyBodyHash(markdown))
|
|
292
|
+
return "legacy";
|
|
293
|
+
return "mismatch";
|
|
294
|
+
}
|
|
295
|
+
/** GH #253: how many `## Open Questions` items are deferred to a version later than `version` —
|
|
296
|
+
* the known work waiting on a later version that `em status` / `em export` report as
|
|
297
|
+
* `queuedForNext` (the name predates #253: GH #236's state-file queue reported the same fact
|
|
298
|
+
* for the one release when a ratified doc could not carry it). 0 when `version` is null. */
|
|
299
|
+
export function countDeferredBeyond(body, version) {
|
|
300
|
+
if (version === null)
|
|
301
|
+
return 0;
|
|
302
|
+
const lines = body.split("\n");
|
|
303
|
+
const start = lines.findIndex((l) => OPEN_QUESTIONS_HEADING.test(l));
|
|
304
|
+
if (start === -1)
|
|
305
|
+
return 0;
|
|
306
|
+
let count = 0;
|
|
307
|
+
for (let i = start + 1; i < lines.length; i++) {
|
|
308
|
+
if (/^#{1,2}\s/.test(lines[i]))
|
|
309
|
+
break;
|
|
310
|
+
const m = DEFERRED_ITEM.exec(lines[i]);
|
|
311
|
+
if (m && Number(m[1]) > version)
|
|
312
|
+
count++;
|
|
313
|
+
}
|
|
314
|
+
return count;
|
|
237
315
|
}
|
|
238
316
|
export function parseSliceDoc(markdown) {
|
|
239
317
|
const { fields, body, frontmatterPresent } = splitFrontmatter(markdown);
|
|
@@ -273,6 +351,7 @@ export function parseSliceDoc(markdown) {
|
|
|
273
351
|
conformedOn: fields.get("conformedon") ?? null,
|
|
274
352
|
meaningConfirmed: fields.get("meaningconfirmed")?.toLowerCase() === "true",
|
|
275
353
|
contractChange: fields.get("contractchange") ?? null,
|
|
354
|
+
reviewSkipped: fields.get("reviewskipped") ?? null,
|
|
276
355
|
frontmatterPresent,
|
|
277
356
|
missingRequiredFields: REQUIRED_FRONTMATTER_KEYS.filter((k) => !fields.has(k)),
|
|
278
357
|
html: marked.parse(body, { async: false }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliceDoc.js","sourceRoot":"","sources":["../../src/catalog/sliceDoc.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,yDAAyD;AACzD,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,yEAAyE;AACzE,EAAE;AACF,oEAAoE;AACpE,wEAAwE;AACxE,kFAAkF;AAClF,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;A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First.js";
|
|
|
14
14
|
* API-first gate — a public-touching slice whose model contract is missing or stale gets a
|
|
15
15
|
* `slice-ready-contract-stale` error on every path past the unknown-key check.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
/** GH #256: the opt-in strictness a host turns on once its legacy docs are re-ratified. */
|
|
18
|
+
export interface SliceReadyOptions {
|
|
19
|
+
/** `--require-ratified-hash`: a `ready-to-implement` doc with no `ratifiedHash:` is NOT ready
|
|
20
|
+
* (`slice-ready-missing-ratified-hash`, error). Off by default so docs ratified before em 1.15
|
|
21
|
+
* — and `em upgrade`'s grandfathered sign-offs — keep passing; a hand-edited frontmatter that
|
|
22
|
+
* fakes `ratifiedBy`/`ratifiedOn` without a hash passes readiness with no integrity check
|
|
23
|
+
* otherwise, which is the hole this closes. */
|
|
24
|
+
requireRatifiedHash?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function validateSliceReady(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, contract: ContractCheckInput, options?: SliceReadyOptions): Diagnostic[];
|
|
18
27
|
/** The named gate conditions `em validate --slice-ready <key> --json` reports individually
|
|
19
28
|
* (MIL-128; 4 originally, `ratified` MIL-259, `contractCurrent` MIL-238): doc bound, frontmatter usable, status ready-to-implement, no unchecked Open
|
|
20
29
|
* Questions — the exact facts `validateSliceReady` above already derives from the same doc
|
|
@@ -49,6 +58,10 @@ export interface SliceReadyGates {
|
|
|
49
58
|
export interface SliceReadyResult {
|
|
50
59
|
gates: SliceReadyGates;
|
|
51
60
|
continuationOf: string | null;
|
|
61
|
+
/** GH #260: the doc's `reviewSkipped:` — the status `em slice ratify --skip-review` ratified
|
|
62
|
+
* from when that bypass is what let it through; null otherwise (and when the doc is unusable).
|
|
63
|
+
* Informational, never a gate: a host decides whether an unreviewed ratification passes. */
|
|
64
|
+
reviewSkipped: string | null;
|
|
52
65
|
}
|
|
53
66
|
export declare function computeSliceReadyGates(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, contract: ContractCheckInput): SliceReadyResult | null;
|
|
54
67
|
/** R34 (MIL-268): the full `--slice-ready` verdict for one slice — the ONE computation `em
|
|
@@ -64,4 +77,4 @@ export interface SliceReadiness {
|
|
|
64
77
|
ready: boolean;
|
|
65
78
|
result: SliceReadyResult | null;
|
|
66
79
|
}
|
|
67
|
-
export declare function computeSliceReadiness(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, contract: ContractCheckInput, allDiagnostics: Diagnostic[]): SliceReadiness;
|
|
80
|
+
export declare function computeSliceReadiness(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, contract: ContractCheckInput, allDiagnostics: Diagnostic[], options?: SliceReadyOptions): SliceReadiness;
|
|
@@ -28,7 +28,7 @@ import { resolveSliceKey } from "../model/resolveSlice.js";
|
|
|
28
28
|
import { makeDiag, pushDiag } from "../model/rules.js";
|
|
29
29
|
import { resolveSliceDocJoin } from "./docJoin.js";
|
|
30
30
|
import { readSliceDoc } from "./readSliceDoc.js";
|
|
31
|
-
import {
|
|
31
|
+
import { ratifiedHashScope } from "./sliceDoc.js";
|
|
32
32
|
import { findStructuredSectionProblems } from "./sliceSections.js";
|
|
33
33
|
import { contractStatus, slicePublicTouching } from "./apiFirst.js";
|
|
34
34
|
/** MIL-238 (briefing R10): the API-first gate's diagnostic for one slice, or null when the slice
|
|
@@ -53,18 +53,7 @@ function resolveSliceMessage(model, refs, sliceKey) {
|
|
|
53
53
|
const r = resolveSliceKey(model, refs, sliceKey);
|
|
54
54
|
return r.ok ? `no slice with export key "${sliceKey}" in this model` : r.message;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
* Readiness gate for one slice, named by its export key (`refs.sliceKeys`). `baseDir` is the
|
|
58
|
-
* `.em` file's directory, same convention every other doc/note path in em uses. Always warning-
|
|
59
|
-
* severity (fits validate's existing warning-producer shape) except for a bad `sliceKey` itself,
|
|
60
|
-
* which is an error — a CLI-argument mistake, not a model-quality finding. The `--slice-ready`
|
|
61
|
-
* flag in src/cli.ts is what decides whether these warnings gate the exit code.
|
|
62
|
-
*
|
|
63
|
-
* MIL-238: `contract` (the `.em` path as given, its source and compile diagnostics) feeds the
|
|
64
|
-
* API-first gate — a public-touching slice whose model contract is missing or stale gets a
|
|
65
|
-
* `slice-ready-contract-stale` error on every path past the unknown-key check.
|
|
66
|
-
*/
|
|
67
|
-
export function validateSliceReady(model, refs, baseDir, sliceKey, contract) {
|
|
56
|
+
export function validateSliceReady(model, refs, baseDir, sliceKey, contract, options = {}) {
|
|
68
57
|
const sliceIndex = refs.sliceKeys.indexOf(sliceKey);
|
|
69
58
|
if (sliceIndex === -1) {
|
|
70
59
|
return [
|
|
@@ -125,14 +114,25 @@ export function validateSliceReady(model, refs, baseDir, sliceKey, contract) {
|
|
|
125
114
|
// MIL-284: the ratified body has an identity now. A doc whose body moved after `em slice
|
|
126
115
|
// ratify` recorded `ratifiedHash:` is not the spec that was signed — the ratification stands
|
|
127
116
|
// on content that is gone. Only checked when a hash exists (a doc ratified before em 1.15 has
|
|
128
|
-
// none and is judged on `ratifiedBy` alone, as before) and only at ready-to-implement.
|
|
129
|
-
|
|
117
|
+
// none and is judged on `ratifiedBy` alone, as before) and only at ready-to-implement. A hash
|
|
118
|
+
// in the pre-1.17 whole-body scope still passes (GH #253: `legacy` is intact, not edited).
|
|
119
|
+
if (doc.status === "ready-to-implement" && doc.ratifiedHash !== null && ratifiedHashScope(parsed.raw, doc.ratifiedHash) === "mismatch") {
|
|
130
120
|
pushDiag(diags, "slice-ready-body-changed-since-ratification", {
|
|
131
121
|
message: `slice "${sliceKey}"'s doc ${doc.path} was edited after ratification (body no longer matches ratifiedHash) — revert, or re-ratify the new content`,
|
|
132
122
|
line: slice.line,
|
|
133
123
|
refs: [sliceKey],
|
|
134
124
|
});
|
|
135
125
|
}
|
|
126
|
+
// GH #256: strict mode — the body-changed check above can only run when a hash exists, so
|
|
127
|
+
// without this a `ready-to-implement` doc whose frontmatter was hand-edited to carry
|
|
128
|
+
// `ratifiedBy`/`ratifiedOn` and no `ratifiedHash` passes with no integrity check at all.
|
|
129
|
+
if (options.requireRatifiedHash && doc.status === "ready-to-implement" && doc.ratifiedHash === null) {
|
|
130
|
+
pushDiag(diags, "slice-ready-missing-ratified-hash", {
|
|
131
|
+
message: `slice "${sliceKey}"'s doc ${doc.path} is ready-to-implement with no ratifiedHash — --require-ratified-hash is on: re-ratify it (\`em slice revise --withdraw\`, review, \`em slice ratify --by\`) so the signed body has an identity`,
|
|
132
|
+
line: slice.line,
|
|
133
|
+
refs: [sliceKey],
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
136
|
if (parsed.openQuestionsUnchecked > 0) {
|
|
137
137
|
pushDiag(diags, "slice-ready-open-questions-unchecked", {
|
|
138
138
|
message: `slice "${sliceKey}" has ${parsed.openQuestionsUnchecked} of ${parsed.openQuestionsTotal} Open Question(s) unchecked`,
|
|
@@ -164,7 +164,7 @@ export function computeSliceReadyGates(model, refs, baseDir, sliceKey, contract)
|
|
|
164
164
|
const docBound = doc.reason !== "no-doc-bound";
|
|
165
165
|
const frontmatterUsable = doc.reason === null;
|
|
166
166
|
if (!frontmatterUsable) {
|
|
167
|
-
return { gates: { docBound, frontmatterUsable, statusReady: false, noUncheckedOpenQuestions: false, ratified: false, contractCurrent }, continuationOf };
|
|
167
|
+
return { gates: { docBound, frontmatterUsable, statusReady: false, noUncheckedOpenQuestions: false, ratified: false, contractCurrent }, continuationOf, reviewSkipped: null };
|
|
168
168
|
}
|
|
169
169
|
const statusReady = doc.status === "ready-to-implement";
|
|
170
170
|
// Same re-derivation of the bound key from doc.path as validateSliceReady above — see its
|
|
@@ -173,10 +173,10 @@ export function computeSliceReadyGates(model, refs, baseDir, sliceKey, contract)
|
|
|
173
173
|
const parsed = readSliceDoc(baseDir, boundKey);
|
|
174
174
|
const noUncheckedOpenQuestions = parsed.openQuestionsUnchecked === 0;
|
|
175
175
|
const ratified = !!doc.ratifiedBy;
|
|
176
|
-
return { gates: { docBound, frontmatterUsable, statusReady, noUncheckedOpenQuestions, ratified, contractCurrent }, continuationOf };
|
|
176
|
+
return { gates: { docBound, frontmatterUsable, statusReady, noUncheckedOpenQuestions, ratified, contractCurrent }, continuationOf, reviewSkipped: doc.reviewSkipped };
|
|
177
177
|
}
|
|
178
|
-
export function computeSliceReadiness(model, refs, baseDir, sliceKey, contract, allDiagnostics) {
|
|
179
|
-
const readyDiagnostics = validateSliceReady(model, refs, baseDir, sliceKey, contract);
|
|
178
|
+
export function computeSliceReadiness(model, refs, baseDir, sliceKey, contract, allDiagnostics, options = {}) {
|
|
179
|
+
const readyDiagnostics = validateSliceReady(model, refs, baseDir, sliceKey, contract, options);
|
|
180
180
|
const combined = [...allDiagnostics, ...readyDiagnostics];
|
|
181
181
|
const scoped = combined.filter((d) => d.refs?.some((r) => r === sliceKey || r.startsWith(`${sliceKey}/`)));
|
|
182
182
|
const result = computeSliceReadyGates(model, refs, baseDir, sliceKey, contract);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliceReadyValidate.js","sourceRoot":"","sources":["../../src/catalog/sliceReadyValidate.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,4FAA4F;AAC5F,2FAA2F;AAC3F,0FAA0F;AAC1F,6FAA6F;AAC7F,qBAAqB;AACrB,EAAE;AACF,qFAAqF;AACrF,uFAAuF;AACvF,4FAA4F;AAC5F,8FAA8F;AAC9F,+FAA+F;AAC/F,4FAA4F;AAC5F,8DAA8D;AAC9D,EAAE;AACF,gGAAgG;AAChG,uFAAuF;AACvF,6FAA6F;AAC7F,gGAAgG;AAChG,kGAAkG;AAClG,2DAA2D;AAC3D,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,8FAA8F;AAC9F,kFAAkF;AAIlF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE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iBAAiB,EAAE,WAAW,EAAE,wBAAwB,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa,EAAE,CAAC;AACxK,CAAC;AAgBD,MAAM,UAAU,qBAAqB,CACnC,KAAsB,EACtB,IAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,QAA4B,EAC5B,cAA4B,EAC5B,UAA6B,EAAE;IAE/B,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/F,MAAM,QAAQ,GAAG,CAAC,GAAG,cAAc,EAAE,GAAG,gBAAgB,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3G,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAChF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AACxD,CAAC"}
|
package/dist/cli/defer.d.ts
CHANGED
|
@@ -49,13 +49,31 @@ export declare function reopenDeferred(raw: string, newVersion: number): {
|
|
|
49
49
|
content: string;
|
|
50
50
|
count: number;
|
|
51
51
|
};
|
|
52
|
-
/** True when the doc's body is a signed spec
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
export declare function
|
|
52
|
+
/** True when the doc's body is a signed spec: `status: implemented`, or `status:
|
|
53
|
+
* ready-to-implement` with a `ratifiedBy:`. On such a doc the positional form appends the
|
|
54
|
+
* deferred item instead of requiring an existing `- [ ]` (a ratified doc has none — readiness
|
|
55
|
+
* required that), and the write goes through `finishSignedDocEdit`. A `draft`/`reviewed` doc —
|
|
56
|
+
* including the next version of a shipped slice — is still being written, so defer edits it as
|
|
57
|
+
* ever. */
|
|
58
|
+
export declare function isSignedDoc(raw: string): boolean;
|
|
59
|
+
export type SignedEditResult = {
|
|
60
|
+
ok: true;
|
|
61
|
+
content: string;
|
|
62
|
+
restamped: boolean;
|
|
63
|
+
} | {
|
|
64
|
+
ok: false;
|
|
65
|
+
message: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Pure (GH #253): the last step of any defer that edits a signed doc. `before` is the doc as
|
|
69
|
+
* read, `after` the doc with the deferral written. Refuses when `before` already fails its own
|
|
70
|
+
* `ratifiedHash` (the body moved after sign-off — defer is not the command that papers over
|
|
71
|
+
* that), re-stamps a hash still in the pre-1.17 whole-body scope to the current scope (same
|
|
72
|
+
* body, new normalisation — not a re-signing), and finally checks that `after` matches the
|
|
73
|
+
* recorded hash in the current scope, refusing with nothing written if it does not: the one
|
|
74
|
+
* invariant this whole design rests on is that a deferral never moves the hash.
|
|
75
|
+
*/
|
|
76
|
+
export declare function finishSignedDocEdit(before: string, after: string): SignedEditResult;
|
|
59
77
|
/** Pure (revise / mark-implemented): appends every queued item to `## Open Questions` of the
|
|
60
78
|
* freshly opened draft (creating the section at EOF when the doc has none), skipping a line
|
|
61
79
|
* already present. Returns how many items were written. */
|
|
@@ -116,24 +134,20 @@ export declare function removeIssueClause(raw: string, startLine: number, issueT
|
|
|
116
134
|
* item containing the text already exists (someone wrote it down by hand), that item is deferred
|
|
117
135
|
* in place via `applyDefer` — never a duplicate. Otherwise the `[x]` item is appended to
|
|
118
136
|
* `## Open Questions`, creating the section at EOF when the doc has none (a pre-template doc).
|
|
119
|
-
* An identical item already present → `changed: false`.
|
|
137
|
+
* An identical item already present → `changed: false`. Used by `--from-issue` in every status
|
|
138
|
+
* and by the positional form on a signed doc (GH #253), where there is no `- [ ]` to rewrite.
|
|
120
139
|
*/
|
|
121
|
-
export declare function
|
|
140
|
+
export declare function applyDeferOrAppend(raw: string, issueText: string, input: Omit<DeferInput, "question">): ApplyDeferResult;
|
|
122
141
|
export type RunDeferResult = {
|
|
123
142
|
ok: true;
|
|
124
143
|
path: string;
|
|
125
144
|
changed: boolean;
|
|
126
|
-
|
|
145
|
+
signed: boolean;
|
|
146
|
+
restamped: boolean;
|
|
127
147
|
} | {
|
|
128
148
|
ok: false;
|
|
129
149
|
message: string;
|
|
130
150
|
};
|
|
131
|
-
/** GH #236: set when defer QUEUED the question (a ratified/shipped doc) instead of editing the
|
|
132
|
-
* doc — `forVersion` is the draft that will carry it, `docVersion` the version left untouched. */
|
|
133
|
-
export interface QueuedNote {
|
|
134
|
-
forVersion: number;
|
|
135
|
-
docVersion: number;
|
|
136
|
-
}
|
|
137
151
|
/** Resolves `sliceKey` to its bound doc (same join as ratify/revise), computes both edits, and
|
|
138
152
|
* writes only when every precondition holds (the state file is required and never created). */
|
|
139
153
|
export declare function runDefer(model: NormalizedModel, refs: RefsResult, baseDir: string, sliceKey: string, input: Omit<DeferInput, "currentVersion">): RunDeferResult;
|
|
@@ -143,7 +157,8 @@ export type RunDeferFromIssueResult = {
|
|
|
143
157
|
changed: boolean;
|
|
144
158
|
issue: string;
|
|
145
159
|
modelLine: number | null;
|
|
146
|
-
|
|
160
|
+
signed: boolean;
|
|
161
|
+
restamped: boolean;
|
|
147
162
|
} | {
|
|
148
163
|
ok: false;
|
|
149
164
|
message: string;
|