spec-controller 0.1.248 → 0.1.249

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
@@ -11470,7 +11470,7 @@ function hasClaimCodeErrors(reconciliation) {
11470
11470
  return (reconciliation.claimCodeErrors ?? []).length > 0;
11471
11471
  }
11472
11472
  function claimCodeErrorsAre(errors) {
11473
- const several = errors.filter((error) => error.kind === "several-claim-codes").length;
11473
+ const several = errors.filter((error) => error.kind === "several-claim-codes" || error.kind === "claim-code-beside-clm-column").length;
11474
11474
  if (several === 0)
11475
11475
  return "misfilings";
11476
11476
  return several === errors.length ? "several-codes" : "both";
@@ -11559,6 +11559,14 @@ function severalClaimCodes(features) {
11559
11559
  ];
11560
11560
  }));
11561
11561
  }
11562
+ function claimCodesBesideClmColumn(features) {
11563
+ return features.flatMap((feature) => feature.scenarios.filter(({ clmColumn }) => clmColumn === true).map(({ name, tags }) => ({
11564
+ kind: "claim-code-beside-clm-column",
11565
+ files: [feature.file],
11566
+ scenario: name,
11567
+ codes: [...new Set(tags.filter((tag) => CLAIM_CODE.test(tag)))]
11568
+ })));
11569
+ }
11562
11570
  function claimCodePopulationOf(features) {
11563
11571
  return { featureFiles: features.length, featureCodes: headerFilesByCode(features).size };
11564
11572
  }
@@ -11567,7 +11575,8 @@ function claimCodeErrorsOf(features) {
11567
11575
  ...duplicateFeatureCodes(features),
11568
11576
  ...foreignClaimCodes(features),
11569
11577
  ...noFeatureCodeFiles(features),
11570
- ...severalClaimCodes(features)
11578
+ ...severalClaimCodes(features),
11579
+ ...claimCodesBesideClmColumn(features)
11571
11580
  ];
11572
11581
  }
