spec-controller 0.1.251 → 0.1.253
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 +9 -9
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11509,7 +11509,7 @@ function duplicateFeatureCodes(features) {
|
|
|
11509
11509
|
}
|
|
11510
11510
|
return faults;
|
|
11511
11511
|
}
|
|
11512
|
-
function
|
|
11512
|
+
function claimCodesCarriedBy(feature) {
|
|
11513
11513
|
return feature.scenarios.flatMap(({ tags }) => {
|
|
11514
11514
|
const { claimCode } = claimCodesOf(tags);
|
|
11515
11515
|
return claimCode === null ? [] : [claimCode];
|
|
@@ -11521,7 +11521,7 @@ function foreignClaimCodes(features) {
|
|
|
11521
11521
|
for (const feature of features) {
|
|
11522
11522
|
if (feature.featureCode === null)
|
|
11523
11523
|
continue;
|
|
11524
|
-
for (const claimCode of
|
|
11524
|
+
for (const claimCode of claimCodesCarriedBy(feature)) {
|
|
11525
11525
|
const named = featureCodeOf(claimCode);
|
|
11526
11526
|
if (named === null || named === feature.featureCode)
|
|
11527
11527
|
continue;
|
|
@@ -11539,7 +11539,7 @@ function foreignClaimCodes(features) {
|
|
|
11539
11539
|
return faults;
|
|
11540
11540
|
}
|
|
11541
11541
|
function noFeatureCodeFiles(features) {
|
|
11542
|
-
return features.filter((feature) => feature.featureCode === null &&
|
|
11542
|
+
return features.filter((feature) => feature.featureCode === null && claimCodesCarriedBy(feature).length > 0).map((feature) => ({
|
|
11543
11543
|
kind: "no-feature-code",
|
|
11544
11544
|
files: [feature.file]
|
|
11545
11545
|
}));
|
|
@@ -12297,14 +12297,14 @@ var init_ledger = __esm({
|
|
|
12297
12297
|
});
|
|
12298
12298
|
|
|
12299
12299
|
// ../core/dist/domain/posting.js
|
|
12300
|
-
function postingOf(observation,
|
|
12300
|
+
function postingOf(observation, carriedClaimCodes, sharedClaimCodes = /* @__PURE__ */ new Set()) {
|
|
12301
12301
|
const claimCode = observation.claimCode ?? null;
|
|
12302
12302
|
if (claimCode === null || sharedClaimCodes.has(claimCode)) {
|
|
12303
12303
|
if (observation.broken === true)
|
|
12304
12304
|
return { kind: "unnamed-claim", posted: "broken" };
|
|
12305
12305
|
return { kind: "unnamed-claim", posted: claimCode === null ? "cites-nothing" : "cites-shared-code" };
|
|
12306
12306
|
}
|
|
12307
|
-
return
|
|
12307
|
+
return carriedClaimCodes.has(claimCode) ? { kind: "scenario", claimCode } : { kind: "phantom-claim", claimCode };
|
|
12308
12308
|
}
|
|
12309
12309
|
var init_posting = __esm({
|
|
12310
12310
|
"../core/dist/domain/posting.js"() {
|
|
@@ -12358,11 +12358,11 @@ function citationIndex() {
|
|
|
12358
12358
|
function namingSharedCode(observation, code) {
|
|
12359
12359
|
return { ...observation, notes: [...observation.notes ?? [], { kind: "shared-claim-code", code }] };
|
|
12360
12360
|
}
|
|
12361
|
-
function routeObservations(evidenceObservations,
|
|
12361
|
+
function routeObservations(evidenceObservations, carriedClaimCodes, sharedClaimCodes) {
|
|
12362
12362
|
const citations = citationIndex();
|
|
12363
12363
|
const onUnnamedClaim = [];
|
|
12364
12364
|
for (const o of evidenceObservations) {
|
|
12365
|
-
const posting = postingOf(o,
|
|
12365
|
+
const posting = postingOf(o, carriedClaimCodes, sharedClaimCodes);
|
|
12366
12366
|
if (posting.kind !== "unnamed-claim")
|
|
12367
12367
|
citations.file(posting, o);
|
|
12368
12368
|
else if (o.claimCode !== null && o.claimCode !== void 0 && sharedClaimCodes.has(o.claimCode))
|
|
@@ -12451,12 +12451,12 @@ function untaggedScenarioRows(untaggedScenarios) {
|
|
|
12451
12451
|
return rows;
|
|
12452
12452
|
}
|
|
12453
12453
|
function reconcile(scenarios, evidenceObservations, untaggedScenarios = []) {
|
|
12454
|
-
const
|
|
12454
|
+
const carriedClaimCodes = new Set(scenarios.map((d) => d.claimCode));
|
|
12455
12455
|
const evidenceObligationPairs = evidenceObligationPairsOf(scenarios);
|
|
12456
12456
|
const observations = inEvidenceOrder(evidenceObservations);
|
|
12457
12457
|
const accounts = accountsByCode(scenarios);
|
|
12458
12458
|
const sharedClaimCodes = new Set(accounts.filter((sharers) => sharers.length > 1).map((sharers) => sharers[0].claimCode));
|
|
12459
|
-
const { citations, ...unnamed } = routeObservations(observations,
|
|
12459
|
+
const { citations, ...unnamed } = routeObservations(observations, carriedClaimCodes, sharedClaimCodes);
|
|
12460
12460
|
return {
|
|
12461
12461
|
claimReconciliations: [
|
|
12462
12462
|
...accounts.flatMap((sharers) => sharers.length === 1 ? [scenarioRow(sharers[0], observations, citations, evidenceObligationPairs)] : sharers.map(duplicateClaimCodeRow)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-controller",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.253",
|
|
4
4
|
"description": "Reconcile the behaviour your scenarios name against the evidence that actually ran — the deterministic `balance` CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reconciliation",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"fast-xml-parser": "^5.11.2",
|
|
27
27
|
"ts-json-schema-generator": "^2.9.0",
|
|
28
28
|
"yaml": "^2.9.0",
|
|
29
|
-
"@3f-consulting/spec-controller-core": "0.1.
|
|
29
|
+
"@3f-consulting/spec-controller-core": "0.1.253"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|