spec-controller 0.1.122 → 0.1.123
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 +273 -279
- package/dist/spec-reconciliation.schema.json +174 -171
- 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
|
+
};
|
|
12052
12020
|
}
|
|
12053
|
-
function
|
|
12054
|
-
|
|
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);
|
|
12043
|
+
}
|
|
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) {
|
|
@@ -27918,7 +27903,7 @@ var init_fitnessCitations = __esm({
|
|
|
27918
27903
|
// ../core/dist/parse/targetCorpus.js
|
|
27919
27904
|
function readTargetCorpus(features, deferralTags) {
|
|
27920
27905
|
return {
|
|
27921
|
-
scenarios: features.flatMap((feature) =>
|
|
27906
|
+
scenarios: features.flatMap((feature) => namedScenariosOf(feature, deferralTags)),
|
|
27922
27907
|
citedRow: (citedScn) => citationOfCitedRow(citedScn)
|
|
27923
27908
|
};
|
|
27924
27909
|
}
|
|
@@ -28335,40 +28320,42 @@ var init_messages4 = __esm({
|
|
|
28335
28320
|
CoreMessage2[CoreMessage2["ExcludedScnOccurrences"] = 115] = "ExcludedScnOccurrences";
|
|
28336
28321
|
CoreMessage2[CoreMessage2["UntaggedScenarios"] = 116] = "UntaggedScenarios";
|
|
28337
28322
|
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["
|
|
28323
|
+
CoreMessage2[CoreMessage2["SharedScnCodeScenario"] = 118] = "SharedScnCodeScenario";
|
|
28324
|
+
CoreMessage2[CoreMessage2["LedgerTableHeader"] = 119] = "LedgerTableHeader";
|
|
28325
|
+
CoreMessage2[CoreMessage2["ClaimColumn"] = 120] = "ClaimColumn";
|
|
28326
|
+
CoreMessage2[CoreMessage2["VerdictColumn"] = 121] = "VerdictColumn";
|
|
28327
|
+
CoreMessage2[CoreMessage2["ReconcilingItemsColumn"] = 122] = "ReconcilingItemsColumn";
|
|
28328
|
+
CoreMessage2[CoreMessage2["EvidenceCellKey"] = 123] = "EvidenceCellKey";
|
|
28329
|
+
CoreMessage2[CoreMessage2["PendingItem"] = 124] = "PendingItem";
|
|
28330
|
+
CoreMessage2[CoreMessage2["PendingItemFor"] = 125] = "PendingItemFor";
|
|
28331
|
+
CoreMessage2[CoreMessage2["CheckStepNoOutcome"] = 126] = "CheckStepNoOutcome";
|
|
28332
|
+
CoreMessage2[CoreMessage2["CheckStepSkipped"] = 127] = "CheckStepSkipped";
|
|
28333
|
+
CoreMessage2[CoreMessage2["CheckStepEnded"] = 128] = "CheckStepEnded";
|
|
28334
|
+
CoreMessage2[CoreMessage2["AmbiguousNamedStep"] = 129] = "AmbiguousNamedStep";
|
|
28335
|
+
CoreMessage2[CoreMessage2["AmbiguousUnnamedStep"] = 130] = "AmbiguousUnnamedStep";
|
|
28336
|
+
CoreMessage2[CoreMessage2["ManifestKindList"] = 131] = "ManifestKindList";
|
|
28337
|
+
CoreMessage2[CoreMessage2["ManifestKindObject"] = 132] = "ManifestKindObject";
|
|
28338
|
+
CoreMessage2[CoreMessage2["ManifestKindString"] = 133] = "ManifestKindString";
|
|
28339
|
+
CoreMessage2[CoreMessage2["ManifestKindStringOrNull"] = 134] = "ManifestKindStringOrNull";
|
|
28340
|
+
CoreMessage2[CoreMessage2["ManifestKindOfType"] = 135] = "ManifestKindOfType";
|
|
28341
|
+
CoreMessage2[CoreMessage2["OutcomeSatisfied"] = 136] = "OutcomeSatisfied";
|
|
28342
|
+
CoreMessage2[CoreMessage2["OutcomeMissing"] = 137] = "OutcomeMissing";
|
|
28343
|
+
CoreMessage2[CoreMessage2["OutcomeFailing"] = 138] = "OutcomeFailing";
|
|
28344
|
+
CoreMessage2[CoreMessage2["OutcomeWatermelon"] = 139] = "OutcomeWatermelon";
|
|
28345
|
+
CoreMessage2[CoreMessage2["OutcomeNoScnCode"] = 140] = "OutcomeNoScnCode";
|
|
28346
|
+
CoreMessage2[CoreMessage2["OutcomeDuplicateScnCode"] = 141] = "OutcomeDuplicateScnCode";
|
|
28347
|
+
CoreMessage2[CoreMessage2["OutcomeCitesUnknownScenario"] = 142] = "OutcomeCitesUnknownScenario";
|
|
28348
|
+
CoreMessage2[CoreMessage2["OutcomeCitesNoScenario"] = 143] = "OutcomeCitesNoScenario";
|
|
28349
|
+
CoreMessage2[CoreMessage2["OutcomeNoEvidenceObligation"] = 144] = "OutcomeNoEvidenceObligation";
|
|
28350
|
+
CoreMessage2[CoreMessage2["OutcomeBroken"] = 145] = "OutcomeBroken";
|
|
28351
|
+
CoreMessage2[CoreMessage2["OutcomeBothMissing"] = 146] = "OutcomeBothMissing";
|
|
28352
|
+
CoreMessage2[CoreMessage2["ObservationPassed"] = 147] = "ObservationPassed";
|
|
28353
|
+
CoreMessage2[CoreMessage2["ObservationFailed"] = 148] = "ObservationFailed";
|
|
28354
|
+
CoreMessage2[CoreMessage2["UnnamedClaimGroupCounts"] = 149] = "UnnamedClaimGroupCounts";
|
|
28355
|
+
CoreMessage2[CoreMessage2["UnnamedClaimCiSteps"] = 150] = "UnnamedClaimCiSteps";
|
|
28356
|
+
CoreMessage2[CoreMessage2["UnnamedClaimFailedNames"] = 151] = "UnnamedClaimFailedNames";
|
|
28357
|
+
CoreMessage2[CoreMessage2["SeveralScnCodes"] = 152] = "SeveralScnCodes";
|
|
28358
|
+
CoreMessage2[CoreMessage2["SharedScnCode"] = 153] = "SharedScnCode";
|
|
28372
28359
|
})(CoreMessage || (CoreMessage = {}));
|
|
28373
28360
|
SATISFIED = "Evidence Observation satisfies its Evidence Obligation";
|
|
28374
28361
|
MISSING = "Evidence Observation is missing";
|
|
@@ -28498,6 +28485,7 @@ var init_messages4 = __esm({
|
|
|
28498
28485
|
[CoreMessage.ExcludedScnOccurrences]: (count) => `${count} @SCN ids seen in non-tag context, excluded`,
|
|
28499
28486
|
[CoreMessage.UntaggedScenarios]: (count) => `${count} scenario(s) carry no @SCN tag`,
|
|
28500
28487
|
[CoreMessage.SharedScnCodes]: (scenarios, accounts, codes) => `The corpus holds ${scenarios} scenarios in ${accounts} accounts \u2014 ${codes} @SCN code(s) carried by more than one scenario:`,
|
|
28488
|
+
[CoreMessage.SharedScnCodeScenario]: (feature, title) => `this one is ${feature} : ${title}`,
|
|
28501
28489
|
[CoreMessage.LedgerTableHeader]: "| Claim | Verdict | Reconciling items |",
|
|
28502
28490
|
[CoreMessage.ClaimColumn]: "Claim",
|
|
28503
28491
|
[CoreMessage.VerdictColumn]: "Verdict",
|
|
@@ -28538,7 +28526,8 @@ var init_messages4 = __esm({
|
|
|
28538
28526
|
[CoreMessage.UnnamedClaimGroupCounts]: (ran, passed, failed) => `${ran} ran, ${passed} passed, ${failed} failed`,
|
|
28539
28527
|
[CoreMessage.UnnamedClaimCiSteps]: (names) => `${names.length} CI step${names.length === 1 ? "" : "s"}: ${names.join(", ")}`,
|
|
28540
28528
|
[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
|
|
28529
|
+
[CoreMessage.SeveralScnCodes]: (codes) => `${codes.length} scenario codes cite ${codes.join(", ")} \u2014 a test cites exactly one scenario, so this one credits none of them.`,
|
|
28530
|
+
[CoreMessage.SharedScnCode]: (code) => `${code} is carried by more than one scenario, so this test credits none of them.`
|
|
28542
28531
|
};
|
|
28543
28532
|
}
|
|
28544
28533
|
});
|
|
@@ -29036,6 +29025,8 @@ function noteWords(note) {
|
|
|
29036
29025
|
switch (note.kind) {
|
|
29037
29026
|
case "several-scn-codes":
|
|
29038
29027
|
return CORE_MESSAGES[CoreMessage.SeveralScnCodes](note.codes);
|
|
29028
|
+
case "shared-scn-code":
|
|
29029
|
+
return CORE_MESSAGES[CoreMessage.SharedScnCode](note.code);
|
|
29039
29030
|
case "ambiguous-step":
|
|
29040
29031
|
return note.step === void 0 ? CORE_MESSAGES[CoreMessage.AmbiguousUnnamedStep] : CORE_MESSAGES[CoreMessage.AmbiguousNamedStep](note.step);
|
|
29041
29032
|
case "check-step-did-not-run":
|
|
@@ -29061,42 +29052,42 @@ var init_remarkWords = __esm({
|
|
|
29061
29052
|
});
|
|
29062
29053
|
|
|
29063
29054
|
// ../core/dist/domain/unnamedClaimGroups.js
|
|
29064
|
-
function
|
|
29065
|
-
return
|
|
29066
|
-
}
|
|
29067
|
-
function isFileGrouped(item) {
|
|
29068
|
-
return citesNoScenario(item) && item.evidenceObservation !== void 0 && !isFitnessObservation(item.evidenceObservation);
|
|
29055
|
+
function citingNoScenario(lines) {
|
|
29056
|
+
return lines.filter((line) => line.outcome === "cites-no-scenario").flatMap((line) => line.evidenceObservation ?? []);
|
|
29069
29057
|
}
|
|
29070
|
-
function keyOf(
|
|
29071
|
-
return JSON.stringify([
|
|
29058
|
+
function keyOf(observation) {
|
|
29059
|
+
return JSON.stringify([observation.qualityCheck, observation.locator ?? null]);
|
|
29072
29060
|
}
|
|
29073
|
-
function remarksOf(
|
|
29074
|
-
return
|
|
29061
|
+
function remarksOf(observations) {
|
|
29062
|
+
return observations.flatMap(({ message, notes }) => message === void 0 && notes === void 0 ? [] : [{ ...message !== void 0 ? { message } : {}, ...notes !== void 0 ? { notes } : {} }]);
|
|
29075
29063
|
}
|
|
29076
|
-
function groupOf(
|
|
29077
|
-
const [first] =
|
|
29078
|
-
const passed =
|
|
29064
|
+
function groupOf(observations) {
|
|
29065
|
+
const [first] = observations;
|
|
29066
|
+
const passed = observations.filter((o) => o.status === "passed").length;
|
|
29079
29067
|
return {
|
|
29080
|
-
qualityCheck: first.
|
|
29068
|
+
qualityCheck: first.qualityCheck,
|
|
29081
29069
|
locator: first.locator,
|
|
29082
|
-
remarks: remarksOf(
|
|
29083
|
-
ran:
|
|
29070
|
+
remarks: remarksOf(observations),
|
|
29071
|
+
ran: observations.length,
|
|
29084
29072
|
passed,
|
|
29085
|
-
failed:
|
|
29086
|
-
failedNames:
|
|
29073
|
+
failed: observations.length - passed,
|
|
29074
|
+
failedNames: observations.flatMap((o) => o.status === "failed" && o.testName !== void 0 ? [o.testName] : [])
|
|
29087
29075
|
};
|
|
29088
29076
|
}
|
|
29089
|
-
function stepsGroupOf(
|
|
29090
|
-
const names =
|
|
29077
|
+
function stepsGroupOf(observations) {
|
|
29078
|
+
const names = observations.flatMap((o) => isFitnessObservation(o) ? [o.fitnessFunction] : []);
|
|
29091
29079
|
return names.length === 0 ? [] : [{ names }];
|
|
29092
29080
|
}
|
|
29093
|
-
function unnamedClaimGroupsOf(
|
|
29081
|
+
function unnamedClaimGroupsOf(lines) {
|
|
29082
|
+
const observations = citingNoScenario(lines);
|
|
29094
29083
|
const byFile = /* @__PURE__ */ new Map();
|
|
29095
|
-
for (const
|
|
29096
|
-
|
|
29097
|
-
|
|
29084
|
+
for (const o of observations) {
|
|
29085
|
+
if (isFitnessObservation(o))
|
|
29086
|
+
continue;
|
|
29087
|
+
const key = keyOf(o);
|
|
29088
|
+
byFile.set(key, [...byFile.get(key) ?? [], o]);
|
|
29098
29089
|
}
|
|
29099
|
-
return [...[...byFile.values()].map(groupOf), ...stepsGroupOf(
|
|
29090
|
+
return [...[...byFile.values()].map(groupOf), ...stepsGroupOf(observations)];
|
|
29100
29091
|
}
|
|
29101
29092
|
var init_unnamedClaimGroups = __esm({
|
|
29102
29093
|
"../core/dist/domain/unnamedClaimGroups.js"() {
|
|
@@ -29106,29 +29097,31 @@ var init_unnamedClaimGroups = __esm({
|
|
|
29106
29097
|
});
|
|
29107
29098
|
|
|
29108
29099
|
// ../core/dist/render/markdown.js
|
|
29109
|
-
function
|
|
29110
|
-
const sentence = OUTCOME_DESCRIPTION[
|
|
29111
|
-
if (
|
|
29100
|
+
function renderLine(line) {
|
|
29101
|
+
const sentence = `${OUTCOME_DESCRIPTION[line.outcome]}${scenarioClauseOf(line)}`;
|
|
29102
|
+
if (line.outcome === "both-missing" || line.outcome === "no-scn-code" || line.qualityCheck === void 0) {
|
|
29112
29103
|
return sentence;
|
|
29113
29104
|
}
|
|
29114
|
-
|
|
29105
|
+
const head = `${line.qualityCheck}: ${sentence}`;
|
|
29106
|
+
const observation = line.evidenceObservation;
|
|
29107
|
+
if (observation === void 0 || !isObservationOnly(line.outcome))
|
|
29108
|
+
return head;
|
|
29109
|
+
return `${head}${line.outcome === "broken" ? brokenSuffix(observation) : observationSuffix(observation)}`;
|
|
29115
29110
|
}
|
|
29116
|
-
function
|
|
29117
|
-
|
|
29118
|
-
const remark = remarkWordsOf(item);
|
|
29119
|
-
if (item.outcome === "broken") {
|
|
29120
|
-
const where2 = [item.locator, remark === void 0 ? void 0 : headlineOf(remark)].filter((part) => part !== void 0 && part.length > 0).join(": ");
|
|
29121
|
-
return where2.length > 0 ? ` (${cellSafe(where2)})` : void 0;
|
|
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)}`;
|
|
29111
|
+
function scenarioClauseOf({ scenario }) {
|
|
29112
|
+
return scenario === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[CoreMessage.SharedScnCodeScenario](scenario.feature, scenario.title)}`;
|
|
29128
29113
|
}
|
|
29129
|
-
function
|
|
29130
|
-
const
|
|
29131
|
-
|
|
29114
|
+
function brokenSuffix(o) {
|
|
29115
|
+
const remark = remarkWordsOf(o);
|
|
29116
|
+
const where = [o.locator, remark === void 0 ? void 0 : headlineOf(remark)].filter((part) => part !== void 0 && part.length > 0).join(": ");
|
|
29117
|
+
return where.length > 0 ? ` (${cellSafe(where)})` : "";
|
|
29118
|
+
}
|
|
29119
|
+
function observationSuffix(o) {
|
|
29120
|
+
const where = isFitnessObservation(o) ? o.fitnessFunction || void 0 : o.locator;
|
|
29121
|
+
return `${where === void 0 ? "" : ` (${where})`}${resultOf(o)}`;
|
|
29122
|
+
}
|
|
29123
|
+
function resultOf(o) {
|
|
29124
|
+
return o.status === void 0 ? "" : ` \u2014 ${CORE_MESSAGES[RESULT_MESSAGE[o.status]]}`;
|
|
29132
29125
|
}
|
|
29133
29126
|
function headlineOf(message) {
|
|
29134
29127
|
return message.split("\n").map((line) => line.trim()).find((line) => line.length > 0) ?? "";
|
|
@@ -29154,12 +29147,12 @@ function renderUnnamedClaimGroup(group) {
|
|
|
29154
29147
|
const steps = CORE_MESSAGES[CoreMessage.UnnamedClaimCiSteps](group.names);
|
|
29155
29148
|
return `fitness: ${OUTCOME_DESCRIPTION["cites-no-scenario"]} \u2014 ${steps}`;
|
|
29156
29149
|
}
|
|
29157
|
-
function renderUnnamedClaimItems(
|
|
29158
|
-
const broken =
|
|
29159
|
-
return [...broken.map(
|
|
29150
|
+
function renderUnnamedClaimItems(lines) {
|
|
29151
|
+
const broken = lines.filter((line) => line.outcome === "broken");
|
|
29152
|
+
return [...broken.map(renderLine), ...unnamedClaimGroupsOf(lines).map(renderUnnamedClaimGroup)];
|
|
29160
29153
|
}
|
|
29161
29154
|
function renderRowExceptions(s) {
|
|
29162
|
-
const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(s
|
|
29155
|
+
const items = isUnnamedClaim(s) ? renderUnnamedClaimItems(reconcilingItemsOf(s)) : reconcilingItemsOf(s).map(renderLine);
|
|
29163
29156
|
const reconciling = items.join("; ");
|
|
29164
29157
|
const pending = s.pendingItems.map(renderPendingItem).join("; ");
|
|
29165
29158
|
const groups = [reconciling, pending].filter((g) => g.length > 0);
|
|
@@ -29176,9 +29169,9 @@ function outOfBalanceByFeature(scenarios, untagged, featureNames) {
|
|
|
29176
29169
|
if (!isOutOfBalance(s))
|
|
29177
29170
|
continue;
|
|
29178
29171
|
const noScnCode = carriesNoScnCode(s);
|
|
29179
|
-
const key = (noScnCode ? featureOf.get(s.
|
|
29172
|
+
const key = (noScnCode ? featureOf.get(s.claim) : featureCodeOf(s.claim)) ?? s.claim;
|
|
29180
29173
|
const group = groups.get(key) ?? { ids: [], noScnCode: 0 };
|
|
29181
|
-
groups.set(key, noScnCode ? { ...group, noScnCode: group.noScnCode + 1 } : { ...group, ids: [...group.ids, s.
|
|
29174
|
+
groups.set(key, noScnCode ? { ...group, noScnCode: group.noScnCode + 1 } : { ...group, ids: [...group.ids, s.claim] });
|
|
29182
29175
|
}
|
|
29183
29176
|
return groups;
|
|
29184
29177
|
}
|
|
@@ -29241,7 +29234,7 @@ function sharedScnCodeLines(shared, accounts) {
|
|
|
29241
29234
|
if (shared.length === 0)
|
|
29242
29235
|
return [];
|
|
29243
29236
|
return [
|
|
29244
|
-
`- ${CORE_MESSAGES[CoreMessage.SharedScnCodes](
|
|
29237
|
+
`- ${CORE_MESSAGES[CoreMessage.SharedScnCodes](accounts, accounts, shared.length)}`,
|
|
29245
29238
|
...shared.map((code) => ` - ${code.scnId}: ${code.scenarios.map((s) => `${s.feature} : ${s.scenario}`).join("; ")}`)
|
|
29246
29239
|
];
|
|
29247
29240
|
}
|
|
@@ -29256,7 +29249,7 @@ function ledgerTableLines(claims, columns) {
|
|
|
29256
29249
|
for (const s of claims) {
|
|
29257
29250
|
const cells = columns.map((col) => evidenceCell(s, col));
|
|
29258
29251
|
const items = renderRowExceptions(s);
|
|
29259
|
-
lines.push(`| ${[s.
|
|
29252
|
+
lines.push(`| ${[s.claim, ...cells, s.verdict, items].join(" | ")} |`);
|
|
29260
29253
|
}
|
|
29261
29254
|
return lines;
|
|
29262
29255
|
}
|
|
@@ -29270,6 +29263,7 @@ var init_markdown = __esm({
|
|
|
29270
29263
|
init_model();
|
|
29271
29264
|
init_outcomeDescription();
|
|
29272
29265
|
init_qualityCheckReconciliation();
|
|
29266
|
+
init_journal();
|
|
29273
29267
|
init_corpusCounts();
|
|
29274
29268
|
init_ledger();
|
|
29275
29269
|
init_claimReconciliation();
|
|
@@ -29298,10 +29292,10 @@ var init_markdown = __esm({
|
|
|
29298
29292
|
runIntegritySection = (report) => {
|
|
29299
29293
|
if (!hasBrokenEvidence({ claimReconciliations: report.ledger.claimReconciliations }))
|
|
29300
29294
|
return [];
|
|
29301
|
-
const
|
|
29295
|
+
const brokenObservations = brokenItemsOf({
|
|
29302
29296
|
claimReconciliations: report.ledger.claimReconciliations
|
|
29303
|
-
});
|
|
29304
|
-
const count =
|
|
29297
|
+
}).flatMap((line) => line.evidenceObservation ?? []);
|
|
29298
|
+
const count = brokenObservations.length;
|
|
29305
29299
|
const proofs = count === 1 ? CORE_MESSAGES[CoreMessage.OneProofNeverRan] : CORE_MESSAGES[CoreMessage.ProofsNeverRan](count);
|
|
29306
29300
|
const lines = [
|
|
29307
29301
|
CORE_MESSAGES[CoreMessage.RunIntegrityHeading],
|
|
@@ -29309,7 +29303,7 @@ var init_markdown = __esm({
|
|
|
29309
29303
|
CORE_MESSAGES[CoreMessage.RunUnsound](proofs),
|
|
29310
29304
|
""
|
|
29311
29305
|
];
|
|
29312
|
-
for (const item of
|
|
29306
|
+
for (const item of brokenObservations) {
|
|
29313
29307
|
const locator = item.locator ?? CORE_MESSAGES[CoreMessage.BrokenEvidenceNotNamed];
|
|
29314
29308
|
lines.push(`- ${CORE_MESSAGES[CoreMessage.BrokenEvidenceWhatBroke](`\`${locator}\``)}`);
|
|
29315
29309
|
lines.push("");
|
|
@@ -29364,7 +29358,7 @@ var init_markdown = __esm({
|
|
|
29364
29358
|
fitnessSection = (report) => {
|
|
29365
29359
|
const rows = fitnessReconciliationsOf({
|
|
29366
29360
|
claimReconciliations: report.ledger.claimReconciliations
|
|
29367
|
-
}).map(({ scnId, reconciliation: r }) => `| ${scnId} | ${OUTCOME_DESCRIPTION[
|
|
29361
|
+
}).map(({ scnId, reconciliation: r }) => `| ${scnId} | ${linesOf(r).map((line) => OUTCOME_DESCRIPTION[line.outcome]).join("; ")} |`);
|
|
29368
29362
|
if (rows.length === 0)
|
|
29369
29363
|
return [];
|
|
29370
29364
|
const { satisfied, total } = report.summary.fitness;
|
|
@@ -29537,7 +29531,7 @@ function featureNamesOf(corpus) {
|
|
|
29537
29531
|
function isObservationReader(reader) {
|
|
29538
29532
|
return Object.hasOwn(OBSERVATION_READERS, reader);
|
|
29539
29533
|
}
|
|
29540
|
-
function
|
|
29534
|
+
function observationsOf3(reports, root) {
|
|
29541
29535
|
return reports.flatMap(({ reader, document }) => isObservationReader(reader) ? OBSERVATION_READERS[reader](document, root) : []);
|
|
29542
29536
|
}
|
|
29543
29537
|
function documentReadBy(reports, reader) {
|
|
@@ -29550,7 +29544,7 @@ function runReconcile(reports, root, corpus, workflows) {
|
|
|
29550
29544
|
packageJson,
|
|
29551
29545
|
ciWorkflows: workflows,
|
|
29552
29546
|
ciStepRecord: documentReadBy(reports, "ci-step-record"),
|
|
29553
|
-
behaviouralObservations:
|
|
29547
|
+
behaviouralObservations: observationsOf3(reports, root),
|
|
29554
29548
|
deferralTags: BUILT_IN_DEFERRAL_TAGS,
|
|
29555
29549
|
reconcilerInvocation: RECONCILER_INVOCATION
|
|
29556
29550
|
});
|