@3f-consulting/spec-controller-core 0.1.0-alpha.8 → 0.1.0-alpha.80
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/README.md +3 -3
- package/dist/assemble/evidenceReconciliationFromSources.d.ts +18 -53
- package/dist/assemble/evidenceReconciliationFromSources.d.ts.map +1 -1
- package/dist/assemble/evidenceReconciliationFromSources.js +31 -326
- package/dist/assemble/evidenceReconciliationFromSources.js.map +1 -1
- package/dist/assemble/renderInput.d.ts +15 -81
- package/dist/assemble/renderInput.d.ts.map +1 -1
- package/dist/assemble/renderInput.js +3 -45
- package/dist/assemble/renderInput.js.map +1 -1
- package/dist/census/evidenceObligations.d.ts +17 -52
- package/dist/census/evidenceObligations.d.ts.map +1 -1
- package/dist/census/evidenceObligations.js +19 -25
- package/dist/census/evidenceObligations.js.map +1 -1
- package/dist/domain/evidenceOrder.d.ts +3 -0
- package/dist/domain/evidenceOrder.d.ts.map +1 -0
- package/dist/domain/evidenceOrder.js +15 -0
- package/dist/domain/evidenceOrder.js.map +1 -0
- package/dist/domain/evidenceReconciliation.d.ts +40 -410
- package/dist/domain/evidenceReconciliation.d.ts.map +1 -1
- package/dist/domain/evidenceReconciliation.js +68 -388
- package/dist/domain/evidenceReconciliation.js.map +1 -1
- package/dist/domain/featureCode.d.ts +4 -0
- package/dist/domain/featureCode.d.ts.map +1 -0
- package/dist/domain/featureCode.js +12 -0
- package/dist/domain/featureCode.js.map +1 -0
- package/dist/domain/journal.d.ts +27 -411
- package/dist/domain/journal.d.ts.map +1 -1
- package/dist/domain/journal.js +7 -118
- package/dist/domain/journal.js.map +1 -1
- package/dist/domain/ledger.d.ts +37 -357
- package/dist/domain/ledger.d.ts.map +1 -1
- package/dist/domain/ledger.js +43 -346
- package/dist/domain/ledger.js.map +1 -1
- package/dist/domain/messages.d.ts +224 -0
- package/dist/domain/messages.d.ts.map +1 -0
- package/dist/domain/messages.js +335 -0
- package/dist/domain/messages.js.map +1 -0
- package/dist/domain/outcome.d.ts +3 -0
- package/dist/domain/outcome.d.ts.map +1 -0
- package/dist/domain/outcome.js +2 -0
- package/dist/domain/outcome.js.map +1 -0
- package/dist/domain/posting.d.ts +24 -121
- package/dist/domain/posting.d.ts.map +1 -1
- package/dist/domain/posting.js +4 -56
- package/dist/domain/posting.js.map +1 -1
- package/dist/domain/qualityCheckFault.d.ts +4 -44
- package/dist/domain/qualityCheckFault.d.ts.map +1 -1
- package/dist/domain/qualityCheckFault.js +0 -24
- package/dist/domain/qualityCheckFault.js.map +1 -1
- package/dist/domain/qualityCheckReconciliation.d.ts +15 -288
- package/dist/domain/qualityCheckReconciliation.d.ts.map +1 -1
- package/dist/domain/qualityCheckReconciliation.js +80 -479
- package/dist/domain/qualityCheckReconciliation.js.map +1 -1
- package/dist/domain/qualityCheckReconciliationFault.d.ts +0 -19
- package/dist/domain/qualityCheckReconciliationFault.d.ts.map +1 -1
- package/dist/domain/qualityCheckReconciliationFault.js +1 -24
- package/dist/domain/qualityCheckReconciliationFault.js.map +1 -1
- package/dist/domain/scenarioCodeError.d.ts +16 -0
- package/dist/domain/scenarioCodeError.d.ts.map +1 -0
- package/dist/domain/scenarioCodeError.js +4 -0
- package/dist/domain/scenarioCodeError.js.map +1 -0
- package/dist/domain/scenarioReconciliation.d.ts +10 -215
- package/dist/domain/scenarioReconciliation.d.ts.map +1 -1
- package/dist/domain/scenarioReconciliation.js +4 -101
- package/dist/domain/scenarioReconciliation.js.map +1 -1
- package/dist/domain/scnAllocation.d.ts +27 -0
- package/dist/domain/scnAllocation.d.ts.map +1 -0
- package/dist/domain/scnAllocation.js +33 -0
- package/dist/domain/scnAllocation.js.map +1 -0
- package/dist/domain/verdictCode.d.ts +10 -0
- package/dist/domain/verdictCode.d.ts.map +1 -0
- package/dist/domain/verdictCode.js +16 -0
- package/dist/domain/verdictCode.js.map +1 -0
- package/dist/index.d.ts +14 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -88
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +3 -27
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -94
- package/dist/internal.js.map +1 -1
- package/dist/lib/bareTerm.d.ts +0 -39
- package/dist/lib/bareTerm.d.ts.map +1 -1
- package/dist/lib/bareTerm.js +0 -39
- package/dist/lib/bareTerm.js.map +1 -1
- package/dist/lib/portablePath.d.ts.map +1 -1
- package/dist/lib/portablePath.js +2 -16
- package/dist/lib/portablePath.js.map +1 -1
- package/dist/lib/scnCitation.d.ts +0 -32
- package/dist/lib/scnCitation.d.ts.map +1 -1
- package/dist/lib/scnCitation.js +2 -42
- package/dist/lib/scnCitation.js.map +1 -1
- package/dist/model.d.ts +0 -23
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +0 -23
- package/dist/model.js.map +1 -1
- package/dist/parse/checkScriptsRunInCI.d.ts +6 -169
- package/dist/parse/checkScriptsRunInCI.d.ts.map +1 -1
- package/dist/parse/checkScriptsRunInCI.js +11 -171
- package/dist/parse/checkScriptsRunInCI.js.map +1 -1
- package/dist/parse/ciStepRecord.d.ts +4 -118
- package/dist/parse/ciStepRecord.d.ts.map +1 -1
- package/dist/parse/ciStepRecord.js +20 -227
- package/dist/parse/ciStepRecord.js.map +1 -1
- package/dist/parse/commandRuns.d.ts +0 -39
- package/dist/parse/commandRuns.d.ts.map +1 -1
- package/dist/parse/commandRuns.js +6 -67
- package/dist/parse/commandRuns.js.map +1 -1
- package/dist/parse/cucumber.d.ts +13 -66
- package/dist/parse/cucumber.d.ts.map +1 -1
- package/dist/parse/cucumber.js +42 -146
- package/dist/parse/cucumber.js.map +1 -1
- package/dist/parse/discoveryScope.d.ts +1 -46
- package/dist/parse/discoveryScope.d.ts.map +1 -1
- package/dist/parse/discoveryScope.js +4 -61
- package/dist/parse/discoveryScope.js.map +1 -1
- package/dist/parse/fitnessCitations.d.ts +1 -72
- package/dist/parse/fitnessCitations.d.ts.map +1 -1
- package/dist/parse/fitnessCitations.js +3 -55
- package/dist/parse/fitnessCitations.js.map +1 -1
- package/dist/parse/reconcilerSteps.d.ts +0 -46
- package/dist/parse/reconcilerSteps.d.ts.map +1 -1
- package/dist/parse/reconcilerSteps.js +2 -64
- package/dist/parse/reconcilerSteps.js.map +1 -1
- package/dist/parse/runningFitnessFunctions.d.ts +9 -0
- package/dist/parse/runningFitnessFunctions.d.ts.map +1 -0
- package/dist/parse/runningFitnessFunctions.js +57 -0
- package/dist/parse/runningFitnessFunctions.js.map +1 -0
- package/dist/parse/scenarioCodeErrors.d.ts +11 -0
- package/dist/parse/scenarioCodeErrors.d.ts.map +1 -0
- package/dist/parse/scenarioCodeErrors.js +78 -0
- package/dist/parse/scenarioCodeErrors.js.map +1 -0
- package/dist/parse/scenarios.d.ts +5 -230
- package/dist/parse/scenarios.d.ts.map +1 -1
- package/dist/parse/scenarios.js +25 -467
- package/dist/parse/scenarios.js.map +1 -1
- package/dist/parse/stepAccounting.d.ts +0 -46
- package/dist/parse/stepAccounting.d.ts.map +1 -1
- package/dist/parse/stepAccounting.js +1 -55
- package/dist/parse/stepAccounting.js.map +1 -1
- package/dist/parse/stepExclusions.d.ts +0 -47
- package/dist/parse/stepExclusions.d.ts.map +1 -1
- package/dist/parse/stepExclusions.js +2 -50
- package/dist/parse/stepExclusions.js.map +1 -1
- package/dist/parse/stepNames.d.ts +0 -27
- package/dist/parse/stepNames.d.ts.map +1 -1
- package/dist/parse/stepNames.js +0 -27
- package/dist/parse/stepNames.js.map +1 -1
- package/dist/parse/targetCorpus.d.ts +3 -80
- package/dist/parse/targetCorpus.d.ts.map +1 -1
- package/dist/parse/targetCorpus.js +4 -46
- package/dist/parse/targetCorpus.js.map +1 -1
- package/dist/parse/targetManifest.d.ts +8 -146
- package/dist/parse/targetManifest.d.ts.map +1 -1
- package/dist/parse/targetManifest.js +48 -198
- package/dist/parse/targetManifest.js.map +1 -1
- package/dist/parse/vitest.d.ts +8 -68
- package/dist/parse/vitest.d.ts.map +1 -1
- package/dist/parse/vitest.js +4 -83
- package/dist/parse/vitest.js.map +1 -1
- package/dist/provenance/provenance.d.ts +30 -138
- package/dist/provenance/provenance.d.ts.map +1 -1
- package/dist/provenance/provenance.js +5 -65
- package/dist/provenance/provenance.js.map +1 -1
- package/dist/render/behaviouralRunners.d.ts +0 -29
- package/dist/render/behaviouralRunners.d.ts.map +1 -1
- package/dist/render/behaviouralRunners.js +6 -69
- package/dist/render/behaviouralRunners.js.map +1 -1
- package/dist/render/configurationNotRead.d.ts +3 -0
- package/dist/render/configurationNotRead.d.ts.map +1 -0
- package/dist/render/configurationNotRead.js +17 -0
- package/dist/render/configurationNotRead.js.map +1 -0
- package/dist/render/discoveryScope.d.ts +0 -37
- package/dist/render/discoveryScope.d.ts.map +1 -1
- package/dist/render/discoveryScope.js +3 -39
- package/dist/render/discoveryScope.js.map +1 -1
- package/dist/render/evidenceGrid.d.ts +3 -37
- package/dist/render/evidenceGrid.d.ts.map +1 -1
- package/dist/render/evidenceGrid.js +21 -103
- package/dist/render/evidenceGrid.js.map +1 -1
- package/dist/render/excludedSteps.d.ts +0 -26
- package/dist/render/excludedSteps.d.ts.map +1 -1
- package/dist/render/excludedSteps.js +4 -32
- package/dist/render/excludedSteps.js.map +1 -1
- package/dist/render/fitnessFunctions.d.ts +3 -0
- package/dist/render/fitnessFunctions.d.ts.map +1 -0
- package/dist/render/fitnessFunctions.js +12 -0
- package/dist/render/fitnessFunctions.js.map +1 -0
- package/dist/render/json.d.ts +0 -11
- package/dist/render/json.d.ts.map +1 -1
- package/dist/render/json.js +0 -11
- package/dist/render/json.js.map +1 -1
- package/dist/render/markdown.d.ts +1 -55
- package/dist/render/markdown.d.ts.map +1 -1
- package/dist/render/markdown.js +104 -480
- package/dist/render/markdown.js.map +1 -1
- package/dist/render/provenanceSection.d.ts +0 -22
- package/dist/render/provenanceSection.d.ts.map +1 -1
- package/dist/render/provenanceSection.js +10 -53
- package/dist/render/provenanceSection.js.map +1 -1
- package/dist/render/reconcilerSteps.d.ts +0 -25
- package/dist/render/reconcilerSteps.d.ts.map +1 -1
- package/dist/render/reconcilerSteps.js +5 -30
- package/dist/render/reconcilerSteps.js.map +1 -1
- package/dist/render/runVerdict.d.ts +0 -38
- package/dist/render/runVerdict.d.ts.map +1 -1
- package/dist/render/runVerdict.js +62 -129
- package/dist/render/runVerdict.js.map +1 -1
- package/dist/render/scenarioCodeErrorsSection.d.ts +3 -0
- package/dist/render/scenarioCodeErrorsSection.d.ts.map +1 -0
- package/dist/render/scenarioCodeErrorsSection.js +45 -0
- package/dist/render/scenarioCodeErrorsSection.js.map +1 -0
- package/dist/render/stepAccounting.d.ts +0 -36
- package/dist/render/stepAccounting.d.ts.map +1 -1
- package/dist/render/stepAccounting.js +5 -49
- package/dist/render/stepAccounting.js.map +1 -1
- package/dist/render/testVolume.d.ts +0 -25
- package/dist/render/testVolume.d.ts.map +1 -1
- package/dist/render/testVolume.js +4 -35
- package/dist/render/testVolume.js.map +1 -1
- package/package.json +4 -1
- package/dist/domain/checkCharacteristics.d.ts +0 -88
- package/dist/domain/checkCharacteristics.d.ts.map +0 -1
- package/dist/domain/checkCharacteristics.js +0 -109
- package/dist/domain/checkCharacteristics.js.map +0 -1
- package/dist/domain/fitnessChecks.d.ts +0 -79
- package/dist/domain/fitnessChecks.d.ts.map +0 -1
- package/dist/domain/fitnessChecks.js +0 -81
- package/dist/domain/fitnessChecks.js.map +0 -1
- package/dist/domain/qualityCheckFaultMessages.d.ts +0 -43
- package/dist/domain/qualityCheckFaultMessages.d.ts.map +0 -1
- package/dist/domain/qualityCheckFaultMessages.js +0 -38
- package/dist/domain/qualityCheckFaultMessages.js.map +0 -1
- package/dist/lib/featureCode.d.ts +0 -21
- package/dist/lib/featureCode.d.ts.map +0 -1
- package/dist/lib/featureCode.js +0 -24
- package/dist/lib/featureCode.js.map +0 -1
- package/dist/parse/corpusCodeFaults.d.ts +0 -76
- package/dist/parse/corpusCodeFaults.d.ts.map +0 -1
- package/dist/parse/corpusCodeFaults.js +0 -121
- package/dist/parse/corpusCodeFaults.js.map +0 -1
- package/dist/parse/corpusFaults.d.ts +0 -124
- package/dist/parse/corpusFaults.d.ts.map +0 -1
- package/dist/parse/corpusFaults.js +0 -72
- package/dist/parse/corpusFaults.js.map +0 -1
- package/dist/parse/corpusGrammarFaults.d.ts +0 -71
- package/dist/parse/corpusGrammarFaults.d.ts.map +0 -1
- package/dist/parse/corpusGrammarFaults.js +0 -292
- package/dist/parse/corpusGrammarFaults.js.map +0 -1
- package/dist/parse/runningStaticChecks.d.ts +0 -125
- package/dist/parse/runningStaticChecks.d.ts.map +0 -1
- package/dist/parse/runningStaticChecks.js +0 -316
- package/dist/parse/runningStaticChecks.js.map +0 -1
- package/dist/render/staticChecks.d.ts +0 -23
- package/dist/render/staticChecks.d.ts.map +0 -1
- package/dist/render/staticChecks.js +0 -69
- package/dist/render/staticChecks.js.map +0 -1
|
@@ -1,61 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE CITATION SEAM'S SURVIVING ROUTE — a consumer's own CI step states the code of the configured
|
|
3
|
-
* row it answers, and this reads that row back as what the run cites.
|
|
4
|
-
*
|
|
5
|
-
* THE TWO-HOP REGISTRY ROUTE THIS FILE ONCE ALSO HELD IS RETIRED (3F-3161, @SCN-LNT-017 — the last
|
|
6
|
-
* registry-`scn` scenario: a registry entry naming a scenario that carries a different
|
|
7
|
-
* characteristic cited nothing, and no scenario is left needing that resolution at all).
|
|
8
|
-
* The retired registry module (hop 1, script handle → bare check tag) and this module's own
|
|
9
|
-
* `fitnessCitations` / `citationOfScript` (hop 2, bare check tag → the corpus's `@SCN`) went with
|
|
10
|
-
* it. Every check now either states its own row's code on its CI step, or is a converted
|
|
11
|
-
* `@fitness` row read through `domain/fitnessChecks` directly. `citationOfCitedRow` — the `id:`
|
|
12
|
-
* route (@SCN-LNT-031) — is the whole of what is left.
|
|
13
|
-
*
|
|
14
|
-
* NOT A HOP, AND THE DIFFERENCE IS WHERE IT STARTS. The retired hops resolved a runnable script
|
|
15
|
-
* HANDLE into a scenario, because a handle does not know what it is for. An `id:` is not a handle:
|
|
16
|
-
* it is the consumer SAYING which row this check answers — a citation, never a declaration — so
|
|
17
|
-
* there is nothing to resolve. The row keyed by that code carries the characteristic, and both
|
|
18
|
-
* terms come off one configured row rather than one being recovered from the other.
|
|
19
|
-
*
|
|
20
|
-
* IT REFINES, IT DOES NOT MANUFACTURE (@SCN-LNT-031, and 3F-3261's rule kept whole). A code no
|
|
21
|
-
* configured row answers returns `null` rather than a citation half-assembled from the handle that
|
|
22
|
-
* ran: an `id:` names a ROW and never a characteristic, and reaching for the script's name for the
|
|
23
|
-
* missing half is the name-match this axis retired, in a new spelling. A step carrying no code at
|
|
24
|
-
* all is the same answer for the same reason — the target has said nothing about that check, so its
|
|
25
|
-
* run cites nothing and posts to suspense, which is the state a consumer starts in.
|
|
26
|
-
*
|
|
27
|
-
* BARED ON THE WAY IN, because a manifest's `scn` is stored bare and a workflow is hand-authored:
|
|
28
|
-
* the one spelling rule this repository has (`lib/bareTerm`) is what keeps a code written with a
|
|
29
|
-
* sigil or a stray space from being looked up under a key no row is filed at.
|
|
30
|
-
*/
|
|
31
1
|
import { bareTerm } from "../lib/bareTerm.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* back as what that step's run cites.
|
|
35
|
-
*
|
|
36
|
-
* NOT A HOP, AND THE DIFFERENCE IS WHERE IT STARTS — the same point the file's own docblock makes,
|
|
37
|
-
* repeated here because this function is where it is proved. The retired hops resolved a runnable
|
|
38
|
-
* script HANDLE into a scenario, because a handle does not know what it is for. An `id:` is not a
|
|
39
|
-
* handle: it is the consumer SAYING which row this check answers — a citation, never a declaration
|
|
40
|
-
* — so there is nothing to resolve. The row keyed by that code carries the characteristic, and both
|
|
41
|
-
* terms come off one configured row rather than one being recovered from the other.
|
|
42
|
-
*
|
|
43
|
-
* IT REFINES, IT DOES NOT MANUFACTURE (@SCN-LNT-031, and 3F-3261's rule kept whole). A code no
|
|
44
|
-
* configured row answers returns `null` rather than a citation half-assembled from the handle that
|
|
45
|
-
* ran: an `id:` names a ROW and never a characteristic, and reaching for the script's name for the
|
|
46
|
-
* missing half is the name-match this axis retired, in a new spelling. A step carrying no code at
|
|
47
|
-
* all is the same answer for the same reason — the target has said nothing about that check, so its
|
|
48
|
-
* run cites nothing and posts to suspense, which is the state a consumer starts in.
|
|
49
|
-
*
|
|
50
|
-
* BARED ON THE WAY IN, because a manifest's `scn` is stored bare and a workflow is hand-authored:
|
|
51
|
-
* the one spelling rule this repository has (`lib/bareTerm`) is what keeps a code written with a
|
|
52
|
-
* sigil or a stray space from being looked up under a key no row is filed at.
|
|
53
|
-
*/
|
|
54
|
-
export function citationOfCitedRow(citedScn, fitnessChecks) {
|
|
2
|
+
import { SCN_CODE } from "./scenarios.js";
|
|
3
|
+
export function citationOfCitedRow(citedScn) {
|
|
55
4
|
if (citedScn === undefined)
|
|
56
5
|
return null;
|
|
57
6
|
const scnId = bareTerm(citedScn);
|
|
58
|
-
|
|
59
|
-
return row === undefined ? null : { checkTag: row.characteristic, scnId };
|
|
7
|
+
return SCN_CODE.test(scnId) ? { scnId } : null;
|
|
60
8
|
}
|
|
61
9
|
//# sourceMappingURL=fitnessCitations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fitnessCitations.js","sourceRoot":"","sources":["../../src/parse/fitnessCitations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fitnessCitations.js","sourceRoot":"","sources":["../../src/parse/fitnessCitations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,MAAM,UAAU,kBAAkB,CAAC,QAA4B;IAC7D,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC"}
|
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE RECONCILER'S OWN STEPS (@SCN-USG-014, 3F-3343) — which steps of a target's pipeline are this
|
|
3
|
-
* reconciliation rather than something it reconciles, and how the report says so.
|
|
4
|
-
*
|
|
5
|
-
* THE SECOND EXCLUSION, AND THE ONLY ONE NOBODY CONFIGURES. A behavioural runner is excluded by a
|
|
6
|
-
* rule over what the target named and a non-check by the consumer's own list; this one is excluded
|
|
7
|
-
* BY CONSTRUCTION, because the run that computes the books cannot be a row in them. The
|
|
8
|
-
* distinction is not a nicety: a `notChecks` pair produces the identical report over the identical
|
|
9
|
-
* pipeline, and the two answers part company only at the consumer who has written nothing — whose
|
|
10
|
-
* very first run would otherwise report their own reconciler as an uncited fitness check, and go
|
|
11
|
-
* on doing so until they learned to configure it away.
|
|
12
|
-
*
|
|
13
|
-
* A CITATION ON EITHER IS UNSATISFIABLE, WHICH IS WHAT MAKES IT CONSTRUCTION RATHER THAN JUDGEMENT.
|
|
14
|
-
* The step record is written BEFORE the reconciliation reads it — necessarily, since that record
|
|
15
|
-
* is its input — so no run's record can ever carry the reconciling step's own outcome, and no
|
|
16
|
-
* scenario can ever be shown to have been answered by it. A demand nothing could satisfy is not a
|
|
17
|
-
* check somebody failed to cite. It is not a check.
|
|
18
|
-
*
|
|
19
|
-
* TWO HALVES, RECOGNISED TWO WAYS, AND NEITHER IS A LIST OF NAMES.
|
|
20
|
-
*
|
|
21
|
-
* - THE RUN: a step whose command runs this tool's own reconciling invocation, compared as whole
|
|
22
|
-
* adjacent shell tokens and followed through the manifest scripts a step invokes — the runner
|
|
23
|
-
* rule's own comparison (`parse/commandRuns`), because a pipeline invokes a binary through a
|
|
24
|
-
* script alias far more often than it writes its name. ADJACENT is what keeps the same binary
|
|
25
|
-
* run for another purpose a candidate: this repository's own pipeline runs `spec-controller
|
|
26
|
-
* tags` beside its balance step, and that is an ordinary step of the pipeline being reconciled.
|
|
27
|
-
* - THE RECORD: a step carrying GitHub's own step-record expression, which is the only way that
|
|
28
|
-
* record can be produced. Read off the step's `env:` and its command, wherever the consumer
|
|
29
|
-
* wrote it, and not off its title — a step called `Dump this run's step record` that produces
|
|
30
|
-
* no record is an ordinary step, and one called anything at all that produces the record is
|
|
31
|
-
* the dump.
|
|
32
|
-
*
|
|
33
|
-
* THE INVOCATION IS INJECTED, NEVER ASSUMED. How this product is invoked at a consumer's command
|
|
34
|
-
* line is a fact the application edge holds (`ingest/ingestQualityChecks.ts`), like the script
|
|
35
|
-
* prefixes and the workflow names beside it; the core is handed it as data. A run told no
|
|
36
|
-
* invocation recognises no reconciling step, which is the safe direction — a candidate too many,
|
|
37
|
-
* visible on the report, rather than a step taken off the books by a rule nobody supplied.
|
|
38
|
-
*
|
|
39
|
-
* THE ACCOUNT AND THE SEAM COME OFF ONE RULE. `isReconciler` re-asks the same question of a single
|
|
40
|
-
* step rather than consulting the list this module built, so the account the report prints and the
|
|
41
|
-
* steps discovery skipped cannot come to disagree — a step named on the report as the reconciler
|
|
42
|
-
* while its check sits on the books is a report that contradicts itself in one page.
|
|
43
|
-
*/
|
|
44
1
|
import { type CiWorkflowStep } from "./checkScriptsRunInCI.js";
|
|
45
2
|
import type { ReconcilerStep } from "../domain/evidenceReconciliation.js";
|
|
46
|
-
/** What a run's pipeline yielded of the reconciler — the account, and the one answer per step. */
|
|
47
3
|
export interface ReconcilerSteps {
|
|
48
|
-
/** The steps that are the reconciler, in the order the pipeline runs them. */
|
|
49
4
|
readonly steps: readonly ReconcilerStep[];
|
|
50
|
-
/** Whether this step is the reconciler rather than a step of the pipeline it reconciles. */
|
|
51
5
|
readonly isReconciler: (step: CiWorkflowStep) => boolean;
|
|
52
6
|
}
|
|
53
7
|
export declare function reconcilerSteps(ciSources: readonly string[], ciSourceNames: readonly string[], invocation: string, packageJson: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcilerSteps.d.ts","sourceRoot":"","sources":["../../src/parse/reconcilerSteps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reconcilerSteps.d.ts","sourceRoot":"","sources":["../../src/parse/reconcilerSteps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC;CAC1D;AAoBD,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAChD,eAAe,CAWjB"}
|
|
@@ -1,67 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE RECONCILER'S OWN STEPS (@SCN-USG-014, 3F-3343) — which steps of a target's pipeline are this
|
|
3
|
-
* reconciliation rather than something it reconciles, and how the report says so.
|
|
4
|
-
*
|
|
5
|
-
* THE SECOND EXCLUSION, AND THE ONLY ONE NOBODY CONFIGURES. A behavioural runner is excluded by a
|
|
6
|
-
* rule over what the target named and a non-check by the consumer's own list; this one is excluded
|
|
7
|
-
* BY CONSTRUCTION, because the run that computes the books cannot be a row in them. The
|
|
8
|
-
* distinction is not a nicety: a `notChecks` pair produces the identical report over the identical
|
|
9
|
-
* pipeline, and the two answers part company only at the consumer who has written nothing — whose
|
|
10
|
-
* very first run would otherwise report their own reconciler as an uncited fitness check, and go
|
|
11
|
-
* on doing so until they learned to configure it away.
|
|
12
|
-
*
|
|
13
|
-
* A CITATION ON EITHER IS UNSATISFIABLE, WHICH IS WHAT MAKES IT CONSTRUCTION RATHER THAN JUDGEMENT.
|
|
14
|
-
* The step record is written BEFORE the reconciliation reads it — necessarily, since that record
|
|
15
|
-
* is its input — so no run's record can ever carry the reconciling step's own outcome, and no
|
|
16
|
-
* scenario can ever be shown to have been answered by it. A demand nothing could satisfy is not a
|
|
17
|
-
* check somebody failed to cite. It is not a check.
|
|
18
|
-
*
|
|
19
|
-
* TWO HALVES, RECOGNISED TWO WAYS, AND NEITHER IS A LIST OF NAMES.
|
|
20
|
-
*
|
|
21
|
-
* - THE RUN: a step whose command runs this tool's own reconciling invocation, compared as whole
|
|
22
|
-
* adjacent shell tokens and followed through the manifest scripts a step invokes — the runner
|
|
23
|
-
* rule's own comparison (`parse/commandRuns`), because a pipeline invokes a binary through a
|
|
24
|
-
* script alias far more often than it writes its name. ADJACENT is what keeps the same binary
|
|
25
|
-
* run for another purpose a candidate: this repository's own pipeline runs `spec-controller
|
|
26
|
-
* tags` beside its balance step, and that is an ordinary step of the pipeline being reconciled.
|
|
27
|
-
* - THE RECORD: a step carrying GitHub's own step-record expression, which is the only way that
|
|
28
|
-
* record can be produced. Read off the step's `env:` and its command, wherever the consumer
|
|
29
|
-
* wrote it, and not off its title — a step called `Dump this run's step record` that produces
|
|
30
|
-
* no record is an ordinary step, and one called anything at all that produces the record is
|
|
31
|
-
* the dump.
|
|
32
|
-
*
|
|
33
|
-
* THE INVOCATION IS INJECTED, NEVER ASSUMED. How this product is invoked at a consumer's command
|
|
34
|
-
* line is a fact the application edge holds (`ingest/ingestQualityChecks.ts`), like the script
|
|
35
|
-
* prefixes and the workflow names beside it; the core is handed it as data. A run told no
|
|
36
|
-
* invocation recognises no reconciling step, which is the safe direction — a candidate too many,
|
|
37
|
-
* visible on the report, rather than a step taken off the books by a rule nobody supplied.
|
|
38
|
-
*
|
|
39
|
-
* THE ACCOUNT AND THE SEAM COME OFF ONE RULE. `isReconciler` re-asks the same question of a single
|
|
40
|
-
* step rather than consulting the list this module built, so the account the report prints and the
|
|
41
|
-
* steps discovery skipped cannot come to disagree — a step named on the report as the reconciler
|
|
42
|
-
* while its check sits on the books is a report that contradicts itself in one page.
|
|
43
|
-
*/
|
|
44
1
|
import { ciWorkflowSteps } from "./checkScriptsRunInCI.js";
|
|
45
2
|
import { commandRuns } from "./commandRuns.js";
|
|
46
3
|
import { qualifiedStepName } from "./stepNames.js";
|
|
47
|
-
/**
|
|
48
|
-
* GitHub'S OWN EXPRESSION FOR THE RUN'S STEP RECORD, whitespace-stripped and lowercased to compare
|
|
49
|
-
* against — its function names are case-insensitive and its expressions tolerate spacing, so
|
|
50
|
-
* `${{ toJSON(steps) }}` and `${{tojson(steps)}}` are one expression and get one answer.
|
|
51
|
-
*/
|
|
52
4
|
const STEP_RECORD_EXPRESSION = "tojson(steps)";
|
|
53
|
-
/** Does this step produce the run's own step record — the input the reconciliation reads? */
|
|
54
5
|
function producesTheStepRecord(step) {
|
|
55
|
-
|
|
6
|
+
const written = "runs" in step ? [...step.env, step.runs] : step.env;
|
|
7
|
+
return written.some((text) => text.replace(/\s/g, "").toLowerCase().includes(STEP_RECORD_EXPRESSION));
|
|
56
8
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Which half of the reconciler this step is, or nothing at all.
|
|
59
|
-
*
|
|
60
|
-
* THE RUN IS ASKED FIRST, so a step that both reconciles and dumps is named as the reconciliation
|
|
61
|
-
* rather than as its input. Either way it is off the books; what the order settles is only which
|
|
62
|
-
* of the two sentences the report prints, and the stronger fact about such a step is that it runs
|
|
63
|
-
* the reconciliation.
|
|
64
|
-
*/
|
|
65
9
|
function roleOf(step, invocation, scripts) {
|
|
66
10
|
if ("runs" in step && commandRuns(step.runs, invocation, scripts))
|
|
67
11
|
return "reconciles";
|
|
@@ -70,14 +14,8 @@ function roleOf(step, invocation, scripts) {
|
|
|
70
14
|
export function reconcilerSteps(ciSources, ciSourceNames, invocation, packageJson) {
|
|
71
15
|
const scripts = packageJson.scripts ?? {};
|
|
72
16
|
return {
|
|
73
|
-
// THE WALK, of which every other reader on this axis takes its own projection (3F-3352) — the
|
|
74
|
-
// same parse, so the step this account names is the step discovery skipped.
|
|
75
17
|
steps: ciWorkflowSteps(ciSources).flatMap((step) => {
|
|
76
18
|
const role = roleOf(step, invocation, scripts);
|
|
77
|
-
// NAMED BY ITS IDENTITY WHERE ITS SOURCE HAS NO NAME. The recognition never depended on the
|
|
78
|
-
// name — a citation on this step is unsatisfiable whatever file it lives in — so a run given
|
|
79
|
-
// no name for a source must not go quiet about a step it set aside. It says which step, in
|
|
80
|
-
// the string GitHub itself displays, and only the qualification is missing.
|
|
81
19
|
return role === undefined
|
|
82
20
|
? []
|
|
83
21
|
: [{ step: qualifiedStepName(step, ciSourceNames) ?? step.identity, role }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcilerSteps.js","sourceRoot":"","sources":["../../src/parse/reconcilerSteps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reconcilerSteps.js","sourceRoot":"","sources":["../../src/parse/reconcilerSteps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAuB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAQnD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,SAAS,qBAAqB,CAAC,IAAoB;IACjD,MAAM,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IACrE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC3B,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CACvE,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CACb,IAAoB,EACpB,UAAkB,EAClB,OAAyC;IAEzC,IAAI,MAAM,IAAI,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;QAAE,OAAO,YAAY,CAAC;IACvF,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,SAA4B,EAC5B,aAAgC,EAChC,UAAkB,EAClB,WAAiD;IAEjD,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,IAAI,EAAE,CAAC;IAC1C,OAAO;QACL,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACjD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,KAAK,SAAS;gBACvB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC,CAAC;QACF,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,SAAS;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FitnessEvidenceObservation } from "../model.js";
|
|
2
|
+
import { type CiWorkflowStep, type PackageJsonScripts } from "./checkScriptsRunInCI.js";
|
|
3
|
+
import type { BehaviouralRunner } from "../domain/evidenceReconciliation.js";
|
|
4
|
+
import type { ScriptCitation } from "./fitnessCitations.js";
|
|
5
|
+
export declare function isCandidateStep(step: CiWorkflowStep, packageJson: PackageJsonScripts, runners: Readonly<Record<string, string | null>>, isExcludedFromDiscovery: (step: CiWorkflowStep) => boolean): boolean;
|
|
6
|
+
export declare function runsNamedRunner(step: CiWorkflowStep, packageJson: PackageJsonScripts, runners: Readonly<Record<string, string | null>>): boolean;
|
|
7
|
+
export declare function runningFitnessFunctions(ciSources: readonly string[], packageJson: PackageJsonScripts, runners: Readonly<Record<string, string | null>>, citedScn?: (script: string, citedByStep?: string) => ScriptCitation | null, isExcludedFromDiscovery?: (step: CiWorkflowStep) => boolean): FitnessEvidenceObservation[];
|
|
8
|
+
export declare function recognisedRunners(ciSources: readonly string[], packageJson: PackageJsonScripts, runners: Readonly<Record<string, string | null>>): BehaviouralRunner[];
|
|
9
|
+
//# sourceMappingURL=runningFitnessFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runningFitnessFunctions.d.ts","sourceRoot":"","sources":["../../src/parse/runningFitnessFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,wBAAgB,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,EAChD,uBAAuB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,GACzD,OAAO,CAET;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,GAC/C,OAAO,CAET;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,EAChD,QAAQ,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,cAAc,GAAG,IAAiB,EACtF,uBAAuB,GAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAqB,GACvE,0BAA0B,EAAE,CAoB9B;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,GAC/C,iBAAiB,EAAE,CASrB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { commandRuns } from "./commandRuns.js";
|
|
2
|
+
import { ciWorkflowSteps, commandInvokesScript, } from "./checkScriptsRunInCI.js";
|
|
3
|
+
const UP_TO_LAST_PIPE = /^.*(?<!\|)\|(?!\|)/;
|
|
4
|
+
function finalStages(command) {
|
|
5
|
+
return command
|
|
6
|
+
.replace(/\\\r?\n/g, " ")
|
|
7
|
+
.split(/\r?\n/)
|
|
8
|
+
.map((line) => line.replace(UP_TO_LAST_PIPE, ""))
|
|
9
|
+
.join("\n");
|
|
10
|
+
}
|
|
11
|
+
function namedRunnersAt(step, scripts, runners) {
|
|
12
|
+
if (!("runs" in step))
|
|
13
|
+
return [];
|
|
14
|
+
const command = finalStages(step.runs);
|
|
15
|
+
const unpiped = Object.fromEntries(Object.entries(scripts).map(([name, body]) => [name, finalStages(body)]));
|
|
16
|
+
return Object.entries(runners).filter((entry) => entry[1] !== null && commandRuns(command, entry[1], unpiped));
|
|
17
|
+
}
|
|
18
|
+
function handleOf(step, scripts) {
|
|
19
|
+
if (!("runs" in step))
|
|
20
|
+
return step.identity;
|
|
21
|
+
const invoked = Object.keys(scripts).filter((name) => commandInvokesScript(step.runs, name));
|
|
22
|
+
return invoked[0] ?? step.identity;
|
|
23
|
+
}
|
|
24
|
+
export function isCandidateStep(step, packageJson, runners, isExcludedFromDiscovery) {
|
|
25
|
+
return !isExcludedFromDiscovery(step) && !runsNamedRunner(step, packageJson, runners);
|
|
26
|
+
}
|
|
27
|
+
export function runsNamedRunner(step, packageJson, runners) {
|
|
28
|
+
return namedRunnersAt(step, packageJson.scripts ?? {}, runners).length > 0;
|
|
29
|
+
}
|
|
30
|
+
export function runningFitnessFunctions(ciSources, packageJson, runners, citedScn = () => null, isExcludedFromDiscovery = () => false) {
|
|
31
|
+
const scripts = packageJson.scripts ?? {};
|
|
32
|
+
const candidates = ciWorkflowSteps(ciSources).filter((step) => isCandidateStep(step, packageJson, runners, isExcludedFromDiscovery));
|
|
33
|
+
return candidates
|
|
34
|
+
.map((step) => {
|
|
35
|
+
const fitnessFunction = handleOf(step, scripts);
|
|
36
|
+
const citation = citedScn(fitnessFunction, step.id);
|
|
37
|
+
return {
|
|
38
|
+
qualityCheck: "fitness",
|
|
39
|
+
fitnessFunction,
|
|
40
|
+
exists: true,
|
|
41
|
+
enforcedOverRealSource: step.abortsJob,
|
|
42
|
+
...(citation !== null
|
|
43
|
+
? { scnId: step.id ?? citation.scnId }
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
})
|
|
47
|
+
.sort((a, b) => a.fitnessFunction.localeCompare(b.fitnessFunction));
|
|
48
|
+
}
|
|
49
|
+
export function recognisedRunners(ciSources, packageJson, runners) {
|
|
50
|
+
const scripts = packageJson.scripts ?? {};
|
|
51
|
+
return ciWorkflowSteps(ciSources).flatMap((step) => namedRunnersAt(step, scripts, runners).map(([tier, runner]) => ({
|
|
52
|
+
tier,
|
|
53
|
+
runner,
|
|
54
|
+
step: step.identity,
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=runningFitnessFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runningFitnessFunctions.js","sourceRoot":"","sources":["../../src/parse/runningFitnessFunctions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,eAAe,EACf,oBAAoB,GAGrB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,OAAO;SACX,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;SAChD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CACrB,IAAoB,EACpB,OAAyC,EACzC,OAAgD;IAEhD,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CACzE,CAAC;IACF,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CACnC,CAAC,KAAK,EAA6B,EAAE,CACnC,KAAK,CAAC,CAAC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+
export interface CorpusFile {
|
|
3
|
+
readonly slug: string;
|
|
4
|
+
readonly featureCode: string | null;
|
|
5
|
+
readonly source: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function duplicateFeatureCodes(features: readonly CorpusFile[]): ScenarioCodeError[];
|
|
8
|
+
export declare function foreignScenarioCodes(features: readonly CorpusFile[]): ScenarioCodeError[];
|
|
9
|
+
export declare function scenarioCodePopulationOf(features: readonly CorpusFile[]): ScenarioCodePopulation;
|
|
10
|
+
export declare function scenarioCodeErrorsOf(features: readonly CorpusFile[]): ScenarioCodeError[];
|
|
11
|
+
//# sourceMappingURL=scenarioCodeErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarioCodeErrors.d.ts","sourceRoot":"","sources":["../../src/parse/scenarioCodeErrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAIhG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,iBAAiB,EAAE,CAW1F;AA6BD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,iBAAiB,EAAE,CAoBzF;AAYD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,sBAAsB,CAEhG;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,iBAAiB,EAAE,CAMzF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { featureCodeOf } from "../domain/featureCode.js";
|
|
2
|
+
import { parseTaggedScenarios } from "./scenarios.js";
|
|
3
|
+
import { CORE_MESSAGES, CoreMessage } from "../domain/messages.js";
|
|
4
|
+
export function duplicateFeatureCodes(features) {
|
|
5
|
+
const faults = [];
|
|
6
|
+
for (const [code, files] of headerFilesByCode(features)) {
|
|
7
|
+
if (files.length < 2)
|
|
8
|
+
continue;
|
|
9
|
+
faults.push({
|
|
10
|
+
kind: "duplicate-feature-code",
|
|
11
|
+
files,
|
|
12
|
+
message: CORE_MESSAGES[CoreMessage.DuplicateFeatureCode](code, files.length, files.join(", ")),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return faults;
|
|
16
|
+
}
|
|
17
|
+
function headerFilesByCode(features) {
|
|
18
|
+
const filesByCode = new Map();
|
|
19
|
+
for (const file of features) {
|
|
20
|
+
if (file.featureCode === null)
|
|
21
|
+
continue;
|
|
22
|
+
filesByCode.set(file.featureCode, [...(filesByCode.get(file.featureCode) ?? []), `${file.slug}.feature`]);
|
|
23
|
+
}
|
|
24
|
+
return filesByCode;
|
|
25
|
+
}
|
|
26
|
+
function foreignMessage(file, scnId, named, carriers) {
|
|
27
|
+
const fileName = `${file.slug}.feature`;
|
|
28
|
+
if (carriers.length === 1) {
|
|
29
|
+
return CORE_MESSAGES[CoreMessage.ForeignScnCodeOneCarrier](fileName, file.featureCode, scnId, named, carriers[0]);
|
|
30
|
+
}
|
|
31
|
+
if (carriers.length > 1) {
|
|
32
|
+
return CORE_MESSAGES[CoreMessage.ForeignScnCodeManyCarriers](fileName, file.featureCode, scnId, named, carriers.length, carriers.join(", "));
|
|
33
|
+
}
|
|
34
|
+
return CORE_MESSAGES[CoreMessage.ForeignScnCodeNoCarrier](fileName, file.featureCode, scnId, named);
|
|
35
|
+
}
|
|
36
|
+
export function foreignScenarioCodes(features) {
|
|
37
|
+
const carriersByCode = headerFilesByCode(features);
|
|
38
|
+
const faults = [];
|
|
39
|
+
for (const file of features) {
|
|
40
|
+
if (file.featureCode === null)
|
|
41
|
+
continue;
|
|
42
|
+
const coded = { ...file, featureCode: file.featureCode };
|
|
43
|
+
for (const scenario of parseTaggedScenarios(file.source)) {
|
|
44
|
+
const named = featureCodeOf(scenario.scnId);
|
|
45
|
+
if (named === null || named === file.featureCode)
|
|
46
|
+
continue;
|
|
47
|
+
const carriers = carriersByCode.get(named) ?? [];
|
|
48
|
+
faults.push({
|
|
49
|
+
kind: "foreign-scn-code",
|
|
50
|
+
files: [`${file.slug}.feature`],
|
|
51
|
+
namedFeatureCode: named,
|
|
52
|
+
namedFeatureFiles: carriers,
|
|
53
|
+
message: foreignMessage(coded, scenario.scnId, named, carriers),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return faults;
|
|
58
|
+
}
|
|
59
|
+
function noFeatureCodeFiles(features) {
|
|
60
|
+
return features
|
|
61
|
+
.filter((file) => file.featureCode === null && parseTaggedScenarios(file.source).length > 0)
|
|
62
|
+
.map((file) => ({
|
|
63
|
+
kind: "no-feature-code",
|
|
64
|
+
files: [`${file.slug}.feature`],
|
|
65
|
+
message: CORE_MESSAGES[CoreMessage.NoFeatureCode](`${file.slug}.feature`),
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
export function scenarioCodePopulationOf(features) {
|
|
69
|
+
return { featureFiles: features.length, featureCodes: headerFilesByCode(features).size };
|
|
70
|
+
}
|
|
71
|
+
export function scenarioCodeErrorsOf(features) {
|
|
72
|
+
return [
|
|
73
|
+
...duplicateFeatureCodes(features),
|
|
74
|
+
...foreignScenarioCodes(features),
|
|
75
|
+
...noFeatureCodeFiles(features),
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=scenarioCodeErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarioCodeErrors.js","sourceRoot":"","sources":["../../src/parse/scenarioCodeErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM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