spec-controller 0.1.156 → 0.1.157
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 +22 -16
- package/dist/spec-reconciliation.schema.json +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11829,6 +11829,9 @@ function evidenceOfRunResult(result) {
|
|
|
11829
11829
|
function isFitnessObservation(observation) {
|
|
11830
11830
|
return observation.qualityCheck === "fitness";
|
|
11831
11831
|
}
|
|
11832
|
+
function ranAsFitnessFunction(observation) {
|
|
11833
|
+
return isFitnessObservation(observation) && observation.broken !== true && observation.exists;
|
|
11834
|
+
}
|
|
11832
11835
|
var QUALITY_CHECKS, FALLBACK_QUALITY_CHECK, TIERS;
|
|
11833
11836
|
var init_journal = __esm({
|
|
11834
11837
|
"../core/dist/domain/journal.js"() {
|
|
@@ -12079,9 +12082,10 @@ function observationCountOf(row, qualityCheck) {
|
|
|
12079
12082
|
}
|
|
12080
12083
|
function stepsAt(row, qualityCheck, stepsByQualityCheck) {
|
|
12081
12084
|
if (qualityCheck === "fitness") {
|
|
12082
|
-
return
|
|
12085
|
+
return observationsOf(row).flatMap((o) => ranAsFitnessFunction(o) && o.step !== void 0 ? [o.step] : []);
|
|
12083
12086
|
}
|
|
12084
|
-
|
|
12087
|
+
const observed = observationsOf(row).some((o) => o.qualityCheck === qualityCheck);
|
|
12088
|
+
if (!namesQualityCheck(row, qualityCheck) && !observed)
|
|
12085
12089
|
return [];
|
|
12086
12090
|
return stepsByQualityCheck.find((entry) => entry.qualityCheck === qualityCheck)?.ciSteps ?? [];
|
|
12087
12091
|
}
|
|
@@ -12208,9 +12212,6 @@ function behaviouralObservationTally(ledger) {
|
|
|
12208
12212
|
const total = BEHAVIOURAL_QUALITY_CHECKS.reduce((n, qc) => n + rawByBehaviouralQualityCheck[qc], 0);
|
|
12209
12213
|
return { rawByBehaviouralQualityCheck, total, onScenario, onPhantomClaim, onUnnamedClaim };
|
|
12210
12214
|
}
|
|
12211
|
-
function ranAsFitnessFunction(observation) {
|
|
12212
|
-
return isFitnessObservation(observation) && observation.broken !== true && observation.exists;
|
|
12213
|
-
}
|
|
12214
12215
|
function runningFitnessObservations(ledger) {
|
|
12215
12216
|
return ledger.claimReconciliations.flatMap((row) => observationsOf(row).flatMap((observation) => ranAsFitnessFunction(observation) ? [observation] : []));
|
|
12216
12217
|
}
|
|
@@ -12415,7 +12416,10 @@ function reconcile(scenarios, evidenceObservations, untaggedScenarios = []) {
|
|
|
12415
12416
|
}
|
|
12416
12417
|
function stepsNamed(running, stepsInOrder) {
|
|
12417
12418
|
const named = new Set(running.map((observation) => observation.step));
|
|
12418
|
-
return stepsInOrder.filter((step) => named.has(step));
|
|
12419
|
+
return eachOnce(stepsInOrder.filter((step) => named.has(step)));
|
|
12420
|
+
}
|
|
12421
|
+
function eachOnce(steps) {
|
|
12422
|
+
return [...new Set(steps)];
|
|
12419
12423
|
}
|
|
12420
12424
|
function withSteps(entry, ciSteps) {
|
|
12421
12425
|
if (ciSteps.length === 0)
|
|
@@ -12435,7 +12439,7 @@ function ciStepsJoined(observations, ledger, runners, tiers, stepsInOrder) {
|
|
|
12435
12439
|
return withSteps(entry, stepsNamed(runningFitnessObservations(ledger), stepsInOrder));
|
|
12436
12440
|
}
|
|
12437
12441
|
const running = runners.filter((row) => row.tier === entry.qualityCheck);
|
|
12438
|
-
return withSteps(withDeclaredRunner(entry, tiers), running.map((row) => row.step));
|
|
12442
|
+
return withSteps(withDeclaredRunner(entry, tiers), eachOnce(running.map((row) => row.step)));
|
|
12439
12443
|
})
|
|
12440
12444
|
};
|
|
12441
12445
|
}
|
|
@@ -27678,22 +27682,23 @@ function declaredRunnerTest(scripts, runners, shell) {
|
|
|
27678
27682
|
const runnersRunBy = declaredRunnersRunBy(scripts, runners, shell);
|
|
27679
27683
|
return (step) => runnersRunBy(step).length > 0;
|
|
27680
27684
|
}
|
|
27681
|
-
function recognisedRunners(steps, scripts, runners, shell) {
|
|
27685
|
+
function recognisedRunners(steps, nameOf2, scripts, runners, shell) {
|
|
27682
27686
|
const runnersRunBy = declaredRunnersRunBy(scripts, runners, shell);
|
|
27683
27687
|
return steps.flatMap((step) => runnersRunBy(step).map(([tier, runner]) => ({
|
|
27684
27688
|
tier,
|
|
27685
27689
|
runner,
|
|
27686
|
-
step: step
|
|
27690
|
+
step: nameOf2(step)
|
|
27687
27691
|
})));
|
|
27688
27692
|
}
|
|
27689
|
-
var namesAWorkflowRead, namesAStep, jobKeyOf, byWorkflowThenJob, COUNTED_AS, noStepsOf;
|
|
27693
|
+
var namesAWorkflowRead, namesAStep, jobKeyOf, byCodeUnit, byWorkflowThenJob, COUNTED_AS, noStepsOf;
|
|
27690
27694
|
var init_uncitedFitnessFunctions = __esm({
|
|
27691
27695
|
"../core/dist/domain/uncitedFitnessFunctions.js"() {
|
|
27692
27696
|
"use strict";
|
|
27693
27697
|
namesAWorkflowRead = (entry, workflowsRead) => workflowsRead.some((workflow) => entry.startsWith(`${workflow}:`));
|
|
27694
27698
|
namesAStep = (entry) => entry.split(":").length > 2;
|
|
27695
27699
|
jobKeyOf = (step) => `${step.workflow}:${step.job}`;
|
|
27696
|
-
|
|
27700
|
+
byCodeUnit = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
27701
|
+
byWorkflowThenJob = (a, b) => byCodeUnit(a.workflow, b.workflow) || byCodeUnit(a.job, b.job);
|
|
27697
27702
|
COUNTED_AS = {
|
|
27698
27703
|
candidate: "candidates",
|
|
27699
27704
|
runner: "runners",
|
|
@@ -27907,7 +27912,8 @@ var init_runVerdict = __esm({
|
|
|
27907
27912
|
|
|
27908
27913
|
// ../core/dist/domain/outOfBalanceByFeature.js
|
|
27909
27914
|
function outOfBalanceByFeature(rows, untagged, featureNames) {
|
|
27910
|
-
const
|
|
27915
|
+
const fileOfCode = new Map(Object.entries(featureNames).map(([code, slug]) => [code, `${slug}.feature`]));
|
|
27916
|
+
const codeOfFile = new Map([...fileOfCode].map(([code, file]) => [file, code]));
|
|
27911
27917
|
const featureOf = new Map(untagged.map((u) => [untaggedScenarioId(u), codeOfFile.get(u.feature) ?? u.feature]));
|
|
27912
27918
|
const groups = /* @__PURE__ */ new Map();
|
|
27913
27919
|
for (const s of rows) {
|
|
@@ -27923,10 +27929,10 @@ function outOfBalanceByFeature(rows, untagged, featureNames) {
|
|
|
27923
27929
|
groups.set(key, group);
|
|
27924
27930
|
}
|
|
27925
27931
|
return [...groups].map(([feature, { claims, noScnCode }]) => {
|
|
27926
|
-
const
|
|
27932
|
+
const featureFile = fileOfCode.get(feature);
|
|
27927
27933
|
return {
|
|
27928
27934
|
feature,
|
|
27929
|
-
...
|
|
27935
|
+
...featureFile ? { featureFile } : {},
|
|
27930
27936
|
count: claims.length + noScnCode,
|
|
27931
27937
|
claims,
|
|
27932
27938
|
...noScnCode > 0 ? { scenariosWithNoScnCode: noScnCode } : {}
|
|
@@ -28221,7 +28227,7 @@ function withUnmatchedNonChecks(reconciliation, { matchingNoStep, notAStepName }
|
|
|
28221
28227
|
}
|
|
28222
28228
|
function withRunnerAccount(reconciliation, steps, packageJson, { tiers: runnerTiers, unrecognisedKeys }) {
|
|
28223
28229
|
const scripts = packageJson.scripts ?? {};
|
|
28224
|
-
const behaviouralRunners = recognisedRunners(steps, scripts, runnerTiers, shellReading);
|
|
28230
|
+
const behaviouralRunners = recognisedRunners(steps, qualifiedStepName, scripts, runnerTiers, shellReading);
|
|
28225
28231
|
const { evidenceObservations } = reconciliation.summary;
|
|
28226
28232
|
return {
|
|
28227
28233
|
...reconciliation,
|
|
@@ -29299,7 +29305,7 @@ function byFeatureTableLines(groups) {
|
|
|
29299
29305
|
return [];
|
|
29300
29306
|
const lines = [CORE_MESSAGES[CoreMessage.ByFeatureTableHeader], "| --- | --- | --- |"];
|
|
29301
29307
|
for (const group of groups) {
|
|
29302
|
-
const label = group.
|
|
29308
|
+
const label = group.featureFile ? `${group.featureFile} (${group.feature})` : group.feature;
|
|
29303
29309
|
lines.push(`| ${label} | ${group.count} | ${idsCell(group)} |`);
|
|
29304
29310
|
}
|
|
29305
29311
|
lines.push("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-controller",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.157",
|
|
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.
|
|
29
|
+
"@3f-consulting/spec-controller-core": "0.1.157"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|