spec-controller 0.1.268 → 0.1.270

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +25 -28
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -89,7 +89,7 @@ The refusal names the input, the path, and what was wrong with it. A well-formed
89
89
 
90
90
  ### `allocate`
91
91
 
92
- `spec-controller allocate` prints the next claim code for a feature part. It reaches no verdict: it exits `0` when it answers, and `2` for a usage error or an unknown part. A file or directory it cannot read, directly or through git, is a usage error: it is refused, naming the path and the reason, and no code is given.
92
+ `spec-controller allocate` prints the next claim code for a feature code. It reaches no verdict: it exits `0` when it answers, and `2` for a usage error or an unknown feature code. A file or directory it cannot read, directly or through git, is a usage error: it is refused, naming the path and the reason, and no code is given.
93
93
 
94
94
  ## On CI
95
95
 
package/dist/cli.js CHANGED
@@ -102,10 +102,10 @@ var init_messages_en = __esm({
102
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).",
103
103
  "outputs-share-file": "Two outputs name the same file: {first} and {second}. Give each output a file of its own.",
104
104
  "output-overwrites-input": "An output would overwrite a file this run reads: {output} is {subject}, {path}. Give the report a file of its own.",
105
- "unknown-part-refused": "unknown part \u2014 no feature file's header carries {part}.\nThe parts this corpus's feature files carry: {parts}.",
106
- "no-parts-carried": "none",
107
- "no-feature-part-given": "no feature part was given: 'spec-controller allocate <FFF>' takes one, a feature file's header code.",
108
- "not-a-feature-part": "''{part}'' is not a feature part: two to five characters, each A-Z or 0-9.",
105
+ "unknown-feature-code-refused": "unknown feature code \u2014 no feature file's header carries {featureCode}.\nThe feature codes this corpus's feature files carry: {featureCodes}.",
106
+ "no-feature-codes-carried": "none",
107
+ "feature-code-not-given": "no feature code was given: 'spec-controller allocate <FFF>' takes one, a feature file's header code.",
108
+ "not-a-feature-code": "''{featureCode}'' is not a feature code: two to five characters, each A-Z or 0-9.",
109
109
  "ci-workflow": "a CI workflow",
110
110
  "read-report": "a report",
111
111
  "format-on-standard-output": "{fmt} on standard output",
@@ -174,17 +174,17 @@ var init_messages_en = __esm({
174
174
  "format-flag": "Where to send output (md or json, optionally :<path> to write to a file). Repeatable.",
175
175
  "strict-flag": "Read every scenario as if nothing were put off: a deferral tag is ignored, and a pending tag such as @integrationpending raises the Evidence Obligation it names.",
176
176
  "exit-zero-flag": "Print the same report but exit 0 on an out-of-balance (1) verdict \u2014 the on-ramp before gating. Usage (2), not reconciled (3) and an unexpected error (4) still fail.",
177
- "allocate-summary": "Print the next claim code for a feature part: one past the highest the repository has ever carried, the code alone on stdout.",
178
- "feature-part-argument": "The feature part: a feature file's header code, two to five of A-Z and 0-9.",
179
- "new-flag": "Start a part no feature file's header carries yet: its first code, or one past any number the repository already carries for it.",
180
- "shallow-history-risks-part-code": "history: shallow clone \u2014 history before {before} unread; a code of {part} may have been used before",
177
+ "allocate-summary": "Print the next claim code for a feature code: one past the highest the repository has ever carried, the code alone on stdout.",
178
+ "feature-code-argument": "The feature code: a feature file's header code, two to five of A-Z and 0-9.",
179
+ "new-flag": "Start a feature code no feature file's header carries yet: its first code, or one past any number the repository already carries for it.",
180
+ "shallow-history-risks-feature-code": "history: shallow clone \u2014 history before {before} unread; a code of {featureCode} may have been used before",
181
181
  "shallow-history-risks-code-above": "history: shallow clone \u2014 history before {before} unread; a code above {code} may have been used before",
182
- "no-repository-risks-part-code": "history: not a git repository \u2014 none read; a code of {part} may have been used before",
182
+ "no-repository-risks-feature-code": "history: not a git repository \u2014 none read; a code of {featureCode} may have been used before",
183
183
  "no-repository-risks-code-above": "history: not a git repository \u2014 none read; a code above {code} may have been used before",
184
184
  "highest-seen-none": "highest seen: none",
185
185
  "highest-seen-in-tree": "highest seen: {code}, {path}:{line}",
186
186
  "highest-seen-in-commit": "highest seen: {code}, {path}:{line} in {commit}",
187
- "part-already-headed": "note: a feature file's header already carries {part}, so --new was not needed"
187
+ "feature-code-already-headed": "note: a feature file's header already carries {featureCode}, so --new was not needed"
188
188
  };
189
189
  }
190
190
  });