11573
11582
  var init_scnTags = __esm({
@@ -11705,6 +11714,9 @@ function rowCodeOf(cell) {
11705
11714
  function rowClaimsOf(outline, outlineTags) {
11706
11715
  if (!outline.examples.some((examples) => claimColumnOf(examples) >= 0))
11707
11716
  return null;
11717
+ const tags = [...outlineTags, ...outline.examples.flatMap((examples) => examples.tags.map((tag) => bareTerm(tag.name)))];
11718
+ if (tags.some((tag) => CLAIM_CODE.test(tag)))
11719
+ return [{ name: outline.name, tags, clmColumn: true }];
11708
11720
  return outline.examples.flatMap((examples) => {
11709
11721
  const column = claimColumnOf(examples);
11710
11722
  const blockTags = examples.tags.map((tag) => bareTerm(tag.name));
@@ -11764,9 +11776,9 @@ function claimCodesAtOf(features) {
11764
11776
  function scenariosByClaimCodeOf({ scenarios }) {
11765
11777
  const taggedScenarios = [];
11766
11778
  const untaggedScenarios = [];
11767
- for (const { name, tags } of scenarios) {
11779
+ for (const { name, tags, clmColumn } of scenarios) {
11768
11780
  const { claimCode, severalCodes } = claimCodesOf(tags);
11769
- if (severalCodes !== void 0)
11781
+ if (clmColumn === true || severalCodes !== void 0)
11770
11782
  continue;
11771
11783
  if (claimCode === null)
11772
11784
  untaggedScenarios.push(name);
@@ -28419,14 +28431,15 @@ var init_messages_en2 = __esm({
28419
28431
  "unnamed-claim-ci-steps": "{count, plural, one {{count} CI step} other {{count} CI steps}}",
28420
28432
  "unnamed-claim-ci-steps-named": "{count, plural, one {{count} CI step} other {{count} CI steps}}: {list}",
28421
28433
  "claim-code-errors-framing": "{count} \u2014 each misfiles a claim code, so the by-feature cut below cannot be trusted, and the run fails (exit 1). Every account still reconciles as it would if the code were filed correctly.",
28422
- "several-claim-codes-framing": "{count} \u2014 each is a scenario carrying more than one claim code, so no account was raised for it under any of them, and the run fails (exit 1).",
28423
- "misfiled-and-several-claim-codes-framing": "{count} \u2014 each either misfiles a claim code, so the by-feature cut below cannot be trusted, or is a scenario carrying more than one claim code, so no account was raised for it under any of them. The run fails (exit 1).",
28434
+ "several-claim-codes-framing": "{count} \u2014 each is a scenario carrying more than one claim code, or a claim code beside a clm column, so no account was raised for it under any of them, and the run fails (exit 1).",
28435
+ "misfiled-and-several-claim-codes-framing": "{count} \u2014 each either misfiles a claim code, so the by-feature cut below cannot be trusted, or is a scenario carrying more than one claim code, or a claim code beside a clm column, so no account was raised for it under any of them. The run fails (exit 1).",
28424
28436
  "duplicate-claim-code-not-listed": `A duplicated claim code is not listed here: it is reported on its account's rows, as "{outcome}".`,
28425
28437
  "duplicate-feature-code": "the feature code @{code} is carried by {fileCount} feature files \u2014 {files}. A feature code names exactly one feature file: a reconciliation's by-feature cut groups on it, so two files sharing a code report as one row and attribute one file's scenarios to the other. Give one of them a code of its own.",
28426
28438
  "foreign-claim-code-carried": "{file} carries the feature code @{featureCode}, but holds the scenario @{claimCode}, whose feature part names {named}. A reconciliation's by-feature cut groups on the id, so it counts this scenario under {carrierCount, plural, one {{carriers}'s row, not {file}'s. Re-code the scenario for @{featureCode}, or move it to {carriers}.} other {the one row for {named}, which {carrierCount} feature files carry \u2014 {carriers} \u2014 so that row cannot say which of them it belongs to. Re-code the scenario for @{featureCode}, or move it once a single file carries {named}.}}",
28427
28439
  "foreign-claim-code-no-carrier": "{file} carries the feature code @{featureCode}, but holds the scenario @{claimCode}, whose feature part names {named}. A reconciliation's by-feature cut groups on the id, so it opens a row for {named}, which no feature file carries as its header code, so that row stands for no file. Re-code the scenario for @{featureCode}.",
28428
28440
  "no-feature-code": "{file} carries no feature code, but its scenarios carry claim codes. A feature file is the class its scenarios' codes are filed under: give it a header code of its own, and code its scenarios for it.",
28429
28441
  "several-claim-codes": `{file}'s scenario "{scenario}" carries {codeCount} claim codes \u2014 {codes}. A scenario is one account, so it raises its evidence obligations under none of them, and a test citing any of them cites a code no scenario carries. Give it one code.`,
28442
+ "claim-code-beside-clm-column": `{file}'s Outline "{scenario}" carries {codeCount, plural, one {the claim code} other {the claim codes}} {codes} beside a clm column. An Outline is one claim under the code it carries or one claim for each row under the code in its clm cell, never both, so it raises no evidence obligations, and a test citing its code or a row's cites a code no scenario carries. Take the code off the Outline, or drop its clm column.`,
28430
28443
  "report-title": "Evidence Reconciliation",
28431
28444
  "run-provenance-heading": "Run provenance",
28432
28445
  "provenance-target-repo": "Target repo: {target}",
@@ -28450,8 +28463,8 @@ var init_messages_en2 = __esm({
28450
28463
  "verdict-exit": "exit {code}",
28451
28464
  "claim-code-errors-headline": "**CLAIM CODE ERRORS**",
28452
28465
  "claim-code-errors-gloss": "the corpus files a claim code under the wrong feature, so the by-feature grouping cannot be trusted. Read `{heading}` above.{alsoOutOfBalance} This run FAILED.",
28453
- "several-claim-codes-gloss": "a scenario in the corpus carries more than one claim code, so no account was raised for it under any of them. Read `{heading}` above.{alsoOutOfBalance} This run FAILED.",
28454
- "misfiled-and-several-claim-codes-gloss": "the corpus files a claim code under the wrong feature, so the by-feature grouping cannot be trusted, and a scenario in it carries more than one claim code, so no account was raised for it under any of them. Read `{heading}` above.{alsoOutOfBalance} This run FAILED.",
28466
+ "several-claim-codes-gloss": "a scenario in the corpus carries more than one claim code, or a claim code beside a clm column, so no account was raised for it under any of them. Read `{heading}` above.{alsoOutOfBalance} This run FAILED.",
28467
+ "misfiled-and-several-claim-codes-gloss": "the corpus files a claim code under the wrong feature, so the by-feature grouping cannot be trusted, and a scenario in it carries more than one claim code, or a claim code beside a clm column, so no account was raised for it under any of them. Read `{heading}` above.{alsoOutOfBalance} This run FAILED.",
28455
28468
  "also-out-of-balance": " The accounts do not agree either: at least one Claim Reconciliation carries a reconciling item.",
28456
28469
  "out-of-balance-headline": "**OUT-OF-BALANCE**",
28457
28470
  "out-of-balance-gloss": "the accounts do not agree. At least one Claim Reconciliation carries a reconciling item. This run FAILED.",
@@ -31385,6 +31398,7 @@ var init_messages4 = __esm({
31385
31398
  CoreMessage2["ForeignClaimCodeNoCarrier"] = "foreign-claim-code-no-carrier";
31386
31399
  CoreMessage2["NoFeatureCode"] = "no-feature-code";
31387
31400
  CoreMessage2["ScenarioSeveralClaimCodes"] = "several-claim-codes";
31401
+ CoreMessage2["ClaimCodeBesideClmColumn"] = "claim-code-beside-clm-column";
31388
31402
  CoreMessage2["RunnerKeyNotALayer"] = "runner-key-not-a-layer";
31389
31403
  CoreMessage2["NotChecksEntryMatchesNoStep"] = "not-checks-entry-matches-no-step";
31390
31404
  CoreMessage2["NotChecksEntryNotAStepName"] = "not-checks-entry-not-a-step-name";
@@ -31530,6 +31544,7 @@ var init_messages4 = __esm({
31530
31544
  CoreError2["ForeignClaimCode"] = "foreign-claim-code";
31531
31545
  CoreError2["NoFeatureCode"] = "no-feature-code";
31532
31546
  CoreError2["SeveralClaimCodes"] = "several-claim-codes";
31547
+ CoreError2["ClaimCodeBesideClmColumn"] = "claim-code-beside-clm-column";
31533
31548
  })(CoreError || (CoreError = {}));
31534
31549
  }
31535
31550
  });
@@ -31748,7 +31763,7 @@ function worded(error) {
31748
31763
  return foreignWorded(error);
31749
31764
  if (error.kind === "no-feature-code")
31750
31765
  return coreMessage(CoreMessage.NoFeatureCode, { file: error.files.join(", ") });
31751
- return coreMessage(CoreMessage.ScenarioSeveralClaimCodes, {
31766
+ return coreMessage(NO_ACCOUNT_MESSAGE_OF[error.kind], {
31752
31767
  file: error.files.join(", "),
31753
31768
  scenario: error.scenario,
31754
31769
  codeCount: error.codes.length,
@@ -31769,7 +31784,7 @@ function foreignWorded(error) {
31769
31784
  });
31770
31785
  }
31771
31786
  }
31772
- var CODE_OF, claimCodeErrorsSection, claimCodesCleanStatement;
31787
+ var CODE_OF, NO_ACCOUNT_MESSAGE_OF, claimCodeErrorsSection, claimCodesCleanStatement;
31773
31788
  var init_claimCodeErrorsSection = __esm({
31774
31789
  "../core/dist/render/claimCodeErrorsSection.js"() {
31775
31790
  "use strict";
@@ -31782,7 +31797,12 @@ var init_claimCodeErrorsSection = __esm({
31782
31797
  "duplicate-feature-code": CoreError.DuplicateFeatureCode,
31783
31798
  "foreign-claim-code": CoreError.ForeignClaimCode,
31784
31799
  "no-feature-code": CoreError.NoFeatureCode,
31785
- "several-claim-codes": CoreError.SeveralClaimCodes
31800
+ "several-claim-codes": CoreError.SeveralClaimCodes,
31801
+ "claim-code-beside-clm-column": CoreError.ClaimCodeBesideClmColumn
31802
+ };
31803
+ NO_ACCOUNT_MESSAGE_OF = {
31804
+ "several-claim-codes": CoreMessage.ScenarioSeveralClaimCodes,
31805
+ "claim-code-beside-clm-column": CoreMessage.ClaimCodeBesideClmColumn
31786
31806
  };
31787
31807
  claimCodeErrorsSection = (report) => {
31788
31808
  const errors = report.errorsInTheInputs?.claimCodeErrors;
@@ -254,6 +254,37 @@
254
254
  "codes"
255
255
  ],
256
256
  "additionalProperties": false
257
+ },
258
+ {
259
+ "type": "object",
260
+ "properties": {
261
+ "kind": {
262
+ "type": "string",
263
+ "const": "claim-code-beside-clm-column"
264
+ },
265
+ "files": {
266
+ "type": "array",
267
+ "items": {
268
+ "type": "string"
269
+ }
270
+ },
271
+ "scenario": {
272
+ "type": "string"
273
+ },
274
+ "codes": {
275
+ "type": "array",
276
+ "items": {
277
+ "type": "string"
278
+ }
279
+ }
280
+ },
281
+ "required": [
282
+ "kind",
283
+ "files",
284
+ "scenario",
285
+ "codes"
286
+ ],
287
+ "additionalProperties": false
257
288
  }
258
289
  ]
259
290
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.248",
3
+ "version": "0.1.249",
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.248"
29
+ "@3f-consulting/spec-controller-core": "0.1.249"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"