@decantr/verifier 2.5.1 → 3.0.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 +17 -0
- package/dist/index.d.ts +416 -2
- package/dist/index.js +2336 -475
- package/dist/index.js.map +1 -1
- package/package.json +9 -6
- package/schema/evidence-bundle.v1.json +99 -1
- package/schema/project-health-report.v1.json +129 -0
- package/schema/scan-report.v1.json +122 -0
- package/schema/verification-report.common.v1.json +59 -0
package/README.md
CHANGED
|
@@ -16,12 +16,18 @@ npm install @decantr/verifier
|
|
|
16
16
|
- `auditProject()` for project-level Decantr audits
|
|
17
17
|
- `auditBuiltDist()` for built-output runtime verification against emitted HTML, assets, and route hints
|
|
18
18
|
- `scanProject()` for read-only Brownfield reconnaissance of framework, routes, components, styling, static-hosting hints, Decantr presence, and assistant-rule files
|
|
19
|
+
- `auditComponentReuse()` for the first AST-derived component reuse drift slice, focused on AI reimplementing common UI primitives instead of importing project-owned components, plus local import references that the typed graph can turn into source-to-source impact edges
|
|
20
|
+
- `auditStyleBridgeDrift()` for accepted style bridge drift, focused on production `className`, common class-helper values, stylesheet declarations, and hardcoded inline color styles that bypass project-owned token/class authority
|
|
21
|
+
- `collectProjectSourceFiles()` for the shared production-source file selection used by Project Health, component reuse drift, style bridge drift, and typed graph source provenance
|
|
19
22
|
- `resolveGitHubScanInput()` and `probePublishedSite()` for hosted scan inputs and HTML-only published-site metadata probes
|
|
20
23
|
- `critiqueFile()` for file-level review against compiled review-pack contracts
|
|
21
24
|
- `createContractAssertions()` for explicit route, shell, accessibility, context, and design-token assertions derived from Essence/context
|
|
22
25
|
- `createEvidenceBundle()` for privacy-redacted local evidence artifacts used by AI repair loops and CI
|
|
26
|
+
- `resolveGraphAnchorForFinding()` and `anchorFindingsToGraph()` for attaching verifier/Project Health findings to typed Contract graph nodes when a graph snapshot exists
|
|
27
|
+
- `deriveVerificationDiagnostic()` and `KNOWN_VERIFICATION_DIAGNOSTICS` for stable finding codes and typed repair IDs used by Project Health, MCP health, and Evidence Bundles
|
|
23
28
|
- schema-backed report types for project audits, Project Health, Decantr CI reports, Evidence Bundles, Workspace Health, file critiques, and showcase verification
|
|
24
29
|
- `ProjectHealthReport`, `ProjectHealthFinding`, and `ProjectHealthRemediation` types for the CLI's end-user health surface
|
|
30
|
+
- Project Health and Evidence Bundle finding schemas include optional `code`, `repair`, `repairPlan`, and `graph` fields so agents can identify, anchor, and act on findings without parsing prose; Evidence Bundle provenance also records graph snapshot, manifest, diff, and contract-capsule hashes when present
|
|
25
31
|
- interaction findings now include scanned file counts, file line ranges, and expected signal evidence where available, so CLI health/check output can point agents at source-grounded remediation
|
|
26
32
|
- contract-only and style-bridge Brownfield critique avoids requiring Decantr treatments/decorators when the project keeps its own styling authority
|
|
27
33
|
- Decantr CI report schemas include accepted style bridge status, mapping count, styling approach, and theme modes alongside local-law findings
|
|
@@ -29,6 +35,17 @@ npm install @decantr/verifier
|
|
|
29
35
|
- project audits tolerate partial or malformed generated review packs without crashing Project Health, so half-attached Brownfield projects still receive actionable findings
|
|
30
36
|
- Next.js static/document outputs are treated as framework-rendered documents instead of requiring a Vite-style `id="root"` mount element
|
|
31
37
|
- project source audits ignore test, spec, story, fixture, and mock files for production drift warnings such as localhost endpoints and unsafe rendering patterns
|
|
38
|
+
- project audits emit `COMP001` / `import-existing-component` findings when a production source file locally redeclares a primitive such as `Button`, `Card`, or `Dialog` while an exported reusable primitive already exists under common component paths
|
|
39
|
+
- project audits emit `COMP010` / `replace-raw-control-with-local-component` findings when production JSX renders raw controls such as `<button>` or `<input>` while a project-owned primitive already exists
|
|
40
|
+
- project audits emit behavior-obligation findings when accepted `.decantr/local-patterns.json` patterns declare `behavior_obligations` and production source strongly violates statically checkable dialog/form obligations:
|
|
41
|
+
- `A11Y010` / `restore-dialog-accessible-name`
|
|
42
|
+
- `A11Y011` / `restore-label-association`
|
|
43
|
+
- `INT010` / `restore-visible-consequence-copy`
|
|
44
|
+
- `INT011` / `restore-cancel-affordance`
|
|
45
|
+
- `INT012` / `restore-submitting-guard`
|
|
46
|
+
- `INT013` / `set-explicit-button-type`
|
|
47
|
+
- `COMP020` / `use-project-owned-interaction-primitive`
|
|
48
|
+
- project audits emit `TOKEN010` / `replace-arbitrary-style-with-bridge-token` findings when an accepted `.decantr/style-bridge.json` exists and production JSX uses arbitrary Tailwind values such as `bg-[#0f172a]`, values inside `cn()`, `clsx()`, `classnames()`, `cva()`, and `tv()` calls, hardcoded inline color styles such as `style={{ backgroundColor: "#0f172a" }}`, or hardcoded visual values in production CSS/module stylesheets
|
|
32
49
|
- published verifier report schemas are exercised by AJV-backed round-trip tests against real audit, critique, and shortlist-report outputs
|
|
33
50
|
- project audits include runtime evidence when a built `dist/` output is present:
|
|
34
51
|
- root document
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,237 @@
|
|
|
1
1
|
import { ReviewExecutionPack } from '@decantr/core';
|
|
2
2
|
import { EssenceFile } from '@decantr/essence-spec';
|
|
3
3
|
|
|
4
|
+
interface VerificationRepairAction {
|
|
5
|
+
id: string;
|
|
6
|
+
payload?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
interface VerificationDiagnosticInput {
|
|
9
|
+
id: string;
|
|
10
|
+
category: string;
|
|
11
|
+
message: string;
|
|
12
|
+
source?: string;
|
|
13
|
+
rule?: string;
|
|
14
|
+
target?: string;
|
|
15
|
+
file?: string;
|
|
16
|
+
suggestedFix?: string;
|
|
17
|
+
evidence?: string[];
|
|
18
|
+
}
|
|
19
|
+
interface VerificationDiagnosticMetadata {
|
|
20
|
+
code: string;
|
|
21
|
+
repair: VerificationRepairAction;
|
|
22
|
+
}
|
|
23
|
+
interface VerificationDiagnosticCatalogEntry {
|
|
24
|
+
rule: string;
|
|
25
|
+
code: string;
|
|
26
|
+
repairId: string;
|
|
27
|
+
family: string;
|
|
28
|
+
}
|
|
29
|
+
declare const KNOWN_VERIFICATION_DIAGNOSTICS: readonly [{
|
|
30
|
+
readonly rule: "browser-base-url-missing";
|
|
31
|
+
readonly code: "VISUAL002";
|
|
32
|
+
readonly repairId: "provide-browser-base-url";
|
|
33
|
+
readonly family: "VISUAL";
|
|
34
|
+
}, {
|
|
35
|
+
readonly rule: "browser-playwright-missing";
|
|
36
|
+
readonly code: "VISUAL001";
|
|
37
|
+
readonly repairId: "install-browser-verifier";
|
|
38
|
+
readonly family: "VISUAL";
|
|
39
|
+
}, {
|
|
40
|
+
readonly rule: "browser-route-verification-failed";
|
|
41
|
+
readonly code: "VISUAL003";
|
|
42
|
+
readonly repairId: "fix-route-render";
|
|
43
|
+
readonly family: "VISUAL";
|
|
44
|
+
}, {
|
|
45
|
+
readonly rule: "visual-baseline-screenshot-drift";
|
|
46
|
+
readonly code: "VISUAL010";
|
|
47
|
+
readonly repairId: "review-visual-baseline-drift";
|
|
48
|
+
readonly family: "VISUAL";
|
|
49
|
+
}, {
|
|
50
|
+
readonly rule: "brownfield-route-drift";
|
|
51
|
+
readonly code: "ROUTE001";
|
|
52
|
+
readonly repairId: "reconcile-brownfield-routes";
|
|
53
|
+
readonly family: "ROUTE";
|
|
54
|
+
}, {
|
|
55
|
+
readonly rule: "check-failed";
|
|
56
|
+
readonly code: "CHECK001";
|
|
57
|
+
readonly repairId: "repair-contract-check";
|
|
58
|
+
readonly family: "CHECK";
|
|
59
|
+
}, {
|
|
60
|
+
readonly rule: "component-reuse-raw-control";
|
|
61
|
+
readonly code: "COMP010";
|
|
62
|
+
readonly repairId: "replace-raw-control-with-local-component";
|
|
63
|
+
readonly family: "COMP";
|
|
64
|
+
}, {
|
|
65
|
+
readonly rule: "behavior-project-interaction-primitive";
|
|
66
|
+
readonly code: "COMP020";
|
|
67
|
+
readonly repairId: "use-project-owned-interaction-primitive";
|
|
68
|
+
readonly family: "COMP";
|
|
69
|
+
}, {
|
|
70
|
+
readonly rule: "behavior-dialog-project-primitive";
|
|
71
|
+
readonly code: "COMP020";
|
|
72
|
+
readonly repairId: "use-project-owned-interaction-primitive";
|
|
73
|
+
readonly family: "COMP";
|
|
74
|
+
}, {
|
|
75
|
+
readonly rule: "component-reuse-primitive-reimplemented";
|
|
76
|
+
readonly code: "COMP001";
|
|
77
|
+
readonly repairId: "import-existing-component";
|
|
78
|
+
readonly family: "COMP";
|
|
79
|
+
}, {
|
|
80
|
+
readonly rule: "declared-route-resolves";
|
|
81
|
+
readonly code: "STRUCT002";
|
|
82
|
+
readonly repairId: "repair-route-binding";
|
|
83
|
+
readonly family: "STRUCT";
|
|
84
|
+
}, {
|
|
85
|
+
readonly rule: "design-token-coverage";
|
|
86
|
+
readonly code: "TOKEN002";
|
|
87
|
+
readonly repairId: "repair-design-token-coverage";
|
|
88
|
+
readonly family: "TOKEN";
|
|
89
|
+
}, {
|
|
90
|
+
readonly rule: "style-bridge-arbitrary-value";
|
|
91
|
+
readonly code: "TOKEN010";
|
|
92
|
+
readonly repairId: "replace-arbitrary-style-with-bridge-token";
|
|
93
|
+
readonly family: "TOKEN";
|
|
94
|
+
}, {
|
|
95
|
+
readonly rule: "essence-present";
|
|
96
|
+
readonly code: "CONTRACT001";
|
|
97
|
+
readonly repairId: "restore-essence-contract";
|
|
98
|
+
readonly family: "CONTRACT";
|
|
99
|
+
}, {
|
|
100
|
+
readonly rule: "essence-v4";
|
|
101
|
+
readonly code: "CONTRACT002";
|
|
102
|
+
readonly repairId: "migrate-essence-v4";
|
|
103
|
+
readonly family: "CONTRACT";
|
|
104
|
+
}, {
|
|
105
|
+
readonly rule: "focus-visible-enabled";
|
|
106
|
+
readonly code: "A11Y001";
|
|
107
|
+
readonly repairId: "enable-focus-visible";
|
|
108
|
+
readonly family: "A11Y";
|
|
109
|
+
}, {
|
|
110
|
+
readonly rule: "behavior-dialog-accessible-name";
|
|
111
|
+
readonly code: "A11Y010";
|
|
112
|
+
readonly repairId: "restore-dialog-accessible-name";
|
|
113
|
+
readonly family: "A11Y";
|
|
114
|
+
}, {
|
|
115
|
+
readonly rule: "behavior-form-label-associated";
|
|
116
|
+
readonly code: "A11Y011";
|
|
117
|
+
readonly repairId: "restore-label-association";
|
|
118
|
+
readonly family: "A11Y";
|
|
119
|
+
}, {
|
|
120
|
+
readonly rule: "behavior-dialog-visible-consequence";
|
|
121
|
+
readonly code: "INT010";
|
|
122
|
+
readonly repairId: "restore-visible-consequence-copy";
|
|
123
|
+
readonly family: "INT";
|
|
124
|
+
}, {
|
|
125
|
+
readonly rule: "behavior-dialog-cancel-affordance";
|
|
126
|
+
readonly code: "INT011";
|
|
127
|
+
readonly repairId: "restore-cancel-affordance";
|
|
128
|
+
readonly family: "INT";
|
|
129
|
+
}, {
|
|
130
|
+
readonly rule: "behavior-dialog-submitting-guard";
|
|
131
|
+
readonly code: "INT012";
|
|
132
|
+
readonly repairId: "restore-submitting-guard";
|
|
133
|
+
readonly family: "INT";
|
|
134
|
+
}, {
|
|
135
|
+
readonly rule: "behavior-form-explicit-button-type";
|
|
136
|
+
readonly code: "INT013";
|
|
137
|
+
readonly repairId: "set-explicit-button-type";
|
|
138
|
+
readonly family: "INT";
|
|
139
|
+
}, {
|
|
140
|
+
readonly rule: "pack-manifest-present";
|
|
141
|
+
readonly code: "CTX002";
|
|
142
|
+
readonly repairId: "hydrate-execution-packs";
|
|
143
|
+
readonly family: "CTX";
|
|
144
|
+
}, {
|
|
145
|
+
readonly rule: "pack-manifest-missing";
|
|
146
|
+
readonly code: "CTX002";
|
|
147
|
+
readonly repairId: "hydrate-execution-packs";
|
|
148
|
+
readonly family: "CTX";
|
|
149
|
+
}, {
|
|
150
|
+
readonly rule: "page-pack-count-mismatch";
|
|
151
|
+
readonly code: "CTX001";
|
|
152
|
+
readonly repairId: "regenerate-context-packs";
|
|
153
|
+
readonly family: "CTX";
|
|
154
|
+
}, {
|
|
155
|
+
readonly rule: "page-route-required";
|
|
156
|
+
readonly code: "STRUCT001";
|
|
157
|
+
readonly repairId: "add-page-route";
|
|
158
|
+
readonly family: "STRUCT";
|
|
159
|
+
}, {
|
|
160
|
+
readonly rule: "project-audit-invalid";
|
|
161
|
+
readonly code: "AUDIT001";
|
|
162
|
+
readonly repairId: "repair-project-audit";
|
|
163
|
+
readonly family: "AUDIT";
|
|
164
|
+
}, {
|
|
165
|
+
readonly rule: "review-pack-present";
|
|
166
|
+
readonly code: "CTX003";
|
|
167
|
+
readonly repairId: "hydrate-review-pack";
|
|
168
|
+
readonly family: "CTX";
|
|
169
|
+
}, {
|
|
170
|
+
readonly rule: "review-pack-file-missing";
|
|
171
|
+
readonly code: "CTX003";
|
|
172
|
+
readonly repairId: "hydrate-review-pack";
|
|
173
|
+
readonly family: "CTX";
|
|
174
|
+
}, {
|
|
175
|
+
readonly rule: "section-shell-concrete";
|
|
176
|
+
readonly code: "STRUCT003";
|
|
177
|
+
readonly repairId: "assign-section-shell";
|
|
178
|
+
readonly family: "STRUCT";
|
|
179
|
+
}, {
|
|
180
|
+
readonly rule: "tokens-file-present";
|
|
181
|
+
readonly code: "TOKEN001";
|
|
182
|
+
readonly repairId: "restore-design-token-file";
|
|
183
|
+
readonly family: "TOKEN";
|
|
184
|
+
}, {
|
|
185
|
+
readonly rule: "typed-graph-current";
|
|
186
|
+
readonly code: "GRAPH001";
|
|
187
|
+
readonly repairId: "regenerate-typed-graph";
|
|
188
|
+
readonly family: "GRAPH";
|
|
189
|
+
}];
|
|
190
|
+
declare function deriveVerificationDiagnostic(input: VerificationDiagnosticInput): VerificationDiagnosticMetadata;
|
|
191
|
+
|
|
192
|
+
type VerificationGraphAnchorConfidence = 'exact' | 'inferred' | 'fallback';
|
|
193
|
+
interface GraphAnchorNode {
|
|
194
|
+
id: string;
|
|
195
|
+
type: string;
|
|
196
|
+
payload?: unknown;
|
|
197
|
+
}
|
|
198
|
+
interface GraphAnchorEdge {
|
|
199
|
+
src: string;
|
|
200
|
+
dst: string;
|
|
201
|
+
relation: string;
|
|
202
|
+
payload?: unknown;
|
|
203
|
+
idx?: number;
|
|
204
|
+
}
|
|
205
|
+
interface GraphAnchorSnapshot {
|
|
206
|
+
id: string;
|
|
207
|
+
project_id: string;
|
|
208
|
+
source_hash: string;
|
|
209
|
+
nodes: GraphAnchorNode[];
|
|
210
|
+
edges: GraphAnchorEdge[];
|
|
211
|
+
}
|
|
212
|
+
interface VerificationGraphAnchor {
|
|
213
|
+
snapshot_id: string;
|
|
214
|
+
source_hash: string;
|
|
215
|
+
node_id: string;
|
|
216
|
+
node_type: string;
|
|
217
|
+
route?: string;
|
|
218
|
+
confidence: VerificationGraphAnchorConfidence;
|
|
219
|
+
reason: string;
|
|
220
|
+
}
|
|
221
|
+
interface GraphAnchorFindingInput {
|
|
222
|
+
id: string;
|
|
223
|
+
category: string;
|
|
224
|
+
message: string;
|
|
225
|
+
evidence?: string[];
|
|
226
|
+
target?: string;
|
|
227
|
+
file?: string;
|
|
228
|
+
rule?: string;
|
|
229
|
+
}
|
|
230
|
+
declare function resolveGraphAnchorForFinding(snapshot: GraphAnchorSnapshot | null | undefined, finding: GraphAnchorFindingInput): VerificationGraphAnchor | undefined;
|
|
231
|
+
declare function anchorFindingsToGraph<TFinding extends GraphAnchorFindingInput>(snapshot: GraphAnchorSnapshot | null | undefined, findings: TFinding[]): Array<TFinding & {
|
|
232
|
+
graph?: VerificationGraphAnchor;
|
|
233
|
+
}>;
|
|
234
|
+
|
|
4
235
|
interface RuntimeAudit {
|
|
5
236
|
distPresent: boolean;
|
|
6
237
|
indexPresent: boolean;
|
|
@@ -53,6 +284,67 @@ interface BuiltDistAuditOptions {
|
|
|
53
284
|
declare function emptyRuntimeAudit(failures?: string[]): RuntimeAudit;
|
|
54
285
|
declare function auditBuiltDist(projectRoot: string, options?: BuiltDistAuditOptions): Promise<RuntimeAudit>;
|
|
55
286
|
|
|
287
|
+
declare const COMPONENT_REUSE_RULE_ID = "component-reuse-primitive-reimplemented";
|
|
288
|
+
declare const RAW_CONTROL_REUSE_RULE_ID = "component-reuse-raw-control";
|
|
289
|
+
declare const RAW_CONTROL_COMPONENT_BY_ELEMENT: {
|
|
290
|
+
readonly button: "Button";
|
|
291
|
+
readonly dialog: "Dialog";
|
|
292
|
+
readonly input: "Input";
|
|
293
|
+
readonly select: "Select";
|
|
294
|
+
readonly table: "Table";
|
|
295
|
+
readonly textarea: "Textarea";
|
|
296
|
+
};
|
|
297
|
+
type RawControlElement = keyof typeof RAW_CONTROL_COMPONENT_BY_ELEMENT;
|
|
298
|
+
interface CodeComponentDeclaration {
|
|
299
|
+
id: string;
|
|
300
|
+
name: string;
|
|
301
|
+
file: string;
|
|
302
|
+
line: number;
|
|
303
|
+
exported: boolean;
|
|
304
|
+
reusable: boolean;
|
|
305
|
+
kind: 'function' | 'variable' | 'class';
|
|
306
|
+
}
|
|
307
|
+
interface ComponentReuseFinding {
|
|
308
|
+
id: string;
|
|
309
|
+
name: string;
|
|
310
|
+
file: string;
|
|
311
|
+
line: number;
|
|
312
|
+
canonicalFile: string;
|
|
313
|
+
canonicalLine: number;
|
|
314
|
+
evidence: string[];
|
|
315
|
+
}
|
|
316
|
+
interface RawControlReuseFinding {
|
|
317
|
+
id: string;
|
|
318
|
+
element: RawControlElement;
|
|
319
|
+
component: string;
|
|
320
|
+
file: string;
|
|
321
|
+
line: number;
|
|
322
|
+
canonicalFile: string;
|
|
323
|
+
canonicalLine: number;
|
|
324
|
+
containingComponent?: string;
|
|
325
|
+
evidence: string[];
|
|
326
|
+
}
|
|
327
|
+
interface CodeImportReference {
|
|
328
|
+
file: string;
|
|
329
|
+
source: string;
|
|
330
|
+
line: number;
|
|
331
|
+
defaultImport?: string;
|
|
332
|
+
namespaceImport?: string;
|
|
333
|
+
imported: string[];
|
|
334
|
+
localNames: string[];
|
|
335
|
+
}
|
|
336
|
+
interface ComponentReuseAudit {
|
|
337
|
+
filesChecked: number;
|
|
338
|
+
declarations: CodeComponentDeclaration[];
|
|
339
|
+
imports: CodeImportReference[];
|
|
340
|
+
reusableComponentCount: number;
|
|
341
|
+
localRedeclarationCount: number;
|
|
342
|
+
rawControlCount: number;
|
|
343
|
+
findings: ComponentReuseFinding[];
|
|
344
|
+
rawControlFindings: RawControlReuseFinding[];
|
|
345
|
+
}
|
|
346
|
+
declare function auditComponentReuse(projectRoot: string, sourceFiles: string[]): ComponentReuseAudit;
|
|
347
|
+
|
|
56
348
|
/**
|
|
57
349
|
* Experiential interaction verifier.
|
|
58
350
|
*
|
|
@@ -168,6 +460,43 @@ interface ScanFindingV1 {
|
|
|
168
460
|
evidence: string[];
|
|
169
461
|
recommendation?: string;
|
|
170
462
|
}
|
|
463
|
+
type ScanGraphPreviewStatus = 'not_attached' | 'current' | 'stale' | 'needs_migration' | 'unavailable';
|
|
464
|
+
interface ScanGraphPreviewV1 {
|
|
465
|
+
status: ScanGraphPreviewStatus;
|
|
466
|
+
canPreview: boolean;
|
|
467
|
+
readOnly: true;
|
|
468
|
+
message: string;
|
|
469
|
+
nextCommand: string | null;
|
|
470
|
+
staleArtifacts: string[];
|
|
471
|
+
snapshot: {
|
|
472
|
+
id: string;
|
|
473
|
+
schemaVersion: string;
|
|
474
|
+
sourceHash: string;
|
|
475
|
+
nodes: number;
|
|
476
|
+
edges: number;
|
|
477
|
+
findings: number;
|
|
478
|
+
evidence: number;
|
|
479
|
+
sourceArtifacts: number;
|
|
480
|
+
} | null;
|
|
481
|
+
capsule: {
|
|
482
|
+
cacheKey: string;
|
|
483
|
+
routes: number;
|
|
484
|
+
components: number;
|
|
485
|
+
tokens: number;
|
|
486
|
+
localRules: number;
|
|
487
|
+
styleBridge: number;
|
|
488
|
+
sourceArtifacts: number;
|
|
489
|
+
sourceArtifactLimit: number;
|
|
490
|
+
sourceArtifactsTruncated: boolean;
|
|
491
|
+
openFindings: number;
|
|
492
|
+
} | null;
|
|
493
|
+
diff: {
|
|
494
|
+
ops: number;
|
|
495
|
+
findingsAdded: number;
|
|
496
|
+
findingsResolved: number;
|
|
497
|
+
evidenceAdded: number;
|
|
498
|
+
} | null;
|
|
499
|
+
}
|
|
171
500
|
interface ScanReportV1 {
|
|
172
501
|
$schema: typeof SCAN_REPORT_SCHEMA_URL;
|
|
173
502
|
schemaVersion: 'scan-report.v1';
|
|
@@ -225,6 +554,7 @@ interface ScanReportV1 {
|
|
|
225
554
|
assistant: {
|
|
226
555
|
ruleFiles: string[];
|
|
227
556
|
};
|
|
557
|
+
graphPreview?: ScanGraphPreviewV1;
|
|
228
558
|
pagesProbe: PublishedSiteProbeV1 | null;
|
|
229
559
|
findings: ScanFindingV1[];
|
|
230
560
|
recommendedCommands: string[];
|
|
@@ -263,6 +593,28 @@ declare function probePublishedSite(url: string, options?: {
|
|
|
263
593
|
}): Promise<PublishedSiteProbeV1>;
|
|
264
594
|
declare function resolveGitHubScanInput(input: string): GitHubScanInputResolution;
|
|
265
595
|
|
|
596
|
+
declare const STYLE_BRIDGE_ARBITRARY_VALUE_RULE_ID = "style-bridge-arbitrary-value";
|
|
597
|
+
interface StyleBridgeDriftFinding {
|
|
598
|
+
id: string;
|
|
599
|
+
file: string;
|
|
600
|
+
line: number;
|
|
601
|
+
className: string;
|
|
602
|
+
value: string;
|
|
603
|
+
source: 'className' | 'inline-style' | 'stylesheet';
|
|
604
|
+
property?: string;
|
|
605
|
+
bridgeMappingIds: string[];
|
|
606
|
+
tokenHints: string[];
|
|
607
|
+
classHints: string[];
|
|
608
|
+
evidence: string[];
|
|
609
|
+
}
|
|
610
|
+
interface StyleBridgeDriftAudit {
|
|
611
|
+
filesChecked: number;
|
|
612
|
+
bridgeMappingCount: number;
|
|
613
|
+
arbitraryValueCount: number;
|
|
614
|
+
findings: StyleBridgeDriftFinding[];
|
|
615
|
+
}
|
|
616
|
+
declare function auditStyleBridgeDrift(projectRoot: string, sourceFiles: string[]): StyleBridgeDriftAudit;
|
|
617
|
+
|
|
266
618
|
declare const VERIFICATION_SCHEMA_URLS: {
|
|
267
619
|
readonly common: "https://decantr.ai/schemas/verification-report.common.v1.json";
|
|
268
620
|
readonly projectAudit: "https://decantr.ai/schemas/project-audit-report.v1.json";
|
|
@@ -276,9 +628,10 @@ declare const VERIFICATION_SCHEMA_URLS: {
|
|
|
276
628
|
};
|
|
277
629
|
type VerificationSeverity = 'error' | 'warn' | 'info';
|
|
278
630
|
type ProjectHealthStatus = 'healthy' | 'warning' | 'error';
|
|
279
|
-
type ProjectHealthFindingSource = 'audit' | 'assertion' | 'browser' | 'check' | 'brownfield' | 'design-token' | 'runtime' | 'pack' | 'interaction';
|
|
631
|
+
type ProjectHealthFindingSource = 'audit' | 'assertion' | 'browser' | 'check' | 'brownfield' | 'design-token' | 'style-bridge' | 'graph' | 'runtime' | 'pack' | 'interaction';
|
|
280
632
|
interface VerificationFinding {
|
|
281
633
|
id: string;
|
|
634
|
+
code?: string;
|
|
282
635
|
category: string;
|
|
283
636
|
severity: VerificationSeverity;
|
|
284
637
|
message: string;
|
|
@@ -287,6 +640,8 @@ interface VerificationFinding {
|
|
|
287
640
|
file?: string;
|
|
288
641
|
rule?: string;
|
|
289
642
|
suggestedFix?: string;
|
|
643
|
+
graph?: VerificationGraphAnchor;
|
|
644
|
+
repair?: VerificationRepairAction;
|
|
290
645
|
}
|
|
291
646
|
interface VerificationScore {
|
|
292
647
|
category: string;
|
|
@@ -350,8 +705,35 @@ interface ProjectHealthRemediation {
|
|
|
350
705
|
prompt: string;
|
|
351
706
|
commands: string[];
|
|
352
707
|
}
|
|
708
|
+
interface EvidenceRepairPlanAction {
|
|
709
|
+
id: string;
|
|
710
|
+
kind: string;
|
|
711
|
+
target?: string | null;
|
|
712
|
+
description: string;
|
|
713
|
+
payload?: Record<string, unknown>;
|
|
714
|
+
}
|
|
715
|
+
interface EvidenceRepairPlan {
|
|
716
|
+
id: string;
|
|
717
|
+
findingId: string;
|
|
718
|
+
diagnosticCode?: string | null;
|
|
719
|
+
repairId?: string | null;
|
|
720
|
+
severity: VerificationSeverity;
|
|
721
|
+
source: ProjectHealthFindingSource;
|
|
722
|
+
category: string;
|
|
723
|
+
graphAnchor?: VerificationGraphAnchor | null;
|
|
724
|
+
actions: EvidenceRepairPlanAction[];
|
|
725
|
+
evidence: Array<{
|
|
726
|
+
id: string;
|
|
727
|
+
text: string;
|
|
728
|
+
}>;
|
|
729
|
+
readTargets: string[];
|
|
730
|
+
preserve: string[];
|
|
731
|
+
avoid: string[];
|
|
732
|
+
commands: string[];
|
|
733
|
+
}
|
|
353
734
|
interface ProjectHealthFinding {
|
|
354
735
|
id: string;
|
|
736
|
+
code?: string;
|
|
355
737
|
source: ProjectHealthFindingSource;
|
|
356
738
|
category: string;
|
|
357
739
|
severity: VerificationSeverity;
|
|
@@ -361,6 +743,9 @@ interface ProjectHealthFinding {
|
|
|
361
743
|
file?: string;
|
|
362
744
|
rule?: string;
|
|
363
745
|
suggestedFix?: string;
|
|
746
|
+
graph?: VerificationGraphAnchor;
|
|
747
|
+
repair?: VerificationRepairAction;
|
|
748
|
+
repairPlan?: EvidenceRepairPlan;
|
|
364
749
|
remediation: ProjectHealthRemediation;
|
|
365
750
|
}
|
|
366
751
|
interface ProjectHealthRouteSummary {
|
|
@@ -379,6 +764,24 @@ interface ProjectHealthPackSummary {
|
|
|
379
764
|
mutationPackCount: number;
|
|
380
765
|
generatedAt: string | null;
|
|
381
766
|
}
|
|
767
|
+
interface ProjectHealthGraphSummary {
|
|
768
|
+
present: boolean;
|
|
769
|
+
ready: boolean;
|
|
770
|
+
current: boolean | null;
|
|
771
|
+
snapshotPresent: boolean;
|
|
772
|
+
manifestPresent: boolean;
|
|
773
|
+
diffPresent: boolean;
|
|
774
|
+
capsulePresent: boolean;
|
|
775
|
+
snapshotId: string | null;
|
|
776
|
+
sourceHash: string | null;
|
|
777
|
+
contractHash: string | null;
|
|
778
|
+
contractCacheKey: string | null;
|
|
779
|
+
sourceArtifactCount: number;
|
|
780
|
+
capsuleSourceArtifactLimit: number | null;
|
|
781
|
+
capsuleSourceArtifactsTruncated: boolean | null;
|
|
782
|
+
staleArtifacts: string[];
|
|
783
|
+
error: string | null;
|
|
784
|
+
}
|
|
382
785
|
interface ProjectHealthReport {
|
|
383
786
|
$schema: string;
|
|
384
787
|
generatedAt: string;
|
|
@@ -401,6 +804,7 @@ interface ProjectHealthReport {
|
|
|
401
804
|
};
|
|
402
805
|
routes: ProjectHealthRouteSummary;
|
|
403
806
|
packs: ProjectHealthPackSummary;
|
|
807
|
+
graph: ProjectHealthGraphSummary;
|
|
404
808
|
ci: {
|
|
405
809
|
recommendedCommand: string;
|
|
406
810
|
failOn: 'error' | 'warn' | 'none';
|
|
@@ -452,12 +856,17 @@ interface EvidenceBundle {
|
|
|
452
856
|
essence: EvidenceProvenanceEntry;
|
|
453
857
|
packManifest: EvidenceProvenanceEntry;
|
|
454
858
|
reviewPack: EvidenceProvenanceEntry;
|
|
859
|
+
graphSnapshot: EvidenceProvenanceEntry;
|
|
860
|
+
graphManifest: EvidenceProvenanceEntry;
|
|
861
|
+
graphDiff: EvidenceProvenanceEntry;
|
|
862
|
+
contractCapsule: EvidenceProvenanceEntry;
|
|
455
863
|
workspaceConfig?: EvidenceProvenanceEntry;
|
|
456
864
|
designTokens?: EvidenceProvenanceEntry;
|
|
457
865
|
};
|
|
458
866
|
assertions: ContractAssertion[];
|
|
459
867
|
findings: Array<{
|
|
460
868
|
id: string;
|
|
869
|
+
code?: string;
|
|
461
870
|
source: ProjectHealthFindingSource;
|
|
462
871
|
category: string;
|
|
463
872
|
severity: VerificationSeverity;
|
|
@@ -466,6 +875,9 @@ interface EvidenceBundle {
|
|
|
466
875
|
target?: string;
|
|
467
876
|
rule?: string;
|
|
468
877
|
suggestedFix?: string;
|
|
878
|
+
graph?: VerificationGraphAnchor;
|
|
879
|
+
repair?: VerificationRepairAction;
|
|
880
|
+
repairPlan?: EvidenceRepairPlan;
|
|
469
881
|
remediationSummary: string;
|
|
470
882
|
commands: string[];
|
|
471
883
|
promptCommand: string;
|
|
@@ -497,6 +909,7 @@ interface EvidenceBundleInput {
|
|
|
497
909
|
designTokens?: EvidenceBundle['designTokens'];
|
|
498
910
|
}
|
|
499
911
|
declare const EVIDENCE_BUNDLE_SCHEMA_URL = "https://decantr.ai/schemas/evidence-bundle.v1.json";
|
|
912
|
+
declare function buildProjectHealthRepairPlan(projectRoot: string, finding: ProjectHealthFinding): EvidenceRepairPlan;
|
|
500
913
|
declare function createContractAssertions(projectRoot: string, audit?: ProjectAuditReport | null): ContractAssertion[];
|
|
501
914
|
declare function createEvidenceBundle(input: EvidenceBundleInput): EvidenceBundle;
|
|
502
915
|
interface FileCritiqueReport {
|
|
@@ -610,9 +1023,10 @@ interface ShowcaseShortlistVerificationReport {
|
|
|
610
1023
|
results: ShowcaseShortlistVerificationEntry[];
|
|
611
1024
|
}
|
|
612
1025
|
declare function collectMissingPackManifestFiles(projectRoot: string, packManifest?: PackManifest | null): MissingPackManifestFile[];
|
|
1026
|
+
declare function collectProjectSourceFiles(projectRoot: string): string[];
|
|
613
1027
|
declare function extractRouteHintsFromEssence(essence: EssenceFile | null): string[];
|
|
614
1028
|
declare function auditProject(projectRoot: string): Promise<ProjectAuditReport>;
|
|
615
1029
|
declare function critiqueSource({ filePath, code, reviewPack, packManifest, treatmentsCss, adoptionMode, }: CritiqueSourceInput): FileCritiqueReport;
|
|
616
1030
|
declare function critiqueFile(filePath: string, projectRoot: string): Promise<FileCritiqueReport>;
|
|
617
1031
|
|
|
618
|
-
export { type BuiltDistAuditOptions, type ContractAssertion, type ContractAssertionCategory, type CritiqueSourceInput, EVIDENCE_BUNDLE_SCHEMA_URL, type EvidenceBundle, type EvidenceBundleInput, type EvidenceProvenanceEntry, type FileCritiqueReport, type GitHubScanInputResolution, INTERACTION_SIGNALS, type InteractionMissingFinding, type InteractionRequirement, type InteractionSignal, type MissingPackManifestFile, type PackManifest, type ProjectAuditReport, type ProjectHealthFinding, type ProjectHealthFindingSource, type ProjectHealthPackSummary, type ProjectHealthRemediation, type ProjectHealthReport, type ProjectHealthRouteSummary, type ProjectHealthStatus, type PublishedSiteProbeV1, type RuntimeAudit, SCAN_REPORT_SCHEMA_URL, type ScanApplicabilityStatus, type ScanConfidence, type ScanFindingSeverity, type ScanFindingV1, type ScanInputKind, type ScanInputV1, type ScanProjectOptions, type ScanReportV1, type ScanRepositoryV1, type ScanRouteV1, type ShowcaseShortlistVerificationEntry, type ShowcaseShortlistVerificationReport, VERIFICATION_SCHEMA_URLS, type VerificationFinding, type VerificationScore, type VerificationSeverity, auditBuiltDist, auditProject, collectMissingPackManifestFiles, createContractAssertions, createEvidenceBundle, createUnavailableScanReport, critiqueFile, critiqueSource, emptyRuntimeAudit, extractRouteHintsFromEssence, listKnownInteractions, probePublishedSite, resolveGitHubScanInput, scanProject, verifyInteractionsInSource };
|
|
1032
|
+
export { type BuiltDistAuditOptions, COMPONENT_REUSE_RULE_ID, type CodeComponentDeclaration, type CodeImportReference, type ComponentReuseAudit, type ComponentReuseFinding, type ContractAssertion, type ContractAssertionCategory, type CritiqueSourceInput, EVIDENCE_BUNDLE_SCHEMA_URL, type EvidenceBundle, type EvidenceBundleInput, type EvidenceProvenanceEntry, type EvidenceRepairPlan, type EvidenceRepairPlanAction, type FileCritiqueReport, type GitHubScanInputResolution, type GraphAnchorEdge, type GraphAnchorFindingInput, type GraphAnchorNode, type GraphAnchorSnapshot, INTERACTION_SIGNALS, type InteractionMissingFinding, type InteractionRequirement, type InteractionSignal, KNOWN_VERIFICATION_DIAGNOSTICS, type MissingPackManifestFile, type PackManifest, type ProjectAuditReport, type ProjectHealthFinding, type ProjectHealthFindingSource, type ProjectHealthGraphSummary, type ProjectHealthPackSummary, type ProjectHealthRemediation, type ProjectHealthReport, type ProjectHealthRouteSummary, type ProjectHealthStatus, type PublishedSiteProbeV1, RAW_CONTROL_REUSE_RULE_ID, type RawControlReuseFinding, type RuntimeAudit, SCAN_REPORT_SCHEMA_URL, STYLE_BRIDGE_ARBITRARY_VALUE_RULE_ID, type ScanApplicabilityStatus, type ScanConfidence, type ScanFindingSeverity, type ScanFindingV1, type ScanInputKind, type ScanInputV1, type ScanProjectOptions, type ScanReportV1, type ScanRepositoryV1, type ScanRouteV1, type ShowcaseShortlistVerificationEntry, type ShowcaseShortlistVerificationReport, type StyleBridgeDriftAudit, type StyleBridgeDriftFinding, VERIFICATION_SCHEMA_URLS, type VerificationDiagnosticCatalogEntry, type VerificationDiagnosticInput, type VerificationDiagnosticMetadata, type VerificationFinding, type VerificationGraphAnchor, type VerificationGraphAnchorConfidence, type VerificationRepairAction, type VerificationScore, type VerificationSeverity, anchorFindingsToGraph, auditBuiltDist, auditComponentReuse, auditProject, auditStyleBridgeDrift, buildProjectHealthRepairPlan, collectMissingPackManifestFiles, collectProjectSourceFiles, createContractAssertions, createEvidenceBundle, createUnavailableScanReport, critiqueFile, critiqueSource, deriveVerificationDiagnostic, emptyRuntimeAudit, extractRouteHintsFromEssence, listKnownInteractions, probePublishedSite, resolveGitHubScanInput, resolveGraphAnchorForFinding, scanProject, verifyInteractionsInSource };
|