spec-controller 0.1.168 → 0.1.170

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 +17 -10
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -28654,7 +28654,11 @@ var init_messages4 = __esm({
28654
28654
  [CoreMessage.ObservationPassed]: "passed",
28655
28655
  [CoreMessage.ObservationFailed]: "failed",
28656
28656
  [CoreMessage.UnnamedClaimGroupCounts]: (ran, passed, failed) => `${ran} ran, ${passed} passed, ${failed} failed`,
28657
- [CoreMessage.UnnamedClaimCiSteps]: (names) => `${names.length} CI step${names.length === 1 ? "" : "s"}: ${names.join(", ")}`,
28657
+ [CoreMessage.UnnamedClaimCiSteps]: (names) => {
28658
+ const named = names.map((name) => name.trim()).filter((name) => name !== "");
28659
+ const listed = named.length === 0 ? "" : `: ${named.join(", ")}`;
28660
+ return `${names.length} CI step${names.length === 1 ? "" : "s"}${listed}`;
28661
+ },
28658
28662
  [CoreMessage.UnnamedClaimFailedNames]: (names) => `(failed: ${names.join(" / ")})`,
28659
28663
  [CoreMessage.SeveralScnCodes]: (codes) => `${codes.length} scenario codes cite ${codes.join(", ")} \u2014 a test cites exactly one scenario, so this one credits none of them.`,
28660
28664
  [CoreMessage.SharedScnCode]: (code) => `${code} is carried by more than one scenario, so evidence citing it credits none of them.`
@@ -28918,16 +28922,20 @@ var init_provenanceSection = __esm({
28918
28922
  // ../core/dist/render/codeSpan.js
28919
28923
  function codeSpan(written) {
28920
28924
  const text = spanHoldsAsWritten(written) ? written : JSON.stringify(written);
28921
- const longestRun = Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
28922
- const fence = "`".repeat(longestRun + 1);
28925
+ const fence = "`".repeat(longestBacktickRun(text) + 1);
28923
28926
  const pad = text.startsWith("`") || text.endsWith("`") ? " " : "";
28924
28927
  return `${fence}${pad}${text}${pad}${fence}`;
28925
28928
  }
28926
- var spanHoldsAsWritten;
28929
+ function fencedBlockLines(info, text) {
28930
+ const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
28931
+ return [`${fence}${info}`, ...text.split("\n"), fence];
28932
+ }
28933
+ var spanHoldsAsWritten, longestBacktickRun;
28927
28934
  var init_codeSpan = __esm({
28928
28935
  "../core/dist/render/codeSpan.js"() {
28929
28936
  "use strict";
28930
28937
  spanHoldsAsWritten = (text) => text !== "" && !(text.startsWith(" ") && text.endsWith(" ")) && !/[\n\r]/.test(text) && !(text.startsWith('"') && text.endsWith('"'));
28938
+ longestBacktickRun = (text) => Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
28931
28939
  }
28932
28940
  });
28933
28941
 
@@ -29189,11 +29197,11 @@ function checkStepWords(code, outcome) {
29189
29197
  return CORE_MESSAGES[CoreMessage.CheckStepEnded](code, outcome);
29190
29198
  }
29191
29199
  function remarkWordsOf({ message, notes = [] }) {
29192
- const words = [...message === void 0 ? [] : [message], ...notes.map(noteWords)];
29200
+ const words = [...message === void 0 || message.trim() === "" ? [] : [message], ...notes.map(noteWords)];
29193
29201
  return words.length === 0 ? void 0 : words.join(" ");
29194
29202
  }
29195
29203
  function remarkHeadlineOf({ message, notes = [] }) {
29196
- const headline = message?.split("\n").map((line) => line.trim()).find((line) => line.length > 0);
29204
+ const headline = message?.split("\n").map((line) => line.replace(/\s+/g, " ").trim()).find((line) => line.length > 0);
29197
29205
  return remarkWordsOf({ ...headline === void 0 ? {} : { message: headline }, notes });
29198
29206
  }
29199
29207
  var init_remarkWords = __esm({
@@ -29431,6 +29439,7 @@ var init_markdown = __esm({
29431
29439
  init_evidenceGrid();
29432
29440
  init_messages4();
29433
29441
  init_remarkWords();
29442
+ init_codeSpan();
29434
29443
  init_unnamedClaimGroups();
29435
29444
  RESULT_MESSAGE = {
29436
29445
  passed: CoreMessage.ObservationPassed,
@@ -29452,12 +29461,10 @@ var init_markdown = __esm({
29452
29461
  ""
29453
29462
  ];
29454
29463
  for (const item of brokenObservations) {
29455
- const locator = item.locator ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
29464
+ const locator = item.locator?.trim() ? item.locator : CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
29456
29465
  lines.push(`- ${CORE_MESSAGES[CoreMessage.BrokenEvidenceWhatBroke](`\`${locator}\``)}`);
29457
29466
  lines.push("");
29458
- lines.push("```text");
29459
- lines.push(...(remarkWordsOf(item) ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNoMessage]).split("\n"));
29460
- lines.push("```");
29467
+ lines.push(...fencedBlockLines("text", remarkWordsOf(item) ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNoMessage]));
29461
29468
  lines.push("");
29462
29469
  }
29463
29470
  return lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.168",
3
+ "version": "0.1.170",
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.168"
29
+ "@3f-consulting/spec-controller-core": "0.1.170"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"