spec-controller 0.1.122 → 0.1.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +357 -338
- package/dist/spec-reconciliation.schema.json +302 -244
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11616,9 +11616,6 @@ function corpusCountsOf(files) {
|
|
|
11616
11616
|
const untagged = files.flatMap(({ feature, untaggedScenarios }) => untaggedScenarios.map((scenario) => ({ feature, scenario }))).sort((a, b) => a.feature.localeCompare(b.feature) || a.scenario.localeCompare(b.scenario));
|
|
11617
11617
|
return evidenceObligations(raw, scenarioCount, untagged, sharedScnCodesOf(files));
|
|
11618
11618
|
}
|
|
11619
|
-
function scenariosBehindAccountsOf(accounts, sharedScnCodes) {
|
|
11620
|
-
return accounts + sharedScnCodes.reduce((extra, code) => extra + code.scenarios.length - 1, 0);
|
|
11621
|
-
}
|
|
11622
11619
|
function evidenceObligations(raw, scenarioCount, untaggedScenarios = [], sharedScnCodes = []) {
|
|
11623
11620
|
return {
|
|
11624
11621
|
rawScnOccurrences: raw,
|
|
@@ -11765,10 +11762,12 @@ function featureCountsOf(feature) {
|
|
|
11765
11762
|
function corpusCountsOfFeatures(features) {
|
|
11766
11763
|
return corpusCountsOf(features.map((parsed) => ({ feature: parsed.file, ...featureCountsOf(parsed) })));
|
|
11767
11764
|
}
|
|
11768
|
-
function
|
|
11765
|
+
function namedScenariosOf(feature, deferralTags = []) {
|
|
11769
11766
|
return scenariosByScnCodeOf(feature).taggedScenarios.map((scenario) => ({
|
|
11770
11767
|
scnId: scenario.scnId,
|
|
11771
|
-
evidenceObligations: obligationsRaisedBy(scenario.tags, deferralTags)
|
|
11768
|
+
evidenceObligations: obligationsRaisedBy(scenario.tags, deferralTags),
|
|
11769
|
+
feature: feature.file,
|
|
11770
|
+
title: scenario.name
|
|
11772
11771
|
}));
|
|
11773
11772
|
}
|
|
11774
11773
|
var SCN_OCCURRENCE;
|
|
@@ -11875,138 +11874,96 @@ var init_qualityCheckReconciliationFault = __esm({
|
|
|
11875
11874
|
});
|
|
11876
11875
|
|
|
11877
11876
|
// ../core/dist/domain/qualityCheckReconciliation.js
|
|
11877
|
+
function isObligationLineOutcome(outcome) {
|
|
11878
|
+
return OBLIGATION_LINE_OUTCOMES.has(outcome);
|
|
11879
|
+
}
|
|
11878
11880
|
function isObservationOnly(outcome) {
|
|
11879
11881
|
const profile = OUTCOME_SIDE_PROFILE[outcome];
|
|
11880
11882
|
return profile.obligation === "None" && profile.observation === "Exists";
|
|
11881
11883
|
}
|
|
11884
|
+
function presenceOf(present) {
|
|
11885
|
+
return present ? "Exists" : "None";
|
|
11886
|
+
}
|
|
11887
|
+
function carriesEvidenceObligation(fields, observation) {
|
|
11888
|
+
return fields.evidenceObligation !== void 0 && observation.broken !== true;
|
|
11889
|
+
}
|
|
11890
|
+
function divergence(outcome, evidence, presenceFound) {
|
|
11891
|
+
const profile = OUTCOME_SIDE_PROFILE[outcome];
|
|
11892
|
+
return new QualityCheckReconciliationFault({
|
|
11893
|
+
code: QualityCheckFaultCode.EvidenceDivergesFromOutcome,
|
|
11894
|
+
evidence,
|
|
11895
|
+
outcome,
|
|
11896
|
+
presenceForOutcome: evidence === "evidence-obligation" ? profile.obligation : profile.observation,
|
|
11897
|
+
presenceFound
|
|
11898
|
+
});
|
|
11899
|
+
}
|
|
11900
|
+
function refuseDivergentLine(outcome, obligation, observation) {
|
|
11901
|
+
const profile = OUTCOME_SIDE_PROFILE[outcome];
|
|
11902
|
+
if (obligation !== profile.obligation)
|
|
11903
|
+
throw divergence(outcome, "evidence-obligation", obligation);
|
|
11904
|
+
if (observation !== profile.observation)
|
|
11905
|
+
throw divergence(outcome, "evidence-observation", observation);
|
|
11906
|
+
}
|
|
11882
11907
|
function makeQualityCheckReconciliation(fields) {
|
|
11883
|
-
const
|
|
11884
|
-
if (fields.
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
outcome: fields.outcome,
|
|
11889
|
-
presenceForOutcome: profile.obligation,
|
|
11890
|
-
presenceFound: fields.evidenceObligation !== void 0 ? "Exists" : "None"
|
|
11891
|
-
});
|
|
11908
|
+
const observations = fields.evidenceObservations ?? [];
|
|
11909
|
+
if (fields.outcome !== void 0) {
|
|
11910
|
+
if (!isObligationLineOutcome(fields.outcome))
|
|
11911
|
+
throw divergence(fields.outcome, "evidence-observation", "None");
|
|
11912
|
+
refuseDivergentLine(fields.outcome, presenceOf(fields.evidenceObligation !== void 0), presenceOf(observations.some((o) => o.broken !== true)));
|
|
11892
11913
|
}
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
code: QualityCheckFaultCode.EvidenceDivergesFromOutcome,
|
|
11896
|
-
evidence: "evidence-observation",
|
|
11897
|
-
outcome: fields.outcome,
|
|
11898
|
-
presenceForOutcome: profile.observation,
|
|
11899
|
-
presenceFound: fields.evidenceObservation !== void 0 ? "Exists" : "None"
|
|
11900
|
-
});
|
|
11914
|
+
for (const observation of observations) {
|
|
11915
|
+
refuseDivergentLine(observation.outcome, presenceOf(carriesEvidenceObligation(fields, observation)), "Exists");
|
|
11901
11916
|
}
|
|
11902
11917
|
return fields;
|
|
11903
11918
|
}
|
|
11904
|
-
function
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
return { outcome, observation };
|
|
11912
|
-
}
|
|
11913
|
-
return { outcome: "missing" };
|
|
11914
|
-
}
|
|
11915
|
-
function fitnessObservationsCiting(scnId, evidenceObservations) {
|
|
11916
|
-
return evidenceObservations.filter((o) => isFitnessObservation(o) && o.broken !== true && o.scnId === scnId);
|
|
11917
|
-
}
|
|
11918
|
-
function fitnessOutcomeOf(observation) {
|
|
11919
|
+
function lineOutcomeOf(observation, answering) {
|
|
11920
|
+
if (observation.broken === true)
|
|
11921
|
+
return "broken";
|
|
11922
|
+
if (answering !== "evidence-obligation")
|
|
11923
|
+
return UNOBLIGED_OUTCOME[answering];
|
|
11924
|
+
if (!isFitnessObservation(observation))
|
|
11925
|
+
return observation.status === "passed" ? "satisfied" : "failing";
|
|
11919
11926
|
if (observation.status === "failed")
|
|
11920
11927
|
return "failing";
|
|
11921
|
-
|
|
11922
|
-
return "satisfied";
|
|
11923
|
-
return observation.exists ? "watermelon" : void 0;
|
|
11928
|
+
return observation.enforcedOverRealSource ? "satisfied" : "watermelon";
|
|
11924
11929
|
}
|
|
11925
|
-
function
|
|
11926
|
-
|
|
11927
|
-
return makeQualityCheckReconciliation({
|
|
11928
|
-
qualityCheck: "fitness",
|
|
11929
|
-
outcome,
|
|
11930
|
-
evidenceObligation: obligation,
|
|
11931
|
-
...observation ? { evidenceObservation: observation } : {}
|
|
11932
|
-
});
|
|
11930
|
+
function linesFor(observations, answering) {
|
|
11931
|
+
return observations.map((o) => ({ ...o, outcome: lineOutcomeOf(o, answering) }));
|
|
11933
11932
|
}
|
|
11934
|
-
function
|
|
11935
|
-
return
|
|
11933
|
+
function observationsField(observations) {
|
|
11934
|
+
return observations.length > 0 ? { evidenceObservations: observations } : {};
|
|
11936
11935
|
}
|
|
11937
11936
|
function reconcileEvidenceObligation(scnId, obligation, evidenceObservations) {
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
}
|
|
11941
|
-
const { outcome, observation } = answerOf(evidenceObservations.filter((o) => o.broken !== true && o.qualityCheck === obligation.qualityCheck && o.scnId === scnId), behaviouralOutcomeOf);
|
|
11937
|
+
const citing = evidenceObservations.filter((o) => o.qualityCheck === obligation.qualityCheck && o.scnId === scnId);
|
|
11938
|
+
const answered = citing.some((o) => o.broken !== true);
|
|
11942
11939
|
return makeQualityCheckReconciliation({
|
|
11943
11940
|
qualityCheck: obligation.qualityCheck,
|
|
11944
|
-
outcome,
|
|
11941
|
+
...answered ? {} : { outcome: "missing" },
|
|
11945
11942
|
evidenceObligation: obligation,
|
|
11946
|
-
...
|
|
11943
|
+
...observationsField(linesFor(citing, "evidence-obligation"))
|
|
11947
11944
|
});
|
|
11948
11945
|
}
|
|
11949
|
-
function
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
...o.message !== void 0 ? { message: o.message } : {},
|
|
11956
|
-
...o.notes !== void 0 ? { notes: o.notes } : {}
|
|
11957
|
-
};
|
|
11958
|
-
}
|
|
11959
|
-
function brokenReconciliationOf(o) {
|
|
11960
|
-
return makeQualityCheckReconciliation({
|
|
11961
|
-
qualityCheck: o.qualityCheck,
|
|
11962
|
-
...fitnessFunctionNameOf(o) !== void 0 ? { fitnessFunction: fitnessFunctionNameOf(o) } : {},
|
|
11963
|
-
outcome: "broken",
|
|
11964
|
-
evidenceObservation: o,
|
|
11965
|
-
...remarkOf(o)
|
|
11966
|
-
});
|
|
11967
|
-
}
|
|
11968
|
-
function brokenReconciliationsOf(postedObservations) {
|
|
11969
|
-
return postedObservations.filter((o) => o.broken === true).map(brokenReconciliationOf);
|
|
11946
|
+
function reconciliationsByQualityCheck(observations, answering) {
|
|
11947
|
+
const groups = /* @__PURE__ */ new Map();
|
|
11948
|
+
for (const o of observations) {
|
|
11949
|
+
groups.set(o.qualityCheck, [...groups.get(o.qualityCheck) ?? [], o]);
|
|
11950
|
+
}
|
|
11951
|
+
return [...groups].map(([qualityCheck, group]) => makeQualityCheckReconciliation({ qualityCheck, evidenceObservations: linesFor(group, answering) }));
|
|
11970
11952
|
}
|
|
11971
11953
|
function noEvidenceObligationReconciliationsOf(scnId, postedObservations, evidenceObligationPairs) {
|
|
11972
|
-
return postedObservations.filter((o) =>
|
|
11973
|
-
qualityCheck: o.qualityCheck,
|
|
11974
|
-
outcome: "no-evidence-obligation",
|
|
11975
|
-
...fitnessFunctionNameOf(o) !== void 0 ? { fitnessFunction: fitnessFunctionNameOf(o) } : {},
|
|
11976
|
-
evidenceObservation: o,
|
|
11977
|
-
...locatorOf(o) !== void 0 ? { locator: locatorOf(o) } : {}
|
|
11978
|
-
}));
|
|
11954
|
+
return reconciliationsByQualityCheck(postedObservations.filter((o) => !evidenceObligationPairs.has(evidenceObligationPairKey(scnId, o.qualityCheck))), "scenario");
|
|
11979
11955
|
}
|
|
11980
11956
|
function citesUnknownScenarioReconciliationsOf(observations) {
|
|
11981
|
-
return observations
|
|
11982
|
-
qualityCheck: o.qualityCheck,
|
|
11983
|
-
...isFitnessObservation(o) ? { fitnessFunction: o.fitnessFunction } : {},
|
|
11984
|
-
outcome: "cites-unknown-scenario",
|
|
11985
|
-
evidenceObservation: o,
|
|
11986
|
-
...locatorOf(o) !== void 0 ? { locator: locatorOf(o) } : {}
|
|
11987
|
-
}));
|
|
11957
|
+
return reconciliationsByQualityCheck(observations, "phantom-claim");
|
|
11988
11958
|
}
|
|
11989
|
-
function unnamedClaimReconciliationsOf(
|
|
11990
|
-
return
|
|
11991
|
-
...brokenEvidence.map(brokenReconciliationOf),
|
|
11992
|
-
...uncited.map((o) => makeQualityCheckReconciliation({
|
|
11993
|
-
qualityCheck: o.qualityCheck,
|
|
11994
|
-
outcome: "cites-no-scenario",
|
|
11995
|
-
evidenceObservation: o,
|
|
11996
|
-
...remarkOf(o)
|
|
11997
|
-
})),
|
|
11998
|
-
...uncitedFitnessFunctions.map((o) => makeQualityCheckReconciliation({
|
|
11999
|
-
qualityCheck: "fitness",
|
|
12000
|
-
fitnessFunction: o.fitnessFunction,
|
|
12001
|
-
outcome: "cites-no-scenario",
|
|
12002
|
-
evidenceObservation: o
|
|
12003
|
-
}))
|
|
12004
|
-
];
|
|
11959
|
+
function unnamedClaimReconciliationsOf(observations) {
|
|
11960
|
+
return reconciliationsByQualityCheck(observations, "unnamed-claim");
|
|
12005
11961
|
}
|
|
12006
11962
|
function noScnCodeReconciliations() {
|
|
12007
11963
|
return [makeQualityCheckReconciliation({ outcome: "no-scn-code", evidenceObligation: {} })];
|
|
12008
11964
|
}
|
|
12009
|
-
function duplicateScnCodeReconciliationsOf(obligations) {
|
|
11965
|
+
function duplicateScnCodeReconciliationsOf(obligations, scenario) {
|
|
11966
|
+
const naming = scenario === void 0 ? {} : { scenario };
|
|
12010
11967
|
const firstNaming = /* @__PURE__ */ new Map();
|
|
12011
11968
|
for (const obligation of obligations) {
|
|
12012
11969
|
if (obligation.qualityCheck !== void 0 && !firstNaming.has(obligation.qualityCheck)) {
|
|
@@ -12014,14 +11971,14 @@ function duplicateScnCodeReconciliationsOf(obligations) {
|
|
|
12014
11971
|
}
|
|
12015
11972
|
}
|
|
12016
11973
|
if (firstNaming.size === 0) {
|
|
12017
|
-
return [makeQualityCheckReconciliation({ outcome: "duplicate-scn-code", evidenceObligation: {} })];
|
|
11974
|
+
return [makeQualityCheckReconciliation({ outcome: "duplicate-scn-code", evidenceObligation: {}, ...naming })];
|
|
12018
11975
|
}
|
|
12019
|
-
return [...firstNaming].map(([qualityCheck, evidenceObligation]) => makeQualityCheckReconciliation({ qualityCheck, outcome: "duplicate-scn-code", evidenceObligation }));
|
|
11976
|
+
return [...firstNaming].map(([qualityCheck, evidenceObligation]) => makeQualityCheckReconciliation({ qualityCheck, outcome: "duplicate-scn-code", evidenceObligation, ...naming }));
|
|
12020
11977
|
}
|
|
12021
11978
|
function bothMissingReconciliation() {
|
|
12022
11979
|
return makeQualityCheckReconciliation({ outcome: "both-missing" });
|
|
12023
11980
|
}
|
|
12024
|
-
var OUTCOME_SIDE_PROFILE, OUT_OF_BALANCE_OUTCOMES,
|
|
11981
|
+
var OUTCOME_SIDE_PROFILE, OUT_OF_BALANCE_OUTCOMES, OBLIGATION_LINE_OUTCOMES, UNOBLIGED_OUTCOME;
|
|
12025
11982
|
var init_qualityCheckReconciliation = __esm({
|
|
12026
11983
|
"../core/dist/domain/qualityCheckReconciliation.js"() {
|
|
12027
11984
|
"use strict";
|
|
@@ -12042,16 +11999,53 @@ var init_qualityCheckReconciliation = __esm({
|
|
|
12042
11999
|
"both-missing": { obligation: "None", observation: "None" }
|
|
12043
12000
|
};
|
|
12044
12001
|
OUT_OF_BALANCE_OUTCOMES = Object.keys(OUTCOME_SIDE_PROFILE).filter((outcome) => outcome !== "satisfied");
|
|
12045
|
-
|
|
12002
|
+
OBLIGATION_LINE_OUTCOMES = new Set(Object.keys(OUTCOME_SIDE_PROFILE).filter((outcome) => OUTCOME_SIDE_PROFILE[outcome].observation === "None"));
|
|
12003
|
+
UNOBLIGED_OUTCOME = {
|
|
12004
|
+
scenario: "no-evidence-obligation",
|
|
12005
|
+
"phantom-claim": "cites-unknown-scenario",
|
|
12006
|
+
"unnamed-claim": "cites-no-scenario"
|
|
12007
|
+
};
|
|
12046
12008
|
}
|
|
12047
12009
|
});
|
|
12048
12010
|
|
|
12049
12011
|
// ../core/dist/domain/claimReconciliation.js
|
|
12050
|
-
function
|
|
12051
|
-
|
|
12012
|
+
function observationLineOf(reconciliation, observation) {
|
|
12013
|
+
const carriesObligation = carriesEvidenceObligation(reconciliation, observation);
|
|
12014
|
+
return {
|
|
12015
|
+
...reconciliation.qualityCheck === void 0 ? {} : { qualityCheck: reconciliation.qualityCheck },
|
|
12016
|
+
outcome: observation.outcome,
|
|
12017
|
+
...carriesObligation ? { evidenceObligation: reconciliation.evidenceObligation } : {},
|
|
12018
|
+
evidenceObservation: observation
|
|
12019
|
+
};
|
|
12020
|
+
}
|
|
12021
|
+
function linesOf(reconciliation) {
|
|
12022
|
+
const own = !isObligationLineOutcome(reconciliation.outcome) ? [] : [
|
|
12023
|
+
{
|
|
12024
|
+
...reconciliation.qualityCheck === void 0 ? {} : { qualityCheck: reconciliation.qualityCheck },
|
|
12025
|
+
outcome: reconciliation.outcome,
|
|
12026
|
+
...reconciliation.evidenceObligation === void 0 ? {} : { evidenceObligation: reconciliation.evidenceObligation },
|
|
12027
|
+
...reconciliation.scenario === void 0 ? {} : { scenario: reconciliation.scenario }
|
|
12028
|
+
}
|
|
12029
|
+
];
|
|
12030
|
+
return [
|
|
12031
|
+
...own,
|
|
12032
|
+
...(reconciliation.evidenceObservations ?? []).map((observation) => observationLineOf(reconciliation, observation))
|
|
12033
|
+
];
|
|
12034
|
+
}
|
|
12035
|
+
function unsatisfiedOf(reconciliations) {
|
|
12036
|
+
return reconciliations.flatMap(linesOf).filter((line) => line.outcome !== "satisfied");
|
|
12037
|
+
}
|
|
12038
|
+
function verdictFor(reconciliations) {
|
|
12039
|
+
return unsatisfiedOf(reconciliations).length === 0 ? "balanced" : "out-of-balance";
|
|
12040
|
+
}
|
|
12041
|
+
function reconcilingItemsOf(row) {
|
|
12042
|
+
return unsatisfiedOf(row.qualityCheckReconciliations);
|
|
12052
12043
|
}
|
|
12053
|
-
function
|
|
12054
|
-
return
|
|
12044
|
+
function observationsOf(row) {
|
|
12045
|
+
return row.qualityCheckReconciliations.flatMap((reconciliation) => reconciliation.evidenceObservations ?? []);
|
|
12046
|
+
}
|
|
12047
|
+
function obligationsOf(row) {
|
|
12048
|
+
return row.qualityCheckReconciliations.flatMap(({ evidenceObligation }) => evidenceObligation?.qualityCheck === void 0 ? [] : [evidenceObligation]);
|
|
12055
12049
|
}
|
|
12056
12050
|
function isScenario(row) {
|
|
12057
12051
|
return row.kind === "scenario";
|
|
@@ -12069,19 +12063,22 @@ function outOfBalanceCountOf(rows) {
|
|
|
12069
12063
|
return rows.filter(isOutOfBalance).length;
|
|
12070
12064
|
}
|
|
12071
12065
|
function carriesNoScnCode(row) {
|
|
12072
|
-
return row.
|
|
12066
|
+
return reconcilingItemsOf(row).some((item) => item.outcome === "no-scn-code");
|
|
12073
12067
|
}
|
|
12074
12068
|
function fitnessFunctionReconciliationsOf(row) {
|
|
12075
|
-
return row.qualityCheckReconciliations.filter((r) => r.qualityCheck === "fitness");
|
|
12069
|
+
return row.qualityCheckReconciliations.filter((r) => r.qualityCheck === "fitness" && r.evidenceObligation !== void 0);
|
|
12070
|
+
}
|
|
12071
|
+
function ranObservationsOf(row) {
|
|
12072
|
+
return observationsOf(row).filter((o) => o.broken !== true);
|
|
12076
12073
|
}
|
|
12077
12074
|
function carriesQualityCheck(row, qualityCheck) {
|
|
12078
|
-
return row.qualityCheckReconciliations.some((r) => r.qualityCheck === qualityCheck
|
|
12075
|
+
return row.qualityCheckReconciliations.some((r) => r.qualityCheck === qualityCheck && linesOf(r).some((line) => line.outcome !== "broken"));
|
|
12079
12076
|
}
|
|
12080
12077
|
function namesQualityCheck(row, qualityCheck) {
|
|
12081
|
-
return evidenceObligationsOf(row
|
|
12078
|
+
return evidenceObligationsOf(obligationsOf(row)).some((o) => o.qualityCheck === qualityCheck);
|
|
12082
12079
|
}
|
|
12083
12080
|
function observationCountOf(row, qualityCheck) {
|
|
12084
|
-
return row.
|
|
12081
|
+
return ranObservationsOf(row).filter((o) => o.qualityCheck === qualityCheck).length;
|
|
12085
12082
|
}
|
|
12086
12083
|
function qualityCheckReconciliationsOf(reconciledEvidenceObligations, noEvidenceObligationItems, pendingItems) {
|
|
12087
12084
|
const rows = [...reconciledEvidenceObligations, ...noEvidenceObligationItems];
|
|
@@ -12099,7 +12096,7 @@ var init_claimReconciliation = __esm({
|
|
|
12099
12096
|
|
|
12100
12097
|
// ../core/dist/domain/ledger.js
|
|
12101
12098
|
function isBalanced(ledger) {
|
|
12102
|
-
return ledger.claimReconciliations.every((row) => row.
|
|
12099
|
+
return ledger.claimReconciliations.every((row) => reconcilingItemsOf(row).length === 0);
|
|
12103
12100
|
}
|
|
12104
12101
|
function hasPendingItems(ledger) {
|
|
12105
12102
|
return ledger.claimReconciliations.some((row) => row.pendingItems.length > 0);
|
|
@@ -12111,10 +12108,13 @@ function hasNothingToReconcile(ledger) {
|
|
|
12111
12108
|
return ledger.claimReconciliations.length === 0;
|
|
12112
12109
|
}
|
|
12113
12110
|
function brokenItemsOf(ledger) {
|
|
12114
|
-
return ledger.claimReconciliations.flatMap((row) => row.
|
|
12111
|
+
return ledger.claimReconciliations.flatMap((row) => reconcilingItemsOf(row).filter((item) => item.outcome === "broken"));
|
|
12115
12112
|
}
|
|
12116
12113
|
function fitnessReconciliationsOf(ledger) {
|
|
12117
|
-
return ledger.claimReconciliations.filter(isScenario).flatMap((row) => fitnessFunctionReconciliationsOf(row).map((r) => ({ scnId: row.
|
|
12114
|
+
return ledger.claimReconciliations.filter(isScenario).flatMap((row) => fitnessFunctionReconciliationsOf(row).map((r) => ({ scnId: row.claim, reconciliation: r })));
|
|
12115
|
+
}
|
|
12116
|
+
function isSatisfied(reconciliation) {
|
|
12117
|
+
return linesOf(reconciliation).every((line) => line.outcome === "satisfied");
|
|
12118
12118
|
}
|
|
12119
12119
|
function ledgerTally(ledger) {
|
|
12120
12120
|
const { claimReconciliations, pending } = claimReconciliationTally(ledger);
|
|
@@ -12166,10 +12166,10 @@ function qualityCheckReconciliationTotals(ledger) {
|
|
|
12166
12166
|
};
|
|
12167
12167
|
const missing = /* @__PURE__ */ new Map();
|
|
12168
12168
|
for (const s of ledger.claimReconciliations) {
|
|
12169
|
-
for (const
|
|
12170
|
-
byOutcome[
|
|
12171
|
-
if (
|
|
12172
|
-
missing.set(
|
|
12169
|
+
for (const line of s.qualityCheckReconciliations.flatMap(linesOf)) {
|
|
12170
|
+
byOutcome[line.outcome]++;
|
|
12171
|
+
if (line.outcome === "missing" && line.qualityCheck) {
|
|
12172
|
+
missing.set(line.qualityCheck, (missing.get(line.qualityCheck) ?? 0) + 1);
|
|
12173
12173
|
}
|
|
12174
12174
|
}
|
|
12175
12175
|
}
|
|
@@ -12184,7 +12184,7 @@ function qualityCheckReconciliationTotals(ledger) {
|
|
|
12184
12184
|
function fitnessTally(ledger) {
|
|
12185
12185
|
const fitness = fitnessReconciliationsOf(ledger);
|
|
12186
12186
|
return {
|
|
12187
|
-
satisfied: fitness.filter(({ reconciliation }) => reconciliation
|
|
12187
|
+
satisfied: fitness.filter(({ reconciliation }) => isSatisfied(reconciliation)).length,
|
|
12188
12188
|
total: fitness.length
|
|
12189
12189
|
};
|
|
12190
12190
|
}
|
|
@@ -12199,7 +12199,7 @@ function behaviouralObservationTally(ledger) {
|
|
|
12199
12199
|
let onPhantomClaim = 0;
|
|
12200
12200
|
let onUnnamedClaim = 0;
|
|
12201
12201
|
for (const row of ledger.claimReconciliations) {
|
|
12202
|
-
for (const observation of row
|
|
12202
|
+
for (const observation of observationsOf(row)) {
|
|
12203
12203
|
if (observation.qualityCheck === "fitness")
|
|
12204
12204
|
continue;
|
|
12205
12205
|
rawByBehaviouralQualityCheck[observation.qualityCheck]++;
|
|
@@ -12218,7 +12218,7 @@ function fitnessFunctionTally(ledger) {
|
|
|
12218
12218
|
let runningFitnessFunctionCount = 0;
|
|
12219
12219
|
let uncitedFitnessFunctionCount = 0;
|
|
12220
12220
|
for (const row of ledger.claimReconciliations) {
|
|
12221
|
-
for (const observation of row
|
|
12221
|
+
for (const observation of observationsOf(row)) {
|
|
12222
12222
|
if (observation.qualityCheck !== "fitness")
|
|
12223
12223
|
continue;
|
|
12224
12224
|
if (observation.broken === true)
|
|
@@ -12243,10 +12243,12 @@ var init_ledger = __esm({
|
|
|
12243
12243
|
});
|
|
12244
12244
|
|
|
12245
12245
|
// ../core/dist/domain/posting.js
|
|
12246
|
-
function postingOf(observation, scenarioIds) {
|
|
12246
|
+
function postingOf(observation, scenarioIds, sharedScnCodes = /* @__PURE__ */ new Set()) {
|
|
12247
12247
|
const scnId = observation.scnId ?? null;
|
|
12248
|
-
if (scnId === null) {
|
|
12249
|
-
|
|
12248
|
+
if (scnId === null || sharedScnCodes.has(scnId)) {
|
|
12249
|
+
if (observation.broken === true)
|
|
12250
|
+
return { kind: "unnamed-claim", posted: "broken" };
|
|
12251
|
+
return { kind: "unnamed-claim", posted: scnId === null ? "cites-nothing" : "cites-shared-code" };
|
|
12250
12252
|
}
|
|
12251
12253
|
return scenarioIds.has(scnId) ? { kind: "scenario", scnId } : { kind: "phantom-claim", scnId };
|
|
12252
12254
|
}
|
|
@@ -12301,23 +12303,22 @@ function citationIndex() {
|
|
|
12301
12303
|
phantomClaimIds
|
|
12302
12304
|
};
|
|
12303
12305
|
}
|
|
12304
|
-
function
|
|
12306
|
+
function namingSharedCode(observation, code) {
|
|
12307
|
+
return { ...observation, notes: [...observation.notes ?? [], { kind: "shared-scn-code", code }] };
|
|
12308
|
+
}
|
|
12309
|
+
function routeObservations(evidenceObservations, scenarioIds, sharedScnCodes) {
|
|
12305
12310
|
const citations = citationIndex();
|
|
12306
|
-
const
|
|
12307
|
-
const uncited = [];
|
|
12308
|
-
const uncitedFitnessFunctions = [];
|
|
12311
|
+
const onUnnamedClaim = [];
|
|
12309
12312
|
for (const o of evidenceObservations) {
|
|
12310
|
-
const posting = postingOf(o, scenarioIds);
|
|
12313
|
+
const posting = postingOf(o, scenarioIds, sharedScnCodes);
|
|
12311
12314
|
if (posting.kind !== "unnamed-claim")
|
|
12312
12315
|
citations.file(posting, o);
|
|
12313
|
-
else if (
|
|
12314
|
-
|
|
12315
|
-
else if (isFitnessObservation(o))
|
|
12316
|
-
uncitedFitnessFunctions.push(o);
|
|
12316
|
+
else if (o.scnId !== null && o.scnId !== void 0 && sharedScnCodes.has(o.scnId))
|
|
12317
|
+
onUnnamedClaim.push(namingSharedCode(o, o.scnId));
|
|
12317
12318
|
else
|
|
12318
|
-
|
|
12319
|
+
onUnnamedClaim.push(o);
|
|
12319
12320
|
}
|
|
12320
|
-
return { citations,
|
|
12321
|
+
return { citations, onUnnamedClaim };
|
|
12321
12322
|
}
|
|
12322
12323
|
function scenarioRow(d, evidenceObservations, citations, evidenceObligationPairs) {
|
|
12323
12324
|
const pendingItems = pendingItemsOf(d);
|
|
@@ -12325,16 +12326,16 @@ function scenarioRow(d, evidenceObservations, citations, evidenceObligationPairs
|
|
|
12325
12326
|
const noEvidenceObligationItems = noEvidenceObligationReconciliationsOf(d.scnId, citations.observationsFor(d.scnId), evidenceObligationPairs);
|
|
12326
12327
|
const qualityCheckReconciliations = qualityCheckReconciliationsOf(reconciledEvidenceObligations, noEvidenceObligationItems, pendingItems);
|
|
12327
12328
|
return {
|
|
12328
|
-
|
|
12329
|
+
claim: d.scnId,
|
|
12329
12330
|
kind: "scenario",
|
|
12330
12331
|
verdict: verdictFor(qualityCheckReconciliations),
|
|
12331
|
-
evidenceObservations: citations.observationsFor(d.scnId),
|
|
12332
|
-
evidenceObligations: [...d.evidenceObligations],
|
|
12333
12332
|
qualityCheckReconciliations,
|
|
12334
|
-
reconcilingItems: reconcilingItemsOf(qualityCheckReconciliations),
|
|
12335
12333
|
pendingItems
|
|
12336
12334
|
};
|
|
12337
12335
|
}
|
|
12336
|
+
function scenarioNameOf({ feature, title }) {
|
|
12337
|
+
return feature === void 0 || title === void 0 ? void 0 : { feature, title };
|
|
12338
|
+
}
|
|
12338
12339
|
function accountsByCode(scenarios) {
|
|
12339
12340
|
const byCode = /* @__PURE__ */ new Map();
|
|
12340
12341
|
for (const scenario of scenarios) {
|
|
@@ -12344,21 +12345,13 @@ function accountsByCode(scenarios) {
|
|
|
12344
12345
|
}
|
|
12345
12346
|
return [...byCode.values()];
|
|
12346
12347
|
}
|
|
12347
|
-
function duplicateScnCodeRow(
|
|
12348
|
-
const
|
|
12349
|
-
const evidenceObligations2 = sharers.flatMap((s) => s.evidenceObligations);
|
|
12350
|
-
const items = [
|
|
12351
|
-
...duplicateScnCodeReconciliationsOf(evidenceObligations2),
|
|
12352
|
-
...brokenReconciliationsOf(citations.observationsFor(scnId))
|
|
12353
|
-
];
|
|
12348
|
+
function duplicateScnCodeRow(sharer) {
|
|
12349
|
+
const items = duplicateScnCodeReconciliationsOf(sharer.evidenceObligations, scenarioNameOf(sharer));
|
|
12354
12350
|
return {
|
|
12355
|
-
scnId,
|
|
12351
|
+
claim: sharer.scnId,
|
|
12356
12352
|
kind: "scenario",
|
|
12357
12353
|
verdict: verdictFor(items),
|
|
12358
|
-
evidenceObservations: citations.observationsFor(scnId),
|
|
12359
|
-
evidenceObligations: evidenceObligations2,
|
|
12360
12354
|
qualityCheckReconciliations: items,
|
|
12361
|
-
reconcilingItems: reconcilingItemsOf(items),
|
|
12362
12355
|
pendingItems: []
|
|
12363
12356
|
};
|
|
12364
12357
|
}
|
|
@@ -12368,30 +12361,24 @@ function phantomClaimRows(citations) {
|
|
|
12368
12361
|
const observations = citations.observationsFor(scnId);
|
|
12369
12362
|
const items = citesUnknownScenarioReconciliationsOf(observations);
|
|
12370
12363
|
rows.push({
|
|
12371
|
-
scnId,
|
|
12364
|
+
claim: scnId,
|
|
12372
12365
|
kind: "phantom-claim",
|
|
12373
12366
|
verdict: verdictFor(items),
|
|
12374
|
-
evidenceObservations: [...observations],
|
|
12375
|
-
evidenceObligations: [],
|
|
12376
12367
|
qualityCheckReconciliations: items,
|
|
12377
|
-
reconcilingItems: items,
|
|
12378
12368
|
pendingItems: []
|
|
12379
12369
|
});
|
|
12380
12370
|
}
|
|
12381
12371
|
return rows;
|
|
12382
12372
|
}
|
|
12383
|
-
function unnamedClaimRows(
|
|
12373
|
+
function unnamedClaimRows({ onUnnamedClaim }) {
|
|
12384
12374
|
const rows = [];
|
|
12385
|
-
if (
|
|
12386
|
-
const items = unnamedClaimReconciliationsOf(
|
|
12375
|
+
if (onUnnamedClaim.length > 0) {
|
|
12376
|
+
const items = unnamedClaimReconciliationsOf(onUnnamedClaim);
|
|
12387
12377
|
rows.push({
|
|
12388
|
-
|
|
12378
|
+
claim: UNNAMED_CLAIM_ID,
|
|
12389
12379
|
kind: "unnamed-claim",
|
|
12390
12380
|
verdict: verdictFor(items),
|
|
12391
|
-
evidenceObservations: [...brokenEvidence, ...uncited, ...uncitedFitnessFunctions],
|
|
12392
|
-
evidenceObligations: [],
|
|
12393
12381
|
qualityCheckReconciliations: items,
|
|
12394
|
-
reconcilingItems: items,
|
|
12395
12382
|
pendingItems: []
|
|
12396
12383
|
});
|
|
12397
12384
|
}
|
|
@@ -12402,13 +12389,10 @@ function untaggedScenarioRows(untaggedScenarios) {
|
|
|
12402
12389
|
for (const name of untaggedScenarios) {
|
|
12403
12390
|
const items = noScnCodeReconciliations();
|
|
12404
12391
|
rows.push({
|
|
12405
|
-
|
|
12392
|
+
claim: name,
|
|
12406
12393
|
kind: "scenario",
|
|
12407
12394
|
verdict: verdictFor(items),
|
|
12408
|
-
evidenceObservations: [],
|
|
12409
|
-
evidenceObligations: [],
|
|
12410
12395
|
qualityCheckReconciliations: items,
|
|
12411
|
-
reconcilingItems: items,
|
|
12412
12396
|
pendingItems: []
|
|
12413
12397
|
});
|
|
12414
12398
|
}
|
|
@@ -12418,12 +12402,14 @@ function reconcile(scenarios, evidenceObservations, untaggedScenarios = []) {
|
|
|
12418
12402
|
const scenarioIds = new Set(scenarios.map((d) => d.scnId));
|
|
12419
12403
|
const evidenceObligationPairs = evidenceObligationPairsOf(scenarios);
|
|
12420
12404
|
const observations = inEvidenceOrder(evidenceObservations);
|
|
12421
|
-
const
|
|
12405
|
+
const accounts = accountsByCode(scenarios);
|
|
12406
|
+
const sharedScnCodes = new Set(accounts.filter((sharers) => sharers.length > 1).map((sharers) => sharers[0].scnId));
|
|
12407
|
+
const { citations, ...unnamed } = routeObservations(observations, scenarioIds, sharedScnCodes);
|
|
12422
12408
|
return {
|
|
12423
12409
|
claimReconciliations: [
|
|
12424
|
-
...
|
|
12410
|
+
...accounts.flatMap((sharers) => sharers.length === 1 ? [scenarioRow(sharers[0], observations, citations, evidenceObligationPairs)] : sharers.map(duplicateScnCodeRow)),
|
|
12425
12411
|
...phantomClaimRows(citations),
|
|
12426
|
-
...unnamedClaimRows(
|
|
12412
|
+
...unnamedClaimRows(unnamed),
|
|
12427
12413
|
...untaggedScenarioRows(untaggedScenarios)
|
|
12428
12414
|
]
|
|
12429
12415
|
};
|
|
@@ -12462,7 +12448,6 @@ var init_evidenceReconciliation = __esm({
|
|
|
12462
12448
|
init_claimReconciliation();
|
|
12463
12449
|
init_posting();
|
|
12464
12450
|
init_evidenceOrder();
|
|
12465
|
-
init_journal();
|
|
12466
12451
|
}
|
|
12467
12452
|
});
|
|
12468
12453
|
|
|
@@ -12602,12 +12587,12 @@ var init_vitest = __esm({
|
|
|
12602
12587
|
|
|
12603
12588
|
// ../core/dist/parse/pytest.js
|
|
12604
12589
|
function parseJunitEvidenceObservations(report) {
|
|
12605
|
-
return
|
|
12590
|
+
return observationsOf2(report, "failed");
|
|
12606
12591
|
}
|
|
12607
12592
|
function parsePytestEvidenceObservations(report) {
|
|
12608
|
-
return
|
|
12593
|
+
return observationsOf2(report, "never-reached-its-assertions");
|
|
12609
12594
|
}
|
|
12610
|
-
function
|
|
12595
|
+
function observationsOf2(report, errorResult) {
|
|
12611
12596
|
const qualityCheck = fallbackQualityCheckOf("test-results");
|
|
12612
12597
|
return (report.testsuites?.testsuite ?? []).flatMap((suite) => (suite.testcase ?? []).flatMap((testcase) => {
|
|
12613
12598
|
const evidence = evidenceOfRunResult(runResultOf2(testcase, errorResult));
|
|
@@ -12732,7 +12717,7 @@ function parseRspecEvidenceObservations(report, root) {
|
|
|
12732
12717
|
qualityCheck,
|
|
12733
12718
|
scnId,
|
|
12734
12719
|
status: evidence.status,
|
|
12735
|
-
locator: example.file_path &&
|
|
12720
|
+
locator: example.file_path && locatorOf(example.file_path, root),
|
|
12736
12721
|
testName: example.full_description,
|
|
12737
12722
|
...severalCodes ? { notes: [{ kind: "several-scn-codes", codes: severalCodes }] } : {}
|
|
12738
12723
|
});
|
|
@@ -12752,14 +12737,14 @@ function loadErrorsOf(report, qualityCheck, root) {
|
|
|
12752
12737
|
if (path === void 0)
|
|
12753
12738
|
unnamed.push(message);
|
|
12754
12739
|
else
|
|
12755
|
-
broken.push({ qualityCheck, scnId: null, status: evidence.status, locator:
|
|
12740
|
+
broken.push({ qualityCheck, scnId: null, status: evidence.status, locator: locatorOf(path, root), broken: evidence.broken, message });
|
|
12756
12741
|
}
|
|
12757
12742
|
if (count > broken.length) {
|
|
12758
12743
|
broken.push({ qualityCheck, scnId: null, status: evidence.status, broken: evidence.broken, message: unnamed.length > 0 ? unnamed.join("\n") : void 0 });
|
|
12759
12744
|
}
|
|
12760
12745
|
return broken;
|
|
12761
12746
|
}
|
|
12762
|
-
function
|
|
12747
|
+
function locatorOf(filePath, root) {
|
|
12763
12748
|
return relativizeToRoot(filePath.replace(/^\.\//, ""), root);
|
|
12764
12749
|
}
|
|
12765
12750
|
function citingCodesOf3(example) {
|
|
@@ -27587,7 +27572,8 @@ function reconcilerSteps(steps, nameOf2, runsTheReconciler) {
|
|
|
27587
27572
|
const role = reconcilerRoleOf(step, runsTheReconciler);
|
|
27588
27573
|
return role === void 0 ? [] : [{ step: nameOf2(step), role }];
|
|
27589
27574
|
}),
|
|
27590
|
-
isReconciler: (step) => reconcilerRoleOf(step, runsTheReconciler) !== void 0
|
|
27575
|
+
isReconciler: (step) => reconcilerRoleOf(step, runsTheReconciler) !== void 0,
|
|
27576
|
+
roleOf: (step) => reconcilerRoleOf(step, runsTheReconciler)
|
|
27591
27577
|
};
|
|
27592
27578
|
}
|
|
27593
27579
|
function nonChecksApplied(steps, nameOf2, nonChecks) {
|
|
@@ -27615,34 +27601,57 @@ function dispositionOfIncluded(step, runsARunner) {
|
|
|
27615
27601
|
function stepDispositions({ isReconciler, isNamedANonCheck, runsARunner }) {
|
|
27616
27602
|
return (step) => exclusionOf(step, isReconciler, isNamedANonCheck) ?? dispositionOfIncluded(step, runsARunner);
|
|
27617
27603
|
}
|
|
27618
|
-
function
|
|
27619
|
-
|
|
27620
|
-
|
|
27621
|
-
|
|
27622
|
-
const
|
|
27623
|
-
const
|
|
27624
|
-
const
|
|
27604
|
+
function everyStepAccountedFor({ stepsRead, accountedFor }) {
|
|
27605
|
+
return accountedFor === stepsRead;
|
|
27606
|
+
}
|
|
27607
|
+
function totalOf(rows) {
|
|
27608
|
+
const summed = (count) => rows.reduce((sum, row) => sum + row[count], 0);
|
|
27609
|
+
const candidates = summed("candidates");
|
|
27610
|
+
const runners = summed("runners");
|
|
27611
|
+
const reconciler = summed("reconciler");
|
|
27612
|
+
const excluded = summed("excluded");
|
|
27613
|
+
const plumbing = summed("plumbing");
|
|
27625
27614
|
return {
|
|
27626
|
-
stepsRead:
|
|
27615
|
+
stepsRead: summed("stepsRead"),
|
|
27627
27616
|
candidates,
|
|
27628
27617
|
runners,
|
|
27629
27618
|
reconciler,
|
|
27630
27619
|
excluded,
|
|
27631
27620
|
plumbing,
|
|
27632
|
-
accountedFor:
|
|
27621
|
+
accountedFor: candidates + runners + reconciler + excluded + plumbing
|
|
27633
27622
|
};
|
|
27634
27623
|
}
|
|
27635
|
-
function
|
|
27636
|
-
|
|
27624
|
+
function stepsBehindCounts(steps, dispositionOf, nameOf2, roleOf) {
|
|
27625
|
+
const reconciler = steps.filter((step) => dispositionOf(step) === "reconciler").flatMap((step) => {
|
|
27626
|
+
const role = roleOf(step);
|
|
27627
|
+
return role === void 0 ? [] : [{ step: nameOf2(step), role }];
|
|
27628
|
+
});
|
|
27629
|
+
const namesOf = (disposition) => steps.filter((step) => dispositionOf(step) === disposition).map(nameOf2);
|
|
27630
|
+
const runners = namesOf("runner");
|
|
27631
|
+
const excluded = namesOf("nonCheck");
|
|
27632
|
+
const plumbing = namesOf("plumbing");
|
|
27633
|
+
return {
|
|
27634
|
+
...runners.length > 0 ? { runners } : {},
|
|
27635
|
+
...reconciler.length > 0 ? { reconciler } : {},
|
|
27636
|
+
...excluded.length > 0 ? { excluded } : {},
|
|
27637
|
+
...plumbing.length > 0 ? { plumbing } : {}
|
|
27638
|
+
};
|
|
27637
27639
|
}
|
|
27638
|
-
function
|
|
27639
|
-
const
|
|
27640
|
+
function stepAccountOf(steps, dispositionOf, nameOf2, roleOf) {
|
|
27641
|
+
const rows = /* @__PURE__ */ new Map();
|
|
27640
27642
|
for (const step of steps) {
|
|
27641
|
-
const
|
|
27642
|
-
const
|
|
27643
|
-
|
|
27643
|
+
const row = rows.get(jobKeyOf(step)) ?? noStepsOf(step);
|
|
27644
|
+
const count = COUNTED_AS[dispositionOf(step)];
|
|
27645
|
+
rows.set(jobKeyOf(step), { ...row, stepsRead: row.stepsRead + 1, [count]: row[count] + 1 });
|
|
27644
27646
|
}
|
|
27645
|
-
|
|
27647
|
+
const byJob = [...rows.values()].sort((a, b) => a.workflow.localeCompare(b.workflow) || a.job.localeCompare(b.job));
|
|
27648
|
+
const total = totalOf(byJob);
|
|
27649
|
+
return {
|
|
27650
|
+
byJob,
|
|
27651
|
+
total,
|
|
27652
|
+
everyStepAccountedFor: everyStepAccountedFor(total),
|
|
27653
|
+
steps: stepsBehindCounts(steps, dispositionOf, nameOf2, roleOf)
|
|
27654
|
+
};
|
|
27646
27655
|
}
|
|
27647
27656
|
function declaredRunnersRunBy(scripts, runners, shell) {
|
|
27648
27657
|
return (step) => {
|
|
@@ -27663,11 +27672,28 @@ function recognisedRunners(steps, scripts, runners, shell) {
|
|
|
27663
27672
|
step: step.identity
|
|
27664
27673
|
})));
|
|
27665
27674
|
}
|
|
27666
|
-
var jobKeyOf;
|
|
27675
|
+
var jobKeyOf, COUNTED_AS, noStepsOf;
|
|
27667
27676
|
var init_uncitedFitnessFunctions = __esm({
|
|
27668
27677
|
"../core/dist/domain/uncitedFitnessFunctions.js"() {
|
|
27669
27678
|
"use strict";
|
|
27670
27679
|
jobKeyOf = (step) => `${step.workflow}:${step.job}`;
|
|
27680
|
+
COUNTED_AS = {
|
|
27681
|
+
candidate: "candidates",
|
|
27682
|
+
runner: "runners",
|
|
27683
|
+
reconciler: "reconciler",
|
|
27684
|
+
nonCheck: "excluded",
|
|
27685
|
+
plumbing: "plumbing"
|
|
27686
|
+
};
|
|
27687
|
+
noStepsOf = ({ workflow, job }) => ({
|
|
27688
|
+
workflow,
|
|
27689
|
+
job,
|
|
27690
|
+
stepsRead: 0,
|
|
27691
|
+
candidates: 0,
|
|
27692
|
+
runners: 0,
|
|
27693
|
+
reconciler: 0,
|
|
27694
|
+
excluded: 0,
|
|
27695
|
+
plumbing: 0
|
|
27696
|
+
});
|
|
27671
27697
|
}
|
|
27672
27698
|
});
|
|
27673
27699
|
|
|
@@ -27839,12 +27865,8 @@ var init_runVerdict = __esm({
|
|
|
27839
27865
|
});
|
|
27840
27866
|
|
|
27841
27867
|
// ../core/dist/assemble/renderInput.js
|
|
27842
|
-
function concludedSummary(
|
|
27843
|
-
return {
|
|
27844
|
-
...summary,
|
|
27845
|
-
...stepAccounting2 ? { stepAccounting: { ...stepAccounting2, everyStepAccountedFor: everyStepAccountedFor(stepAccounting2) } } : {},
|
|
27846
|
-
runVerdict: runVerdict(verdictInputs)
|
|
27847
|
-
};
|
|
27868
|
+
function concludedSummary(summary, verdictInputs) {
|
|
27869
|
+
return { ...summary, runVerdict: runVerdict(verdictInputs) };
|
|
27848
27870
|
}
|
|
27849
27871
|
function assembleRenderInput(evidenceReconciliation, ctx, evidenceObligations2, featureNames) {
|
|
27850
27872
|
const errors = errorsOf(evidenceReconciliation.scenarioCodeErrors, evidenceReconciliation.summary);
|
|
@@ -27868,7 +27890,6 @@ var init_renderInput2 = __esm({
|
|
|
27868
27890
|
init_provenance();
|
|
27869
27891
|
init_renderInput();
|
|
27870
27892
|
init_runVerdict();
|
|
27871
|
-
init_uncitedFitnessFunctions();
|
|
27872
27893
|
}
|
|
27873
27894
|
});
|
|
27874
27895
|
|
|
@@ -27918,7 +27939,7 @@ var init_fitnessCitations = __esm({
|
|
|
27918
27939
|
// ../core/dist/parse/targetCorpus.js
|
|
27919
27940
|
function readTargetCorpus(features, deferralTags) {
|
|
27920
27941
|
return {
|
|
27921
|
-
scenarios: features.flatMap((feature) =>
|
|
27942
|
+
scenarios: features.flatMap((feature) => namedScenariosOf(feature, deferralTags)),
|
|
27922
27943
|
citedRow: (citedScn) => citationOfCitedRow(citedScn)
|
|
27923
27944
|
};
|
|
27924
27945
|
}
|
|
@@ -28109,40 +28130,25 @@ function withScenarioCodeErrors(reconciliation, input) {
|
|
|
28109
28130
|
};
|
|
28110
28131
|
}
|
|
28111
28132
|
function withReaderAccounts(reconciliation, steps, packageJson, runners, exclusions, reconciler, dispositionOf) {
|
|
28112
|
-
return withStepAccounting(
|
|
28133
|
+
return withStepAccounting(withUnmatchedNonChecks(withRunnerAccount(reconciliation, steps, packageJson, runners), exclusions), steps, dispositionOf, reconciler.roleOf);
|
|
28113
28134
|
}
|
|
28114
|
-
function withStepAccounting(reconciliation, steps, dispositionOf) {
|
|
28115
|
-
|
|
28116
|
-
if (accounting.stepsRead === 0)
|
|
28135
|
+
function withStepAccounting(reconciliation, steps, dispositionOf, roleOf) {
|
|
28136
|
+
if (steps.length === 0)
|
|
28117
28137
|
return reconciliation;
|
|
28118
28138
|
return {
|
|
28119
28139
|
...reconciliation,
|
|
28120
|
-
summary: {
|
|
28140
|
+
summary: {
|
|
28141
|
+
...reconciliation.summary,
|
|
28142
|
+
stepAccounting: stepAccountOf(steps, dispositionOf, qualifiedStepName, roleOf)
|
|
28143
|
+
}
|
|
28121
28144
|
};
|
|
28122
28145
|
}
|
|
28123
|
-
function
|
|
28124
|
-
|
|
28125
|
-
if (scope.length === 0)
|
|
28126
|
-
return reconciliation;
|
|
28127
|
-
return { ...reconciliation, summary: { ...reconciliation.summary, discoveryScope: scope } };
|
|
28128
|
-
}
|
|
28129
|
-
function withReconcilerAccount(reconciliation, reconciler) {
|
|
28130
|
-
if (reconciler.steps.length === 0)
|
|
28146
|
+
function withUnmatchedNonChecks(reconciliation, { unmatchedEntries }) {
|
|
28147
|
+
if (unmatchedEntries.length === 0)
|
|
28131
28148
|
return reconciliation;
|
|
28132
28149
|
return {
|
|
28133
28150
|
...reconciliation,
|
|
28134
|
-
summary: { ...reconciliation.summary,
|
|
28135
|
-
};
|
|
28136
|
-
}
|
|
28137
|
-
function withExclusionAccount(reconciliation, exclusions) {
|
|
28138
|
-
const { excluded, unmatchedEntries } = exclusions;
|
|
28139
|
-
return {
|
|
28140
|
-
...reconciliation,
|
|
28141
|
-
summary: {
|
|
28142
|
-
...reconciliation.summary,
|
|
28143
|
-
...excluded.length > 0 ? { excludedSteps: excluded } : {},
|
|
28144
|
-
...unmatchedEntries.length > 0 ? { nonChecksMatchingNoStep: unmatchedEntries } : {}
|
|
28145
|
-
}
|
|
28151
|
+
summary: { ...reconciliation.summary, nonChecksMatchingNoStep: unmatchedEntries }
|
|
28146
28152
|
};
|
|
28147
28153
|
}
|
|
28148
28154
|
function withRunnerAccount(reconciliation, steps, packageJson, { tiers: runnerTiers, tiersWithoutRunner, unrecognisedKeys }) {
|
|
@@ -28185,7 +28191,11 @@ function assembleSavedReport(saved, strictGiven) {
|
|
|
28185
28191
|
return {
|
|
28186
28192
|
...saved,
|
|
28187
28193
|
runProvenance: { ...saved.runProvenance, strict },
|
|
28188
|
-
summary: concludedSummary(saved.summary, {
|
|
28194
|
+
summary: concludedSummary(saved.summary, {
|
|
28195
|
+
ledger: saved.ledger,
|
|
28196
|
+
scenarioCodeErrors: saved.errors?.scenarioCodes,
|
|
28197
|
+
strict
|
|
28198
|
+
})
|
|
28189
28199
|
};
|
|
28190
28200
|
}
|
|
28191
28201
|
var init_savedReport = __esm({
|
|
@@ -28335,40 +28345,42 @@ var init_messages4 = __esm({
|
|
|
28335
28345
|
CoreMessage2[CoreMessage2["ExcludedScnOccurrences"] = 115] = "ExcludedScnOccurrences";
|
|
28336
28346
|
CoreMessage2[CoreMessage2["UntaggedScenarios"] = 116] = "UntaggedScenarios";
|
|
28337
28347
|
CoreMessage2[CoreMessage2["SharedScnCodes"] = 117] = "SharedScnCodes";
|
|
28338
|
-
CoreMessage2[CoreMessage2["
|
|
28339
|
-
CoreMessage2[CoreMessage2["
|
|
28340
|
-
CoreMessage2[CoreMessage2["
|
|
28341
|
-
CoreMessage2[CoreMessage2["
|
|
28342
|
-
CoreMessage2[CoreMessage2["
|
|
28343
|
-
CoreMessage2[CoreMessage2["
|
|
28344
|
-
CoreMessage2[CoreMessage2["
|
|
28345
|
-
CoreMessage2[CoreMessage2["
|
|
28346
|
-
CoreMessage2[CoreMessage2["
|
|
28347
|
-
CoreMessage2[CoreMessage2["
|
|
28348
|
-
CoreMessage2[CoreMessage2["
|
|
28349
|
-
CoreMessage2[CoreMessage2["
|
|
28350
|
-
CoreMessage2[CoreMessage2["
|
|
28351
|
-
CoreMessage2[CoreMessage2["
|
|
28352
|
-
CoreMessage2[CoreMessage2["
|
|
28353
|
-
CoreMessage2[CoreMessage2["
|
|
28354
|
-
CoreMessage2[CoreMessage2["
|
|
28355
|
-
CoreMessage2[CoreMessage2["
|
|
28356
|
-
CoreMessage2[CoreMessage2["
|
|
28357
|
-
CoreMessage2[CoreMessage2["
|
|
28358
|
-
CoreMessage2[CoreMessage2["
|
|
28359
|
-
CoreMessage2[CoreMessage2["
|
|
28360
|
-
CoreMessage2[CoreMessage2["
|
|
28361
|
-
CoreMessage2[CoreMessage2["
|
|
28362
|
-
CoreMessage2[CoreMessage2["
|
|
28363
|
-
CoreMessage2[CoreMessage2["
|
|
28364
|
-
CoreMessage2[CoreMessage2["
|
|
28365
|
-
CoreMessage2[CoreMessage2["
|
|
28366
|
-
CoreMessage2[CoreMessage2["
|
|
28367
|
-
CoreMessage2[CoreMessage2["
|
|
28368
|
-
CoreMessage2[CoreMessage2["
|
|
28369
|
-
CoreMessage2[CoreMessage2["
|
|
28370
|
-
CoreMessage2[CoreMessage2["
|
|
28371
|
-
CoreMessage2[CoreMessage2["
|
|
28348
|
+
CoreMessage2[CoreMessage2["SharedScnCodeScenario"] = 118] = "SharedScnCodeScenario";
|
|
28349
|
+
CoreMessage2[CoreMessage2["LedgerTableHeader"] = 119] = "LedgerTableHeader";
|
|
28350
|
+
CoreMessage2[CoreMessage2["ClaimColumn"] = 120] = "ClaimColumn";
|
|
28351
|
+
CoreMessage2[CoreMessage2["VerdictColumn"] = 121] = "VerdictColumn";
|
|
28352
|
+
CoreMessage2[CoreMessage2["ReconcilingItemsColumn"] = 122] = "ReconcilingItemsColumn";
|
|
28353
|
+
CoreMessage2[CoreMessage2["EvidenceCellKey"] = 123] = "EvidenceCellKey";
|
|
28354
|
+
CoreMessage2[CoreMessage2["PendingItem"] = 124] = "PendingItem";
|
|
28355
|
+
CoreMessage2[CoreMessage2["PendingItemFor"] = 125] = "PendingItemFor";
|
|
28356
|
+
CoreMessage2[CoreMessage2["CheckStepNoOutcome"] = 126] = "CheckStepNoOutcome";
|
|
28357
|
+
CoreMessage2[CoreMessage2["CheckStepSkipped"] = 127] = "CheckStepSkipped";
|
|
28358
|
+
CoreMessage2[CoreMessage2["CheckStepEnded"] = 128] = "CheckStepEnded";
|
|
28359
|
+
CoreMessage2[CoreMessage2["AmbiguousNamedStep"] = 129] = "AmbiguousNamedStep";
|
|
28360
|
+
CoreMessage2[CoreMessage2["AmbiguousUnnamedStep"] = 130] = "AmbiguousUnnamedStep";
|
|
28361
|
+
CoreMessage2[CoreMessage2["ManifestKindList"] = 131] = "ManifestKindList";
|
|
28362
|
+
CoreMessage2[CoreMessage2["ManifestKindObject"] = 132] = "ManifestKindObject";
|
|
28363
|
+
CoreMessage2[CoreMessage2["ManifestKindString"] = 133] = "ManifestKindString";
|
|
28364
|
+
CoreMessage2[CoreMessage2["ManifestKindStringOrNull"] = 134] = "ManifestKindStringOrNull";
|
|
28365
|
+
CoreMessage2[CoreMessage2["ManifestKindOfType"] = 135] = "ManifestKindOfType";
|
|
28366
|
+
CoreMessage2[CoreMessage2["OutcomeSatisfied"] = 136] = "OutcomeSatisfied";
|
|
28367
|
+
CoreMessage2[CoreMessage2["OutcomeMissing"] = 137] = "OutcomeMissing";
|
|
28368
|
+
CoreMessage2[CoreMessage2["OutcomeFailing"] = 138] = "OutcomeFailing";
|
|
28369
|
+
CoreMessage2[CoreMessage2["OutcomeWatermelon"] = 139] = "OutcomeWatermelon";
|
|
28370
|
+
CoreMessage2[CoreMessage2["OutcomeNoScnCode"] = 140] = "OutcomeNoScnCode";
|
|
28371
|
+
CoreMessage2[CoreMessage2["OutcomeDuplicateScnCode"] = 141] = "OutcomeDuplicateScnCode";
|
|
28372
|
+
CoreMessage2[CoreMessage2["OutcomeCitesUnknownScenario"] = 142] = "OutcomeCitesUnknownScenario";
|
|
28373
|
+
CoreMessage2[CoreMessage2["OutcomeCitesNoScenario"] = 143] = "OutcomeCitesNoScenario";
|
|
28374
|
+
CoreMessage2[CoreMessage2["OutcomeNoEvidenceObligation"] = 144] = "OutcomeNoEvidenceObligation";
|
|
28375
|
+
CoreMessage2[CoreMessage2["OutcomeBroken"] = 145] = "OutcomeBroken";
|
|
28376
|
+
CoreMessage2[CoreMessage2["OutcomeBothMissing"] = 146] = "OutcomeBothMissing";
|
|
28377
|
+
CoreMessage2[CoreMessage2["ObservationPassed"] = 147] = "ObservationPassed";
|
|
28378
|
+
CoreMessage2[CoreMessage2["ObservationFailed"] = 148] = "ObservationFailed";
|
|
28379
|
+
CoreMessage2[CoreMessage2["UnnamedClaimGroupCounts"] = 149] = "UnnamedClaimGroupCounts";
|
|
28380
|
+
CoreMessage2[CoreMessage2["UnnamedClaimCiSteps"] = 150] = "UnnamedClaimCiSteps";
|
|
28381
|
+
CoreMessage2[CoreMessage2["UnnamedClaimFailedNames"] = 151] = "UnnamedClaimFailedNames";
|
|
28382
|
+
CoreMessage2[CoreMessage2["SeveralScnCodes"] = 152] = "SeveralScnCodes";
|
|
28383
|
+
CoreMessage2[CoreMessage2["SharedScnCode"] = 153] = "SharedScnCode";
|
|
28372
28384
|
})(CoreMessage || (CoreMessage = {}));
|
|
28373
28385
|
SATISFIED = "Evidence Observation satisfies its Evidence Obligation";
|
|
28374
28386
|
MISSING = "Evidence Observation is missing";
|
|
@@ -28498,6 +28510,7 @@ var init_messages4 = __esm({
|
|
|
28498
28510
|
[CoreMessage.ExcludedScnOccurrences]: (count) => `${count} @SCN ids seen in non-tag context, excluded`,
|
|
28499
28511
|
[CoreMessage.UntaggedScenarios]: (count) => `${count} scenario(s) carry no @SCN tag`,
|
|
28500
28512
|
[CoreMessage.SharedScnCodes]: (scenarios, accounts, codes) => `The corpus holds ${scenarios} scenarios in ${accounts} accounts \u2014 ${codes} @SCN code(s) carried by more than one scenario:`,
|
|
28513
|
+
[CoreMessage.SharedScnCodeScenario]: (feature, title) => `this one is ${feature} : ${title}`,
|
|
28501
28514
|
[CoreMessage.LedgerTableHeader]: "| Claim | Verdict | Reconciling items |",
|
|
28502
28515
|
[CoreMessage.ClaimColumn]: "Claim",
|
|
28503
28516
|
[CoreMessage.VerdictColumn]: "Verdict",
|
|
@@ -28538,7 +28551,8 @@ var init_messages4 = __esm({
|
|
|
28538
28551
|
[CoreMessage.UnnamedClaimGroupCounts]: (ran, passed, failed) => `${ran} ran, ${passed} passed, ${failed} failed`,
|
|
28539
28552
|
[CoreMessage.UnnamedClaimCiSteps]: (names) => `${names.length} CI step${names.length === 1 ? "" : "s"}: ${names.join(", ")}`,
|
|
28540
28553
|
[CoreMessage.UnnamedClaimFailedNames]: (names) => `(failed: ${names.join(" / ")})`,
|
|
28541
|
-
[CoreMessage.SeveralScnCodes]: (codes) => `${codes.length} scenario codes cite ${codes.join(", ")} \u2014 a test cites exactly one scenario, so this one credits none of them
|
|
28554
|
+
[CoreMessage.SeveralScnCodes]: (codes) => `${codes.length} scenario codes cite ${codes.join(", ")} \u2014 a test cites exactly one scenario, so this one credits none of them.`,
|
|
28555
|
+
[CoreMessage.SharedScnCode]: (code) => `${code} is carried by more than one scenario, so this test credits none of them.`
|
|
28542
28556
|
};
|
|
28543
28557
|
}
|
|
28544
28558
|
});
|
|
@@ -28831,15 +28845,15 @@ var init_discoveryScope = __esm({
|
|
|
28831
28845
|
"use strict";
|
|
28832
28846
|
init_messages4();
|
|
28833
28847
|
discoveryScopeSection = (report) => {
|
|
28834
|
-
const
|
|
28835
|
-
if (
|
|
28848
|
+
const rows = report.summary.stepAccounting?.byJob ?? [];
|
|
28849
|
+
if (rows.length === 0)
|
|
28836
28850
|
return [];
|
|
28837
28851
|
return [
|
|
28838
28852
|
CORE_MESSAGES[CoreMessage.DiscoveryScopeHeading],
|
|
28839
28853
|
"",
|
|
28840
28854
|
CORE_MESSAGES[CoreMessage.DiscoveryScopeTableHeader],
|
|
28841
28855
|
"| --- | --- | --- | --- |",
|
|
28842
|
-
...
|
|
28856
|
+
...rows.map(({ workflow, job, stepsRead, candidates }) => `| ${workflow} | ${job} | ${stepsRead} | ${candidates} |`),
|
|
28843
28857
|
""
|
|
28844
28858
|
];
|
|
28845
28859
|
};
|
|
@@ -28904,7 +28918,7 @@ var init_excludedSteps = __esm({
|
|
|
28904
28918
|
"use strict";
|
|
28905
28919
|
init_messages4();
|
|
28906
28920
|
excludedStepsSection = (report) => {
|
|
28907
|
-
const excluded = report.summary.
|
|
28921
|
+
const excluded = report.summary.stepAccounting?.steps.excluded ?? [];
|
|
28908
28922
|
const unmatched = report.errors?.configuration?.nonChecksMatchingNoStep ?? [];
|
|
28909
28923
|
if (excluded.length === 0 && unmatched.length === 0)
|
|
28910
28924
|
return [];
|
|
@@ -28930,7 +28944,7 @@ var init_reconcilerSteps = __esm({
|
|
|
28930
28944
|
records: CORE_MESSAGES[CoreMessage.ReconcilerRecords]
|
|
28931
28945
|
};
|
|
28932
28946
|
reconcilerSection = (report) => {
|
|
28933
|
-
const steps = report.summary.
|
|
28947
|
+
const steps = report.summary.stepAccounting?.steps.reconciler ?? [];
|
|
28934
28948
|
if (steps.length === 0)
|
|
28935
28949
|
return [];
|
|
28936
28950
|
return [
|
|
@@ -28949,12 +28963,12 @@ var init_stepAccounting = __esm({
|
|
|
28949
28963
|
"../core/dist/render/stepAccounting.js"() {
|
|
28950
28964
|
"use strict";
|
|
28951
28965
|
init_messages4();
|
|
28952
|
-
verdictOf = (
|
|
28966
|
+
verdictOf = ({ everyStepAccountedFor: everyStepAccountedFor2, total }) => everyStepAccountedFor2 ? `- ${CORE_MESSAGES[CoreMessage.EveryStepAccountedFor]}` : `- ${CORE_MESSAGES[CoreMessage.StepsNotAccountedFor](total.stepsRead, total.accountedFor)}`;
|
|
28953
28967
|
stepAccountingSection = (report) => {
|
|
28954
28968
|
const accounting = report.summary.stepAccounting;
|
|
28955
28969
|
if (accounting === void 0)
|
|
28956
28970
|
return [];
|
|
28957
|
-
const { stepsRead, candidates, runners, reconciler, excluded, plumbing
|
|
28971
|
+
const { stepsRead, candidates, runners, reconciler, excluded, plumbing, accountedFor } = accounting.total;
|
|
28958
28972
|
return [
|
|
28959
28973
|
CORE_MESSAGES[CoreMessage.StepAccountingHeading],
|
|
28960
28974
|
"",
|
|
@@ -29036,6 +29050,8 @@ function noteWords(note) {
|
|
|
29036
29050
|
switch (note.kind) {
|
|
29037
29051
|
case "several-scn-codes":
|
|
29038
29052
|
return CORE_MESSAGES[CoreMessage.SeveralScnCodes](note.codes);
|
|
29053
|
+
case "shared-scn-code":
|
|
29054
|
+
return CORE_MESSAGES[CoreMessage.SharedScnCode](note.code);
|
|
29039
29055
|
case "ambiguous-step":
|
|
29040
29056
|
return note.step === void 0 ? CORE_MESSAGES[CoreMessage.AmbiguousUnnamedStep] : CORE_MESSAGES[CoreMessage.AmbiguousNamedStep](note.step);
|
|
29041
29057
|
case "check-step-did-not-run":
|
|
@@ -29061,42 +29077,42 @@ var init_remarkWords = __esm({
|
|
|
29061
29077
|
});
|
|
29062
29078
|
|
|
29063
29079
|
// ../core/dist/domain/unnamedClaimGroups.js
|
|
29064
|
-
function
|
|
29065
|
-
return
|
|
29080
|
+
function citingNoScenario(lines) {
|
|
29081
|
+
return lines.filter((line) => line.outcome === "cites-no-scenario").flatMap((line) => line.evidenceObservation ?? []);
|
|
29066
29082
|
}
|
|
29067
|
-
function
|
|
29068
|
-
return
|
|
29083
|
+
function keyOf(observation) {
|
|
29084
|
+
return JSON.stringify([observation.qualityCheck, observation.locator ?? null]);
|
|
29069
29085
|
}
|
|
29070
|
-
function
|
|
29071
|
-
return
|
|
29086
|
+
function remarksOf(observations) {
|
|
29087
|
+
return observations.flatMap(({ message, notes }) => message === void 0 && notes === void 0 ? [] : [{ ...message !== void 0 ? { message } : {}, ...notes !== void 0 ? { notes } : {} }]);
|
|
29072
29088
|
}
|
|
29073
|
-
function
|
|
29074
|
-
|
|
29075
|
-
|
|
29076
|
-
function groupOf(items) {
|
|
29077
|
-
const [first] = items;
|
|
29078
|
-
const passed = items.filter((item) => item.evidenceObservation.status === "passed").length;
|
|
29089
|
+
function groupOf(observations) {
|
|
29090
|
+
const [first] = observations;
|
|
29091
|
+
const passed = observations.filter((o) => o.status === "passed").length;
|
|
29079
29092
|
return {
|
|
29080
|
-
qualityCheck: first.
|
|
29093
|
+
qualityCheck: first.qualityCheck,
|
|
29081
29094
|
locator: first.locator,
|
|
29082
|
-
remarks: remarksOf(
|
|
29083
|
-
ran:
|
|
29095
|
+
remarks: remarksOf(observations),
|
|
29096
|
+
ran: observations.length,
|
|
29084
29097
|
passed,
|
|
29085
|
-
failed:
|
|
29086
|
-
failedNames:
|
|
29098
|
+
failed: observations.length - passed,
|
|
29099
|
+
failedNames: observations.flatMap((o) => o.status === "failed" && o.testName !== void 0 ? [o.testName] : [])
|
|
29087
29100
|
};
|
|
29088
29101
|
}
|
|
29089
|
-
function stepsGroupOf(
|
|
29090
|
-
const names =
|
|
29102
|
+
function stepsGroupOf(observations) {
|
|
29103
|
+
const names = observations.flatMap((o) => isFitnessObservation(o) ? [o.fitnessFunction] : []);
|
|
29091
29104
|
return names.length === 0 ? [] : [{ names }];
|
|
29092
29105
|
}
|
|
29093
|
-
function unnamedClaimGroupsOf(
|
|
29106
|
+
function unnamedClaimGroupsOf(lines) {
|
|
29107
|
+
const observations = citingNoScenario(lines);
|
|
29094
29108
|
const byFile = /* @__PURE__ */ new Map();
|
|
29095
|
-
for (const
|
|
29096
|
-
|
|
29097
|
-
|
|
29109
|
+
for (const o of observations) {
|
|
29110
|
+
if (isFitnessObservation(o))
|
|
29111
|
+
continue;
|
|
29112
|
+
const key = keyOf(o);
|
|
29113
|
+
byFile.set(key, [...byFile.get(key) ?? [], o]);
|
|
29098
29114
|
}
|
|
29099
|
-
return [...[...byFile.values()].map(groupOf), ...stepsGroupOf(
|
|
29115
|
+
return [...[...byFile.values()].map(groupOf), ...stepsGroupOf(observations)];
|
|
29100
29116
|
}
|
|
29101
29117
|
var init_unnamedClaimGroups = __esm({
|
|
29102
29118
|
"../core/dist/domain/unnamedClaimGroups.js"() {
|
|
@@ -29106,29 +29122,31 @@ var init_unnamedClaimGroups = __esm({
|
|
|
29106
29122
|
});
|
|
29107
29123
|
|
|
29108
29124
|
// ../core/dist/render/markdown.js
|
|
29109
|
-
function
|
|
29110
|
-
const sentence = OUTCOME_DESCRIPTION[
|
|
29111
|
-
if (
|
|
29125
|
+
function renderLine(line) {
|
|
29126
|
+
const sentence = `${OUTCOME_DESCRIPTION[line.outcome]}${scenarioClauseOf(line)}`;
|
|
29127
|
+
if (line.outcome === "both-missing" || line.outcome === "no-scn-code" || line.qualityCheck === void 0) {
|
|
29112
29128
|
return sentence;
|
|
29113
29129
|
}
|
|
29114
|
-
|
|
29130
|
+
const head = `${line.qualityCheck}: ${sentence}`;
|
|
29131
|
+
const observation = line.evidenceObservation;
|
|
29132
|
+
if (observation === void 0 || !isObservationOnly(line.outcome))
|
|
29133
|
+
return head;
|
|
29134
|
+
return `${head}${line.outcome === "broken" ? brokenSuffix(observation) : observationSuffix(observation)}`;
|
|
29115
29135
|
}
|
|
29116
|
-
function
|
|
29117
|
-
|
|
29118
|
-
|
|
29119
|
-
|
|
29120
|
-
|
|
29121
|
-
|
|
29122
|
-
}
|
|
29123
|
-
if (!observationOnly)
|
|
29124
|
-
return void 0;
|
|
29125
|
-
const where = item.fitnessFunction || item.locator;
|
|
29126
|
-
const said = item.fitnessFunction || remark === void 0 ? "" : `: ${cellSafe(headlineOf(remark))}`;
|
|
29127
|
-
return `${where === void 0 ? "" : ` (${where}${said})`}${resultOf(item)}`;
|
|
29136
|
+
function scenarioClauseOf({ scenario }) {
|
|
29137
|
+
return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](scenario.feature, scenario.title)}`;
|
|
29138
|
+
}
|
|
29139
|
+
function brokenSuffix(o) {
|
|
29140
|
+
const remark = remarkWordsOf(o);
|
|
29141
|
+
const where = [o.locator, remark === void 0 ? void 0 : headlineOf(remark)].filter((part) => part !== void 0 && part.length > 0).join(": ");
|
|
29142
|
+
return where.length > 0 ? ` (${cellSafe(where)})` : "";
|
|
29128
29143
|
}
|
|
29129
|
-
function
|
|
29130
|
-
const
|
|
29131
|
-
return
|
|
29144
|
+
function observationSuffix(o) {
|
|
29145
|
+
const where = isFitnessObservation(o) ? o.fitnessFunction || void 0 : o.locator;
|
|
29146
|
+
return `${where === void 0 ? "" : ` (${where})`}${resultOf(o)}`;
|
|
29147
|
+
}
|
|
29148
|
+
function resultOf(o) {
|
|
29149
|
+
return o.status === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[RESULT_MESSAGE[o.status]]}`;
|
|
29132
29150
|
}
|
|
29133
29151
|
function headlineOf(message) {
|
|
29134
29152
|
return message.split("\n").map((line) => line.trim()).find((line) => line.length > 0) ?? "";
|
|
@@ -29154,12 +29172,12 @@ function renderUnnamedClaimGroup(group) {
|
|
|
29154
29172
|
const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names);
|
|
29155
29173
|
return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]} \u2014 ${steps}`;
|
|
29156
29174
|
}
|
|
29157
|
-
function renderUnnamedClaimItems(
|
|
29158
|
-
const broken =
|
|
29159
|
-
return [...broken.map(
|
|
29175
|
+
function renderUnnamedClaimItems(lines) {
|
|
29176
|
+
const broken = lines.filter((line) => line.outcome === "broken");
|
|
29177
|
+
return [...broken.map(renderLine), ...unnamedClaimGroupsOf(lines).map(renderUnnamedClaimGroup)];
|
|
29160
29178
|
}
|
|
29161
29179
|
function renderRowExceptions(s) {
|
|
29162
|
-
const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(s
|
|
29180
|
+
const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
|
|
29163
29181
|
const reconciling = items.join("; ");
|
|
29164
29182
|
const pending = s.pendingItems.map(renderPendingItem).join("; ");
|
|
29165
29183
|
const groups = [reconciling, pending].filter((g) => g.length > 0);
|
|
@@ -29176,9 +29194,9 @@ function outOfBalanceByFeature(scenarios, untagged, featureNames) {
|
|
|
29176
29194
|
if (!isOutOfBalance(s))
|
|
29177
29195
|
continue;
|
|
29178
29196
|
const noScnCode = carriesNoScnCode(s);
|
|
29179
|
-
const key = (noScnCode ? featureOf.get(s.
|
|
29197
|
+
const key = (noScnCode ? featureOf.get(s.claim) : featureCodeOf(s.claim)) ?? s.claim;
|
|
29180
29198
|
const group = groups.get(key) ?? { ids: [], noScnCode: 0 };
|
|
29181
|
-
groups.set(key, noScnCode ? { ...group, noScnCode: group.noScnCode + 1 } : { ...group, ids: [...group.ids, s.
|
|
29199
|
+
groups.set(key, noScnCode ? { ...group, noScnCode: group.noScnCode + 1 } : { ...group, ids: [...group.ids, s.claim] });
|
|
29182
29200
|
}
|
|
29183
29201
|
return groups;
|
|
29184
29202
|
}
|
|
@@ -29241,7 +29259,7 @@ function sharedScnCodeLines(shared, accounts) {
|
|
|
29241
29259
|
if (shared.length === 0)
|
|
29242
29260
|
return [];
|
|
29243
29261
|
return [
|
|
29244
|
-
`- ${CORE_MESSAGES[CoreMessage.SharedScnCodes](
|
|
29262
|
+
`- ${CORE_MESSAGES[CoreMessage.SharedScnCodes](accounts, accounts, shared.length)}`,
|
|
29245
29263
|
...shared.map((code) => ` - ${code.scnId}: ${code.scenarios.map((s) => `${s.feature} : ${s.scenario}`).join("; ")}`)
|
|
29246
29264
|
];
|
|
29247
29265
|
}
|
|
@@ -29256,7 +29274,7 @@ function ledgerTableLines(claims, columns) {
|
|
|
29256
29274
|
for (const s of claims) {
|
|
29257
29275
|
const cells = columns.map((col) => evidenceCell(s, col));
|
|
29258
29276
|
const items = renderRowExceptions(s);
|
|
29259
|
-
lines.push(`| ${[s.
|
|
29277
|
+
lines.push(`| ${[s.claim, ...cells, s.verdict, items].join(" | ")} |`);
|
|
29260
29278
|
}
|
|
29261
29279
|
return lines;
|
|
29262
29280
|
}
|
|
@@ -29270,6 +29288,7 @@ var init_markdown = __esm({
|
|
|
29270
29288
|
init_model();
|
|
29271
29289
|
init_outcomeDescription();
|
|
29272
29290
|
init_qualityCheckReconciliation();
|
|
29291
|
+
init_journal();
|
|
29273
29292
|
init_corpusCounts();
|
|
29274
29293
|
init_ledger();
|
|
29275
29294
|
init_claimReconciliation();
|
|
@@ -29298,10 +29317,10 @@ var init_markdown = __esm({
|
|
|
29298
29317
|
runIntegritySection = (report) => {
|
|
29299
29318
|
if (!hasBrokenEvidence({ claimReconciliations: report.ledger.claimReconciliations }))
|
|
29300
29319
|
return [];
|
|
29301
|
-
const
|
|
29320
|
+
const brokenObservations = brokenItemsOf({
|
|
29302
29321
|
claimReconciliations: report.ledger.claimReconciliations
|
|
29303
|
-
});
|
|
29304
|
-
const count =
|
|
29322
|
+
}).flatMap((line) => line.evidenceObservation ?? []);
|
|
29323
|
+
const count = brokenObservations.length;
|
|
29305
29324
|
const proofs = count === 1 ? CORE_MESSAGES[CoreMessage.OneProofNeverRan] : CORE_MESSAGES[CoreMessage.ProofsNeverRan](count);
|
|
29306
29325
|
const lines = [
|
|
29307
29326
|
CORE_MESSAGES[CoreMessage.RunIntegrityHeading],
|
|
@@ -29309,7 +29328,7 @@ var init_markdown = __esm({
|
|
|
29309
29328
|
CORE_MESSAGES[CoreMessage.RunUnsound](proofs),
|
|
29310
29329
|
""
|
|
29311
29330
|
];
|
|
29312
|
-
for (const item of
|
|
29331
|
+
for (const item of brokenObservations) {
|
|
29313
29332
|
const locator = item.locator ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
|
|
29314
29333
|
lines.push(`- ${CORE_MESSAGES[CoreMessage.BrokenEvidenceWhatBroke](`\`${locator}\``)}`);
|
|
29315
29334
|
lines.push("");
|
|
@@ -29364,7 +29383,7 @@ var init_markdown = __esm({
|
|
|
29364
29383
|
fitnessSection = (report) => {
|
|
29365
29384
|
const rows = fitnessReconciliationsOf({
|
|
29366
29385
|
claimReconciliations: report.ledger.claimReconciliations
|
|
29367
|
-
}).map(({ scnId, reconciliation: r }) => `| ${scnId} | ${OUTCOME_DESCRIPTION[
|
|
29386
|
+
}).map(({ scnId, reconciliation: r }) => `| ${scnId} | ${linesOf(r).map((line) => OUTCOME_DESCRIPTION[line.outcome]).join("; ")} |`);
|
|
29368
29387
|
if (rows.length === 0)
|
|
29369
29388
|
return [];
|
|
29370
29389
|
const { satisfied, total } = report.summary.fitness;
|
|
@@ -29537,7 +29556,7 @@ function featureNamesOf(corpus) {
|
|
|
29537
29556
|
function isObservationReader(reader) {
|
|
29538
29557
|
return Object.hasOwn(OBSERVATION_READERS, reader);
|
|
29539
29558
|
}
|
|
29540
|
-
function
|
|
29559
|
+
function observationsOf3(reports, root) {
|
|
29541
29560
|
return reports.flatMap(({ reader, document }) => isObservationReader(reader) ? OBSERVATION_READERS[reader](document, root) : []);
|
|
29542
29561
|
}
|
|
29543
29562
|
function documentReadBy(reports, reader) {
|
|
@@ -29550,7 +29569,7 @@ function runReconcile(reports, root, corpus, workflows) {
|
|
|
29550
29569
|
packageJson,
|
|
29551
29570
|
ciWorkflows: workflows,
|
|
29552
29571
|
ciStepRecord: documentReadBy(reports, "ci-step-record"),
|
|
29553
|
-
behaviouralObservations:
|
|
29572
|
+
behaviouralObservations: observationsOf3(reports, root),
|
|
29554
29573
|
deferralTags: BUILT_IN_DEFERRAL_TAGS,
|
|
29555
29574
|
reconcilerInvocation: RECONCILER_INVOCATION
|
|
29556
29575
|
});
|