@intentset/verification 0.6.0 → 0.7.0
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 +50 -0
- package/dist/adapters/common.d.ts +6 -0
- package/dist/adapters/common.d.ts.map +1 -1
- package/dist/adapters/common.js +2 -0
- package/dist/adapters/common.js.map +1 -1
- package/dist/adapters/playwright.d.ts +3 -0
- package/dist/adapters/playwright.d.ts.map +1 -0
- package/dist/adapters/playwright.js +78 -0
- package/dist/adapters/playwright.js.map +1 -0
- package/dist/binding.d.ts +31 -0
- package/dist/binding.d.ts.map +1 -0
- package/dist/binding.js +46 -0
- package/dist/binding.js.map +1 -0
- package/dist/classify.d.ts +35 -7
- package/dist/classify.d.ts.map +1 -1
- package/dist/classify.js +104 -14
- package/dist/classify.js.map +1 -1
- package/dist/fixture.d.ts +18 -2
- package/dist/fixture.d.ts.map +1 -1
- package/dist/fixture.js +23 -3
- package/dist/fixture.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/records.d.ts +8 -1
- package/dist/records.d.ts.map +1 -1
- package/dist/records.js +24 -1
- package/dist/records.js.map +1 -1
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +4 -0
- package/dist/report.js.map +1 -1
- package/dist/stale.d.ts +65 -0
- package/dist/stale.d.ts.map +1 -0
- package/dist/stale.js +95 -0
- package/dist/stale.js.map +1 -0
- package/dist/subject.d.ts +92 -0
- package/dist/subject.d.ts.map +1 -0
- package/dist/subject.js +247 -0
- package/dist/subject.js.map +1 -0
- package/package.json +9 -2
- package/src/adapters/common.ts +8 -0
- package/src/adapters/playwright.ts +94 -0
- package/src/binding.ts +68 -0
- package/src/classify.ts +165 -14
- package/src/fixture.ts +36 -3
- package/src/index.ts +4 -0
- package/src/records.ts +40 -2
- package/src/report.ts +4 -0
- package/src/stale.ts +160 -0
- package/src/subject.ts +277 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @intentset/verification
|
|
2
|
+
|
|
3
|
+
Run records and what they prove (Core §8): reading and checking records, classifying each as current, stale or
|
|
4
|
+
missing against the snapshot it ran at, coverage that counts links and current passes separately, and adapters that
|
|
5
|
+
turn a Vitest JSON report or node's TAP output into records.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @intentset/verification
|
|
11
|
+
pnpm add @intentset/verification
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
In CI, after the tests, turn the report into run records bound to this commit and graph, through the CLI,
|
|
17
|
+
`@intentset/cli`:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx -p @intentset/cli intentset evidence import --from vitest reports/vitest.json \
|
|
21
|
+
--out .intentset/evidence/ci.json --product PRD-X --release <label>
|
|
22
|
+
npx -p @intentset/cli intentset validate --level L3 --product PRD-X --release <label>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
With pnpm, `pnpm dlx --package=@intentset/cli intentset …`, or `pnpm exec intentset …` once `@intentset/cli` is
|
|
26
|
+
installed. The command is always `@intentset/cli`'s: this package has no `intentset` binary, and npx asked
|
|
27
|
+
for `intentset` alone would fetch an unrelated unscoped package from the registry.
|
|
28
|
+
|
|
29
|
+
From code:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { readFile } from "node:fs/promises";
|
|
33
|
+
import { readRunRecords } from "@intentset/verification";
|
|
34
|
+
|
|
35
|
+
const path = ".intentset/evidence/ci.json";
|
|
36
|
+
const { records, diagnostics } = readRunRecords(JSON.parse(await readFile(path, "utf8")), path);
|
|
37
|
+
// a record with any problem is reported as EVID001 and left out, so it never counts as evidence
|
|
38
|
+
```
|
|
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.
|
|
41
|
+
|
|
42
|
+
## Learn more
|
|
43
|
+
|
|
44
|
+
Part of [Intentset](https://intentset.org/), which keeps product intent connected to the code that delivers it and the
|
|
45
|
+
checks that verify it, as readable Markdown files in a repository. The specifications are at
|
|
46
|
+
https://intentset.org/specifications/ and the source at https://github.com/intentset/intentset.
|
|
47
|
+
|
|
48
|
+
## Licence
|
|
49
|
+
|
|
50
|
+
MIT
|
|
@@ -23,6 +23,12 @@ export interface ToRunRecordsOptions {
|
|
|
23
23
|
finishedAt: string;
|
|
24
24
|
/** Where the run's report lives; each record's uri is this plus `#` and the verification ID. */
|
|
25
25
|
uriBase: string;
|
|
26
|
+
/**
|
|
27
|
+
* Verification ID -> the hash of its subject, when the effective binding is subject (Core §8): a record is then
|
|
28
|
+
* written with `binding: "subject"` and that hash, and the commit and graph hash stay as provenance. A
|
|
29
|
+
* verification with no entry, or no map at all, gets a commit-binding record.
|
|
30
|
+
*/
|
|
31
|
+
subjects?: ReadonlyMap<string, string>;
|
|
26
32
|
}
|
|
27
33
|
export interface ConvertedRun {
|
|
28
34
|
/** One record per verification at least one test matched, by verification ID. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/adapters/common.ts"],"names":[],"mappings":"AAQA,OAAO,EAAkB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAE5G,MAAM,WAAW,UAAU;IACzB,yGAAyG;IACzG,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,iGAAiG;IACjG,QAAQ,EAAE,MAAM,EA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H,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,+GAA+G;IAC/G,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,CAmD1F"}
|
package/dist/adapters/common.js
CHANGED
|
@@ -70,6 +70,7 @@ export function toRunRecords(parsed, options) {
|
|
|
70
70
|
.map(([r, n]) => `${n} ${r}`)
|
|
71
71
|
.join(", ");
|
|
72
72
|
const names = [...selectors].sort(compareStrings).join(", ");
|
|
73
|
+
const subjectHash = options.subjects?.get(verificationId);
|
|
73
74
|
records.push({
|
|
74
75
|
evidenceId: deriveEvidenceId(verificationId, options.commit, options.graphHash, options.finishedAt),
|
|
75
76
|
verificationId,
|
|
@@ -83,6 +84,7 @@ export function toRunRecords(parsed, options) {
|
|
|
83
84
|
finishedAt: options.finishedAt,
|
|
84
85
|
result,
|
|
85
86
|
uri: `${options.uriBase}#${encodeURIComponent(verificationId)}`,
|
|
87
|
+
...(subjectHash === undefined ? {} : { binding: "subject", subjectHash }),
|
|
86
88
|
rationale: `${results.length} test${results.length === 1 ? "" : "s"} matched ${names}: ${counts}.`,
|
|
87
89
|
});
|
|
88
90
|
}
|
|
@@ -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;AA2C5G,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,eAAe,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,KAAa;IAC7D,IAAI,QAAQ,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1D,KAAK,IAAI,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACvF,MAAM,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
|
+
export function parsePlaywrightJson(json) {
|
|
2
|
+
if (!isRecord(json) || !Array.isArray(json.suites)) {
|
|
3
|
+
throw new TypeError("This is not Playwright JSON reporter output: expected an object with a suites array.");
|
|
4
|
+
}
|
|
5
|
+
const tests = [];
|
|
6
|
+
const problems = [];
|
|
7
|
+
if (Array.isArray(json.errors)) {
|
|
8
|
+
for (const error of json.errors) {
|
|
9
|
+
problems.push(`The run reported an error: ${firstLine(isRecord(error) ? error.message : error) || "no message"}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
json.suites.forEach((file, index) => {
|
|
13
|
+
if (!isRecord(file))
|
|
14
|
+
throw new TypeError(`suites[${index}] is not an object.`);
|
|
15
|
+
walk(file, [], tests, problems);
|
|
16
|
+
});
|
|
17
|
+
return { tests, problems };
|
|
18
|
+
}
|
|
19
|
+
function walk(suite, ancestors, tests, problems) {
|
|
20
|
+
for (const spec of Array.isArray(suite.specs) ? suite.specs : []) {
|
|
21
|
+
if (!isRecord(spec))
|
|
22
|
+
throw new TypeError("A spec in the report is not an object.");
|
|
23
|
+
const title = typeof spec.title === "string" ? spec.title : "";
|
|
24
|
+
const fullName = [...ancestors, title].join(" > ");
|
|
25
|
+
for (const test of Array.isArray(spec.tests) ? spec.tests : []) {
|
|
26
|
+
if (!isRecord(test))
|
|
27
|
+
throw new TypeError(`${fullName} has a test entry that is not an object.`);
|
|
28
|
+
const result = resultOf(test, fullName, problems);
|
|
29
|
+
tests.push({ fullName, result, durationMs: durationOf(test) });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (const child of Array.isArray(suite.suites) ? suite.suites : []) {
|
|
33
|
+
if (!isRecord(child))
|
|
34
|
+
throw new TypeError("A suite in the report is not an object.");
|
|
35
|
+
const title = typeof child.title === "string" ? child.title : "";
|
|
36
|
+
walk(child, title === "" ? ancestors : [...ancestors, title], tests, problems);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function resultOf(test, fullName, problems) {
|
|
40
|
+
switch (test.status) {
|
|
41
|
+
case "expected":
|
|
42
|
+
case "flaky":
|
|
43
|
+
return "pass";
|
|
44
|
+
case "skipped":
|
|
45
|
+
return "skip";
|
|
46
|
+
case "unexpected":
|
|
47
|
+
return failureKind(lastResult(test));
|
|
48
|
+
default:
|
|
49
|
+
problems.push(`${fullName} has the unknown status ${JSON.stringify(test.status)}, read as error`);
|
|
50
|
+
return "error";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** A timeout or an interrupted run is an error; an assertion that did not hold is a fail; anything else thrown is an error. */
|
|
54
|
+
function failureKind(last) {
|
|
55
|
+
if (last === undefined)
|
|
56
|
+
return "fail";
|
|
57
|
+
if (last.status === "timedOut" || last.status === "interrupted")
|
|
58
|
+
return "error";
|
|
59
|
+
const error = isRecord(last.error) ? last.error : undefined;
|
|
60
|
+
const message = typeof error?.message === "string" ? error.message : "";
|
|
61
|
+
return /\bexpect\(|AssertionError/.test(message) || message === "" ? "fail" : "error";
|
|
62
|
+
}
|
|
63
|
+
function lastResult(test) {
|
|
64
|
+
const results = Array.isArray(test.results) ? test.results : [];
|
|
65
|
+
const last = results[results.length - 1];
|
|
66
|
+
return isRecord(last) ? last : undefined;
|
|
67
|
+
}
|
|
68
|
+
function durationOf(test) {
|
|
69
|
+
const duration = lastResult(test)?.duration;
|
|
70
|
+
return typeof duration === "number" && Number.isFinite(duration) ? duration : null;
|
|
71
|
+
}
|
|
72
|
+
function firstLine(value) {
|
|
73
|
+
return typeof value === "string" ? (value.trim().split("\n")[0] ?? "") : "";
|
|
74
|
+
}
|
|
75
|
+
function isRecord(value) {
|
|
76
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../../src/adapters/playwright.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,mBAAmB,CAAC,IAA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AAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3C,CAAC;AAED,SAAS,UAAU,CAAC,IAA6B;IAC/C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAC5C,OAAO,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AACrF,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which binding judges run evidence (Core §8, ADR 0013) and the subjects it
|
|
3
|
+
* needs. The decision is pure: the repository's configuration and whether it
|
|
4
|
+
* has slice claims. Computing a subject needs what the architecture package
|
|
5
|
+
* resolves (claimed files, import closures), which this package does not
|
|
6
|
+
* depend on, so a caller hands it in as a `SubjectSource`.
|
|
7
|
+
*/
|
|
8
|
+
import type { EvidenceBinding, EvidenceBindingReason, Graph } from "@intentset/core";
|
|
9
|
+
import { type Subject, type SubjectInput } from "./subject.ts";
|
|
10
|
+
export interface BindingDecision {
|
|
11
|
+
binding: EvidenceBinding;
|
|
12
|
+
/** `configured`, `default` (subject, since slices exist) or `no-slices` (commit, since there is nothing to hash). */
|
|
13
|
+
reason: EvidenceBindingReason;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Core §8: `binding: subject` is the default wherever the repository has slice
|
|
17
|
+
* claims; `binding: commit` is the stricter mode a repository or gate asks
|
|
18
|
+
* for; a repository with no slice claims is judged by commit binding unless it
|
|
19
|
+
* asked for that, and says so (EVID004), whatever it asked for.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveBinding(configured: EvidenceBinding | null, hasSlices: boolean): BindingDecision;
|
|
22
|
+
/** True when some slice that is not retired claims files: the repository has a subject to hash. */
|
|
23
|
+
export declare function hasSliceClaims(graph: Graph): boolean;
|
|
24
|
+
/** What a caller resolves for the subject hash: the architecture package's claims and imports, over one tree. */
|
|
25
|
+
export type SubjectSource = Omit<SubjectInput, "graph" | "verificationId"> & {
|
|
26
|
+
/** True for a file that can move some subject: a slice's, a used resource's, a global input, a test, a record. */
|
|
27
|
+
covers: (path: string) => boolean;
|
|
28
|
+
};
|
|
29
|
+
/** The subject of every verification in the graph, by ID, with each file hashed once. */
|
|
30
|
+
export declare function subjectsFor(graph: Graph, source: SubjectSource): Map<string, Subject>;
|
|
31
|
+
//# sourceMappingURL=binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAErF,OAAO,EAA0B,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAGvF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,eAAe,CAAC;IACzB,qHAAqH;IACrH,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,EAAE,SAAS,EAAE,OAAO,GAAG,eAAe,CAItG;AAED,mGAAmG;AACnG,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAUpD;AAED,iHAAiH;AACjH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,gBAAgB,CAAC,GAAG;IAC3E,kHAAkH;IAClH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBrF"}
|
package/dist/binding.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { compareStrings } from "./diagnostic.js";
|
|
2
|
+
import { ABSENT, computeSubject } from "./subject.js";
|
|
3
|
+
import { sha256Hex } from "@intentset/core";
|
|
4
|
+
/**
|
|
5
|
+
* Core §8: `binding: subject` is the default wherever the repository has slice
|
|
6
|
+
* claims; `binding: commit` is the stricter mode a repository or gate asks
|
|
7
|
+
* for; a repository with no slice claims is judged by commit binding unless it
|
|
8
|
+
* asked for that, and says so (EVID004), whatever it asked for.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveBinding(configured, hasSlices) {
|
|
11
|
+
if (configured === "commit")
|
|
12
|
+
return { binding: "commit", reason: "configured" };
|
|
13
|
+
if (!hasSlices)
|
|
14
|
+
return { binding: "commit", reason: "no-slices" };
|
|
15
|
+
return { binding: "subject", reason: configured === "subject" ? "configured" : "default" };
|
|
16
|
+
}
|
|
17
|
+
/** True when some slice that is not retired claims files: the repository has a subject to hash. */
|
|
18
|
+
export function hasSliceClaims(graph) {
|
|
19
|
+
for (const artifact of graph.artifacts.values()) {
|
|
20
|
+
if (artifact.meta.type === "slice" &&
|
|
21
|
+
artifact.meta.status !== "retired" &&
|
|
22
|
+
(artifact.meta.slice?.claims.length ?? 0) > 0)
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
/** The subject of every verification in the graph, by ID, with each file hashed once. */
|
|
28
|
+
export function subjectsFor(graph, source) {
|
|
29
|
+
const hashes = new Map();
|
|
30
|
+
const fileHash = (path) => {
|
|
31
|
+
let hash = hashes.get(path);
|
|
32
|
+
if (hash === undefined) {
|
|
33
|
+
const bytes = source.readFile(path);
|
|
34
|
+
hash = bytes === undefined ? ABSENT : sha256Hex(bytes);
|
|
35
|
+
hashes.set(path, hash);
|
|
36
|
+
}
|
|
37
|
+
return hash;
|
|
38
|
+
};
|
|
39
|
+
const subjects = new Map();
|
|
40
|
+
const ids = [...graph.artifacts.keys()].filter((id) => graph.artifacts.get(id)?.meta.type === "verification");
|
|
41
|
+
for (const id of ids.sort(compareStrings)) {
|
|
42
|
+
subjects.set(id, computeSubject({ ...source, graph, verificationId: id, fileHash }));
|
|
43
|
+
}
|
|
44
|
+
return subjects;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAmC,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkC,EAAE,SAAkB;IACnF,IAAI,UAAU,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAChF,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,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GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;IAC9G,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC1C,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,cAAc,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/classify.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Evidence freshness (Core §8, invariant 3). Only a `pass`
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Evidence freshness (Core §8, invariant 3). Only a `pass` whose binding holds
|
|
3
|
+
* is current: under commit binding, at the assessed commit and graph hash;
|
|
4
|
+
* under subject binding, while the subject it checked is unchanged. Everything
|
|
5
|
+
* else is something else, and says which. A failing current run stays visible
|
|
6
|
+
* however many older passes there are, because the status is decided by the
|
|
7
|
+
* latest current run and every run is kept in the history.
|
|
7
8
|
*/
|
|
8
|
-
import { type Diagnostic, type Graph } from "@intentset/core";
|
|
9
|
+
import { type Diagnostic, type EvidenceBinding, type EvidenceBindingReason, type Graph } from "@intentset/core";
|
|
9
10
|
import { type RunRecord, type RunResult, type RunScope } from "./records.ts";
|
|
11
|
+
import { type Subject } from "./subject.ts";
|
|
10
12
|
export declare const EVIDENCE_STATUSES: readonly ["current-pass", "current-fail", "stale", "skip", "error", "missing", "unresolved"];
|
|
11
13
|
export type EvidenceStatus = (typeof EVIDENCE_STATUSES)[number];
|
|
12
14
|
/** What evidence is assessed against: a commit and graph hash, and the product and release it is for. */
|
|
@@ -17,12 +19,33 @@ export interface EvidenceSnapshot {
|
|
|
17
19
|
graphHash: string;
|
|
18
20
|
/** The exact product and release under assessment. Absent or null considers records of every scope, and reports that it did. */
|
|
19
21
|
scope?: RunScope | null;
|
|
22
|
+
/** The binding in force (Core §8); commit when absent, as before the field existed. */
|
|
23
|
+
binding?: EvidenceBinding;
|
|
24
|
+
/**
|
|
25
|
+
* Why the binding is the one in force: `configured` (the repository asked), `default` (subject, because slices
|
|
26
|
+
* exist) or `no-slices` (commit, because the repository has no slice claims to hash and did not ask for it,
|
|
27
|
+
* which EVID004 says). Absent reads as `configured`.
|
|
28
|
+
*/
|
|
29
|
+
bindingReason?: EvidenceBindingReason;
|
|
30
|
+
/** Under subject binding: the subject of each verification at the snapshot, by verification ID. */
|
|
31
|
+
subjects?: ReadonlyMap<string, Subject>;
|
|
32
|
+
/**
|
|
33
|
+
* The files changed between a record's commit and the assessed commit, or null when the commit is not an
|
|
34
|
+
* ancestor of it or git is unavailable. Optional: it only makes the notes and EVID005 more specific.
|
|
35
|
+
*/
|
|
36
|
+
changedSince?: (commit: string) => readonly string[] | null;
|
|
37
|
+
/** True for a file that can move some subject: claimed, a used resource's, a global input, a test, a record. */
|
|
38
|
+
covers?: (path: string) => boolean;
|
|
20
39
|
}
|
|
21
40
|
export type ResultCounts = Record<RunResult, number>;
|
|
22
41
|
export interface VerificationEvidence {
|
|
23
42
|
verificationId: string;
|
|
24
43
|
method: "automated" | "manual";
|
|
25
44
|
status: EvidenceStatus;
|
|
45
|
+
/** The binding that judged this verification. */
|
|
46
|
+
binding: EvidenceBinding;
|
|
47
|
+
/** Under subject binding, the hash of the subject it was judged at; null under commit binding and when none could be computed. */
|
|
48
|
+
subject: string | null;
|
|
26
49
|
/** Why the status is qualified or what was set aside, when anything was. */
|
|
27
50
|
note?: string;
|
|
28
51
|
/** The record that decided the status: the latest at the snapshot, else the latest in scope; null when there is none. */
|
|
@@ -43,6 +66,9 @@ export interface Classification {
|
|
|
43
66
|
commit: string | null;
|
|
44
67
|
graphHash: string;
|
|
45
68
|
scope: RunScope | null;
|
|
69
|
+
binding: EvidenceBinding;
|
|
70
|
+
/** Why this binding is in force (`configured` when the caller did not say). */
|
|
71
|
+
bindingReason: EvidenceBindingReason;
|
|
46
72
|
};
|
|
47
73
|
/** One entry per verification artifact in the graph, keyed and ordered by ID. */
|
|
48
74
|
verifications: Record<string, VerificationEvidence>;
|
|
@@ -52,13 +78,15 @@ export interface Classification {
|
|
|
52
78
|
unknown: RunRecord[];
|
|
53
79
|
/** Records that cannot be evidence for the verification they name (EVID001), by evidence ID. */
|
|
54
80
|
rejected: RejectedRecord[];
|
|
55
|
-
/** EVID001 and
|
|
81
|
+
/** EVID001, EVID002, EVID004 and EVID005, sorted. */
|
|
56
82
|
diagnostics: Diagnostic[];
|
|
57
83
|
}
|
|
58
84
|
export interface ClassifyOptions {
|
|
59
85
|
/** The file the records were read from, for diagnostics; null when they did not come from one. */
|
|
60
86
|
evidencePath?: string | null;
|
|
61
87
|
}
|
|
88
|
+
/** The most files EVID005 lists; the rest are counted. */
|
|
89
|
+
export declare const UNCLAIMED_LIMIT = 20;
|
|
62
90
|
/** Core §8: classify every verification in the graph against the snapshot. Deterministic for identical inputs. */
|
|
63
91
|
export declare function classifyEvidence(graph: Graph, records: readonly RunRecord[], snapshot: EvidenceSnapshot, options?: ClassifyOptions): Classification;
|
|
64
92
|
/** 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
|
|
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,qBAAq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C5B,cAAc,CAwHhB;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
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Evidence freshness (Core §8, invariant 3). Only a `pass`
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Evidence freshness (Core §8, invariant 3). Only a `pass` whose binding holds
|
|
3
|
+
* is current: under commit binding, at the assessed commit and graph hash;
|
|
4
|
+
* under subject binding, while the subject it checked is unchanged. Everything
|
|
5
|
+
* else is something else, and says which. A failing current run stays visible
|
|
6
|
+
* however many older passes there are, because the status is decided by the
|
|
7
|
+
* latest current run and every run is kept in the history.
|
|
7
8
|
*/
|
|
8
|
-
import { sortDiagnostics } from "@intentset/core";
|
|
9
|
+
import { sortDiagnostics, } from "@intentset/core";
|
|
9
10
|
import { compareStrings, evidenceDiagnostic } from "./diagnostic.js";
|
|
10
11
|
import { CURRENT, compareRecords } from "./records.js";
|
|
12
|
+
import { partsChangedAmong } from "./subject.js";
|
|
11
13
|
export const EVIDENCE_STATUSES = [
|
|
12
14
|
"current-pass",
|
|
13
15
|
"current-fail",
|
|
@@ -18,6 +20,9 @@ export const EVIDENCE_STATUSES = [
|
|
|
18
20
|
"unresolved",
|
|
19
21
|
];
|
|
20
22
|
const NOTE_COMMIT_UNKNOWN = "commit unknown; matched on graph hash";
|
|
23
|
+
/** The most files EVID005 lists; the rest are counted. */
|
|
24
|
+
export const UNCLAIMED_LIMIT = 20;
|
|
25
|
+
const short = (commit) => commit.slice(0, 9);
|
|
21
26
|
/** Core §8: classify every verification in the graph against the snapshot. Deterministic for identical inputs. */
|
|
22
27
|
export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
23
28
|
const path = options.evidencePath ?? null;
|
|
@@ -69,14 +74,44 @@ export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
|
69
74
|
}
|
|
70
75
|
inScope.get(record.verificationId)?.push(record);
|
|
71
76
|
}
|
|
77
|
+
const binding = snapshot.binding ?? "commit";
|
|
78
|
+
if (snapshot.bindingReason === "no-slices") {
|
|
79
|
+
diagnostics.push(evidenceDiagnostic({
|
|
80
|
+
code: "EVID004",
|
|
81
|
+
severity: "warning",
|
|
82
|
+
artifact: null,
|
|
83
|
+
path: null,
|
|
84
|
+
message: "No slice claims files, so there is no subject to bind evidence to: it is judged by commit binding (a record is current only at the assessed commit and graph hash).",
|
|
85
|
+
remediation: "Declare slices with claims (VSA §3) so evidence can stay current while its subject is unchanged, or set `evidence.binding: commit` in .intentset/config.yaml to choose this on purpose (Core §8).",
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
72
88
|
const verifications = {};
|
|
89
|
+
const unclaimed = new Set();
|
|
73
90
|
for (const id of ids) {
|
|
74
91
|
const artifact = graph.artifacts.get(id);
|
|
75
92
|
const history = (inScope.get(id) ?? []).sort(compareRecords);
|
|
76
|
-
verifications[id] = classifyOne(id, artifact?.meta.verification?.method ?? "automated", history, outOfScope.get(id) ?? 0, snapshot);
|
|
93
|
+
verifications[id] = classifyOne(id, artifact?.meta.verification?.method ?? "automated", history, outOfScope.get(id) ?? 0, snapshot, binding, unclaimed);
|
|
94
|
+
}
|
|
95
|
+
if (unclaimed.size > 0) {
|
|
96
|
+
const files = [...unclaimed].sort(compareStrings);
|
|
97
|
+
const listed = files.slice(0, UNCLAIMED_LIMIT);
|
|
98
|
+
diagnostics.push(evidenceDiagnostic({
|
|
99
|
+
code: "EVID005",
|
|
100
|
+
severity: "warning",
|
|
101
|
+
artifact: null,
|
|
102
|
+
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 used 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` : ""}.`,
|
|
104
|
+
remediation: "Claim the file in a slice (the architecture check's unclaimed files rule), name its resource in `usesResources`, or list it in `evidence.globalInputs` if it affects every check (Core §8).",
|
|
105
|
+
}));
|
|
77
106
|
}
|
|
78
107
|
return {
|
|
79
|
-
snapshot: {
|
|
108
|
+
snapshot: {
|
|
109
|
+
commit: snapshot.commit,
|
|
110
|
+
graphHash: snapshot.graphHash,
|
|
111
|
+
scope,
|
|
112
|
+
binding,
|
|
113
|
+
bindingReason: snapshot.bindingReason ?? "configured",
|
|
114
|
+
},
|
|
80
115
|
verifications,
|
|
81
116
|
ignoredOutOfScope,
|
|
82
117
|
unknown,
|
|
@@ -88,9 +123,10 @@ export function classifyEvidence(graph, records, snapshot, options = {}) {
|
|
|
88
123
|
export function atSnapshot(record, snapshot) {
|
|
89
124
|
return record.graphHash === snapshot.graphHash && (snapshot.commit === null || record.commit === snapshot.commit);
|
|
90
125
|
}
|
|
91
|
-
function classifyOne(verificationId, method, history, outOfScope, snapshot) {
|
|
126
|
+
function classifyOne(verificationId, method, history, outOfScope, snapshot, binding, unclaimed) {
|
|
92
127
|
const counts = { pass: 0, fail: 0, skip: 0, error: 0 };
|
|
93
|
-
const
|
|
128
|
+
const subjectHash = binding === "subject" ? (snapshot.subjects?.get(verificationId)?.hash ?? null) : null;
|
|
129
|
+
const base = { verificationId, method, binding, subject: subjectHash, history, atSnapshot: counts, outOfScope };
|
|
94
130
|
const ignored = outOfScope > 0 ? `${outOfScope} record${outOfScope === 1 ? "" : "s"} for another product or release ignored` : null;
|
|
95
131
|
if (history.length === 0) {
|
|
96
132
|
return withNote({ ...base, status: "missing", latest: null }, [ignored]);
|
|
@@ -103,23 +139,77 @@ function classifyOne(verificationId, method, history, outOfScope, snapshot) {
|
|
|
103
139
|
ignored,
|
|
104
140
|
]);
|
|
105
141
|
}
|
|
106
|
-
const
|
|
142
|
+
const subject = snapshot.subjects?.get(verificationId);
|
|
143
|
+
if (binding === "subject" && subject === undefined) {
|
|
144
|
+
return withNote({ ...base, status: "unresolved", latest: history[history.length - 1] }, [
|
|
145
|
+
"subject binding is in force but no subject could be computed for this verification",
|
|
146
|
+
ignored,
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
const current = binding === "subject"
|
|
150
|
+
? history.filter((record) => record.binding === "subject" && record.subjectHash === subject?.hash)
|
|
151
|
+
: history.filter((record) => record.binding !== "subject" && atSnapshot(record, snapshot));
|
|
107
152
|
for (const record of current)
|
|
108
153
|
counts[record.result]++;
|
|
109
154
|
if (current.length === 0) {
|
|
110
|
-
|
|
155
|
+
const latest = history[history.length - 1];
|
|
156
|
+
return withNote({ ...base, status: "stale", latest }, [staleNote(latest, binding, subject, snapshot), ignored]);
|
|
111
157
|
}
|
|
112
158
|
const latest = current[current.length - 1];
|
|
113
159
|
const status = latest.result === "pass" ? "current-pass" : latest.result === "fail" ? "current-fail" : latest.result;
|
|
114
|
-
|
|
160
|
+
const notes = [];
|
|
161
|
+
if (binding === "subject") {
|
|
162
|
+
const unlisted = collectUnclaimed(latest, snapshot, unclaimed);
|
|
163
|
+
notes.push(`judged by subject binding; the run was at commit ${short(latest.commit)}${unlisted}`);
|
|
164
|
+
}
|
|
165
|
+
else if (snapshot.commit === null)
|
|
166
|
+
notes.push(NOTE_COMMIT_UNKNOWN);
|
|
167
|
+
notes.push(ignored);
|
|
168
|
+
return withNote({ ...base, status, latest }, notes);
|
|
169
|
+
}
|
|
170
|
+
/** Why the latest record is not current under the binding in force, with what moved when that can be said. */
|
|
171
|
+
function staleNote(latest, binding, subject, snapshot) {
|
|
172
|
+
if (binding === "commit") {
|
|
173
|
+
return latest.binding === "subject"
|
|
174
|
+
? "latest record is bound to a subject, not to a commit; a gate that asks for commit binding needs a run imported at this commit with commit binding"
|
|
175
|
+
: null;
|
|
176
|
+
}
|
|
177
|
+
if (latest.binding !== "subject") {
|
|
178
|
+
return `latest record is bound to commit ${short(latest.commit)}, not to a subject, so subject binding judges it stale; it can be re-imported to bind it to the subject`;
|
|
179
|
+
}
|
|
180
|
+
if (snapshot.changedSince === undefined || subject === undefined)
|
|
181
|
+
return "the subject changed since the run";
|
|
182
|
+
const changed = snapshot.changedSince(latest.commit);
|
|
183
|
+
if (changed === null) {
|
|
184
|
+
return `the subject changed since the run; which part moved is unknown, because commit ${short(latest.commit)} is not an ancestor of the assessed commit or git is unavailable`;
|
|
185
|
+
}
|
|
186
|
+
const parts = partsChangedAmong(subject, new Set(changed));
|
|
187
|
+
return parts.length === 0
|
|
188
|
+
? `the subject changed since the run at commit ${short(latest.commit)}, in a part no changed file names (a file that left the subject, or a record moved)`
|
|
189
|
+
: `the subject changed since the run at commit ${short(latest.commit)}: ${parts.slice(0, 5).join(", ")}${parts.length > 5 ? `, and ${parts.length - 5} more` : ""}`;
|
|
190
|
+
}
|
|
191
|
+
/** Collects what changed outside every subject since a current record's commit (EVID005), and says when that cannot be known. */
|
|
192
|
+
function collectUnclaimed(latest, snapshot, unclaimed) {
|
|
193
|
+
if (snapshot.changedSince === undefined || snapshot.covers === undefined)
|
|
194
|
+
return "";
|
|
195
|
+
const changed = snapshot.changedSince(latest.commit);
|
|
196
|
+
if (changed === null) {
|
|
197
|
+
return `; files changed since then could not be listed, because the commit is not an ancestor of the assessed commit or git is unavailable`;
|
|
198
|
+
}
|
|
199
|
+
for (const path of changed)
|
|
200
|
+
if (!snapshot.covers(path))
|
|
201
|
+
unclaimed.add(path);
|
|
202
|
+
return "";
|
|
115
203
|
}
|
|
116
204
|
function withNote(evidence, notes) {
|
|
117
205
|
const present = notes.filter((note) => note !== null);
|
|
118
|
-
const { verificationId, method, status, latest, history, atSnapshot: counts, outOfScope } = evidence;
|
|
206
|
+
const { verificationId, method, binding, subject, status, latest, history, atSnapshot: counts, outOfScope, } = evidence;
|
|
119
207
|
return {
|
|
120
208
|
verificationId,
|
|
121
209
|
method,
|
|
122
210
|
status,
|
|
211
|
+
binding,
|
|
212
|
+
subject,
|
|
123
213
|
...(present.length > 0 ? { note: present.join("; ") } : {}),
|
|
124
214
|
latest,
|
|
125
215
|
history,
|
package/dist/classify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAAA
|
|
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;AAEpE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD,kHAAkH;AAClH,MAAM,UAAU,gBAAgB,CAC9B,KAAY,EACZ,OAA6B,EAC7B,QAA0B,EAC1B,OAAO,GAAoB,EAAE;IAE7B,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC;IACrC,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,MAAM,QAA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