@milehimikey/em 1.19.5 → 1.19.7

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 (53) 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 +5 -4
  4. package/.claude/skills/event-modeling-design/SKILL.md +1 -1
  5. package/.claude/skills/event-modeling-discover/SKILL.md +1 -1
  6. package/.claude/skills/event-modeling-engagement/SKILL.md +1 -1
  7. package/.claude/skills/event-modeling-implement/SKILL.md +1 -1
  8. package/.claude/skills/event-modeling-review/SKILL.md +1 -1
  9. package/.claude/skills/event-modeling-shared/reference/em-dsl.md +17 -8
  10. package/.claude/skills/event-modeling-shared/reference/methodology.md +4 -2
  11. package/.claude/skills/event-modeling-shared/reference/slice-doc-schema.md +1 -1
  12. package/.claude-plugin/marketplace.json +2 -2
  13. package/README.md +11 -1
  14. package/dist/cli/conformSupersede.js +13 -3
  15. package/dist/cli/conformSupersede.js.map +1 -1
  16. package/dist/cli/findings.d.ts +6 -2
  17. package/dist/cli/findings.js +7 -3
  18. package/dist/cli/findings.js.map +1 -1
  19. package/dist/cli/markImplemented.js +21 -3
  20. package/dist/cli/markImplemented.js.map +1 -1
  21. package/dist/cli/revise.d.ts +4 -1
  22. package/dist/cli/revise.js +3 -2
  23. package/dist/cli/revise.js.map +1 -1
  24. package/dist/cli/sliceConform.d.ts +59 -6
  25. package/dist/cli/sliceConform.js +106 -24
  26. package/dist/cli/sliceConform.js.map +1 -1
  27. package/dist/cli/status.js +4 -3
  28. package/dist/cli/status.js.map +1 -1
  29. package/dist/cli.js +33 -21
  30. package/dist/cli.js.map +1 -1
  31. package/dist/emit/json.js +1 -1
  32. package/dist/emit/json.js.map +1 -1
  33. package/dist/model/edges.d.ts +11 -4
  34. package/dist/model/edges.js +41 -5
  35. package/dist/model/edges.js.map +1 -1
  36. package/dist/model/validate.js +20 -0
  37. package/dist/model/validate.js.map +1 -1
  38. package/dist/parser/ast.d.ts +1 -1
  39. package/dist/parser/parser.js +7 -7
  40. package/dist/parser/parser.js.map +1 -1
  41. package/package.json +1 -1
  42. package/plugin/.claude-plugin/plugin.json +2 -2
  43. package/plugin/shared/reference/em-dsl.md +17 -8
  44. package/plugin/shared/reference/methodology.md +4 -2
  45. package/plugin/shared/reference/slice-doc-schema.md +1 -1
  46. package/plugin/skills/conform/SKILL.md +1 -1
  47. package/plugin/skills/conform/reference/conform.md +5 -4
  48. package/plugin/skills/design/SKILL.md +1 -1
  49. package/plugin/skills/discover/SKILL.md +1 -1
  50. package/plugin/skills/engagement/SKILL.md +1 -1
  51. package/plugin/skills/event-modeling/SKILL.md +1 -1
  52. package/plugin/skills/implement/SKILL.md +1 -1
  53. package/plugin/skills/review/SKILL.md +1 -1
package/dist/cli.js CHANGED
@@ -89,9 +89,9 @@ import { listModelCommits } from "./cli/changelog-git.js";
89
89
  import { buildChangelogDoc } from "./cli/changelogBuild.js";
90
90
  import { runRevise } from "./cli/revise.js";
91
91
  import { runDefer, runDeferFromIssue } from "./cli/defer.js";
92
- import { runSliceConform } from "./cli/sliceConform.js";
92
+ import { runSliceConform, resolveFindingsForReport, findingsFilesOf, unruledAcrossFiles } from "./cli/sliceConform.js";
93
93
  import { checkPrdTriage, buildCheckPrdTriageJson, renderPrdTriageMarkdown, validatePrdTriage } from "./cli/prdTriage.js";
94
- import { checkFindingsFile, buildCheckFindingsJson, lookupFindingsBesideReport, unruledFindingsInScope, FINDING_LOCI } from "./cli/findings.js";
94
+ import { checkFindingsFile, buildCheckFindingsJson, FINDING_LOCI } from "./cli/findings.js";
95
95
  import { STATE_FILE_NAME, PHASES, isPhase, loadStateFile, parseState, setPhase, setConformance, setModelVersion, setCertified, setEmVersion, setReview, isValidDateString, modelPathMismatch, } from "./cli/stateFile.js";
