spec-controller 0.1.155 → 0.1.156

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 +20 -25
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -28657,7 +28657,7 @@ var init_outcomeDescription = __esm({
28657
28657
 
28658
28658
  // ../core/dist/render/cellSafe.js
28659
28659
  function cellSafe(text) {
28660
- return text.replace(/\s+/g, " ").replace(/\|/g, "\\|").trim();
28660
+ return text.replace(/\s+/g, " ").replace(/[\\|]/g, "\\$&").trim();
28661
28661
  }
28662
28662
  var init_cellSafe = __esm({
28663
28663
  "../core/dist/render/cellSafe.js"() {
@@ -29160,6 +29160,10 @@ function remarkWordsOf({ message, notes = [] }) {
29160
29160
  const words = [...message === void 0 ? [] : [message], ...notes.map(noteWords)];
29161
29161
  return words.length === 0 ? void 0 : words.join(" ");
29162
29162
  }
29163
+ function remarkHeadlineOf({ message, notes = [] }) {
29164
+ const headline = message?.split("\n").map((line) => line.trim()).find((line) => line.length > 0);
29165
+ return remarkWordsOf({ ...headline === void 0 ? {} : { message: headline }, notes });
29166
+ }
29163
29167
  var init_remarkWords = __esm({
29164
29168
  "../core/dist/render/remarkWords.js"() {
29165
29169
  "use strict";
@@ -29175,19 +29179,15 @@ function sharedScnCodeOf(observation) {
29175
29179
  const [code = null] = (observation.notes ?? []).flatMap((note) => note.kind === "shared-scn-code" ? [note.code] : []);
29176
29180
  return code;
29177
29181
  }
29178
- function keyOf(observation) {
29179
- return JSON.stringify([observation.qualityCheck, observation.locator ?? null, sharedScnCodeOf(observation)]);
29180
- }
29181
29182
  function remarksOf(observations) {
29182
29183
  return observations.flatMap(({ message, notes = [] }) => {
29183
29184
  const kept = notes.filter((note) => note.kind !== "shared-scn-code");
29184
- return message === void 0 && kept.length === 0 ? [] : [{ ...message !== void 0 ? { message } : {}, notes: kept }];
29185
+ return message === void 0 && kept.length === 0 ? [] : [{ ...message !== void 0 ? { message } : {}, ...kept.length > 0 ? { notes: kept } : {} }];
29185
29186
  });
29186
29187
  }
29187
- function groupOf(observations) {
29188
+ function groupOf(sharedScnCode, observations) {
29188
29189
  const [first] = observations;
29189
29190
  const passed = observations.filter((o) => o.status === "passed").length;
29190
- const sharedScnCode = sharedScnCodeOf(first);
29191
29191
  return {
29192
29192
  qualityCheck: first.qualityCheck,
29193
29193
  locator: first.locator,
@@ -29215,10 +29215,11 @@ function unnamedClaimGroupsOf(lines) {
29215
29215
  for (const o of observations) {
29216
29216
  if (isFitnessObservation(o))
29217
29217
  continue;
29218
- const key = keyOf(o);
29219
- byFile.set(key, [...byFile.get(key) ?? [], o]);
29218
+ const code = sharedScnCodeOf(o);
29219
+ const key = JSON.stringify([o.qualityCheck, o.locator ?? null, code]);
29220
+ byFile.set(key, { code, members: [...byFile.get(key)?.members ?? [], o] });
29220
29221
  }
29221
- return [...[...byFile.values()].map(groupOf), ...stepsGroupsOf(observations)];
29222
+ return [...[...byFile.values()].map(({ code, members }) => groupOf(code, members)), ...stepsGroupsOf(observations)];
29222
29223
  }
29223
29224
  var init_unnamedClaimGroups = __esm({
29224
29225
  "../core/dist/domain/unnamedClaimGroups.js"() {
@@ -29242,7 +29243,7 @@ function renderLine(line) {
29242
29243
  return `${head}${line.outcome === "broken" ? brokenSuffix(observation) : observationSuffix(observation)}`;
29243
29244
  }
29244
29245
  function quotedSuffix(parts) {
29245
- const where = parts.flatMap((part) => cellSafe(part ?? "") || []).join(": ");
29246
+ const where = parts.flatMap((part) => part?.trim() || []).join(": ");
29246
29247
  return where === "" ? "" : ` (${where})`;
29247
29248
  }
29248
29249
  function namedSuffix(o) {
@@ -29252,31 +29253,25 @@ function scenarioClauseOf({ scenario }) {
29252
29253
  return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](scenario.feature, scenario.title)}`;
29253
29254
  }
29254
29255
  function brokenSuffix(o) {
29255
- const remark = remarkWordsOf(o);
29256
- const where = [o.locator, remark === void 0 ? void 0 : headlineOf(remark)].filter((part) => part !== void 0 && part.length > 0).join(": ");
29257
- return where.length > 0 ? ` (${cellSafe(where)})` : "";
29256
+ return quotedSuffix([o.locator, remarkHeadlineOf(o)]);
29258
29257
  }
29259
29258
  function observationSuffix(o) {
29260
- return `${quotedSuffix([isFitnessObservation(o) ? o.fitnessFunction : o.locator])}${resultOf(o)}`;
29259
+ return `${namedSuffix(o)}${resultOf(o)}`;
29261
29260
  }
29262
29261
  function resultOf(o) {
29263
29262
  return o.status === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[RESULT_MESSAGE[o.status]]}`;
29264
29263
  }
29265
- function headlineOf(message) {
29266
- return message.split("\n").map((line) => line.trim()).find((line) => line.length > 0) ?? "";
29267
- }
29268
29264
  function renderPendingItem(item) {
29269
29265
  return item.qualityCheck === void 0 ? CORE_MESSAGES[CoreMessage.PendingItem] : CORE_MESSAGES[CoreMessage.PendingItemFor](item.qualityCheck);
29270
29266
  }
29271
29267
  function renderFileGroup(group) {
29272
- const remarks = group.remarks.flatMap((remark) => remarkWordsOf(remark) ?? []);
29273
- const code = group.sharedScnCode === void 0 ? [] : [cellSafe(CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode))];
29274
- const said = [.../* @__PURE__ */ new Set([...code, ...remarks.map((remark) => cellSafe(headlineOf(remark)))])].join(" / ");
29275
- const where = group.locator === void 0 ? "" : ` (${group.locator}${said === "" ? "" : `: ${said}`})`;
29268
+ const remarks = group.remarks.flatMap((remark) => remarkHeadlineOf(remark) ?? []);
29269
+ const code = group.sharedScnCode === void 0 ? [] : [CORE_MESSAGES[CoreMessage.SharedScnCode](group.sharedScnCode)];
29270
+ const said = [.../* @__PURE__ */ new Set([...code, ...remarks])].filter((part) => part !== "").join(" / ");
29276
29271
  const counts = CORE_MESSAGES[CoreMessage.UnnamedClaimGroupCounts](group.ran, group.passed, group.failed);
29277
- const names = group.failedNames.map(cellSafe).filter((name) => name !== "");
29272
+ const names = group.failedNames.map((name) => name.trim()).filter((name) => name !== "");
29278
29273
  const failed = names.length === 0 ? "" : ` ${CORE_MESSAGES[CoreMessage.UnnamedClaimFailedNames](names)}`;
29279
- return `${group.qualityCheck}: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${where} \u2014 ${counts}${failed}`;
29274
+ return `${group.qualityCheck}: ${OUTCOME_DESCRIPTION["cites-no-scenario"]}${quotedSuffix([group.locator, said])} \u2014 ${counts}${failed}`;
29280
29275
  }
29281
29276
  function renderUnnamedClaimGroup(group) {
29282
29277
  if (!("names" in group))
@@ -29291,7 +29286,7 @@ function renderUnnamedClaimItems(lines) {
29291
29286
  }
29292
29287
  function renderRowExceptions(s) {
29293
29288
  const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
29294
- const reconciling = items.join("; ");
29289
+ const reconciling = items.map(cellSafe).join("; ");
29295
29290
  const pending = s.pendingItems.map(renderPendingItem).join("; ");
29296
29291
  const groups = [reconciling, pending].filter((g) => g.length > 0);
29297
29292
  return groups.length === 0 ? "\u2014" : groups.join("; ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.155",
3
+ "version": "0.1.156",
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.155"
29
+ "@3f-consulting/spec-controller-core": "0.1.156"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"