@milehimikey/em 1.9.0 → 1.10.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 (81) hide show
  1. package/.claude/skills/event-modeling/SKILL.md +1 -1
  2. package/.claude/skills/event-modeling-conform/SKILL.md +1 -1
  3. package/.claude/skills/event-modeling-conform/reference/conform.md +1 -1
  4. package/.claude/skills/event-modeling-design/SKILL.md +3 -3
  5. package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
  6. package/.claude/skills/event-modeling-implement/SKILL.md +1 -1
  7. package/.claude/skills/event-modeling-review/SKILL.md +1 -1
  8. package/.claude/skills/event-modeling-shared/reference/em-dsl.md +47 -2
  9. package/.claude/skills/event-modeling-shared/reference/operating-principles.md +4 -1
  10. package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +381 -0
  11. package/.claude/skills/event-modeling-shared/templates/slice.md +7 -7
  12. package/README.md +8 -1
  13. package/dist/cli/ciInit.d.ts +10 -3
  14. package/dist/cli/ciInit.js +22 -14
  15. package/dist/cli/ciInit.js.map +1 -1
  16. package/dist/cli/systemInputs.d.ts +34 -0
  17. package/dist/cli/systemInputs.js +129 -0
  18. package/dist/cli/systemInputs.js.map +1 -0
  19. package/dist/cli.js +222 -7
  20. package/dist/cli.js.map +1 -1
  21. package/dist/emit/json.d.ts +16 -1
  22. package/dist/emit/json.js +36 -1
  23. package/dist/emit/json.js.map +1 -1
  24. package/dist/emit/queryJson.d.ts +6 -0
  25. package/dist/emit/queryJson.js +29 -0
  26. package/dist/emit/queryJson.js.map +1 -0
  27. package/dist/emit/systemJson.d.ts +8 -0
  28. package/dist/emit/systemJson.js +38 -0
  29. package/dist/emit/systemJson.js.map +1 -0
  30. package/dist/mcp/server.d.ts +1 -1
  31. package/dist/mcp/server.js +185 -6
  32. package/dist/mcp/server.js.map +1 -1
  33. package/dist/model/edges.d.ts +13 -1
  34. package/dist/model/edges.js +43 -15
  35. package/dist/model/edges.js.map +1 -1
  36. package/dist/model/model.d.ts +2 -0
  37. package/dist/model/model.js +1 -0
  38. package/dist/model/model.js.map +1 -1
  39. package/dist/model/qualifiedRef.d.ts +47 -0
  40. package/dist/model/qualifiedRef.js +100 -0
  41. package/dist/model/qualifiedRef.js.map +1 -0
  42. package/dist/model/queryIndex.d.ts +50 -0
  43. package/dist/model/queryIndex.js +111 -0
  44. package/dist/model/queryIndex.js.map +1 -0
  45. package/dist/model/rules.d.ts +69 -0
  46. package/dist/model/rules.js +82 -0
  47. package/dist/model/rules.js.map +1 -1
  48. package/dist/model/sliceDocIndex.d.ts +30 -0
  49. package/dist/model/sliceDocIndex.js +110 -0
  50. package/dist/model/sliceDocIndex.js.map +1 -0
  51. package/dist/model/validate.js +4 -11
  52. package/dist/model/validate.js.map +1 -1
  53. package/dist/parser/ast.d.ts +4 -0
  54. package/dist/parser/parser.d.ts +2 -0
  55. package/dist/parser/parser.js +8 -2
  56. package/dist/parser/parser.js.map +1 -1
  57. package/dist/query/format.d.ts +8 -0
  58. package/dist/query/format.js +80 -0
  59. package/dist/query/format.js.map +1 -0
  60. package/dist/query/pipeline.d.ts +17 -0
  61. package/dist/query/pipeline.js +38 -0
  62. package/dist/query/pipeline.js.map +1 -0
  63. package/dist/query/system.d.ts +60 -0
  64. package/dist/query/system.js +87 -0
  65. package/dist/query/system.js.map +1 -0
  66. package/dist/query/verbs.d.ts +100 -0
  67. package/dist/query/verbs.js +306 -0
  68. package/dist/query/verbs.js.map +1 -0
  69. package/dist/render/drawEdges.js +8 -4
  70. package/dist/render/drawEdges.js.map +1 -1
  71. package/dist/render/sliceDiagram.js +1 -0
  72. package/dist/render/sliceDiagram.js.map +1 -1
  73. package/dist/system/manifest.d.ts +45 -0
  74. package/dist/system/manifest.js +178 -0
  75. package/dist/system/manifest.js.map +1 -0
  76. package/dist/system/verify.d.ts +88 -0
  77. package/dist/system/verify.js +263 -0
  78. package/dist/system/verify.js.map +1 -0
  79. package/dist/util/slug.js +16 -10
  80. package/dist/util/slug.js.map +1 -1
  81. package/package.json +10 -1
