spec-controller 0.1.169 → 0.1.171

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 +25 -17
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -12082,7 +12082,7 @@ function observationCountOf(row, qualityCheckKind) {
12082
12082
  }
12083
12083
  function stepsAt(row, qualityCheckKind, stepsByQualityCheckKind) {
12084
12084
  if (qualityCheckKind === "fitness") {
12085
- return observationsOf(row).flatMap((o) => ranAsFitnessFunction(o) && o.step !== void 0 ? [o.step] : []);
12085
+ return observationsOf(row).flatMap((o) => isFitnessObservation(o) && o.step !== void 0 ? [o.step] : []);
12086
12086
  }
12087
12087
  const observed = observationsOf(row).some((o) => o.qualityCheckKind === qualityCheckKind);
12088
12088
  if (!namesQualityCheckKind(row, qualityCheckKind) && !observed)
@@ -27687,7 +27687,7 @@ function stepAccountOf(steps, dispositionOf, nameOf2, roleOf) {
27687
27687
  return {
27688
27688
  byJob,
27689
27689
  total: totalOf(byJob),
27690
- steps: stepsBehindCounts([...steps].sort(byWorkflowThenJob), dispositionOf, nameOf2, roleOf)
27690
+ steps: stepsBehindCounts(stepsInAccountingOrder(steps), dispositionOf, nameOf2, roleOf)
27691
27691
  };
27692
27692
  }
27693
27693
  function declaredRunnersRunBy(scripts, runners, shell) {
@@ -27709,7 +27709,11 @@ function recognisedRunners(steps, nameOf2, scripts, runners, shell) {
27709
27709
  step: nameOf2(step)
27710
27710
  })));
27711
27711
  }
