spec-controller 0.1.272 → 0.1.273

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 +11 -11
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -568,12 +568,14 @@ function recordedObservationOf(recorded2, steps) {
568
568
  return { cites, result, kind: "fitness", place, notes: [] };
569
569
  }
570
570
  function fitnessObservationsOf(steps, dispositionOf, recorded2) {
571
- const workflow = steps.filter((step) => dispositionOf(step) === "candidate").map(workflowObservationOf);
571
+ const candidates = steps.filter((step) => dispositionOf(step) === "candidate");
572
572
  if (recorded2 === void 0)
573
- return workflow;
573
+ return candidates.map(workflowObservationOf);
574
+ const fitnessEntries = recorded2.filter(isKeyedByAClaimCode);
575
+ const isRecorded = (step) => fitnessEntries.some(({ key }) => key === step.id);
574
576
  return [
575
- ...workflow.filter(({ cites }) => cites.length === 0),
576
- ...recorded2.filter(isKeyedByAClaimCode).map((entry) => recordedObservationOf(entry, steps))
577
+ ...candidates.filter((step) => !isRecorded(step)).map(workflowObservationOf),
578
+ ...fitnessEntries.map((entry) => recordedObservationOf(entry, steps))
577
579
  ];
578
580
  }
579
581
  function neverRanObservation(kind, place, message2) {
@@ -670,10 +672,10 @@ function kindsTheTagsName(tags) {
670
672
  }
671
673
  function scenarioResultOf(steps) {
672
674
  const endings = steps.map(endingOf);
673
- if (endings.includes("failed"))
674
- return "failed";
675
675
  if (endings.includes("could-not-run"))
676
676
  return "never-ran";
677
+ if (endings.includes("failed"))
678
+ return "failed";
677
679
  return endings.length > 0 && endings.every((ending) => ending === "passed") ? "passed" : void 0;
678
680
  }
679
681
  function scenarioRunObservationOf(run3, root, claimCodesAt) {
@@ -682,12 +684,10 @@ function scenarioRunObservationOf(run3, root, claimCodesAt) {
682
684
  return [];
683
685
  const place = relativizeToRoot(String(run3.featurePath ?? run3.featureName), root);
684
686
  const rowCodes = run3.line === void 0 ? [] : claimCodesAt(place, run3.line);
685
- const [firstKind, ...otherKinds] = kindsTheTagsName(run3.tags);
686
687
  const cites = nearestCitation([codesIn2([...run3.tags, ...rowCodes])]);
687
- if (result === "never-ran") {
688
- return [{ cites, result, kind: firstKind, place, notes: run3.steps.filter((step) => endingOf(step) === "could-not-run").map(stepText) }];
689
- }
690
- return [firstKind, ...otherKinds].map((kind) => ({ cites, result, kind, place, notes: [], name: run3.name }));
688
+ const neverRan = result === "never-ran";
689
+ const notes = neverRan ? run3.steps.filter((step) => endingOf(step) === "could-not-run").map(stepText) : [];
690
+ return kindsTheTagsName(run3.tags).map((kind) => ({ cites, result, kind, place, notes, ...neverRan ? {} : { name: run3.name } }));
691
691
  }
692
692
  function scenarioRunObservationsOf(runs2, root, claimCodesAt) {
693
693
  return runs2.flatMap((run3) => scenarioRunObservationOf(run3, root, claimCodesAt));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.272",
3
+ "version": "0.1.273",
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.272"
29
+ "@3f-consulting/spec-controller-core": "0.1.273"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"