@@ -22,7 +22,7 @@ ships; that mismatch is an intended drift signal, not a bug), and fill in the `#
22
22
  below with this hop's change, replacing whatever it held before (it always shows only the latest
23
23
  hop — full history lives in git, same-commit-ratification convention). Full grammar — the fixed
24
24
  heading, the four operation subsections, why the heading never varies, the replace-not-accumulate
25
- lifecycle — is documented in docs/slice-doc-schema.md#delta-section-grammar-and-lifecycle; treat
25
+ lifecycle — is documented in ../reference/slice-doc-schema.md#delta-section-grammar-and-lifecycle; treat
26
26
  it the same Socratic way as every other section here, don't generate it mechanically.
27
27
 
28
28
  The three lineage keys only apply when this doc was produced by a split, merge, or rename —
@@ -47,7 +47,7 @@ command writes either. `owner` is free text naming who (a person or team) holds
47
47
  never talks to a tracker itself. Delete both otherwise; most docs never carry them.
48
48
 
49
49
  Full machine schema — required-vs-optional keys per `status`, value types/enums, the
50
- unknown-key policy — is documented in docs/slice-doc-schema.md.
50
+ unknown-key policy — is documented in ../reference/slice-doc-schema.md.
51
51
 
52
52
  The diagram below is generated, not hand-drawn: `em render <model>.em --slice "{{Slice Name}}"
53
53
  -o slices/{{slice-name}}.svg` (kebab-case the slice name to match this doc's own filename).
@@ -62,13 +62,13 @@ version: 1
62
62
  implementedIn: {{PR/commit link — fill in once status is `implemented`}}
63
63
  # Lineage — only when this doc exists because of a split, merge, or rename (delete these three
64
64
  # lines otherwise). Grammar: <slice-key>@v<N>. See
65
- # docs/slice-doc-schema.md#lineage-grammar-and-cardinality.
65
+ # ../reference/slice-doc-schema.md#lineage-grammar-and-cardinality.
66
66
  # split-from: <slice-key>@v<N>
67
67
  # merged-from: <slice-key>@v<N>, <slice-key>@v<N>
68
68
  # superseded-by: <slice-key>@v<N>, <slice-key>@v<N>
69
69
  # Cross-slice coverage — only when this doc also covers another slice with no doc of its own
70
70
  # (e.g. the view-only half of a two-slice Automation/Translation, MIL-121); delete otherwise.
71
- # Plain slice keys, comma-separated. See docs/slice-doc-schema.md#cross-slice-coverage-covers.
71
+ # Plain slice keys, comma-separated. See ../reference/slice-doc-schema.md#cross-slice-coverage-covers.
72
72
  # covers: <slice-key>, <slice-key>
73
73
  # Ownership / tracking — optional, hand-filled (no `em` command writes either); delete otherwise.
74
74
  # owner: <person or team>
@@ -81,7 +81,7 @@ implementedIn: {{PR/commit link — fill in once status is `implemented`}}
81
81
  <!-- Only on re-ratification of an already-`implemented` slice — omit this whole section on a
82
82
  slice's first version (v1 has no delta yet). The heading is always the literal `## Delta`,
83
83
  never `## Delta: vX → vY` — hop metadata is a display line inside the section instead (see
84
- docs/slice-doc-schema.md#delta-section-grammar-and-lifecycle for why). Replace this
84
+ ../reference/slice-doc-schema.md#delta-section-grammar-and-lifecycle for why). Replace this
85
85
  section's content wholesale on the next re-ratification — it shows only the latest hop, not
86
86
  an accumulating log. Omit any of the four subsections below with no entries this hop; keep
87
87
  the remaining ones in this order (Added/Modified/Removed/Renamed). `Renamed` is for a
@@ -161,7 +161,7 @@ an event directly.}}
161
161
  <!-- What must ALWAYS hold. Give each a stable ID so tests and code can reference it:
