@3f-consulting/spec-controller-core 0.1.0-alpha.7 → 0.1.0-alpha.71
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 +5 -40
- package/dist/assemble/evidenceReconciliationFromSources.d.ts.map +1 -1
- package/dist/assemble/evidenceReconciliationFromSources.js +30 -325
- package/dist/assemble/evidenceReconciliationFromSources.js.map +1 -1
- package/dist/assemble/renderInput.d.ts +7 -73
- 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 +11 -46
- 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 +21 -391
- package/dist/domain/evidenceReconciliation.d.ts.map +1 -1
- package/dist/domain/evidenceReconciliation.js +87 -382
- 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 +8 -393
- package/dist/domain/journal.d.ts.map +1 -1
- package/dist/domain/journal.js +6 -118
- package/dist/domain/journal.js.map +1 -1
- package/dist/domain/ledger.d.ts +8 -328
- package/dist/domain/ledger.d.ts.map +1 -1
- package/dist/domain/ledger.js +23 -326
- package/dist/domain/ledger.js.map +1 -1
- package/dist/domain/messages.d.ts +213 -0
- package/dist/domain/messages.d.ts.map +1 -0
- package/dist/domain/messages.js +313 -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 +8 -105
- 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 +3 -43
- 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 +7 -280
- package/dist/domain/qualityCheckReconciliation.d.ts.map +1 -1
- package/dist/domain/qualityCheckReconciliation.js +63 -463
- 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 +2 -207
- 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 +5 -168
- 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 +18 -225
- 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 +0 -53
- 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 +2 -57
- 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 +3 -228
- package/dist/parse/scenarios.d.ts.map +1 -1
- package/dist/parse/scenarios.js +20 -457
- 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 +1 -78
- 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 +0 -60
- 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 +2 -110
- package/dist/provenance/provenance.d.ts.map +1 -1
- package/dist/provenance/provenance.js +2 -58
- 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 +1 -35
- 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 +128 -467
- 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
package/dist/domain/journal.js
CHANGED
|
@@ -1,138 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The JOURNAL — the debit/credit input concepts of the reconciliation domain, co-located
|
|
3
|
-
* as one module (module, not class). These are the raw entries a run RAISES (evidence
|
|
4
|
-
* obligations, and the scenarios that raise them) and OBSERVES (evidence observations, runtime
|
|
5
|
-
* and static), keyed by one flat `qualityCheck` per evidence obligation — the two-axis
|
|
6
|
-
* `(kind, level)` grid collapsed to a single mutually-exclusive coordinate.
|
|
7
|
-
*
|
|
8
|
-
* `@lint` is one quality-check VALUE, not a second axis; `qualityCheck === "lint"` is the
|
|
9
|
-
* watermelon discriminator (replacing the retired `kind === "static"`). The runtime
|
|
10
|
-
* quality-checks (@unit/@integration/@e2e/@performance) reconcile against emitted test
|
|
11
|
-
* results; the `lint` quality-check reconciles a static check over the source artifact.
|
|
12
|
-
*
|
|
13
|
-
* The reconciled OUTCOMES these entries produce live in the sibling concept modules
|
|
14
|
-
* (`qualityCheckReconciliation`, `scenarioReconciliation`, `ledger`), which import this one.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* The NAMED `(scnId, quality-check)` pairs — the ONE rule for what a scenario names, keyed
|
|
18
|
-
* `"<scnId> <qualityCheck>"`. A credit citing a scenario is reconciliation-matched only
|
|
19
|
-
* when its pair is in this set; otherwise it is `no-evidence-obligation` (a real scenario, at a quality-check
|
|
20
|
-
* it never named).
|
|
21
|
-
*
|
|
22
|
-
* A `pending` obligation is EXCLUDED — it names nothing. Canon, Pending Item: a
|
|
23
|
-
* `<quality-check>pending` tag raises **no Evidence Obligation**, so an Evidence Observation
|
|
24
|
-
* citing that scenario at a pending quality-check is `no-evidence-obligation` — exactly as when
|
|
25
|
-
* nothing was raised at all. Nothing is named, so nothing can be attributed to it. (This also drops the
|
|
26
|
-
* scenario-scope pending obligation, which carries no `qualityCheck` at all — it names no
|
|
27
|
-
* specific check, so it never belonged in a pair set keyed by one.)
|
|
28
|
-
*
|
|
29
|
-
* ONE COPY, BY CONSTRUCTION (3F-1858). This loop existed TWICE, character-identical — in
|
|
30
|
-
* `reconcile` and in the observation census — each building the set over ALL obligations
|
|
31
|
-
* INCLUDING pending. They agreed by copy-paste, not by construction: either could have grown a
|
|
32
|
-
* filter alone and nothing would have redded. That is exactly what the pending divergence was —
|
|
33
|
-
* the pair-check excluded the credit from `no-evidence-obligation` while the pending partition excluded it
|
|
34
|
-
* from the debit side, so it posted NOWHERE and the run read balanced, exit 0, over a fault canon
|
|
35
|
-
* says must fail (@SCN-PND-005).
|
|
36
|
-
*
|
|
37
|
-
* Lives in the model, not in either caller: what a scenario NAMES is the model's rule, not a
|
|
38
|
-
* reconciler's or a census's private business (`entity-owns-its-behaviour`) — the same reason
|
|
39
|
-
* `OUT_OF_BALANCE_OUTCOMES` lives here rather than in the renderer that walks it.
|
|
40
|
-
*
|
|
41
|
-
* A runtime credit's quality-check is a `RuntimeQualityCheck`, so a `lint` obligation
|
|
42
|
-
* never matches one — as intended; the two axes key differently, see below.
|
|
43
|
-
*
|
|
44
|
-
* THE FITNESS KEY CARRIES ITS CHECK TAG (@SCN-LNT-013), and the asymmetry with the runtime key is
|
|
45
|
-
* the design rather than an inconsistency. A runtime credit's `qualityCheck` IS its discriminating
|
|
46
|
-
* term — an obligation at `unit` is answered by a credit at `unit`, and there is nothing finer to
|
|
47
|
-
* key on. On the fitness axis the axis word is `lint` for EVERY check, so the axis alone cannot
|
|
48
|
-
* discriminate: keyed on it, a row's obligation for one check answers a credit for any other.
|
|
49
|
-
*
|
|
50
|
-
* WHICH IS EXACTLY THE FAULT THIS CLOSES. `@SCN-LNT-012` made the debit MATCH compare check tags —
|
|
51
|
-
* the `@SCN` picks the row, the tag picks the obligation — so a credit whose tag no obligation on
|
|
52
|
-
* its row names matches nothing, correctly. This set stayed keyed on the axis, so the credit it
|
|
53
|
-
* newly failed to match was also excluded from the credit-side items that should have caught it,
|
|
54
|
-
* and it reconciled to NOTHING: filtered out of the debit by its tag and out of the credit side by
|
|
55
|
-
* its axis. Measured over a genuine watermelon, the run read balanced, exit 0.
|
|
56
|
-
*
|
|
57
|
-
* BUILT AND READ TOGETHER. `noEvidenceObligationReconciliationsOf` composes the same key from the
|
|
58
|
-
* CREDIT's own `checkTag`. A key built one way and read another is this same bug in a new spelling,
|
|
59
|
-
* so the two are one change and are described in both places.
|
|
60
|
-
*/
|
|
61
1
|
export function evidenceObligationPairsOf(scenarios) {
|
|
62
2
|
const pairs = new Set();
|
|
63
3
|
for (const scenario of scenarios) {
|
|
64
4
|
for (const obligation of scenario.evidenceObligations) {
|
|
65
5
|
if (obligation.pending === true)
|
|
66
|
-
continue;
|
|
67
|
-
pairs.add(evidenceObligationPairKey(scenario.scnId, obligation.qualityCheck
|
|
6
|
+
continue;
|
|
7
|
+
pairs.add(evidenceObligationPairKey(scenario.scnId, obligation.qualityCheck));
|
|
68
8
|
}
|
|
69
9
|
}
|
|
70
10
|
return pairs;
|
|
71
11
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* credit-side lookup, so the two cannot drift.
|
|
75
|
-
*
|
|
76
|
-
* `checkTag` is the FITNESS discriminator (the obligation's `staticCheck`, the credit's `checkTag`)
|
|
77
|
-
* and is ignored on the runtime axis, where the quality-check already discriminates. A fitness
|
|
78
|
-
* entry with NO tag keys distinctly from every tagged one rather than collapsing onto a bare
|
|
79
|
-
* `"<scn> lint"` that a tagged obligation could answer — an uncited credit never reaches a real
|
|
80
|
-
* row (`citationOfCitedRow` resolves the `@SCN` and the tag together or neither), and if one ever
|
|
81
|
-
* did, it must not match by having nothing to compare.
|
|
82
|
-
*/
|
|
83
|
-
export function evidenceObligationPairKey(scnId, qualityCheck, checkTag) {
|
|
84
|
-
return qualityCheck === "lint"
|
|
85
|
-
? `${scnId} lint ${checkTag}`
|
|
86
|
-
: `${scnId} ${qualityCheck}`;
|
|
12
|
+
export function evidenceObligationPairKey(scnId, qualityCheck) {
|
|
13
|
+
return `${scnId} ${qualityCheck}`;
|
|
87
14
|
}
|
|
88
|
-
/**
|
|
89
|
-
* THE PENDING PARTITION, debit half (@SCN-PND-004, 3F-2204) — the evidence obligations a scenario
|
|
90
|
-
* actually NAMES: every non-pending one, in document order. These are the obligations that
|
|
91
|
-
* reconcile; the complement becomes one-sided Pending Items (`pendingItemsOf`, below).
|
|
92
|
-
*
|
|
93
|
-
* A pending obligation is EXCLUDED for the SAME reason, and by the same canon clause, as in
|
|
94
|
-
* `evidenceObligationPairsOf`: a `<quality-check>pending` tag raises
|
|
95
|
-
* NO Evidence Obligation, so it names nothing. This completes that family — the three now state
|
|
96
|
-
* one rule over three keyings (the whole obligations, the `(scnId, quality-check)` pairs, the
|
|
97
|
-
* static-check handles) instead of two stating it and a third restating it inline in the fold.
|
|
98
|
-
*
|
|
99
|
-
* Lives here rather than in the reconciler: what a scenario NAMES is the model's rule, not the
|
|
100
|
-
* reconciler's private business (`entity-owns-its-behaviour`).
|
|
101
|
-
*
|
|
102
|
-
* Takes the OBLIGATIONS rather than a `Scenario` (3F-2203) so the one rule serves both sides of the
|
|
103
|
-
* pipeline: `reconcile` passes the obligations a scenario raises, and the renderer passes a Ledger
|
|
104
|
-
* row's POSTED DEBITS (`ScenarioReconciliation.evidenceObligations`) to answer "does this row
|
|
105
|
-
* name this quality-check?" for the grid. The renderer previously re-encoded the `!pending`
|
|
106
|
-
* clause itself — the same rule in a second home, agreeing by copy.
|
|
107
|
-
*/
|
|
108
15
|
export function evidenceObligationsOf(evidenceObligations) {
|
|
109
16
|
return evidenceObligations.filter((obligation) => !obligation.pending);
|
|
110
17
|
}
|
|
111
|
-
/**
|
|
112
|
-
* THE PENDING PARTITION, deferred half (@SCN-PND-004, 3F-2204) — the one-sided Pending Items a
|
|
113
|
-
* scenario's deferred obligations raise, one per `<quality-check>pending` obligation, in document
|
|
114
|
-
* order. The exact complement of `evidenceObligationsOf`: together they partition the
|
|
115
|
-
* scenario's obligations, so nothing is dropped and nothing is counted twice.
|
|
116
|
-
*
|
|
117
|
-
* A Pending Item carries ONLY the quality-check owed — `undefined` for the scenario-scope deferral
|
|
118
|
-
* (@SCN-PND-022, a bare `@wip` raising no obligations), which owes no specific check. It is
|
|
119
|
-
* partitioned off BEFORE the observation match, so it never becomes a Quality Check Reconciliation
|
|
120
|
-
* and never a reconciling item: "one-sided — nothing is reconciled".
|
|
121
|
-
*/
|
|
122
18
|
export function pendingItemsOf(scenario) {
|
|
123
19
|
return scenario.evidenceObligations
|
|
124
20
|
.filter((obligation) => obligation.pending)
|
|
125
21
|
.map((obligation) => ({ qualityCheck: obligation.qualityCheck }));
|
|
126
22
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* OWN fields — its runnable handle, its `exists`, its `enforcedOverRealSource` — asks.
|
|
130
|
-
*
|
|
131
|
-
* It outlived the measured member it was written to tell apart from (3F-3516): the `lint`
|
|
132
|
-
* quality-check is a single interface again, so this is the quality-check clause alone, and its
|
|
133
|
-
* readers keep naming what they mean rather than spelling `qualityCheck === "lint"` at each site.
|
|
134
|
-
*/
|
|
135
|
-
export function isStaticCheckObservation(observation) {
|
|
136
|
-
return observation.qualityCheck === "lint";
|
|
23
|
+
export function isFitnessObservation(observation) {
|
|
24
|
+
return observation.qualityCheck === "fitness";
|
|
137
25
|
}
|
|
138
26
|
//# sourceMappingURL=journal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../src/domain/journal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../src/domain/journal.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,yBAAyB,CAAC,SAA8B;IACtE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,KAAK,MAAM,UAAU,IAAI,QAAQ,CAAC,mBAAmB,EAAE,CAAC;YACtD,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI;gBAAE,SAAS;YAC1C,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAa,EACb,YAAsC;IAEtC,OAAO,GAAG,KAAK,IAAI,YAAY,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,mBAAkD;IAElD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,QAAkB;IAC/C,OAAO,QAAQ,CAAC,mBAAmB;SAChC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;SAC1C,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AACtE,CAAC;AAyBD,MAAM,UAAU,oBAAoB,CAClC,WAAgC;IAEhC,OAAO,WAAW,CAAC,YAAY,KAAK,SAAS,CAAC;AAChD,CAAC"}
|
package/dist/domain/ledger.d.ts
CHANGED
|
@@ -1,379 +1,59 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE LEDGER — the accounts with their posted entries, co-located with its OWN whole-run
|
|
3
|
-
* behaviour: `isBalanced`, `hasPendingItems`, `hasBrokenEvidence` (module, not class). These
|
|
4
|
-
* three pure predicates are the whole-run verdict surface the CLI edge maps to exit codes;
|
|
5
|
-
* they were the reconcile orchestration's exports and now live WITH the concept they fold over.
|
|
6
|
-
*/
|
|
7
1
|
import type { Outcome, QualityCheckReconciliation } from "./qualityCheckReconciliation.js";
|
|
8
2
|
import type { ScenarioReconciliation } from "./scenarioReconciliation.js";
|
|
9
3
|
import type { RuntimeQualityCheck } from "./journal.js";
|
|
10
|
-
/**
|
|
11
|
-
* THE LEDGER — the accounts with their POSTED ENTRIES. Canon (double-entry-manifesto, chain
|
|
12
|
-
* step 4 + the Ledger entry): "the evidence obligations (debits) and evidence observations
|
|
13
|
-
* (credits) organised by real or invented scenario, keyed by quality-check — THIS IS WHERE
|
|
14
|
-
* RECONCILIATION HAPPENS."
|
|
15
|
-
*
|
|
16
|
-
* RENAMED FROM `Ledger` (3F-1846 / 3F-1830). 3F-1138 corrected a real error — the
|
|
17
|
-
* rendered report was titled `# Ledger`, and the per-scenario reconciliation is the trial balance,
|
|
18
|
-
* not the ledger — but corrected it by DELETING the concept rather than distinguishing it. The
|
|
19
|
-
* Ledger was never the report, so removing the report's wrong name should not have removed the
|
|
20
|
-
* Ledger. This restores it. `Ledger` is now canon's name for LAYER 1 — the
|
|
21
|
-
* assembled statement (`assemble/report.ts`, formerly `EvidenceReconciliation`); the four layers are
|
|
22
|
-
* `Ledger` → `Ledger` → `ScenarioReconciliation` → `QualityCheckReconciliation`,
|
|
23
|
-
* under canon's four names.
|
|
24
|
-
*
|
|
25
|
-
* The Ledger is NOT a second name for the Evidence Reconciliation, and NOT a pre-reconciliation
|
|
26
|
-
* input stage: the SAME accounts live in it before and after balancing off, gaining their verdict
|
|
27
|
-
* IN PLACE. It holds entries, so it is an OBJECT and never a bare array of rows — the code and the
|
|
28
|
-
* JSON are one vocabulary (`interface Ledger { scenarioReconciliations }` ↔
|
|
29
|
-
* `"ledger": { "scenarioReconciliations": [...] }`).
|
|
30
|
-
*
|
|
31
|
-
* `scenarioReconciliations` (renamed from `scenarios`) is the collection of Scenario
|
|
32
|
-
* Reconciliation rows — real (`kind: scenario`, including the degenerate `both-missing`
|
|
33
|
-
* row a zero-evidence scenario posts), cited-but-UNKNOWN (`kind: phantom-scenario`), and
|
|
34
|
-
* cites-nothing (`kind: suspense-scenario`). The name reserves `scenario`/`scenarios` for the
|
|
35
|
-
* real kind (a phantom / suspense is NOT a scenario).
|
|
36
|
-
*
|
|
37
|
-
* EVERY scenario is a row now: the separate-axis authoring-quality
|
|
38
|
-
* `warnings` collection was RETIRED — a scenario raising zero evidence obligations and cited
|
|
39
|
-
* by no evidence observation reconciles to a `both-missing` out-of-balance row, not a warning excluded
|
|
40
|
-
* from the balance.
|
|
41
|
-
*/
|
|
42
4
|
export interface Ledger {
|
|
43
5
|
scenarioReconciliations: ScenarioReconciliation[];
|
|
44
6
|
}
|
|
45
|
-
/**
|
|
46
|
-
* The WHOLE-RUN verdict — is the ENTIRE reconciliation balanced? A pure domain
|
|
47
|
-
* derivation over the WHOLE `Ledger`: balanced IFF NO reconciling
|
|
48
|
-
* item exists ANYWHERE, across every Scenario Reconciliation row — scenario,
|
|
49
|
-
* phantom, and suspense alike. Out-of-balance iff ANY row carries a reconciling
|
|
50
|
-
* item: a scenario's out-of-balance items (failing / missing /
|
|
51
|
-
* no-evidence-obligation / both-missing) AND the credit-side suspense/phantom rows (a
|
|
52
|
-
* no-evidence-obligation static-check watermelon, an uncited credit, a phantom scenario).
|
|
53
|
-
*
|
|
54
|
-
* It is deliberately NOT a scan of scenario verdicts alone — that would
|
|
55
|
-
* let a watermelon-only run (every scenario balanced, yet a no-evidence-obligation
|
|
56
|
-
* static check sitting unreconciled in the suspense row) read as balanced, the
|
|
57
|
-
* false pass a CI gate must never give. Every row's `reconcilingItems` is
|
|
58
|
-
* consulted, so the suspense/phantom rows (verdict ALWAYS out-of-balance) count.
|
|
59
|
-
*
|
|
60
|
-
* The CLI edge maps this boolean to the process exit code — balanced → 0,
|
|
61
|
-
* out-of-balance → EXACTLY 1 — an ENUMERATED status, never a count (a count would
|
|
62
|
-
* 8-bit `& 0xFF` wrap → false pass).
|
|
63
|
-
*/
|
|
64
7
|
export declare function isBalanced(reconciliation: Ledger): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Does the WHOLE reconciliation carry any Pending Item? A pure domain predicate over the
|
|
67
|
-
* WHOLE `Ledger`, SYMMETRIC with `isBalanced` — together they are the
|
|
68
|
-
* whole-run verdict surface. True iff ANY Scenario Reconciliation row carries a Pending
|
|
69
|
-
* Item (a deferred `<quality-check>pending` obligation partitioned off before reconciliation,
|
|
70
|
-
* @SCN-PND-004). Pending Items are run-neutral by default (@SCN-PND-008); the CLI edge
|
|
71
|
-
* consults this ALONGSIDE `isBalanced` to escalate an otherwise-balanced run to the distinct
|
|
72
|
-
* exit code 3 under `--strict` (@SCN-CLI-011) — an OPT-IN gate on deferred obligations,
|
|
73
|
-
* checked only when `isBalanced` is true (out-of-balance dominates, exit 1).
|
|
74
|
-
*/
|
|
75
8
|
export declare function hasPendingItems(reconciliation: Ledger): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Does the WHOLE reconciliation carry BROKEN evidence — i.e. is the run UNSOUND? The THIRD
|
|
78
|
-
* whole-run predicate (@SCN-LDG-018), beside `isBalanced` and `hasPendingItems`, and the
|
|
79
|
-
* EXISTENTIAL TWIN of the latter: the same `some(row => some(item => item.outcome === X))` scan.
|
|
80
|
-
*
|
|
81
|
-
* Soundness is a property of the RUN, not of a scenario. If any PROOF NEVER RAN — a vitest suite
|
|
82
|
-
* that failed to collect (@SCN-LDG-017), or a cucumber step matched by two or more definitions
|
|
83
|
-
* (@SCN-LDG-019) — the evidence never fully materialised, so every `missing` in that run is
|
|
84
|
-
* SUSPECT: it may be a broken proof rather than an absent one, and the remedies differ (fix the
|
|
85
|
-
* harness vs write a test). The scenario's own row stays honest at its own resolution (`missing`);
|
|
86
|
-
* the RUN is what is stamped unsound.
|
|
87
|
-
*
|
|
88
|
-
* DERIVED, NEVER STORED — no soundness flag is written onto `Ledger`, the same
|
|
89
|
-
* no-drift reason `isBalanced` and `hasPendingItems` derive. Machine consumers read soundness off
|
|
90
|
-
* `summary.byOutcome.broken > 0` (type-forced into the JSON the moment `broken` joined the
|
|
91
|
-
* `Outcome` union); the markdown renderer prints the HEADLINE word — "unsound" is the render word,
|
|
92
|
-
* never the predicate's name, exactly as "out-of-balance" is for `isBalanced`.
|
|
93
|
-
*
|
|
94
|
-
* Keyed on the `broken` OUTCOME specifically, never on `!isBalanced`: an ordinary out-of-balance
|
|
95
|
-
* run (an honest `missing`, no broken evidence) is perfectly SOUND. The three whole-run
|
|
96
|
-
* predicates are INDEPENDENT — a run may carry Pending Items and be sound; a run may carry broken
|
|
97
|
-
* evidence and no Pending Items. (A broken run is ALWAYS out-of-balance, since the `broken` item
|
|
98
|
-
* sits on the suspense row — which is why the CLI edge must consult THIS predicate BEFORE the
|
|
99
|
-
* balance verdict, @SCN-CLI-012, or its exit code would be unreachable.)
|
|
100
|
-
*/
|
|
101
9
|
export declare function hasBrokenEvidence(reconciliation: Ledger): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Does the WHOLE run have NOTHING TO RECONCILE — no accounts at all? The FOURTH whole-run
|
|
104
|
-
* predicate (@SCN-CLI-019), beside `isBalanced` / `hasPendingItems` / `hasBrokenEvidence`, and the
|
|
105
|
-
* one shape the other three cannot speak about.
|
|
106
|
-
*
|
|
107
|
-
* THE FAULT IT EXISTS TO NAME. `isBalanced` is `.every()` over the rows, so on an EMPTY ledger it
|
|
108
|
-
* is VACUOUSLY TRUE; `hasPendingItems` and `hasBrokenEvidence` are `.some()`, so they are
|
|
109
|
-
* vacuously FALSE. A target that declared nothing and produced nothing therefore satisfied every
|
|
110
|
-
* existing predicate in the direction that reads as a pass, and was told "BALANCED … (exit 0)" — a
|
|
111
|
-
* green over silence, from the tool whose whole claim is that silence is not the same as nothing
|
|
112
|
-
* wrong. No combination of the three separates an empty run from a clean one, which is why this is
|
|
113
|
-
* a predicate and not a derivation of one.
|
|
114
|
-
*
|
|
115
|
-
* ITS OWN ENUMERATED STATE, exit 5 (taxonomy: 0 balanced / 1 out-of-balance / 2 usage / 3
|
|
116
|
-
* pending-under-strict / 4 unsound / 5 nothing to reconcile). Not balanced — there are no accounts
|
|
117
|
-
* to agree. Not out-of-balance — nothing disagrees. Not a usage fault — the invocation was valid
|
|
118
|
-
* and `new-client` is a supported adoption state, not a degraded one. Not unsound — no proof
|
|
119
|
-
* failed; none was owed.
|
|
120
|
-
*
|
|
121
|
-
* KEYED ON THE EMPTY LEDGER, NEVER ON THE EMPTY CORPUS, and that is load-bearing rather than
|
|
122
|
-
* pedantic: a target with no corpus but uncited credits HAS a row — its suspense row — and is an
|
|
123
|
-
* ordinary out-of-balance report at exit 1 (@SCN-CLI-020). Keyed on "no corpus" instead, the modal
|
|
124
|
-
* first run's whole report would disappear behind exit 5.
|
|
125
|
-
*
|
|
126
|
-
* DERIVED, NEVER STORED — no emptiness flag is written onto `Ledger`, the same no-drift reason its
|
|
127
|
-
* three siblings derive, and the reason no JSON-schema change is owed: a machine consumer reads
|
|
128
|
-
* the row count off the ledger it already has. The markdown renderer prints the HEADLINE word —
|
|
129
|
-
* "NOTHING TO RECONCILE" is the render word, never the predicate's name, exactly as "unsound" is
|
|
130
|
-
* for `hasBrokenEvidence`.
|
|
131
|
-
*
|
|
132
|
-
* WHERE IT MUST BE ASKED, MEASURED RATHER THAN ARGUED (3F-3344). The ticket predicted this would
|
|
133
|
-
* be @SCN-CLI-012's pre-emption one code further on — ask it after `isBalanced` and the branch
|
|
134
|
-
* goes unreachable. IT IS NOT, and the plant that was supposed to prove it stayed GREEN. An empty
|
|
135
|
-
* ledger is MUTUALLY EXCLUSIVE with all three siblings: with no rows there is no row to carry a
|
|
136
|
-
* broken item, a reconciling item or a Pending Item, so it fires NONE of them and its position
|
|
137
|
-
* AMONG them is unobservable. Moving it below `!isBalanced` in the CLI ladder still exits 5
|
|
138
|
-
* (measured).
|
|
139
|
-
*
|
|
140
|
-
* WHAT IS LOAD-BEARING is its position against the chain's DEFAULT. "Balanced" is not a predicate
|
|
141
|
-
* branch — it is the fall-through — so there is no "after the balanced case" to append a fifth
|
|
142
|
-
* code to, and a chain that reaches its default has already called the run balanced. Appended
|
|
143
|
-
* after the default the branch is dead code and the run exits 0 (measured: the plant that DID red).
|
|
144
|
-
* That is also why the fault survived: a fifth code cannot be ADDED to this chain, it has to
|
|
145
|
-
* DISPLACE the default, and nothing about the other three predicates says so.
|
|
146
|
-
*/
|
|
147
10
|
export declare function hasNothingToReconcile(reconciliation: Ledger): boolean;
|
|
148
|
-
/**
|
|
149
|
-
* The BROKEN reconciling items across the WHOLE run (3F-2203) — every proof that never ran, in row
|
|
150
|
-
* order, each carrying its WHERE-to-fix (locator) and WHAT-broke (the runner's message).
|
|
151
|
-
*
|
|
152
|
-
* The QUANTITATIVE twin of `hasBrokenEvidence`, which is now derived FROM it: "is this run
|
|
153
|
-
* unsound?" and "which proofs never ran?" are one question at two resolutions, so they are one
|
|
154
|
-
* scan. The markdown's Run-integrity section listed these by re-deriving the scan itself — a model
|
|
155
|
-
* query living in the renderer, and a second statement of which outcome means broken.
|
|
156
|
-
*
|
|
157
|
-
* The renderer READS this list and takes its length for the count-phrase; asking a list you were
|
|
158
|
-
* given how long it is is projection, not derivation.
|
|
159
|
-
*/
|
|
160
11
|
export declare function brokenItemsOf(reconciliation: Ledger): QualityCheckReconciliation[];
|
|
161
|
-
|
|
162
|
-
* The OBLIGATION-SIDE static-check sub-rows across the whole Ledger (3F-2203) — each `lint` Quality
|
|
163
|
-
* Check Reconciliation with the scnId of the row that names it, in row-then-document order.
|
|
164
|
-
*
|
|
165
|
-
* SCENARIO ROWS ONLY. A `lint` obligation is obligation-side, so a phantom or suspense row can carry
|
|
166
|
-
* none; the suspense row's lint CREDIT (a no-evidence-obligation static check, `cites-no-scenario`) is an
|
|
167
|
-
* observation, not an obligation, and must never inflate the obligation-side lint total.
|
|
168
|
-
*
|
|
169
|
-
* ONE COPY, BY CONSTRUCTION. That scenario-rows-only filter plus the lint cut existed TWICE,
|
|
170
|
-
* character-identical — here in `lintTally` and in the markdown's `### Lint evidence obligations`
|
|
171
|
-
* table. They agreed by copy-paste, not construction: either could have grown a clause alone and
|
|
172
|
-
* nothing would have redded. Same anaemia, same cure as `evidenceObligationPairsOf` and
|
|
173
|
-
* the corpus's own fitness obligations; the tally and the table are now two readings of ONE list.
|
|
174
|
-
*/
|
|
175
|
-
export declare function lintReconciliationsOf(reconciliation: Ledger): {
|
|
12
|
+
export declare function fitnessReconciliationsOf(reconciliation: Ledger): {
|
|
176
13
|
scnId: string;
|
|
177
14
|
reconciliation: QualityCheckReconciliation;
|
|
178
15
|
}[];
|
|
179
|
-
/**
|
|
180
|
-
* The materialised totals over the Scenario Reconciliations — the headline verdict tally,
|
|
181
|
-
* counted over EVERY row (@SCN-RMD-001, 3F-1724).
|
|
182
|
-
*
|
|
183
|
-
* The Evidence Reconciliation is ALL Scenario Reconciliations assembled, and the summary is
|
|
184
|
-
* its totals (`strategy/double-entry-manifesto.md`). There are three row kinds — real
|
|
185
|
-
* (`scenario`), `phantom-scenario` (cited by a credit, carried by no feature) and
|
|
186
|
-
* `suspense-scenario` (credits citing no scenario at all) — and phantom / suspense
|
|
187
|
-
* reconciliations are ALWAYS out-of-balance. So `total` / `balanced` / `outOfBalance` count
|
|
188
|
-
* every row, phantom and suspense among them.
|
|
189
|
-
*
|
|
190
|
-
* (The earlier "ruling Q3" — a scenario-only tally with phantom / suspense bucketed APART —
|
|
191
|
-
* was a divergence from the manifesto, not a decision: it let `isBalanced` (which correctly
|
|
192
|
-
* walks every row's reconciling items → exit 1) disagree with a tally reading 0
|
|
193
|
-
* out-of-balance, so a failing run rendered a headline that read as a pass. RETRACTED by the
|
|
194
|
-
* operator, 2026-07-13; the bug it caused is 3F-1703.)
|
|
195
|
-
*/
|
|
196
16
|
export interface ScenarioReconciliationTotals {
|
|
197
|
-
/** Every Scenario Reconciliation — scenario, phantom and suspense rows alike. */
|
|
198
17
|
total: number;
|
|
199
18
|
balanced: number;
|
|
200
|
-
/** Every out-of-balance row — the phantom and suspense rows among them (they always are). */
|
|
201
19
|
outOfBalance: number;
|
|
202
|
-
/**
|
|
203
|
-
* Phantom-scenario rows (cited by a credit, carried by no feature) — a SUB-COUNT, i.e. a
|
|
204
|
-
* breakdown OF `total` / `outOfBalance`, not a bucket outside them.
|
|
205
|
-
*/
|
|
206
20
|
phantom: number;
|
|
207
|
-
/**
|
|
208
|
-
* Suspense-scenario rows — credits citing NO scenario, aggregated into the one
|
|
209
|
-
* `(no scenario)` row. A SUB-COUNT like `phantom`: counted INSIDE `total` and
|
|
210
|
-
* `outOfBalance`, and surfaced separately so a reader recovers the scenario count as
|
|
211
|
-
* `total − phantom − suspense`.
|
|
212
|
-
*/
|
|
213
21
|
suspense: number;
|
|
214
22
|
}
|
|
215
|
-
/** A missing bucket — a rendered subject (a quality-check: `lint` or a runtime quality-check) and its count. */
|
|
216
23
|
export interface MissingByQualityCheck {
|
|
217
24
|
subject: string;
|
|
218
25
|
count: number;
|
|
219
26
|
}
|
|
220
|
-
/**
|
|
221
|
-
* The materialised evidence-obligation totals — the aggregate the markdown's Evidence
|
|
222
|
-
* reconciliation table derives, carried AS DATA (the MATERIALISE ruling): the total, the
|
|
223
|
-
* per-reconciliation-outcome breakdown, the out-of-balance sum, and the missing
|
|
224
|
-
* split by rendered subject.
|
|
225
|
-
*/
|
|
226
27
|
export interface EvidenceObligationTotals {
|
|
227
28
|
total: number;
|
|
228
29
|
byOutcome: Record<Outcome, number>;
|
|
229
30
|
outOfBalance: number;
|
|
230
31
|
missingByQualityCheck: MissingByQualityCheck[];
|
|
231
32
|
}
|
|
232
|
-
|
|
233
|
-
* The materialised lint tally (RMD-005) — the static-only evidenceObligation tally the markdown's
|
|
234
|
-
* `### Lint evidence obligations` total line derives: how many `@lint` (static) evidence obligations
|
|
235
|
-
* reconcile satisfied (balanced), out of the total raised. `summary.byOutcome` is
|
|
236
|
-
* kind-agnostic and cannot express the static-only lint total, so it is materialised explicitly.
|
|
237
|
-
*/
|
|
238
|
-
export interface LintTally {
|
|
33
|
+
export interface FitnessTally {
|
|
239
34
|
satisfied: number;
|
|
240
35
|
total: number;
|
|
241
36
|
}
|
|
242
|
-
/**
|
|
243
|
-
* The LEDGER-PURE part of the report summary — every totals field derived from the `Ledger`
|
|
244
|
-
* alone. The assembler merges this with the census pass-throughs (`testVolume`, `staticChecks`)
|
|
245
|
-
* and interleaves the keys in document order to build the full `Summary`.
|
|
246
|
-
*/
|
|
247
37
|
export interface LedgerTally {
|
|
248
38
|
scenarioReconciliations: ScenarioReconciliationTotals;
|
|
249
39
|
evidenceObligations: EvidenceObligationTotals;
|
|
250
40
|
pending: number;
|
|
251
|
-
|
|
41
|
+
fitness: FitnessTally;
|
|
252
42
|
}
|
|
253
|
-
/**
|
|
254
|
-
* Tally the LEDGER-PURE summary totals from the balance — the aggregate the markdown's
|
|
255
|
-
* trial-balance table derives, carried AS DATA so a later render-from-saved-JSON rebuilds it with
|
|
256
|
-
* zero computation (the MATERIALISE ruling). The census pass-throughs (`testVolume`,
|
|
257
|
-
* `staticChecks`) are not Ledger-pure and are merged in by the assembler.
|
|
258
|
-
*/
|
|
259
43
|
export declare function ledgerTally(balance: Ledger): LedgerTally;
|
|
260
|
-
|
|
261
|
-
* The static-only lint tally (RMD-005) — how many `@lint` (static) evidence obligations reconcile
|
|
262
|
-
* satisfied (`balanced`), out of the total raised. Byte-for-byte the markdown's
|
|
263
|
-
* `countStaticEvidenceObligations` (`src/render/markdown.ts`), so slice 2 can read `satisfied` / `total`
|
|
264
|
-
* with zero byte change. `summary.byOutcome` counts ALL kinds, so the static-only total is derived
|
|
265
|
-
* here explicitly.
|
|
266
|
-
*/
|
|
267
|
-
export declare function lintTally(balance: Ledger): LintTally;
|
|
268
|
-
/** The canonical runtime quality-check order, in reading order. */
|
|
44
|
+
export declare function fitnessTally(balance: Ledger): FitnessTally;
|
|
269
45
|
export declare const RUNTIME_QUALITY_CHECKS: readonly RuntimeQualityCheck[];
|
|
270
|
-
/**
|
|
271
|
-
* The materialised runtime-observation totals — the aggregate the markdown's `### Test volume`
|
|
272
|
-
* cut derives, carried AS DATA (the MATERIALISE ruling). Two keyings of the SAME posted credits:
|
|
273
|
-
* - `rawByRuntimeQualityCheck` — the per-quality-check evidence-observation total over ALL
|
|
274
|
-
* runtime credits, regardless of `@SCN` (the runtime axis; `lint` credits are not counted).
|
|
275
|
-
* - the per-scenario-kind counts — how many credits posted to a scenario's account
|
|
276
|
-
* (`onScenario`), to an invented `phantom-scenario` account (`onPhantomScenario`), and to the
|
|
277
|
-
* `suspense-scenario` account (`onSuspenseScenario`).
|
|
278
|
-
* These jointly exhaust the raw total by construction:
|
|
279
|
-
* `Σ rawByRuntimeQualityCheck = onScenario + onPhantomScenario + onSuspenseScenario`.
|
|
280
|
-
*/
|
|
281
46
|
export interface RuntimeObservationTally {
|
|
282
|
-
/** Raw per-quality-check evidence-observation totals — ALL runtime credits, regardless of `@SCN`. */
|
|
283
47
|
rawByRuntimeQualityCheck: Record<RuntimeQualityCheck, number>;
|
|
284
|
-
/**
|
|
285
|
-
* The runtime credit total — `Σ rawByRuntimeQualityCheck`, and equally
|
|
286
|
-
* `onScenario + onPhantomScenario + onSuspenseScenario` (3F-2231).
|
|
287
|
-
*
|
|
288
|
-
* RETURNED, not left for the caller to re-derive. The fold computed this sum and discarded it,
|
|
289
|
-
* so the assembler summed the same record again to fill `summary.testVolume` — the identical
|
|
290
|
-
* `reduce`, in an adapter, for a number the Ledger already knew. Two homes for one total is the
|
|
291
|
-
* shape this domain model exists to remove: the Ledger counts its own posted credits because it
|
|
292
|
-
* IS the balance, and a consumer asks rather than counts.
|
|
293
|
-
*/
|
|
294
48
|
total: number;
|
|
295
|
-
/** Runtime credits posted to a scenario's account (matched-attributed OR no-evidence-obligation). */
|
|
296
49
|
onScenario: number;
|
|
297
|
-
/** Runtime credits posted to an invented `phantom-scenario` account (an `@SCN` no feature carries). */
|
|
298
50
|
onPhantomScenario: number;
|
|
299
|
-
/** Runtime credits posted to the `suspense-scenario` account (citing no scenario, or broken). */
|
|
300
51
|
onSuspenseScenario: number;
|
|
301
52
|
}
|
|
302
|
-
/**
|
|
303
|
-
* Tally the runtime evidence observations from the Ledger — a FOLD OVER THE POSTED CREDITS
|
|
304
|
-
* (@SCN-RMD-003), the credit-side twin of `ledgerTally`'s debit-side fold. It walks the POSTED
|
|
305
|
-
* CREDITS on each Scenario Reconciliation row (@SCN-LDG-022) and reads each credit's account off
|
|
306
|
-
* THE ROW IT POSTED TO — a scenario row ⇒ `onScenario`, a phantom row ⇒ `onPhantomScenario`,
|
|
307
|
-
* the suspense row ⇒ `onSuspenseScenario` — summing the raw per-quality-check total in lockstep.
|
|
308
|
-
*
|
|
309
|
-
* It RE-DERIVES NOTHING and it does NOT classify: the reconciler already decided which account
|
|
310
|
-
* every credit posts to (the account IS the citation, @SCN-LDG-022), so asking the row is asking
|
|
311
|
-
* that decision. There is ONE place that decides what a credit is, so this tally can never disagree
|
|
312
|
-
* with the verdict — the views (Test volume, the per-quality-check table) are projections of the
|
|
313
|
-
* same rows, not a parallel opinion kept in step.
|
|
314
|
-
*
|
|
315
|
-
* Static check (`lint`) credits are SKIPPED, ON THE CHECK and never on the absence of a citation
|
|
316
|
-
* (@SCN-RPT-023). A fitness credit now CITES its own scenario and posts to an ordinary
|
|
317
|
-
* scenario row, so to a naive walk it is indistinguishable from a runtime credit by the account it
|
|
318
|
-
* landed on; the `qualityCheck` is the only thing that tells them apart. Counting one would fold
|
|
319
|
-
* the static axis into the Test volume, which must not see it at all.
|
|
320
|
-
*
|
|
321
|
-
* The per-scenario-kind counts feed `summary.testVolume` directly (`onScenario` counts credits
|
|
322
|
-
* citing a scenario, INCLUDING no-evidence-obligation — so the 3-termed identity
|
|
323
|
-
* `total = onScenario + onPhantomScenario + onSuspenseScenario` holds); `rawByRuntimeQualityCheck`
|
|
324
|
-
* is the re-homed per-quality-check headline the by-level table renders.
|
|
325
|
-
*/
|
|
326
53
|
export declare function runtimeObservationTally(ledger: Ledger): RuntimeObservationTally;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
* distinct static checks that RAN — every static check a CI step invokes, whether or not its red is
|
|
331
|
-
* that job's verdict, 3F-3280) and `uncitedStaticCheckCount` (how many of THOSE no scenario cites — a
|
|
332
|
-
* static check running with nothing naming it, the mirror of a runtime `cites-no-scenario` credit).
|
|
333
|
-
* The named count is IMPLICIT (`runningStaticCheckCount − uncitedStaticCheckCount`) and NOT carried:
|
|
334
|
-
* every cited static check is already a reconciled `lint` sub-row and adds nothing the rows do not
|
|
335
|
-
* already hold.
|
|
336
|
-
*
|
|
337
|
-
* THE SECOND COUNT IS A SUBSET OF THE FIRST, AND THAT IS WHAT MAKES THE IMPLICIT COUNT SOUND
|
|
338
|
-
* (@SCN-LNT-033). Both take the same running membership rule, so the subtraction a reader performs
|
|
339
|
-
* on the pair can never go below nil — it is a partition of the running set into the named and the
|
|
340
|
-
* uncited, not two independently-drawn populations that happen to be printed on one line.
|
|
341
|
-
*/
|
|
342
|
-
export interface StaticObservationTally {
|
|
343
|
-
/**
|
|
344
|
-
* The running static-check set volume — every check a step of the target's CI runs, whatever
|
|
345
|
-
* form the step takes (@SCN-USG-013): a check can be an action as readily as a command. A check
|
|
346
|
-
* whose red the job survives RAN and is counted (3F-3280); that it enforces nothing is its own
|
|
347
|
-
* row's watermelon (@SCN-LNT-032), not a smaller number here.
|
|
348
|
-
*/
|
|
349
|
-
runningStaticCheckCount: number;
|
|
350
|
-
/** Running static checks NO `@lint` cites — a SUBSET of the count above (named is implicit). */
|
|
351
|
-
uncitedStaticCheckCount: number;
|
|
54
|
+
export interface FitnessFunctionTally {
|
|
55
|
+
runningFitnessFunctionCount: number;
|
|
56
|
+
uncitedFitnessFunctionCount: number;
|
|
352
57
|
}
|
|
353
|
-
|
|
354
|
-
* Tally the static-check observations from the Ledger — a FOLD OVER THE POSTED static-check CREDITS
|
|
355
|
-
* (3F-2118), the static-axis twin of `runtimeObservationTally`. It walks the POSTED CREDITS on each
|
|
356
|
-
* Scenario Reconciliation row (@SCN-LDG-022), reads each credit off THE ROW IT POSTED TO, and — like
|
|
357
|
-
* its runtime sibling — RE-DERIVES NOTHING: the reconciler already decided which account every credit
|
|
358
|
-
* posts to, so this can never disagree with the verdict.
|
|
359
|
-
*
|
|
360
|
-
* `uncitedStaticCheckCount` is the count of RUNNING lint credits on the SUSPENSE row — the
|
|
361
|
-
* no-evidence-obligation static checks the reconciler folded there (a static check running with no
|
|
362
|
-
* scenario citing it, `cites-no-scenario` on the credit side). THE RUNNING QUALIFIER IS APPLIED
|
|
363
|
-
* HERE RATHER THAN ASSUMED (@SCN-LNT-033): the uncited count is the running count's suspense-row
|
|
364
|
-
* subset, so the two take one membership rule. A severed check nobody cites RAN, and is in both
|
|
365
|
-
* (3F-3280). A BROKEN credit reaches the same row by a different route (@SCN-LNT-026) and is
|
|
366
|
-
* excluded: it is a check a scenario DID name, which did not run.
|
|
367
|
-
*
|
|
368
|
-
* `runningStaticCheckCount` is the count of lint credits that RAN, across ALL rows. One care-move
|
|
369
|
-
* the runtime axis does not need (see the block comment above):
|
|
370
|
-
* - FILTER TO WHAT RAN (`exists`): a missing (absent) or broken check STILL posts (posting is not
|
|
371
|
-
* classifying), but it did not run, so it is excluded — as the retired census's running-only
|
|
372
|
-
* `continue` excluded it. A severed check (wired, and the job's verdict does not depend on it)
|
|
373
|
-
* ran and is counted; its row reads the watermelon (3F-3280, ruled 2026-09-17).
|
|
374
|
-
*
|
|
375
|
-
* The named (implicit) count is `runningStaticCheckCount − uncitedStaticCheckCount`, and it cannot
|
|
376
|
-
* go below nil: the uncited count is drawn from inside the running one.
|
|
377
|
-
*/
|
|
378
|
-
export declare function staticObservationTally(ledger: Ledger): StaticObservationTally;
|
|
58
|
+
export declare function fitnessFunctionTally(ledger: Ledger): FitnessFunctionTally;
|
|
379
59
|
//# sourceMappingURL=ledger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/domain/ledger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/domain/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,KAAK,EAAE,mBAAmB,EAA8B,MAAM,cAAc,CAAC;AAEpF,MAAM,WAAW,MAAM;IACrB,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;CACnD;AAED,wBAAgB,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAErE;AAED,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,0BAA0B,EAAE,CAIlF;AAED,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,GACrB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,0BAA0B,CAAA;CAAE,EAAE,CAMjE;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,qBAAqB,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,uBAAuB,EAAE,4BAA4B,CAAC;IACtD,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;CACvB;AAID,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAQxD;AA8DD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAM1D;AAED,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAAkD,CAAC;AAEpH,MAAM,WAAW,uBAAuB;IACtC,wBAAwB,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CAwB/E;AAED,MAAM,WAAW,oBAAoB;IACnC,2BAA2B,EAAE,MAAM,CAAC;IACpC,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAczE"}
|