spec-controller 0.1.174 → 0.1.176

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 +65 -44
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -16785,7 +16785,7 @@ var init_lexer = __esm({
16785
16785
  let parenDepth = 0;
16786
16786
  let parentParenDepth = 0;
16787
16787
  let parenDepths;
16788
- let reported = false;
16788
+ let reported2 = false;
16789
16789
  const src = this.src;
16790
16790
  const len = this.srcEnd;
16791
16791
  const start = this.pos;
@@ -16828,15 +16828,15 @@ var init_lexer = __esm({
16828
16828
  (parenDepths ?? (parenDepths = [])).push(parenDepth);
16829
16829
  depth++;
16830
16830
  parenDepth = 0;
16831
- if (depth + this._nestingDepth > MAX_SYNTAX_NESTING && !reported) {
16831
+ if (depth + this._nestingDepth > MAX_SYNTAX_NESTING && !reported2) {
16832
16832
  this.errors.push({ message: "maximum arithmetic expansion nesting depth exceeded", pos: this.pos - 1 });
16833
- reported = true;
16833
+ reported2 = true;
16834
16834
  }
16835
16835
  this.pos += 2;
16836
16836
  } else {
16837
- if (++parenDepth + depth - 1 + this._nestingDepth > MAX_SYNTAX_NESTING && !reported) {
16837
+ if (++parenDepth + depth - 1 + this._nestingDepth > MAX_SYNTAX_NESTING && !reported2) {
16838
16838
  this.errors.push({ message: "maximum arithmetic expression nesting depth exceeded", pos: this.pos });
16839
- reported = true;
16839
+ reported2 = true;
16840
16840
  }
16841
16841
  this.pos++;
16842
16842
  }
@@ -17042,16 +17042,16 @@ var init_lexer = __esm({
17042
17042
  const start = this.pos;
17043
17043
  this.pos++;
17044
17044
  let depth = 1;
17045
- let reported = false;
17045
+ let reported2 = false;
17046
17046
  while (this.pos < len && depth > 0) {
17047
17047
  const ch = src.charCodeAt(this.pos);
17048
17048
  if (ch === CH_DOLLAR) {
17049
17049
  const next = this.pos + 1 < len ? src.charCodeAt(this.pos + 1) : 0;
17050
17050
  if (next === CH_LBRACE) {
17051
17051
  depth++;
17052
- if (this._nestingDepth + depth > MAX_SYNTAX_NESTING && !reported) {
17052
+ if (this._nestingDepth + depth > MAX_SYNTAX_NESTING && !reported2) {
17053
17053
  this.errors.push({ message: "maximum parameter expansion nesting depth exceeded", pos: this.pos });
17054
- reported = true;
17054
+ reported2 = true;
17055
17055
  }
17056
17056
  this.pos += 2;
17057
17057
  continue;
@@ -17392,7 +17392,7 @@ var init_lexer = __esm({
17392
17392
  let arithBase = -1;
17393
17393
  let arithExtent = start >= 2 && src.charCodeAt(start) === CH_LPAREN && src.charCodeAt(start - 1) === CH_LPAREN && src.charCodeAt(start - 2) === CH_DOLLAR;
17394
17394
  let substitutions = 0;
17395
- let reported = false;
17395
+ let reported2 = false;
17396
17396
  const quotes = quoteOnly ? [{ close: CH_DQUOTE, depth: 0 }] : [];
17397
17397
  let quotedDepth = quoteOnly ? 1 : 0;
17398
17398
  let parameterDepth = 0;
@@ -17455,9 +17455,9 @@ var init_lexer = __esm({
17455
17455
  continue;
17456
17456
  }
17457
17457
  }
17458
- if (!reported && this._nestingDepth + Math.max(quotedDepth, parameterDepth) > MAX_SYNTAX_NESTING) {
17458
+ if (!reported2 && this._nestingDepth + Math.max(quotedDepth, parameterDepth) > MAX_SYNTAX_NESTING) {
17459
17459
  this.errors.push({ message: "maximum word nesting depth exceeded", pos: this.pos });
17460
- reported = true;
17460
+ reported2 = true;
17461
17461
  }
17462
17462
  if (!commandOpen) {
17463
17463
  this.pos++;
@@ -17523,9 +17523,9 @@ var init_lexer = __esm({
17523
17523
  substitutions++;
17524
17524
  else
17525
17525
  (arithmeticOpens ?? (arithmeticOpens = [])).push(depth);
17526
- if (substitutions + (arithmeticOpens?.length ?? 0) + this._nestingDepth + (quoteOnly ? 0 : 1) > MAX_SYNTAX_NESTING && !reported) {
17526
+ if (substitutions + (arithmeticOpens?.length ?? 0) + this._nestingDepth + (quoteOnly ? 0 : 1) > MAX_SYNTAX_NESTING && !reported2) {
17527
17527
  this.errors.push({ message: "maximum command substitution nesting depth exceeded", pos: commandDollarPos });
17528
- reported = true;
17528
+ reported2 = true;
17529
17529
  }
17530
17530
  }
17531
17531
  continuedDollarPos = -1;
@@ -28714,9 +28714,48 @@ var init_outcomeDescription = __esm({
28714
28714
  function cellSafe(text) {
28715
28715
  return text.replace(/\s+/g, " ").replace(/[\\|]/g, "\\$&").trim();
28716
28716
  }
28717
+ function cellSafeKeepingCodeSpans(text) {
28718
+ return text.replace(/\s+/g, " ").replace(SPAN_OR_ESCAPED, (found) => found.startsWith("`") ? found.replace(/\|/g, "\\|") : `\\${found}`);
28719
+ }
28720
+ var SPAN_OR_ESCAPED;
28717
28721
  var init_cellSafe = __esm({
28718
28722
  "../core/dist/render/cellSafe.js"() {
28719
28723
  "use strict";
28724
+ SPAN_OR_ESCAPED = /(`+)[\s\S]*?(?<!`)\1(?!`)|[\\|]/g;
28725
+ }
28726
+ });
28727
+
28728
+ // ../core/dist/render/codeSpan.js
28729
+ function codeSpan(written) {
28730
+ const text = spanHoldsAsWritten(written) ? written : JSON.stringify(written);
28731
+ const fence = "`".repeat(longestBacktickRun(text) + 1);
28732
+ const pad = text.startsWith("`") || text.endsWith("`") ? " " : "";
28733
+ return `${fence}${pad}${text}${pad}${fence}`;
28734
+ }
28735
+ function fencedBlockLines(info, text) {
28736
+ const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
28737
+ return [`${fence}${info}`, ...text.split("\n"), fence];
28738
+ }
28739
+ var spanHoldsAsWritten, longestBacktickRun;
28740
+ var init_codeSpan = __esm({
28741
+ "../core/dist/render/codeSpan.js"() {
28742
+ "use strict";
28743
+ spanHoldsAsWritten = (text) => text !== "" && !(text.startsWith(" ") && text.endsWith(" ")) && !/[\n\r]/.test(text) && !(text.startsWith('"') && text.endsWith('"'));
28744
+ longestBacktickRun = (text) => Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
28745
+ }
28746
+ });
28747
+
28748
+ // ../core/dist/render/reportedName.js
28749
+ function reportedName(text) {
28750
+ const name = text.replace(/\s+/g, " ").trim();
28751
+ return ROW_SEPARATOR.test(name) ? codeSpan(name) : name;
28752
+ }
28753
+ var ROW_SEPARATOR;
28754
+ var init_reportedName = __esm({
28755
+ "../core/dist/render/reportedName.js"() {
28756
+ "use strict";
28757
+ init_codeSpan();
28758
+ ROW_SEPARATOR = /; |: | \/ |, /;
28720
28759
  }
28721
28760
  });
28722
28761
 
@@ -28941,26 +28980,6 @@ var init_provenanceSection = __esm({
28941
28980
  }
28942
28981
  });
28943
28982
 
28944
- // ../core/dist/render/codeSpan.js
28945
- function codeSpan(written) {
28946
- const text = spanHoldsAsWritten(written) ? written : JSON.stringify(written);
28947
- const fence = "`".repeat(longestBacktickRun(text) + 1);
28948
- const pad = text.startsWith("`") || text.endsWith("`") ? " " : "";
28949
- return `${fence}${pad}${text}${pad}${fence}`;
28950
- }
28951
- function fencedBlockLines(info, text) {
28952
- const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
28953
- return [`${fence}${info}`, ...text.split("\n"), fence];
28954
- }
28955
- var spanHoldsAsWritten, longestBacktickRun;
28956
- var init_codeSpan = __esm({
28957
- "../core/dist/render/codeSpan.js"() {
28958
- "use strict";
28959
- spanHoldsAsWritten = (text) => text !== "" && !(text.startsWith(" ") && text.endsWith(" ")) && !/[\n\r]/.test(text) && !(text.startsWith('"') && text.endsWith('"'));
28960
- longestBacktickRun = (text) => Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
28961
- }
28962
- });
28963
-
28964
28983
  // ../core/dist/render/configurationNotRead.js
28965
28984
  function kindWords(kind) {
28966
28985
  switch (kind) {
@@ -29235,9 +29254,9 @@ function remarkWordsOf({ message, notes = [] }) {
29235
29254
  const words = [...message === void 0 || message.trim() === "" ? [] : [message], ...notes.map(noteWords)];
29236
29255
  return words.length === 0 ? void 0 : words.join(" ");
29237
29256
  }
29238
- function remarkHeadlineOf({ message, notes = [] }) {
29257
+ function remarkHeadlineOf({ message, notes = [] }, quote) {
29239
29258
  const headline = message?.split("\n").map((line) => line.replace(/\s+/g, " ").trim()).find((line) => line.length > 0);
29240
- return remarkWordsOf({ ...headline === void 0 ? {} : { message: headline }, notes });
29259
+ return remarkWordsOf({ ...headline === void 0 ? {} : { message: quote(headline) }, notes });
29241
29260
  }
29242
29261
  var init_remarkWords = __esm({
29243
29262
  "../core/dist/render/remarkWords.js"() {
@@ -29322,13 +29341,13 @@ function quotedSuffix(parts) {
29322
29341
  return where === "" ? "" : ` (${where})`;
29323
29342
  }
29324
29343
  function namedSuffix(o) {
29325
- return quotedSuffix(isFitnessObservation(o) ? [o.fitnessFunction] : [o.locator, o.testName]);
29344
+ return quotedSuffix((isFitnessObservation(o) ? [o.fitnessFunction] : [o.locator, o.testName]).map(reported));
29326
29345
  }
29327
29346
  function scenarioClauseOf({ scenario }) {
29328
- return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](scenario.feature, scenario.title)}`;
29347
+ return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](reportedName(scenario.feature), reportedName(scenario.title))}`;
29329
29348
  }
29330
29349
  function brokenSuffix(o) {
29331
- return quotedSuffix([o.locator, remarkHeadlineOf(o)]);
29350
+ return quotedSuffix([reported(o.locator), remarkHeadlineOf(o, reportedName)]);
29332
29351
  }
29333
29352
  function observationSuffix(o) {
29334
29353
  return `${namedSuffix(o)}${resultOf(o)}`;
@@ -29340,18 +29359,18 @@ function renderPendingItem(item) {
29340
29359
  return item.qualityCheckKind === void 0 ? CORE_MESSAGES[CoreMessage.PendingItem] : CORE_MESSAGES[CoreMessage.PendingItemFor](item.qualityCheckKind);
29341
29360
  }
29342
29361
  function renderFileGroup(group) {
29343
- const remarks = group.remarks.flatMap((remark) => remarkHeadlineOf(remark) ?? []);
29362
+ const remarks = group.remarks.flatMap((remark) => remarkHeadlineOf(remark, reportedName) ?? []);
29344
29363
  const code = group.sharedScnCode === void 0 ? [] : [CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)];
29345
29364
  const said = [.../* @__PURE__ */ new Set([...code, ...remarks])].filter((part) => part !== "").join(" / ");
29346
29365
  const counts = CORE_MESSAGES[CoreMessage.UnnamedClaimGroupCounts](group.ran, group.passed, group.failed);
29347
- const names = group.failedNames.map((name) => name.trim()).filter((name) => name !== "");
29366
+ const names = group.failedNames.map(reportedName).filter((name) => name !== "");
29348
29367
  const failed = names.length === 0 ? "" : ` ${CORE_MESSAGES[CoreMessage.UnnamedClaimFailedNames](names)}`;
29349
- return `${group.qualityCheckKind}: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${quotedSuffix([group.locator, said])} \u2014 ${counts}${failed}`;
29368
+ return `${group.qualityCheckKind}: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${quotedSuffix([reported(group.locator), said])} \u2014 ${counts}${failed}`;
29350
29369
  }
29351
29370
  function renderUnnamedClaimGroup(group) {
29352
29371
  if (!("names" in group))
29353
29372
  return renderFileGroup(group);
29354
- const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names);
29373
+ const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names.map(reportedName));
29355
29374
  const remark = group.sharedScnCode === void 0 ? "" : ` (${CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)})`;
29356
29375
  return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${remark} \u2014 ${steps}`;
29357
29376
  }
@@ -29361,7 +29380,7 @@ function renderUnnamedClaimItems(lines) {
29361
29380
  }
29362
29381
  function renderRowExceptions(s) {
29363
29382
  const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
29364
- const reconciling = items.map(cellSafe).join("; ");
29383
+ const reconciling = items.map(cellSafeKeepingCodeSpans).join("; ");
29365
29384
  const pending = s.pendingItems.map(renderPendingItem).join("; ");
29366
29385
  const groups = [reconciling, pending].filter((g) => g.length > 0);
29367
29386
  return groups.length === 0 ? "\u2014" : groups.join("; ");
@@ -29453,13 +29472,14 @@ function ledgerTableLines(claims, columns, stepsByQualityCheckKind) {
29453
29472
  function renderReport(report, inputNames, exitCodeOf2) {
29454
29473
  return SECTIONS.flatMap((section) => section(report, inputNames, exitCodeOf2)).join("\n");
29455
29474
  }
29456
- var RESULT_MESSAGE, titleSection, runIntegritySection, summaryViewsSection, EVIDENCE_RECONCILIATION_COLUMNS, EVIDENCE_RECONCILIATION_TERMS, evidenceReconciliationSection, byFeatureSection, ledgerSection, SECTIONS;
29475
+ var reported, RESULT_MESSAGE, titleSection, runIntegritySection, summaryViewsSection, EVIDENCE_RECONCILIATION_COLUMNS, EVIDENCE_RECONCILIATION_TERMS, evidenceReconciliationSection, byFeatureSection, ledgerSection, SECTIONS;
29457
29476
  var init_markdown = __esm({
29458
29477
  "../core/dist/render/markdown.js"() {
29459
29478
  "use strict";
29460
29479
  init_model();
29461
29480
  init_outcomeDescription();
29462
29481
  init_cellSafe();
29482
+ init_reportedName();
29463
29483
  init_qualityCheckReconciliation();
29464
29484
  init_journal();
29465
29485
  init_ledger();
@@ -29476,6 +29496,7 @@ var init_markdown = __esm({
29476
29496
  init_remarkWords();
29477
29497
  init_codeSpan();
29478
29498
  init_unnamedClaimGroups();
29499
+ reported = (part) => part === void 0 ? void 0 : reportedName(part);
29479
29500
  RESULT_MESSAGE = {
29480
29501
  passed: CoreMessage.ObservationPassed,
29481
29502
  failed: CoreMessage.ObservationFailed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.174",
3
+ "version": "0.1.176",
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.174"
29
+ "@3f-consulting/spec-controller-core": "0.1.176"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"