162
162
  `INV-<MNEMONIC>-<n>`, where `<MNEMONIC>` is a short (2-4 letter/digit), slice-unique
163
163
  abbreviation of this slice's key (e.g. slice `checkout` -> `INV-CHK-1`) — see
164
- docs/slice-doc-schema.md. Add a letter suffix for a closely-related sub-invariant
164
+ ../reference/slice-doc-schema.md. Add a letter suffix for a closely-related sub-invariant
165
165
  (`INV-CHK-3a`). Keep the rule statement itself to one line. If it needs more — why the rule
166
166
  exists, what "violation" looks like in practice, an edge case worth calling out — add that as
167
167
  a nested bullet under the rule instead of one long run-on sentence: this section renders as
@@ -217,5 +217,5 @@ an event directly.}}
217
217
  as `## Delta`, for the same reason: an ever-growing scroll of resolved questions goes stale
218
218
  exactly like an accumulating Delta log would, and full history already lives in git
219
219
  (`git log -p slices/<name>.md`) — this section is a live worklist, not an audit trail. See
220
- docs/slice-doc-schema.md#open-questions-section-lifecycle. -->
220
+ ../reference/slice-doc-schema.md#open-questions-section-lifecycle. -->
221
221
  - [ ] {{question}}
package/README.md CHANGED
@@ -38,6 +38,13 @@ em diff model.em --from HEAD~1 # what this change did to the model
38
38
  em changelog model.em # the model's git history as a business ledger
39
39
  ```
40
40
 
41
+ A system of several models — one per team or sub-department, each in its own directory — gets
42
+ the same treatment across model boundaries: a seam manifest (`system.yaml`) declares which
43
+ model's `public` event feeds which other model's Translation slice, and `em system system.yaml`
44
+ verifies every binding against the models' exports and emits the org-level context map
45
+ ([docs/cli.md](docs/cli.md#em-system-manifest); worked example in
46
+ [examples/multi-model/](examples/multi-model/)).
47
+
41
48
  A model is a list of slices — vertical time steps, read left to right — whose elements land
42
49
  in swimlane rows:
43
50
 
@@ -117,7 +124,7 @@ built this way.
117
124
  | [docs/usage-data.md](docs/usage-data.md) | What usage data em captures, and how to roll it up for a retro |
118
125
  | [docs/architecture.md](docs/architecture.md) | How rendering works; why Graphviz, not PlantUML |
119
126
  | [docs/roadmap.md](docs/roadmap.md) | What's planned |
120
- | [docs/decisions/](docs/decisions/) | Write-ups for open design questions (starts with [MIL-162](docs/decisions/mil-162-teachable-navigator.md), the stakeholder-portal decision) |
127
+ | [docs/decisions/](docs/decisions/) | Write-ups for open design questions ([MIL-162](docs/decisions/mil-162-teachable-navigator.md), the stakeholder-portal decision; [MIL-194](docs/decisions/mil-194-seam-manifest.md), the seam manifest) |
121
128
 
122
129
  ## Development
123
130
 
@@ -4,13 +4,20 @@ export declare function ciWorkflowPath(repoRoot: string): string;
4
4
  export declare function conformWorkflowPath(repoRoot: string): string;
5
5
  export declare function findUnsafeCiInitArg(value: string): string | null;
6
6
  /** The managed block only (no header/`on:`/`jobs:` scaffolding) — what gets written between
7
- * the marker pair, both for a fresh file and to patch an existing marked one in place. */
8
- export declare function ciManagedBody(model: string, testsDir: string): string;
7
+ * the marker pair, both for a fresh file and to patch an existing marked one in place.
8
+ *
9
+ * Every `npx @milehimikey/em` invocation pins the generating em's own exact version
10
+ * (MIL-188): an unpinned line floats to whatever `latest` resolves to on the runner that
11
+ * day, which is the opposite of a preset. Because the pin lives inside the managed body,
12
+ * `--check` from a different em version reports the block as stale — the same
13
+ * upgrade-visibility `em skill check` gets from its version stamp — and a file scaffolded
14
+ * by a pre-pin em shows stale the same way. */
15
+ export declare function ciManagedBody(model: string, testsDir: string, emVersion: string): string;
9
16
  export declare function buildCiWorkflowFile(model: string, testsDir: string, emVersion: string): string;
10
17
  /** The managed block only (no header/`on:`/`permissions:`/`jobs:` scaffolding) — what gets
11
18
  * written between the marker pair, both for a fresh file and to patch an existing marked one
12
19
  * in place. */
13
- export declare function conformManagedBody(model: string): string;
20
+ export declare function conformManagedBody(model: string, emVersion: string): string;
14
21
  export declare function buildConformWorkflowFile(model: string, emVersion: string): string;
15
22
  export type CiFileStatus = {
16
23
  kind: "create";
@@ -45,8 +45,16 @@ export function findUnsafeCiInitArg(value) {
45
45
  }
46
46
  // ---- em-ci.yml (PR gates + push-triggered badge rebuild) ----
47
47
  /** The managed block only (no header/`on:`/`jobs:` scaffolding) — what gets written between
48
- * the marker pair, both for a fresh file and to patch an existing marked one in place. */
49
- export function ciManagedBody(model, testsDir) {
48
+ * the marker pair, both for a fresh file and to patch an existing marked one in place.
49
+ *
50
+ * Every `npx @milehimikey/em` invocation pins the generating em's own exact version
51
+ * (MIL-188): an unpinned line floats to whatever `latest` resolves to on the runner that
52
+ * day, which is the opposite of a preset. Because the pin lives inside the managed body,
53
+ * `--check` from a different em version reports the block as stale — the same
54
+ * upgrade-visibility `em skill check` gets from its version stamp — and a file scaffolded
55
+ * by a pre-pin em shows stale the same way. */
56
+ export function ciManagedBody(model, testsDir, emVersion) {
57
+ const em = `npx @milehimikey/em@${emVersion}`;
50
58
  return ` validate:
