spec-controller 0.1.263 → 0.1.265

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.
package/dist/cli.js CHANGED
@@ -97,9 +97,7 @@ var init_messages_en = __esm({
97
97
  "takes-no-value": "The {flag} flag of ''{scope}'' takes no value, and was given one: ''{value}''.",
98
98
  "extra-argument": "The argument ''{token}'' is more than ''{scope}'' takes: it takes {takes} once, and its flags.",
99
99
  "not-a-flag": "The argument ''{token}'' is not a flag, nor the value of the flag before it: ''{scope}'' takes only flags and their values.",
100
- "unknown-flag": "Unknown flag {flag} for ''{scope}'' \u2014 this is spec-controller {toolVersion}, and that flag is not in its {command} scope.",
101
- "pin-drifted": "If this version is pinned, the pin and the tree it is reading have drifted apart: bump the pin to a version whose ''{command}'' accepts {flag}.",
102
- "otherwise-see-flags": "Otherwise run ''{scope} --help' to see the flags this version accepts.",
100
+ "unknown-flag": "Unknown flag {flag} for ''{scope}''.",
103
101
  "unknown-format": "Unknown --format {formats}. Supported formats are {supported} (e.g. --format md, --format json:report.json).",
104
102
  "more-than-one-to-stdout": "More than one output routes to stdout ({formats}); at most one may. Give one of them a :<path> to write it to a file instead (e.g. --format json:report.json).",
105
103
  "outputs-share-file": "Two outputs name the same file: {first} and {second}. Give each output a file of its own.",
@@ -108,11 +106,8 @@ var init_messages_en = __esm({
108
106
  "no-parts-carried": "none",
109
107
  "no-feature-part-given": "no feature part was given: 'spec-controller allocate <FFF>' takes one, a feature file's header code.",
110
108
  "not-a-feature-part": "''{part}'' is not a feature part: two to five characters, each A-Z or 0-9.",
111
- "default-corpus-feature-file": "a feature file of the corpus read by default",
112
- "flagged-corpus-feature-file": "a feature file of the --features corpus",
113
- "default-ci-workflow": "a CI workflow read by default",
114
- "flagged-ci-workflow": "the --ci workflow",
115
- "flagged-ci-folder-workflow": "a workflow of the --ci folder",
109
+ "ci-workflow": "a CI workflow",
110
+ "read-report": "a report",
116
111
  "format-on-standard-output": "{fmt} on standard output",
117
112
  "coded-usage-error": "spec-controller {command}: usage error [{code}] \u2014 {message}",
118
113
  "coded-host-usage-error": "spec-controller: usage error [{code}] \u2014 {message}",
@@ -161,7 +156,7 @@ var init_messages_en = __esm({
161
156
  "shape-wrong-kind": "{where} is {found}, not {expected}",
162
157
  "shape-field-missing": "{path} is missing",
163
158
  help: "spec-controller \u2014 reconcile scenarios against observed evidence\n\nUsage:\n spec-controller <command> [command-args]\n\nCommands:\n{commands}\n\nFull flags, examples, and CI wiring: docs/user-guide.md.",
164
- "help-entry": " {name}{description}",
159
+ "help-entry": " {name} {description}",
165
160
  "command-help": "spec-controller {command} \u2014 {summary}{arguments}\n\nOptions:\n{options}",
166
161
  "command-help-arguments": "\n\nUsage: spec-controller {command} {arguments} [options]\n\nArguments:\n{entries}",
167
162
  "help-flag": "Show this help and exit.",
@@ -258,10 +253,7 @@ function settleUnexpectedError(err, proc, stderr) {
258
253
  if (run.lineWritten) return;
259
254
  run.lineWritten = true;
260
255
  settleExitCode(proc);
261
- try {
262
- standardError(stderr).error(unexpectedErrorLine(err, run.finished));
263
- } catch {
264
- }
256
+ standardError(stderr).error(unexpectedErrorLine(err, run.finished));
265
257
  }
266
258
  function settleExitCode(proc) {
267
259
  if (run.finished) return;
@@ -275,7 +267,7 @@ function filled(text, values) {
275
267
  return text.replace(/\{(name|firstLine)\}/g, (_, key) => values[key]);
276
268
  }
277
269
  function nameOf(err) {
278
- return err.name;
270
+ return err?.name ?? "";
279
271
  }
280
272
  function firstLineOf(err) {
281
273
  try {
@@ -340,7 +332,6 @@ function misfiledCodes(feature, filesByCode) {
340
332
  return carried.filter((code) => code.featureCode !== featureCode).map((code) => ({
341
333
  kind: "foreign-claim-code",
342
334
  files: [feature.file],
343
- featureCode,
344
335
  claimCode: written(code),
345
336
  namedFeatureCode: code.featureCode,
346
337
  namedFeatureFiles: filesByCode.get(code.featureCode) ?? []
@@ -418,7 +409,7 @@ function claimRowsOf({ examples }) {
418
409
  }
419
410
  function scenarioReadOf(scenario) {
420
411
  const rows = claimRowsOf(scenario);
421
- return { tags: scenario.tags, title: scenario.title, examplesTags: scenario.examples.flatMap(({ tags }) => tags), rows };
412
+ return { tags: [...new Set(scenario.tags)], title: scenario.title, examplesTags: scenario.examples.flatMap(({ tags }) => tags), rows };
422
413
  }
423
414
  function featureReadOf({ file, featureTags, scenarios }) {
424
415
  return { file, featureTags, scenarios: scenarios.map(scenarioReadOf) };
@@ -482,10 +473,10 @@ function below(root, path) {
482
473
  return from.every((part, at) => to[at] === part) ? to.slice(from.length).join(SEPARATOR) : void 0;
483
474
  }
484
475
  function relativizeToRoot(path, root) {
485
- if (root === void 0 || !isAbsolute(path))
476
+ if (!isAbsolute(path))
486
477
  return path;
487
478
  const rel = below(root, path);
488
- if (rel === void 0 || rel.startsWith(UP))
479
+ if (rel === void 0)
489
480
  return path;
490
481
  return rel === "" ? "." : rel;
491
482
  }
@@ -529,7 +520,7 @@ function stepIdentityOf(step) {
529
520
  return name;
530
521
  if ("action" in step)
531
522
  return step.action.name;
532
- return step.command.split(/\r?\n/).find((line) => line.trim() !== "")?.trim() ?? "";
523
+ return step.command.split(/\n/).find((line) => line.trim() !== "")?.trim() ?? "";
533
524
  }
534
525
  function qualifiedStepName(step) {
535
526
  return `${step.workflow}:${step.job}:${stepIdentityOf(step)}`;
@@ -859,7 +850,7 @@ function withCounts(key, members) {
859
850
  const results = members.map(({ observation }) => observation);
860
851
  const passed = results.filter(({ result }) => result === "passed" || result === "passed-on-error").length;
861
852
  const failures = results.filter(({ result }) => result === "failed").map(({ name, place }) => name ?? place);
862
- return { ...key, qualityCheckReconciliations: members, ran: passed + failures.length, passed, failed: failures.length, failures };
853
+ return { ...key, ran: passed + failures.length, passed, failed: failures.length, failures };
863
854
  }
864
855
  function groupsOf({ qualityCheckReconciliations }) {
865
856
  const groups = [];
@@ -1071,9 +1062,6 @@ function runIdentityOf(read) {
1071
1062
  toolVersion: toolVersionOf(read.toolVersion)
1072
1063
  };
1073
1064
  }
1074
- function addressNameOf(origin) {
1075
- return ownerRepoOf(origin.path) ?? `${origin.lead}${origin.host}${origin.separator}${origin.path}`;
1076
- }
1077
1065
  function ownerRepoOf(path) {
1078
1066
  const segments = withoutSuffix(path.replace(/^\//, "")).split("/");
1079
1067
  return segments.length >= 2 ? segments.slice(-2).join("/") : void 0;
@@ -1104,7 +1092,7 @@ var init_provenance = __esm({
1104
1092
  NAME_OF_FORM = {
1105
1093
  unread: () => void 0,
1106
1094
  path: (origin) => origin.carriesUser ? void 0 : repositoryFolderOf(origin.path),
1107
- address: addressNameOf
1095
+ address: (origin) => ownerRepoOf(origin.path)
1108
1096
  };
1109
1097
  originNameOf = (origin) => NAME_OF_FORM[origin.form](origin);
1110
1098
  withoutSuffix = (path) => path.endsWith(REPOSITORY_SUFFIX) ? path.slice(0, -REPOSITORY_SUFFIX.length) : path;
@@ -12135,7 +12123,7 @@ function parseSources(sources, parse4, read) {
12135
12123
  try {
12136
12124
  documents.push({ file, source, document: parse4(source) });
12137
12125
  } catch (err) {
12138
- faults.push({ file, message: err instanceof Error ? err.message : String(err) });
12126
+ faults.push({ file, message: err.message });
12139
12127
  }
12140
12128
  }
12141
12129
  if (faults.length > 0)
@@ -12225,7 +12213,7 @@ function testCaseOf(suite, testcase, errorsWritten) {
12225
12213
  classname: testcase.classname,
12226
12214
  name: testcase.name,
12227
12215
  properties: testcase.properties?.property ?? [],
12228
- ...failure === void 0 ? {} : { failure: { message: failure.message, text: failure["#text"] } },
12216
+ ...failure === void 0 ? {} : { failure: { text: failure["#text"] } },
12229
12217
  ...error === void 0 ? {} : { error: { message: error.message, text: error["#text"], ...errorsWritten } },
12230
12218
  skipped: testcase.skipped !== void 0
12231
12219
  };
@@ -16264,10 +16252,10 @@ var require_resolve_block_map = __commonJS({
16264
16252
  let offset = bm.offset;
16265
16253
  let commentEnd = null;
16266
16254
  for (const collItem of bm.items) {
16267
- const { start, key, sep: sep5, value } = collItem;
16255
+ const { start, key, sep: sep4, value } = collItem;
16268
16256
  const keyProps = resolveProps.resolveProps(start, {
16269
16257
  indicator: "explicit-key-ind",
16270
- next: key ?? sep5?.[0],
16258
+ next: key ?? sep4?.[0],
16271
16259
  offset,
16272
16260
  onError,
16273
16261
  parentIndent: bm.indent,
@@ -16281,7 +16269,7 @@ var require_resolve_block_map = __commonJS({
16281
16269
  else if ("indent" in key && key.indent !== bm.indent)
16282
16270
  onError(offset, "BAD_INDENT", startColMsg);
16283
16271
  }
16284
- if (!keyProps.anchor && !keyProps.tag && !sep5) {
16272
+ if (!keyProps.anchor && !keyProps.tag && !sep4) {
16285
16273
  commentEnd = keyProps.end;
16286
16274
  if (keyProps.comment) {
16287
16275
  if (map.comment)
@@ -16305,7 +16293,7 @@ var require_resolve_block_map = __commonJS({
16305
16293
  ctx.atKey = false;
16306
16294
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
16307
16295
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
16308
- const valueProps = resolveProps.resolveProps(sep5 ?? [], {
16296
+ const valueProps = resolveProps.resolveProps(sep4 ?? [], {
16309
16297
  indicator: "map-value-ind",
16310
16298
  next: value,
16311
16299
  offset: keyNode.range[2],
@@ -16321,7 +16309,7 @@ var require_resolve_block_map = __commonJS({
16321
16309
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
16322
16310
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
16323
16311
  }
16324
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep5, null, valueProps, onError);
16312
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep4, null, valueProps, onError);
16325
16313
  if (ctx.schema.compat)
16326
16314
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
16327
16315
  offset = valueNode.range[2];
@@ -16412,7 +16400,7 @@ var require_resolve_end = __commonJS({
16412
16400
  let comment = "";
16413
16401
  if (end) {
16414
16402
  let hasSpace = false;
16415
- let sep5 = "";
16403
+ let sep4 = "";
16416
16404
  for (const token of end) {
16417
16405
  const { source, type } = token;
16418
16406
  switch (type) {
@@ -16426,13 +16414,13 @@ var require_resolve_end = __commonJS({
16426
16414
  if (!comment)
16427
16415
  comment = cb;
16428
16416
  else
16429
- comment += sep5 + cb;
16430
- sep5 = "";
16417
+ comment += sep4 + cb;
16418
+ sep4 = "";
16431
16419
  break;
16432
16420
  }
16433
16421
  case "newline":
16434
16422
  if (comment)
16435
- sep5 += source;
16423
+ sep4 += source;
16436
16424
  hasSpace = true;
16437
16425
  break;
16438
16426
  default:
@@ -16475,18 +16463,18 @@ var require_resolve_flow_collection = __commonJS({
16475
16463
  let offset = fc.offset + fc.start.source.length;
16476
16464
  for (let i = 0; i < fc.items.length; ++i) {
16477
16465
  const collItem = fc.items[i];
16478
- const { start, key, sep: sep5, value } = collItem;
16466
+ const { start, key, sep: sep4, value } = collItem;
16479
16467
  const props = resolveProps.resolveProps(start, {
16480
16468
  flow: fcName,
16481
16469
  indicator: "explicit-key-ind",
16482
- next: key ?? sep5?.[0],
16470
+ next: key ?? sep4?.[0],
16483
16471
  offset,
16484
16472
  onError,
16485
16473
  parentIndent: fc.indent,
16486
16474
  startOnNewline: false
16487
16475
  });
16488
16476
  if (!props.found) {
16489
- if (!props.anchor && !props.tag && !sep5 && !value) {
16477
+ if (!props.anchor && !props.tag && !sep4 && !value) {
16490
16478
  if (i === 0 && props.comma)
16491
16479
  onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
16492
16480
  else if (i < fc.items.length - 1)
@@ -16540,8 +16528,8 @@ var require_resolve_flow_collection = __commonJS({
16540
16528
  }
16541
16529
  }
16542
16530
  }
16543
- if (!isMap && !sep5 && !props.found) {
16544
- const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep5, null, props, onError);
16531
+ if (!isMap && !sep4 && !props.found) {
16532
+ const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep4, null, props, onError);
16545
16533
  coll.items.push(valueNode);
16546
16534
  offset = valueNode.range[2];
16547
16535
  if (isBlock2(value))
@@ -16553,7 +16541,7 @@ var require_resolve_flow_collection = __commonJS({
16553
16541
  if (isBlock2(key))
16554
16542
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
16555
16543
  ctx.atKey = false;
16556
- const valueProps = resolveProps.resolveProps(sep5 ?? [], {
16544
+ const valueProps = resolveProps.resolveProps(sep4 ?? [], {
16557
16545
  flow: fcName,
16558
16546
  indicator: "map-value-ind",
16559
16547
  next: value,
@@ -16564,8 +16552,8 @@ var require_resolve_flow_collection = __commonJS({
16564
16552
  });
16565
16553
  if (valueProps.found) {
16566
16554
  if (!isMap && !props.found && ctx.options.strict) {
16567
- if (sep5)
16568
- for (const st of sep5) {
16555
+ if (sep4)
16556
+ for (const st of sep4) {
16569
16557
  if (st === valueProps.found)
16570
16558
  break;
16571
16559
  if (st.type === "newline") {
@@ -16582,7 +16570,7 @@ var require_resolve_flow_collection = __commonJS({
16582
16570
  else
16583
16571
  onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
16584
16572
  }
16585
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep5, null, valueProps, onError) : null;
16573
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep4, null, valueProps, onError) : null;
16586
16574
  if (valueNode) {
16587
16575
  if (isBlock2(value))
16588
16576
  onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -16762,7 +16750,7 @@ var require_resolve_block_scalar = __commonJS({
16762
16750
  chompStart = i + 1;
16763
16751
  }
16764
16752
  let value = "";
16765
- let sep5 = "";
16753
+ let sep4 = "";
16766
16754
  let prevMoreIndented = false;
16767
16755
  for (let i = 0; i < contentStart; ++i)
16768
16756
  value += lines[i][0].slice(trimIndent) + "\n";
@@ -16779,24 +16767,24 @@ var require_resolve_block_scalar = __commonJS({
16779
16767
  indent = "";
16780
16768
  }
16781
16769
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
16782
- value += sep5 + indent.slice(trimIndent) + content;
16783
- sep5 = "\n";
16770
+ value += sep4 + indent.slice(trimIndent) + content;
16771
+ sep4 = "\n";
16784
16772
  } else if (indent.length > trimIndent || content[0] === " ") {
16785
- if (sep5 === " ")
16786
- sep5 = "\n";
16787
- else if (!prevMoreIndented && sep5 === "\n")
16788
- sep5 = "\n\n";
16789
- value += sep5 + indent.slice(trimIndent) + content;
16790
- sep5 = "\n";
16773
+ if (sep4 === " ")
16774
+ sep4 = "\n";
16775
+ else if (!prevMoreIndented && sep4 === "\n")
16776
+ sep4 = "\n\n";
16777
+ value += sep4 + indent.slice(trimIndent) + content;
16778
+ sep4 = "\n";
16791
16779
  prevMoreIndented = true;
16792
16780
  } else if (content === "") {
16793
- if (sep5 === "\n")
16781
+ if (sep4 === "\n")
16794
16782
  value += "\n";
16795
16783
  else
16796
- sep5 = "\n";
16784
+ sep4 = "\n";
16797
16785
  } else {
16798
- value += sep5 + content;
16799
- sep5 = " ";
16786
+ value += sep4 + content;
16787
+ sep4 = " ";
16800
16788
  prevMoreIndented = false;
16801
16789
  }
16802
16790
  }
@@ -16978,25 +16966,25 @@ var require_resolve_flow_scalar = __commonJS({
16978
16966
  if (!match)
16979
16967
  return source;
16980
16968
  let res = match[1];
16981
- let sep5 = " ";
16969
+ let sep4 = " ";
16982
16970
  let pos = first.lastIndex;
16983
16971
  line.lastIndex = pos;
16984
16972
  while (match = line.exec(source)) {
16985
16973
  if (match[1] === "") {
16986
- if (sep5 === "\n")
16987
- res += sep5;
16974
+ if (sep4 === "\n")
16975
+ res += sep4;
16988
16976
  else
16989
- sep5 = "\n";
16977
+ sep4 = "\n";
16990
16978
  } else {
16991
- res += sep5 + match[1];
16992
- sep5 = " ";
16979
+ res += sep4 + match[1];
16980
+ sep4 = " ";
16993
16981
  }
16994
16982
  pos = line.lastIndex;
16995
16983
  }
16996
16984
  const last = /[ \t]*(.*)/sy;
16997
16985
  last.lastIndex = pos;
16998
16986
  match = last.exec(source);
16999
- return res + sep5 + (match?.[1] ?? "");
16987
+ return res + sep4 + (match?.[1] ?? "");
17000
16988
  }
17001
16989
  function doubleQuotedValue(source, onError) {
17002
16990
  let res = "";
@@ -17806,14 +17794,14 @@ var require_cst_stringify = __commonJS({
17806
17794
  }
17807
17795
  }
17808
17796
  }
17809
- function stringifyItem({ start, key, sep: sep5, value }) {
17797
+ function stringifyItem({ start, key, sep: sep4, value }) {
17810
17798
  let res = "";
17811
17799
  for (const st of start)
17812
17800
  res += st.source;
17813
17801
  if (key)
17814
17802
  res += stringifyToken(key);
17815
- if (sep5)
17816
- for (const st of sep5)
17803
+ if (sep4)
17804
+ for (const st of sep4)
17817
17805
  res += st.source;
17818
17806
  if (value)
17819
17807
  res += stringifyToken(value);
@@ -18980,18 +18968,18 @@ var require_parser = __commonJS({
18980
18968
  if (this.type === "map-value-ind") {
18981
18969
  const prev = getPrevProps(this.peek(2));
18982
18970
  const start = getFirstKeyStartProps(prev);
18983
- let sep5;
18971
+ let sep4;
18984
18972
  if (scalar.end) {
18985
- sep5 = scalar.end;
18986
- sep5.push(this.sourceToken);
18973
+ sep4 = scalar.end;
18974
+ sep4.push(this.sourceToken);
18987
18975
  delete scalar.end;
18988
18976
  } else
18989
- sep5 = [this.sourceToken];
18977
+ sep4 = [this.sourceToken];
18990
18978
  const map = {
18991
18979
  type: "block-map",
18992
18980
  offset: scalar.offset,
18993
18981
  indent: scalar.indent,
18994
- items: [{ start, key: scalar, sep: sep5 }]
18982
+ items: [{ start, key: scalar, sep: sep4 }]
18995
18983
  };
18996
18984
  this.onKeyLine = true;
18997
18985
  this.stack[this.stack.length - 1] = map;
@@ -19144,15 +19132,15 @@ var require_parser = __commonJS({
19144
19132
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
19145
19133
  const start2 = getFirstKeyStartProps(it.start);
19146
19134
  const key = it.key;
19147
- const sep5 = it.sep;
19148
- sep5.push(this.sourceToken);
19135
+ const sep4 = it.sep;
19136
+ sep4.push(this.sourceToken);
19149
19137
  delete it.key;
19150
19138
  delete it.sep;
19151
19139
  this.stack.push({
19152
19140
  type: "block-map",
19153
19141
  offset: this.offset,
19154
19142
  indent: this.indent,
19155
- items: [{ start: start2, key, sep: sep5 }]
19143
+ items: [{ start: start2, key, sep: sep4 }]
19156
19144
  });
19157
19145
  } else if (start.length > 0) {
19158
19146
  it.sep = it.sep.concat(start, this.sourceToken);
@@ -19346,13 +19334,13 @@ var require_parser = __commonJS({
19346
19334
  const prev = getPrevProps(parent);
19347
19335
  const start = getFirstKeyStartProps(prev);
19348
19336
  fixFlowSeqItems(fc);
19349
- const sep5 = fc.end.splice(1, fc.end.length);
19350
- sep5.push(this.sourceToken);
19337
+ const sep4 = fc.end.splice(1, fc.end.length);
19338
+ sep4.push(this.sourceToken);
19351
19339
  const map = {
19352
19340
  type: "block-map",
19353
19341
  offset: fc.offset,
19354
19342
  indent: fc.indent,
19355
- items: [{ start, key: fc, sep: sep5 }]
19343
+ items: [{ start, key: fc, sep: sep4 }]
19356
19344
  };
19357
19345
  this.onKeyLine = true;
19358
19346
  this.stack[this.stack.length - 1] = map;
@@ -19638,7 +19626,7 @@ function envValuesOf(value) {
19638
19626
  return Object.values(isRecord(value) ? value : {}).filter((entry) => typeof entry === "string");
19639
19627
  }
19640
19628
  function idOf(value) {
19641
- return typeof value === "string" ? value || void 0 : void 0;
19629
+ return typeof value === "string" ? value : void 0;
19642
19630
  }
19643
19631
  function readUses(uses) {
19644
19632
  const [owner, repository] = uses.split(/[/@]/);
@@ -30401,7 +30389,7 @@ function parsedWorkflowsOf({ paths, sources }) {
30401
30389
  const parse4 = parseWorkflows(sources);
30402
30390
  if (parse4.kind === "parsed") return { kind: "read", workflows: parse4.parsed };
30403
30391
  const pathOf3 = new Map(paths.map((read) => [basename(read), read]));
30404
- return { kind: "unparseable", faults: parse4.faults.map(({ file, message: message2 }) => ({ file: pathOf3.get(file) ?? file, message: message2 })) };
30392
+ return { kind: "unparseable", faults: parse4.faults.map(({ file, message: message2 }) => ({ file: pathOf3.get(file), message: message2 })) };
30405
30393
  }
30406
30394
  function readWorkflows(path, read = readUtf8) {
30407
30395
  return readingOf(path, () => workflowSourcesOf(path, read), parsedWorkflowsOf);
@@ -30558,11 +30546,7 @@ function probeDestination(path) {
30558
30546
  return { identity, created: existed ? void 0 : realpathSync(path) };
30559
30547
  }
30560
30548
  function regularFileIdentity(path) {
30561
- try {
30562
- return regularIdentity(statSync2(path, { bigint: true }));
30563
- } catch {
30564
- }
30565
- return void 0;
30549
+ return regularIdentity(statSync2(path, { bigint: true }));
30566
30550
  }
30567
30551
  function streamIdentity(fd) {
30568
30552
  return regularIdentity(fstatSync(fd, { bigint: true }));
@@ -33471,21 +33455,21 @@ var init_Matcher = __esm({
33471
33455
  * @returns {string}
33472
33456
  */
33473
33457
  toString(separator, includeNamespace = true) {
33474
- const sep5 = separator || this.separator;
33475
- const isDefault = sep5 === this.separator && includeNamespace === true;
33458
+ const sep4 = separator || this.separator;
33459
+ const isDefault = sep4 === this.separator && includeNamespace === true;
33476
33460
  if (isDefault) {
33477
33461
  if (this._pathStringCache !== null) {
33478
33462
  return this._pathStringCache;
33479
33463
  }
33480
33464
  const result = this.path.map(
33481
33465
  (n) => n.namespace ? `${n.namespace}:${n.tag}` : n.tag
33482
- ).join(sep5);
33466
+ ).join(sep4);
33483
33467
  this._pathStringCache = result;
33484
33468
  return result;
33485
33469
  }
33486
33470
  return this.path.map(
33487
33471
  (n) => includeNamespace && n.namespace ? `${n.namespace}:${n.tag}` : n.tag
33488
- ).join(sep5);
33472
+ ).join(sep4);
33489
33473
  }
33490
33474
  /**
33491
33475
  * Get path as array of tag names.
@@ -35438,23 +35422,14 @@ var init_unreadableInputs = __esm({
35438
35422
  // src/inputs/inputsRead.ts
35439
35423
  import { existsSync as existsSync3 } from "node:fs";
35440
35424
  function inputsReadFrom(args, given, reader, defaults) {
35441
- const reports = jsonInputsOf(given, reader.exists, defaults.packageJson).map(({ subject, path }) => ({ subject: lowerFirst(subject), path }));
35425
+ const reports = jsonInputsOf(given, reader.exists, defaults.packageJson).map(({ path }) => ({ subject: message("read-report" /* ReadReport */), path }));
35442
35426
  return [...reports, ...featureInputs(args["features"], reader, defaults.features), ...workflowInputs(args["ci"], reader, defaults.ci)];
35443
35427
  }
35444
35428
  function featureInputs(dir, reader, defaultCorpus) {
35445
- const subject = message(dir === void 0 ? "default-corpus-feature-file" /* DefaultCorpusFeatureFile */ : "flagged-corpus-feature-file" /* FlaggedCorpusFeatureFile */);
35446
- return reader.featureFiles(dir ?? defaultCorpus).map((path) => ({ subject, path }));
35429
+ return reader.featureFiles(dir ?? defaultCorpus).map((path) => ({ subject: message("feature-file" /* FeatureFile */), path }));
35447
35430
  }
35448
35431
  function workflowInputs(ci, reader, defaultWorkflows) {
35449
- const files = reader.workflowFiles(ci ?? defaultWorkflows);
35450
- return files.map((path) => ({ subject: workflowSubject(ci, path), path }));
35451
- }
35452
- function workflowSubject(ci, path) {
35453
- if (ci === void 0) return message("default-ci-workflow" /* DefaultCiWorkflow */);
35454
- return message(path === ci ? "flagged-ci-workflow" /* FlaggedCiWorkflow */ : "flagged-ci-folder-workflow" /* FlaggedCiFolderWorkflow */);
35455
- }
35456
- function lowerFirst(text) {
35457
- return text.charAt(0).toLowerCase() + text.slice(1);
35432
+ return reader.workflowFiles(ci ?? defaultWorkflows).map((path) => ({ subject: message("ci-workflow" /* CiWorkflow */), path }));
35458
35433
  }
35459
35434
  var NODE_INPUT_READER;
35460
35435
  var init_inputsRead = __esm({
@@ -35467,20 +35442,8 @@ var init_inputsRead = __esm({
35467
35442
  init_unreadableInputs();
35468
35443
  NODE_INPUT_READER = {
35469
35444
  exists: existsSync3,
35470
- featureFiles: (dir) => {
35471
- try {
35472
- return corpusFeatureFiles(dir).map(({ path }) => path);
35473
- } catch {
35474
- return [];
35475
- }
35476
- },
35477
- workflowFiles: (path) => {
35478
- try {
35479
- return ciSourcePathsOf(path);
35480
- } catch {
35481
- return [];
35482
- }
35483
- }
35445
+ featureFiles: (dir) => corpusFeatureFiles(dir).map(({ path }) => path),
35446
+ workflowFiles: (path) => ciSourcePathsOf(path)
35484
35447
  };
35485
35448
  }
35486
35449
  });
@@ -35516,7 +35479,7 @@ var init_exitStatus = __esm({
35516
35479
  // src/runIdentity/resolveRunInputs.ts
35517
35480
  import { execFileSync } from "node:child_process";
35518
35481
  import { readFileSync as readFileSync3 } from "node:fs";
35519
- import { dirname as dirname2, join as join5, sep as sep3 } from "node:path";
35482
+ import { dirname as dirname2, join as join5 } from "node:path";
35520
35483
  import { fileURLToPath } from "node:url";
35521
35484
  function readTargetHead(targetDir) {
35522
35485
  return readGit(targetDir, ["rev-parse", "HEAD"]);
@@ -35529,33 +35492,31 @@ function originPartsOf(remote) {
35529
35492
  if (isLocalPath(remote)) return { form: "path", path: remote, carriesUser: false };
35530
35493
  if (remote.startsWith("file:")) return { form: "path", path: remote, carriesUser: remote.includes("@") };
35531
35494
  const scheme = URL_SCHEME.exec(remote);
35532
- if (scheme !== null) return urlParts(scheme, remote.slice(scheme[0].length));
35495
+ if (scheme !== null) return urlParts(remote.slice(scheme[0].length));
35533
35496
  return OTHER_SCHEME_OR_TRANSPORT.test(remote) ? UNREAD : scpParts(remote);
35534
35497
  }
35535
35498
  function isLocalPath(remote) {
35536
35499
  return remote.split(":", 1)[0].includes("/") || !remote.includes(":");
35537
35500
  }
35538
- function urlParts(scheme, rest) {
35501
+ function urlParts(rest) {
35539
35502
  const authority = rest.split(/[/?#]/, 1)[0];
35540
35503
  const afterAuthority = rest.slice(authority.length);
35541
35504
  const at = authority.lastIndexOf("@");
35542
- const host = authority.slice(at + 1);
35543
- if (afterAuthority.includes("@") || host === "") return UNREAD;
35544
- return { form: "address", lead: scheme[0], host, separator: "", path: pathOf(afterAuthority) };
35505
+ if (afterAuthority.includes("@") || authority.slice(at + 1) === "") return UNREAD;
35506
+ return { form: "address", path: pathOf(afterAuthority) };
35545
35507
  }
35546
35508
  function scpParts(address) {
35547
35509
  const at = address.lastIndexOf("@");
35548
35510
  const hostPath = address.slice(at + 1);
35549
35511
  const colon = hostPath.indexOf(":");
35550
35512
  if (colon <= 0) return UNREAD;
35551
- const host = hostPath.slice(0, colon);
35552
- return { form: "address", lead: "", host, separator: ":", path: pathOf(hostPath.slice(colon + 1)) };
35513
+ return { form: "address", path: pathOf(hostPath.slice(colon + 1)) };
35553
35514
  }
35554
35515
  function pathOf(rest) {
35555
35516
  return rest.split(/[?#]/, 1)[0];
35556
35517
  }
35557
35518
  function readToolInstall(toolDir = toolFolder()) {
35558
- return { toolFolder: toolDir.split(sep3).join("/"), toolHead: readGit(toolDir, ["rev-parse", "HEAD"]), toolVersion: readToolVersion(toolDir) };
35519
+ return { toolFolder: toolDir, toolHead: readGit(toolDir, ["rev-parse", "HEAD"]), toolVersion: readToolVersion(toolDir) };
35559
35520
  }
35560
35521
  function readToolVersion(fromDir = toolFolder()) {
35561
35522
  let dir = fromDir;
@@ -35577,8 +35538,9 @@ function readRepositoryTop(folder) {
35577
35538
  return readGit(folder, ["rev-parse", "--show-toplevel"]);
35578
35539
  }
35579
35540
  function readGit(dir, args) {
35541
+ const folder = dir ?? process.cwd();
35580
35542
  try {
35581
- const out = execFileSync("git", ["-C", dir ?? process.cwd(), ...args], {
35543
+ const out = execFileSync("git", ["-C", folder, ...args], {
35582
35544
  encoding: "utf8",
35583
35545
  stdio: "pipe"
35584
35546
  });
@@ -35603,16 +35565,15 @@ function flagLabel(flag) {
35603
35565
  const names = [flag.name, ...flag.aliases ?? []].join(", ");
35604
35566
  return flag.arg !== void 0 ? `${names} ${flag.arg}` : names;
35605
35567
  }
35606
- function entries(listed, gutter) {
35607
- const width = Math.max(0, ...listed.map(({ name }) => name.length)) + gutter;
35608
- return listed.map(({ name, description }) => message("help-entry" /* HelpEntry */, { name: name.padEnd(width), description })).join("\n");
35568
+ function entries(listed) {
35569
+ return listed.map(({ name, description }) => message("help-entry" /* HelpEntry */, { name, description })).join("\n");
35609
35570
  }
35610
35571
  function renderCommandHelp(command) {
35611
35572
  return message("command-help" /* CommandHelp */, {
35612
35573
  command: command.name,
35613
35574
  summary: command.summary,
35614
35575
  arguments: argumentHelp(command.name, command.positional),
35615
- options: entries(command.flags.map((flag) => ({ name: flagLabel(flag), description: flag.description })), 2)
35576
+ options: entries(command.flags.map((flag) => ({ name: flagLabel(flag), description: flag.description })))
35616
35577
  });
35617
35578
  }
35618
35579
  function argumentHelp(command, positional) {
@@ -35620,12 +35581,12 @@ function argumentHelp(command, positional) {
35620
35581
  return message("command-help-arguments" /* CommandHelpArguments */, {
35621
35582
  command,
35622
35583
  arguments: positional.name,
35623
- entries: entries([positional], 2)
35584
+ entries: entries([positional])
35624
35585
  });
35625
35586
  }
35626
35587
  function renderTopLevelHelp(registry) {
35627
35588
  return message("help" /* Help */, {
35628
- commands: entries(registry.commands.map((command) => ({ name: command.name, description: command.summary })), 4)
35589
+ commands: entries(registry.commands.map((command) => ({ name: command.name, description: command.summary })))
35629
35590
  });
35630
35591
  }
35631
35592
  var balanceFlags, balanceCommand, allocateCommand, cliRegistry;
@@ -35814,21 +35775,18 @@ function notAFlagRefusal(token, command) {
35814
35775
  const scope = `spec-controller ${command}`;
35815
35776
  return refusal("not-a-flag" /* NotAFlag */, { token, scope }, [message("see-flags" /* SeeFlags */, { scope })]);
35816
35777
  }
35817
- function checkUnknownFlags(args, registry, command, toolVersion) {
35778
+ function checkUnknownFlags(args, registry, command) {
35818
35779
  const entry = commandEntry(registry, command);
35819
35780
  for (const key of Object.keys(args)) {
35820
35781
  if (!entry.flags.some((flag) => flag.name === `--${key}`)) {
35821
- return unknownFlagRefusal(`--${key}`, command, toolVersion);
35782
+ return unknownFlagRefusal(`--${key}`, command);
35822
35783
  }
35823
35784
  }
35824
35785
  return null;
35825
35786
  }
35826
- function unknownFlagRefusal(flag, command, toolVersion) {
35787
+ function unknownFlagRefusal(flag, command) {
35827
35788
  const scope = `spec-controller ${command}`;
35828
- return refusal("unknown-flag" /* UnknownFlag */, { flag, scope, toolVersion, command }, [
35829
- message("pin-drifted" /* PinDrifted */, { command, flag }),
35830
- message("otherwise-see-flags" /* OtherwiseSeeFlags */, { scope })
35831
- ]);
35789
+ return refusal("unknown-flag" /* UnknownFlag */, { flag, scope }, [message("see-flags" /* SeeFlags */, { scope })]);
35832
35790
  }
35833
35791
  var argumentsOf;
35834
35792
  var init_cliArgs = __esm({
@@ -35856,7 +35814,7 @@ function reconcile(argv) {
35856
35814
  const args = parseArgs(argv);
35857
35815
  const shapeError = checkArgvShape(argv, cliRegistry, "balance");
35858
35816
  if (shapeError) refuse(shapeError);
35859
- const unknownFlagError = checkUnknownFlags(args, cliRegistry, "balance", toolVersionOf(readToolVersion()));
35817
+ const unknownFlagError = checkUnknownFlags(args, cliRegistry, "balance");
35860
35818
  if (unknownFlagError) refuse(unknownFlagError);
35861
35819
  const missingValueError = checkMissingValues(argv, cliRegistry, "balance");
35862
35820
  if (missingValueError) refuse(missingValueError);
@@ -36018,17 +35976,17 @@ var init_readParts = __esm({
36018
35976
  });
36019
35977
 
36020
35978
  // src/runRequest/request.ts
36021
- function readRequest(argv, registry, toolVersion) {
36022
- const why = argvRefusal(argv, registry, toolVersion);
35979
+ function readRequest(argv, registry) {
35980
+ const why = argvRefusal(argv, registry);
36023
35981
  if (why !== null) return { usageError: why };
36024
35982
  const [part] = positionalArguments(argv);
36025
35983
  if (part === void 0) return { usageError: refusal("no-feature-part-given" /* NoFeaturePartGiven */, {}) };
36026
35984
  if (!isFeatureCode(part)) return { usageError: refusal("not-a-feature-part" /* NotAFeaturePart */, { part }) };
36027
35985
  return { featureCode: part, isNew: argv.includes("--new") };
36028
35986
  }
36029
- function argvRefusal(argv, registry, toolVersion) {
35987
+ function argvRefusal(argv, registry) {
36030
35988
  const args = parseArgs(argv);
36031
- return checkArgvShape(argv, registry, "allocate") ?? checkUnknownFlags(args, registry, "allocate", toolVersion);
35989
+ return checkArgvShape(argv, registry, "allocate") ?? checkUnknownFlags(args, registry, "allocate");
36032
35990
  }
36033
35991
  var init_request = __esm({
36034
35992
  "src/runRequest/request.ts"() {
@@ -36139,7 +36097,7 @@ var init_readHistory = __esm({
36139
36097
  // src/repository/readTree.ts
36140
36098
  import { spawnSync as spawnSync2 } from "node:child_process";
36141
36099
  import { accessSync, constants as constants2, lstatSync as lstatSync3, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "node:fs";
36142
- import { join as join7, relative, sep as sep4 } from "node:path";
36100
+ import { join as join7, relative, sep as sep3 } from "node:path";
36143
36101
  function readTree(top, marks) {
36144
36102
  const listed = gitListing(top, ["ls-files", "-z", "--cached", "--others", "--exclude-standard"]);
36145
36103
  const ignored = gitListing(top, ["ls-files", "-z", "--others", "--ignored", "--exclude-standard", "--directory"]);
@@ -36181,7 +36139,7 @@ function linesCarrying(path, content, marks) {
36181
36139
  function walkTree(root, marks) {
36182
36140
  return filesUnder(root).flatMap((file) => {
36183
36141
  const content = readOrRefuse("tree-file" /* TreeFile */, file, () => readFileSync6(file));
36184
- return linesCarrying(relative(root, file).split(sep4).join("/"), content, marks);
36142
+ return linesCarrying(relative(root, file).split(sep3).join("/"), content, marks);
36185
36143
  });
36186
36144
  }
36187
36145
  function filesUnder(dir) {
@@ -36253,7 +36211,7 @@ function runAllocate(argv) {
36253
36211
  process.stdout.write(renderCommandHelp(allocateCommand) + "\n");
36254
36212
  return;
36255
36213
  }
36256
- answerOrRefuse(readRequest(argv, cliRegistry, toolVersionOf(readToolVersion())));
36214
+ answerOrRefuse(readRequest(argv, cliRegistry));
36257
36215
  }
36258
36216
  function answerOrRefuse(request) {
36259
36217
  if ("usageError" in request) {
@@ -36300,7 +36258,6 @@ var init_allocate = __esm({
36300
36258
  init_dist3();
36301
36259
  init_cliArgs();
36302
36260
  init_cliRegistry();
36303
- init_resolveRunInputs();
36304
36261
  init_readParts();
36305
36262
  init_request();
36306
36263
  init_defaults();
@@ -736,9 +736,6 @@
736
736
  "type": "string"
737
737
  }
738
738
  },
739
- "featureCode": {
740
- "type": "string"
741
- },
742
739
  "claimCode": {
743
740
  "type": "string"
744
741
  },
@@ -755,7 +752,6 @@
755
752
  "required": [
756
753
  "kind",
757
754
  "files",
758
- "featureCode",
759
755
  "claimCode",
760
756
  "namedFeatureCode",
761
757
  "namedFeatureFiles"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.263",
3
+ "version": "0.1.265",
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.263"
29
+ "@3f-consulting/spec-controller-core": "0.1.265"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"