@decantr/verifier 3.0.0-next.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,6 +37,14 @@ npm install @decantr/verifier
37
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
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
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`
40
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
41
49
  - published verifier report schemas are exercised by AJV-backed round-trip tests against real audit, critique, and shortlist-report outputs
42
50
  - project audits include runtime evidence when a built `dist/` output is present:
package/dist/index.d.ts CHANGED
@@ -61,6 +61,16 @@ declare const KNOWN_VERIFICATION_DIAGNOSTICS: readonly [{
61
61
  readonly code: "COMP010";
62
62
  readonly repairId: "replace-raw-control-with-local-component";
63
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";
64
74
  }, {
65
75
  readonly rule: "component-reuse-primitive-reimplemented";
66
76
  readonly code: "COMP001";
@@ -96,6 +106,36 @@ declare const KNOWN_VERIFICATION_DIAGNOSTICS: readonly [{
96
106
  readonly code: "A11Y001";
97
107
  readonly repairId: "enable-focus-visible";
98
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";
99
139
  }, {
100
140
  readonly rule: "pack-manifest-present";
101
141
  readonly code: "CTX002";
@@ -305,28 +345,6 @@ interface ComponentReuseAudit {
305
345
  }
306
346
  declare function auditComponentReuse(projectRoot: string, sourceFiles: string[]): ComponentReuseAudit;
307
347
 
308
- declare const STYLE_BRIDGE_ARBITRARY_VALUE_RULE_ID = "style-bridge-arbitrary-value";
309
- interface StyleBridgeDriftFinding {
310
- id: string;
311
- file: string;
312
- line: number;
313
- className: string;
314
- value: string;
315
- source: 'className' | 'inline-style' | 'stylesheet';
316
- property?: string;
317
- bridgeMappingIds: string[];
318
- tokenHints: string[];
319
- classHints: string[];
320
- evidence: string[];
321
- }
322
- interface StyleBridgeDriftAudit {
323
- filesChecked: number;
324
- bridgeMappingCount: number;
325
- arbitraryValueCount: number;
326
- findings: StyleBridgeDriftFinding[];
327
- }
328
- declare function auditStyleBridgeDrift(projectRoot: string, sourceFiles: string[]): StyleBridgeDriftAudit;
329
-
330
348
  /**
331
349
  * Experiential interaction verifier.
332
350
  *
@@ -575,6 +593,28 @@ declare function probePublishedSite(url: string, options?: {
575
593
  }): Promise<PublishedSiteProbeV1>;
576
594
  declare function resolveGitHubScanInput(input: string): GitHubScanInputResolution;
577
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
+
578
618
  declare const VERIFICATION_SCHEMA_URLS: {
579
619
  readonly common: "https://decantr.ai/schemas/verification-report.common.v1.json";
580
620
  readonly projectAudit: "https://decantr.ai/schemas/project-audit-report.v1.json";