96
96
  import { findCertifiedVersion, latestModelVersionNumber, modelVersionDrift, runCertifyModelVersion, runModelVersionBump, } from "./cli/modelVersion.js";
97
97
  import { STARTER_EM, starterEmFor, scaffoldReadme, scaffoldStateFile, scaffoldConstitution } from "./templates.js";
@@ -960,6 +960,9 @@ function reviseAction(commandName) {
960
960
  if (result.advisory && result.advisory.unruledFindingsCount > 0) {
961
961
  console.error(`warn: revising "${sliceKey}" with ${result.advisory.unruledFindingsCount} unruled conformance finding(s) on the shipped version`);
962
962
  }
963
+ if (result.advisory && result.advisory.findingsFilesScanned === 0) {
964
+ console.error(`note: no conformance findings file (conformance/<date>[-<name>]-findings.json) was found beside the model — unruled findings on "${sliceKey}" could not be checked`);
965
+ }
963
966
  const what = result.kind === "shipped"
964
967
  ? `v${result.newVersion - 1} stays shipped; v${result.newVersion} opened as draft`
965
968
  : result.kind === "unshipped"
@@ -1084,7 +1087,7 @@ slice
1084
1087
  "Idempotent on the same (version, --at) pair; a different --at simply overwrites (a " +
1085
1088
  "later re-certification is normal — there's no way for em to tell 'later' from 'earlier' " +
1086
1089
  "for an arbitrary revision string, so there's no --force to reach for). Refuses when the " +
1087
- "newest conformance/*-findings.json matching --at still has an unruled finding in scope " +
1090
+ "conformance/<date>[-<name>]-findings.json file matching --at still has an unruled finding in scope " +
1088
1091
  "for this slice; --skip-findings-check overrides with a loud notice.")
1089
1092
  .argument("<file>", "input .em file")
1090
1093
  .argument("<slice-key>", "slice export key (kebab-case)")
@@ -1119,9 +1122,12 @@ slice
1119
1122
  console.error(`notice: --skip-findings-check — certifying "${sliceKey}" with ${result.skippedFindingsCheck.length} ` +
1120
1123
  `unruled conformance finding(s) still in scope (id ${result.skippedFindingsCheck.join(", ")})`);
1121
1124
  }
1122
- console.log(result.changed
1125
+ const noFindingsNote = result.findingsFiles.length === 0
1126
+ ? ` — note: no conformance findings file matches --at ${opts.at} (conformance/<date>[-<name>]-findings.json with that revision), so the findings check had nothing to read`
1127
+ : ` — findings: ${result.findingsFiles.join(", ")}`;
1128
+ console.log((result.changed
1123
1129
  ? `certified: ${result.path} (conformedVersion: ${result.version}, conformedAt: ${opts.at}, conformedOn: ${on})`
1124
- : `already certified (no-op): ${result.path}`);
1130
+ : `already certified (no-op): ${result.path}`) + noFindingsNote);
1125
1131
  });
1126
1132
  program
1127
1133
  .command("changelog")
@@ -1222,9 +1228,10 @@ state
1222
1228
  .command("set-conformance")
1223
1229
  .description("rewrite Last conformance: (and Last updated:) in the exact format reference/conform.md " +
1224
1230
  "parses. Refuses (MIL-214) while any `implemented` slice has an unruled conformance " +
1225
- "finding in the findings JSON beside --report (a `slice: null` finding blocks every " +
1231
+ "finding in the findings JSON beside --report, or, when that is absent, in every findings " +
1232
+ "file at the report's own revision (a `slice: null` finding blocks every " +
1226
1233
  "slice); --partial records the marker with a ` (partial)` suffix instead, with a loud " +
1227
- "notice. Without a findings JSON beside --report: warns once and records the marker as " +
1234
+ "notice. Without a findings JSON beside --report and none at the report's revision: warns once and records the marker as " +
1228
1235
  "given (migration path for a report predating `em conform-findings`)")
1229
1236
  .argument("<revision>", "target-repo revision just diffed against")
1230
1237
  .argument("[dir]", STATE_DIR_HELP, ".")
@@ -1260,28 +1267,31 @@ state
1260
1267
  compiledForCertify = { model: compiled.model, refs: compiled.refs, source: compiled.source };
1261
1268
  }
1262
1269
  }