@@ -30304,9 +30304,6 @@ function readingOf(path, read, parse4) {
30304
30304
  function readUtf8(path) {
30305
30305
  return readFileSync(path, "utf8");
30306
30306
  }
30307
- function reasonOf(err) {
30308
- return err instanceof Error ? err.message : String(err);
30309
- }
30310
30307
  var init_inputReading = __esm({
30311
30308
  "src/inputs/inputReading.ts"() {
30312
30309
  "use strict";
@@ -35293,7 +35290,7 @@ function documentOf(text, parse4) {
35293
35290
  try {
35294
35291
  return { kind: "parsed", document: parse4(text) };
35295
35292
  } catch (err) {
35296
- return { kind: "unparseable", reason: reasonOf(err) };
35293
+ return { kind: "unparseable", reason: err.message };
35297
35294
  }
35298
35295
  }
35299
35296
  function readDocument(path, format, read = readUtf8) {
@@ -35639,7 +35636,7 @@ var init_cliRegistry = __esm({
35639
35636
  allocateCommand = {
35640
35637
  name: "allocate",
35641
35638
  summary: message("allocate-summary" /* AllocateSummary */),
35642
- positional: { name: "<FFF>", description: message("feature-part-argument" /* FeaturePartArgument */) },
35639
+ positional: { name: "<FFF>", description: message("feature-code-argument" /* FeatureCodeArgument */) },
35643
35640
  flags: [
35644
35641
  {
35645
35642
  name: "--new",
@@ -35958,7 +35955,7 @@ var init_unreadable = __esm({
35958
35955
  }
35959
35956
  });
35960
35957
 
35961
- // src/repository/readParts.ts
35958
+ // src/repository/readFeatureCodes.ts
35962
35959
  import { readFileSync as readFileSync4 } from "node:fs";
35963
35960
  function readFeatureCodes(featureFiles) {
35964
35961
  const sources = featureFiles.map(({ path }) => ({
@@ -35969,8 +35966,8 @@ function readFeatureCodes(featureFiles) {
35969
35966
  if (parse4.kind === "unparseable") throw new UnparseableFeatureFiles(parse4.faults);
35970
35967
  return parse4.parsed.flatMap((feature) => featureCodeOfFile(feature) ?? []);
35971
35968
  }
35972
- var init_readParts = __esm({
35973
- "src/repository/readParts.ts"() {
35969
+ var init_readFeatureCodes = __esm({
35970
+ "src/repository/readFeatureCodes.ts"() {
35974
35971
  "use strict";
35975
35972
  init_dist3();
35976
35973
  init_messages();
@@ -35982,10 +35979,10 @@ var init_readParts = __esm({
35982
35979
  function readRequest(argv, registry) {
35983
35980
  const why = argvRefusal(argv, registry);
35984
35981
  if (why !== null) return { usageError: why };
35985
- const [part] = positionalArguments(argv);
35986
- if (part === void 0) return { usageError: refusal("no-feature-part-given" /* NoFeaturePartGiven */, {}) };
35987
- if (!isFeatureCode(part)) return { usageError: refusal("not-a-feature-part" /* NotAFeaturePart */, { part }) };
35988
- return { featureCode: part, isNew: argv.includes("--new") };
35982
+ const [featureCode] = positionalArguments(argv);
35983
+ if (featureCode === void 0) return { usageError: refusal("feature-code-not-given" /* FeatureCodeNotGiven */, {}) };
35984
+ if (!isFeatureCode(featureCode)) return { usageError: refusal("not-a-feature-code" /* NotAFeatureCode */, { featureCode }) };
35985
+ return { featureCode, isNew: argv.includes("--new") };
35989
35986
  }
35990
35987
  function argvRefusal(argv, registry) {
35991
35988
  const args = parseArgs(argv);
@@ -36174,10 +36171,10 @@ function historyBoundaryLine(boundary, allocation) {
36174
36171
  }
36175
36172
  }
36176
36173
  function shallowHistoryLine(before, allocation) {
36177
- return allocation.highest === void 0 ? message("shallow-history-risks-part-code" /* ShallowHistoryRisksPartCode */, { before, part: allocation.featureCode }) : message("shallow-history-risks-code-above" /* ShallowHistoryRisksCodeAbove */, { before, code: allocation.highest.code });
36174
+ return allocation.highest === void 0 ? message("shallow-history-risks-feature-code" /* ShallowHistoryRisksFeatureCode */, { before, featureCode: allocation.featureCode }) : message("shallow-history-risks-code-above" /* ShallowHistoryRisksCodeAbove */, { before, code: allocation.highest.code });
36178
36175
  }
36179
36176
  function noRepositoryLine(allocation) {
36180
- return allocation.highest === void 0 ? message("no-repository-risks-part-code" /* NoRepositoryRisksPartCode */, { part: allocation.featureCode }) : message("no-repository-risks-code-above" /* NoRepositoryRisksCodeAbove */, { code: allocation.highest.code });
36177
+ return allocation.highest === void 0 ? message("no-repository-risks-feature-code" /* NoRepositoryRisksFeatureCode */, { featureCode: allocation.featureCode }) : message("no-repository-risks-code-above" /* NoRepositoryRisksCodeAbove */, { code: allocation.highest.code });
36181
36178
  }
36182
36179
  function highestSeenLine(allocation) {
36183
36180
  const highest = allocation.highest;
@@ -36186,14 +36183,14 @@ function highestSeenLine(allocation) {
36186
36183
  return commit === void 0 ? message("highest-seen-in-tree" /* HighestSeenInTree */, { code: highest.code, path, line }) : message("highest-seen-in-commit" /* HighestSeenInCommit */, { code: highest.code, path, line, commit });
36187
36184
  }
36188
36185
  function featureCodesListed({ featureCodes }) {
36189
- return featureCodes.length === 0 ? message("no-parts-carried" /* NoPartsCarried */) : featureCodes.join(", ");
36186
+ return featureCodes.length === 0 ? message("no-feature-codes-carried" /* NoFeatureCodesCarried */) : featureCodes.join(", ");
36190
36187
  }
36191
36188
  function unknownFeatureCodeRefusal(unknown) {
36192
- return refusal("unknown-part-refused" /* UnknownPartRefused */, { part: unknown.featureCode, parts: featureCodesListed(unknown) });
36189
+ return refusal("unknown-feature-code-refused" /* UnknownFeatureCodeRefused */, { featureCode: unknown.featureCode, featureCodes: featureCodesListed(unknown) });
36193
36190
  }
36194
36191
  function alreadyHeadedNote(allocation) {
36195
36192
  if (allocation.alreadyHeaded !== true) return null;
36196
- return message("part-already-headed" /* PartAlreadyHeaded */, { part: allocation.featureCode });
36193
+ return message("feature-code-already-headed" /* FeatureCodeAlreadyHeaded */, { featureCode: allocation.featureCode });
36197
36194
  }
36198
36195
  var init_allocateNotes = __esm({
36199
36196
  "src/output/allocateNotes.ts"() {
@@ -36261,7 +36258,7 @@ var init_allocate = __esm({
36261
36258
  init_dist3();
36262
36259
  init_cliArgs();
36263
36260
  init_cliRegistry();
36264
- init_readParts();
36261
+ init_readFeatureCodes();
36265
36262
  init_request();
36266
36263
  init_defaults();
36267
36264
  init_unreadable();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.268",
3
+ "version": "0.1.270",
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.268"
29
+ "@3f-consulting/spec-controller-core": "0.1.270"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"