spec-controller 0.1.163 → 0.1.165
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 +43 -17
- package/dist/spec-reconciliation.schema.json +6 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -27607,11 +27607,30 @@ function nonChecksApplied(steps, nameOf2, nonChecks) {
|
|
|
27607
27607
|
}
|
|
27608
27608
|
};
|
|
27609
27609
|
}
|
|
27610
|
+
function workflowReadNamedBy(entry, workflowsRead) {
|
|
27611
|
+
return workflowsRead.filter((workflow) => entry.startsWith(`${workflow}:`)).sort((a, b) => b.length - a.length)[0];
|
|
27612
|
+
}
|
|
27613
|
+
function workflowFileNamedBy(entry) {
|
|
27614
|
+
const end = WORKFLOW_FILE_THEN_COLON.exec(entry);
|
|
27615
|
+
return end === null ? void 0 : entry.slice(0, end.index + end[0].length - 1);
|
|
27616
|
+
}
|
|
27617
|
+
function namesAJobAndAStep(remainder) {
|
|
27618
|
+
const jobEnd = remainder.indexOf(":");
|
|
27619
|
+
return jobEnd > 0 && jobEnd < remainder.length - 1;
|
|
27620
|
+
}
|
|
27621
|
+
function notAppliedAs(entry, workflowsRead) {
|
|
27622
|
+
const read = workflowReadNamedBy(entry, workflowsRead);
|
|
27623
|
+
const workflow = read ?? workflowFileNamedBy(entry);
|
|
27624
|
+
if (workflow === void 0 || !namesAJobAndAStep(entry.slice(workflow.length + 1)))
|
|
27625
|
+
return "notAStepName";
|
|
27626
|
+
return read === void 0 ? "namingAWorkflowNotRead" : "matchingNoStep";
|
|
27627
|
+
}
|
|
27610
27628
|
function nonChecksNotApplied(unmatchedEntries, workflowsRead) {
|
|
27629
|
+
const as = (reason) => unmatchedEntries.filter((entry) => notAppliedAs(entry, workflowsRead) === reason);
|
|
27611
27630
|
return {
|
|
27612
|
-
matchingNoStep:
|
|
27613
|
-
notAStepName:
|
|
27614
|
-
namingAWorkflowNotRead:
|
|
27631
|
+
matchingNoStep: as("matchingNoStep"),
|
|
27632
|
+
notAStepName: as("notAStepName"),
|
|
27633
|
+
namingAWorkflowNotRead: as("namingAWorkflowNotRead")
|
|
27615
27634
|
};
|
|
27616
27635
|
}
|
|
27617
27636
|
function exclusionOf(step, isReconciler, isNamedANonCheck) {
|
|
@@ -27690,15 +27709,15 @@ function recognisedRunners(steps, nameOf2, scripts, runners, shell) {
|
|
|
27690
27709
|
step: nameOf2(step)
|
|
27691
27710
|
})));
|
|
27692
27711
|
}
|
|
27693
|
-
var
|
|
27712
|
+
var WORKFLOW_FILE_THEN_COLON, jobKeyOf, byCodeUnit, byWorkflowThenJob, workflowsReadInOrder, COUNTED_AS, noStepsOf;
|
|
27694
27713
|
var init_uncitedFitnessFunctions = __esm({
|
|
27695
27714
|
"../core/dist/domain/uncitedFitnessFunctions.js"() {
|
|
27696
27715
|
"use strict";
|
|
27697
|
-
|
|
27698
|
-
namesAStep = (entry) => entry.split(":").length > 2;
|
|
27716
|
+
WORKFLOW_FILE_THEN_COLON = /\.ya?ml:/;
|
|
27699
27717
|
jobKeyOf = (step) => `${step.workflow}:${step.job}`;
|
|
27700
27718
|
byCodeUnit = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
27701
27719
|
byWorkflowThenJob = (a, b) => byCodeUnit(a.workflow, b.workflow) || byCodeUnit(a.job, b.job);
|
|
27720
|
+
workflowsReadInOrder = (files) => [...files].sort(byCodeUnit);
|
|
27702
27721
|
COUNTED_AS = {
|
|
27703
27722
|
candidate: "candidates",
|
|
27704
27723
|
runner: "runners",
|
|
@@ -28151,6 +28170,7 @@ function observationStreams(input, steps, corpus, packageJson, isCandidate) {
|
|
|
28151
28170
|
function pipelineReadings(input) {
|
|
28152
28171
|
const { packageJson } = input;
|
|
28153
28172
|
const steps = pipelineStepsOf(input.ciWorkflows);
|
|
28173
|
+
const workflowsRead = workflowsReadInOrder(input.ciWorkflows.map(({ file }) => file));
|
|
28154
28174
|
const exclusions = nonChecksApplied(steps, qualifiedStepName, resolveNotChecks(packageJson));
|
|
28155
28175
|
const runners = resolveRunners(packageJson);
|
|
28156
28176
|
const invocation = input.reconcilerInvocation ?? "";
|
|
@@ -28160,7 +28180,8 @@ function pipelineReadings(input) {
|
|
|
28160
28180
|
return {
|
|
28161
28181
|
steps,
|
|
28162
28182
|
runners,
|
|
28163
|
-
notApplied: nonChecksNotApplied(exclusions.unmatchedEntries,
|
|
28183
|
+
notApplied: nonChecksNotApplied(exclusions.unmatchedEntries, workflowsRead),
|
|
28184
|
+
workflowsRead,
|
|
28164
28185
|
reconciler,
|
|
28165
28186
|
dispositionOf: stepDispositions({
|
|
28166
28187
|
isReconciler: reconciler.isReconciler,
|
|
@@ -28175,10 +28196,11 @@ function untaggedScenariosAmong(features) {
|
|
|
28175
28196
|
function evidenceReconciliationFromSources(input) {
|
|
28176
28197
|
const { packageJson } = input;
|
|
28177
28198
|
const corpus = readTargetCorpus(input.features, resolveDeferralTags(packageJson, input.deferralTags));
|
|
28178
|
-
const
|
|
28199
|
+
const readings = pipelineReadings(input);
|
|
28200
|
+
const { steps, dispositionOf } = readings;
|
|
28179
28201
|
const isCandidate = (step) => dispositionOf(step) === "candidate";
|
|
28180
28202
|
const reconciliation = evidenceReconciliationOf(corpus.scenarios, observationStreams(input, steps, corpus, packageJson, isCandidate), untaggedScenariosAmong(input.features));
|
|
28181
|
-
return withScenarioCodeErrors(withConfigurationAccount(withReaderAccounts(reconciliation,
|
|
28203
|
+
return withScenarioCodeErrors(withConfigurationAccount(withReaderAccounts(reconciliation, packageJson, readings), packageJson), input);
|
|
28182
28204
|
}
|
|
28183
28205
|
function withConfigurationAccount(reconciliation, packageJson) {
|
|
28184
28206
|
const { wrongKinds, unknownKeys } = configurationNotRead(packageJson);
|
|
@@ -28198,10 +28220,10 @@ function withScenarioCodeErrors(reconciliation, input) {
|
|
|
28198
28220
|
scenarioCodePopulation: scenarioCodePopulationOf(input.features)
|
|
28199
28221
|
};
|
|
28200
28222
|
}
|
|
28201
|
-
function withReaderAccounts(reconciliation,
|
|
28202
|
-
return withStepAccounting(withUnmatchedNonChecks(withRunnerAccount(reconciliation, steps, packageJson, runners), notApplied), steps, dispositionOf, reconciler.roleOf, notApplied.namingAWorkflowNotRead);
|
|
28223
|
+
function withReaderAccounts(reconciliation, packageJson, { steps, runners, notApplied, workflowsRead, reconciler, dispositionOf }) {
|
|
28224
|
+
return withStepAccounting(withUnmatchedNonChecks(withRunnerAccount(reconciliation, steps, packageJson, runners), notApplied), steps, dispositionOf, reconciler.roleOf, { namingAWorkflowNotRead: notApplied.namingAWorkflowNotRead, workflowsRead });
|
|
28203
28225
|
}
|
|
28204
|
-
function withStepAccounting(reconciliation, steps, dispositionOf, roleOf, namingAWorkflowNotRead) {
|
|
28226
|
+
function withStepAccounting(reconciliation, steps, dispositionOf, roleOf, { namingAWorkflowNotRead, workflowsRead }) {
|
|
28205
28227
|
if (steps.length === 0)
|
|
28206
28228
|
return reconciliation;
|
|
28207
28229
|
return {
|
|
@@ -28210,7 +28232,8 @@ function withStepAccounting(reconciliation, steps, dispositionOf, roleOf, naming
|
|
|
28210
28232
|
...reconciliation.summary,
|
|
28211
28233
|
stepAccounting: {
|
|
28212
28234
|
...stepAccountOf(steps, dispositionOf, qualifiedStepName, roleOf),
|
|
28213
|
-
...namingAWorkflowNotRead.length > 0 ? { nonChecksNamingAWorkflowNotRead: namingAWorkflowNotRead } : {}
|
|
28235
|
+
...namingAWorkflowNotRead.length > 0 ? { nonChecksNamingAWorkflowNotRead: namingAWorkflowNotRead } : {},
|
|
28236
|
+
workflowsRead
|
|
28214
28237
|
}
|
|
28215
28238
|
}
|
|
28216
28239
|
};
|
|
@@ -28893,15 +28916,18 @@ var init_provenanceSection = __esm({
|
|
|
28893
28916
|
});
|
|
28894
28917
|
|
|
28895
28918
|
// ../core/dist/render/codeSpan.js
|
|
28896
|
-
function codeSpan(
|
|
28919
|
+
function codeSpan(written) {
|
|
28920
|
+
const text = spanHoldsAsWritten(written) ? written : JSON.stringify(written);
|
|
28897
28921
|
const longestRun = Math.max(0, ...(text.match(/`+/g) ?? []).map((run3) => run3.length));
|
|
28898
28922
|
const fence = "`".repeat(longestRun + 1);
|
|
28899
28923
|
const pad = text.startsWith("`") || text.endsWith("`") ? " " : "";
|
|
28900
28924
|
return `${fence}${pad}${text}${pad}${fence}`;
|
|
28901
28925
|
}
|
|
28926
|
+
var spanHoldsAsWritten;
|
|
28902
28927
|
var init_codeSpan = __esm({
|
|
28903
28928
|
"../core/dist/render/codeSpan.js"() {
|
|
28904
28929
|
"use strict";
|
|
28930
|
+
spanHoldsAsWritten = (text) => text !== "" && !(text.startsWith(" ") && text.endsWith(" ")) && !/[\n\r]/.test(text) && !(text.startsWith('"') && text.endsWith('"'));
|
|
28905
28931
|
}
|
|
28906
28932
|
});
|
|
28907
28933
|
|
|
@@ -29026,10 +29052,10 @@ var init_stepAccounting = __esm({
|
|
|
29026
29052
|
""
|
|
29027
29053
|
];
|
|
29028
29054
|
};
|
|
29029
|
-
workflowsReadOf = ({ byJob }) => [...new Set(byJob.map(({ workflow }) => workflow))].map((workflow) =>
|
|
29055
|
+
workflowsReadOf = ({ workflowsRead, byJob }) => [...new Set(workflowsRead ?? byJob.map(({ workflow }) => workflow))].map((workflow) => codeSpan(workflow)).join(", ");
|
|
29030
29056
|
notAppliedListOf = (accounting) => {
|
|
29031
|
-
const notApplied = accounting.nonChecksNamingAWorkflowNotRead
|
|
29032
|
-
if (notApplied
|
|
29057
|
+
const notApplied = accounting.nonChecksNamingAWorkflowNotRead;
|
|
29058
|
+
if (notApplied === void 0)
|
|
29033
29059
|
return [];
|
|
29034
29060
|
return [
|
|
29035
29061
|
CORE_MESSAGES[CoreMessage.StepAccountingNotAppliedLabel]("`specController.notChecks`", workflowsReadOf(accounting)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-controller",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.165",
|
|
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.165"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|