1263
- let unruled = [];
1264
- const lookup = lookupFindingsBesideReport(modelDir, opts.report);
1265
- if (lookup.kind === "invalid") {
1266
- console.error(`em state set-conformance: ${lookup.message}`);
1270
+ let unruledTotal = 0;
1271
+ let unruledDescribe = "";
1272
+ const resolved = resolveFindingsForReport(modelDir, opts.report, revision);
1273
+ if (resolved.kind === "invalid") {
1274
+ console.error(`em state set-conformance: ${resolved.message}`);
1267
1275
  process.exit(1);
1268
1276
  }
1269
- else if (lookup.kind === "absent") {
1270
- console.error(`warn: no findings JSON found beside ${opts.report} — recording the marker without verifying every ` +
1277
+ else if (resolved.kind === "none") {
1278
+ console.error(`warn: no findings JSON found beside ${opts.report} (and no same-revision file) — recording the marker without verifying every ` +
1271
1279
  "finding is ruled (migration path for a report written before `em conform-findings`)");
1272
1280
  }
1273
1281
  else {
1274
- unruled = unruledFindingsInScope(lookup.doc.findings, inScope);
1282
+ const counted = unruledAcrossFiles(findingsFilesOf(resolved), inScope);
1283
+ unruledTotal = counted.total;
1284
+ unruledDescribe = counted.describe;
1275
1285
  }
1276
1286
  const partialFlag = opts.partial === true;
1277
- if (unruled.length > 0 && !partialFlag) {
1278
- console.error(`em state set-conformance: ${unruled.length} unruled conformance finding(s) among implemented slices ` +
1279
- `(id ${unruled.map((f) => f.id).join(", ")}) — rule on them (\`em conform-supersede --locus --by\`) or pass --partial`);
1287
+ if (unruledTotal > 0 && !partialFlag) {
1288
+ console.error(`em state set-conformance: ${unruledTotal} unruled conformance finding(s) among implemented slices ` +
1289
+ `in ${unruledDescribe} — rule on them (\`em conform-supersede --locus --by\`) or pass --partial`);
1280
1290
  process.exit(1);
1281
1291
  }
1282
- const recordPartial = partialFlag && unruled.length > 0;
1292
+ const recordPartial = partialFlag && unruledTotal > 0;
1283
1293
  if (recordPartial) {
1284
- console.error(`notice: conformance marker recorded as PARTIAL — ${unruled.length} finding(s) unruled`);
1294
+ console.error(`notice: conformance marker recorded as PARTIAL — ${unruledTotal} finding(s) unruled`);
1285
1295
  }
1286
1296
  const today = localIsoDate();
1287
1297
  // MIL-218 ruling D: a FULL (non-`--partial`) marker also certifies the current design
@@ -1296,7 +1306,8 @@ state
1296
1306
  // is where that problem gets its own diagnostic.
1297
1307
  let certifiedVersion = null;
1298
1308
  if (!recordPartial && compiledForCertify) {
1299
- const findingsPath = lookup.kind === "found" ? lookup.path : null;
1309
+ const readFiles = findingsFilesOf(resolved);
1310
+ const findingsPath = readFiles ? readFiles.map((f) => f.path).join(", ") : null;
1300
1311
  const certifyResult = runCertifyModelVersion(modelDir, compiledForCertify.model, compiledForCertify.refs, compiledForCertify.source, revision, today, opts.report, findingsPath);
1301
1312
  if (!certifyResult.ok) {
1302
1313
  console.error(`em state set-conformance: ${certifyResult.message}`);
@@ -1511,7 +1522,8 @@ program
1511
1522
  "report; idempotent on the same --as-of/--findings/--on stamp; refuses if the report " +
1512
1523
  "doesn't exist. --locus/--by (MIL-214, both required together) additionally record the " +
1513
1524
  "ruling itself — locus/resolvedBy/resolvedOn — on the findings named by --findings in the " +
1514
- "sibling conformance/<date>-findings.json, when one exists (warns once and stamps the " +
1525
+ "sibling conformance/<date>-findings.json, when one exists (refuses, naming them, when only " +
1526
+ "other findings files exist at the report's revision; warns once and stamps the " +
1515
1527
  "banner only when it doesn't — the migration path for a report predating em conform-findings)")
1516
1528
  .argument("<file>", "input .em file (used only to resolve the report path's base directory)")
1517
1529
  .argument("<report-path>", "path to the conformance report, relative to the model's directory")