27712
- var WORKFLOW_FILE_THEN_COLON, jobKeyOf, byCodeUnit, byWorkflowThenJob, workflowsReadInOrder, COUNTED_AS, noStepsOf;
27712
+ function countedRunners(steps, dispositionOf, nameOf2, scripts, runners, shell) {
27713
+ const counted2 = stepsInAccountingOrder(steps).filter((step) => dispositionOf(step) === "runner");
27714
+ return recognisedRunners(counted2, nameOf2, scripts, runners, shell);
27715
+ }
27716
+ var WORKFLOW_FILE_THEN_COLON, jobKeyOf, byCodeUnit, byWorkflowThenJob, stepsInAccountingOrder, workflowsReadInOrder, COUNTED_AS, noStepsOf;
27713
27717
  var init_uncitedFitnessFunctions = __esm({
27714
27718
  "../core/dist/domain/uncitedFitnessFunctions.js"() {
27715
27719
  "use strict";
@@ -27717,6 +27721,7 @@ var init_uncitedFitnessFunctions = __esm({
27717
27721
  jobKeyOf = (step) => `${step.workflow}:${step.job}`;
27718
27722
  byCodeUnit = (a, b) => a < b ? -1 : a > b ? 1 : 0;
27719
27723
  byWorkflowThenJob = (a, b) => byCodeUnit(a.workflow, b.workflow) || byCodeUnit(a.job, b.job);
27724
+ stepsInAccountingOrder = (steps) => [...steps].sort(byWorkflowThenJob);
27720
27725
  workflowsReadInOrder = (files) => [...files].sort(byCodeUnit);
27721
27726
  COUNTED_AS = {
27722
27727
  candidate: "candidates",
@@ -28221,7 +28226,7 @@ function withScenarioCodeErrors(reconciliation, input) {
28221
28226
  };
28222
28227
  }
28223
28228
  function withReaderAccounts(reconciliation, packageJson, { steps, runners, notApplied, workflowsRead, reconciler, dispositionOf }) {
28224
- return withStepAccounting(withUnmatchedNonChecks(withRunnerAccount(reconciliation, steps, packageJson, runners), notApplied), steps, dispositionOf, reconciler.roleOf, { namingAWorkflowNotRead: notApplied.namingAWorkflowNotRead, workflowsRead });
28229
+ return withStepAccounting(withUnmatchedNonChecks(withRunnerAccount(reconciliation, steps, dispositionOf, packageJson, runners), notApplied), steps, dispositionOf, reconciler.roleOf, { namingAWorkflowNotRead: notApplied.namingAWorkflowNotRead, workflowsRead });
28225
28230
  }
28226
28231
  function withStepAccounting(reconciliation, steps, dispositionOf, roleOf, { namingAWorkflowNotRead, workflowsRead }) {
28227
28232
  if (steps.length === 0)
@@ -28248,16 +28253,16 @@ function withUnmatchedNonChecks(reconciliation, { matchingNoStep, notAStepName }
28248
28253
  }
28249
28254
  };
28250
28255
  }
28251
- function withRunnerAccount(reconciliation, steps, packageJson, { layers: runnerLayers, unrecognisedKeys }) {
28256
+ function withRunnerAccount(reconciliation, steps, dispositionOf, packageJson, { layers: runnerLayers, unrecognisedKeys }) {
28252
28257
  const scripts = packageJson.scripts ?? {};
28253
- const behaviouralRunners = recognisedRunners(steps, qualifiedStepName, scripts, runnerLayers, shellReading);
28258
+ const behaviouralRunners = countedRunners(steps, dispositionOf, qualifiedStepName, scripts, runnerLayers, shellReading);
28254
28259
  const { evidenceObservations } = reconciliation.summary;
28255
28260
  return {
28256
28261
  ...reconciliation,
28257
28262
  summary: {
28258
28263
  ...reconciliation.summary,
28259
28264
  ...evidenceObservations === void 0 ? {} : {
28260
- evidenceObservations: ciStepsJoined(evidenceObservations, reconciliation.ledger, behaviouralRunners, runnerLayers, steps.map(qualifiedStepName))
28265
+ evidenceObservations: ciStepsJoined(evidenceObservations, reconciliation.ledger, behaviouralRunners, runnerLayers, stepsInAccountingOrder(steps).map(qualifiedStepName))
28261
28266
  },
28262
28267
  ...unrecognisedKeys.length > 0 ? { runnerKeysNotALayer: unrecognisedKeys } : {}
28263
28268
  }
@@ -28416,7 +28421,7 @@ var init_messages4 = __esm({
28416
28421
  CoreMessage2[CoreMessage2["FitnessCiStep"] = 85] = "FitnessCiStep";
28417
28422
  CoreMessage2[CoreMessage2["RunnerLayerNamesNone"] = 86] = "RunnerLayerNamesNone";
28418
28423
  CoreMessage2[CoreMessage2["RunnerLayerUnnamed"] = 87] = "RunnerLayerUnnamed";
28419
- CoreMessage2[CoreMessage2["NoStepReadRunsIt"] = 88] = "NoStepReadRunsIt";
28424
+ CoreMessage2[CoreMessage2["NoStepCountedAsItsRunnerRunsIt"] = 88] = "NoStepCountedAsItsRunnerRunsIt";
28420
28425
  CoreMessage2[CoreMessage2["RunnerKeyNotALayer"] = 89] = "RunnerKeyNotALayer";
28421
28426
  CoreMessage2[CoreMessage2["ReconcilerStep"] = 90] = "ReconcilerStep";
28422
28427
  CoreMessage2[CoreMessage2["ReconcilerReconciles"] = 91] = "ReconcilerReconciles";
@@ -28583,7 +28588,7 @@ var init_messages4 = __esm({
28583
28588
  [CoreMessage.FitnessCiStep]: (steps) => `${steps} step(s), each named on its fitness function's row of Claim Reconciliations.`,
28584
28589
  [CoreMessage.RunnerLayerNamesNone]: "no runner: the target names none.",
28585
28590
  [CoreMessage.RunnerLayerUnnamed]: "unnamed: the target has not said.",
28586
- [CoreMessage.NoStepReadRunsIt]: "no step read runs it.",
28591
+ [CoreMessage.NoStepCountedAsItsRunnerRunsIt]: "no step counted as its runner runs it.",
28587
28592
  [CoreMessage.RunnerKeyNotALayer]: (key) => `${key} \u2014 not a tier: the runner block is keyed by the four tiers, and this key excludes nothing.`,
28588
28593
  [CoreMessage.ReconcilerStep]: (step, whatItIs) => `${step} \u2014 the reconciler: ${whatItIs}.`,
28589
28594
  [CoreMessage.ReconcilerReconciles]: "this step runs the reconciliation this report is",
@@ -28922,16 +28927,20 @@ var init_provenanceSection = __esm({
28922
28927
  // ../core/dist/render/codeSpan.js
28923
28928
  function codeSpan(written) {
28924
28929
  const text = spanHoldsAsWritten(written) ? written : JSON.stringify(written);
28925
- const longestRun = Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
28926
- const fence = "`".repeat(longestRun + 1);
28930
+ const fence = "`".repeat(longestBacktickRun(text) + 1);
28927
28931
  const pad = text.startsWith("`") || text.endsWith("`") ? " " : "";
28928
28932
  return `${fence}${pad}${text}${pad}${fence}`;
28929
28933
  }
28930
- var spanHoldsAsWritten;
28934
+ function fencedBlockLines(info, text) {
28935
+ const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
28936
+ return [`${fence}${info}`, ...text.split("\n"), fence];
28937
+ }
28938
+ var spanHoldsAsWritten, longestBacktickRun;
28931
28939
  var init_codeSpan = __esm({
28932
28940
  "../core/dist/render/codeSpan.js"() {
28933
28941
  "use strict";
28934
28942
  spanHoldsAsWritten = (text) => text !== "" && !(text.startsWith(" ") && text.endsWith(" ")) && !/[\n\r]/.test(text) && !(text.startsWith('"') && text.endsWith('"'));
28943
+ longestBacktickRun = (text) => Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
28935
28944
  }
28936
28945
  });
28937
28946
 
@@ -29106,7 +29115,7 @@ var init_evidenceObservations = __esm({
29106
29115
  if (typeof runner === "string") {
29107
29116
  return [
29108
29117
  cellSafe(runner),
29109
- ciSteps ? cellSafe(ciSteps.join(", ")) : CORE_MESSAGES[CoreMessage.NoStepReadRunsIt]
29118
+ ciSteps ? cellSafe(ciSteps.join(", ")) : CORE_MESSAGES[CoreMessage.NoStepCountedAsItsRunnerRunsIt]
29110
29119
  ];
29111
29120
  }
29112
29121
  if (qualityCheckKind === "fitness") {
@@ -29193,7 +29202,7 @@ function checkStepWords(code, outcome) {
29193
29202
  return CORE_MESSAGES[CoreMessage.CheckStepEnded](code, outcome);
29194
29203
  }
29195
29204
  function remarkWordsOf({ message, notes = [] }) {
29196
- const words = [...message === void 0 ? [] : [message], ...notes.map(noteWords)];
29205
+ const words = [...message === void 0 || message.trim() === "" ? [] : [message], ...notes.map(noteWords)];
29197
29206
  return words.length === 0 ? void 0 : words.join(" ");
29198
29207
  }
29199
29208
  function remarkHeadlineOf({ message, notes = [] }) {
@@ -29435,6 +29444,7 @@ var init_markdown = __esm({
29435
29444
  init_evidenceGrid();
29436
29445
  init_messages4();
29437
29446
  init_remarkWords();
29447
+ init_codeSpan();
29438
29448
  init_unnamedClaimGroups();
29439
29449
  RESULT_MESSAGE = {
29440
29450
  passed: CoreMessage.ObservationPassed,
@@ -29459,9 +29469,7 @@ var init_markdown = __esm({
29459
29469
  const locator = item.locator?.trim() ? item.locator : CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
29460
29470
  lines.push(`- ${CORE_MESSAGES[CoreMessage.BrokenEvidenceWhatBroke](`\`${locator}\``)}`);
29461
29471
  lines.push("");
29462
- lines.push("```text");
29463
- lines.push(...(remarkWordsOf(item) ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNoMessage]).split("\n"));
29464
- lines.push("```");
29472
+ lines.push(...fencedBlockLines("text", remarkWordsOf(item) ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNoMessage]));
29465
29473
  lines.push("");
29466
29474
  }
29467
29475
  return lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.169",
3
+ "version": "0.1.171",
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.169"
29
+ "@3f-consulting/spec-controller-core": "0.1.171"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"