51
59
  name: em validate (changed .em files)
52
60
  if: github.event_name == 'pull_request'
@@ -71,8 +79,8 @@ export function ciManagedBody(model, testsDir) {
71
79
  status=0
72
80
  for f in $changed; do
73
81
  echo "::group::em validate $f"
74
- npx @milehimikey/em validate "$f" || status=1
75
- npx @milehimikey/em validate "$f" --list-issues
82
+ ${em} validate "$f" || status=1
83
+ ${em} validate "$f" --list-issues
76
84
  echo "::endgroup::"
77
85
  done
78
86
  exit $status
@@ -87,7 +95,7 @@ export function ciManagedBody(model, testsDir) {
87
95
  with:
88
96
  node-version: 20
89
97
  - name: Check README Slices table is current
90
- run: npx @milehimikey/em slice index "${model}" --check
98
+ run: ${em} slice index "${model}" --check
91
99
 
92
100
  coverage:
93
101
  name: "em coverage --strict (invariant citations)"
@@ -99,7 +107,7 @@ export function ciManagedBody(model, testsDir) {
99
107
  with:
100
108
  node-version: 20
101
109
  - name: Check invariant test coverage
102
- run: npx @milehimikey/em coverage "${model}" --tests "${testsDir}" --strict
110
+ run: ${em} coverage "${model}" --tests "${testsDir}" --strict
103
111
 
104
112
  ledger:
105
113
  name: em ledger (slice doc version/content agreement)
@@ -113,7 +121,7 @@ export function ciManagedBody(model, testsDir) {
113
121
  with:
114
122
  node-version: 20
115
123
  - name: Check slice doc version/content agreement
116
- run: npx @milehimikey/em ledger "${model}" --from "\${{ github.event.pull_request.base.sha }}"
124
+ run: ${em} ledger "${model}" --from "\${{ github.event.pull_request.base.sha }}"
117
125
 
118
126
  skill-check:
119
127
  name: em skill check (vendored skill drift)
@@ -127,7 +135,7 @@ export function ciManagedBody(model, testsDir) {
127
135
  - name: Check vendored skill matches installed em
128
136
  run: |
129
137
  if [ -d .claude/skills/event-modeling ]; then
130
- npx @milehimikey/em skill check
138
+ ${em} skill check
131
139
  else
132
140
  echo "no vendored skill at .claude/skills/event-modeling — skipping (run \`em skill install\` to opt in)"
133
141
  fi
@@ -142,7 +150,7 @@ export function ciManagedBody(model, testsDir) {
142
150
  with:
143
151
  node-version: 20
144
152
  - name: Check glossary consistency across models
145
- run: npx @milehimikey/em glossary $(git ls-files '*.em') --fail-on-conflicts
153
+ run: ${em} glossary $(git ls-files '*.em') --fail-on-conflicts
146
154
 
147
155
  status-badge:
148
156
  name: rebuild status badge (advisory — publish only, never a gate)
@@ -156,7 +164,7 @@ export function ciManagedBody(model, testsDir) {
156
164
  with:
157
165
  node-version: 20
158
166
  - name: Rebuild status badge
159
- run: npx @milehimikey/em status "${model}" --tests "${testsDir}" --badge -o status-badge.svg
167
+ run: ${em} status "${model}" --tests "${testsDir}" --badge -o status-badge.svg
160
168
  - name: Commit badge if changed
161
169
  run: |
162
170
  if git diff --quiet -- status-badge.svg; then
@@ -201,13 +209,13 @@ jobs:
201
209
  // closing marker's leading spaces vanished on a second `em ci init` run).
202
210
  export function buildCiWorkflowFile(model, testsDir, emVersion) {
203
211
  const { start, end } = markerPair(CI_WORKFLOW_MARKER, "hash");
204
- return `${ciWorkflowHeader(model, emVersion)}${start}\n${ciManagedBody(model, testsDir)}\n${end}\n`;
212
+ return `${ciWorkflowHeader(model, emVersion)}${start}\n${ciManagedBody(model, testsDir, emVersion)}\n${end}\n`;
205
213
  }
206
214
  // ---- em-conform.yml (scheduled, advisory-only conformance cadence) ----
207
215
  /** The managed block only (no header/`on:`/`permissions:`/`jobs:` scaffolding) — what gets
208
216
  * written between the marker pair, both for a fresh file and to patch an existing marked one
209
217
  * in place. */
210
- export function conformManagedBody(model) {
218
+ export function conformManagedBody(model, emVersion) {
211
219
  const modelDir = dirname(model) === "." ? "." : dirname(model);
212
220
  return ` conform:
213
221
  runs-on: ubuntu-latest
@@ -222,7 +230,7 @@ export function conformManagedBody(model) {
222
230
 
223
231
  - name: Run conform phase
224
232
  run: |
225
- npm i -g @milehimikey/em@1 @anthropic-ai/claude-code
233
+ npm i -g @milehimikey/em@${emVersion} @anthropic-ai/claude-code
226
234
  em skill install --force
227
235
  claude -p "/event-modeling conform" \\
228
236
  --allowedTools "Bash(em:*),Bash(git:*),Read,Grep,Glob,Write,Edit"
@@ -268,7 +276,7 @@ jobs:
268
276
  }
269
277
  export function buildConformWorkflowFile(model, emVersion) {
270
278
  const { start, end } = markerPair(CONFORM_WORKFLOW_MARKER, "hash");
271
- return `${conformWorkflowHeader(model, emVersion)}${start}\n${conformManagedBody(model)}\n${end}\n`;
279
+ return `${conformWorkflowHeader(model, emVersion)}${start}\n${conformManagedBody(model, emVersion)}\n${end}\n`;
272
280
  }
273
281
  /**
274
282
  * Decide what to do with one generated file: create it if missing, patch the managed block if
@@ -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,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAEpD,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACtE,MAAM,wBAAwB,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAEhF,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAC7C,CAAC;AACD,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,OAAO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,IAAY,EACZ,SAAiB,EACjB,WAAmB,EACnB,UAAkB,EAClB,KAAc;IAEd,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAErE,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAEvE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC7F,CAAC;IACD,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC3H,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,MAAoB;IAC5D,IAAI,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"}
@@ -0,0 +1,34 @@
1
+ import { SystemManifest } from "../system/manifest.js";
2
+ import { SystemDiagnostic, SystemExportDoc, SystemModelInput } from "../system/verify.js";
3
+ /** The oldest `em export` schema whose document carries what the verifier reads (`model.key`
4
+ * from MIL-193, `model.edges` from MIL-191 — both schema 1.10). */
5
+ export declare const MIN_EXPORT_SCHEMA: {
6
+ major: number;
7
+ minor: number;
8
+ };
9
+ export type LoadSystemResult = {
10
+ ok: true;
11
+ manifest: SystemManifest;
12
+ manifestText: string;
13
+ models: SystemModelInput[];
14
+ } | {
15
+ ok: false;
16
+ diagnostics: SystemDiagnostic[];
17
+ };
18
+ /** Read + parse the manifest at `manifestPath` and load every model it declares. `ok: false`
19
+ * means the system can't be verified at all (unreadable/invalid manifest, or a source that
20
+ * can't be read, parsed, or has compile errors) — the caller refuses, the same way `em export`
21
+ * refuses a model with errors, rather than verifying a partial system. */
22
+ export declare function loadSystem(manifestPath: string): LoadSystemResult;
23
+ type LoadedSource = {
24
+ sourceKind: "em" | "export";
25
+ doc: SystemExportDoc;
26
+ } | {
27
+ error: string;
28
+ };
29
+ /** Shape-check an `em export --json` document: `schemaVersion` >= 1.10 and the `model.key`/
30
+ * `model.slices`/`model.edges` fields present. Deliberately shallow — this is a guard against
31
+ * handing the verifier a file that isn't an export at all (or one from an older em), not a
32
+ * full schema validation; an export em itself wrote is trusted past this point. */
33
+ export declare function readExportDoc(text: string, file: string): LoadedSource;
34
+ export {};
@@ -0,0 +1,129 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // The filesystem half of `em system` (MIL-194): read the manifest, resolve each model's
3
+ // `source` relative to the manifest's directory, and turn every source — a `.em` file compiled
4
+ // in-process, or an `em export --json` document read as-is — into the ONE input shape the
5
+ // verifier (src/system/verify.ts) accepts: an export document. That is how "verification reads
6
+ // export JSON only" stays true while a co-located repo still gets to point at its `.em` files
7
+ // directly: a `.em` source is compiled with the same `compile()` + `buildExportDoc()` `em export`
8
+ // itself runs, never through a second model reader, so the verifier can't tell the two apart.
9
+ //
10
+ // Shared by the CLI action (src/cli.ts) and the MCP `system` tool (src/mcp/server.ts) so the two
11
+ // surfaces load a system identically — the parity requirement. Every failure is a returned
12
+ // diagnostic, never a throw or a process exit: the CLI prints and exits, MCP returns a tool error.
13
+ import { readFileSync } from "node:fs";
14
+ import { dirname, extname, isAbsolute, join } from "node:path";
15
+ import { compile } from "../pipeline.js";
16
+ import { ParseError } from "../parser/parser.js";
17
+ import { hasErrors } from "../model/validate.js";
18
+ import { buildExportDoc } from "../emit/json.js";
19
+ import { makeDiag } from "../model/rules.js";
20
+ import { parseManifest } from "../system/manifest.js";
21
+ /** The oldest `em export` schema whose document carries what the verifier reads (`model.key`
22
+ * from MIL-193, `model.edges` from MIL-191 — both schema 1.10). */
23
+ export const MIN_EXPORT_SCHEMA = { major: 1, minor: 10 };
24
+ /** Read + parse the manifest at `manifestPath` and load every model it declares. `ok: false`
25
+ * means the system can't be verified at all (unreadable/invalid manifest, or a source that
26
+ * can't be read, parsed, or has compile errors) — the caller refuses, the same way `em export`
27
+ * refuses a model with errors, rather than verifying a partial system. */
28
+ export function loadSystem(manifestPath) {
29
+ let manifestText;
30
+ try {
31
+ manifestText = readFileSync(manifestPath, "utf8");
32
+ }
33
+ catch {
34
+ return { ok: false, diagnostics: [{ file: manifestPath, ...makeDiag("system-manifest-invalid", { message: `cannot read ${manifestPath}` }) }] };
35
+ }
36
+ const parsed = parseManifest(manifestText);
37
+ if (!parsed.ok) {
38
+ return { ok: false, diagnostics: parsed.diagnostics.map((d) => ({ file: manifestPath, ...d })) };
39
+ }
40
+ const baseDir = dirname(manifestPath);
41
+ const diagnostics = [];
42
+ const models = [];
43
+ for (const entry of parsed.manifest.models) {
44
+ // Joined, not resolved: diagnostics and `--json` echo this path, and a document a CI job
45
+ // commits must not embed one machine's absolute checkout path — `em export`'s `source.path`
46
+ // keeps the same "as given" posture.
47
+ const file = isAbsolute(entry.source) ? entry.source : join(baseDir, entry.source);
48
+ const loaded = loadSource(file);
49
+ if ("error" in loaded) {
50
+ diagnostics.push({
51
+ file: manifestPath,
52
+ ...makeDiag("system-manifest-invalid", { message: `model "${entry.key}": ${loaded.error}`, line: entry.line }),
53
+ });
54
+ continue;
55
+ }
56
+ models.push({ key: entry.key, source: entry.source, sourceKind: loaded.sourceKind, owner: entry.owner, file, doc: loaded.doc });
57
+ }
58
+ if (diagnostics.length > 0)
59
+ return { ok: false, diagnostics };
60
+ return { ok: true, manifest: parsed.manifest, manifestText, models };
61
+ }
62
+ /** One source path to an export document. `.em` compiles (refusing on parse/validation
63
+ * errors, same gate as `em export`); anything else is read as an `em export --json` document
64
+ * and shape-checked for the fields the verifier needs. */
65
+ function loadSource(file) {
66
+ let text;
67
+ try {
68
+ text = readFileSync(file, "utf8");
69
+ }
70
+ catch {
71
+ return { error: `cannot read ${file}` };
72
+ }
73
+ if (extname(file).toLowerCase() === ".em") {
74
+ try {
75
+ const { model, refs, diagnostics } = compile(text);
76
+ if (hasErrors(diagnostics)) {
77
+ return { error: `${file} has validation errors — run \`em validate ${file}\` and fix them first` };
78
+ }
79
+ // The document's own `model.key` (MIL-193, schema 1.10) is the key the manifest must match —
80
+ // never recomputed here, so `em system` and `em export` can't disagree about it.
81
+ const { doc } = buildExportDoc(model, refs, diagnostics, text, file);
82
+ return { sourceKind: "em", doc };
83
+ }
84
+ catch (e) {
85
+ if (e instanceof ParseError)
86
+ return { error: `parse error in ${file} ${e.message}` };
87
+ throw e;
88
+ }
89
+ }
90
+ return readExportDoc(text, file);
91
+ }
92
+ /** Shape-check an `em export --json` document: `schemaVersion` >= 1.10 and the `model.key`/
93
+ * `model.slices`/`model.edges` fields present. Deliberately shallow — this is a guard against
94
+ * handing the verifier a file that isn't an export at all (or one from an older em), not a
95
+ * full schema validation; an export em itself wrote is trusted past this point. */
96
+ export function readExportDoc(text, file) {
97
+ let raw;
98
+ try {
99
+ raw = JSON.parse(text);
100
+ }
101
+ catch {
102
+ return { error: `${file} is not valid JSON (expected an \`em export --json\` document)` };
103
+ }
104
+ if (typeof raw !== "object" || raw === null || typeof raw.schemaVersion !== "string") {
105
+ return { error: `${file} is not an \`em export --json\` document (no schemaVersion)` };
106
+ }
107
+ const doc = raw;
108
+ const [majorStr, minorStr] = doc.schemaVersion.split(".");
109
+ const major = Number(majorStr);
110
+ const minor = Number(minorStr);
111
+ const tooOld = !Number.isInteger(major) || !Number.isInteger(minor) || major < MIN_EXPORT_SCHEMA.major || (major === MIN_EXPORT_SCHEMA.major && minor < MIN_EXPORT_SCHEMA.minor);
112
+ if (tooOld) {
113
+ return {
114
+ error: `${file} has export schemaVersion "${doc.schemaVersion}" — \`em system\` needs >= ${MIN_EXPORT_SCHEMA.major}.${MIN_EXPORT_SCHEMA.minor} ` +
115
+ `(model.key and model.edges); regenerate it with a current \`em export --json\``,
116
+ };
117
+ }
118
+ const model = doc.model;
119
+ if (typeof model !== "object" || model === null)
120
+ return { error: `${file}: export document has no \`model\`` };
121
+ if (typeof model.key !== "string")
122
+ return { error: `${file}: export document has no \`model.key\` — regenerate it with a current \`em export --json\`` };
123
+ if (!Array.isArray(model.slices))
124
+ return { error: `${file}: export document has no \`model.slices\`` };
125
+ if (!Array.isArray(model.edges))
126
+ return { error: `${file}: export document has no \`model.edges\` — regenerate it with a current \`em export --json\`` };
127
+ return { sourceKind: "export", doc: raw };
128
+ }
129
+ //# sourceMappingURL=systemInputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"systemInputs.js","sourceRoot":"","sources":["../../src/cli/systemInputs.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,wFAAwF;AACxF,+FAA+F;AAC/F,0FAA0F;AAC1F,+FAA+F;AAC/F,8FAA8F;AAC9F,kGAAkG;AAClG,8FAA8F;AAC9F,EAAE;AACF,iGAAiG;AACjG,2FAA2F;AAC3F,mGAAmG;AAEnG,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EA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