@am_shork/attest 0.2.2 → 0.4.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/CHANGELOG.md +876 -62
- package/README.md +157 -19
- package/dist/cli/index.js +91 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/json.d.ts +52 -5
- package/dist/cli/json.d.ts.map +1 -1
- package/dist/cli/json.js +50 -2
- package/dist/cli/json.js.map +1 -1
- package/dist/cli/report.d.ts +11 -1
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +114 -3
- package/dist/cli/report.js.map +1 -1
- package/dist/core/apply.d.ts +8 -0
- package/dist/core/apply.d.ts.map +1 -1
- package/dist/core/apply.js +10 -0
- package/dist/core/apply.js.map +1 -1
- package/dist/core/gate.d.ts +27 -1
- package/dist/core/gate.d.ts.map +1 -1
- package/dist/core/gate.js +48 -1
- package/dist/core/gate.js.map +1 -1
- package/dist/core/loader.d.ts +8 -0
- package/dist/core/loader.d.ts.map +1 -1
- package/dist/core/loader.js +19 -1
- package/dist/core/loader.js.map +1 -1
- package/dist/core/locate.d.ts +22 -1
- package/dist/core/locate.d.ts.map +1 -1
- package/dist/core/locate.js +76 -7
- package/dist/core/locate.js.map +1 -1
- package/dist/core/paths.d.ts +15 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +36 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/pipeline.d.ts +75 -5
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +212 -35
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/red-record.d.ts +56 -0
- package/dist/core/red-record.d.ts.map +1 -0
- package/dist/core/red-record.js +177 -0
- package/dist/core/red-record.js.map +1 -0
- package/dist/core/render.d.ts +1 -1
- package/dist/core/render.d.ts.map +1 -1
- package/dist/core/render.js +16 -2
- package/dist/core/render.js.map +1 -1
- package/dist/core/runner.d.ts +1 -1
- package/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +36 -11
- package/dist/core/runner.js.map +1 -1
- package/dist/core/skill.d.ts +23 -0
- package/dist/core/skill.d.ts.map +1 -0
- package/dist/core/skill.js +276 -0
- package/dist/core/skill.js.map +1 -0
- package/dist/core/static-registry.d.ts +28 -0
- package/dist/core/static-registry.d.ts.map +1 -1
- package/dist/core/static-registry.js +91 -25
- package/dist/core/static-registry.js.map +1 -1
- package/dist/core/status.d.ts +39 -0
- package/dist/core/status.d.ts.map +1 -0
- package/dist/core/status.js +64 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/targets.d.ts +52 -0
- package/dist/core/targets.d.ts.map +1 -0
- package/dist/core/targets.js +141 -0
- package/dist/core/targets.js.map +1 -0
- package/dist/core/types.d.ts +13 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/validator.d.ts +11 -0
- package/dist/core/validator.d.ts.map +1 -1
- package/dist/core/validator.js +28 -12
- package/dist/core/validator.js.map +1 -1
- package/dist/core/write.d.ts +2 -0
- package/dist/core/write.d.ts.map +1 -0
- package/dist/core/write.js +21 -0
- package/dist/core/write.js.map +1 -0
- package/dist/runtime.d.ts +9 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +10 -2
- package/dist/runtime.js.map +1 -1
- package/package.json +5 -5
package/dist/cli/report.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoverageRow, VerifyCounts } from '../core/pipeline.js';
|
|
1
|
+
import type { CoverageRow, StatusResult, VerifyCounts } from '../core/pipeline.js';
|
|
2
2
|
import type { Issue } from '../core/types.js';
|
|
3
3
|
export declare function formatIssues(issues: Issue[]): string;
|
|
4
4
|
/**
|
|
@@ -27,5 +27,15 @@ export declare function summarize(issues: Issue[], scope?: VerifyCounts): string
|
|
|
27
27
|
* parse would show up here as a widening gap rather than as silence.
|
|
28
28
|
*/
|
|
29
29
|
export declare function formatScope(scope: VerifyCounts): string;
|
|
30
|
+
/**
|
|
31
|
+
* The progress table for one change.
|
|
32
|
+
*
|
|
33
|
+
* The closing line says what this report is *not*. Every state here is read
|
|
34
|
+
* without running a single test, so a table of green ticks means the readable
|
|
35
|
+
* obligations are met and nothing at all about whether the suite passes — and a
|
|
36
|
+
* report that can be mistaken for a verdict is worse than no report, which is
|
|
37
|
+
* the argument that keeps `render --check` comparing documents rather than bytes.
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatStatus(result: StatusResult): string;
|
|
30
40
|
export declare function formatCoverage(rows: CoverageRow[]): string;
|
|
31
41
|
//# sourceMappingURL=report.d.ts.map
|
package/dist/cli/report.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/cli/report.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/cli/report.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,kBAAkB,CAAC;AAkErD,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAcpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAkBrD;AAUD,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CASvE;AAID;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAIvD;AA4BD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAwBzD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,CAe1D"}
|
package/dist/cli/report.js
CHANGED
|
@@ -8,15 +8,66 @@ const LEVEL_TAG = {
|
|
|
8
8
|
INFO: (s) => chalk.blueBright(s),
|
|
9
9
|
};
|
|
10
10
|
const ORDER = ['ERROR', 'WARNING', 'INFO'];
|
|
11
|
+
/** The one control character a report keeps: see `block`. */
|
|
12
|
+
const NEWLINE = 0x0a;
|
|
13
|
+
/** How far a message is indented under its header line. */
|
|
14
|
+
const INDENT = ' ';
|
|
15
|
+
/**
|
|
16
|
+
* Text from the project, on its way to a terminal.
|
|
17
|
+
*
|
|
18
|
+
* Most of what a report prints is Attest's own prose, but the parts a reader
|
|
19
|
+
* actually navigates by are not: a scenario name and a file path are quoted
|
|
20
|
+
* verbatim out of the repository under test (`orphan-test`, `declared-not-run`,
|
|
21
|
+
* `never-red`), and the parser hands back the *cooked* string, so an ESC
|
|
22
|
+
* written as an escape in a spec file is a real control byte by the time it
|
|
23
|
+
* arrives here.
|
|
24
|
+
*
|
|
25
|
+
* That makes the human report a place where the repository being checked can
|
|
26
|
+
* write to the terminal of whoever is checking it. On a fork MR the author is
|
|
27
|
+
* not the reviewer, and the payload is a scenario name: erase the lines above,
|
|
28
|
+
* repaint a red verdict green, rewrite the window title. The `--json` path was
|
|
29
|
+
* never exposed — `JSON.stringify` escapes every C0 character — which is
|
|
30
|
+
* precisely why this had to be fixed on the side people read.
|
|
31
|
+
*
|
|
32
|
+
* A newline survives, because one diagnostic is legitimately multi-line:
|
|
33
|
+
* `registry-invalid` carries Zod's list of field errors, and flattening it
|
|
34
|
+
* would cost a real reader a real thing to save a hypothetical one. It is
|
|
35
|
+
* re-indented instead, so injected text lands inside the message block rather
|
|
36
|
+
* than at column 0 where a forged `ERROR ...` header would be indistinguishable
|
|
37
|
+
* from a real one.
|
|
38
|
+
*/
|
|
39
|
+
function block(text) {
|
|
40
|
+
return control(text).replaceAll('\n', `\n${INDENT}`);
|
|
41
|
+
}
|
|
42
|
+
/** The same, for text that sits inline in a header and must stay one line. */
|
|
43
|
+
function inline(text) {
|
|
44
|
+
return control(text).replaceAll('\n', ' ');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every C0 control except the newline, plus DEL and the C1 range, as a space.
|
|
48
|
+
*
|
|
49
|
+
* A space rather than deletion: removing the byte would silently splice
|
|
50
|
+
* `atte` + `st` into a word that was never in the file, and a diagnostic that
|
|
51
|
+
* quietly rewrites what it quotes is its own kind of wrong.
|
|
52
|
+
*/
|
|
53
|
+
function control(text) {
|
|
54
|
+
return [...text]
|
|
55
|
+
.map((ch) => {
|
|
56
|
+
const c = ch.codePointAt(0);
|
|
57
|
+
const isControl = (c < 0x20 && c !== NEWLINE) || (c >= 0x7f && c <= 0x9f);
|
|
58
|
+
return isControl ? ' ' : ch;
|
|
59
|
+
})
|
|
60
|
+
.join('');
|
|
61
|
+
}
|
|
11
62
|
export function formatIssues(issues) {
|
|
12
63
|
if (issues.length === 0)
|
|
13
64
|
return chalk.green('✓ No issues.');
|
|
14
65
|
const lines = [];
|
|
15
66
|
for (const level of ORDER) {
|
|
16
67
|
for (const i of issues.filter((x) => x.level === level)) {
|
|
17
|
-
const where = i.file ? `${i.file}${i.line ? `:${i.line}` : ''}` : '';
|
|
68
|
+
const where = i.file ? `${inline(i.file)}${i.line ? `:${i.line}` : ''}` : '';
|
|
18
69
|
const loc = where ? chalk.dim(` (${where})`) : '';
|
|
19
|
-
lines.push(`${LEVEL_TAG[level](level.padEnd(7))} ${chalk.cyan(i.code)}${loc}\n
|
|
70
|
+
lines.push(`${LEVEL_TAG[level](level.padEnd(7))} ${chalk.cyan(inline(i.code))}${loc}\n${INDENT}${block(i.message)}`);
|
|
20
71
|
}
|
|
21
72
|
}
|
|
22
73
|
const repeats = formatRepeats(issues);
|
|
@@ -89,6 +140,62 @@ export function formatScope(scope) {
|
|
|
89
140
|
const tail = skipped > 0 ? chalk.dim(` (${skipped} without a requirement(), not run)`) : '';
|
|
90
141
|
return chalk.dim(`Running ${plural(scope.attesting, 'spec file')}`) + tail;
|
|
91
142
|
}
|
|
143
|
+
/** What each obligation state looks like, and what to do about it. */
|
|
144
|
+
const STATE_MARK = {
|
|
145
|
+
'no-scenario': {
|
|
146
|
+
mark: chalk.red('✗'),
|
|
147
|
+
hint: () => chalk.red('no scenario yet'),
|
|
148
|
+
},
|
|
149
|
+
unproven: {
|
|
150
|
+
mark: chalk.yellow('●'),
|
|
151
|
+
hint: (row) => {
|
|
152
|
+
// The two states the gate reports apart, kept apart here for the same
|
|
153
|
+
// reason: a scenario recorded as passing does not test what it claims,
|
|
154
|
+
// while one never observed only means the stage-1 run has not happened.
|
|
155
|
+
const passed = row.scenarios.filter((s) => s.firstRun === 'pass').length;
|
|
156
|
+
const unseen = row.scenarios.filter((s) => s.firstRun === null).length;
|
|
157
|
+
const parts = [];
|
|
158
|
+
if (unseen > 0)
|
|
159
|
+
parts.push(`${unseen} never run`);
|
|
160
|
+
if (passed > 0)
|
|
161
|
+
parts.push(`${passed} passed first`);
|
|
162
|
+
return chalk.yellow(parts.join(', '));
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
proven: {
|
|
166
|
+
mark: chalk.green('✓'),
|
|
167
|
+
hint: (row) => chalk.dim(`${plural(row.scenarios.length, 'scenario')}, seen red`),
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* The progress table for one change.
|
|
172
|
+
*
|
|
173
|
+
* The closing line says what this report is *not*. Every state here is read
|
|
174
|
+
* without running a single test, so a table of green ticks means the readable
|
|
175
|
+
* obligations are met and nothing at all about whether the suite passes — and a
|
|
176
|
+
* report that can be mistaken for a verdict is worse than no report, which is
|
|
177
|
+
* the argument that keeps `render --check` comparing documents rather than bytes.
|
|
178
|
+
*/
|
|
179
|
+
export function formatStatus(result) {
|
|
180
|
+
const lines = [];
|
|
181
|
+
if (result.rows.length === 0) {
|
|
182
|
+
lines.push(chalk.dim('(this change adds no requirements)'));
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
for (const row of result.rows) {
|
|
186
|
+
const { mark, hint } = STATE_MARK[row.state];
|
|
187
|
+
// Sanitised for the reason `formatIssues` sanitises: a status row's id is
|
|
188
|
+
// whatever `delta({ added: { … } })` wrote, and the static delta reader
|
|
189
|
+
// deliberately does not schema-validate it (see static-registry.ts), so
|
|
190
|
+
// unlike a registry id it has never been through `^[A-Z]+-\d+$`.
|
|
191
|
+
lines.push(` ${mark} ${chalk.bold(inline(row.reqId))} ${hint(row)}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const { proven } = result.counts;
|
|
195
|
+
lines.push(chalk.dim(`— ${plural(result.rows.length, 'added requirement')}, ${proven} ready to archive`));
|
|
196
|
+
lines.push(chalk.dim(`Not a verdict: run \`attest archive ${inline(result.change)}\` to run the suite.`));
|
|
197
|
+
return lines.join('\n');
|
|
198
|
+
}
|
|
92
199
|
export function formatCoverage(rows) {
|
|
93
200
|
if (rows.length === 0)
|
|
94
201
|
return chalk.dim('(the registry contains no requirements)');
|
|
@@ -98,7 +205,11 @@ export function formatCoverage(rows) {
|
|
|
98
205
|
const detail = r.covered
|
|
99
206
|
? chalk.dim(`${r.scenarioCount} scenario${r.scenarioCount === 1 ? '' : 's'}`)
|
|
100
207
|
: chalk.red('no scenario');
|
|
101
|
-
|
|
208
|
+
// Sanitised, even though a registry id has been through the schema's
|
|
209
|
+
// `^[A-Z]+-\d+$`: that is true of the *static* reader only. Under
|
|
210
|
+
// `--eval` the registry is whatever the module exported, and `evalReader`
|
|
211
|
+
// checks that it is an object and nothing further.
|
|
212
|
+
return ` ${mark} ${chalk.bold(inline(r.reqId))} ${detail}`;
|
|
102
213
|
})
|
|
103
214
|
.join('\n');
|
|
104
215
|
}
|
package/dist/cli/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/cli/report.ts"],"names":[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
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The ids a delta ADDs — the scope of the first-red obligation (design §6).
|
|
9
|
+
*
|
|
10
|
+
* One function because two commands ask: the gate scopes `never-red` to these,
|
|
11
|
+
* and `status` reports progress against the same set. Read through it rather
|
|
12
|
+
* than off `delta.added`, so the two can never be scoped differently.
|
|
13
|
+
*/
|
|
14
|
+
export declare function addedIds(d: RegistryDelta): string[];
|
|
7
15
|
/**
|
|
8
16
|
* Apply a change delta to a base registry, returning the merged registry plus
|
|
9
17
|
* any apply-level issues (conflicts, missing targets, invalid results). The
|
package/dist/core/apply.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/core/apply.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAe,MAAM,YAAY,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,aAAa,GAAG,WAAW,CAiExE"}
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/core/apply.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAe,MAAM,YAAY,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,EAAE,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,aAAa,GAAG,WAAW,CAiExE"}
|
package/dist/core/apply.js
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
// no-ops on RENAMED.
|
|
5
5
|
import { RequirementSchema } from './schema.js';
|
|
6
6
|
import { byCodeUnit } from './order.js';
|
|
7
|
+
/**
|
|
8
|
+
* The ids a delta ADDs — the scope of the first-red obligation (design §6).
|
|
9
|
+
*
|
|
10
|
+
* One function because two commands ask: the gate scopes `never-red` to these,
|
|
11
|
+
* and `status` reports progress against the same set. Read through it rather
|
|
12
|
+
* than off `delta.added`, so the two can never be scoped differently.
|
|
13
|
+
*/
|
|
14
|
+
export function addedIds(d) {
|
|
15
|
+
return Object.keys(d.added ?? {});
|
|
16
|
+
}
|
|
7
17
|
/**
|
|
8
18
|
* Apply a change delta to a base registry, returning the merged registry plus
|
|
9
19
|
* any apply-level issues (conflicts, missing targets, invalid results). The
|
package/dist/core/apply.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/core/apply.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,yEAAyE;AACzE,yEAAyE;AACzE,qBAAqB;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AASxC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,CAAgB;IACzD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAsB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,aAAa;IACb,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QAC3C,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CA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,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AACxE,CAAC;AAED,SAAS,YAAY,CAAC,KAAwC;IAC5D,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,eAAe,CAAC;AACrD,CAAC;AAED,8EAA8E;AAC9E,SAAS,eAAe,CAAC,CAAc,EAAE,CAAc;IACrD,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,SAAS,CAAC,GAAgB;IACjC,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;QAC5B,UAAU,EAAE,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC;KAChC,CAAC,CAAC;AACL,CAAC;AAED,wEAAwE;AACxE,8EAA8E;AAC9E,8EAA8E;AAC9E,2EAA2E;AAC3E,gDAAgD;AAChD,SAAS,QAAQ,CAAC,GAA4B;IAC5C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC"}
|
package/dist/core/gate.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RedRecord } from './red-record.js';
|
|
1
2
|
import type { AttestPlan, Issue, Registry, RunResult } from './types.js';
|
|
2
3
|
export interface GateInputs {
|
|
3
4
|
/** End-state registry (base with the change's delta already applied). */
|
|
@@ -6,6 +7,10 @@ export interface GateInputs {
|
|
|
6
7
|
plan: AttestPlan;
|
|
7
8
|
/** Executable verification result (design §5.4). */
|
|
8
9
|
run: RunResult;
|
|
10
|
+
/** Ids this change ADDs — the scenarios that carry a first-red obligation. */
|
|
11
|
+
addedIds?: readonly string[];
|
|
12
|
+
/** First observed outcome per scenario, already merged with this run. */
|
|
13
|
+
firstRun?: RedRecord;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
16
|
* Declared-not-run: a scenario the static plan claims attests a requirement,
|
|
@@ -16,6 +21,25 @@ export interface GateInputs {
|
|
|
16
21
|
* this framework is that agreement should be structural, not clerical.
|
|
17
22
|
*/
|
|
18
23
|
export declare function declaredNotRunIssues(plan: AttestPlan, run: RunResult): Issue[];
|
|
24
|
+
/**
|
|
25
|
+
* Never-red: a scenario attesting a requirement this change ADDs, whose first
|
|
26
|
+
* observed run did not fail (design §6, mechanism 2).
|
|
27
|
+
*
|
|
28
|
+
* This is the half of the gate that certifies the tests ever *discriminated*.
|
|
29
|
+
* Green at archive time says only that they pass now — a scenario that asserted
|
|
30
|
+
* nothing has been green since the commit that added it and clears every other
|
|
31
|
+
* check identically. The two states are reported apart because the fixes differ:
|
|
32
|
+
* a first run that passed means the scenario does not test what it claims, while
|
|
33
|
+
* no observation at all means the workflow's stage-1 step was skipped, and the
|
|
34
|
+
* remedy for the second is to run the gate before implementing rather than to
|
|
35
|
+
* rewrite anything.
|
|
36
|
+
*
|
|
37
|
+
* Scoped to ADDED ids only. A requirement written straight into the base
|
|
38
|
+
* registry — which is how existing behaviour gets described, in a brownfield
|
|
39
|
+
* adoption and in this repo — carries no such obligation, because there was
|
|
40
|
+
* never a moment when its scenario was supposed to fail.
|
|
41
|
+
*/
|
|
42
|
+
export declare function neverRedIssues(plan: AttestPlan, addedIds: readonly string[], firstRun: RedRecord): Issue[];
|
|
19
43
|
/**
|
|
20
44
|
* Decide whether a change may be archived. Returns the blocking issues; an
|
|
21
45
|
* empty array means the gate passes (design §8). Checks, in order:
|
|
@@ -26,6 +50,8 @@ export declare function declaredNotRunIssues(plan: AttestPlan, run: RunResult):
|
|
|
26
50
|
* 2. Executable: all tests green.
|
|
27
51
|
* 3. Static coverage vs runtime coverage: every declared scenario actually
|
|
28
52
|
* ran (catches skip/only false coverage).
|
|
53
|
+
* 4. Never-red: every scenario of an ADDED requirement failed on its first
|
|
54
|
+
* recorded run (design §6, mechanism 2).
|
|
29
55
|
*/
|
|
30
|
-
export declare function evaluateGate({ registry, plan, run }: GateInputs): Issue[];
|
|
56
|
+
export declare function evaluateGate({ registry, plan, run, addedIds, firstRun }: GateInputs): Issue[];
|
|
31
57
|
//# sourceMappingURL=gate.d.ts.map
|
package/dist/core/gate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/core/gate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB,yEAAyE;IACzE,QAAQ,EAAE,QAAQ,CAAC;IACnB,8CAA8C;IAC9C,IAAI,EAAE,UAAU,CAAC;IACjB,oDAAoD;IACpD,GAAG,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/core/gate.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB,yEAAyE;IACzE,QAAQ,EAAE,QAAQ,CAAC;IACnB,8CAA8C;IAC9C,IAAI,EAAE,UAAU,CAAC;IACjB,oDAAoD;IACpD,GAAG,EAAE,SAAS,CAAC;IACf,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,GAAG,KAAK,EAAE,CAe9E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS,GAClB,KAAK,EAAE,CAoBT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,KAAK,EAAE,CA0B7F"}
|
package/dist/core/gate.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// inputs; the file orchestration (load registry+delta, parse all specs, run)
|
|
5
5
|
// is wired in the Locate layer / CLI (see pipeline.ts).
|
|
6
6
|
import { validateStructure } from './validator.js';
|
|
7
|
+
import { RED_RECORD_FILE, hasRecordedRed, recordedOutcome, } from './red-record.js';
|
|
7
8
|
/**
|
|
8
9
|
* Declared-not-run: a scenario the static plan claims attests a requirement,
|
|
9
10
|
* which the runtime never executed (skipped, or excluded by an `.only`).
|
|
@@ -28,6 +29,46 @@ export function declaredNotRunIssues(plan, run) {
|
|
|
28
29
|
}
|
|
29
30
|
return issues;
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Never-red: a scenario attesting a requirement this change ADDs, whose first
|
|
34
|
+
* observed run did not fail (design §6, mechanism 2).
|
|
35
|
+
*
|
|
36
|
+
* This is the half of the gate that certifies the tests ever *discriminated*.
|
|
37
|
+
* Green at archive time says only that they pass now — a scenario that asserted
|
|
38
|
+
* nothing has been green since the commit that added it and clears every other
|
|
39
|
+
* check identically. The two states are reported apart because the fixes differ:
|
|
40
|
+
* a first run that passed means the scenario does not test what it claims, while
|
|
41
|
+
* no observation at all means the workflow's stage-1 step was skipped, and the
|
|
42
|
+
* remedy for the second is to run the gate before implementing rather than to
|
|
43
|
+
* rewrite anything.
|
|
44
|
+
*
|
|
45
|
+
* Scoped to ADDED ids only. A requirement written straight into the base
|
|
46
|
+
* registry — which is how existing behaviour gets described, in a brownfield
|
|
47
|
+
* adoption and in this repo — carries no such obligation, because there was
|
|
48
|
+
* never a moment when its scenario was supposed to fail.
|
|
49
|
+
*/
|
|
50
|
+
export function neverRedIssues(plan, addedIds, firstRun) {
|
|
51
|
+
const added = new Set(addedIds);
|
|
52
|
+
const issues = [];
|
|
53
|
+
for (const s of plan.scenarios) {
|
|
54
|
+
if (!added.has(s.reqId))
|
|
55
|
+
continue;
|
|
56
|
+
if (hasRecordedRed(firstRun, s.reqId, s.name))
|
|
57
|
+
continue;
|
|
58
|
+
const outcome = recordedOutcome(firstRun, s.reqId, s.name);
|
|
59
|
+
issues.push({
|
|
60
|
+
level: 'ERROR',
|
|
61
|
+
code: 'never-red',
|
|
62
|
+
reqId: s.reqId,
|
|
63
|
+
file: s.file,
|
|
64
|
+
line: s.line,
|
|
65
|
+
message: outcome === 'pass'
|
|
66
|
+
? `scenario "${s.name}" passed on its first run, so it never showed that ${s.reqId} was unimplemented; give it an assertion that fails without the change and run the gate again — a later failing run replaces this record.`
|
|
67
|
+
: `scenario "${s.name}" has no recorded first run for ${s.reqId}; run \`attest archive\` before implementing, so ${RED_RECORD_FILE} records it failing.`,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return issues;
|
|
71
|
+
}
|
|
31
72
|
/**
|
|
32
73
|
* Decide whether a change may be archived. Returns the blocking issues; an
|
|
33
74
|
* empty array means the gate passes (design §8). Checks, in order:
|
|
@@ -38,8 +79,10 @@ export function declaredNotRunIssues(plan, run) {
|
|
|
38
79
|
* 2. Executable: all tests green.
|
|
39
80
|
* 3. Static coverage vs runtime coverage: every declared scenario actually
|
|
40
81
|
* ran (catches skip/only false coverage).
|
|
82
|
+
* 4. Never-red: every scenario of an ADDED requirement failed on its first
|
|
83
|
+
* recorded run (design §6, mechanism 2).
|
|
41
84
|
*/
|
|
42
|
-
export function evaluateGate({ registry, plan, run }) {
|
|
85
|
+
export function evaluateGate({ registry, plan, run, addedIds, firstRun }) {
|
|
43
86
|
const blocking = [];
|
|
44
87
|
// 1) Structure (end-state re-validation).
|
|
45
88
|
blocking.push(...validateStructure(registry, plan).filter((i) => i.level === 'ERROR'));
|
|
@@ -53,6 +96,10 @@ export function evaluateGate({ registry, plan, run }) {
|
|
|
53
96
|
}
|
|
54
97
|
// 3) Declared-not-run: static coverage claimed, runtime never executed it.
|
|
55
98
|
blocking.push(...declaredNotRunIssues(plan, run));
|
|
99
|
+
// 4) Never-red: the added scenarios have to have discriminated once.
|
|
100
|
+
if (addedIds && addedIds.length > 0) {
|
|
101
|
+
blocking.push(...neverRedIssues(plan, addedIds, firstRun ?? {}));
|
|
102
|
+
}
|
|
56
103
|
return blocking;
|
|
57
104
|
}
|
|
58
105
|
//# sourceMappingURL=gate.js.map
|
package/dist/core/gate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../../src/core/gate.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,iFAAiF;AACjF,4EAA4E;AAC5E,6EAA6E;AAC7E,wDAAwD;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../../src/core/gate.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,iFAAiF;AACjF,4EAA4E;AAC5E,6EAA6E;AAC7E,wDAAwD;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AAgBzB;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAgB,EAAE,GAAc;IACnE,MAAM,MAAM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
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export interface Loader {
|
|
2
2
|
load<T = unknown>(absPath: string): Promise<T>;
|
|
3
3
|
close(): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* The scratch directory this loader owns, so its disposal can be asserted
|
|
6
|
+
* against *this* loader rather than against whatever the OS temp directory
|
|
7
|
+
* happens to contain. Counting `attest-loader-*` globally was a test that
|
|
8
|
+
* failed whenever anything else held a loader at the same time — which any
|
|
9
|
+
* concurrently running spec does.
|
|
10
|
+
*/
|
|
11
|
+
readonly scratchDir: string;
|
|
4
12
|
}
|
|
5
13
|
export declare function createLoader(): Promise<Loader>;
|
|
6
14
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/core/loader.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/core/loader.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAqDpD"}
|
package/dist/core/loader.js
CHANGED
|
@@ -23,13 +23,31 @@ export async function createLoader() {
|
|
|
23
23
|
configFile: false,
|
|
24
24
|
logLevel: 'error',
|
|
25
25
|
appType: 'custom',
|
|
26
|
-
|
|
26
|
+
// `ws: false` is load-bearing, and `middlewareMode` is not enough on its
|
|
27
|
+
// own: it suppresses the HTTP server but Vite still starts the HMR
|
|
28
|
+
// WebSocket server, which binds `::` — every interface, not loopback — on
|
|
29
|
+
// port 24678. Every `attest` command that reads a registry by evaluating it
|
|
30
|
+
// therefore opened a network port for the length of the run, on a
|
|
31
|
+
// developer's machine and on every CI runner, for a channel that does
|
|
32
|
+
// nothing here: nothing subscribes to HMR, because nothing is watching.
|
|
33
|
+
//
|
|
34
|
+
// The visible symptom was the collision. Two attest processes at once —
|
|
35
|
+
// ordinary in a CI matrix, and what this repo's own concurrent specs do —
|
|
36
|
+
// and the second printed `WebSocket server error: Port is already in use`
|
|
37
|
+
// into the middle of a report, through a `logLevel: 'error'` that was
|
|
38
|
+
// supposed to have silenced the loader entirely.
|
|
39
|
+
//
|
|
40
|
+
// `hmr: false` does *not* close it (measured, Vite 5.4): the ws server is
|
|
41
|
+
// created before the hmr option is consulted. `ws: false` is the one that
|
|
42
|
+
// leaves no listening handle at all.
|
|
43
|
+
server: { middlewareMode: true, ws: false },
|
|
27
44
|
resolve: { alias: { vitest: stub } },
|
|
28
45
|
ssr: { noExternal: ['vitest'] },
|
|
29
46
|
optimizeDeps: { noDiscovery: true },
|
|
30
47
|
});
|
|
31
48
|
let closed = false;
|
|
32
49
|
return {
|
|
50
|
+
scratchDir: dir,
|
|
33
51
|
async load(absPath) {
|
|
34
52
|
return (await server.ssrLoadModule(absPath));
|
|
35
53
|
},
|
package/dist/core/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/core/loader.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,2EAA2E;AAC3E,6EAA6E;AAC7E,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,6EAA6E;AAC7E,oEAAoE;AAEpE,OAAO,EAAE,YAAY,EAAsB,MAAM,MAAM,CAAC;AACxD,OAAO,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AA4E;QAC5E,kEAAkE;QAClE,sEAAsE;QACtE,wEAAwE;QACxE,EAAE;QACF,wEAAwE;QACxE,0EAA0E;QAC1E,0EAA0E;QAC1E,sEAAsE;QACtE,iDAAiD;QACjD,EAAE;QACF,0EAA0E;QAC1E,0EAA0E;QAC1E,qCAAqC;QACrC,MAAM,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE;QAC3C,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QACpC,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QAC/B,YAAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;KACpC,CAAC,CAAC;IAEH,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,OAAO;QACL,UAAU,EAAE,GAAG;QACf,KAAK,CAAC,IAAI,CAAI,OAAe;YAC3B,OAAO,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAM,CAAC;QACpD,CAAC;QACD,uEAAuE;QACvE,wEAAwE;QACxE,0EAA0E;QAC1E,yEAAyE;QACzE,qDAAqD;QACrD,KAAK,CAAC,KAAK;YACT,IAAI,MAAM;gBAAE,OAAO;YACnB,MAAM,GAAG,IAAI,CAAC;YACd,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;oBAAS,CAAC;gBACT,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/core/locate.d.ts
CHANGED
|
@@ -43,6 +43,22 @@ export interface RegistryReader {
|
|
|
43
43
|
* This is what `verify` and `archive` use: they run the whole suite anyway, so
|
|
44
44
|
* declining to evaluate one more module buys them nothing. Everywhere else it
|
|
45
45
|
* is the opt-in behaviour behind `--eval`.
|
|
46
|
+
*
|
|
47
|
+
* The exported value is **validated**, not asserted. A module's default export
|
|
48
|
+
* is an `unknown` from the loader's point of view, and calling it a `Registry`
|
|
49
|
+
* because it is an object was a type assertion standing in for a check: a file
|
|
50
|
+
* that exports a plain literal instead of calling `defineRequirements` reached
|
|
51
|
+
* the validator, where `req.statement.matchAll` threw — so `--eval` answered
|
|
52
|
+
* `internal-error` with a raw TypeError for a file the static reader diagnoses
|
|
53
|
+
* with a code and a fix hint, and the static reader's own hint ("pass --eval")
|
|
54
|
+
* pointed straight at that crash. Two readers of one file must not disagree
|
|
55
|
+
* about what is wrong with it (the call `archive` already makes for the delta).
|
|
56
|
+
*
|
|
57
|
+
* Re-parsing costs nothing on the normal path: `defineRequirements` returns
|
|
58
|
+
* what this same schema already produced, so a registry authored the ordinary
|
|
59
|
+
* way parses to itself. What `--eval` buys remains untouched — it is about a
|
|
60
|
+
* registry being *computed* rather than written out, never about it being
|
|
61
|
+
* shaped differently.
|
|
46
62
|
*/
|
|
47
63
|
export declare function evalReader(loader: Loader): RegistryReader;
|
|
48
64
|
/**
|
|
@@ -55,7 +71,8 @@ export declare function staticReader(): RegistryReader;
|
|
|
55
71
|
/**
|
|
56
72
|
* Read and merge every `*.reqs.ts` registry under root, with the given reader.
|
|
57
73
|
* A registry the reader rejects becomes its own ERROR; a duplicate id across
|
|
58
|
-
* files becomes a duplicate-requirement ERROR
|
|
74
|
+
* files becomes a duplicate-requirement ERROR, and two files claiming one id
|
|
75
|
+
* prefix a duplicate-prefix ERROR.
|
|
59
76
|
*
|
|
60
77
|
* Pass `files` to reuse a {@link scanProject} result instead of re-walking.
|
|
61
78
|
*/
|
|
@@ -67,6 +84,10 @@ export declare function loadRegistry(root: string, reader: RegistryReader, files
|
|
|
67
84
|
* Parse the given spec files into one merged plan (paths shown relative to
|
|
68
85
|
* `displayRoot`). Files are read concurrently; the merge follows the input
|
|
69
86
|
* order, so the plan never depends on I/O timing.
|
|
87
|
+
*
|
|
88
|
+
* The paths are POSIX on every platform (see `paths.ts`): they are not only
|
|
89
|
+
* displayed, they become the child run's `include` globs, where a Windows
|
|
90
|
+
* separator would silently match nothing.
|
|
70
91
|
*/
|
|
71
92
|
export declare function parseSpecs(files: string[], displayRoot: string): Promise<AttestPlan>;
|
|
72
93
|
/** Parse every `*.spec.ts` under root into one merged plan (file paths shown relative to root). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../src/core/locate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locate.d.ts","sourceRoot":"","sources":["../../src/core/locate.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAc9D,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OAAoC,CAAC;AAC/E,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OAAoC,CAAC;AAE/E;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AAED,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CASpE;AAED,yEAAyE;AACzE,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,GACtB;IAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC;AAEnC;;;;GAIG;AACH,MAA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