code-auditor-mcp 4.1.0 → 5.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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +374 -0
- package/README.md +4 -4
- package/configs/hhra-compat.json +0 -8
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.d.ts +1 -1
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.d.ts.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.js +7 -1
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.js.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.d.ts +2 -8
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.d.ts.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.js +4 -4
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.js.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.d.ts +1 -1
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.d.ts.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.js.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.d.ts +2 -2
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.d.ts.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.js.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.d.ts +1 -1
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.d.ts.map +1 -1
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.js.map +1 -1
- package/dist/analyzers/applicability.d.ts +42 -0
- package/dist/analyzers/applicability.d.ts.map +1 -1
- package/dist/analyzers/applicability.js +74 -0
- package/dist/analyzers/applicability.js.map +1 -1
- package/dist/analyzers/cross-language/APIContractAnalyzer.js +18 -24
- package/dist/analyzers/cross-language/APIContractAnalyzer.js.map +1 -1
- package/dist/analyzers/cross-language/DependencyGraphBuilder.d.ts +30 -23
- package/dist/analyzers/cross-language/DependencyGraphBuilder.d.ts.map +1 -1
- package/dist/analyzers/cross-language/DependencyGraphBuilder.js +113 -76
- package/dist/analyzers/cross-language/DependencyGraphBuilder.js.map +1 -1
- package/dist/analyzers/cross-language/SchemaValidator.d.ts +2 -0
- package/dist/analyzers/cross-language/SchemaValidator.d.ts.map +1 -1
- package/dist/analyzers/cross-language/SchemaValidator.js +8 -3
- package/dist/analyzers/cross-language/SchemaValidator.js.map +1 -1
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.js +210 -148
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.js.map +1 -1
- package/dist/analyzers/documentationAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/documentationAnalyzer.js +23 -28
- package/dist/analyzers/documentationAnalyzer.js.map +1 -1
- package/dist/analyzers/handleIdentification.d.ts +356 -0
- package/dist/analyzers/handleIdentification.d.ts.map +1 -0
- package/dist/analyzers/handleIdentification.js +424 -0
- package/dist/analyzers/handleIdentification.js.map +1 -0
- package/dist/analyzers/manifestStaleness.d.ts +64 -0
- package/dist/analyzers/manifestStaleness.d.ts.map +1 -0
- package/dist/analyzers/manifestStaleness.js +115 -0
- package/dist/analyzers/manifestStaleness.js.map +1 -0
- package/dist/analyzers/orgFilterTiers.d.ts +73 -1
- package/dist/analyzers/orgFilterTiers.d.ts.map +1 -1
- package/dist/analyzers/orgFilterTiers.js +166 -1
- package/dist/analyzers/orgFilterTiers.js.map +1 -1
- package/dist/analyzers/provenance.d.ts +251 -57
- package/dist/analyzers/provenance.d.ts.map +1 -1
- package/dist/analyzers/provenance.js +1109 -429
- package/dist/analyzers/provenance.js.map +1 -1
- package/dist/analyzers/reactAnalyzer.d.ts +2 -0
- package/dist/analyzers/reactAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/reactAnalyzer.js +2 -0
- package/dist/analyzers/reactAnalyzer.js.map +1 -1
- package/dist/analyzers/receiverResolution.d.ts +183 -0
- package/dist/analyzers/receiverResolution.d.ts.map +1 -0
- package/dist/analyzers/receiverResolution.js +540 -0
- package/dist/analyzers/receiverResolution.js.map +1 -0
- package/dist/analyzers/receiverRoot.d.ts +328 -0
- package/dist/analyzers/receiverRoot.d.ts.map +1 -0
- package/dist/analyzers/receiverRoot.js +990 -0
- package/dist/analyzers/receiverRoot.js.map +1 -0
- package/dist/analyzers/ruleRegistry.d.ts +12 -68
- package/dist/analyzers/ruleRegistry.d.ts.map +1 -1
- package/dist/analyzers/ruleRegistry.js +32 -342
- package/dist/analyzers/ruleRegistry.js.map +1 -1
- package/dist/analyzers/ruleTiming.d.ts +10 -0
- package/dist/analyzers/ruleTiming.d.ts.map +1 -1
- package/dist/analyzers/ruleTiming.js +20 -0
- package/dist/analyzers/ruleTiming.js.map +1 -1
- package/dist/analyzers/sqlLiteral.d.ts +76 -0
- package/dist/analyzers/sqlLiteral.d.ts.map +1 -0
- package/dist/analyzers/sqlLiteral.js +419 -0
- package/dist/analyzers/sqlLiteral.js.map +1 -0
- package/dist/analyzers/tsEcosystem.d.ts +115 -0
- package/dist/analyzers/tsEcosystem.d.ts.map +1 -0
- package/dist/analyzers/tsEcosystem.js +231 -0
- package/dist/analyzers/tsEcosystem.js.map +1 -0
- package/dist/analyzers/tsExpressionDescriptor.d.ts +156 -0
- package/dist/analyzers/tsExpressionDescriptor.d.ts.map +1 -0
- package/dist/analyzers/tsExpressionDescriptor.js +374 -0
- package/dist/analyzers/tsExpressionDescriptor.js.map +1 -0
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.d.ts +6 -0
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js +107 -44
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.d.ts +1 -12
- package/dist/analyzers/universal/UniversalDRYAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js +24 -101
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts +287 -49
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js +2130 -512
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.js +2 -18
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.d.ts +0 -33
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.js +20 -143
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.d.ts +4 -3
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.js +36 -13
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSecretsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSecretsAnalyzer.js +6 -0
- package/dist/analyzers/universal/UniversalSecretsAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSecurityAnalyzer.d.ts +15 -0
- package/dist/analyzers/universal/UniversalSecurityAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSecurityAnalyzer.js +25 -0
- package/dist/analyzers/universal/UniversalSecurityAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts +21 -32
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js +166 -196
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/functionConcerns.d.ts +3 -0
- package/dist/analyzers/universal/functionConcerns.d.ts.map +1 -1
- package/dist/analyzers/universal/functionConcerns.js +4 -1
- package/dist/analyzers/universal/functionConcerns.js.map +1 -1
- package/dist/analyzers/universal/schema/codeAnalysis.d.ts +310 -69
- package/dist/analyzers/universal/schema/codeAnalysis.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/codeAnalysis.js +709 -383
- package/dist/analyzers/universal/schema/codeAnalysis.js.map +1 -1
- package/dist/analyzers/universal/schema/config.d.ts +3 -14
- package/dist/analyzers/universal/schema/config.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/config.js +3 -16
- package/dist/analyzers/universal/schema/config.js.map +1 -1
- package/dist/analyzers/universal/schema/discovery.d.ts +22 -1
- package/dist/analyzers/universal/schema/discovery.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/discovery.js +36 -20
- package/dist/analyzers/universal/schema/discovery.js.map +1 -1
- package/dist/analyzers/universal/schema/jsonSchema.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/jsonSchema.js +13 -3
- package/dist/analyzers/universal/schema/jsonSchema.js.map +1 -1
- package/dist/analyzers/universal/schema/migrations.d.ts +187 -27
- package/dist/analyzers/universal/schema/migrations.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/migrations.js +443 -186
- package/dist/analyzers/universal/schema/migrations.js.map +1 -1
- package/dist/analyzers/universal/schema/types.d.ts +17 -3
- package/dist/analyzers/universal/schema/types.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/violations.js +1 -1
- package/dist/analyzers/universal/schema/violations.js.map +1 -1
- package/dist/analyzers/universal/styleScale.d.ts +52 -0
- package/dist/analyzers/universal/styleScale.d.ts.map +1 -0
- package/dist/analyzers/universal/styleScale.js +95 -0
- package/dist/analyzers/universal/styleScale.js.map +1 -0
- package/dist/applyDataDirEnv.js +1 -1
- package/dist/applyDataDirEnv.js.map +1 -1
- package/dist/auditRouter.d.ts +26 -30
- package/dist/auditRouter.d.ts.map +1 -1
- package/dist/auditRouter.js +373 -143
- package/dist/auditRouter.js.map +1 -1
- package/dist/auditRunner.d.ts +64 -1
- package/dist/auditRunner.d.ts.map +1 -1
- package/dist/auditRunner.js +1537 -1051
- package/dist/auditRunner.js.map +1 -1
- package/dist/baseline.d.ts +30 -3
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +70 -9
- package/dist/baseline.js.map +1 -1
- package/dist/cli.js +997 -812
- package/dist/cli.js.map +1 -1
- package/dist/codeIndex/analyzerConfig.d.ts +60 -0
- package/dist/codeIndex/analyzerConfig.d.ts.map +1 -0
- package/dist/codeIndex/analyzerConfig.js +98 -0
- package/dist/codeIndex/analyzerConfig.js.map +1 -0
- package/dist/codeIndex/auditResults.d.ts +39 -0
- package/dist/codeIndex/auditResults.d.ts.map +1 -0
- package/dist/codeIndex/auditResults.js +99 -0
- package/dist/codeIndex/auditResults.js.map +1 -0
- package/dist/codeIndex/codeMap.d.ts +59 -0
- package/dist/codeIndex/codeMap.d.ts.map +1 -0
- package/dist/codeIndex/codeMap.js +72 -0
- package/dist/codeIndex/codeMap.js.map +1 -0
- package/dist/codeIndex/conventions.d.ts +33 -0
- package/dist/codeIndex/conventions.d.ts.map +1 -0
- package/dist/codeIndex/conventions.js +84 -0
- package/dist/codeIndex/conventions.js.map +1 -0
- package/dist/codeIndex/coverage.d.ts +78 -0
- package/dist/codeIndex/coverage.d.ts.map +1 -0
- package/dist/codeIndex/coverage.js +164 -0
- package/dist/codeIndex/coverage.js.map +1 -0
- package/dist/codeIndex/dependencyGraph.d.ts +97 -0
- package/dist/codeIndex/dependencyGraph.d.ts.map +1 -0
- package/dist/codeIndex/dependencyGraph.js +241 -0
- package/dist/codeIndex/dependencyGraph.js.map +1 -0
- package/dist/codeIndex/functionIndex.d.ts +111 -0
- package/dist/codeIndex/functionIndex.d.ts.map +1 -0
- package/dist/codeIndex/functionIndex.js +306 -0
- package/dist/codeIndex/functionIndex.js.map +1 -0
- package/dist/codeIndex/inferredReceivers.d.ts +32 -0
- package/dist/codeIndex/inferredReceivers.d.ts.map +1 -0
- package/dist/codeIndex/inferredReceivers.js +41 -0
- package/dist/codeIndex/inferredReceivers.js.map +1 -0
- package/dist/codeIndex/meta.d.ts +30 -0
- package/dist/codeIndex/meta.d.ts.map +1 -0
- package/dist/codeIndex/meta.js +37 -0
- package/dist/codeIndex/meta.js.map +1 -0
- package/dist/codeIndex/migrations.d.ts +96 -0
- package/dist/codeIndex/migrations.d.ts.map +1 -0
- package/dist/codeIndex/migrations.js +1302 -0
- package/dist/codeIndex/migrations.js.map +1 -0
- package/dist/codeIndex/projectTasks.d.ts +54 -0
- package/dist/codeIndex/projectTasks.d.ts.map +1 -0
- package/dist/codeIndex/projectTasks.js +81 -0
- package/dist/codeIndex/projectTasks.js.map +1 -0
- package/dist/codeIndex/provenance.d.ts +47 -0
- package/dist/codeIndex/provenance.d.ts.map +1 -0
- package/dist/codeIndex/provenance.js +48 -0
- package/dist/codeIndex/provenance.js.map +1 -0
- package/dist/codeIndex/rawSql.d.ts +54 -0
- package/dist/codeIndex/rawSql.d.ts.map +1 -0
- package/dist/codeIndex/rawSql.js +71 -0
- package/dist/codeIndex/rawSql.js.map +1 -0
- package/dist/codeIndex/schema.d.ts +99 -0
- package/dist/codeIndex/schema.d.ts.map +1 -0
- package/dist/codeIndex/schema.js +174 -0
- package/dist/codeIndex/schema.js.map +1 -0
- package/dist/codeIndex/search.d.ts +40 -0
- package/dist/codeIndex/search.d.ts.map +1 -0
- package/dist/codeIndex/search.js +316 -0
- package/dist/codeIndex/search.js.map +1 -0
- package/dist/codeIndex/shared.d.ts +27 -0
- package/dist/codeIndex/shared.d.ts.map +1 -0
- package/dist/codeIndex/shared.js +46 -0
- package/dist/codeIndex/shared.js.map +1 -0
- package/dist/codeIndex/sqliteCollection.d.ts +81 -0
- package/dist/codeIndex/sqliteCollection.d.ts.map +1 -0
- package/dist/codeIndex/sqliteCollection.js +250 -0
- package/dist/codeIndex/sqliteCollection.js.map +1 -0
- package/dist/codeIndex/whitelist.d.ts +59 -0
- package/dist/codeIndex/whitelist.d.ts.map +1 -0
- package/dist/codeIndex/whitelist.js +188 -0
- package/dist/codeIndex/whitelist.js.map +1 -0
- package/dist/codeIndexDB.d.ts +130 -277
- package/dist/codeIndexDB.d.ts.map +1 -1
- package/dist/codeIndexDB.js +364 -2748
- package/dist/codeIndexDB.js.map +1 -1
- package/dist/codeIndexService.d.ts +87 -12
- package/dist/codeIndexService.d.ts.map +1 -1
- package/dist/codeIndexService.js +110 -34
- package/dist/codeIndexService.js.map +1 -1
- package/dist/componentScanner.d.ts +35 -0
- package/dist/componentScanner.d.ts.map +1 -1
- package/dist/componentScanner.js +114 -80
- package/dist/componentScanner.js.map +1 -1
- package/dist/config/configGeneratePath.d.ts +4 -0
- package/dist/config/configGeneratePath.d.ts.map +1 -1
- package/dist/config/configGeneratePath.js +4 -0
- package/dist/config/configGeneratePath.js.map +1 -1
- package/dist/config/configLoader.d.ts +16 -1
- package/dist/config/configLoader.d.ts.map +1 -1
- package/dist/config/configLoader.js +26 -23
- package/dist/config/configLoader.js.map +1 -1
- package/dist/config/defaults.d.ts +11 -7
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +21 -20
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/effectiveConfig.d.ts +17 -2
- package/dist/config/effectiveConfig.d.ts.map +1 -1
- package/dist/config/effectiveConfig.js +32 -25
- package/dist/config/effectiveConfig.js.map +1 -1
- package/dist/config/lintConfigReader.d.ts +6 -0
- package/dist/config/lintConfigReader.d.ts.map +1 -1
- package/dist/config/lintConfigReader.js +6 -0
- package/dist/config/lintConfigReader.js.map +1 -1
- package/dist/config/staticObjectExtract.d.ts +4 -0
- package/dist/config/staticObjectExtract.d.ts.map +1 -1
- package/dist/config/staticObjectExtract.js +7 -3
- package/dist/config/staticObjectExtract.js.map +1 -1
- package/dist/config/thresholdRationales.d.ts +2 -0
- package/dist/config/thresholdRationales.d.ts.map +1 -1
- package/dist/config/thresholdRationales.js +5 -2
- package/dist/config/thresholdRationales.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -5
- package/dist/constants.js.map +1 -1
- package/dist/conventions/conventionMiner.d.ts +105 -2
- package/dist/conventions/conventionMiner.d.ts.map +1 -1
- package/dist/conventions/conventionMiner.js +334 -259
- package/dist/conventions/conventionMiner.js.map +1 -1
- package/dist/coverage/coverageService.js +4 -4
- package/dist/coverage/coverageService.js.map +1 -1
- package/dist/daemon/args.d.ts +3 -0
- package/dist/daemon/args.d.ts.map +1 -1
- package/dist/daemon/args.js +3 -0
- package/dist/daemon/args.js.map +1 -1
- package/dist/daemon/core.d.ts +33 -27
- package/dist/daemon/core.d.ts.map +1 -1
- package/dist/daemon/core.js +198 -162
- package/dist/daemon/core.js.map +1 -1
- package/dist/daemon/lspServer.d.ts +8 -0
- package/dist/daemon/lspServer.d.ts.map +1 -1
- package/dist/daemon/lspServer.js +8 -0
- package/dist/daemon/lspServer.js.map +1 -1
- package/dist/daemon/main.d.ts +2 -0
- package/dist/daemon/main.d.ts.map +1 -1
- package/dist/daemon/main.js +2 -0
- package/dist/daemon/main.js.map +1 -1
- package/dist/daemon/resolve.d.ts +22 -7
- package/dist/daemon/resolve.d.ts.map +1 -1
- package/dist/daemon/resolve.js +29 -8
- package/dist/daemon/resolve.js.map +1 -1
- package/dist/daemon/socketClient.d.ts +10 -1
- package/dist/daemon/socketClient.d.ts.map +1 -1
- package/dist/daemon/socketClient.js +10 -1
- package/dist/daemon/socketClient.js.map +1 -1
- package/dist/daemon/socketServer.d.ts +13 -0
- package/dist/daemon/socketServer.d.ts.map +1 -1
- package/dist/daemon/socketServer.js +13 -0
- package/dist/daemon/socketServer.js.map +1 -1
- package/dist/dataPaths.d.ts +27 -8
- package/dist/dataPaths.d.ts.map +1 -1
- package/dist/dataPaths.js +28 -44
- package/dist/dataPaths.js.map +1 -1
- package/dist/dismissals.d.ts +22 -1
- package/dist/dismissals.d.ts.map +1 -1
- package/dist/dismissals.js +22 -1
- package/dist/dismissals.js.map +1 -1
- package/dist/enforcement/gate.d.ts +1 -0
- package/dist/enforcement/gate.d.ts.map +1 -1
- package/dist/enforcement/gate.js +1 -0
- package/dist/enforcement/gate.js.map +1 -1
- package/dist/fingerprint.d.ts +6 -0
- package/dist/fingerprint.d.ts.map +1 -1
- package/dist/fingerprint.js +46 -1
- package/dist/fingerprint.js.map +1 -1
- package/dist/functionScanner.d.ts +30 -1
- package/dist/functionScanner.d.ts.map +1 -1
- package/dist/functionScanner.js +258 -256
- package/dist/functionScanner.js.map +1 -1
- package/dist/generators/AWSQConfigGenerator.d.ts +23 -0
- package/dist/generators/AWSQConfigGenerator.d.ts.map +1 -1
- package/dist/generators/AWSQConfigGenerator.js +23 -0
- package/dist/generators/AWSQConfigGenerator.js.map +1 -1
- package/dist/generators/BaseConfigGenerator.d.ts +7 -0
- package/dist/generators/BaseConfigGenerator.d.ts.map +1 -1
- package/dist/generators/BaseConfigGenerator.js +7 -0
- package/dist/generators/BaseConfigGenerator.js.map +1 -1
- package/dist/generators/ClaudeConfigGenerator.d.ts +23 -0
- package/dist/generators/ClaudeConfigGenerator.d.ts.map +1 -1
- package/dist/generators/ClaudeConfigGenerator.js +23 -0
- package/dist/generators/ClaudeConfigGenerator.js.map +1 -1
- package/dist/generators/ClineConfigGenerator.d.ts +23 -0
- package/dist/generators/ClineConfigGenerator.d.ts.map +1 -1
- package/dist/generators/ClineConfigGenerator.js +23 -0
- package/dist/generators/ClineConfigGenerator.js.map +1 -1
- package/dist/generators/CodeiumConfigGenerator.d.ts +23 -0
- package/dist/generators/CodeiumConfigGenerator.d.ts.map +1 -1
- package/dist/generators/CodeiumConfigGenerator.js +23 -0
- package/dist/generators/CodeiumConfigGenerator.js.map +1 -1
- package/dist/generators/CodexConfigGenerator.d.ts +23 -0
- package/dist/generators/CodexConfigGenerator.d.ts.map +1 -1
- package/dist/generators/CodexConfigGenerator.js +23 -0
- package/dist/generators/CodexConfigGenerator.js.map +1 -1
- package/dist/generators/ConfigGeneratorFactory.d.ts +9 -0
- package/dist/generators/ConfigGeneratorFactory.d.ts.map +1 -1
- package/dist/generators/ConfigGeneratorFactory.js +9 -0
- package/dist/generators/ConfigGeneratorFactory.js.map +1 -1
- package/dist/generators/ContinueConfigGenerator.d.ts +23 -0
- package/dist/generators/ContinueConfigGenerator.d.ts.map +1 -1
- package/dist/generators/ContinueConfigGenerator.js +23 -0
- package/dist/generators/ContinueConfigGenerator.js.map +1 -1
- package/dist/generators/CopilotConfigGenerator.d.ts +23 -0
- package/dist/generators/CopilotConfigGenerator.d.ts.map +1 -1
- package/dist/generators/CopilotConfigGenerator.js +23 -0
- package/dist/generators/CopilotConfigGenerator.js.map +1 -1
- package/dist/generators/CursorConfigGenerator.d.ts +23 -0
- package/dist/generators/CursorConfigGenerator.d.ts.map +1 -1
- package/dist/generators/CursorConfigGenerator.js +23 -0
- package/dist/generators/CursorConfigGenerator.js.map +1 -1
- package/dist/generators/GeminiConfigGenerator.d.ts +23 -0
- package/dist/generators/GeminiConfigGenerator.d.ts.map +1 -1
- package/dist/generators/GeminiConfigGenerator.js +23 -0
- package/dist/generators/GeminiConfigGenerator.js.map +1 -1
- package/dist/generators/VSCodeConfigGenerator.d.ts +23 -0
- package/dist/generators/VSCodeConfigGenerator.d.ts.map +1 -1
- package/dist/generators/VSCodeConfigGenerator.js +23 -0
- package/dist/generators/VSCodeConfigGenerator.js.map +1 -1
- package/dist/generators/ZCodeConfigGenerator.d.ts +23 -0
- package/dist/generators/ZCodeConfigGenerator.d.ts.map +1 -1
- package/dist/generators/ZCodeConfigGenerator.js +23 -0
- package/dist/generators/ZCodeConfigGenerator.js.map +1 -1
- package/dist/graph/blastRadius.d.ts.map +1 -1
- package/dist/graph/blastRadius.js +12 -7
- package/dist/graph/blastRadius.js.map +1 -1
- package/dist/graph/callGraph.d.ts +31 -0
- package/dist/graph/callGraph.d.ts.map +1 -1
- package/dist/graph/callGraph.js +62 -32
- package/dist/graph/callGraph.js.map +1 -1
- package/dist/graph/importClassification.d.ts +28 -0
- package/dist/graph/importClassification.d.ts.map +1 -1
- package/dist/graph/importClassification.js +57 -0
- package/dist/graph/importClassification.js.map +1 -1
- package/dist/graph/importGraph.d.ts +38 -0
- package/dist/graph/importGraph.d.ts.map +1 -1
- package/dist/graph/importGraph.js +38 -0
- package/dist/graph/importGraph.js.map +1 -1
- package/dist/graph/outputFormatter.d.ts +12 -4
- package/dist/graph/outputFormatter.d.ts.map +1 -1
- package/dist/graph/outputFormatter.js +12 -62
- package/dist/graph/outputFormatter.js.map +1 -1
- package/dist/hooks/codex.d.ts +8 -1
- package/dist/hooks/codex.d.ts.map +1 -1
- package/dist/hooks/codex.js +7 -0
- package/dist/hooks/codex.js.map +1 -1
- package/dist/hooks/core.d.ts +6 -0
- package/dist/hooks/core.d.ts.map +1 -1
- package/dist/hooks/core.js +6 -1
- package/dist/hooks/core.js.map +1 -1
- package/dist/hooks/cursor.d.ts +11 -1
- package/dist/hooks/cursor.d.ts.map +1 -1
- package/dist/hooks/cursor.js +10 -0
- package/dist/hooks/cursor.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/installConfig.d.ts +23 -5
- package/dist/installConfig.d.ts.map +1 -1
- package/dist/installConfig.js +23 -5
- package/dist/installConfig.js.map +1 -1
- package/dist/installer.d.ts +6 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +6 -0
- package/dist/installer.js.map +1 -1
- package/dist/invariants/ruleEngine.d.ts +3 -0
- package/dist/invariants/ruleEngine.d.ts.map +1 -1
- package/dist/invariants/ruleEngine.js +156 -119
- package/dist/invariants/ruleEngine.js.map +1 -1
- package/dist/invariants/ruleValidator.d.ts +3 -0
- package/dist/invariants/ruleValidator.d.ts.map +1 -1
- package/dist/invariants/ruleValidator.js +185 -178
- package/dist/invariants/ruleValidator.js.map +1 -1
- package/dist/languages/LanguageOrchestrator.d.ts +4 -1
- package/dist/languages/LanguageOrchestrator.d.ts.map +1 -1
- package/dist/languages/LanguageOrchestrator.js +8 -19
- package/dist/languages/LanguageOrchestrator.js.map +1 -1
- package/dist/languages/RuntimeManager.d.ts +8 -0
- package/dist/languages/RuntimeManager.d.ts.map +1 -1
- package/dist/languages/RuntimeManager.js +55 -5
- package/dist/languages/RuntimeManager.js.map +1 -1
- package/dist/languages/UniversalAnalyzer.js +1 -1
- package/dist/languages/UniversalAnalyzer.js.map +1 -1
- package/dist/languages/adapterBridge.d.ts +4 -0
- package/dist/languages/adapterBridge.d.ts.map +1 -1
- package/dist/languages/adapterBridge.js +37 -3
- package/dist/languages/adapterBridge.js.map +1 -1
- package/dist/languages/go/GoAdapter.d.ts.map +1 -1
- package/dist/languages/go/GoAdapter.js +11 -14
- package/dist/languages/go/GoAdapter.js.map +1 -1
- package/dist/languages/go/analyzer-darwin-amd64 +0 -0
- package/dist/languages/go/analyzer-darwin-arm64 +0 -0
- package/dist/languages/go/analyzer-linux-amd64 +0 -0
- package/dist/languages/go/analyzer-linux-arm64 +0 -0
- package/dist/languages/go/analyzer-src/analyzer.go +2 -0
- package/dist/languages/go/analyzer-src/dataaccess.go +388 -0
- package/dist/languages/go/analyzer-src/types.go +8 -0
- package/dist/languages/go/analyzer-windows-amd64.exe +0 -0
- package/dist/languages/go/database-packages.json +8 -0
- package/dist/languages/go/goResolution.d.ts +229 -0
- package/dist/languages/go/goResolution.d.ts.map +1 -0
- package/dist/languages/go/goResolution.js +799 -0
- package/dist/languages/go/goResolution.js.map +1 -0
- package/dist/languages/go/stdlib-packages.json +353 -0
- package/dist/languages/go/tenantInputs.d.ts +37 -0
- package/dist/languages/go/tenantInputs.d.ts.map +1 -0
- package/dist/languages/go/tenantInputs.js +121 -0
- package/dist/languages/go/tenantInputs.js.map +1 -0
- package/dist/languages/index.d.ts +1 -0
- package/dist/languages/index.d.ts.map +1 -1
- package/dist/languages/index.js +5 -0
- package/dist/languages/index.js.map +1 -1
- package/dist/languages/json/JsonAdapter.d.ts +177 -0
- package/dist/languages/json/JsonAdapter.d.ts.map +1 -0
- package/dist/languages/json/JsonAdapter.js +531 -0
- package/dist/languages/json/JsonAdapter.js.map +1 -0
- package/dist/languages/locationIndex.d.ts +41 -0
- package/dist/languages/locationIndex.d.ts.map +1 -0
- package/dist/languages/locationIndex.js +42 -0
- package/dist/languages/locationIndex.js.map +1 -0
- package/dist/languages/sql/dialectDetection.d.ts +57 -0
- package/dist/languages/sql/dialectDetection.d.ts.map +1 -0
- package/dist/languages/sql/dialectDetection.js +135 -0
- package/dist/languages/sql/dialectDetection.js.map +1 -0
- package/dist/languages/sql/sqlAst.d.ts +494 -0
- package/dist/languages/sql/sqlAst.d.ts.map +1 -0
- package/dist/languages/sql/sqlAst.js +1817 -0
- package/dist/languages/sql/sqlAst.js.map +1 -0
- package/dist/languages/testConventions.d.ts +12 -1
- package/dist/languages/testConventions.d.ts.map +1 -1
- package/dist/languages/testConventions.js +13 -1
- package/dist/languages/testConventions.js.map +1 -1
- package/dist/languages/tree-sitter/TreeSitterCssAdapter.js +1 -1
- package/dist/languages/tree-sitter/TreeSitterCssAdapter.js.map +1 -1
- package/dist/languages/tree-sitter/converter.js +2 -2
- package/dist/languages/tree-sitter/converter.js.map +1 -1
- package/dist/languages/tree-sitter/parser.d.ts +3 -4
- package/dist/languages/tree-sitter/parser.d.ts.map +1 -1
- package/dist/languages/tree-sitter/parser.js +10 -4
- package/dist/languages/tree-sitter/parser.js.map +1 -1
- package/dist/languages/tree-sitter/rawNode.d.ts +3 -0
- package/dist/languages/tree-sitter/rawNode.d.ts.map +1 -1
- package/dist/languages/tree-sitter/rawNode.js +3 -0
- package/dist/languages/tree-sitter/rawNode.js.map +1 -1
- package/dist/languages/types.d.ts +7 -0
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts +36 -0
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js +168 -45
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js.map +1 -1
- package/dist/languages/typescript/database-packages.json +19 -0
- package/dist/ledger.d.ts +118 -2
- package/dist/ledger.d.ts.map +1 -1
- package/dist/ledger.js +167 -45
- package/dist/ledger.js.map +1 -1
- package/dist/legacyIndexNotice.d.ts +32 -0
- package/dist/legacyIndexNotice.d.ts.map +1 -0
- package/dist/legacyIndexNotice.js +89 -0
- package/dist/legacyIndexNotice.js.map +1 -0
- package/dist/mcp-tools/discoveryQueries.d.ts +55 -0
- package/dist/mcp-tools/discoveryQueries.d.ts.map +1 -0
- package/dist/mcp-tools/discoveryQueries.js +157 -0
- package/dist/mcp-tools/discoveryQueries.js.map +1 -0
- package/dist/mcp-tools/projectTasks.d.ts +9 -123
- package/dist/mcp-tools/projectTasks.d.ts.map +1 -1
- package/dist/mcp-tools/projectTasks.js +180 -170
- package/dist/mcp-tools/projectTasks.js.map +1 -1
- package/dist/mcp-tools/whitelistTools.d.ts +20 -0
- package/dist/mcp-tools/whitelistTools.d.ts.map +1 -1
- package/dist/mcp-tools/whitelistTools.js +20 -0
- package/dist/mcp-tools/whitelistTools.js.map +1 -1
- package/dist/mcp-tools/workflowGuide.d.ts +9 -0
- package/dist/mcp-tools/workflowGuide.d.ts.map +1 -1
- package/dist/mcp-tools/workflowGuide.js +13 -5
- package/dist/mcp-tools/workflowGuide.js.map +1 -1
- package/dist/mcp-tools-shared.d.ts +78 -0
- package/dist/mcp-tools-shared.d.ts.map +1 -1
- package/dist/mcp-tools-shared.js +203 -340
- package/dist/mcp-tools-shared.js.map +1 -1
- package/dist/mcp-ui-simple.d.ts +2 -0
- package/dist/mcp-ui-simple.d.ts.map +1 -1
- package/dist/mcp-ui-simple.js +12 -5
- package/dist/mcp-ui-simple.js.map +1 -1
- package/dist/mcp.d.ts +6 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +832 -851
- package/dist/mcp.js.map +1 -1
- package/dist/mcpAuditJobs.d.ts +29 -33
- package/dist/mcpAuditJobs.d.ts.map +1 -1
- package/dist/mcpAuditJobs.js +102 -791
- package/dist/mcpAuditJobs.js.map +1 -1
- package/dist/mcpAutoIndex.d.ts +5 -0
- package/dist/mcpAutoIndex.d.ts.map +1 -1
- package/dist/mcpAutoIndex.js +7 -2
- package/dist/mcpAutoIndex.js.map +1 -1
- package/dist/mcpDiagnostics.d.ts +7 -0
- package/dist/mcpDiagnostics.d.ts.map +1 -1
- package/dist/mcpDiagnostics.js +34 -9
- package/dist/mcpDiagnostics.js.map +1 -1
- package/dist/mcpToolErrors.d.ts +16 -0
- package/dist/mcpToolErrors.d.ts.map +1 -1
- package/dist/mcpToolErrors.js +16 -0
- package/dist/mcpToolErrors.js.map +1 -1
- package/dist/nextFile.d.ts +6 -0
- package/dist/nextFile.d.ts.map +1 -1
- package/dist/nextFile.js +6 -0
- package/dist/nextFile.js.map +1 -1
- package/dist/nextFileIncremental.d.ts +44 -4
- package/dist/nextFileIncremental.d.ts.map +1 -1
- package/dist/nextFileIncremental.js +47 -7
- package/dist/nextFileIncremental.js.map +1 -1
- package/dist/phase/batchFunctions.d.ts +38 -0
- package/dist/phase/batchFunctions.d.ts.map +1 -0
- package/dist/phase/batchFunctions.js +64 -0
- package/dist/phase/batchFunctions.js.map +1 -0
- package/dist/phase/checks.d.ts +39 -0
- package/dist/phase/checks.d.ts.map +1 -0
- package/dist/phase/checks.js +48 -0
- package/dist/phase/checks.js.map +1 -0
- package/dist/phase/codeBlocks.d.ts +25 -0
- package/dist/phase/codeBlocks.d.ts.map +1 -0
- package/dist/phase/codeBlocks.js +268 -0
- package/dist/phase/codeBlocks.js.map +1 -0
- package/dist/phase/colorMath.d.ts +41 -0
- package/dist/phase/colorMath.d.ts.map +1 -0
- package/dist/phase/colorMath.js +109 -0
- package/dist/phase/colorMath.js.map +1 -0
- package/dist/phase/config.d.ts +29 -0
- package/dist/phase/config.d.ts.map +1 -0
- package/dist/phase/config.js +54 -0
- package/dist/phase/config.js.map +1 -0
- package/dist/phase/consumed.d.ts +47 -0
- package/dist/phase/consumed.d.ts.map +1 -0
- package/dist/phase/consumed.js +22 -0
- package/dist/phase/consumed.js.map +1 -0
- package/dist/phase/conventionMining.d.ts +59 -0
- package/dist/phase/conventionMining.d.ts.map +1 -0
- package/dist/phase/conventionMining.js +152 -0
- package/dist/phase/conventionMining.js.map +1 -0
- package/dist/phase/coverage.d.ts +65 -0
- package/dist/phase/coverage.d.ts.map +1 -0
- package/dist/phase/coverage.js +121 -0
- package/dist/phase/coverage.js.map +1 -0
- package/dist/phase/dag.d.ts +49 -0
- package/dist/phase/dag.d.ts.map +1 -0
- package/dist/phase/dag.js +120 -0
- package/dist/phase/dag.js.map +1 -0
- package/dist/phase/dataAccessCalls.d.ts +33 -0
- package/dist/phase/dataAccessCalls.d.ts.map +1 -0
- package/dist/phase/dataAccessCalls.js +42 -0
- package/dist/phase/dataAccessCalls.js.map +1 -0
- package/dist/phase/dataAccessCallsCandidates.d.ts +25 -0
- package/dist/phase/dataAccessCallsCandidates.d.ts.map +1 -0
- package/dist/phase/dataAccessCallsCandidates.js +27 -0
- package/dist/phase/dataAccessCallsCandidates.js.map +1 -0
- package/dist/phase/dynamicSql.d.ts +18 -0
- package/dist/phase/dynamicSql.d.ts.map +1 -0
- package/dist/phase/dynamicSql.js +20 -0
- package/dist/phase/dynamicSql.js.map +1 -0
- package/dist/phase/exportForm.d.ts +23 -0
- package/dist/phase/exportForm.d.ts.map +1 -0
- package/dist/phase/exportForm.js +29 -0
- package/dist/phase/exportForm.js.map +1 -0
- package/dist/phase/exportSymbols.d.ts +21 -0
- package/dist/phase/exportSymbols.d.ts.map +1 -0
- package/dist/phase/exportSymbols.js +28 -0
- package/dist/phase/exportSymbols.js.map +1 -0
- package/dist/phase/fileHeader.d.ts +15 -0
- package/dist/phase/fileHeader.d.ts.map +1 -0
- package/dist/phase/fileHeader.js +33 -0
- package/dist/phase/fileHeader.js.map +1 -0
- package/dist/phase/fileImports.d.ts +39 -0
- package/dist/phase/fileImports.d.ts.map +1 -0
- package/dist/phase/fileImports.js +138 -0
- package/dist/phase/fileImports.js.map +1 -0
- package/dist/phase/fileSymbols.d.ts +25 -0
- package/dist/phase/fileSymbols.d.ts.map +1 -0
- package/dist/phase/fileSymbols.js +302 -0
- package/dist/phase/fileSymbols.js.map +1 -0
- package/dist/phase/functionBodies.d.ts +28 -0
- package/dist/phase/functionBodies.d.ts.map +1 -0
- package/dist/phase/functionBodies.js +67 -0
- package/dist/phase/functionBodies.js.map +1 -0
- package/dist/phase/functionIndex.d.ts +28 -0
- package/dist/phase/functionIndex.d.ts.map +1 -0
- package/dist/phase/functionIndex.js +152 -0
- package/dist/phase/functionIndex.js.map +1 -0
- package/dist/phase/goFunctionAnalysis.d.ts +47 -0
- package/dist/phase/goFunctionAnalysis.d.ts.map +1 -0
- package/dist/phase/goFunctionAnalysis.js +291 -0
- package/dist/phase/goFunctionAnalysis.js.map +1 -0
- package/dist/phase/goFunctions.d.ts +38 -0
- package/dist/phase/goFunctions.d.ts.map +1 -0
- package/dist/phase/goFunctions.js +154 -0
- package/dist/phase/goFunctions.js.map +1 -0
- package/dist/phase/goImports.d.ts +29 -0
- package/dist/phase/goImports.d.ts.map +1 -0
- package/dist/phase/goImports.js +68 -0
- package/dist/phase/goImports.js.map +1 -0
- package/dist/phase/goPackageBindings.d.ts +22 -0
- package/dist/phase/goPackageBindings.d.ts.map +1 -0
- package/dist/phase/goPackageBindings.js +30 -0
- package/dist/phase/goPackageBindings.js.map +1 -0
- package/dist/phase/goSwitches.d.ts +28 -0
- package/dist/phase/goSwitches.d.ts.map +1 -0
- package/dist/phase/goSwitches.js +52 -0
- package/dist/phase/goSwitches.js.map +1 -0
- package/dist/phase/importForm.d.ts +20 -0
- package/dist/phase/importForm.d.ts.map +1 -0
- package/dist/phase/importForm.js +27 -0
- package/dist/phase/importForm.js.map +1 -0
- package/dist/phase/importSpecifiers.d.ts +20 -0
- package/dist/phase/importSpecifiers.d.ts.map +1 -0
- package/dist/phase/importSpecifiers.js +30 -0
- package/dist/phase/importSpecifiers.js.map +1 -0
- package/dist/phase/imports.d.ts +18 -0
- package/dist/phase/imports.d.ts.map +1 -0
- package/dist/phase/imports.js +25 -0
- package/dist/phase/imports.js.map +1 -0
- package/dist/phase/jsonDocument.d.ts +26 -0
- package/dist/phase/jsonDocument.d.ts.map +1 -0
- package/dist/phase/jsonDocument.js +36 -0
- package/dist/phase/jsonDocument.js.map +1 -0
- package/dist/phase/localBinding.d.ts +33 -0
- package/dist/phase/localBinding.d.ts.map +1 -0
- package/dist/phase/localBinding.js +208 -0
- package/dist/phase/localBinding.js.map +1 -0
- package/dist/phase/loopQueries.d.ts +31 -0
- package/dist/phase/loopQueries.d.ts.map +1 -0
- package/dist/phase/loopQueries.js +44 -0
- package/dist/phase/loopQueries.js.map +1 -0
- package/dist/phase/loopQueryCandidates.d.ts +26 -0
- package/dist/phase/loopQueryCandidates.d.ts.map +1 -0
- package/dist/phase/loopQueryCandidates.js +28 -0
- package/dist/phase/loopQueryCandidates.js.map +1 -0
- package/dist/phase/oracles.d.ts +216 -0
- package/dist/phase/oracles.d.ts.map +1 -0
- package/dist/phase/oracles.js +484 -0
- package/dist/phase/oracles.js.map +1 -0
- package/dist/phase/phaseModel.d.ts +190 -0
- package/dist/phase/phaseModel.d.ts.map +1 -0
- package/dist/phase/phaseModel.js +468 -0
- package/dist/phase/phaseModel.js.map +1 -0
- package/dist/phase/producers.d.ts +450 -0
- package/dist/phase/producers.d.ts.map +1 -0
- package/dist/phase/producers.js +1027 -0
- package/dist/phase/producers.js.map +1 -0
- package/dist/phase/querySiteCandidates.d.ts +27 -0
- package/dist/phase/querySiteCandidates.d.ts.map +1 -0
- package/dist/phase/querySiteCandidates.js +66 -0
- package/dist/phase/querySiteCandidates.js.map +1 -0
- package/dist/phase/querySites.d.ts +30 -0
- package/dist/phase/querySites.d.ts.map +1 -0
- package/dist/phase/querySites.js +93 -0
- package/dist/phase/querySites.js.map +1 -0
- package/dist/phase/reachability.d.ts +61 -0
- package/dist/phase/reachability.d.ts.map +1 -0
- package/dist/phase/reachability.js +104 -0
- package/dist/phase/reachability.js.map +1 -0
- package/dist/phase/reactComponents.d.ts +33 -0
- package/dist/phase/reactComponents.d.ts.map +1 -0
- package/dist/phase/reactComponents.js +47 -0
- package/dist/phase/reactComponents.js.map +1 -0
- package/dist/phase/receiverActivity.d.ts +35 -0
- package/dist/phase/receiverActivity.d.ts.map +1 -0
- package/dist/phase/receiverActivity.js +66 -0
- package/dist/phase/receiverActivity.js.map +1 -0
- package/dist/phase/receiverConsumers.d.ts +200 -0
- package/dist/phase/receiverConsumers.d.ts.map +1 -0
- package/dist/phase/receiverConsumers.js +1025 -0
- package/dist/phase/receiverConsumers.js.map +1 -0
- package/dist/phase/receiverProvenance.d.ts +97 -0
- package/dist/phase/receiverProvenance.d.ts.map +1 -0
- package/dist/phase/receiverProvenance.js +337 -0
- package/dist/phase/receiverProvenance.js.map +1 -0
- package/dist/phase/routing.d.ts +47 -0
- package/dist/phase/routing.d.ts.map +1 -0
- package/dist/phase/routing.js +62 -0
- package/dist/phase/routing.js.map +1 -0
- package/dist/phase/rules/conventions.d.ts +61 -0
- package/dist/phase/rules/conventions.d.ts.map +1 -0
- package/dist/phase/rules/conventions.js +403 -0
- package/dist/phase/rules/conventions.js.map +1 -0
- package/dist/phase/rules/crossDomain.d.ts +102 -0
- package/dist/phase/rules/crossDomain.d.ts.map +1 -0
- package/dist/phase/rules/crossDomain.js +918 -0
- package/dist/phase/rules/crossDomain.js.map +1 -0
- package/dist/phase/rules/dataAccess.d.ts +62 -0
- package/dist/phase/rules/dataAccess.d.ts.map +1 -0
- package/dist/phase/rules/dataAccess.js +480 -0
- package/dist/phase/rules/dataAccess.js.map +1 -0
- package/dist/phase/rules/dependencyGraph.d.ts +44 -0
- package/dist/phase/rules/dependencyGraph.d.ts.map +1 -0
- package/dist/phase/rules/dependencyGraph.js +260 -0
- package/dist/phase/rules/dependencyGraph.js.map +1 -0
- package/dist/phase/rules/documentation.d.ts +45 -0
- package/dist/phase/rules/documentation.d.ts.map +1 -0
- package/dist/phase/rules/documentation.js +340 -0
- package/dist/phase/rules/documentation.js.map +1 -0
- package/dist/phase/rules/dry.d.ts +109 -0
- package/dist/phase/rules/dry.d.ts.map +1 -0
- package/dist/phase/rules/dry.js +803 -0
- package/dist/phase/rules/dry.js.map +1 -0
- package/dist/phase/rules/fileDocumentation.d.ts +36 -0
- package/dist/phase/rules/fileDocumentation.d.ts.map +1 -0
- package/dist/phase/rules/fileDocumentation.js +134 -0
- package/dist/phase/rules/fileDocumentation.js.map +1 -0
- package/dist/phase/rules/functionBodies.d.ts +33 -0
- package/dist/phase/rules/functionBodies.d.ts.map +1 -0
- package/dist/phase/rules/functionBodies.js +71 -0
- package/dist/phase/rules/functionBodies.js.map +1 -0
- package/dist/phase/rules/goRules.d.ts +49 -0
- package/dist/phase/rules/goRules.d.ts.map +1 -0
- package/dist/phase/rules/goRules.js +209 -0
- package/dist/phase/rules/goRules.js.map +1 -0
- package/dist/phase/rules/querySites.d.ts +29 -0
- package/dist/phase/rules/querySites.d.ts.map +1 -0
- package/dist/phase/rules/querySites.js +94 -0
- package/dist/phase/rules/querySites.js.map +1 -0
- package/dist/phase/rules/react.d.ts +38 -0
- package/dist/phase/rules/react.d.ts.map +1 -0
- package/dist/phase/rules/react.js +202 -0
- package/dist/phase/rules/react.js.map +1 -0
- package/dist/phase/rules/registry.d.ts +170 -0
- package/dist/phase/rules/registry.d.ts.map +1 -0
- package/dist/phase/rules/registry.js +103 -0
- package/dist/phase/rules/registry.js.map +1 -0
- package/dist/phase/rules/schema.d.ts +79 -0
- package/dist/phase/rules/schema.d.ts.map +1 -0
- package/dist/phase/rules/schema.js +273 -0
- package/dist/phase/rules/schema.js.map +1 -0
- package/dist/phase/rules/schemaJson.d.ts +32 -0
- package/dist/phase/rules/schemaJson.d.ts.map +1 -0
- package/dist/phase/rules/schemaJson.js +81 -0
- package/dist/phase/rules/schemaJson.js.map +1 -0
- package/dist/phase/rules/schemaValidator.d.ts +38 -0
- package/dist/phase/rules/schemaValidator.d.ts.map +1 -0
- package/dist/phase/rules/schemaValidator.js +107 -0
- package/dist/phase/rules/schemaValidator.js.map +1 -0
- package/dist/phase/rules/secrets.d.ts +34 -0
- package/dist/phase/rules/secrets.d.ts.map +1 -0
- package/dist/phase/rules/secrets.js +208 -0
- package/dist/phase/rules/secrets.js.map +1 -0
- package/dist/phase/rules/security.d.ts +30 -0
- package/dist/phase/rules/security.d.ts.map +1 -0
- package/dist/phase/rules/security.js +85 -0
- package/dist/phase/rules/security.js.map +1 -0
- package/dist/phase/rules/securityDefects.d.ts +37 -0
- package/dist/phase/rules/securityDefects.d.ts.map +1 -0
- package/dist/phase/rules/securityDefects.js +167 -0
- package/dist/phase/rules/securityDefects.js.map +1 -0
- package/dist/phase/rules/solid.d.ts +61 -0
- package/dist/phase/rules/solid.d.ts.map +1 -0
- package/dist/phase/rules/solid.js +562 -0
- package/dist/phase/rules/solid.js.map +1 -0
- package/dist/phase/rules/styles.d.ts +77 -0
- package/dist/phase/rules/styles.d.ts.map +1 -0
- package/dist/phase/rules/styles.js +868 -0
- package/dist/phase/rules/styles.js.map +1 -0
- package/dist/phase/rules/unreferencedModule.d.ts +26 -0
- package/dist/phase/rules/unreferencedModule.d.ts.map +1 -0
- package/dist/phase/rules/unreferencedModule.js +61 -0
- package/dist/phase/rules/unreferencedModule.js.map +1 -0
- package/dist/phase/runner.d.ts +549 -0
- package/dist/phase/runner.d.ts.map +1 -0
- package/dist/phase/runner.js +1098 -0
- package/dist/phase/runner.js.map +1 -0
- package/dist/phase/schemaCode.d.ts +34 -0
- package/dist/phase/schemaCode.d.ts.map +1 -0
- package/dist/phase/schemaCode.js +53 -0
- package/dist/phase/schemaCode.js.map +1 -0
- package/dist/phase/schemaObjects.d.ts +37 -0
- package/dist/phase/schemaObjects.d.ts.map +1 -0
- package/dist/phase/schemaObjects.js +139 -0
- package/dist/phase/schemaObjects.js.map +1 -0
- package/dist/phase/schemaUsage.d.ts +30 -0
- package/dist/phase/schemaUsage.d.ts.map +1 -0
- package/dist/phase/schemaUsage.js +99 -0
- package/dist/phase/schemaUsage.js.map +1 -0
- package/dist/phase/schemaUsageCandidates.d.ts +32 -0
- package/dist/phase/schemaUsageCandidates.d.ts.map +1 -0
- package/dist/phase/schemaUsageCandidates.js +165 -0
- package/dist/phase/schemaUsageCandidates.js.map +1 -0
- package/dist/phase/schemaValidations.d.ts +34 -0
- package/dist/phase/schemaValidations.d.ts.map +1 -0
- package/dist/phase/schemaValidations.js +53 -0
- package/dist/phase/schemaValidations.js.map +1 -0
- package/dist/phase/secretCandidates.d.ts +28 -0
- package/dist/phase/secretCandidates.d.ts.map +1 -0
- package/dist/phase/secretCandidates.js +132 -0
- package/dist/phase/secretCandidates.js.map +1 -0
- package/dist/phase/securityCandidates.d.ts +29 -0
- package/dist/phase/securityCandidates.d.ts.map +1 -0
- package/dist/phase/securityCandidates.js +469 -0
- package/dist/phase/securityCandidates.js.map +1 -0
- package/dist/phase/seeded-defects.d.ts +18 -0
- package/dist/phase/seeded-defects.d.ts.map +1 -0
- package/dist/phase/seeded-defects.js +61 -0
- package/dist/phase/seeded-defects.js.map +1 -0
- package/dist/phase/stringLiterals.d.ts +24 -0
- package/dist/phase/stringLiterals.d.ts.map +1 -0
- package/dist/phase/stringLiterals.js +35 -0
- package/dist/phase/stringLiterals.js.map +1 -0
- package/dist/phase/stylesCss.d.ts +25 -0
- package/dist/phase/stylesCss.d.ts.map +1 -0
- package/dist/phase/stylesCss.js +34 -0
- package/dist/phase/stylesCss.js.map +1 -0
- package/dist/phase/stylesMarkup.d.ts +31 -0
- package/dist/phase/stylesMarkup.d.ts.map +1 -0
- package/dist/phase/stylesMarkup.js +48 -0
- package/dist/phase/stylesMarkup.js.map +1 -0
- package/dist/phase/stylesSource.d.ts +36 -0
- package/dist/phase/stylesSource.d.ts.map +1 -0
- package/dist/phase/stylesSource.js +50 -0
- package/dist/phase/stylesSource.js.map +1 -0
- package/dist/phase/typeDeclarations.d.ts +33 -0
- package/dist/phase/typeDeclarations.d.ts.map +1 -0
- package/dist/phase/typeDeclarations.js +76 -0
- package/dist/phase/typeDeclarations.js.map +1 -0
- package/dist/phase/types.d.ts +2191 -0
- package/dist/phase/types.d.ts.map +1 -0
- package/dist/phase/types.js +27 -0
- package/dist/phase/types.js.map +1 -0
- package/dist/phase/withinFileProvenance.d.ts +50 -0
- package/dist/phase/withinFileProvenance.d.ts.map +1 -0
- package/dist/phase/withinFileProvenance.js +112 -0
- package/dist/phase/withinFileProvenance.js.map +1 -0
- package/dist/pipeline.d.ts +37 -30
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +131 -326
- package/dist/pipeline.js.map +1 -1
- package/dist/pipelineAdapters.d.ts +104 -21
- package/dist/pipelineAdapters.d.ts.map +1 -1
- package/dist/pipelineAdapters.js +1145 -988
- package/dist/pipelineAdapters.js.map +1 -1
- package/dist/pipelineTypes.d.ts +21 -0
- package/dist/pipelineTypes.d.ts.map +1 -1
- package/dist/pipelineTypes.js +21 -10
- package/dist/pipelineTypes.js.map +1 -1
- package/dist/presets/presets.d.ts +9 -2
- package/dist/presets/presets.d.ts.map +1 -1
- package/dist/presets/presets.js +15 -26
- package/dist/presets/presets.js.map +1 -1
- package/dist/reporting/csvReportGenerator.d.ts +14 -3
- package/dist/reporting/csvReportGenerator.d.ts.map +1 -1
- package/dist/reporting/csvReportGenerator.js +14 -3
- package/dist/reporting/csvReportGenerator.js.map +1 -1
- package/dist/reporting/htmlReportGenerator.d.ts +5 -1
- package/dist/reporting/htmlReportGenerator.d.ts.map +1 -1
- package/dist/reporting/htmlReportGenerator.js +5 -1
- package/dist/reporting/htmlReportGenerator.js.map +1 -1
- package/dist/reporting/jsonReportGenerator.d.ts +9 -2
- package/dist/reporting/jsonReportGenerator.d.ts.map +1 -1
- package/dist/reporting/jsonReportGenerator.js +19 -5
- package/dist/reporting/jsonReportGenerator.js.map +1 -1
- package/dist/reporting/reportGenerator.d.ts +9 -2
- package/dist/reporting/reportGenerator.d.ts.map +1 -1
- package/dist/reporting/reportGenerator.js +9 -2
- package/dist/reporting/reportGenerator.js.map +1 -1
- package/dist/reporting/sarifReportGenerator.d.ts +14 -0
- package/dist/reporting/sarifReportGenerator.d.ts.map +1 -1
- package/dist/reporting/sarifReportGenerator.js +14 -0
- package/dist/reporting/sarifReportGenerator.js.map +1 -1
- package/dist/reporting/sizeDistribution.d.ts +19 -2
- package/dist/reporting/sizeDistribution.d.ts.map +1 -1
- package/dist/reporting/sizeDistribution.js +23 -5
- package/dist/reporting/sizeDistribution.js.map +1 -1
- package/dist/ruleAliases.d.ts +6 -8
- package/dist/ruleAliases.d.ts.map +1 -1
- package/dist/ruleAliases.js +29 -4
- package/dist/ruleAliases.js.map +1 -1
- package/dist/search/QueryParser.d.ts +1 -0
- package/dist/search/QueryParser.d.ts.map +1 -1
- package/dist/search/QueryParser.js +32 -91
- package/dist/search/QueryParser.js.map +1 -1
- package/dist/services/CodeMapGenerator.d.ts +19 -20
- package/dist/services/CodeMapGenerator.d.ts.map +1 -1
- package/dist/services/CodeMapGenerator.js +214 -194
- package/dist/services/CodeMapGenerator.js.map +1 -1
- package/dist/services/ProjectTaskRepository.d.ts +65 -3
- package/dist/services/ProjectTaskRepository.d.ts.map +1 -1
- package/dist/services/ProjectTaskRepository.js +94 -25
- package/dist/services/ProjectTaskRepository.js.map +1 -1
- package/dist/services/auditJobService.d.ts +17 -1
- package/dist/services/auditJobService.d.ts.map +1 -1
- package/dist/services/auditJobService.js +16 -0
- package/dist/services/auditJobService.js.map +1 -1
- package/dist/services/fileAccounting.d.ts +43 -5
- package/dist/services/fileAccounting.d.ts.map +1 -1
- package/dist/services/fileAccounting.js +48 -9
- package/dist/services/fileAccounting.js.map +1 -1
- package/dist/services/projectTaskHelpers.d.ts +45 -0
- package/dist/services/projectTaskHelpers.d.ts.map +1 -1
- package/dist/services/projectTaskHelpers.js +45 -0
- package/dist/services/projectTaskHelpers.js.map +1 -1
- package/dist/services/whitelistService.d.ts +40 -5
- package/dist/services/whitelistService.d.ts.map +1 -1
- package/dist/services/whitelistService.js +87 -46
- package/dist/services/whitelistService.js.map +1 -1
- package/dist/sqlite/betterSqlite3.d.ts +35 -1
- package/dist/sqlite/betterSqlite3.d.ts.map +1 -1
- package/dist/sqlite/betterSqlite3.js +35 -1
- package/dist/sqlite/betterSqlite3.js.map +1 -1
- package/dist/sqlite/driver.d.ts +23 -0
- package/dist/sqlite/driver.d.ts.map +1 -1
- package/dist/sqlite/driver.js +23 -0
- package/dist/sqlite/driver.js.map +1 -1
- package/dist/sqlite/nodeSqlite.d.ts +35 -1
- package/dist/sqlite/nodeSqlite.d.ts.map +1 -1
- package/dist/sqlite/nodeSqlite.js +35 -1
- package/dist/sqlite/nodeSqlite.js.map +1 -1
- package/dist/structuralSignature.d.ts +9 -0
- package/dist/structuralSignature.d.ts.map +1 -1
- package/dist/structuralSignature.js +9 -0
- package/dist/structuralSignature.js.map +1 -1
- package/dist/styles/cssAstExtractor.d.ts +15 -0
- package/dist/styles/cssAstExtractor.d.ts.map +1 -1
- package/dist/styles/cssAstExtractor.js +15 -0
- package/dist/styles/cssAstExtractor.js.map +1 -1
- package/dist/styles/normalizer.d.ts +6 -0
- package/dist/styles/normalizer.d.ts.map +1 -1
- package/dist/styles/normalizer.js +6 -0
- package/dist/styles/normalizer.js.map +1 -1
- package/dist/styles/styleExtractor.d.ts +29 -2
- package/dist/styles/styleExtractor.d.ts.map +1 -1
- package/dist/styles/styleExtractor.js +67 -48
- package/dist/styles/styleExtractor.js.map +1 -1
- package/dist/styles/styleIndexer.d.ts +8 -0
- package/dist/styles/styleIndexer.d.ts.map +1 -1
- package/dist/styles/styleIndexer.js +135 -138
- package/dist/styles/styleIndexer.js.map +1 -1
- package/dist/styles/tailwindConfigLoader.d.ts +12 -0
- package/dist/styles/tailwindConfigLoader.d.ts.map +1 -1
- package/dist/styles/tailwindConfigLoader.js +12 -0
- package/dist/styles/tailwindConfigLoader.js.map +1 -1
- package/dist/styles/tailwindExpander.d.ts +3 -0
- package/dist/styles/tailwindExpander.d.ts.map +1 -1
- package/dist/styles/tailwindExpander.js +8 -4
- package/dist/styles/tailwindExpander.js.map +1 -1
- package/dist/styles/tailwindProbe.d.ts +9 -0
- package/dist/styles/tailwindProbe.d.ts.map +1 -1
- package/dist/styles/tailwindProbe.js +181 -166
- package/dist/styles/tailwindProbe.js.map +1 -1
- package/dist/styles/tailwindUtilityExpander.d.ts +13 -0
- package/dist/styles/tailwindUtilityExpander.d.ts.map +1 -1
- package/dist/styles/tailwindUtilityExpander.js +13 -0
- package/dist/styles/tailwindUtilityExpander.js.map +1 -1
- package/dist/symbols.d.ts +13 -11
- package/dist/symbols.d.ts.map +1 -1
- package/dist/symbols.js +14 -21
- package/dist/symbols.js.map +1 -1
- package/dist/telemetry.d.ts +31 -3
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +31 -3
- package/dist/telemetry.js.map +1 -1
- package/dist/tool-registry.d.ts +37 -1
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tool-registry.js +37 -1
- package/dist/tool-registry.js.map +1 -1
- package/dist/types.d.ts +106 -92
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -16
- package/dist/types.js.map +1 -1
- package/dist/ui/InteractivePrompts.d.ts +12 -0
- package/dist/ui/InteractivePrompts.d.ts.map +1 -1
- package/dist/ui/InteractivePrompts.js +12 -0
- package/dist/ui/InteractivePrompts.js.map +1 -1
- package/dist/utils/astParser.d.ts +15 -0
- package/dist/utils/astParser.d.ts.map +1 -1
- package/dist/utils/astParser.js +15 -0
- package/dist/utils/astParser.js.map +1 -1
- package/dist/utils/astUtils.d.ts +60 -0
- package/dist/utils/astUtils.d.ts.map +1 -1
- package/dist/utils/astUtils.js +350 -362
- package/dist/utils/astUtils.js.map +1 -1
- package/dist/utils/contentHash.d.ts +22 -0
- package/dist/utils/contentHash.d.ts.map +1 -0
- package/dist/utils/contentHash.js +26 -0
- package/dist/utils/contentHash.js.map +1 -0
- package/dist/utils/dependencyExtractor.d.ts +28 -0
- package/dist/utils/dependencyExtractor.d.ts.map +1 -1
- package/dist/utils/dependencyExtractor.js +28 -1
- package/dist/utils/dependencyExtractor.js.map +1 -1
- package/dist/utils/errorMessage.d.ts +10 -0
- package/dist/utils/errorMessage.d.ts.map +1 -0
- package/dist/utils/errorMessage.js +12 -0
- package/dist/utils/errorMessage.js.map +1 -0
- package/dist/utils/fileDiscovery.d.ts +61 -2
- package/dist/utils/fileDiscovery.d.ts.map +1 -1
- package/dist/utils/fileDiscovery.js +131 -23
- package/dist/utils/fileDiscovery.js.map +1 -1
- package/dist/utils/reactDetection.d.ts +34 -5
- package/dist/utils/reactDetection.d.ts.map +1 -1
- package/dist/utils/reactDetection.js +73 -52
- package/dist/utils/reactDetection.js.map +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/workers/auditWorker.js +7 -3
- package/dist/workers/auditWorker.js.map +1 -1
- package/examples/.auditrc.example.json +0 -8
- package/examples/.auditrc.json +0 -11
- package/examples/.code-auditor.json +0 -2
- package/examples/nextjs.auditrc.json +0 -8
- package/examples/node-api.auditrc.json +0 -7
- package/examples/react.auditrc.json +0 -6
- package/examples/tolerant-solid.auditrc.json +0 -5
- package/package.json +14 -8
- package/plugin/.claude-plugin/manifest.json +16 -0
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +6 -2
- package/plugin/scripts/hook-audit.sh +41 -14
- package/plugin/scripts/hook-common.sh +50 -5
- package/plugin/scripts/hook-drift-check.sh +72 -0
- package/plugin/scripts/hook-self-audit.sh +17 -12
- package/plugin/skills/code-auditor/SKILL.md +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec 68 §11.1 — the general phase-model runner behind the both-paths split.
|
|
3
|
+
*
|
|
4
|
+
* `runPhaseModel` drives Parse → Process → Analyze over `MIGRATED_RULES`. The
|
|
5
|
+
* three-phase ordering and the "rules read facts, never ASTs" property are
|
|
6
|
+
* fixed here; §6's fan-out is realized as a bounded in-process work queue over
|
|
7
|
+
* one task per file (`workerCount` on {@link PhaseInfra}), with a deterministic
|
|
8
|
+
* file-sorted fact merge so `workerCount` is a tuning threshold, never a source
|
|
9
|
+
* of output reordering (§6.4). Tree-sitter `parse()` is synchronous CPU-bound
|
|
10
|
+
* work in one JS thread, so the queue is a structural unit rather than a
|
|
11
|
+
* wall-clock parallelizer; the guarantees §6 exists to deliver — per-file
|
|
12
|
+
* isolation (§3.3), byte-identical output across worker counts (§6.4), and a
|
|
13
|
+
* bounded in-flight window (§6.5) — are what land here.
|
|
14
|
+
*
|
|
15
|
+
* The fact set is *derived* from the migrated rules' `needs`: the union of every
|
|
16
|
+
* declared fact kind, transitively widened by corpus processors' upstream
|
|
17
|
+
* `needs` (today that is the one `ddl-declarations → resolution` edge). File
|
|
18
|
+
* facts are built by parsing each file once and running every matching
|
|
19
|
+
* per-(kind, format) producer over it; corpus facts are reduced in dependency
|
|
20
|
+
* order. Each rule then runs against exactly the facts it declared — no more,
|
|
21
|
+
* no less — which is what makes a rule's coverage state computable (§8).
|
|
22
|
+
*
|
|
23
|
+
* Thresholds are resolved by the caller (§10's config surface) and passed as a
|
|
24
|
+
* per-rule map; a rule with no entry reads its documented fallback. The rule's
|
|
25
|
+
* own `analyze` never reaches a tree, an adapter, or a source string.
|
|
26
|
+
*/
|
|
27
|
+
import { type InputFile } from './runner.js';
|
|
28
|
+
import type { ExternalTableDecl, FactKind, Finding, OracleShortfall, ThresholdValues, UnreadStyleSourceFact, UnresolvedImportFact, UnresolvedQuerySite } from './types.js';
|
|
29
|
+
import type { IndexHandle } from '../types.js';
|
|
30
|
+
import type { UnprovenQueryReceiver } from '../analyzers/receiverResolution.js';
|
|
31
|
+
import type { UnparseableSql } from '../analyzers/universal/schema/codeAnalysis.js';
|
|
32
|
+
import type { Dialect } from '../mcp-tools/discoveryQueries.js';
|
|
33
|
+
/**
|
|
34
|
+
* The result of a phase-model run: the migrated rules' findings plus the
|
|
35
|
+
* per-file fact completeness map that feeds §8's fifth coverage state
|
|
36
|
+
* (`incomplete`). A file is recorded against a fact kind when its parse failed
|
|
37
|
+
* (no producer for that kind could run on it) or a producer threw on it (§3.3).
|
|
38
|
+
*/
|
|
39
|
+
export interface PhaseModelResult {
|
|
40
|
+
findings: Finding[];
|
|
41
|
+
/** Fact kind → files whose fact is incomplete (parse dropped or producer threw). */
|
|
42
|
+
incompleteFacts: ReadonlyMap<FactKind, ReadonlySet<string>>;
|
|
43
|
+
/** Spec 69 R1 — per-file completeness shortfalls: a counted oracle whose
|
|
44
|
+
* processor emitted fewer fragments than expected. Each record names the
|
|
45
|
+
* file, the processor, and both numbers. An empty list means every counted
|
|
46
|
+
* oracle met its expected count for every file. */
|
|
47
|
+
oracleShortfalls: readonly OracleShortfall[];
|
|
48
|
+
/** Spec 70 2c — the unproven query-shaped DB-call sites, re-derived corpus-side
|
|
49
|
+
* from the `data-access-calls-candidates` fact + the `receiver-provenance` fixed
|
|
50
|
+
* point with no AST. Replaces the pre-pass's `unprovenQueryReceivers` half; the
|
|
51
|
+
* `cannot-fire` coverage diagnostic is re-derived from these in the caller. Empty
|
|
52
|
+
* when `receiver-provenance` was not needed (no receiver-consuming rule active). */
|
|
53
|
+
unprovenQueryReceivers: readonly UnprovenQueryReceiver[];
|
|
54
|
+
/** The `receiver-provenance` fixed point's unresolved DB-looking imports — the
|
|
55
|
+
* pre-pass's `unresolvedImports` half, carried on the fact itself (never a
|
|
56
|
+
* separate pre-pass field). Empty when `receiver-provenance` was not needed. */
|
|
57
|
+
unresolvedImports: readonly UnresolvedImportFact[];
|
|
58
|
+
/** Spec 70 1b — the re-admitted DB-calls whose SQL argument is held in an
|
|
59
|
+
* unresolvable identifier, re-derived corpus-side from the raw
|
|
60
|
+
* `schema-usage-candidates` fact + the `receiver-provenance` fixed point with
|
|
61
|
+
* no AST (`identifyHandle` re-admits each, so only DB handles qualify). Feeds
|
|
62
|
+
* the `unresolved-query` coverage diagnostic re-homed in the caller. Empty when
|
|
63
|
+
* `schema-usage` was not needed. */
|
|
64
|
+
unresolvedQuerySites: readonly UnresolvedQuerySite[];
|
|
65
|
+
/** Spec 70 R2 — the re-admitted tagged-template/DB-call SQL arguments whose
|
|
66
|
+
* static text the named dialect could not parse, re-derived corpus-side from
|
|
67
|
+
* the raw `schema-usage-candidates` fact + the `receiver-provenance` fixed
|
|
68
|
+
* point with no AST (`classifyUnparseableSql` mirrors
|
|
69
|
+
* `classifyUnresolvedQuerySites`, collecting `parseSqlTables().unparseable`
|
|
70
|
+
* that `classifySchemaUsage` discards). Feeds the `unparseable` cannot-fire
|
|
71
|
+
* diagnostic re-homed in the caller; each record is stamped with its `file`
|
|
72
|
+
* so the caller can group per file as the legacy visitor did. Empty when
|
|
73
|
+
* `schema-usage` was not needed. */
|
|
74
|
+
unparseableSql: readonly (UnparseableSql & {
|
|
75
|
+
file: string;
|
|
76
|
+
})[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The corpus-level inputs the phase model needs beyond the file list. §8's
|
|
80
|
+
* `reachability` processor reads the discovery list, virtual-module list,
|
|
81
|
+
* tsconfig aliases and package.json entry points — all derived from the
|
|
82
|
+
* project root — so the runner threads them here rather than leaking config
|
|
83
|
+
* into the fact shapes. Every field is optional: the slice tests run a single
|
|
84
|
+
* fixture with none of this, and the processor falls back to the same defaults
|
|
85
|
+
* the legacy reducer did.
|
|
86
|
+
*/
|
|
87
|
+
export interface PhaseInfra {
|
|
88
|
+
/** Absolute project root (Tailwind config + alias/entry resolution). */
|
|
89
|
+
projectRoot?: string;
|
|
90
|
+
/** True for a scoped (changed/files/git) run. Gates the full-project unread
|
|
91
|
+
* dialect walk (`.less`/`.styl`/`.sass`) to full runs only — the same
|
|
92
|
+
* `if (!scoped)` the legacy `findUnreadStyleFiles` walk carried. Absent in
|
|
93
|
+
* the slice tests (no project root, so the walk is skipped regardless). */
|
|
94
|
+
scoped?: boolean;
|
|
95
|
+
/** Full corpus discovery list (unfiltered) for alias resolution. */
|
|
96
|
+
corpusFiles?: readonly string[];
|
|
97
|
+
/** Virtual-module specifiers (config, default DEFAULT_VIRTUAL_MODULES). */
|
|
98
|
+
importVirtualModules?: readonly string[];
|
|
99
|
+
/** tsconfig `paths` + `baseUrl` for alias classification + resolution. */
|
|
100
|
+
tsconfigAliases?: {
|
|
101
|
+
pathPatterns?: readonly string[];
|
|
102
|
+
paths?: Readonly<Record<string, readonly string[]>>;
|
|
103
|
+
baseUrl?: string;
|
|
104
|
+
};
|
|
105
|
+
/** package.json entry points (facade-expanded), absolute. */
|
|
106
|
+
packageEntryPoints?: readonly string[];
|
|
107
|
+
/** The read-only code-index handle the index-backed corpus producers
|
|
108
|
+
* (`call-graph`) read their facts from. Optional: the slice tests run a
|
|
109
|
+
* single fixture with no index, and the producer degrades to an empty fact
|
|
110
|
+
* (matching the legacy graceful-degradation). */
|
|
111
|
+
indexHandle?: IndexHandle;
|
|
112
|
+
/** The migrated rule ids to run (already filtered to the enabled analyzers).
|
|
113
|
+
* Undefined runs every migrated rule — the slice-test / full-pipeline path.
|
|
114
|
+
* A scoped, analyzer-restricted audit passes its subset so disabled analyzers'
|
|
115
|
+
* facts (e.g. cross-domain's `call-graph` whole-table `functions` read) are
|
|
116
|
+
* never built. */
|
|
117
|
+
enabledRules?: ReadonlySet<string>;
|
|
118
|
+
/** §16.8 fault injection — a hook invoked (and awaited) before each (kind,
|
|
119
|
+
* file) producer runs. If it throws, the run treats it as that producer
|
|
120
|
+
* throwing: the file is recorded `incomplete` for `kind` and the run
|
|
121
|
+
* continues. Real runs pass none; the per-file-failure-isolation test passes
|
|
122
|
+
* a hook that throws for one file to prove a single failure does not abort
|
|
123
|
+
* the run or poison its neighbors. It may be async — the §16.5 ordering test
|
|
124
|
+
* awaits a delay for one file to seed a slow processor. */
|
|
125
|
+
beforeProcess?: (kind: FactKind, file: string) => void | Promise<void>;
|
|
126
|
+
/** §16.5 ordering seam — invoked (and awaited) once, before the first rule's
|
|
127
|
+
* `analyze` runs. The ordering test uses it to observe that analysis does not
|
|
128
|
+
* begin until every file has been parsed and every processor level has
|
|
129
|
+
* completed: a slow `beforeProcess` must finish before this fires. */
|
|
130
|
+
beforeAnalyze?: () => void | Promise<void>;
|
|
131
|
+
/** Spec 70 2b — invoked once after every file fact is merged (so the
|
|
132
|
+
* `code-block` fact is assembled) and before any corpus fact is reduced (so
|
|
133
|
+
* the `clone-pair-history` read sees the write). Named for its one job, not
|
|
134
|
+
* its timing: it persists the dry-pair history to the index. Persisting the
|
|
135
|
+
* `dry_pair_history` write (`seedDryPairs` over the `code-block` fact → the
|
|
136
|
+
* `dry_pair_history` table) is its ONLY legitimate use — a general-purpose
|
|
137
|
+
* "after file facts" hook is how declared-input discipline erodes, so this
|
|
138
|
+
* seam is deliberately single-purpose and single-consumer. Absent in the
|
|
139
|
+
* slice tests (single fixture, no index). */
|
|
140
|
+
persistDryPairHistory?: (facts: ReadonlyMap<FactKind, unknown>) => void | Promise<void>;
|
|
141
|
+
/** Config-declared external tables (schema analyzer's `knownTables` +
|
|
142
|
+
* `schemas`), threaded to the `resolution` corpus producer so its
|
|
143
|
+
* known-table set matches the legacy reducer (see {@link ExternalTableDecl}). */
|
|
144
|
+
externalTables?: ReadonlyArray<ExternalTableDecl>;
|
|
145
|
+
/** §6.6 — the bounded work queue's width: how many files parse/process
|
|
146
|
+
* concurrently. Defaults to 1 (serial) at this seam; the entry point sizes
|
|
147
|
+
* the pool to `max(1, cpus - 1)`. A threshold, not a selection gate: the
|
|
148
|
+
* fact merge is file-sorted, so the value never reorders findings (§6.4). */
|
|
149
|
+
workerCount?: number;
|
|
150
|
+
/** Spec 70 R1 — the corpus's named SQL dialect (or null when unnamed). Threaded
|
|
151
|
+
* to every parsed file so the `data-access-calls` producer parses SQL-content
|
|
152
|
+
* facts rather than regex. Absent in the slice tests (single fixture). */
|
|
153
|
+
sqlDialect?: Dialect | null;
|
|
154
|
+
/** Spec 70 R2 — the corpus's dialect-detection reason (non-null only when
|
|
155
|
+
* `sqlDialect` is null), threaded to the `unparseable` re-derivation so an
|
|
156
|
+
* unparseable SQL argument in a dialect-undetermined corpus reports the *why*
|
|
157
|
+
* rather than the generic fallback string (mirrors the legacy `schema-code`
|
|
158
|
+
* visitor's `config.sqlDialectReason`). */
|
|
159
|
+
sqlDialectReason?: string | null;
|
|
160
|
+
/** Spec 70 criterion 9 (Item 3) — the project's declared type packages
|
|
161
|
+
* (package.json `dependencies`/`devDependencies` ∪ tsconfig `compilerOptions.types`),
|
|
162
|
+
* the ambient-arm gate for an unbound handle-type name. Absent (undefined) the
|
|
163
|
+
* gate abstains: an unbound `D1Database` without a declared dependency stays
|
|
164
|
+
* `unproven` rather than being credited `handle`. */
|
|
165
|
+
declaredTypePackages?: ReadonlySet<string>;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Run the full phase model over the given absolute file paths and return the
|
|
169
|
+
* migrated rules' findings. A no-op while `MIGRATED_RULES` is empty (the legacy
|
|
170
|
+
* pipeline serves everything, so the tool is functionally unchanged).
|
|
171
|
+
*
|
|
172
|
+
* @param filePaths - The absolute file paths to read and run through the model.
|
|
173
|
+
* @param thresholdsByRule - The resolved per-rule threshold map.
|
|
174
|
+
* @param infra - The optional corpus-level inputs (project root, index, workers).
|
|
175
|
+
* @returns The migrated rules' findings and the per-file fact completeness map.
|
|
176
|
+
*/
|
|
177
|
+
export declare function runPhaseModel(filePaths: readonly string[], thresholdsByRule: ReadonlyMap<string, ThresholdValues>, infra?: PhaseInfra): Promise<PhaseModelResult>;
|
|
178
|
+
/**
|
|
179
|
+
* The file/corpus-pipeline half, exposed for the slice tests.
|
|
180
|
+
*
|
|
181
|
+
* @param files - The already-read input files to parse, process, and analyze.
|
|
182
|
+
* @param thresholdsByRule - The resolved per-rule threshold map.
|
|
183
|
+
* @param infra - The optional corpus-level inputs (project root, index, workers).
|
|
184
|
+
* @param unread - The traverse phase's walk-level unread-source reasons (dialect,
|
|
185
|
+
* read-failure, unknown-extension), merged into the `unread-style-sources`
|
|
186
|
+
* fact ahead of the corpus producer's table-derived content-level reasons.
|
|
187
|
+
* @returns The migrated rules' findings and the per-file fact completeness map.
|
|
188
|
+
*/
|
|
189
|
+
export declare function runPhaseModelOverFiles(files: readonly InputFile[], thresholdsByRule: ReadonlyMap<string, ThresholdValues>, infra?: PhaseInfra, unread?: readonly UnreadStyleSourceFact[]): Promise<PhaseModelResult>;
|
|
190
|
+
//# sourceMappingURL=phaseModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phaseModel.d.ts","sourceRoot":"","sources":["../../src/phase/phaseModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,KAAK,EAGV,iBAAiB,EACjB,QAAQ,EAER,OAAO,EACP,eAAe,EAKf,eAAe,EAEf,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAIhE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,oFAAoF;IACpF,eAAe,EAAE,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D;;;wDAGoD;IACpD,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C;;;;yFAIqF;IACrF,sBAAsB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACzD;;qFAEiF;IACjF,iBAAiB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACnD;;;;;yCAKqC;IACrC,oBAAoB,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACrD;;;;;;;;yCAQqC;IACrC,cAAc,EAAE,SAAS,CAAC,cAAc,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CAChE;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;gFAG4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,0EAA0E;IAC1E,eAAe,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9H,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC;;;sDAGkD;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;uBAImB;IACnB,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC;;;;;;gEAM4D;IAC5D,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE;;;2EAGuE;IACvE,aAAa,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C;;;;;;;;kDAQ8C;IAC9C,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF;;sFAEkF;IAClF,cAAc,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAClD;;;kFAG8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;+EAE2E;IAC3E,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B;;;;gDAI4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;0DAIsD;IACtD,oBAAoB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EACtD,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,gBAAgB,CAAC,CA0D3B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EACtD,KAAK,CAAC,EAAE,UAAU,EAClB,MAAM,GAAE,SAAS,qBAAqB,EAAO,GAC5C,OAAO,CAAC,gBAAgB,CAAC,CAY3B"}
|
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec 68 §11.1 — the general phase-model runner behind the both-paths split.
|
|
3
|
+
*
|
|
4
|
+
* `runPhaseModel` drives Parse → Process → Analyze over `MIGRATED_RULES`. The
|
|
5
|
+
* three-phase ordering and the "rules read facts, never ASTs" property are
|
|
6
|
+
* fixed here; §6's fan-out is realized as a bounded in-process work queue over
|
|
7
|
+
* one task per file (`workerCount` on {@link PhaseInfra}), with a deterministic
|
|
8
|
+
* file-sorted fact merge so `workerCount` is a tuning threshold, never a source
|
|
9
|
+
* of output reordering (§6.4). Tree-sitter `parse()` is synchronous CPU-bound
|
|
10
|
+
* work in one JS thread, so the queue is a structural unit rather than a
|
|
11
|
+
* wall-clock parallelizer; the guarantees §6 exists to deliver — per-file
|
|
12
|
+
* isolation (§3.3), byte-identical output across worker counts (§6.4), and a
|
|
13
|
+
* bounded in-flight window (§6.5) — are what land here.
|
|
14
|
+
*
|
|
15
|
+
* The fact set is *derived* from the migrated rules' `needs`: the union of every
|
|
16
|
+
* declared fact kind, transitively widened by corpus processors' upstream
|
|
17
|
+
* `needs` (today that is the one `ddl-declarations → resolution` edge). File
|
|
18
|
+
* facts are built by parsing each file once and running every matching
|
|
19
|
+
* per-(kind, format) producer over it; corpus facts are reduced in dependency
|
|
20
|
+
* order. Each rule then runs against exactly the facts it declared — no more,
|
|
21
|
+
* no less — which is what makes a rule's coverage state computable (§8).
|
|
22
|
+
*
|
|
23
|
+
* Thresholds are resolved by the caller (§10's config surface) and passed as a
|
|
24
|
+
* per-rule map; a rule with no entry reads its documented fallback. The rule's
|
|
25
|
+
* own `analyze` never reaches a tree, an adapter, or a source string.
|
|
26
|
+
*/
|
|
27
|
+
import { promises as fs } from 'fs';
|
|
28
|
+
import { MIGRATED_RULES } from './rules/registry.js';
|
|
29
|
+
import { fileProducerFor, PRODUCERS, CORPUS_PRODUCERS } from './producers.js';
|
|
30
|
+
import { oracleShortfall } from './oracles.js';
|
|
31
|
+
import { formatFor, parseOne } from './runner.js';
|
|
32
|
+
import { loadTailwindConfig, tokensToStyleTokens } from '../styles/tailwindConfigLoader.js';
|
|
33
|
+
import { findFiles, UNREAD_STYLE_EXTENSIONS, getSourceExtensions } from '../utils/fileDiscovery.js';
|
|
34
|
+
import { classifyUnprovenQueryReceivers, classifyUnresolvedQuerySites, classifyUnparseableSql } from './receiverConsumers.js';
|
|
35
|
+
import { withRuleTiming, withRuleTimingAsync } from '../analyzers/ruleTiming.js';
|
|
36
|
+
/**
|
|
37
|
+
* Run the full phase model over the given absolute file paths and return the
|
|
38
|
+
* migrated rules' findings. A no-op while `MIGRATED_RULES` is empty (the legacy
|
|
39
|
+
* pipeline serves everything, so the tool is functionally unchanged).
|
|
40
|
+
*
|
|
41
|
+
* @param filePaths - The absolute file paths to read and run through the model.
|
|
42
|
+
* @param thresholdsByRule - The resolved per-rule threshold map.
|
|
43
|
+
* @param infra - The optional corpus-level inputs (project root, index, workers).
|
|
44
|
+
* @returns The migrated rules' findings and the per-file fact completeness map.
|
|
45
|
+
*/
|
|
46
|
+
export async function runPhaseModel(filePaths, thresholdsByRule, infra) {
|
|
47
|
+
if (MIGRATED_RULES.length === 0)
|
|
48
|
+
return { findings: [], incompleteFacts: new Map(), oracleShortfalls: [], unprovenQueryReceivers: [], unresolvedImports: [], unresolvedQuerySites: [], unparseableSql: [] };
|
|
49
|
+
const active = activeRules(infra?.enabledRules);
|
|
50
|
+
if (active.length === 0)
|
|
51
|
+
return { findings: [], incompleteFacts: new Map(), oracleShortfalls: [], unprovenQueryReceivers: [], unresolvedImports: [], unresolvedQuerySites: [], unparseableSql: [] };
|
|
52
|
+
const neededFormats = new Set();
|
|
53
|
+
for (const rule of active) {
|
|
54
|
+
for (const f of rule.needs.formats)
|
|
55
|
+
neededFormats.add(f);
|
|
56
|
+
}
|
|
57
|
+
// Widen to the formats that supply the transitively-needed *file* facts: a
|
|
58
|
+
// rule names only the formats it evaluates (`needs.formats`), not the formats
|
|
59
|
+
// its facts come from. `unknown-table` declares `resolution`, whose
|
|
60
|
+
// upstream `ddl-declarations` is supplied by `sql` (migration files) as well
|
|
61
|
+
// as TS/JS — so `.sql` files must be read even though no rule declares `sql`.
|
|
62
|
+
const neededKinds = neededFactKinds(active);
|
|
63
|
+
for (const kind of neededKinds) {
|
|
64
|
+
const producers = PRODUCERS[kind];
|
|
65
|
+
if (producers)
|
|
66
|
+
for (const format of Object.keys(producers))
|
|
67
|
+
neededFormats.add(format);
|
|
68
|
+
}
|
|
69
|
+
// Spec 70 — the traverse phase is now the source of the three *walk-level*
|
|
70
|
+
// unread reasons (`unsupported style dialect`, `read failed`, `unsupported
|
|
71
|
+
// source extension`), each byte-identical to the legacy string it replaces.
|
|
72
|
+
// The content-level `<style lang="…">` reason still comes from the index
|
|
73
|
+
// table (via the corpus producer), so the fact is their merge in `buildFacts`.
|
|
74
|
+
const unread = [];
|
|
75
|
+
// Dialect walk (`.less`/`.styl`/`.sass`) — full runs only, matching the legacy
|
|
76
|
+
// `if (!scoped)` around `findUnreadStyleFiles`.
|
|
77
|
+
if (infra?.projectRoot && !infra.scoped && neededKinds.has('unread-style-sources')) {
|
|
78
|
+
for (const p of await findFiles(infra.projectRoot, { extensions: UNREAD_STYLE_EXTENSIONS })) {
|
|
79
|
+
const ext = p.slice(p.lastIndexOf('.') + 1);
|
|
80
|
+
unread.push({ filePath: p, reason: `unsupported style dialect: ${ext}` });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const files = [];
|
|
84
|
+
for (const p of filePaths) {
|
|
85
|
+
// Unknown source extension → unread (the legacy `extractForFile` backstop),
|
|
86
|
+
// and skip the parse — `formatFor` would map it to `typescript` and mis-parse
|
|
87
|
+
// it as TS rather than leaving it unhandled.
|
|
88
|
+
const ext = p.includes('.') ? p.slice(p.lastIndexOf('.')) : '';
|
|
89
|
+
if (ext && !getSourceExtensions().has(ext)) {
|
|
90
|
+
unread.push({ filePath: p, reason: `unsupported source extension: ${ext}` });
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (!neededFormats.has(formatFor(p)))
|
|
94
|
+
continue;
|
|
95
|
+
try {
|
|
96
|
+
files.push({ path: p, content: await fs.readFile(p, 'utf8') });
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
// Unreadable — the traverse's own read attempt records the reason (the
|
|
100
|
+
// legacy read-failure push moved here); skip, don't fail.
|
|
101
|
+
unread.push({ filePath: p, reason: `read failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return runPhaseModelOverFiles(files, thresholdsByRule, infra, unread);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The file/corpus-pipeline half, exposed for the slice tests.
|
|
108
|
+
*
|
|
109
|
+
* @param files - The already-read input files to parse, process, and analyze.
|
|
110
|
+
* @param thresholdsByRule - The resolved per-rule threshold map.
|
|
111
|
+
* @param infra - The optional corpus-level inputs (project root, index, workers).
|
|
112
|
+
* @param unread - The traverse phase's walk-level unread-source reasons (dialect,
|
|
113
|
+
* read-failure, unknown-extension), merged into the `unread-style-sources`
|
|
114
|
+
* fact ahead of the corpus producer's table-derived content-level reasons.
|
|
115
|
+
* @returns The migrated rules' findings and the per-file fact completeness map.
|
|
116
|
+
*/
|
|
117
|
+
export async function runPhaseModelOverFiles(files, thresholdsByRule, infra, unread = []) {
|
|
118
|
+
const { facts, incompleteFacts, oracleShortfalls, unprovenQueryReceivers, unresolvedImports, unresolvedQuerySites, unparseableSql } = await buildFacts(files, infra, unread);
|
|
119
|
+
const findings = await analyzeAll(facts, thresholdsByRule, infra);
|
|
120
|
+
return {
|
|
121
|
+
findings,
|
|
122
|
+
incompleteFacts,
|
|
123
|
+
oracleShortfalls,
|
|
124
|
+
unprovenQueryReceivers,
|
|
125
|
+
unresolvedImports,
|
|
126
|
+
unresolvedQuerySites,
|
|
127
|
+
unparseableSql,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/** The migrated rules this run should serve: all, or the enabled subset. */
|
|
131
|
+
function activeRules(enabledRules) {
|
|
132
|
+
if (!enabledRules)
|
|
133
|
+
return MIGRATED_RULES;
|
|
134
|
+
return MIGRATED_RULES.filter((r) => enabledRules.has(r.id));
|
|
135
|
+
}
|
|
136
|
+
/** The fact kinds the migrated rules read, transitively closed over corpus `needs`. */
|
|
137
|
+
function neededFactKinds(active = MIGRATED_RULES) {
|
|
138
|
+
const needed = new Set();
|
|
139
|
+
for (const rule of active) {
|
|
140
|
+
for (const f of rule.needs.facts)
|
|
141
|
+
needed.add(f);
|
|
142
|
+
}
|
|
143
|
+
// Corpus producers pull in their upstream facts (ddl-declarations → resolution).
|
|
144
|
+
let grew = true;
|
|
145
|
+
while (grew) {
|
|
146
|
+
grew = false;
|
|
147
|
+
for (const producer of Object.values(CORPUS_PRODUCERS)) {
|
|
148
|
+
if (!needed.has(producer.produces))
|
|
149
|
+
continue;
|
|
150
|
+
for (const upstream of producer.needs) {
|
|
151
|
+
if (!needed.has(upstream)) {
|
|
152
|
+
needed.add(upstream);
|
|
153
|
+
grew = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Spec 70 2c — `classifyUnprovenQueryReceivers` (the fifth receiver consumer)
|
|
159
|
+
// reads the raw `data-access-calls-candidates` fact, which is only an upstream
|
|
160
|
+
// of `data-access-calls`. When `receiver-provenance` is needed through another
|
|
161
|
+
// consumer (e.g. a `loop-queries`-only run) but `data-access-calls` is not, that
|
|
162
|
+
// candidate fact would be absent and the cannot-fire surface would silently read
|
|
163
|
+
// empty — matching the pre-pass, which always scanned for unproven receivers
|
|
164
|
+
// whenever any receiver consumer was present.
|
|
165
|
+
if (needed.has('receiver-provenance'))
|
|
166
|
+
needed.add('data-access-calls-candidates');
|
|
167
|
+
return needed;
|
|
168
|
+
}
|
|
169
|
+
/** Process: build every needed fact kind (file facts, then corpus facts in order). */
|
|
170
|
+
async function buildFacts(files, infra, unread = []) {
|
|
171
|
+
const projectRoot = infra?.projectRoot;
|
|
172
|
+
const active = activeRules(infra?.enabledRules);
|
|
173
|
+
const needed = neededFactKinds(active);
|
|
174
|
+
const facts = new Map();
|
|
175
|
+
const incompleteFacts = new Map();
|
|
176
|
+
const oracleShortfalls = [];
|
|
177
|
+
const fileKinds = [...needed].filter((k) => Object.prototype.hasOwnProperty.call(PRODUCERS, k));
|
|
178
|
+
// Every needed file fact starts empty so a corpus producer whose upstream
|
|
179
|
+
// no file produced sees `[]`, not `undefined` (resolution's
|
|
180
|
+
// ddl-declarations edge on a corpus with no code DDL — e.g. a styles-only
|
|
181
|
+
// audit, or DDL declared in .sql migrations the code parser never sees).
|
|
182
|
+
for (const kind of fileKinds) {
|
|
183
|
+
facts.set(kind, []);
|
|
184
|
+
}
|
|
185
|
+
/** Record `file` against `kind` in the per-file completeness map (§3.3). */
|
|
186
|
+
const markIncomplete = (kind, file) => {
|
|
187
|
+
let set = incompleteFacts.get(kind);
|
|
188
|
+
if (!set) {
|
|
189
|
+
set = new Set();
|
|
190
|
+
incompleteFacts.set(kind, set);
|
|
191
|
+
}
|
|
192
|
+
set.add(file);
|
|
193
|
+
};
|
|
194
|
+
// §6.1 — one parse + per-file process is a single task per file. Each task
|
|
195
|
+
// returns that file's fact fragments (and its incomplete (kind) list); the
|
|
196
|
+
// parent merges them in file order. A bounded queue runs at most `workerCount`
|
|
197
|
+
// files in flight (§6.5). `workerCount` is a threshold, not a selection gate:
|
|
198
|
+
// the merge is file-sorted, so the fact arrays — and every finding derived
|
|
199
|
+
// from them — are byte-identical regardless of how wide the queue is (§6.4).
|
|
200
|
+
//
|
|
201
|
+
// §3.3 per-file failure isolation: a failed parse marks every file fact kind
|
|
202
|
+
// that would have been produced from this file's format `incomplete`; a
|
|
203
|
+
// throwing producer marks just that (kind, file) pair. Either way the run
|
|
204
|
+
// continues — the failure is observable in §8's coverage, not a dropped file
|
|
205
|
+
// (which would read `clean`, a false negative) and not an aborted run.
|
|
206
|
+
const workerCount = Math.max(1, infra?.workerCount ?? 1);
|
|
207
|
+
const perFile = await mapWithConcurrency(files, (input) => processFile(input, fileKinds, projectRoot, infra), workerCount);
|
|
208
|
+
// Deterministic merge: file-sorted so the parent's write order (and thus every
|
|
209
|
+
// rule's input and output) never depends on completion order.
|
|
210
|
+
const ordered = [...perFile].sort((a, b) => (a.file < b.file ? -1 : a.file > b.file ? 1 : 0));
|
|
211
|
+
for (const r of ordered) {
|
|
212
|
+
for (const [kind, items] of r.fragments) {
|
|
213
|
+
const acc = facts.get(kind) ?? [];
|
|
214
|
+
acc.push(...items);
|
|
215
|
+
facts.set(kind, acc);
|
|
216
|
+
}
|
|
217
|
+
for (const kind of r.incomplete)
|
|
218
|
+
markIncomplete(kind, r.file);
|
|
219
|
+
oracleShortfalls.push(...r.shortfalls);
|
|
220
|
+
}
|
|
221
|
+
// Corpus-level Tailwind theme tokens (Spec 68 §3.2): the legacy pipeline
|
|
222
|
+
// stores these in `style_tokens` alongside the per-file CSS custom properties
|
|
223
|
+
// during index sync. The phase fact has no index, so merge them here as a
|
|
224
|
+
// synthetic declaration-free fragment. `tokensToStyleTokens` on a project with
|
|
225
|
+
// no Tailwind config yields `filePath: 'built-in defaults'`, which
|
|
226
|
+
// `buildTokenValueMap` / `buildDeclaredScale` both exclude — so the merge is a
|
|
227
|
+
// no-op for plain-CSS projects and load-bearing only when a real config
|
|
228
|
+
// declares a color/spacing/font-size scale.
|
|
229
|
+
if (projectRoot && needed.has('style-declarations')) {
|
|
230
|
+
const twTokens = tokensToStyleTokens(loadTailwindConfig(projectRoot), projectRoot);
|
|
231
|
+
if (twTokens.length > 0) {
|
|
232
|
+
const acc = facts.get('style-declarations') ?? [];
|
|
233
|
+
acc.push({ declarations: [], tokens: twTokens, classUsage: [], unreadSources: [] });
|
|
234
|
+
facts.set('style-declarations', acc);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Spec 70 2b — the dry-pair seed write: after the file facts are merged (the
|
|
238
|
+
// `code-block` fact is complete) but before the corpus facts reduce (so
|
|
239
|
+
// `clone-pair-history` reads the freshly-written `dry_pair_history` rows, the
|
|
240
|
+
// same write-before-read ordering `persistDryPairs`-then-`runPhaseModel` had).
|
|
241
|
+
await infra?.persistDryPairHistory?.(facts);
|
|
242
|
+
// Corpus facts, reduced from upstream facts (single shallow level today).
|
|
243
|
+
const corpusKinds = [...needed].filter((k) => Object.prototype.hasOwnProperty.call(CORPUS_PRODUCERS, k));
|
|
244
|
+
// Shared `identifyHandle` verdict cache (Spec 70) — one map per `buildFacts`
|
|
245
|
+
// pass, threaded through `corpusCtx` to the four receiver consumers and reused
|
|
246
|
+
// by the post-loop classifiers below. The verdict is a pure function of
|
|
247
|
+
// (file, handle identity) within a single pass, so a cache hit is byte-identical
|
|
248
|
+
// to a re-fold; it just avoids folding `data-access-calls-candidates` twice
|
|
249
|
+
// (once in `data-access-calls`, once in the cannot-fire reduction).
|
|
250
|
+
const handleVerdictCache = new Map();
|
|
251
|
+
const corpusCtx = {
|
|
252
|
+
projectRoot: infra?.projectRoot,
|
|
253
|
+
corpusFiles: infra?.corpusFiles,
|
|
254
|
+
virtualModules: infra?.importVirtualModules,
|
|
255
|
+
tsconfigAliases: infra?.tsconfigAliases,
|
|
256
|
+
packageEntryPoints: infra?.packageEntryPoints,
|
|
257
|
+
indexHandle: infra?.indexHandle,
|
|
258
|
+
externalTables: infra?.externalTables,
|
|
259
|
+
sqlDialect: infra?.sqlDialect,
|
|
260
|
+
declaredTypePackages: infra?.declaredTypePackages,
|
|
261
|
+
handleVerdictCache,
|
|
262
|
+
};
|
|
263
|
+
// §5 DAG — topological sort. A corpus producer's `needs` may reference other
|
|
264
|
+
// corpus kinds (e.g. the four receiver consumers depend on `receiver-provenance`,
|
|
265
|
+
// which itself depends on file facts). File-fact needs are already satisfied by
|
|
266
|
+
// the per-file pass above; only the corpus→corpus edges require ordering, so the
|
|
267
|
+
// sort runs over `corpusKinds` alone (a `needs` entry naming a file fact is
|
|
268
|
+
// simply already present in `facts`). Kahn's algorithm; a cycle falls back to
|
|
269
|
+
// the unsorted order rather than looping (no cycle exists in the declared DAG).
|
|
270
|
+
const sortedCorpusKinds = topoSortCorpusKinds(corpusKinds);
|
|
271
|
+
for (const kind of sortedCorpusKinds) {
|
|
272
|
+
const producer = CORPUS_PRODUCERS[kind];
|
|
273
|
+
const upstream = Object.fromEntries(producer.needs.map((n) => [n, facts.get(n)]));
|
|
274
|
+
facts.set(kind, withRuleTiming(`producer:${producer.id}`, () => producer.process(upstream, corpusCtx)));
|
|
275
|
+
}
|
|
276
|
+
// Spec 70 — merge the traverse phase's walk-level unread reasons ahead of the
|
|
277
|
+
// corpus producer's fact-derived content-level reasons (`<style lang>`). The
|
|
278
|
+
// walk-level half is the traverse's own read/dialect record; the content-level
|
|
279
|
+
// half is what the `unread-style-sources` producer flattens from the markup
|
|
280
|
+
// `style-declarations` fact (`extractStylesMarkup` collects it during its
|
|
281
|
+
// `extractDeclarations` pass — no `style_unread_sources` table re-read).
|
|
282
|
+
if (needed.has('unread-style-sources')) {
|
|
283
|
+
const content = facts.get('unread-style-sources') ?? [];
|
|
284
|
+
facts.set('unread-style-sources', [...unread, ...content]);
|
|
285
|
+
}
|
|
286
|
+
// Spec 70 2c — the fifth receiver consumer (a plain reduction, not a registry
|
|
287
|
+
// fact kind): re-derive the unproven query-shaped call sites from the raw
|
|
288
|
+
// `data-access-calls-candidates` fact + the `receiver-provenance` fixed point,
|
|
289
|
+
// and surface the fixed point's unresolved imports. Both replace the deleted
|
|
290
|
+
// pre-pass's `unprovenQueryReceivers` / `unresolvedImports` halves; they exist
|
|
291
|
+
// only to feed the `cannot-fire` coverage diagnostic (re-homed in the caller),
|
|
292
|
+
// never a rule's declared facts.
|
|
293
|
+
let unprovenQueryReceivers = [];
|
|
294
|
+
let unresolvedImports = [];
|
|
295
|
+
let unresolvedQuerySites = [];
|
|
296
|
+
let unparseableSql = [];
|
|
297
|
+
const receiverProvenanceFact = facts.get('receiver-provenance');
|
|
298
|
+
if (receiverProvenanceFact) {
|
|
299
|
+
unresolvedImports = [...receiverProvenanceFact.unresolvedImports];
|
|
300
|
+
// The shared resolution tail the three corpus reductions below rehydrate from.
|
|
301
|
+
const resolutionBase = {
|
|
302
|
+
withinFacts: facts.get('within-file-provenance') ?? [],
|
|
303
|
+
provenance: receiverProvenanceFact,
|
|
304
|
+
activityFacts: facts.get('receiver-activity') ?? [],
|
|
305
|
+
sqlDialect: infra?.sqlDialect ?? null,
|
|
306
|
+
declaredTypePackages: infra?.declaredTypePackages,
|
|
307
|
+
projectRoot: infra?.projectRoot,
|
|
308
|
+
tsconfig: infra?.tsconfigAliases,
|
|
309
|
+
};
|
|
310
|
+
unprovenQueryReceivers = classifyUnprovenQueryReceivers(facts.get('data-access-calls-candidates') ?? [], { ...resolutionBase, verdictCache: handleVerdictCache });
|
|
311
|
+
// Spec 70 1b — the `unresolved-query` half (a third coverage signal, alongside
|
|
312
|
+
// the two above): re-derive the re-admitted unresolvable-SQL DB-calls from the
|
|
313
|
+
// raw `schema-usage-candidates` fact + the provenance fixed point. Only runs
|
|
314
|
+
// when `schema-usage` was needed (its raw fact is present); otherwise empty.
|
|
315
|
+
const schemaUsageCandidates = facts.get('schema-usage-candidates');
|
|
316
|
+
if (schemaUsageCandidates) {
|
|
317
|
+
unresolvedQuerySites = classifyUnresolvedQuerySites(schemaUsageCandidates, resolutionBase);
|
|
318
|
+
// Spec 70 R2 — the `unparseable` half (the `unresolved-query` sibling):
|
|
319
|
+
// re-derive the re-admitted static-SQL arguments the named dialect could not
|
|
320
|
+
// parse, from the same raw fact + fixed point. Threads `sqlDialectReason` so
|
|
321
|
+
// a dialect-undetermined corpus reports the legacy `why`, not the generic
|
|
322
|
+
// fallback string.
|
|
323
|
+
unparseableSql = classifyUnparseableSql(schemaUsageCandidates, {
|
|
324
|
+
...resolutionBase,
|
|
325
|
+
sqlDialectReason: infra?.sqlDialectReason ?? null,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return { facts, incompleteFacts, oracleShortfalls, unprovenQueryReceivers, unresolvedImports, unresolvedQuerySites, unparseableSql };
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* §5 DAG — topological sort over the corpus kinds requested, so a corpus producer
|
|
333
|
+
* whose `needs` names another corpus kind runs after it. A `needs` entry naming a
|
|
334
|
+
* file fact is ignored here (file facts are already in `facts` by the time corpus
|
|
335
|
+
* producers run). Kahn's algorithm keyed on the `CORPUS_PRODUCERS[].needs` edges;
|
|
336
|
+
* the result preserves the input order among independent kinds (the determinism
|
|
337
|
+
* anchor), and a cycle (none exists in the declared DAG) falls back to the input
|
|
338
|
+
* order rather than looping forever.
|
|
339
|
+
*/
|
|
340
|
+
function topoSortCorpusKinds(kinds) {
|
|
341
|
+
const corpusSet = new Set(kinds);
|
|
342
|
+
const inDegree = new Map();
|
|
343
|
+
const dependents = new Map();
|
|
344
|
+
for (const kind of kinds)
|
|
345
|
+
inDegree.set(kind, 0);
|
|
346
|
+
for (const kind of kinds) {
|
|
347
|
+
for (const need of CORPUS_PRODUCERS[kind].needs) {
|
|
348
|
+
if (!corpusSet.has(need))
|
|
349
|
+
continue; // file fact — already satisfied.
|
|
350
|
+
inDegree.set(kind, (inDegree.get(kind) ?? 0) + 1);
|
|
351
|
+
const list = dependents.get(need) ?? [];
|
|
352
|
+
list.push(kind);
|
|
353
|
+
dependents.set(need, list);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Seed the queue with the zero-in-degree kinds in input order (stability).
|
|
357
|
+
const queue = kinds.filter((k) => (inDegree.get(k) ?? 0) === 0);
|
|
358
|
+
const sorted = [];
|
|
359
|
+
while (queue.length > 0) {
|
|
360
|
+
const kind = queue.shift();
|
|
361
|
+
sorted.push(kind);
|
|
362
|
+
for (const dep of dependents.get(kind) ?? []) {
|
|
363
|
+
const next = (inDegree.get(dep) ?? 1) - 1;
|
|
364
|
+
inDegree.set(dep, next);
|
|
365
|
+
if (next === 0)
|
|
366
|
+
queue.push(dep);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
// A cycle leaves some kinds unsorted; fall back to the input order for them.
|
|
370
|
+
if (sorted.length !== kinds.length)
|
|
371
|
+
return [...kinds];
|
|
372
|
+
return sorted;
|
|
373
|
+
}
|
|
374
|
+
/** §6.5 — bounded work queue: run `fn` over `items` with at most `limit` in
|
|
375
|
+
* flight, returning results in input order. With `limit === 1` this is exactly
|
|
376
|
+
* a serial loop; with `limit > 1` the queue never holds more than `limit`
|
|
377
|
+
* in-flight tasks, so a huge repository does not materialize a wall of
|
|
378
|
+
* concurrent parses. Input order is preserved in the result array, so the
|
|
379
|
+
* caller's file-sorted merge is the single determinism anchor. */
|
|
380
|
+
async function mapWithConcurrency(items, fn, limit) {
|
|
381
|
+
const results = new Array(items.length);
|
|
382
|
+
let next = 0;
|
|
383
|
+
const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {
|
|
384
|
+
while (next < items.length) {
|
|
385
|
+
const i = next++;
|
|
386
|
+
results[i] = await fn(items[i]);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
await Promise.all(workers);
|
|
390
|
+
return results;
|
|
391
|
+
}
|
|
392
|
+
/** §6.1 — one task per file: parse once, run every matching per-(kind, format)
|
|
393
|
+
* producer, free the tree, and return the file's fact fragments plus its
|
|
394
|
+
* incomplete (kind) list. The tree never leaves this function (Fact 8), and a
|
|
395
|
+
* parse failure or throwing producer is scoped to this file — the parent
|
|
396
|
+
* records `incomplete` rather than aborting (§3.3). */
|
|
397
|
+
async function processFile(input, fileKinds, projectRoot, infra) {
|
|
398
|
+
let parsed = await parseOne(input, projectRoot);
|
|
399
|
+
// Spec 70 R1 — attach the corpus dialect to the parsed file so the
|
|
400
|
+
// data-access producer's SQL facts parse rather than regex.
|
|
401
|
+
if (parsed && infra?.sqlDialect) {
|
|
402
|
+
parsed = { ...parsed, sqlDialect: infra.sqlDialect };
|
|
403
|
+
}
|
|
404
|
+
const fragments = new Map();
|
|
405
|
+
const incomplete = [];
|
|
406
|
+
const shortfalls = [];
|
|
407
|
+
if (!parsed) {
|
|
408
|
+
const format = formatFor(input.path);
|
|
409
|
+
for (const kind of fileKinds) {
|
|
410
|
+
if (fileProducerFor(kind, format))
|
|
411
|
+
incomplete.push(kind);
|
|
412
|
+
}
|
|
413
|
+
return { file: input.path, fragments, incomplete, shortfalls };
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
for (const kind of fileKinds) {
|
|
417
|
+
const producer = fileProducerFor(kind, parsed.format);
|
|
418
|
+
if (!producer)
|
|
419
|
+
continue;
|
|
420
|
+
try {
|
|
421
|
+
await infra?.beforeProcess?.(kind, input.path);
|
|
422
|
+
// Spec 38 R2 — per-producer timing on the phase path. The legacy
|
|
423
|
+
// `withRuleTiming` only wrapped the `Universal*Analyzer` visitors, so
|
|
424
|
+
// after the migration the gate's per-rule breakdown reported rule cost
|
|
425
|
+
// (~20 ms) against a ~320 ms gate with the producer cost invisible.
|
|
426
|
+
// Timing each producer's `process` under `producer:<id>` surfaces the
|
|
427
|
+
// fact-build cost in the same slowest-first breakdown as the rules.
|
|
428
|
+
const emitted = withRuleTiming(`producer:${producer.id}`, () => producer.process(parsed));
|
|
429
|
+
const acc = fragments.get(kind) ?? [];
|
|
430
|
+
acc.push(...emitted);
|
|
431
|
+
fragments.set(kind, acc);
|
|
432
|
+
const sf = oracleShortfall(producer.oracle, parsed, emitted, producer.id);
|
|
433
|
+
if (sf)
|
|
434
|
+
shortfalls.push(sf);
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
incomplete.push(kind);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
finally {
|
|
442
|
+
parsed.ast?.dispose?.();
|
|
443
|
+
}
|
|
444
|
+
return { file: input.path, fragments, incomplete, shortfalls };
|
|
445
|
+
}
|
|
446
|
+
/** Analyze: run every active migrated rule against exactly its declared facts.
|
|
447
|
+
* `beforeAnalyze` fires once before the first rule, after `buildFacts` has
|
|
448
|
+
* completed for every file and every processor level — the §16.5 ordering
|
|
449
|
+
* observation point. */
|
|
450
|
+
async function analyzeAll(facts, thresholdsByRule, infra) {
|
|
451
|
+
await infra?.beforeAnalyze?.();
|
|
452
|
+
const findings = [];
|
|
453
|
+
for (const rule of activeRules(infra?.enabledRules)) {
|
|
454
|
+
const ruleFacts = Object.fromEntries(rule.needs.facts.map((f) => [f, facts.get(f)]));
|
|
455
|
+
const ctx = {
|
|
456
|
+
facts: ruleFacts,
|
|
457
|
+
formats: rule.needs.formats,
|
|
458
|
+
thresholds: thresholdsByRule.get(rule.id) ?? {},
|
|
459
|
+
};
|
|
460
|
+
// Spec 38 R2 — per-rule timing on the phase path (the legacy `withRuleTiming`
|
|
461
|
+
// wrappers no longer run for migrated rules). Records the full async analyze
|
|
462
|
+
// under the rule's ID so the gate's per-rule breakdown reports the dominant
|
|
463
|
+
// rule again, not `(no rules recorded)`.
|
|
464
|
+
findings.push(...await withRuleTimingAsync(rule.id, () => rule.analyze(ctx)));
|
|
465
|
+
}
|
|
466
|
+
return findings;
|
|
467
|
+
}
|
|
468
|
+
//# sourceMappingURL=phaseModel.js.map
|