@intentset/verification 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/adapters/common.d.ts +10 -6
- package/dist/adapters/common.d.ts.map +1 -1
- package/dist/adapters/common.js +11 -8
- package/dist/adapters/common.js.map +1 -1
- package/dist/classify.d.ts +5 -1
- package/dist/classify.d.ts.map +1 -1
- package/dist/classify.js +108 -4
- package/dist/classify.js.map +1 -1
- package/dist/subject.d.ts +42 -4
- package/dist/subject.d.ts.map +1 -1
- package/dist/subject.js +90 -8
- package/dist/subject.js.map +1 -1
- package/package.json +2 -2
- package/src/adapters/common.ts +18 -11
- package/src/classify.ts +126 -3
- package/src/subject.ts +113 -7
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ const { records, diagnostics } = readRunRecords(JSON.parse(await readFile(path,
|
|
|
37
37
|
// a record with any problem is reported as EVID001 and left out, so it never counts as evidence
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Only a `pass` whose binding holds is current. Under subject binding, the default where slices claim files, a record carries the hash of its verification's subject (`computeSubject`) and stays current while that is unchanged; under commit binding, which a repository or a gate asks for, it is current only at the assessed commit and graph hash. Keep run records out of the commit they assess.
|
|
40
|
+
Only a `pass` whose binding holds is current. Under subject binding, the default where slices claim files, a record carries the hash of its verification's subject (`computeSubject`) and stays current while that is unchanged (a resource's files count only where the verification exercises it or an implementing slice owns it, `evidence.resources: exercised`; EVID006 reports what that cannot see; a slice reached only through `dependsOn` counts by every file it claims, or, with `evidence.dependencies: entrypoint`, by its binding fields, entrypoint files and contract records, and EVID007 reports what that cannot see); under commit binding, which a repository or a gate asks for, it is current only at the assessed commit and graph hash. Keep run records out of the commit they assess.
|
|
41
41
|
|
|
42
42
|
## Learn more
|
|
43
43
|
|
|
@@ -11,8 +11,12 @@ export interface ParsedRun {
|
|
|
11
11
|
problems: string[];
|
|
12
12
|
}
|
|
13
13
|
export interface ToRunRecordsOptions {
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Selector -> the verification ID, or every verification ID, that names it, from the graph's automated
|
|
16
|
+
* verifications. A selector two verifications share (one test verifying two behaviors) gives each of them its own
|
|
17
|
+
* record from the same tests.
|
|
18
|
+
*/
|
|
19
|
+
verifications: ReadonlyMap<string, string | readonly string[]>;
|
|
16
20
|
commit: string;
|
|
17
21
|
graphHash: string;
|
|
18
22
|
environment: string;
|
|
@@ -31,9 +35,9 @@ export interface ToRunRecordsOptions {
|
|
|
31
35
|
subjects?: ReadonlyMap<string, string>;
|
|
32
36
|
}
|
|
33
37
|
export interface ConvertedRun {
|
|
34
|
-
/** One record per verification at least one test matched, by verification ID. */
|
|
38
|
+
/** One record per verification whose selector at least one test matched, by verification ID. */
|
|
35
39
|
records: RunRecord[];
|
|
36
|
-
/** Selectors no test matched, sorted:
|
|
40
|
+
/** Selectors no test matched, sorted and listed once however many verifications name them: those verifications get no record from this run, and read as missing. */
|
|
37
41
|
unmatched: string[];
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
@@ -48,8 +52,8 @@ export declare function deriveEvidenceId(verificationId: string, commit: string,
|
|
|
48
52
|
/** The worse of two results: fail, then error, then skip, then pass. */
|
|
49
53
|
export declare function worst(a: RunResult, b: RunResult): RunResult;
|
|
50
54
|
/**
|
|
51
|
-
* One run record per verification whose selector matched at least one test
|
|
52
|
-
* Several matching tests make one record with the worst result and a
|
|
55
|
+
* One run record per verification whose selector matched at least one test,
|
|
56
|
+
* so a selector two verifications share gives each its own record. Several matching tests make one record with the worst result and a
|
|
53
57
|
* rationale that counts them. Throws when the options would make a malformed
|
|
54
58
|
* record, since that is a caller's mistake rather than evidence.
|
|
55
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/adapters/common.ts"],"names":[],"mappings":"AAQA,OAAO,EAAkB,KAAK,SAAS,EAAE,KAAK,SAA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QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,gGAAgG;IAChG,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,oKAAoK;IACpK,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAKD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAYxE;AAED,8HAA8H;AAC9H,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAED,wEAAwE;AACxE,wBAAgB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,SAAS,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAsD1F"}
|
package/dist/adapters/common.js
CHANGED
|
@@ -38,8 +38,8 @@ export function worst(a, b) {
|
|
|
38
38
|
return SEVERITY[a] >= SEVERITY[b] ? a : b;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* One run record per verification whose selector matched at least one test
|
|
42
|
-
* Several matching tests make one record with the worst result and a
|
|
41
|
+
* One run record per verification whose selector matched at least one test,
|
|
42
|
+
* so a selector two verifications share gives each its own record. Several matching tests make one record with the worst result and a
|
|
43
43
|
* rationale that counts them. Throws when the options would make a malformed
|
|
44
44
|
* record, since that is a caller's mistake rather than evidence.
|
|
45
45
|
*/
|
|
@@ -47,17 +47,20 @@ export function toRunRecords(parsed, options) {
|
|
|
47
47
|
const matched = new Map();
|
|
48
48
|
const unmatched = [];
|
|
49
49
|
for (const selector of [...options.verifications.keys()].sort(compareStrings)) {
|
|
50
|
-
const
|
|
50
|
+
const named = options.verifications.get(selector);
|
|
51
|
+
const verificationIds = [...new Set(typeof named === "string" ? [named] : named)].sort(compareStrings);
|
|
51
52
|
const hits = parsed.tests.flatMap((test, index) => (selectorMatches(selector, test.fullName) ? [index] : []));
|
|
52
53
|
if (hits.length === 0) {
|
|
53
54
|
unmatched.push(selector);
|
|
54
55
|
continue;
|
|
55
56
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
for (const verificationId of verificationIds) {
|
|
58
|
+
const entry = matched.get(verificationId) ?? { selectors: new Set(), tests: new Set() };
|
|
59
|
+
entry.selectors.add(selector);
|
|
60
|
+
for (const hit of hits)
|
|
61
|
+
entry.tests.add(hit);
|
|
62
|
+
matched.set(verificationId, entry);
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
const records = [];
|
|
63
66
|
for (const verificationId of [...matched.keys()].sort(compareStrings)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/adapters/common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAA+D,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/adapters/common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAA+D,MAAM,eAAe,CAAC;AA+C5G,MAAM,QAAQ,GAA8B,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACpF,MAAM,IAAI,GAAG,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AAE,WAAW,EAAE,CAAC;YAClF,SAAS,EAAE,GAAG,OAAO,CAAC,MAAM,QAAQ,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,KAAK,MAAM,GAAG;SACnG,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACxD,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,+DAA+D,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAChC,CAAC"}
|
package/dist/classify.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export interface Classification {
|
|
|
78
78
|
unknown: RunRecord[];
|
|
79
79
|
/** Records that cannot be evidence for the verification they name (EVID001), by evidence ID. */
|
|
80
80
|
rejected: RejectedRecord[];
|
|
81
|
-
/** EVID001, EVID002, EVID004 and
|
|
81
|
+
/** EVID001, EVID002, EVID004, EVID005, EVID006 and EVID007, sorted. */
|
|
82
82
|
diagnostics: Diagnostic[];
|
|
83
83
|
}
|
|
84
84
|
export interface ClassifyOptions {
|
|
@@ -87,6 +87,10 @@ export interface ClassifyOptions {
|
|
|
87
87
|
}
|
|
88
88
|
/** The most files EVID005 lists; the rest are counted. */
|
|
89
89
|
export declare const UNCLAIMED_LIMIT = 20;
|
|
90
|
+
/** The most verifications EVID006 lists, and the most files it lists for each resource; the rest are counted. */
|
|
91
|
+
export declare const UNEXERCISED_LIMIT = 20;
|
|
92
|
+
/** The most verifications EVID007 lists, and the most files it lists for each dependency slice; the rest are counted. */
|
|
93
|
+
export declare const DEPENDENCY_INTERNALS_LIMIT = 20;
|
|
90
94
|
/** Core §8: classify every verification in the graph against the snapshot. Deterministic for identical inputs. */
|
|
91
95
|
export declare function classifyEvidence(graph: Graph, records: readonly RunRecord[], snapshot: EvidenceSnapshot, options?: ClassifyOptions): Classification;
|
|
92
96
|
/** True when a record was made at the snapshot: same graph hash, and same commit unless the snapshot's is unknown. */
|
package/dist/classify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA2B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtG,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,iBAAiB,YAC5B,cAAc,EACd,cAAc,EACd,OAAO,EACP,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,CACJ,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,yGAAyG;AACzG,MAAM,WAAW,gBAAgB;IAC/B,kHAAkH;IAClH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,gIAAgI;IAChI,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,uFAAuF;IACvF,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,mGAAmG;IACnG,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,MA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,KAAK,CAAC;AAElC,iHAAiH;AACjH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAGpC,yHAAyH;AACzH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAW7C,kHAAkH;AAClH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,GAAE,eAAoB,GAC5B,cAAc,CA6KhB;AAED,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE7G"}
|
package/dist/classify.js
CHANGED
|
@@ -22,6 +22,12 @@ export const EVIDENCE_STATUSES = [
|
|
|
22
22
|
const NOTE_COMMIT_UNKNOWN = "commit unknown; matched on graph hash";
|
|
23
23
|
/** The most files EVID005 lists; the rest are counted. */
|
|
24
24
|
export const UNCLAIMED_LIMIT = 20;
|
|
25
|
+
/** The most verifications EVID006 lists, and the most files it lists for each resource; the rest are counted. */
|
|
26
|
+
export const UNEXERCISED_LIMIT = 20;
|
|
27
|
+
const UNEXERCISED_FILES = 5;
|
|
28
|
+
/** The most verifications EVID007 lists, and the most files it lists for each dependency slice; the rest are counted. */
|
|
29
|
+
export const DEPENDENCY_INTERNALS_LIMIT = 20;
|
|
30
|
+
const DEPENDENCY_INTERNALS_FILES = 5;
|
|
25
31
|
const short = (commit) => commit.slice(0, 9);
|
|
26
32
|
/** Core §8: classify every verification in the graph against the snapshot. Deterministic for identical inputs. */
|
|
27
33
|
export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
@@ -87,11 +93,17 @@ export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
|
87
93
|
}
|
|
88
94
|
const verifications = {};
|
|
89
95
|
const unclaimed = new Set();
|
|
96
|
+
const unexercised = new Map();
|
|
97
|
+
const internals = new Map();
|
|
90
98
|
for (const id of ids) {
|
|
91
99
|
const artifact = graph.artifacts.get(id);
|
|
92
100
|
const history = (inScope.get(id) ?? []).sort(compareRecords);
|
|
93
|
-
verifications[id] = classifyOne(id, artifact?.meta.verification?.method ?? "automated", history, outOfScope.get(id) ?? 0, snapshot, binding, unclaimed);
|
|
101
|
+
verifications[id] = classifyOne(id, artifact?.meta.verification?.method ?? "automated", history, outOfScope.get(id) ?? 0, snapshot, binding, unclaimed, unexercised, internals);
|
|
94
102
|
}
|
|
103
|
+
// A file of a resource EVID006 reports is not listed here as well: EVID006 says more (which verifications use it).
|
|
104
|
+
for (const entry of unexercised.values())
|
|
105
|
+
for (const file of entry.files)
|
|
106
|
+
unclaimed.delete(file);
|
|
95
107
|
if (unclaimed.size > 0) {
|
|
96
108
|
const files = [...unclaimed].sort(compareStrings);
|
|
97
109
|
const listed = files.slice(0, UNCLAIMED_LIMIT);
|
|
@@ -100,8 +112,52 @@ export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
|
100
112
|
severity: "warning",
|
|
101
113
|
artifact: null,
|
|
102
114
|
path: null,
|
|
103
|
-
message: `${files.length} file${files.length === 1 ? "" : "s"} changed since the commit of a subject-bound record and no slice claims, no
|
|
104
|
-
remediation: "Claim the file in a slice (the architecture check's unclaimed files rule), name its resource in `
|
|
115
|
+
message: `${files.length} file${files.length === 1 ? "" : "s"} changed since the commit of a subject-bound record and no slice claims, no exercised resource names and no global input lists ${files.length === 1 ? "it" : "them"}, so ${files.length === 1 ? "it" : "they"} cannot make any evidence stale: ${listed.join(", ")}${files.length > listed.length ? `, and ${files.length - listed.length} more` : ""}.`,
|
|
116
|
+
remediation: "Claim the file in a slice (the architecture check's unclaimed files rule), name its resource in a verification's `exercises`, or list it in `evidence.globalInputs` if it affects every check (Core §8).",
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
if (unexercised.size > 0) {
|
|
120
|
+
const resources = [...unexercised].sort(([a], [b]) => compareStrings(a, b));
|
|
121
|
+
const all = new Set();
|
|
122
|
+
for (const [, entry] of resources)
|
|
123
|
+
for (const id of entry.verifications)
|
|
124
|
+
all.add(id);
|
|
125
|
+
const verifications = [...all].sort(compareStrings);
|
|
126
|
+
const listed = verifications.slice(0, UNEXERCISED_LIMIT);
|
|
127
|
+
const what = resources.map(([id, entry]) => {
|
|
128
|
+
const files = [...entry.files].sort(compareStrings);
|
|
129
|
+
const shown = files.slice(0, UNEXERCISED_FILES).join(", ");
|
|
130
|
+
return `${id} (${shown}${files.length > UNEXERCISED_FILES ? `, and ${files.length - UNEXERCISED_FILES} more` : ""})`;
|
|
131
|
+
});
|
|
132
|
+
diagnostics.push(evidenceDiagnostic({
|
|
133
|
+
code: "EVID006",
|
|
134
|
+
severity: "warning",
|
|
135
|
+
artifact: null,
|
|
136
|
+
path: null,
|
|
137
|
+
message: `${verifications.length} verification${verifications.length === 1 ? " is" : "s are"} current though a resource ${verifications.length === 1 ? "it uses" : "they use"} and ${verifications.length === 1 ? "does" : "do"} not exercise changed since the commit of ${verifications.length === 1 ? "its" : "their"} record: ${what.join("; ")}; ${listed.join(", ")}${verifications.length > listed.length ? `, and ${verifications.length - listed.length} more` : ""}.`,
|
|
138
|
+
remediation: "Where a check does depend on that resource, name it in the verification's `exercises` so a change to it makes the record stale, or set `evidence.resources: used` to hash every resource a slice lists (Core §8).",
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
if (internals.size > 0) {
|
|
142
|
+
const slices = [...internals].sort(([a], [b]) => compareStrings(a, b));
|
|
143
|
+
const all = new Set();
|
|
144
|
+
for (const [, entry] of slices)
|
|
145
|
+
for (const id of entry.verifications)
|
|
146
|
+
all.add(id);
|
|
147
|
+
const verifications = [...all].sort(compareStrings);
|
|
148
|
+
const listed = verifications.slice(0, DEPENDENCY_INTERNALS_LIMIT);
|
|
149
|
+
const what = slices.map(([id, entry]) => {
|
|
150
|
+
const files = [...entry.files].sort(compareStrings);
|
|
151
|
+
const shown = files.slice(0, DEPENDENCY_INTERNALS_FILES).join(", ");
|
|
152
|
+
return `${id} (${shown}${files.length > DEPENDENCY_INTERNALS_FILES ? `, and ${files.length - DEPENDENCY_INTERNALS_FILES} more` : ""})`;
|
|
153
|
+
});
|
|
154
|
+
diagnostics.push(evidenceDiagnostic({
|
|
155
|
+
code: "EVID007",
|
|
156
|
+
severity: "warning",
|
|
157
|
+
artifact: null,
|
|
158
|
+
path: null,
|
|
159
|
+
message: `${verifications.length} verification${verifications.length === 1 ? " is" : "s are"} current though a slice ${verifications.length === 1 ? "it depends" : "they depend"} on changed outside its entrypoints and contracts since the commit of ${verifications.length === 1 ? "its" : "their"} record: ${what.join("; ")}; ${listed.join(", ")}${verifications.length > listed.length ? `, and ${verifications.length - listed.length} more` : ""}.`,
|
|
160
|
+
remediation: "Where a check does depend on that slice's internals, name the slice in the verification's `exercises` so a change to it makes the record stale, or set `evidence.dependencies: files` to hash every file a dependency claims (Core §8).",
|
|
105
161
|
}));
|
|
106
162
|
}
|
|
107
163
|
return {
|
|
@@ -123,7 +179,7 @@ export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
|
123
179
|
export function atSnapshot(record, snapshot) {
|
|
124
180
|
return record.graphHash === snapshot.graphHash && (snapshot.commit === null || record.commit === snapshot.commit);
|
|
125
181
|
}
|
|
126
|
-
function classifyOne(verificationId, method, history, outOfScope, snapshot, binding, unclaimed) {
|
|
182
|
+
function classifyOne(verificationId, method, history, outOfScope, snapshot, binding, unclaimed, unexercised, internals) {
|
|
127
183
|
const counts = { pass: 0, fail: 0, skip: 0, error: 0 };
|
|
128
184
|
const subjectHash = binding === "subject" ? (snapshot.subjects?.get(verificationId)?.hash ?? null) : null;
|
|
129
185
|
const base = { verificationId, method, binding, subject: subjectHash, history, atSnapshot: counts, outOfScope };
|
|
@@ -160,6 +216,8 @@ function classifyOne(verificationId, method, history, outOfScope, snapshot, bind
|
|
|
160
216
|
const notes = [];
|
|
161
217
|
if (binding === "subject") {
|
|
162
218
|
const unlisted = collectUnclaimed(latest, snapshot, unclaimed);
|
|
219
|
+
collectUnexercised(verificationId, latest, subject, snapshot, unexercised);
|
|
220
|
+
collectInternals(verificationId, latest, subject, snapshot, internals);
|
|
163
221
|
notes.push(`judged by subject binding; the run was at commit ${short(latest.commit)}${unlisted}`);
|
|
164
222
|
}
|
|
165
223
|
else if (snapshot.commit === null)
|
|
@@ -201,6 +259,52 @@ function collectUnclaimed(latest, snapshot, unclaimed) {
|
|
|
201
259
|
unclaimed.add(path);
|
|
202
260
|
return "";
|
|
203
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Collects the resources a current record's verification uses without exercising (EVID006) whose files changed since
|
|
264
|
+
* the record's commit: the subject cannot see them, so the record stays current, and the report says so. It asks for
|
|
265
|
+
* the same `changedSince` as EVID005, and has nothing to say when that cannot be answered (EVID005's note says so).
|
|
266
|
+
*/
|
|
267
|
+
function collectUnexercised(verificationId, latest, subject, snapshot, unexercised) {
|
|
268
|
+
if (snapshot.changedSince === undefined || subject === undefined || subject.unexercised.length === 0)
|
|
269
|
+
return;
|
|
270
|
+
const changed = snapshot.changedSince(latest.commit);
|
|
271
|
+
if (changed === null || changed.length === 0)
|
|
272
|
+
return;
|
|
273
|
+
const moved = new Set(changed);
|
|
274
|
+
for (const resource of subject.unexercised) {
|
|
275
|
+
const files = resource.files.filter((path) => moved.has(path));
|
|
276
|
+
if (files.length === 0)
|
|
277
|
+
continue;
|
|
278
|
+
const entry = unexercised.get(resource.id) ?? { files: new Set(), verifications: new Set() };
|
|
279
|
+
for (const path of files)
|
|
280
|
+
entry.files.add(path);
|
|
281
|
+
entry.verifications.add(verificationId);
|
|
282
|
+
unexercised.set(resource.id, entry);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Collects the dependency slices a current record's verification counts only through their entrypoints and contracts
|
|
287
|
+
* (EVID007) whose other files changed since the record's commit: the subject cannot see them, so the record stays
|
|
288
|
+
* current, and the report says so. Like EVID006 it has nothing to say when git cannot answer.
|
|
289
|
+
*/
|
|
290
|
+
function collectInternals(verificationId, latest, subject, snapshot, internals) {
|
|
291
|
+
if (snapshot.changedSince === undefined || subject === undefined || subject.dependencyInternals.length === 0)
|
|
292
|
+
return;
|
|
293
|
+
const changed = snapshot.changedSince(latest.commit);
|
|
294
|
+
if (changed === null || changed.length === 0)
|
|
295
|
+
return;
|
|
296
|
+
const moved = new Set(changed);
|
|
297
|
+
for (const slice of subject.dependencyInternals) {
|
|
298
|
+
const files = slice.files.filter((path) => moved.has(path));
|
|
299
|
+
if (files.length === 0)
|
|
300
|
+
continue;
|
|
301
|
+
const entry = internals.get(slice.id) ?? { files: new Set(), verifications: new Set() };
|
|
302
|
+
for (const path of files)
|
|
303
|
+
entry.files.add(path);
|
|
304
|
+
entry.verifications.add(verificationId);
|
|
305
|
+
internals.set(slice.id, entry);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
204
308
|
function withNote(evidence, notes) {
|
|
205
309
|
const present = notes.filter((note) => note !== null);
|
|
206
310
|
const { verificationId, method, binding, subject, status, latest, history, atSnapshot: counts, outOfScope, } = evidence;
|
package/dist/classify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAKL,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAiD,MAAM,cAAc,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAgB,MAAM,cAAc,CAAC;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,cAAc;IACd,cAAc;IACd,OAAO;IACP,MAAM;IACN,OAAO;IACP,SAAS;IACT,YAAY;CACJ,CAAC;AAmFX,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;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AC,CAAC,CAAC;QAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACjC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,EAAU,EAAE,aAAa,EAAE,IAAI,GAAG,EAAU,EAAE,CAAC;QACxG,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChD,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,QAA4C,EAAE,KAAwB;IACtF,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACtE,MAAM,EACJ,cAAc,EACd,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EAAE,MAAM,EAClB,UAAU,GACX,GAAG,QAAQ,CAAC;IACb,OAAO;QACL,cAAc;QACd,MAAM;QACN,MAAM;QACN,OAAO;QACP,OAAO;QACP,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,MAAM;QACN,OAAO;QACP,UAAU,EAAE,MAAM;QAClB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
package/dist/subject.d.ts
CHANGED
|
@@ -14,8 +14,26 @@
|
|
|
14
14
|
* `verification.exercises`: each by the hash of its **binding fields**
|
|
15
15
|
* (`implements`, `dependsOn`, `claims`, `usesResources`, `entrypoints`;
|
|
16
16
|
* never its prose) and the content of every file its claims resolve to;
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* A slice reached only through `dependsOn` is a **dependency**: under
|
|
18
|
+
* `dependencies: "entrypoint"` (`evidence.dependencies`) it contributes its
|
|
19
|
+
* binding fields, the files of its `entrypoints` and the records of the
|
|
20
|
+
* contracts it exposes or consumes and the decisions those name (a
|
|
21
|
+
* `contract` and a `decision` part), not its other claimed files; the
|
|
22
|
+
* files left out are `dependencyInternals`, so a report can say what the
|
|
23
|
+
* subject could not see (EVID007). An implementing slice and an exercised
|
|
24
|
+
* slice always contribute every file. `dependencies: "files"` is the rule
|
|
25
|
+
* of Core §8 up to 0.7.0 (ADR 0013, amended 2026-10-15, second);
|
|
26
|
+
* - the resources the verification exercises: each by its registry entry and
|
|
27
|
+
* the content of the files its path matches. A resource counts where
|
|
28
|
+
* `verification.exercises` names it, or where a slice that implements a
|
|
29
|
+
* verified behavior lists it in `usesResources` and also claims a file it
|
|
30
|
+
* matches (the slice's own resource). A resource a slice merely lists is not
|
|
31
|
+
* hashed, so a change to a backend a web slice talks to does not move every
|
|
32
|
+
* check of that slice; `resourceMode: "used"` (`evidence.resources: used`)
|
|
33
|
+
* hashes the files of every resource an included slice lists, as Core §8
|
|
34
|
+
* did from 0.7.0 to 0.7.1 (ADR 0013, amended 2026-10-15). What a subject
|
|
35
|
+
* leaves out is `unexercised`, so a report can say what it could not see
|
|
36
|
+
* (EVID006);
|
|
19
37
|
* - the test file (`locator`) and the local files it imports, transitively,
|
|
20
38
|
* which the caller resolves (`localImports`) with the architecture
|
|
21
39
|
* package's resolver and stops at a package boundary;
|
|
@@ -28,8 +46,8 @@
|
|
|
28
46
|
* `absent`, so a deleted file moves the subject. `parts` carries each entry,
|
|
29
47
|
* so a report can say which part moved (`movedParts`).
|
|
30
48
|
*/
|
|
31
|
-
import { type Graph } from "@intentset/core";
|
|
32
|
-
export declare const SUBJECT_PART_KINDS: readonly ["verification", "verified", "slice", "slice-file", "resource", "resource-file", "test", "test-import", "global-input"];
|
|
49
|
+
import { type EvidenceDependencies, type EvidenceResources, type Graph } from "@intentset/core";
|
|
50
|
+
export declare const SUBJECT_PART_KINDS: readonly ["verification", "verified", "slice", "slice-file", "contract", "decision", "resource", "resource-file", "test", "test-import", "global-input"];
|
|
33
51
|
export type SubjectPartKind = (typeof SUBJECT_PART_KINDS)[number];
|
|
34
52
|
/** One thing that went into the hash: `id` is a record ID or a path, `hash` its content or source hash. */
|
|
35
53
|
export interface SubjectPart {
|
|
@@ -43,10 +61,24 @@ export interface SubjectPart {
|
|
|
43
61
|
/** The repository-relative file the part is, or the record's file: what a `git diff` names when the part moves. */
|
|
44
62
|
path?: string;
|
|
45
63
|
}
|
|
64
|
+
/** A registry resource an included slice lists in `usesResources` that the subject does not hash, with the files its path matches. */
|
|
65
|
+
export interface UnexercisedResource {
|
|
66
|
+
id: string;
|
|
67
|
+
files: string[];
|
|
68
|
+
}
|
|
69
|
+
/** A dependency slice whose claimed files the subject does not hash (`dependencies: "entrypoint"`), with those files. */
|
|
70
|
+
export interface DependencyInternals {
|
|
71
|
+
id: string;
|
|
72
|
+
files: string[];
|
|
73
|
+
}
|
|
46
74
|
export interface Subject {
|
|
47
75
|
hash: string;
|
|
48
76
|
/** Sorted by kind, then ID. */
|
|
49
77
|
parts: SubjectPart[];
|
|
78
|
+
/** The resources the included slices list that this subject leaves out, sorted by ID; always empty under `resourceMode: "used"`. Not part of the hash. */
|
|
79
|
+
unexercised: UnexercisedResource[];
|
|
80
|
+
/** The dependency slices whose internal files this subject leaves out, sorted by ID; always empty under `dependencies: "files"`. Not part of the hash. */
|
|
81
|
+
dependencyInternals: DependencyInternals[];
|
|
50
82
|
}
|
|
51
83
|
/** A registry resource as the subject sees it: its record, and the files its path matches. */
|
|
52
84
|
export interface SubjectResource {
|
|
@@ -64,6 +96,10 @@ export interface SubjectInput {
|
|
|
64
96
|
sliceFiles: ReadonlyMap<string, readonly string[]> | Readonly<Record<string, readonly string[]>>;
|
|
65
97
|
/** Registry resource ID to its record and files; absent means the repository declares none. */
|
|
66
98
|
resources?: ReadonlyMap<string, SubjectResource>;
|
|
99
|
+
/** Which resource files count (`evidence.resources`): `exercised`, the default, or `used`. */
|
|
100
|
+
resourceMode?: EvidenceResources;
|
|
101
|
+
/** What a dependency slice contributes (`evidence.dependencies`): `DEFAULT_EVIDENCE_DEPENDENCIES` when absent. */
|
|
102
|
+
dependencyMode?: EvidenceDependencies;
|
|
67
103
|
/** The local files a file imports, transitively and without the file itself, stopping at a package boundary. */
|
|
68
104
|
localImports?: (path: string) => readonly string[];
|
|
69
105
|
/** Files whose change affects every check and that belong to no slice (`evidence.globalInputs`), as paths. */
|
|
@@ -77,6 +113,8 @@ export declare function exercisesOf(graph: Graph, id: string): string[];
|
|
|
77
113
|
export declare function verifiedBehaviors(graph: Graph, verificationId: string): string[];
|
|
78
114
|
/** The slices a subject includes, each with why: implementers, their `dependsOn` closure, and the exercised slices. */
|
|
79
115
|
export declare function includedSlices(graph: Graph, verificationId: string): Map<string, string>;
|
|
116
|
+
/** The contracts a slice exposes or consumes: its public contract records, whose change a dependent sees. */
|
|
117
|
+
export declare function contractsOf(graph: Graph, id: string): string[];
|
|
80
118
|
/** The binding fields of a slice record, canonical: what the subject hashes of it instead of the whole record. */
|
|
81
119
|
export declare function sliceBinding(graph: Graph, id: string): unknown;
|
|
82
120
|
export declare function computeSubject(input: SubjectInput): Subject;
|
package/dist/subject.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,KAAK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M,GAAG,OAAO,CAe9D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CA+H3D;AAWD,wGAAwG;AACxG,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAK1F"}
|
package/dist/subject.js
CHANGED
|
@@ -14,8 +14,26 @@
|
|
|
14
14
|
* `verification.exercises`: each by the hash of its **binding fields**
|
|
15
15
|
* (`implements`, `dependsOn`, `claims`, `usesResources`, `entrypoints`;
|
|
16
16
|
* never its prose) and the content of every file its claims resolve to;
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* A slice reached only through `dependsOn` is a **dependency**: under
|
|
18
|
+
* `dependencies: "entrypoint"` (`evidence.dependencies`) it contributes its
|
|
19
|
+
* binding fields, the files of its `entrypoints` and the records of the
|
|
20
|
+
* contracts it exposes or consumes and the decisions those name (a
|
|
21
|
+
* `contract` and a `decision` part), not its other claimed files; the
|
|
22
|
+
* files left out are `dependencyInternals`, so a report can say what the
|
|
23
|
+
* subject could not see (EVID007). An implementing slice and an exercised
|
|
24
|
+
* slice always contribute every file. `dependencies: "files"` is the rule
|
|
25
|
+
* of Core §8 up to 0.7.0 (ADR 0013, amended 2026-10-15, second);
|
|
26
|
+
* - the resources the verification exercises: each by its registry entry and
|
|
27
|
+
* the content of the files its path matches. A resource counts where
|
|
28
|
+
* `verification.exercises` names it, or where a slice that implements a
|
|
29
|
+
* verified behavior lists it in `usesResources` and also claims a file it
|
|
30
|
+
* matches (the slice's own resource). A resource a slice merely lists is not
|
|
31
|
+
* hashed, so a change to a backend a web slice talks to does not move every
|
|
32
|
+
* check of that slice; `resourceMode: "used"` (`evidence.resources: used`)
|
|
33
|
+
* hashes the files of every resource an included slice lists, as Core §8
|
|
34
|
+
* did from 0.7.0 to 0.7.1 (ADR 0013, amended 2026-10-15). What a subject
|
|
35
|
+
* leaves out is `unexercised`, so a report can say what it could not see
|
|
36
|
+
* (EVID006);
|
|
19
37
|
* - the test file (`locator`) and the local files it imports, transitively,
|
|
20
38
|
* which the caller resolves (`localImports`) with the architecture
|
|
21
39
|
* package's resolver and stops at a package boundary;
|
|
@@ -28,12 +46,14 @@
|
|
|
28
46
|
* `absent`, so a deleted file moves the subject. `parts` carries each entry,
|
|
29
47
|
* so a report can say which part moved (`movedParts`).
|
|
30
48
|
*/
|
|
31
|
-
import { canonicalJson, sha256Hex } from "@intentset/core";
|
|
49
|
+
import { canonicalJson, DEFAULT_EVIDENCE_DEPENDENCIES, sha256Hex, } from "@intentset/core";
|
|
32
50
|
export const SUBJECT_PART_KINDS = [
|
|
33
51
|
"verification",
|
|
34
52
|
"verified",
|
|
35
53
|
"slice",
|
|
36
54
|
"slice-file",
|
|
55
|
+
"contract",
|
|
56
|
+
"decision",
|
|
37
57
|
"resource",
|
|
38
58
|
"resource-file",
|
|
39
59
|
"test",
|
|
@@ -108,6 +128,17 @@ export function includedSlices(graph, verificationId) {
|
|
|
108
128
|
}
|
|
109
129
|
return new Map([...why].sort(([a], [b]) => cmp(a, b)).map(([id, set]) => [id, [...set].sort(cmp).join(",")]));
|
|
110
130
|
}
|
|
131
|
+
/** The contracts a slice exposes or consumes: its public contract records, whose change a dependent sees. */
|
|
132
|
+
export function contractsOf(graph, id) {
|
|
133
|
+
const out = new Set();
|
|
134
|
+
for (const edge of graph.out.get(id) ?? []) {
|
|
135
|
+
if ((edge.kind === "exposes" || edge.kind === "consumes") &&
|
|
136
|
+
graph.artifacts.get(edge.to)?.meta.type === "contract") {
|
|
137
|
+
out.add(edge.to);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return [...out].sort(cmp);
|
|
141
|
+
}
|
|
111
142
|
/** The binding fields of a slice record, canonical: what the subject hashes of it instead of the whole record. */
|
|
112
143
|
export function sliceBinding(graph, id) {
|
|
113
144
|
const artifact = graph.artifacts.get(id);
|
|
@@ -166,6 +197,10 @@ export function computeSubject(input) {
|
|
|
166
197
|
}
|
|
167
198
|
for (const id of targets)
|
|
168
199
|
parts.push(recordPart("verified", id));
|
|
200
|
+
const mode = input.resourceMode ?? "exercised";
|
|
201
|
+
const dependencyMode = input.dependencyMode ?? DEFAULT_EVIDENCE_DEPENDENCIES;
|
|
202
|
+
const internal = new Map();
|
|
203
|
+
const contractIds = new Set();
|
|
169
204
|
const resourceWhy = new Map();
|
|
170
205
|
const useResource = (id, reason) => {
|
|
171
206
|
if (input.resources?.has(id) !== true)
|
|
@@ -174,6 +209,7 @@ export function computeSubject(input) {
|
|
|
174
209
|
set.add(reason);
|
|
175
210
|
resourceWhy.set(id, set);
|
|
176
211
|
};
|
|
212
|
+
const listed = new Set();
|
|
177
213
|
for (const id of exercisesOf(graph, verificationId))
|
|
178
214
|
useResource(id, "exercises");
|
|
179
215
|
for (const [id, why] of includedSlices(graph, verificationId)) {
|
|
@@ -185,12 +221,45 @@ export function computeSubject(input) {
|
|
|
185
221
|
why,
|
|
186
222
|
...(artifact === undefined ? {} : { path: artifact.path }),
|
|
187
223
|
});
|
|
188
|
-
|
|
189
|
-
|
|
224
|
+
const dependency = why === "dependsOn";
|
|
225
|
+
if (dependency && dependencyMode === "entrypoint") {
|
|
226
|
+
const surface = new Set(artifact?.meta.slice?.entrypoints ?? []);
|
|
227
|
+
for (const path of [...surface].sort(cmp)) {
|
|
228
|
+
parts.push({ kind: "slice-file", id: path, hash: fileHash(path), owner: id, path });
|
|
229
|
+
}
|
|
230
|
+
internal.set(id, [...new Set(claimed(id))].filter((path) => !surface.has(path)).sort(cmp));
|
|
231
|
+
for (const contract of contractsOf(graph, id))
|
|
232
|
+
contractIds.add(contract);
|
|
190
233
|
}
|
|
191
|
-
|
|
192
|
-
|
|
234
|
+
else {
|
|
235
|
+
for (const path of [...new Set(claimed(id))].sort(cmp)) {
|
|
236
|
+
parts.push({ kind: "slice-file", id: path, hash: fileHash(path), owner: id, path });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const implementing = why.split(",").includes("implements");
|
|
240
|
+
for (const resource of artifact?.meta.slice?.usesResources ?? []) {
|
|
241
|
+
if (input.resources?.has(resource) !== true)
|
|
242
|
+
continue;
|
|
243
|
+
if (mode === "used" || (implementing && ownsResource(claimed(id), input.resources.get(resource)?.files ?? []))) {
|
|
244
|
+
useResource(resource, "usesResources");
|
|
245
|
+
}
|
|
246
|
+
else
|
|
247
|
+
listed.add(resource);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const decisionIds = new Set();
|
|
251
|
+
for (const id of [...contractIds].sort(cmp)) {
|
|
252
|
+
parts.push(recordPart("contract", id));
|
|
253
|
+
for (const edge of graph.out.get(id) ?? [])
|
|
254
|
+
if (edge.kind === "informedBy")
|
|
255
|
+
decisionIds.add(edge.to);
|
|
193
256
|
}
|
|
257
|
+
for (const id of [...decisionIds].sort(cmp))
|
|
258
|
+
parts.push(recordPart("decision", id));
|
|
259
|
+
const unexercised = [...listed]
|
|
260
|
+
.filter((id) => !resourceWhy.has(id))
|
|
261
|
+
.sort(cmp)
|
|
262
|
+
.map((id) => ({ id, files: [...new Set(input.resources?.get(id)?.files ?? [])].sort(cmp) }));
|
|
194
263
|
for (const [id, set] of resourceWhy) {
|
|
195
264
|
const resource = input.resources?.get(id);
|
|
196
265
|
parts.push({
|
|
@@ -214,9 +283,22 @@ export function computeSubject(input) {
|
|
|
214
283
|
for (const path of [...new Set(globalInputs)]) {
|
|
215
284
|
parts.push({ kind: "global-input", id: path, hash: fileHash(path), path });
|
|
216
285
|
}
|
|
286
|
+
// A claimed file of a dependency that another part hashes (an entrypoint of another slice, the test, a global input) is seen.
|
|
287
|
+
const hashed = new Set(parts.filter((p) => p.path !== undefined).map((p) => p.path));
|
|
288
|
+
const dependencyInternals = [...internal]
|
|
289
|
+
.map(([id, files]) => ({ id, files: files.filter((path) => !hashed.has(path)) }))
|
|
290
|
+
.filter((entry) => entry.files.length > 0)
|
|
291
|
+
.sort((a, b) => cmp(a.id, b.id));
|
|
217
292
|
parts.sort((a, b) => cmp(a.kind, b.kind) || cmp(a.id, b.id) || cmp(a.owner ?? "", b.owner ?? ""));
|
|
218
293
|
const entries = parts.map(({ kind, id, hash, why, owner }) => ({ kind, id, hash, why, owner }));
|
|
219
|
-
return { hash: sha256Hex(canonicalJson(entries)), parts };
|
|
294
|
+
return { hash: sha256Hex(canonicalJson(entries)), parts, unexercised, dependencyInternals };
|
|
295
|
+
}
|
|
296
|
+
/** True when a slice claims a file a resource's path matches: the resource is the slice's own, not only one it talks to. */
|
|
297
|
+
function ownsResource(claimedFiles, resourceFiles) {
|
|
298
|
+
if (claimedFiles.length === 0 || resourceFiles.length === 0)
|
|
299
|
+
return false;
|
|
300
|
+
const files = new Set(resourceFiles);
|
|
301
|
+
return claimedFiles.some((path) => files.has(path));
|
|
220
302
|
}
|
|
221
303
|
const partKey = (p) => `${p.kind} ${p.id}${p.owner === undefined ? "" : ` (${p.owner})`}`;
|
|
222
304
|
/** The parts that differ between two subjects, as `kind id` keys, sorted: added, removed or changed. */
|
package/dist/subject.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.js","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,aAAa,EAAc,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,cAAc;IACd,UAAU;IACV,OAAO;IACP,YAAY;IACZ,UAAU;IACV,eAAe;IACf,MAAM;IACN,aAAa;IACb,cAAc;CACN,CAAC;AA6CX,8GAA8G;AAC9G,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;AAE/B,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,C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E,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1D,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,OAA4B;IAC9E,OAAO,OAAO,CAAC,KAAK;SACjB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAC1D,GAAG,CAAC,OAAO,CAAC;SACZ,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentset/verification",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Run records, evidence freshness classification, and test-reporter adapters.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intentset",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@intentset/core": "^0.7.
|
|
38
|
+
"@intentset/core": "^0.7.1"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/adapters/common.ts
CHANGED
|
@@ -22,8 +22,12 @@ export interface ParsedRun {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface ToRunRecordsOptions {
|
|
25
|
-
/**
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Selector -> the verification ID, or every verification ID, that names it, from the graph's automated
|
|
27
|
+
* verifications. A selector two verifications share (one test verifying two behaviors) gives each of them its own
|
|
28
|
+
* record from the same tests.
|
|
29
|
+
*/
|
|
30
|
+
verifications: ReadonlyMap<string, string | readonly string[]>;
|
|
27
31
|
commit: string;
|
|
28
32
|
graphHash: string;
|
|
29
33
|
environment: string;
|
|
@@ -43,9 +47,9 @@ export interface ToRunRecordsOptions {
|
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
export interface ConvertedRun {
|
|
46
|
-
/** One record per verification at least one test matched, by verification ID. */
|
|
50
|
+
/** One record per verification whose selector at least one test matched, by verification ID. */
|
|
47
51
|
records: RunRecord[];
|
|
48
|
-
/** Selectors no test matched, sorted:
|
|
52
|
+
/** Selectors no test matched, sorted and listed once however many verifications name them: those verifications get no record from this run, and read as missing. */
|
|
49
53
|
unmatched: string[];
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -88,8 +92,8 @@ export function worst(a: RunResult, b: RunResult): RunResult {
|
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
/**
|
|
91
|
-
* One run record per verification whose selector matched at least one test
|
|
92
|
-
* Several matching tests make one record with the worst result and a
|
|
95
|
+
* One run record per verification whose selector matched at least one test,
|
|
96
|
+
* so a selector two verifications share gives each its own record. Several matching tests make one record with the worst result and a
|
|
93
97
|
* rationale that counts them. Throws when the options would make a malformed
|
|
94
98
|
* record, since that is a caller's mistake rather than evidence.
|
|
95
99
|
*/
|
|
@@ -97,16 +101,19 @@ export function toRunRecords(parsed: ParsedRun, options: ToRunRecordsOptions): C
|
|
|
97
101
|
const matched = new Map<string, { selectors: Set<string>; tests: Set<number> }>();
|
|
98
102
|
const unmatched: string[] = [];
|
|
99
103
|
for (const selector of [...options.verifications.keys()].sort(compareStrings)) {
|
|
100
|
-
const
|
|
104
|
+
const named = options.verifications.get(selector) as string | readonly string[];
|
|
105
|
+
const verificationIds = [...new Set(typeof named === "string" ? [named] : named)].sort(compareStrings);
|
|
101
106
|
const hits = parsed.tests.flatMap((test, index) => (selectorMatches(selector, test.fullName) ? [index] : []));
|
|
102
107
|
if (hits.length === 0) {
|
|
103
108
|
unmatched.push(selector);
|
|
104
109
|
continue;
|
|
105
110
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
for (const verificationId of verificationIds) {
|
|
112
|
+
const entry = matched.get(verificationId) ?? { selectors: new Set<string>(), tests: new Set<number>() };
|
|
113
|
+
entry.selectors.add(selector);
|
|
114
|
+
for (const hit of hits) entry.tests.add(hit);
|
|
115
|
+
matched.set(verificationId, entry);
|
|
116
|
+
}
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
const records: RunRecord[] = [];
|
package/src/classify.ts
CHANGED
|
@@ -99,7 +99,7 @@ export interface Classification {
|
|
|
99
99
|
unknown: RunRecord[];
|
|
100
100
|
/** Records that cannot be evidence for the verification they name (EVID001), by evidence ID. */
|
|
101
101
|
rejected: RejectedRecord[];
|
|
102
|
-
/** EVID001, EVID002, EVID004 and
|
|
102
|
+
/** EVID001, EVID002, EVID004, EVID005, EVID006 and EVID007, sorted. */
|
|
103
103
|
diagnostics: Diagnostic[];
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -113,6 +113,20 @@ const NOTE_COMMIT_UNKNOWN = "commit unknown; matched on graph hash";
|
|
|
113
113
|
/** The most files EVID005 lists; the rest are counted. */
|
|
114
114
|
export const UNCLAIMED_LIMIT = 20;
|
|
115
115
|
|
|
116
|
+
/** The most verifications EVID006 lists, and the most files it lists for each resource; the rest are counted. */
|
|
117
|
+
export const UNEXERCISED_LIMIT = 20;
|
|
118
|
+
const UNEXERCISED_FILES = 5;
|
|
119
|
+
|
|
120
|
+
/** The most verifications EVID007 lists, and the most files it lists for each dependency slice; the rest are counted. */
|
|
121
|
+
export const DEPENDENCY_INTERNALS_LIMIT = 20;
|
|
122
|
+
const DEPENDENCY_INTERNALS_FILES = 5;
|
|
123
|
+
|
|
124
|
+
/** What EVID007 collects: per dependency slice, the changed files of it outside its entrypoints and the current verifications that depend on it. */
|
|
125
|
+
type Internals = Map<string, { files: Set<string>; verifications: Set<string> }>;
|
|
126
|
+
|
|
127
|
+
/** What EVID006 collects: per resource, the changed files of it and the current verifications that use it without exercising it. */
|
|
128
|
+
type Unexercised = Map<string, { files: Set<string>; verifications: Set<string> }>;
|
|
129
|
+
|
|
116
130
|
const short = (commit: string) => commit.slice(0, 9);
|
|
117
131
|
|
|
118
132
|
/** Core §8: classify every verification in the graph against the snapshot. Deterministic for identical inputs. */
|
|
@@ -198,6 +212,8 @@ export function classifyEvidence(
|
|
|
198
212
|
|
|
199
213
|
const verifications: Record<string, VerificationEvidence> = {};
|
|
200
214
|
const unclaimed = new Set<string>();
|
|
215
|
+
const unexercised: Unexercised = new Map();
|
|
216
|
+
const internals: Internals = new Map();
|
|
201
217
|
for (const id of ids) {
|
|
202
218
|
const artifact = graph.artifacts.get(id);
|
|
203
219
|
const history = (inScope.get(id) ?? []).sort(compareRecords);
|
|
@@ -209,8 +225,12 @@ export function classifyEvidence(
|
|
|
209
225
|
snapshot,
|
|
210
226
|
binding,
|
|
211
227
|
unclaimed,
|
|
228
|
+
unexercised,
|
|
229
|
+
internals,
|
|
212
230
|
);
|
|
213
231
|
}
|
|
232
|
+
// A file of a resource EVID006 reports is not listed here as well: EVID006 says more (which verifications use it).
|
|
233
|
+
for (const entry of unexercised.values()) for (const file of entry.files) unclaimed.delete(file);
|
|
214
234
|
if (unclaimed.size > 0) {
|
|
215
235
|
const files = [...unclaimed].sort(compareStrings);
|
|
216
236
|
const listed = files.slice(0, UNCLAIMED_LIMIT);
|
|
@@ -220,9 +240,56 @@ export function classifyEvidence(
|
|
|
220
240
|
severity: "warning",
|
|
221
241
|
artifact: null,
|
|
222
242
|
path: null,
|
|
223
|
-
message: `${files.length} file${files.length === 1 ? "" : "s"} changed since the commit of a subject-bound record and no slice claims, no
|
|
243
|
+
message: `${files.length} file${files.length === 1 ? "" : "s"} changed since the commit of a subject-bound record and no slice claims, no exercised resource names and no global input lists ${files.length === 1 ? "it" : "them"}, so ${files.length === 1 ? "it" : "they"} cannot make any evidence stale: ${listed.join(", ")}${files.length > listed.length ? `, and ${files.length - listed.length} more` : ""}.`,
|
|
244
|
+
remediation:
|
|
245
|
+
"Claim the file in a slice (the architecture check's unclaimed files rule), name its resource in a verification's `exercises`, or list it in `evidence.globalInputs` if it affects every check (Core §8).",
|
|
246
|
+
}),
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
if (unexercised.size > 0) {
|
|
250
|
+
const resources = [...unexercised].sort(([a], [b]) => compareStrings(a, b));
|
|
251
|
+
const all = new Set<string>();
|
|
252
|
+
for (const [, entry] of resources) for (const id of entry.verifications) all.add(id);
|
|
253
|
+
const verifications = [...all].sort(compareStrings);
|
|
254
|
+
const listed = verifications.slice(0, UNEXERCISED_LIMIT);
|
|
255
|
+
const what = resources.map(([id, entry]) => {
|
|
256
|
+
const files = [...entry.files].sort(compareStrings);
|
|
257
|
+
const shown = files.slice(0, UNEXERCISED_FILES).join(", ");
|
|
258
|
+
return `${id} (${shown}${files.length > UNEXERCISED_FILES ? `, and ${files.length - UNEXERCISED_FILES} more` : ""})`;
|
|
259
|
+
});
|
|
260
|
+
diagnostics.push(
|
|
261
|
+
evidenceDiagnostic({
|
|
262
|
+
code: "EVID006",
|
|
263
|
+
severity: "warning",
|
|
264
|
+
artifact: null,
|
|
265
|
+
path: null,
|
|
266
|
+
message: `${verifications.length} verification${verifications.length === 1 ? " is" : "s are"} current though a resource ${verifications.length === 1 ? "it uses" : "they use"} and ${verifications.length === 1 ? "does" : "do"} not exercise changed since the commit of ${verifications.length === 1 ? "its" : "their"} record: ${what.join("; ")}; ${listed.join(", ")}${verifications.length > listed.length ? `, and ${verifications.length - listed.length} more` : ""}.`,
|
|
224
267
|
remediation:
|
|
225
|
-
"
|
|
268
|
+
"Where a check does depend on that resource, name it in the verification's `exercises` so a change to it makes the record stale, or set `evidence.resources: used` to hash every resource a slice lists (Core §8).",
|
|
269
|
+
}),
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (internals.size > 0) {
|
|
274
|
+
const slices = [...internals].sort(([a], [b]) => compareStrings(a, b));
|
|
275
|
+
const all = new Set<string>();
|
|
276
|
+
for (const [, entry] of slices) for (const id of entry.verifications) all.add(id);
|
|
277
|
+
const verifications = [...all].sort(compareStrings);
|
|
278
|
+
const listed = verifications.slice(0, DEPENDENCY_INTERNALS_LIMIT);
|
|
279
|
+
const what = slices.map(([id, entry]) => {
|
|
280
|
+
const files = [...entry.files].sort(compareStrings);
|
|
281
|
+
const shown = files.slice(0, DEPENDENCY_INTERNALS_FILES).join(", ");
|
|
282
|
+
return `${id} (${shown}${files.length > DEPENDENCY_INTERNALS_FILES ? `, and ${files.length - DEPENDENCY_INTERNALS_FILES} more` : ""})`;
|
|
283
|
+
});
|
|
284
|
+
diagnostics.push(
|
|
285
|
+
evidenceDiagnostic({
|
|
286
|
+
code: "EVID007",
|
|
287
|
+
severity: "warning",
|
|
288
|
+
artifact: null,
|
|
289
|
+
path: null,
|
|
290
|
+
message: `${verifications.length} verification${verifications.length === 1 ? " is" : "s are"} current though a slice ${verifications.length === 1 ? "it depends" : "they depend"} on changed outside its entrypoints and contracts since the commit of ${verifications.length === 1 ? "its" : "their"} record: ${what.join("; ")}; ${listed.join(", ")}${verifications.length > listed.length ? `, and ${verifications.length - listed.length} more` : ""}.`,
|
|
291
|
+
remediation:
|
|
292
|
+
"Where a check does depend on that slice's internals, name the slice in the verification's `exercises` so a change to it makes the record stale, or set `evidence.dependencies: files` to hash every file a dependency claims (Core §8).",
|
|
226
293
|
}),
|
|
227
294
|
);
|
|
228
295
|
}
|
|
@@ -256,6 +323,8 @@ function classifyOne(
|
|
|
256
323
|
snapshot: EvidenceSnapshot,
|
|
257
324
|
binding: EvidenceBinding,
|
|
258
325
|
unclaimed: Set<string>,
|
|
326
|
+
unexercised: Unexercised,
|
|
327
|
+
internals: Internals,
|
|
259
328
|
): VerificationEvidence {
|
|
260
329
|
const counts: ResultCounts = { pass: 0, fail: 0, skip: 0, error: 0 };
|
|
261
330
|
const subjectHash = binding === "subject" ? (snapshot.subjects?.get(verificationId)?.hash ?? null) : null;
|
|
@@ -302,6 +371,8 @@ function classifyOne(
|
|
|
302
371
|
const notes: (string | null)[] = [];
|
|
303
372
|
if (binding === "subject") {
|
|
304
373
|
const unlisted = collectUnclaimed(latest, snapshot, unclaimed);
|
|
374
|
+
collectUnexercised(verificationId, latest, subject, snapshot, unexercised);
|
|
375
|
+
collectInternals(verificationId, latest, subject, snapshot, internals);
|
|
305
376
|
notes.push(`judged by subject binding; the run was at commit ${short(latest.commit)}${unlisted}`);
|
|
306
377
|
} else if (snapshot.commit === null) notes.push(NOTE_COMMIT_UNKNOWN);
|
|
307
378
|
notes.push(ignored);
|
|
@@ -345,6 +416,58 @@ function collectUnclaimed(latest: RunRecord, snapshot: EvidenceSnapshot, unclaim
|
|
|
345
416
|
return "";
|
|
346
417
|
}
|
|
347
418
|
|
|
419
|
+
/**
|
|
420
|
+
* Collects the resources a current record's verification uses without exercising (EVID006) whose files changed since
|
|
421
|
+
* the record's commit: the subject cannot see them, so the record stays current, and the report says so. It asks for
|
|
422
|
+
* the same `changedSince` as EVID005, and has nothing to say when that cannot be answered (EVID005's note says so).
|
|
423
|
+
*/
|
|
424
|
+
function collectUnexercised(
|
|
425
|
+
verificationId: string,
|
|
426
|
+
latest: RunRecord,
|
|
427
|
+
subject: Subject | undefined,
|
|
428
|
+
snapshot: EvidenceSnapshot,
|
|
429
|
+
unexercised: Unexercised,
|
|
430
|
+
): void {
|
|
431
|
+
if (snapshot.changedSince === undefined || subject === undefined || subject.unexercised.length === 0) return;
|
|
432
|
+
const changed = snapshot.changedSince(latest.commit);
|
|
433
|
+
if (changed === null || changed.length === 0) return;
|
|
434
|
+
const moved = new Set(changed);
|
|
435
|
+
for (const resource of subject.unexercised) {
|
|
436
|
+
const files = resource.files.filter((path) => moved.has(path));
|
|
437
|
+
if (files.length === 0) continue;
|
|
438
|
+
const entry = unexercised.get(resource.id) ?? { files: new Set<string>(), verifications: new Set<string>() };
|
|
439
|
+
for (const path of files) entry.files.add(path);
|
|
440
|
+
entry.verifications.add(verificationId);
|
|
441
|
+
unexercised.set(resource.id, entry);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Collects the dependency slices a current record's verification counts only through their entrypoints and contracts
|
|
447
|
+
* (EVID007) whose other files changed since the record's commit: the subject cannot see them, so the record stays
|
|
448
|
+
* current, and the report says so. Like EVID006 it has nothing to say when git cannot answer.
|
|
449
|
+
*/
|
|
450
|
+
function collectInternals(
|
|
451
|
+
verificationId: string,
|
|
452
|
+
latest: RunRecord,
|
|
453
|
+
subject: Subject | undefined,
|
|
454
|
+
snapshot: EvidenceSnapshot,
|
|
455
|
+
internals: Internals,
|
|
456
|
+
): void {
|
|
457
|
+
if (snapshot.changedSince === undefined || subject === undefined || subject.dependencyInternals.length === 0) return;
|
|
458
|
+
const changed = snapshot.changedSince(latest.commit);
|
|
459
|
+
if (changed === null || changed.length === 0) return;
|
|
460
|
+
const moved = new Set(changed);
|
|
461
|
+
for (const slice of subject.dependencyInternals) {
|
|
462
|
+
const files = slice.files.filter((path) => moved.has(path));
|
|
463
|
+
if (files.length === 0) continue;
|
|
464
|
+
const entry = internals.get(slice.id) ?? { files: new Set<string>(), verifications: new Set<string>() };
|
|
465
|
+
for (const path of files) entry.files.add(path);
|
|
466
|
+
entry.verifications.add(verificationId);
|
|
467
|
+
internals.set(slice.id, entry);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
348
471
|
function withNote(evidence: Omit<VerificationEvidence, "note">, notes: (string | null)[]): VerificationEvidence {
|
|
349
472
|
const present = notes.filter((note): note is string => note !== null);
|
|
350
473
|
const {
|
package/src/subject.ts
CHANGED
|
@@ -14,8 +14,26 @@
|
|
|
14
14
|
* `verification.exercises`: each by the hash of its **binding fields**
|
|
15
15
|
* (`implements`, `dependsOn`, `claims`, `usesResources`, `entrypoints`;
|
|
16
16
|
* never its prose) and the content of every file its claims resolve to;
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* A slice reached only through `dependsOn` is a **dependency**: under
|
|
18
|
+
* `dependencies: "entrypoint"` (`evidence.dependencies`) it contributes its
|
|
19
|
+
* binding fields, the files of its `entrypoints` and the records of the
|
|
20
|
+
* contracts it exposes or consumes and the decisions those name (a
|
|
21
|
+
* `contract` and a `decision` part), not its other claimed files; the
|
|
22
|
+
* files left out are `dependencyInternals`, so a report can say what the
|
|
23
|
+
* subject could not see (EVID007). An implementing slice and an exercised
|
|
24
|
+
* slice always contribute every file. `dependencies: "files"` is the rule
|
|
25
|
+
* of Core §8 up to 0.7.0 (ADR 0013, amended 2026-10-15, second);
|
|
26
|
+
* - the resources the verification exercises: each by its registry entry and
|
|
27
|
+
* the content of the files its path matches. A resource counts where
|
|
28
|
+
* `verification.exercises` names it, or where a slice that implements a
|
|
29
|
+
* verified behavior lists it in `usesResources` and also claims a file it
|
|
30
|
+
* matches (the slice's own resource). A resource a slice merely lists is not
|
|
31
|
+
* hashed, so a change to a backend a web slice talks to does not move every
|
|
32
|
+
* check of that slice; `resourceMode: "used"` (`evidence.resources: used`)
|
|
33
|
+
* hashes the files of every resource an included slice lists, as Core §8
|
|
34
|
+
* did from 0.7.0 to 0.7.1 (ADR 0013, amended 2026-10-15). What a subject
|
|
35
|
+
* leaves out is `unexercised`, so a report can say what it could not see
|
|
36
|
+
* (EVID006);
|
|
19
37
|
* - the test file (`locator`) and the local files it imports, transitively,
|
|
20
38
|
* which the caller resolves (`localImports`) with the architecture
|
|
21
39
|
* package's resolver and stops at a package boundary;
|
|
@@ -28,13 +46,22 @@
|
|
|
28
46
|
* `absent`, so a deleted file moves the subject. `parts` carries each entry,
|
|
29
47
|
* so a report can say which part moved (`movedParts`).
|
|
30
48
|
*/
|
|
31
|
-
import {
|
|
49
|
+
import {
|
|
50
|
+
canonicalJson,
|
|
51
|
+
DEFAULT_EVIDENCE_DEPENDENCIES,
|
|
52
|
+
type EvidenceDependencies,
|
|
53
|
+
type EvidenceResources,
|
|
54
|
+
type Graph,
|
|
55
|
+
sha256Hex,
|
|
56
|
+
} from "@intentset/core";
|
|
32
57
|
|
|
33
58
|
export const SUBJECT_PART_KINDS = [
|
|
34
59
|
"verification",
|
|
35
60
|
"verified",
|
|
36
61
|
"slice",
|
|
37
62
|
"slice-file",
|
|
63
|
+
"contract",
|
|
64
|
+
"decision",
|
|
38
65
|
"resource",
|
|
39
66
|
"resource-file",
|
|
40
67
|
"test",
|
|
@@ -56,10 +83,26 @@ export interface SubjectPart {
|
|
|
56
83
|
path?: string;
|
|
57
84
|
}
|
|
58
85
|
|
|
86
|
+
/** A registry resource an included slice lists in `usesResources` that the subject does not hash, with the files its path matches. */
|
|
87
|
+
export interface UnexercisedResource {
|
|
88
|
+
id: string;
|
|
89
|
+
files: string[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** A dependency slice whose claimed files the subject does not hash (`dependencies: "entrypoint"`), with those files. */
|
|
93
|
+
export interface DependencyInternals {
|
|
94
|
+
id: string;
|
|
95
|
+
files: string[];
|
|
96
|
+
}
|
|
97
|
+
|
|
59
98
|
export interface Subject {
|
|
60
99
|
hash: string;
|
|
61
100
|
/** Sorted by kind, then ID. */
|
|
62
101
|
parts: SubjectPart[];
|
|
102
|
+
/** The resources the included slices list that this subject leaves out, sorted by ID; always empty under `resourceMode: "used"`. Not part of the hash. */
|
|
103
|
+
unexercised: UnexercisedResource[];
|
|
104
|
+
/** The dependency slices whose internal files this subject leaves out, sorted by ID; always empty under `dependencies: "files"`. Not part of the hash. */
|
|
105
|
+
dependencyInternals: DependencyInternals[];
|
|
63
106
|
}
|
|
64
107
|
|
|
65
108
|
/** A registry resource as the subject sees it: its record, and the files its path matches. */
|
|
@@ -79,6 +122,10 @@ export interface SubjectInput {
|
|
|
79
122
|
sliceFiles: ReadonlyMap<string, readonly string[]> | Readonly<Record<string, readonly string[]>>;
|
|
80
123
|
/** Registry resource ID to its record and files; absent means the repository declares none. */
|
|
81
124
|
resources?: ReadonlyMap<string, SubjectResource>;
|
|
125
|
+
/** Which resource files count (`evidence.resources`): `exercised`, the default, or `used`. */
|
|
126
|
+
resourceMode?: EvidenceResources;
|
|
127
|
+
/** What a dependency slice contributes (`evidence.dependencies`): `DEFAULT_EVIDENCE_DEPENDENCIES` when absent. */
|
|
128
|
+
dependencyMode?: EvidenceDependencies;
|
|
82
129
|
/** The local files a file imports, transitively and without the file itself, stopping at a package boundary. */
|
|
83
130
|
localImports?: (path: string) => readonly string[];
|
|
84
131
|
/** Files whose change affects every check and that belong to no slice (`evidence.globalInputs`), as paths. */
|
|
@@ -142,6 +189,20 @@ export function includedSlices(graph: Graph, verificationId: string): Map<string
|
|
|
142
189
|
return new Map([...why].sort(([a], [b]) => cmp(a, b)).map(([id, set]) => [id, [...set].sort(cmp).join(",")]));
|
|
143
190
|
}
|
|
144
191
|
|
|
192
|
+
/** The contracts a slice exposes or consumes: its public contract records, whose change a dependent sees. */
|
|
193
|
+
export function contractsOf(graph: Graph, id: string): string[] {
|
|
194
|
+
const out = new Set<string>();
|
|
195
|
+
for (const edge of graph.out.get(id) ?? []) {
|
|
196
|
+
if (
|
|
197
|
+
(edge.kind === "exposes" || edge.kind === "consumes") &&
|
|
198
|
+
graph.artifacts.get(edge.to)?.meta.type === "contract"
|
|
199
|
+
) {
|
|
200
|
+
out.add(edge.to);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return [...out].sort(cmp);
|
|
204
|
+
}
|
|
205
|
+
|
|
145
206
|
/** The binding fields of a slice record, canonical: what the subject hashes of it instead of the whole record. */
|
|
146
207
|
export function sliceBinding(graph: Graph, id: string): unknown {
|
|
147
208
|
const artifact = graph.artifacts.get(id);
|
|
@@ -198,6 +259,10 @@ export function computeSubject(input: SubjectInput): Subject {
|
|
|
198
259
|
}
|
|
199
260
|
for (const id of targets) parts.push(recordPart("verified", id));
|
|
200
261
|
|
|
262
|
+
const mode = input.resourceMode ?? "exercised";
|
|
263
|
+
const dependencyMode = input.dependencyMode ?? DEFAULT_EVIDENCE_DEPENDENCIES;
|
|
264
|
+
const internal = new Map<string, string[]>();
|
|
265
|
+
const contractIds = new Set<string>();
|
|
201
266
|
const resourceWhy = new Map<string, Set<string>>();
|
|
202
267
|
const useResource = (id: string, reason: string) => {
|
|
203
268
|
if (input.resources?.has(id) !== true) return;
|
|
@@ -205,6 +270,7 @@ export function computeSubject(input: SubjectInput): Subject {
|
|
|
205
270
|
set.add(reason);
|
|
206
271
|
resourceWhy.set(id, set);
|
|
207
272
|
};
|
|
273
|
+
const listed = new Set<string>();
|
|
208
274
|
for (const id of exercisesOf(graph, verificationId)) useResource(id, "exercises");
|
|
209
275
|
|
|
210
276
|
for (const [id, why] of includedSlices(graph, verificationId)) {
|
|
@@ -216,11 +282,37 @@ export function computeSubject(input: SubjectInput): Subject {
|
|
|
216
282
|
why,
|
|
217
283
|
...(artifact === undefined ? {} : { path: artifact.path }),
|
|
218
284
|
});
|
|
219
|
-
|
|
220
|
-
|
|
285
|
+
const dependency = why === "dependsOn";
|
|
286
|
+
if (dependency && dependencyMode === "entrypoint") {
|
|
287
|
+
const surface = new Set(artifact?.meta.slice?.entrypoints ?? []);
|
|
288
|
+
for (const path of [...surface].sort(cmp)) {
|
|
289
|
+
parts.push({ kind: "slice-file", id: path, hash: fileHash(path), owner: id, path });
|
|
290
|
+
}
|
|
291
|
+
internal.set(id, [...new Set(claimed(id))].filter((path) => !surface.has(path)).sort(cmp));
|
|
292
|
+
for (const contract of contractsOf(graph, id)) contractIds.add(contract);
|
|
293
|
+
} else {
|
|
294
|
+
for (const path of [...new Set(claimed(id))].sort(cmp)) {
|
|
295
|
+
parts.push({ kind: "slice-file", id: path, hash: fileHash(path), owner: id, path });
|
|
296
|
+
}
|
|
221
297
|
}
|
|
222
|
-
|
|
298
|
+
const implementing = why.split(",").includes("implements");
|
|
299
|
+
for (const resource of artifact?.meta.slice?.usesResources ?? []) {
|
|
300
|
+
if (input.resources?.has(resource) !== true) continue;
|
|
301
|
+
if (mode === "used" || (implementing && ownsResource(claimed(id), input.resources.get(resource)?.files ?? []))) {
|
|
302
|
+
useResource(resource, "usesResources");
|
|
303
|
+
} else listed.add(resource);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
const decisionIds = new Set<string>();
|
|
307
|
+
for (const id of [...contractIds].sort(cmp)) {
|
|
308
|
+
parts.push(recordPart("contract", id));
|
|
309
|
+
for (const edge of graph.out.get(id) ?? []) if (edge.kind === "informedBy") decisionIds.add(edge.to);
|
|
223
310
|
}
|
|
311
|
+
for (const id of [...decisionIds].sort(cmp)) parts.push(recordPart("decision", id));
|
|
312
|
+
const unexercised: UnexercisedResource[] = [...listed]
|
|
313
|
+
.filter((id) => !resourceWhy.has(id))
|
|
314
|
+
.sort(cmp)
|
|
315
|
+
.map((id) => ({ id, files: [...new Set(input.resources?.get(id)?.files ?? [])].sort(cmp) }));
|
|
224
316
|
|
|
225
317
|
for (const [id, set] of resourceWhy) {
|
|
226
318
|
const resource = input.resources?.get(id) as SubjectResource;
|
|
@@ -246,9 +338,23 @@ export function computeSubject(input: SubjectInput): Subject {
|
|
|
246
338
|
parts.push({ kind: "global-input", id: path, hash: fileHash(path), path });
|
|
247
339
|
}
|
|
248
340
|
|
|
341
|
+
// A claimed file of a dependency that another part hashes (an entrypoint of another slice, the test, a global input) is seen.
|
|
342
|
+
const hashed = new Set(parts.filter((p) => p.path !== undefined).map((p) => p.path));
|
|
343
|
+
const dependencyInternals: DependencyInternals[] = [...internal]
|
|
344
|
+
.map(([id, files]) => ({ id, files: files.filter((path) => !hashed.has(path)) }))
|
|
345
|
+
.filter((entry) => entry.files.length > 0)
|
|
346
|
+
.sort((a, b) => cmp(a.id, b.id));
|
|
347
|
+
|
|
249
348
|
parts.sort((a, b) => cmp(a.kind, b.kind) || cmp(a.id, b.id) || cmp(a.owner ?? "", b.owner ?? ""));
|
|
250
349
|
const entries = parts.map(({ kind, id, hash, why, owner }) => ({ kind, id, hash, why, owner }));
|
|
251
|
-
return { hash: sha256Hex(canonicalJson(entries)), parts };
|
|
350
|
+
return { hash: sha256Hex(canonicalJson(entries)), parts, unexercised, dependencyInternals };
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/** True when a slice claims a file a resource's path matches: the resource is the slice's own, not only one it talks to. */
|
|
354
|
+
function ownsResource(claimedFiles: readonly string[], resourceFiles: readonly string[]): boolean {
|
|
355
|
+
if (claimedFiles.length === 0 || resourceFiles.length === 0) return false;
|
|
356
|
+
const files = new Set(resourceFiles);
|
|
357
|
+
return claimedFiles.some((path) => files.has(path));
|
|
252
358
|
}
|
|
253
359
|
|
|
254
360
|
const partKey = (p: SubjectPart) => `${p.kind} ${p.id}${p.owner === undefined ? "" : ` (${p.owner})`}`;
|