@decantr/verifier 3.6.1 → 3.8.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 CHANGED
@@ -15,7 +15,8 @@ npm install @decantr/verifier
15
15
 
16
16
  - `auditProject()` for project-level Decantr audits
17
17
  - `auditBuiltDist()` for built-output runtime verification against emitted HTML, assets, and route hints
18
- - `scanProject()` for read-only Brownfield reconnaissance of framework, routes, components, styling, static-hosting hints, Decantr presence, and assistant-rule files
18
+ - `discoverProject()` for shared read-only Brownfield discovery of workspace/app scope, package manager, framework, language, source-declared routes, taskable routes, component inventory, styling authority, Decantr presence, and assistant-rule files
19
+ - `scanProject()` for read-only Brownfield reconnaissance that emits `scan-report.v2` by default using the shared discovery substrate
19
20
  - `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
21
  - `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
22
  - `collectProjectSourceFiles()` for the shared production-source file selection used by Project Health, component reuse drift, style bridge drift, and typed graph source provenance
@@ -96,12 +97,13 @@ function isBlocking(report: ProjectHealthReport) {
96
97
  - `@decantr/verifier/schema/loop-readiness.v2.json`
97
98
  - `@decantr/verifier/schema/proof-field-report.v2.json`
98
99
  - `@decantr/verifier/schema/scan-report.v1.json`
100
+ - `@decantr/verifier/schema/scan-report.v2.json`
99
101
  - `@decantr/verifier/schema/workspace-health-report.v1.json`
100
102
  - `@decantr/verifier/schema/workspace-health-report.v2.json`
101
103
  - `@decantr/verifier/schema/file-critique-report.v1.json`
102
104
  - `@decantr/verifier/schema/showcase-shortlist-report.v1.json`
103
105
 
104
- The v2 schema assets are the active Decantr 3.5 contracts for Project Health, CI, Workspace Health, Evidence Bundles, runtime probes, authority resolution, loop readiness, and proof field reports. v1 health/evidence schemas remain published for stored-artifact compatibility; audit, scan, file-critique, and showcase reports remain v1 until those wires need to change. See [Report Schemas](https://decantr.ai/reference/report-schemas.md).
106
+ The v2 schema assets are the active Decantr 3 contracts for Project Health, CI, Workspace Health, Evidence Bundles, runtime probes, authority resolution, loop readiness, proof field reports, and Brownfield scan reports. v1 health/evidence/scan schemas remain published for stored-artifact compatibility; audit, file-critique, and showcase reports remain v1 until those wires need to change. See [Report Schemas](https://decantr.ai/reference/report-schemas.md).
105
107
 
106
108
  ## Security And Permissions
107
109
 
package/dist/index.d.ts CHANGED
@@ -516,6 +516,99 @@ interface ComponentReuseAudit {
516
516
  }
517
517
  declare function auditComponentReuse(projectRoot: string, sourceFiles: string[]): ComponentReuseAudit;
518
518
 
519
+ type DiscoveryConfidenceLevel = 'high' | 'medium' | 'low';
520
+ type DiscoveryPackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
521
+ type DiscoveryFramework = 'angular' | 'astro' | 'html' | 'nextjs' | 'nuxt' | 'react' | 'solid' | 'svelte' | 'vue' | 'unknown';
522
+ type DiscoveryPrimaryLanguage = 'go' | 'html' | 'javascript' | 'python' | 'rust' | 'typescript' | 'unknown';
523
+ type DiscoveryRouteStrategy = 'angular-router' | 'app-router' | 'mixed-next-router' | 'none' | 'nuxt-router' | 'pages-router' | 'react-router' | 'source-declared' | 'static-html' | 'sveltekit-router' | 'vue-router';
524
+ type DiscoveryRouteSignalKind = 'angular-router' | 'file-route' | 'html-route' | 'pathname-branch' | 'react-router' | 'source-declared' | 'tanstack-router' | 'vue-router';
525
+ interface DiscoveryRouteSignal {
526
+ path: string;
527
+ file: string;
528
+ kind: DiscoveryRouteSignalKind;
529
+ confidence: DiscoveryConfidenceLevel;
530
+ taskable: boolean;
531
+ evidence: string;
532
+ }
533
+ interface DiscoveryRoute {
534
+ path: string;
535
+ file: string;
536
+ hasLayout: boolean;
537
+ confidence: DiscoveryConfidenceLevel;
538
+ source: DiscoveryRouteSignalKind;
539
+ }
540
+ interface DiscoveryComponent {
541
+ name: string;
542
+ file: string;
543
+ kind: 'exported' | 'default-export' | 'wrapper' | 'pascal-file' | 'route-local';
544
+ confidence: DiscoveryConfidenceLevel;
545
+ }
546
+ interface DiscoveryProjectIdentity {
547
+ framework: DiscoveryFramework;
548
+ frameworkVersion: string | null;
549
+ packageManager: DiscoveryPackageManager;
550
+ primaryLanguage: DiscoveryPrimaryLanguage;
551
+ hasTypeScript: boolean;
552
+ hasTailwind: boolean;
553
+ hasDecantr: boolean;
554
+ packageName: string | null;
555
+ packageJsonPresent: boolean;
556
+ packageJsonValid: boolean;
557
+ dependencies: Record<string, string>;
558
+ evidence: string[];
559
+ }
560
+ interface DiscoveryWorkspaceScope {
561
+ workspaceRoot: string;
562
+ appRoot: string;
563
+ projectPath: string;
564
+ scope: 'single-app' | 'workspace-app';
565
+ }
566
+ interface DiscoveryRoutes {
567
+ strategy: DiscoveryRouteStrategy;
568
+ routeSignals: DiscoveryRouteSignal[];
569
+ taskableRoutes: DiscoveryRoute[];
570
+ routeSignalCount: number;
571
+ taskableRouteCount: number;
572
+ confidence: DiscoveryConfidenceLevel;
573
+ limitations: string[];
574
+ }
575
+ interface DiscoveryComponents {
576
+ pageCount: number;
577
+ componentCount: number;
578
+ directories: string[];
579
+ items: DiscoveryComponent[];
580
+ confidence: DiscoveryConfidenceLevel;
581
+ evidence: string[];
582
+ limitations: string[];
583
+ }
584
+ interface DiscoveryStyling {
585
+ approach: string;
586
+ configFile: string | null;
587
+ cssVariableCount: number;
588
+ colorTokenCount: number;
589
+ darkMode: boolean;
590
+ themeSignals: string[];
591
+ }
592
+ interface ProjectDiscovery {
593
+ schemaVersion: 'discovery.v1';
594
+ generatedAt: string;
595
+ workspace: DiscoveryWorkspaceScope;
596
+ project: DiscoveryProjectIdentity;
597
+ routes: DiscoveryRoutes;
598
+ components: DiscoveryComponents;
599
+ styling: DiscoveryStyling;
600
+ assistant: {
601
+ ruleFiles: string[];
602
+ };
603
+ confidence: {
604
+ level: DiscoveryConfidenceLevel;
605
+ score: number;
606
+ reasons: string[];
607
+ };
608
+ limitations: string[];
609
+ }
610
+ declare function discoverProject(projectRoot: string): ProjectDiscovery;
611
+
519
612
  /**
520
613
  * Experiential interaction verifier.
521
614
  *
@@ -589,7 +682,9 @@ type ScanInputKind = 'local' | 'github-repo' | 'github-pages';
589
682
  type ScanConfidence = 'high' | 'medium' | 'low';
590
683
  type ScanApplicabilityStatus = 'strong_fit' | 'partial_fit' | 'not_applicable' | 'unknown';
591
684
  type ScanFindingSeverity = 'success' | 'info' | 'warn' | 'error';
592
- declare const SCAN_REPORT_SCHEMA_URL = "https://decantr.ai/schemas/scan-report.v1.json";
685
+ declare const SCAN_REPORT_V1_SCHEMA_URL = "https://decantr.ai/schemas/scan-report.v1.json";
686
+ declare const SCAN_REPORT_V2_SCHEMA_URL = "https://decantr.ai/schemas/scan-report.v2.json";
687
+ declare const SCAN_REPORT_SCHEMA_URL = "https://decantr.ai/schemas/scan-report.v2.json";
593
688
  interface ScanInputV1 {
594
689
  kind: ScanInputKind;
595
690
  value: string;
@@ -669,7 +764,7 @@ interface ScanGraphPreviewV1 {
669
764
  } | null;
670
765
  }
671
766
  interface ScanReportV1 {
672
- $schema: typeof SCAN_REPORT_SCHEMA_URL;
767
+ $schema: typeof SCAN_REPORT_V1_SCHEMA_URL;
673
768
  schemaVersion: 'scan-report.v1';
674
769
  generatedAt: string;
675
770
  input: ScanInputV1;
@@ -735,6 +830,70 @@ interface ScanReportV1 {
735
830
  notes: string[];
736
831
  };
737
832
  }
833
+ interface ScanRouteSignalV2 {
834
+ path: string;
835
+ file: string;
836
+ kind: string;
837
+ confidence: DiscoveryConfidenceLevel;
838
+ taskable: boolean;
839
+ evidence: string;
840
+ }
841
+ interface ScanComponentV2 {
842
+ name: string;
843
+ file: string;
844
+ kind: DiscoveryComponent['kind'];
845
+ confidence: DiscoveryConfidenceLevel;
846
+ }
847
+ interface ScanDiscoveryV2 {
848
+ schemaVersion: 'discovery.v1';
849
+ workspace: {
850
+ projectPath: string;
851
+ scope: 'single-app' | 'workspace-app';
852
+ };
853
+ projectEvidence: string[];
854
+ routeSignalCount: number;
855
+ taskableRouteCount: number;
856
+ routeConfidence: DiscoveryConfidenceLevel;
857
+ componentConfidence: DiscoveryConfidenceLevel;
858
+ componentEvidence: string[];
859
+ limitations: string[];
860
+ }
861
+ interface ScanReportV2 {
862
+ $schema: typeof SCAN_REPORT_V2_SCHEMA_URL;
863
+ schemaVersion: 'scan-report.v2';
864
+ generatedAt: string;
865
+ input: ScanInputV1;
866
+ source: ScanReportV1['source'];
867
+ confidence: ScanReportV1['confidence'];
868
+ applicability: ScanReportV1['applicability'];
869
+ project: ScanReportV1['project'] & {
870
+ evidence: string[];
871
+ workspaceScope: 'single-app' | 'workspace-app';
872
+ projectPath: string;
873
+ };
874
+ routes: ScanReportV1['routes'] & {
875
+ routeSignalCount: number;
876
+ taskableRouteCount: number;
877
+ confidence: DiscoveryConfidenceLevel;
878
+ signals: ScanRouteSignalV2[];
879
+ };
880
+ components: ScanReportV1['components'] & {
881
+ confidence: DiscoveryConfidenceLevel;
882
+ evidence: string[];
883
+ items: ScanComponentV2[];
884
+ limitations: string[];
885
+ };
886
+ styling: ScanReportV1['styling'];
887
+ staticHosting: ScanReportV1['staticHosting'];
888
+ assistant: ScanReportV1['assistant'];
889
+ graphPreview?: ScanGraphPreviewV1;
890
+ pagesProbe: PublishedSiteProbeV1 | null;
891
+ discovery: ScanDiscoveryV2;
892
+ findings: ScanFindingV1[];
893
+ recommendedCommands: string[];
894
+ privacy: ScanReportV1['privacy'];
895
+ }
896
+ type ScanReport = ScanReportV2;
738
897
  interface ScanProjectOptions {
739
898
  input?: ScanInputV1;
740
899
  repository?: ScanRepositoryV1 | null;
@@ -748,7 +907,7 @@ interface GitHubScanInputResolution {
748
907
  publishedSiteUrl: string | null;
749
908
  warnings: string[];
750
909
  }
751
- declare function scanProject(projectRoot: string, options?: ScanProjectOptions): Promise<ScanReportV1>;
910
+ declare function scanProject(projectRoot: string, options?: ScanProjectOptions): Promise<ScanReportV2>;
752
911
  declare function createUnavailableScanReport(input: {
753
912
  scanInput: ScanInputV1;
754
913
  repository?: ScanRepositoryV1 | null;
@@ -757,7 +916,7 @@ declare function createUnavailableScanReport(input: {
757
916
  title: string;
758
917
  message: string;
759
918
  evidence?: string[];
760
- }): ScanReportV1;
919
+ }): ScanReportV2;
761
920
  declare function probePublishedSite(url: string, options?: {
762
921
  timeoutMs?: number;
763
922
  fetchImpl?: typeof fetch;
@@ -914,7 +1073,7 @@ declare const VERIFICATION_SCHEMA_URLS: {
914
1073
  readonly projectHealth: "https://decantr.ai/schemas/project-health-report.v2.json";
915
1074
  readonly decantrCi: "https://decantr.ai/schemas/decantr-ci-report.v2.json";
916
1075
  readonly evidenceBundle: "https://decantr.ai/schemas/evidence-bundle.v2.json";
917
- readonly scanReport: "https://decantr.ai/schemas/scan-report.v1.json";
1076
+ readonly scanReport: "https://decantr.ai/schemas/scan-report.v2.json";
918
1077
  readonly workspaceHealth: "https://decantr.ai/schemas/workspace-health-report.v2.json";
919
1078
  readonly fileCritique: "https://decantr.ai/schemas/file-critique-report.v1.json";
920
1079
  readonly showcaseShortlist: "https://decantr.ai/schemas/showcase-shortlist-report.v1.json";
@@ -1375,4 +1534,4 @@ declare function auditProject(projectRoot: string): Promise<ProjectAuditReport>;
1375
1534
  declare function critiqueSource({ filePath, code, reviewPack, packManifest, treatmentsCss, adoptionMode, }: CritiqueSourceInput): FileCritiqueReport;
1376
1535
  declare function critiqueFile(filePath: string, projectRoot: string): Promise<FileCritiqueReport>;
1377
1536
 
1378
- export { AUTHORITY_RESOLUTION_V2_SCHEMA_URL, type AuthorityConflict, type AuthorityLaneId, type AuthorityOrderEntry, type AuthorityResolution, type AuthorityResolutionAction, type AuthorityResolutionActionKind, type BuiltDistAuditOptions, COMPONENT_REUSE_RULE_ID, type CodeComponentDeclaration, type CodeImportReference, type ComponentReuseAudit, type ComponentReuseFinding, type ContractAssertion, type ContractAssertionCategory, type CritiqueSourceInput, DECANTR_CI_REPORT_V2_SCHEMA_URL, EVIDENCE_BUNDLE_SCHEMA_URL, EVIDENCE_BUNDLE_V2_SCHEMA_URL, type EvidenceBundle, type EvidenceBundleInput, type EvidenceConfidenceLevel, type EvidenceProvenanceEntry, type EvidenceRepairPlan, type EvidenceRepairPlanAction, type EvidenceTier, type EvidenceTierCapability, type EvidenceTierOptions, type EvidenceTierStage, type EvidenceTierStatus, type ExtractSourceStringLiteralOptions, type FileCritiqueReport, type GitHubScanInputResolution, type GraphAnchorEdge, type GraphAnchorFindingInput, type GraphAnchorNode, type GraphAnchorSnapshot, type GraphImpactSummary, INTERACTION_SIGNALS, type InteractionMissingFinding, type InteractionRequirement, type InteractionSignal, KNOWN_VERIFICATION_DIAGNOSTICS, LOOP_READINESS_V2_SCHEMA_URL, type LoopInstructionBlock, type LoopReadiness, type LoopReadinessState, type MissingPackManifestFile, PROJECT_HEALTH_REPORT_V2_SCHEMA_URL, PROOF_FIELD_REPORT_V2_SCHEMA_URL, type PackManifest, type ProjectAuditReport, type ProjectHealthFinding, type ProjectHealthFindingLike, type ProjectHealthFindingSource, type ProjectHealthGraphSummary, type ProjectHealthPackSummary, type ProjectHealthRemediation, type ProjectHealthReport, type ProjectHealthReportLike, type ProjectHealthRouteSummary, type ProjectHealthStatus, type ProjectSourceFile, type ProjectSourceKind, type ProjectSourceLanguage, type ProjectSourceProgram, type ProjectSourceProgramOptions, type PublishedSiteProbeV1, RAW_CONTROL_REUSE_RULE_ID, RUNTIME_PROBE_PAYLOAD_V2_SCHEMA_URL, type RawControlReuseFinding, type ResolveSourceSymbolOriginOptions, 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 SourceImportKind, type SourceImportReference, type SourceImportResolution, type SourceImportResolutionKind, type SourceInventory, type SourceInventoryOptions, type SourceInventorySkipReason, type SourceInventorySkippedPath, type SourceLocation, type SourceStringLiteral, type SourceStringLiteralContext, type SourceSymbolOrigin, type StyleBridgeDriftAudit, type StyleBridgeDriftFinding, VERIFICATION_COMMON_V2_SCHEMA_URL, VERIFICATION_SCHEMA_URLS, type VerificationDiagnosticCatalogEntry, type VerificationDiagnosticInput, type VerificationDiagnosticMetadata, type VerificationFinding, type VerificationGraphAnchor, type VerificationGraphAnchorConfidence, type VerificationRepairAction, type VerificationScore, type VerificationSeverity, WORKSPACE_HEALTH_REPORT_V2_SCHEMA_URL, anchorFindingsToGraph, auditBuiltDist, auditComponentReuse, auditProject, auditStyleBridgeDrift, buildProjectHealthRepairPlan, collectMissingPackManifestFiles, collectProjectSourceFiles, collectSourceImports, createAuthorityOrder, createAuthorityResolution, createContractAssertions, createEvidenceBundle, createEvidenceTier, createLoopReadiness, createProjectSourceProgram, createSourceInventory, createUnavailableScanReport, critiqueFile, critiqueSource, deriveVerificationDiagnostic, emptyRuntimeAudit, extractRouteHintsFromEssence, extractSourceStringLiterals, getProjectSourceFile, isPathInsideProject, isSupportedSourceExtension, listKnownInteractions, normalizeSourcePath, probePublishedSite, resolveGitHubScanInput, resolveGraphAnchorForFinding, resolveSourceImport, resolveSourceSymbolOrigin, scanProject, sourceKindFromPath, sourceLanguageFromPath, sourceLocationForNode, sourceScriptKindFromPath, verifyInteractionsInSource };
1537
+ export { AUTHORITY_RESOLUTION_V2_SCHEMA_URL, type AuthorityConflict, type AuthorityLaneId, type AuthorityOrderEntry, type AuthorityResolution, type AuthorityResolutionAction, type AuthorityResolutionActionKind, type BuiltDistAuditOptions, COMPONENT_REUSE_RULE_ID, type CodeComponentDeclaration, type CodeImportReference, type ComponentReuseAudit, type ComponentReuseFinding, type ContractAssertion, type ContractAssertionCategory, type CritiqueSourceInput, DECANTR_CI_REPORT_V2_SCHEMA_URL, type DiscoveryComponent, type DiscoveryConfidenceLevel, type DiscoveryFramework, type DiscoveryPackageManager, type DiscoveryPrimaryLanguage, type DiscoveryRoute, type DiscoveryRouteSignal, type DiscoveryRouteSignalKind, type DiscoveryRouteStrategy, type DiscoveryRoutes, type DiscoveryStyling, EVIDENCE_BUNDLE_SCHEMA_URL, EVIDENCE_BUNDLE_V2_SCHEMA_URL, type EvidenceBundle, type EvidenceBundleInput, type EvidenceConfidenceLevel, type EvidenceProvenanceEntry, type EvidenceRepairPlan, type EvidenceRepairPlanAction, type EvidenceTier, type EvidenceTierCapability, type EvidenceTierOptions, type EvidenceTierStage, type EvidenceTierStatus, type ExtractSourceStringLiteralOptions, type FileCritiqueReport, type GitHubScanInputResolution, type GraphAnchorEdge, type GraphAnchorFindingInput, type GraphAnchorNode, type GraphAnchorSnapshot, type GraphImpactSummary, INTERACTION_SIGNALS, type InteractionMissingFinding, type InteractionRequirement, type InteractionSignal, KNOWN_VERIFICATION_DIAGNOSTICS, LOOP_READINESS_V2_SCHEMA_URL, type LoopInstructionBlock, type LoopReadiness, type LoopReadinessState, type MissingPackManifestFile, PROJECT_HEALTH_REPORT_V2_SCHEMA_URL, PROOF_FIELD_REPORT_V2_SCHEMA_URL, type PackManifest, type ProjectAuditReport, type ProjectDiscovery, type ProjectHealthFinding, type ProjectHealthFindingLike, type ProjectHealthFindingSource, type ProjectHealthGraphSummary, type ProjectHealthPackSummary, type ProjectHealthRemediation, type ProjectHealthReport, type ProjectHealthReportLike, type ProjectHealthRouteSummary, type ProjectHealthStatus, type ProjectSourceFile, type ProjectSourceKind, type ProjectSourceLanguage, type ProjectSourceProgram, type ProjectSourceProgramOptions, type PublishedSiteProbeV1, RAW_CONTROL_REUSE_RULE_ID, RUNTIME_PROBE_PAYLOAD_V2_SCHEMA_URL, type RawControlReuseFinding, type ResolveSourceSymbolOriginOptions, type RuntimeAudit, SCAN_REPORT_SCHEMA_URL, SCAN_REPORT_V1_SCHEMA_URL, SCAN_REPORT_V2_SCHEMA_URL, STYLE_BRIDGE_ARBITRARY_VALUE_RULE_ID, type ScanApplicabilityStatus, type ScanConfidence, type ScanFindingSeverity, type ScanFindingV1, type ScanInputKind, type ScanInputV1, type ScanProjectOptions, type ScanReport, type ScanReportV1, type ScanReportV2, type ScanRepositoryV1, type ScanRouteSignalV2, type ScanRouteV1, type ShowcaseShortlistVerificationEntry, type ShowcaseShortlistVerificationReport, type SourceImportKind, type SourceImportReference, type SourceImportResolution, type SourceImportResolutionKind, type SourceInventory, type SourceInventoryOptions, type SourceInventorySkipReason, type SourceInventorySkippedPath, type SourceLocation, type SourceStringLiteral, type SourceStringLiteralContext, type SourceSymbolOrigin, type StyleBridgeDriftAudit, type StyleBridgeDriftFinding, VERIFICATION_COMMON_V2_SCHEMA_URL, VERIFICATION_SCHEMA_URLS, type VerificationDiagnosticCatalogEntry, type VerificationDiagnosticInput, type VerificationDiagnosticMetadata, type VerificationFinding, type VerificationGraphAnchor, type VerificationGraphAnchorConfidence, type VerificationRepairAction, type VerificationScore, type VerificationSeverity, WORKSPACE_HEALTH_REPORT_V2_SCHEMA_URL, anchorFindingsToGraph, auditBuiltDist, auditComponentReuse, auditProject, auditStyleBridgeDrift, buildProjectHealthRepairPlan, collectMissingPackManifestFiles, collectProjectSourceFiles, collectSourceImports, createAuthorityOrder, createAuthorityResolution, createContractAssertions, createEvidenceBundle, createEvidenceTier, createLoopReadiness, createProjectSourceProgram, createSourceInventory, createUnavailableScanReport, critiqueFile, critiqueSource, deriveVerificationDiagnostic, discoverProject, emptyRuntimeAudit, extractRouteHintsFromEssence, extractSourceStringLiterals, getProjectSourceFile, isPathInsideProject, isSupportedSourceExtension, listKnownInteractions, normalizeSourcePath, probePublishedSite, resolveGitHubScanInput, resolveGraphAnchorForFinding, resolveSourceImport, resolveSourceSymbolOrigin, scanProject, sourceKindFromPath, sourceLanguageFromPath, sourceLocationForNode, sourceScriptKindFromPath, verifyInteractionsInSource };