@milehimikey/em 1.10.0 → 1.12.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 +5 -1
- package/.claude/skills/event-modeling-design/SKILL.md +41 -14
- package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
- package/.claude/skills/event-modeling-implement/SKILL.md +24 -7
- package/.claude/skills/event-modeling-implement/reference/implement.md +227 -19
- package/.claude/skills/event-modeling-review/SKILL.md +14 -3
- package/.claude/skills/event-modeling-shared/reference/em-dsl.md +80 -15
- package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +43 -1
- package/.claude/skills/event-modeling-shared/templates/constitution.md +118 -0
- package/.claude/skills/event-modeling-shared/templates/model-readme.md +2 -2
- package/.claude/skills/event-modeling-shared/templates/slice.md +4 -0
- package/dist/catalog/build.js +42 -1
- package/dist/catalog/build.js.map +1 -1
- package/dist/catalog/coverage.d.ts +15 -0
- package/dist/catalog/coverage.js +34 -0
- package/dist/catalog/coverage.js.map +1 -0
- package/dist/catalog/docJoin.d.ts +19 -2
- package/dist/catalog/docJoin.js +30 -4
- package/dist/catalog/docJoin.js.map +1 -1
- package/dist/catalog/docModelConsistencyValidate.js +1 -1
- package/dist/catalog/docModelConsistencyValidate.js.map +1 -1
- package/dist/catalog/noteBindingValidate.js +18 -0
- package/dist/catalog/noteBindingValidate.js.map +1 -1
- package/dist/catalog/orphanedSliceDocValidate.d.ts +8 -1
- package/dist/catalog/orphanedSliceDocValidate.js +33 -6
- package/dist/catalog/orphanedSliceDocValidate.js.map +1 -1
- package/dist/catalog/pages.d.ts +16 -1
- package/dist/catalog/pages.js +16 -4
- package/dist/catalog/pages.js.map +1 -1
- package/dist/catalog/sliceDoc.d.ts +8 -0
- package/dist/catalog/sliceDoc.js +2 -0
- package/dist/catalog/sliceDoc.js.map +1 -1
- package/dist/catalog/sliceReadyValidate.d.ts +12 -1
- package/dist/catalog/sliceReadyValidate.js +4 -4
- package/dist/catalog/sliceReadyValidate.js.map +1 -1
- package/dist/cli/agentsMd.js +9 -3
- package/dist/cli/agentsMd.js.map +1 -1
- package/dist/cli/ciInit.js +3 -0
- package/dist/cli/ciInit.js.map +1 -1
- package/dist/cli/conformScope.js +10 -3
- package/dist/cli/conformScope.js.map +1 -1
- package/dist/cli/coverage.d.ts +34 -9
- package/dist/cli/coverage.js +61 -24
- package/dist/cli/coverage.js.map +1 -1
- package/dist/cli/ledgerCheck.d.ts +72 -0
- package/dist/cli/ledgerCheck.js +122 -1
- package/dist/cli/ledgerCheck.js.map +1 -1
- package/dist/cli/markImplemented.js +12 -1
- package/dist/cli/markImplemented.js.map +1 -1
- package/dist/cli/ratify.d.ts +37 -5
- package/dist/cli/ratify.js +123 -10
- package/dist/cli/ratify.js.map +1 -1
- package/dist/cli/reratify.js +26 -6
- package/dist/cli/reratify.js.map +1 -1
- package/dist/cli/review.d.ts +38 -0
- package/dist/cli/review.js +171 -0
- package/dist/cli/review.js.map +1 -0
- package/dist/cli/sliceIndex.d.ts +3 -0
- package/dist/cli/sliceIndex.js +14 -8
- package/dist/cli/sliceIndex.js.map +1 -1
- package/dist/cli/sliceLink.js +16 -0
- package/dist/cli/sliceLink.js.map +1 -1
- package/dist/cli/stateFile.d.ts +10 -0
- package/dist/cli/stateFile.js +14 -0
- package/dist/cli/stateFile.js.map +1 -1
- package/dist/cli/status.d.ts +55 -3
- package/dist/cli/status.js +92 -19
- package/dist/cli/status.js.map +1 -1
- package/dist/cli.js +203 -47
- package/dist/cli.js.map +1 -1
- package/dist/emit/coverageJson.d.ts +2 -2
- package/dist/emit/coverageJson.js +6 -2
- package/dist/emit/coverageJson.js.map +1 -1
- package/dist/emit/freshnessJson.d.ts +1 -1
- package/dist/emit/freshnessJson.js +5 -1
- package/dist/emit/freshnessJson.js.map +1 -1
- package/dist/emit/json.d.ts +45 -1
- package/dist/emit/json.js +82 -3
- 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/queryJson.d.ts +1 -1
- package/dist/emit/queryJson.js +5 -1
- package/dist/emit/queryJson.js.map +1 -1
- package/dist/emit/statusJson.d.ts +1 -1
- package/dist/emit/statusJson.js +10 -1
- package/dist/emit/statusJson.js.map +1 -1
- package/dist/emit/validateJson.d.ts +4 -3
- package/dist/emit/validateJson.js +10 -3
- package/dist/emit/validateJson.js.map +1 -1
- package/dist/mcp/server.js +47 -22
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/continuation.d.ts +23 -0
- package/dist/model/continuation.js +49 -0
- package/dist/model/continuation.js.map +1 -0
- package/dist/model/edges.d.ts +18 -3
- package/dist/model/edges.js +34 -0
- package/dist/model/edges.js.map +1 -1
- package/dist/model/model.d.ts +4 -0
- package/dist/model/model.js +1 -0
- package/dist/model/model.js.map +1 -1
- package/dist/model/queryIndex.d.ts +5 -2
- package/dist/model/queryIndex.js +5 -2
- package/dist/model/queryIndex.js.map +1 -1
- package/dist/model/rules.d.ts +25 -0
- package/dist/model/rules.js +25 -0
- package/dist/model/rules.js.map +1 -1
- package/dist/model/sliceDocIndex.d.ts +12 -5
- package/dist/model/sliceDocIndex.js +18 -7
- package/dist/model/sliceDocIndex.js.map +1 -1
- package/dist/model/validate.js +82 -1
- package/dist/model/validate.js.map +1 -1
- package/dist/parser/ast.d.ts +21 -0
- package/dist/parser/parser.js +96 -32
- package/dist/parser/parser.js.map +1 -1
- package/dist/render/drawEdges.js +7 -0
- package/dist/render/drawEdges.js.map +1 -1
- package/dist/render/drawNotes.d.ts +13 -3
- package/dist/render/drawNotes.js +96 -20
- package/dist/render/drawNotes.js.map +1 -1
- package/dist/render/render.js +6 -5
- package/dist/render/render.js.map +1 -1
- package/dist/render/sliceStatus.d.ts +3 -3
- package/dist/render/sliceStatus.js +27 -29
- package/dist/render/sliceStatus.js.map +1 -1
- package/dist/templates.d.ts +14 -1
- package/dist/templates.js +141 -5
- package/dist/templates.js.map +1 -1
- package/dist/util/localDate.d.ts +2 -0
- package/dist/util/localDate.js +17 -0
- package/dist/util/localDate.js.map +1 -0
- package/package.json +1 -1
package/dist/cli/agentsMd.js
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
// slice-readiness gate (`em validate --slice-ready --json`, MIL-128), and the machine-readable
|
|
7
7
|
// read path (`em export --slice`, MIL-128). MIL-21 adds a fourth pointer: `em-mcp`, the MCP
|
|
8
8
|
// server exposing the same contract/gate/read-path (plus full validate/export) as tools for an
|
|
9
|
-
// MCP-native agent, instead of shell commands.
|
|
9
|
+
// MCP-native agent, instead of shell commands. MIL-152 (a later skill-free G5 run) adds two more:
|
|
10
|
+
// how to list a model's slice keys at all (nothing in this chain said so before — the agent had
|
|
11
|
+
// to fall back to a full `em export`), and the MCP handshake doc's URL, since `docs/mcp.md`
|
|
12
|
+
// itself isn't vendored into the installed skill bundle a repo-local agent actually has on disk.
|
|
10
13
|
//
|
|
11
14
|
// Same marker discipline as `em slice index`'s README Slices table (src/cli/sliceIndex.ts,
|
|
12
15
|
// MIL-98): idempotent replace-between-markers via src/util/markers.ts, user content outside the
|
|
@@ -38,8 +41,11 @@ agent — Claude Code or otherwise — should follow this contract:
|
|
|
38
41
|
- **Read path**: \`em export <model>.em --slice <slice-key>\` exports just that slice's
|
|
39
42
|
normalized JSON (pattern, fields, doc) to implement against; \`em export <model>.em\` exports
|
|
40
43
|
the whole model.
|
|
41
|
-
- **
|
|
42
|
-
|
|
44
|
+
- **Slice keys**: \`em export <model>.em | jq -r '.model.slices[].key'\` lists every slice's
|
|
45
|
+
export key (the \`<slice-key>\` the gate and read path above take) without reading the DSL.
|
|
46
|
+
- **MCP alternative**: \`em-mcp\` starts a stateless stdio MCP server exposing the contract,
|
|
47
|
+
gate, and read path above (plus full validate/export) as tools instead of shell commands —
|
|
48
|
+
every tool mirrors a CLI \`--json\` surface byte-for-byte. Handshake and full tool list:
|
|
43
49
|
[docs/mcp.md](https://github.com/milehimikey/em/blob/main/docs/mcp.md).`;
|
|
44
50
|
function markerBlock() {
|
|
45
51
|
return `<!-- GENERATED:${AGENTS_MD_MARKER}:start -->\n${SECTION_BODY}\n<!-- GENERATED:${AGENTS_MD_MARKER}:end -->`;
|
package/dist/cli/agentsMd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentsMd.js","sourceRoot":"","sources":["../../src/cli/agentsMd.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,yFAAyF;AACzF,2FAA2F;AAC3F,gGAAgG;AAChG,uFAAuF;AACvF,+FAA+F;AAC/F,4FAA4F;AAC5F,+FAA+F;AAC/F
|
|
1
|
+
{"version":3,"file":"agentsMd.js","sourceRoot":"","sources":["../../src/cli/agentsMd.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,yFAAyF;AACzF,2FAA2F;AAC3F,gGAAgG;AAChG,uFAAuF;AACvF,+FAA+F;AAC/F,4FAA4F;AAC5F,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,4FAA4F;AAC5F,iGAAiG;AACjG,EAAE;AACF,2FAA2F;AAC3F,gGAAgG;AAChG,6FAA6F;AAC7F,8FAA8F;AAC9F,+FAA+F;AAC/F,4FAA4F;AAC5F,8FAA8F;AAC9F,6FAA6F;AAC7F,sDAAsD;AAEtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;+CAC+C;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEjD,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;0EAoBqD,CAAC;AAE3E,SAAS,WAAW;IAClB,OAAO,kBA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,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC/C,CAAC"}
|
package/dist/cli/ciInit.js
CHANGED
|
@@ -107,6 +107,9 @@ export function ciManagedBody(model, testsDir, emVersion) {
|
|
|
107
107
|
with:
|
|
108
108
|
node-version: 20
|
|
109
109
|
- name: Check invariant test coverage
|
|
110
|
+
# Counts INV-* IDs in \`implemented\` slice docs only (MIL-207) — a ready-to-implement
|
|
111
|
+
# doc has nothing yet to cite it, so this job is green on a fresh scaffold and on a
|
|
112
|
+
# doc-only ratification PR. Pass --include-ready for the older, forward-looking report.
|
|
110
113
|
run: ${em} coverage "${model}" --tests "${testsDir}" --strict
|
|
111
114
|
|
|
112
115
|
ledger:
|
package/dist/cli/ciInit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ciInit.js","sourceRoot":"","sources":["../../src/cli/ciInit.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,wFAAwF;AACxF,2FAA2F;AAC3F,4FAA4F;AAC5F,yFAAyF;AACzF,2EAA2E;AAC3E,EAAE;AACF,0FAA0F;AAC1F,yFAAyF;AACzF,uFAAuF;AACvF,6FAA6F;AAC7F,2EAA2E;AAC3E,4FAA4F;AAC5F,6FAA6F;AAC7F,2FAA2F;AAC3F,cAAc;AACd,8FAA8F;AAC9F,6FAA6F;AAC7F,sEAAsE;AACtE,EAAE;AACF,0FAA0F;AAC1F,gGAAgG;AAChG,6FAA6F;AAC7F,6FAA6F;AAC7F,4DAA4D;AAE5D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAC1C,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,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QAC3F,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
package/dist/cli/conformScope.js
CHANGED
|
@@ -82,11 +82,18 @@ export function buildConformScope(slices, lastConformance, changedPaths, full) {
|
|
|
82
82
|
* `em slice index` does. */
|
|
83
83
|
export function resolveSliceDocFacts(model, refs, baseDir) {
|
|
84
84
|
const diagnostics = [];
|
|
85
|
-
const facts =
|
|
85
|
+
const facts = [];
|
|
86
|
+
model.slices.forEach((slice, i) => {
|
|
86
87
|
const key = refs.sliceKeys[i];
|
|
87
|
-
const { doc, diagnostics: docDiags } = resolveSliceDocJoin(slice, key, baseDir, (id) => refs.refById.get(id));
|
|
88
|
+
const { doc, diagnostics: docDiags, continuationOf: continuationOfKey } = resolveSliceDocJoin(model, refs, slice, key, baseDir, (id) => refs.refById.get(id));
|
|
88
89
|
diagnostics.push(...docDiags);
|
|
89
|
-
|
|
90
|
+
// MIL-208: a continuation slice carries the SAME status/implementedIn as the originating
|
|
91
|
+
// slice (identical doc join) — including it here would list the same PR as a candidate
|
|
92
|
+
// under two different keys for one actual change. The originating slice's own fact already
|
|
93
|
+
// covers it.
|
|
94
|
+
if (continuationOfKey !== null)
|
|
95
|
+
return;
|
|
96
|
+
facts.push({ key, status: doc.status, implementedIn: doc.implementedIn });
|
|
90
97
|
});
|
|
91
98
|
return { facts, diagnostics };
|
|
92
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conformScope.js","sourceRoot":"","sources":["../../src/cli/conformScope.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,8FAA8F;AAC9F,6FAA6F;AAC7F,0CAA0C;AAC1C,EAAE;AACF,4EAA4E;AAC5E,+FAA+F;AAC/F,6C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AAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,sBAAsB,CAAC,CAAC;QACrF,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjE,aAAa,CAAC,aAAa,EAAE,GAAG,IAAI,GAAG,GAAG,GAAG,sBAAsB,IAAI,CAAC,CAAC;YACzE,gBAAgB,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,aAAa,EAAE,GAAG,sBAAsB,IAAI,CAAC,CAAC;QAC5D,gBAAgB,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/cli/coverage.d.ts
CHANGED
|
@@ -53,8 +53,9 @@ export interface SliceCoverage {
|
|
|
53
53
|
* has `docReason: null`). Lets an out-of-scope reader tell "nothing bound yet" apart from
|
|
54
54
|
* "bound but broken" without re-running the join themselves. */
|
|
55
55
|
docReason: string | null;
|
|
56
|
-
/** True when this slice's doc was found, its frontmatter usable, and `status` is
|
|
57
|
-
* `
|
|
56
|
+
/** True when this slice's doc was found, its frontmatter usable, and `status` is in scope —
|
|
57
|
+
* `implemented` by default, plus `ready-to-implement` with `--include-ready` (MIL-207). The
|
|
58
|
+
* only slices `invariants` is populated for. */
|
|
58
59
|
inScope: boolean;
|
|
59
60
|
invariants: InvariantCoverage[];
|
|
60
61
|
}
|
|
@@ -65,12 +66,36 @@ export interface CoverageReport {
|
|
|
65
66
|
/** Of `totalInvariants`, how many have zero citations. */
|
|
66
67
|
uncoveredCount: number;
|
|
67
68
|
}
|
|
69
|
+
/** One slice's doc-join outcome, cheap to resolve (no test-tree scan) — the bit every
|
|
70
|
+
* `--tests <dir>` consumer needs to answer "is there anything in scope at all?" before it
|
|
71
|
+
* decides whether a missing test directory is an error (MIL-207: with zero in-scope docs
|
|
72
|
+
* there's nothing to cite, so a fresh scaffold's absent `test/` isn't a defect). */
|
|
73
|
+
export interface ScopedSlice {
|
|
74
|
+
key: string;
|
|
75
|
+
status: string | null;
|
|
76
|
+
docReason: string | null;
|
|
77
|
+
inScope: boolean;
|
|
78
|
+
/** The bound doc's path (`SliceDocExport.path`) — present even when out of scope or unbound,
|
|
79
|
+
* same convention as `SliceCoverage.status`/`docReason` above. */
|
|
80
|
+
docPath: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Resolve every slice's doc-join and in-scope status, without touching the test tree. Shared by
|
|
84
|
+
* `buildCoverageReport` (below) and every `--tests` consumer that needs to know, before checking
|
|
85
|
+
* whether `--tests <dir>` exists, whether anything is in scope — so "is there anything to check"
|
|
86
|
+
* has exactly one answer everywhere it's asked (MIL-207: don't fork the leniency logic per
|
|
87
|
+
* consumer). `includeReady` selects `IN_SCOPE_STATUSES_WITH_READY` over the MIL-207 default.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveScopedSlices(model: NormalizedModel, refs: RefsResult, baseDir: string, includeReady: boolean): ScopedSlice[];
|
|
68
90
|
/**
|
|
69
|
-
* Assemble the full coverage report: for every slice in the model, resolve its doc
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
91
|
+
* Assemble the full coverage report: for every slice in the model, resolve its doc-join/in-scope
|
|
92
|
+
* status (`resolveScopedSlices`), extract invariant IDs for in-scope slices, then scan `testsDir`
|
|
93
|
+
* once for every ID across the whole model (cheaper than one scan per slice, and citations are
|
|
94
|
+
* looked up per-slice from the single resulting map). `baseDir` is the `.em` file's directory,
|
|
95
|
+
* same convention every doc/note path in `em` uses. `includeReady` (MIL-207, default false)
|
|
96
|
+
* widens scope to also count `ready-to-implement` docs — when false (the default) and nothing in
|
|
97
|
+
* the model is `implemented` yet, `allIds` stays empty and `testsDir` is never read, so calling
|
|
98
|
+
* this with a `testsDir` that doesn't exist yet is safe in that case (see callers' leniency
|
|
99
|
+
* check via `resolveScopedSlices` before this).
|
|
75
100
|
*/
|
|
76
|
-
export declare function buildCoverageReport(model: NormalizedModel, refs: RefsResult, baseDir: string, testsDir: string): CoverageReport;
|
|
101
|
+
export declare function buildCoverageReport(model: NormalizedModel, refs: RefsResult, baseDir: string, testsDir: string, includeReady?: boolean): CoverageReport;
|
package/dist/cli/coverage.js
CHANGED
|
@@ -62,11 +62,25 @@ const OWNERSHIP_HEADING_RE = /^##\s+(?:Invariants(?:\s*\/\s*Business Rules)?|Del
|
|
|
62
62
|
* for HTML-render readability — that sub-bullet is indented, so it's already excluded here the
|
|
63
63
|
* same as any other continuation line, and never contributes (or steals) an ID. */
|
|
64
64
|
const STRUCTURAL_LINE_RE = /^(?:[-*]\s|#{3,6}\s)/;
|
|
65
|
-
/** Statuses `reference/implement.md`'s coverage gate applies to
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
|
|
65
|
+
/** Statuses `reference/implement.md`'s coverage gate applies to, by default (MIL-207). Doc
|
|
66
|
+
* ratification (`draft` -> `reviewed` -> `ready-to-implement`) is the hand-off *before*
|
|
67
|
+
* implementation, not a claim that implementing code exists yet — a `ready-to-implement` doc
|
|
68
|
+
* has, by definition, nothing to cite its invariants, so scoping the gate to it made every
|
|
69
|
+
* ratification PR fail coverage before a line of implementing code (or its test) existed
|
|
70
|
+
* (`em ci init`'s generated job, gating every PR on `main`). Scope starts at `implemented` and
|
|
71
|
+
* stays in scope forever after (tests shouldn't regress away from citing an invariant just
|
|
72
|
+
* because the slice shipped). Anything else (`draft`, `reviewed`, or no doc at all) is out of
|
|
73
|
+
* scope. */
|
|
74
|
+
const IN_SCOPE_STATUSES_DEFAULT = new Set(["implemented"]);
|
|
75
|
+
/** `--include-ready` (CLI `em coverage`; `includeReady` on the MCP `coverage` tool's input)
|
|
76
|
+
* opts back into the pre-MIL-207 scope — `ready-to-implement` docs included — for a team that
|
|
77
|
+
* wants the forward-looking report: which invariants will need a citing test once
|
|
78
|
+
* implementation starts. Never the default, since that's exactly the every-ratification-PR-
|
|
79
|
+
* is-red behavior MIL-207 fixes. */
|
|
80
|
+
const IN_SCOPE_STATUSES_WITH_READY = new Set(["ready-to-implement", "implemented"]);
|
|
81
|
+
function inScopeStatuses(includeReady) {
|
|
82
|
+
return includeReady ? IN_SCOPE_STATUSES_WITH_READY : IN_SCOPE_STATUSES_DEFAULT;
|
|
83
|
+
}
|
|
70
84
|
/**
|
|
71
85
|
* Extract every distinct `INV-*` token this slice doc *defines*, in first-occurrence order (a
|
|
72
86
|
* rule stated once in `## Invariants` and re-declared in a later `## Delta` section dedupes to
|
|
@@ -155,39 +169,62 @@ export function scanTestCitations(testsDir, ids) {
|
|
|
155
169
|
return citations;
|
|
156
170
|
}
|
|
157
171
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* path in `em` uses.
|
|
172
|
+
* Resolve every slice's doc-join and in-scope status, without touching the test tree. Shared by
|
|
173
|
+
* `buildCoverageReport` (below) and every `--tests` consumer that needs to know, before checking
|
|
174
|
+
* whether `--tests <dir>` exists, whether anything is in scope — so "is there anything to check"
|
|
175
|
+
* has exactly one answer everywhere it's asked (MIL-207: don't fork the leniency logic per
|
|
176
|
+
* consumer). `includeReady` selects `IN_SCOPE_STATUSES_WITH_READY` over the MIL-207 default.
|
|
164
177
|
*/
|
|
165
|
-
export function
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
const slice = model.slices[i];
|
|
178
|
+
export function resolveScopedSlices(model, refs, baseDir, includeReady) {
|
|
179
|
+
const scopeStatuses = inScopeStatuses(includeReady);
|
|
180
|
+
const result = [];
|
|
181
|
+
model.slices.forEach((slice, i) => {
|
|
170
182
|
const key = refs.sliceKeys[i];
|
|
171
|
-
const { doc } = resolveSliceDocJoin(slice, key, baseDir, (id) => refs.refById.get(id));
|
|
172
|
-
|
|
183
|
+
const { doc, continuationOf: continuationOfKey } = resolveSliceDocJoin(model, refs, slice, key, baseDir, (id) => refs.refById.get(id));
|
|
184
|
+
// MIL-208: a continuation slice (an again-view-only slice with no legacy doc of its own)
|
|
185
|
+
// has nothing of its own to cite — its invariants, if any, live in the ORIGINATING slice's
|
|
186
|
+
// doc, which already gets its own entry here. Including the continuation key too would just
|
|
187
|
+
// duplicate that entry under a second key.
|
|
188
|
+
if (continuationOfKey !== null)
|
|
189
|
+
return;
|
|
190
|
+
const inScope = doc.reason === null && doc.status !== null && scopeStatuses.has(doc.status);
|
|
191
|
+
result.push({ key, status: doc.status, docReason: doc.reason, inScope, docPath: doc.path });
|
|
192
|
+
});
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Assemble the full coverage report: for every slice in the model, resolve its doc-join/in-scope
|
|
197
|
+
* status (`resolveScopedSlices`), extract invariant IDs for in-scope slices, then scan `testsDir`
|
|
198
|
+
* once for every ID across the whole model (cheaper than one scan per slice, and citations are
|
|
199
|
+
* looked up per-slice from the single resulting map). `baseDir` is the `.em` file's directory,
|
|
200
|
+
* same convention every doc/note path in `em` uses. `includeReady` (MIL-207, default false)
|
|
201
|
+
* widens scope to also count `ready-to-implement` docs — when false (the default) and nothing in
|
|
202
|
+
* the model is `implemented` yet, `allIds` stays empty and `testsDir` is never read, so calling
|
|
203
|
+
* this with a `testsDir` that doesn't exist yet is safe in that case (see callers' leniency
|
|
204
|
+
* check via `resolveScopedSlices` before this).
|
|
205
|
+
*/
|
|
206
|
+
export function buildCoverageReport(model, refs, baseDir, testsDir, includeReady = false) {
|
|
207
|
+
const scoped = resolveScopedSlices(model, refs, baseDir, includeReady);
|
|
208
|
+
const allIds = new Set();
|
|
209
|
+
const withIds = scoped.map(({ key, status, docReason, inScope, docPath }) => {
|
|
173
210
|
let ids = [];
|
|
174
211
|
if (inScope) {
|
|
175
|
-
// Re-derive the bound doc's key from
|
|
176
|
-
// — MIL-121's ratified cross-binding can resolve
|
|
212
|
+
// Re-derive the bound doc's key from docPath rather than assuming it's this slice's own
|
|
213
|
+
// — MIL-121's ratified cross-binding can resolve the doc to a DIFFERENT slice's doc, same
|
|
177
214
|
// re-derivation sliceReadyValidate.ts uses for Open Questions.
|
|
178
|
-
const boundKey =
|
|
215
|
+
const boundKey = docPath.replace(/^slices\//, "").replace(/\.md$/, "");
|
|
179
216
|
const parsed = readSliceDoc(baseDir, boundKey);
|
|
180
217
|
if (parsed)
|
|
181
218
|
ids = extractInvariantIds(parsed.body);
|
|
182
219
|
}
|
|
183
|
-
scoped.push({ key, status: doc.status, docReason: doc.reason, inScope, ids });
|
|
184
220
|
for (const id of ids)
|
|
185
221
|
allIds.add(id);
|
|
186
|
-
|
|
222
|
+
return { key, status, docReason, inScope, ids };
|
|
223
|
+
});
|
|
187
224
|
const citations = scanTestCitations(testsDir, [...allIds]);
|
|
188
225
|
let totalInvariants = 0;
|
|
189
226
|
let uncoveredCount = 0;
|
|
190
|
-
const slices =
|
|
227
|
+
const slices = withIds.map(({ key, status, docReason, inScope, ids }) => {
|
|
191
228
|
const invariants = ids.map((id) => {
|
|
192
229
|
const cs = citations.get(id) ?? [];
|
|
193
230
|
totalInvariants++;
|
package/dist/cli/coverage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/cli/coverage.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,8FAA8F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AAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;YACnC,eAAe,EAAE,CAAC;YAClB,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;gBAAE,cAAc,EAAE,CAAC;YACtC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -14,8 +14,41 @@ export interface LedgerSkip {
|
|
|
14
14
|
sliceKey: string;
|
|
15
15
|
reason: LedgerSkipReason;
|
|
16
16
|
}
|
|
17
|
+
/** Where a waiver of a `ledger-content-without-version-bump` finding came from (MIL-185): the
|
|
18
|
+
* repeatable `--waive <slice-key>` flag on a manual run, or an `Em-Ledger-Waive: <slice-key>`
|
|
19
|
+
* git trailer found on a commit in the checked range during a CI run. The trailer variant
|
|
20
|
+
* carries the exact commit that declared it — see `readLedgerWaiverTrailers` — so the waiver
|
|
21
|
+
* is auditable back to a specific, reviewed change, not just an unattributed flag.
|
|
22
|
+
*/
|
|
23
|
+
export type LedgerWaiveSource = {
|
|
24
|
+
source: "flag";
|
|
25
|
+
} | {
|
|
26
|
+
source: "trailer";
|
|
27
|
+
commit: string;
|
|
28
|
+
};
|
|
29
|
+
/** A `ledger-content-without-version-bump` finding that was excused rather than silenced —
|
|
30
|
+
* still fully reported (text output prints a `waived:` line, JSON lists it under `waived`),
|
|
31
|
+
* just not counted toward the exit code. Only this one finding code is ever waivable: a
|
|
32
|
+
* version regression or a bump-without-content-change is never a "formatting-only" false
|
|
33
|
+
* positive, so waiving either would hide a real defect (docs/cli.md, docs/ci.md). */
|
|
34
|
+
export interface WaivedLedgerFinding extends LedgerFinding {
|
|
35
|
+
waivedBy: LedgerWaiveSource;
|
|
36
|
+
}
|
|
37
|
+
/** A waiver (flag or trailer) that named a slice key with no matching waivable finding — either
|
|
38
|
+
* a typo, a key for a slice with a different (non-waivable) finding, or a slice that's already
|
|
39
|
+
* clean. Not an error: the waiver is simply inert, but silently swallowing it would hide a
|
|
40
|
+
* typo'd `--waive`/trailer from the operator, so it's surfaced as a note (stderr in the CLI,
|
|
41
|
+
* never folded into `findings`/`waived`). */
|
|
42
|
+
export interface UnknownLedgerWaiver {
|
|
43
|
+
sliceKey: string;
|
|
44
|
+
source: LedgerWaiveSource;
|
|
45
|
+
}
|
|
17
46
|
export interface LedgerCheckResult {
|
|
18
47
|
findings: LedgerFinding[];
|
|
48
|
+
/** Findings excused by a waiver (MIL-185) — see `WaivedLedgerFinding`. Always present (`[]`
|
|
49
|
+
* when no waiver applied), so a caller comparing runs before/after MIL-185 sees only this one
|
|
50
|
+
* additive field, never a shape change to `findings`/`skipped`/`checkedCount`. */
|
|
51
|
+
waived: WaivedLedgerFinding[];
|
|
19
52
|
skipped: LedgerSkip[];
|
|
20
53
|
/** Total slice keys considered (the union of both revisions' `slices/*.md` — every key that
|
|
21
54
|
* produced either a finding, a skip, or a clean pass). Lets a caller report "N checked"
|
|
@@ -36,3 +69,42 @@ export interface LedgerCheckResult {
|
|
|
36
69
|
* risking a false negative on a real prose edit.
|
|
37
70
|
*/
|
|
38
71
|
export declare function checkLedger(anchorFile: string, from: string, to: string | null, runGit?: GitRunner): LedgerCheckResult;
|
|
72
|
+
/** One `Em-Ledger-Waive: <slice-key>` trailer found on a commit in the checked range, paired
|
|
73
|
+
* with the commit that declared it. */
|
|
74
|
+
export interface LedgerTrailerWaiver {
|
|
75
|
+
sliceKey: string;
|
|
76
|
+
commit: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `Em-Ledger-Waive: <slice-key>` trailers on every commit in `from..to` (`to` null means `HEAD`
|
|
80
|
+
* — an uncommitted working-tree change has no commit to carry a trailer, so it can only be
|
|
81
|
+
* waived via `--waive`; see docs/cli.md). Reads the range oldest-first (`--reverse`) so a slice
|
|
82
|
+
* key repeated across several commits attributes to the **first** (earliest) commit that
|
|
83
|
+
* actually declared the waiver, not the most recent — deterministic for a given repo state, and
|
|
84
|
+
* the answer an auditor wants ("who introduced this waiver").
|
|
85
|
+
*
|
|
86
|
+
* Uses `%(trailers:key=Em-Ledger-Waive,valueonly)` (git's own trailer parser — requires the
|
|
87
|
+
* standard blank-line-separated footer block, same convention `git interpret-trailers` expects)
|
|
88
|
+
* rather than regexing commit messages by hand. A range that fails to resolve (unknown
|
|
89
|
+
* revision, `anchorFile` not in a repo) returns `[]` — routine, matching every other
|
|
90
|
+
* `diff-inputs.ts` git call's "missing is not a crash" stance; `checkLedger`'s own calls against
|
|
91
|
+
* the same revisions already surface a real problem with `--from`/`--to` if there is one.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readLedgerWaiverTrailers(anchorFile: string, from: string, to: string | null, runGit?: GitRunner): LedgerTrailerWaiver[];
|
|
94
|
+
/**
|
|
95
|
+
* Split a `checkLedger` result's findings into still-active and waived (MIL-185, R9), given the
|
|
96
|
+
* flag-provided slice keys (repeatable `--waive <slice-key>`) and the trailer waivers read from
|
|
97
|
+
* the commit range (`readLedgerWaiverTrailers`). Pure — no git access, so flag-only and
|
|
98
|
+
* trailer-only waiver logic is testable without faking a git runner.
|
|
99
|
+
*
|
|
100
|
+
* Only a `ledger-content-without-version-bump` finding is ever waivable (`WAIVABLE_LEDGER_CODE`)
|
|
101
|
+
* — a version regression or a bump-without-content-change stays a hard finding regardless of any
|
|
102
|
+
* waiver naming that slice key. A flag waiver takes precedence over a same-key trailer waiver
|
|
103
|
+
* (both excuse the same finding; the flag is the more explicit, in-hand instruction). A waiver
|
|
104
|
+
* that names a slice key with no matching waivable finding is reported via `unknownWaivers`
|
|
105
|
+
* rather than silently dropped — see `UnknownLedgerWaiver`.
|
|
106
|
+
*/
|
|
107
|
+
export declare function applyLedgerWaivers(result: LedgerCheckResult, flagWaivedKeys: string[], trailerWaivers: LedgerTrailerWaiver[]): {
|
|
108
|
+
result: LedgerCheckResult;
|
|
109
|
+
unknownWaivers: UnknownLedgerWaiver[];
|
|
110
|
+
};
|
package/dist/cli/ledgerCheck.js
CHANGED
|
@@ -111,6 +111,127 @@ export function checkLedger(anchorFile, from, to, runGit = realGit) {
|
|
|
111
111
|
: `slice "${sliceKey}": version: bumped (v${oldVersion} -> v${newVersion}) but doc content is unchanged`;
|
|
112
112
|
findings.push({ sliceKey, code, message, oldVersion, newVersion, bodyChanged, lineageChanged: docsLineageChanged });
|
|
113
113
|
}
|
|
114
|
-
return { findings, skipped, checkedCount: keys.length };
|
|
114
|
+
return { findings, waived: [], skipped, checkedCount: keys.length };
|
|
115
|
+
}
|
|
116
|
+
/** The only finding code a waiver may excuse (MIL-185, R9) — see `WaivedLedgerFinding`. */
|
|
117
|
+
const WAIVABLE_LEDGER_CODE = "ledger-content-without-version-bump";
|
|
118
|
+
// `%x00`/`%x01` are git's own pretty-format escapes for those literal bytes — git substitutes
|
|
119
|
+
// them into its OUTPUT, so the argv string handed to spawnSync stays plain ASCII text (an actual
|
|
120
|
+
// embedded NUL byte in an argv string throws in Node's child_process). The output bytes they
|
|
121
|
+
// produce are never valid in a commit hash or trailer value, so they're safe as delimiters when
|
|
122
|
+
// *parsing* `log.stdout` below — same technique as `changelog-git.ts`'s `FS` separator, one step
|
|
123
|
+
// removed because these two also need to round-trip through a `--format` argument first.
|
|
124
|
+
const FORMAT_HASH_SEP = "%x00";
|
|
125
|
+
const FORMAT_RECORD_END = "%x01";
|
|
126
|
+
const HASH_SEP = "\x00";
|
|
127
|
+
const RECORD_END = "\x01";
|
|
128
|
+
/**
|
|
129
|
+
* `Em-Ledger-Waive: <slice-key>` trailers on every commit in `from..to` (`to` null means `HEAD`
|
|
130
|
+
* — an uncommitted working-tree change has no commit to carry a trailer, so it can only be
|
|
131
|
+
* waived via `--waive`; see docs/cli.md). Reads the range oldest-first (`--reverse`) so a slice
|
|
132
|
+
* key repeated across several commits attributes to the **first** (earliest) commit that
|
|
133
|
+
* actually declared the waiver, not the most recent — deterministic for a given repo state, and
|
|
134
|
+
* the answer an auditor wants ("who introduced this waiver").
|
|
135
|
+
*
|
|
136
|
+
* Uses `%(trailers:key=Em-Ledger-Waive,valueonly)` (git's own trailer parser — requires the
|
|
137
|
+
* standard blank-line-separated footer block, same convention `git interpret-trailers` expects)
|
|
138
|
+
* rather than regexing commit messages by hand. A range that fails to resolve (unknown
|
|
139
|
+
* revision, `anchorFile` not in a repo) returns `[]` — routine, matching every other
|
|
140
|
+
* `diff-inputs.ts` git call's "missing is not a crash" stance; `checkLedger`'s own calls against
|
|
141
|
+
* the same revisions already surface a real problem with `--from`/`--to` if there is one.
|
|
142
|
+
*/
|
|
143
|
+
export function readLedgerWaiverTrailers(anchorFile, from, to, runGit = realGit) {
|
|
144
|
+
const toplevel = runGit(["-C", dirname(resolve(anchorFile)), "rev-parse", "--show-toplevel"]);
|
|
145
|
+
if (toplevel.status !== 0)
|
|
146
|
+
return [];
|
|
147
|
+
const repoRoot = toplevel.stdout.trim();
|
|
148
|
+
const range = `${from}..${to ?? "HEAD"}`;
|
|
149
|
+
const log = runGit([
|
|
150
|
+
"-C",
|
|
151
|
+
repoRoot,
|
|
152
|
+
"log",
|
|
153
|
+
"--reverse",
|
|
154
|
+
`--format=%H${FORMAT_HASH_SEP}%(trailers:key=Em-Ledger-Waive,valueonly)${FORMAT_RECORD_END}`,
|
|
155
|
+
range,
|
|
156
|
+
]);
|
|
157
|
+
if (log.status !== 0)
|
|
158
|
+
return [];
|
|
159
|
+
const seen = new Set();
|
|
160
|
+
const waivers = [];
|
|
161
|
+
for (const record of log.stdout.split(RECORD_END)) {
|
|
162
|
+
const body = record.startsWith("\n") ? record.slice(1) : record;
|
|
163
|
+
if (!body.trim())
|
|
164
|
+
continue;
|
|
165
|
+
const sepIndex = body.indexOf(HASH_SEP);
|
|
166
|
+
if (sepIndex === -1)
|
|
167
|
+
continue;
|
|
168
|
+
const commit = body.slice(0, sepIndex);
|
|
169
|
+
const values = body
|
|
170
|
+
.slice(sepIndex + 1)
|
|
171
|
+
.split("\n")
|
|
172
|
+
.map((v) => v.trim())
|
|
173
|
+
.filter((v) => v.length > 0);
|
|
174
|
+
for (const sliceKey of values) {
|
|
175
|
+
if (seen.has(sliceKey))
|
|
176
|
+
continue; // keep only the first (earliest, --reverse) commit
|
|
177
|
+
seen.add(sliceKey);
|
|
178
|
+
waivers.push({ sliceKey, commit });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return waivers;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Split a `checkLedger` result's findings into still-active and waived (MIL-185, R9), given the
|
|
185
|
+
* flag-provided slice keys (repeatable `--waive <slice-key>`) and the trailer waivers read from
|
|
186
|
+
* the commit range (`readLedgerWaiverTrailers`). Pure — no git access, so flag-only and
|
|
187
|
+
* trailer-only waiver logic is testable without faking a git runner.
|
|
188
|
+
*
|
|
189
|
+
* Only a `ledger-content-without-version-bump` finding is ever waivable (`WAIVABLE_LEDGER_CODE`)
|
|
190
|
+
* — a version regression or a bump-without-content-change stays a hard finding regardless of any
|
|
191
|
+
* waiver naming that slice key. A flag waiver takes precedence over a same-key trailer waiver
|
|
192
|
+
* (both excuse the same finding; the flag is the more explicit, in-hand instruction). A waiver
|
|
193
|
+
* that names a slice key with no matching waivable finding is reported via `unknownWaivers`
|
|
194
|
+
* rather than silently dropped — see `UnknownLedgerWaiver`.
|
|
195
|
+
*/
|
|
196
|
+
export function applyLedgerWaivers(result, flagWaivedKeys, trailerWaivers) {
|
|
197
|
+
const waivableBySliceKey = new Map();
|
|
198
|
+
for (const finding of result.findings) {
|
|
199
|
+
if (finding.code === WAIVABLE_LEDGER_CODE)
|
|
200
|
+
waivableBySliceKey.set(finding.sliceKey, finding);
|
|
201
|
+
}
|
|
202
|
+
const waivedSliceKeys = new Set();
|
|
203
|
+
const waived = [...result.waived];
|
|
204
|
+
const unknownWaivers = [];
|
|
205
|
+
const seenFlagKeys = new Set();
|
|
206
|
+
for (const sliceKey of flagWaivedKeys) {
|
|
207
|
+
if (seenFlagKeys.has(sliceKey))
|
|
208
|
+
continue;
|
|
209
|
+
seenFlagKeys.add(sliceKey);
|
|
210
|
+
const finding = waivableBySliceKey.get(sliceKey);
|
|
211
|
+
const source = { source: "flag" };
|
|
212
|
+
if (finding) {
|
|
213
|
+
waived.push({ ...finding, waivedBy: source });
|
|
214
|
+
waivedSliceKeys.add(sliceKey);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
unknownWaivers.push({ sliceKey, source });
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
for (const trailer of trailerWaivers) {
|
|
221
|
+
if (waivedSliceKeys.has(trailer.sliceKey))
|
|
222
|
+
continue; // already waived by a flag entry
|
|
223
|
+
const finding = waivableBySliceKey.get(trailer.sliceKey);
|
|
224
|
+
const source = { source: "trailer", commit: trailer.commit };
|
|
225
|
+
if (finding) {
|
|
226
|
+
waived.push({ ...finding, waivedBy: source });
|
|
227
|
+
waivedSliceKeys.add(trailer.sliceKey);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
unknownWaivers.push({ sliceKey: trailer.sliceKey, source });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
waived.sort((a, b) => a.sliceKey.localeCompare(b.sliceKey));
|
|
234
|
+
const findings = result.findings.filter((f) => !waivedSliceKeys.has(f.sliceKey));
|
|
235
|
+
return { result: { ...result, findings, waived }, unknownWaivers };
|
|
115
236
|
}
|
|
116
237
|
//# sourceMappingURL=ledgerCheck.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledgerCheck.js","sourceRoot":"","sources":["../../src/cli/ledgerCheck.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,+FAA+F;AAC/F,8FAA8F;AAC9F,6FAA6F;AA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AAM,GAAsB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QAChF,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9C,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjF,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
// module rather than being copy-pasted a second time.
|
|
31
31
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
32
32
|
import { join } from "node:path";
|
|
33
|
+
import { continuationOf } from "../model/continuation.js";
|
|
33
34
|
import { resolveSliceDocJoin } from "../catalog/docJoin.js";
|
|
34
35
|
import { fieldLineRegex, locateFrontmatterInner, normalizeFieldValue } from "./frontmatterSurgery.js";
|
|
35
36
|
/**
|
|
@@ -111,7 +112,17 @@ export function runMarkImplemented(model, refs, baseDir, sliceKey, prUrl) {
|
|
|
111
112
|
return { ok: false, message: `no slice with export key "${sliceKey}" in this model` };
|
|
112
113
|
}
|
|
113
114
|
const slice = model.slices[sliceIndex];
|
|
114
|
-
const { doc } = resolveSliceDocJoin(slice, sliceKey, baseDir, (id) => refs.refById.get(id));
|
|
115
|
+
const { doc, continuationOf: continuationOfKey } = resolveSliceDocJoin(model, refs, slice, sliceKey, baseDir, (id) => refs.refById.get(id));
|
|
116
|
+
// MIL-208: see runRatify's own comment — a continuation slice has no status of its own.
|
|
117
|
+
if (continuationOfKey) {
|
|
118
|
+
const continuation = continuationOf(model, refs, sliceIndex);
|
|
119
|
+
const viewName = model.byId.get(continuation.viewLogicalId).name;
|
|
120
|
+
return {
|
|
121
|
+
ok: false,
|
|
122
|
+
message: `"${sliceKey}" is a continuation of "${continuationOfKey}" (view "${viewName}" again) — ` +
|
|
123
|
+
`it has no doc of its own; mark-implemented "${continuationOfKey}" instead`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
115
126
|
if (doc.reason === "no-doc-bound") {
|
|
116
127
|
return {
|
|
117
128
|
ok: false,
|