spec-controller 0.1.133 → 0.1.135

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 (2) hide show
  1. package/dist/cli.js +49 -53
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -28389,8 +28389,8 @@ var init_messages4 = __esm({
28389
28389
  CoreMessage2[CoreMessage2["EvidenceObservationsHeading"] = 80] = "EvidenceObservationsHeading";
28390
28390
  CoreMessage2[CoreMessage2["EvidenceObservationsSum"] = 81] = "EvidenceObservationsSum";
28391
28391
  CoreMessage2[CoreMessage2["EvidenceObservationsTableHeader"] = 82] = "EvidenceObservationsTableHeader";
28392
- CoreMessage2[CoreMessage2["BehaviouralRunnersHeading"] = 83] = "BehaviouralRunnersHeading";
28393
- CoreMessage2[CoreMessage2["BehaviouralRunnersTableHeader"] = 84] = "BehaviouralRunnersTableHeader";
28392
+ CoreMessage2[CoreMessage2["FitnessRunner"] = 83] = "FitnessRunner";
28393
+ CoreMessage2[CoreMessage2["FitnessCiStep"] = 84] = "FitnessCiStep";
28394
28394
  CoreMessage2[CoreMessage2["RunnerTierNamesNone"] = 85] = "RunnerTierNamesNone";
28395
28395
  CoreMessage2[CoreMessage2["RunnerTierUnnamed"] = 86] = "RunnerTierUnnamed";
28396
28396
  CoreMessage2[CoreMessage2["RunnerKeyNotATier"] = 87] = "RunnerKeyNotATier";
@@ -28556,11 +28556,11 @@ var init_messages4 = __esm({
28556
28556
  [CoreMessage.PendingTally]: (pending) => `${pending} Pending Item(s) \u2014 deferred, tallied apart from balanced and out-of-balance.`,
28557
28557
  [CoreMessage.EvidenceObservationsHeading]: "### Evidence observations",
28558
28558
  [CoreMessage.EvidenceObservationsSum]: (total, onScenario, onPhantomClaim, onUnnamedClaim) => `${total} evidence observations = ${onScenario} on scenarios + ${onPhantomClaim} on ${CITED_WITH_NO_SCENARIO} + ${onUnnamedClaim} citing no scenario.`,
28559
- [CoreMessage.EvidenceObservationsTableHeader]: "| Quality-check | Evidence observations |",
28560
- [CoreMessage.BehaviouralRunnersHeading]: "### Behavioural runners",
28561
- [CoreMessage.BehaviouralRunnersTableHeader]: "| Tier | Runner | Recognised at |",
28562
- [CoreMessage.RunnerTierNamesNone]: (tier) => `${tier} \u2014 no runner: the target names none.`,
28563
- [CoreMessage.RunnerTierUnnamed]: (tier) => `${tier} \u2014 unnamed: the target has not said.`,
28559
+ [CoreMessage.EvidenceObservationsTableHeader]: "| Quality-check | Evidence observations | Runner | CI step |",
28560
+ [CoreMessage.FitnessRunner]: "each fitness function's check step",
28561
+ [CoreMessage.FitnessCiStep]: "the step whose id is its @SCN",
28562
+ [CoreMessage.RunnerTierNamesNone]: "no runner: the target names none.",
28563
+ [CoreMessage.RunnerTierUnnamed]: "unnamed: the target has not said.",
28564
28564
  [CoreMessage.RunnerKeyNotATier]: (key) => `${key} \u2014 not a tier: the runner block is keyed by the four tiers, and this key excludes nothing.`,
28565
28565
  [CoreMessage.ReconcilerStep]: (step, whatItIs) => `${step} \u2014 the reconciler: ${whatItIs}.`,
28566
28566
  [CoreMessage.ReconcilerReconciles]: "this step runs the reconciliation this report is",
@@ -28637,7 +28637,7 @@ var init_messages4 = __esm({
28637
28637
  [CoreMessage.UnnamedClaimCiSteps]: (names) => `${names.length} CI step${names.length === 1 ? "" : "s"}: ${names.join(", ")}`,
28638
28638
  [CoreMessage.UnnamedClaimFailedNames]: (names) => `(failed: ${names.join(" / ")})`,
28639
28639
  [CoreMessage.SeveralScnCodes]: (codes) => `${codes.length} scenario codes cite ${codes.join(", ")} \u2014 a test cites exactly one scenario, so this one credits none of them.`,
28640
- [CoreMessage.SharedScnCode]: (code) => `${code} is carried by more than one scenario, so this test credits none of them.`
28640
+ [CoreMessage.SharedScnCode]: (code) => `${code} is carried by more than one scenario, so evidence citing it credits none of them.`
28641
28641
  };
28642
28642
  }
28643
28643
  });
@@ -28910,7 +28910,8 @@ var init_configurationNotRead = __esm({
28910
28910
  configurationNotReadSection = (report) => {
28911
28911
  const wrongKinds = report.errors?.configuration?.ofWrongKind ?? [];
28912
28912
  const unknownKeys = report.errors?.configuration?.keysNotRead ?? [];
28913
- if (wrongKinds.length === 0 && unknownKeys.length === 0)
28913
+ const runnerKeysNotATier = report.errors?.configuration?.runnerKeysNotATier ?? [];
28914
+ if (wrongKinds.length === 0 && unknownKeys.length === 0 && runnerKeysNotATier.length === 0)
28914
28915
  return [];
28915
28916
  return [
28916
28917
  CORE_MESSAGES[CoreMessage.ConfigurationNotReadHeading],
@@ -28919,44 +28920,13 @@ var init_configurationNotRead = __esm({
28919
28920
  "",
28920
28921
  ...wrongKinds.map(({ entry, is, reads }) => `- ${CORE_MESSAGES[CoreMessage.ConfigurationWrongKind](`\`${entry}\``, kindWords(is), kindWords(reads))}`),
28921
28922
  ...unknownKeys.map((key) => `- ${CORE_MESSAGES[CoreMessage.ConfigurationUnknownKey](`\`specController.${key}\``)}`),
28923
+ ...runnerKeysNotATier.map((key) => `- ${CORE_MESSAGES[CoreMessage.RunnerKeyNotATier](key)}`),
28922
28924
  ""
28923
28925
  ];
28924
28926
  };
28925
28927
  }
28926
28928
  });
28927
28929
 
28928
- // ../core/dist/render/behaviouralRunners.js
28929
- var runnerTierAccount, unrecognisedKeyAccount, runnerRows, behaviouralRunnersSection;
28930
- var init_behaviouralRunners = __esm({
28931
- "../core/dist/render/behaviouralRunners.js"() {
28932
- "use strict";
28933
- init_messages4();
28934
- runnerTierAccount = (tiers) => (tiers ?? []).map(({ tier, namesNone }) => namesNone ? `- ${CORE_MESSAGES[CoreMessage.RunnerTierNamesNone](tier)}` : `- ${CORE_MESSAGES[CoreMessage.RunnerTierUnnamed](tier)}`);
28935
- unrecognisedKeyAccount = (keys) => (keys ?? []).map((key) => `- ${CORE_MESSAGES[CoreMessage.RunnerKeyNotATier](key)}`);
28936
- runnerRows = (report) => (report.summary.evidenceObservations?.byQualityCheck ?? []).flatMap(({ qualityCheck, runner, ciSteps }) => runner === void 0 ? [] : (ciSteps ?? []).map((step) => ({ tier: qualityCheck, runner, step })));
28937
- behaviouralRunnersSection = (report) => {
28938
- const runners = runnerRows(report);
28939
- const account = [
28940
- ...runnerTierAccount(report.summary.tiersWithoutRunner),
28941
- ...unrecognisedKeyAccount(report.errors?.configuration?.runnerKeysNotATier)
28942
- ];
28943
- if (runners.length === 0 && account.length === 0)
28944
- return [];
28945
- return [
28946
- CORE_MESSAGES[CoreMessage.BehaviouralRunnersHeading],
28947
- "",
28948
- ...runners.length > 0 ? [
28949
- CORE_MESSAGES[CoreMessage.BehaviouralRunnersTableHeader],
28950
- "| --- | --- | --- |",
28951
- ...runners.map(({ tier, runner, step }) => `| ${tier} | ${runner} | ${step} |`),
28952
- ""
28953
- ] : [],
28954
- ...account.length > 0 ? [...account, ""] : []
28955
- ];
28956
- };
28957
- }
28958
- });
28959
-
28960
28930
  // ../core/dist/render/stepAccounting.js
28961
28931
  var verdictOf, rowOf, jobRowsOf, totalRowOf, WHAT_IT_IS, runnersListOf, reconcilerListOf, excludedListOf, plumbingListOf, stepAccountingSection;
28962
28932
  var init_stepAccounting = __esm({
@@ -29045,11 +29015,27 @@ var init_stepAccounting = __esm({
29045
29015
  });
29046
29016
 
29047
29017
  // ../core/dist/render/testVolume.js
29048
- var testVolumeSection;
29018
+ var tierNote, runnerCells, testVolumeSection;
29049
29019
  var init_testVolume = __esm({
29050
29020
  "../core/dist/render/testVolume.js"() {
29051
29021
  "use strict";
29052
29022
  init_messages4();
29023
+ tierNote = (qualityCheck, tiersWithoutRunner) => {
29024
+ const without = tiersWithoutRunner.find(({ tier }) => tier === qualityCheck);
29025
+ if (without === void 0)
29026
+ return "";
29027
+ return CORE_MESSAGES[without.namesNone ? CoreMessage.RunnerTierNamesNone : CoreMessage.RunnerTierUnnamed];
29028
+ };
29029
+ runnerCells = ({ qualityCheck, count, runner, ciSteps }, tiersWithoutRunner) => {
29030
+ if (count === 0)
29031
+ return ["", ""];
29032
+ if (qualityCheck === "fitness") {
29033
+ return [CORE_MESSAGES[CoreMessage.FitnessRunner], CORE_MESSAGES[CoreMessage.FitnessCiStep]];
29034
+ }
29035
+ if (runner === void 0)
29036
+ return [tierNote(qualityCheck, tiersWithoutRunner), ""];
29037
+ return [runner, (ciSteps ?? []).join(", ")];
29038
+ };
29053
29039
  testVolumeSection = (report) => {
29054
29040
  const observations = report.summary.evidenceObservations;
29055
29041
  if (!observations)
@@ -29060,10 +29046,11 @@ var init_testVolume = __esm({
29060
29046
  CORE_MESSAGES[CoreMessage.EvidenceObservationsSum](observations.total, observations.onScenario, observations.onPhantomClaim, observations.onUnnamedClaim),
29061
29047
  "",
29062
29048
  CORE_MESSAGES[CoreMessage.EvidenceObservationsTableHeader],
29063
- "| --- | --- |"
29049
+ "| --- | --- | --- | --- |"
29064
29050
  ];
29065
- for (const { qualityCheck, count } of observations.byQualityCheck) {
29066
- lines.push(`| ${qualityCheck} | ${count} |`);
29051
+ for (const entry of observations.byQualityCheck) {
29052
+ const [runner, ciSteps] = runnerCells(entry, report.summary.tiersWithoutRunner ?? []);
29053
+ lines.push(`| ${entry.qualityCheck} | ${entry.count} | ${runner} | ${ciSteps} |`);
29067
29054
  }
29068
29055
  lines.push("");
29069
29056
  return lines;
@@ -29138,8 +29125,12 @@ var init_remarkWords = __esm({
29138
29125
  function citingNoScenario(lines) {
29139
29126
  return lines.filter((line) => line.outcome === "cites-no-scenario").flatMap((line) => line.evidenceObservation ?? []);
29140
29127
  }
29128
+ function sharedScnCodeOf(observation) {
29129
+ const [code = null] = (observation.notes ?? []).flatMap((note) => note.kind === "shared-scn-code" ? [note.code] : []);
29130
+ return code;
29131
+ }
29141
29132
  function keyOf(observation) {
29142
- return JSON.stringify([observation.qualityCheck, observation.locator ?? null]);
29133
+ return JSON.stringify([observation.qualityCheck, observation.locator ?? null, sharedScnCodeOf(observation)]);
29143
29134
  }
29144
29135
  function remarksOf(observations) {
29145
29136
  return observations.flatMap(({ message, notes }) => message === void 0 && notes === void 0 ? [] : [{ ...message !== void 0 ? { message } : {}, ...notes !== void 0 ? { notes } : {} }]);
@@ -29157,9 +29148,15 @@ function groupOf(observations) {
29157
29148
  failedNames: observations.flatMap((o) => o.status === "failed" && o.testName !== void 0 ? [o.testName] : [])
29158
29149
  };
29159
29150
  }
29160
- function stepsGroupOf(observations) {
29161
- const names = observations.flatMap((o) => isFitnessObservation(o) ? [o.fitnessFunction] : []);
29162
- return names.length === 0 ? [] : [{ names }];
29151
+ function stepsGroupsOf(observations) {
29152
+ const byCode = /* @__PURE__ */ new Map();
29153
+ for (const o of observations) {
29154
+ if (!isFitnessObservation(o))
29155
+ continue;
29156
+ const code = sharedScnCodeOf(o);
29157
+ byCode.set(code, [...byCode.get(code) ?? [], o.fitnessFunction]);
29158
+ }
29159
+ return [...byCode].map(([code, names]) => code === null ? { names } : { names, sharedScnCode: code });
29163
29160
  }
29164
29161
  function unnamedClaimGroupsOf(lines) {
29165
29162
  const observations = citingNoScenario(lines);
@@ -29170,7 +29167,7 @@ function unnamedClaimGroupsOf(lines) {
29170
29167
  const key = keyOf(o);
29171
29168
  byFile.set(key, [...byFile.get(key) ?? [], o]);
29172
29169
  }
29173
- return [...[...byFile.values()].map(groupOf), ...stepsGroupOf(observations)];
29170
+ return [...[...byFile.values()].map(groupOf), ...stepsGroupsOf(observations)];
29174
29171
  }
29175
29172
  var init_unnamedClaimGroups = __esm({
29176
29173
  "../core/dist/domain/unnamedClaimGroups.js"() {
@@ -29228,7 +29225,8 @@ function renderUnnamedClaimGroup(group) {
29228
29225
  if (!("names" in group))
29229
29226
  return renderFileGroup(group);
29230
29227
  const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names);
29231
- return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]} \u2014 ${steps}`;
29228
+ const remark = group.sharedScnCode === void 0 ? "" : ` (${CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)})`;
29229
+ return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${remark} \u2014 ${steps}`;
29232
29230
  }
29233
29231
  function renderUnnamedClaimItems(lines) {
29234
29232
  const broken = lines.filter((line) => line.outcome === "broken");
@@ -29340,7 +29338,6 @@ var init_markdown = __esm({
29340
29338
  init_scenarioCodeErrorsSection();
29341
29339
  init_provenanceSection();
29342
29340
  init_configurationNotRead();
29343
- init_behaviouralRunners();
29344
29341
  init_stepAccounting();
29345
29342
  init_testVolume();
29346
29343
  init_evidenceGrid();
@@ -29487,7 +29484,6 @@ var init_markdown = __esm({
29487
29484
  scenarioCodesCleanStatement,
29488
29485
  evidenceReconciliationSection,
29489
29486
  testVolumeSection,
29490
- behaviouralRunnersSection,
29491
29487
  stepAccountingSection,
29492
29488
  fitnessSection,
29493
29489
  byFeatureSection,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
4
4
  "description": "Reconcile the behaviour your scenarios name against the evidence that actually ran — the deterministic `balance` CLI.",
5
5
  "keywords": [
6
6
  "reconciliation",
@@ -26,7 +26,7 @@
26
26
  "fast-xml-parser": "^5.11.2",
27
27
  "ts-json-schema-generator": "^2.9.0",
28
28
  "yaml": "^2.9.0",
29
- "@3f-consulting/spec-controller-core": "0.1.133"
29
+ "@3f-consulting/spec-controller-core": "0.1.135"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"