code-auditor-mcp 4.1.1 → 5.0.2
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 +381 -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 +427 -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 +348 -0
- package/dist/analyzers/receiverRoot.d.ts.map +1 -0
- package/dist/analyzers/receiverRoot.js +1032 -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 +241 -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.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js +23 -35
- 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 +66 -1
- package/dist/auditRunner.d.ts.map +1 -1
- package/dist/auditRunner.js +1544 -1034
- 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 +983 -821
- 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 +132 -271
- package/dist/codeIndexDB.d.ts.map +1 -1
- package/dist/codeIndexDB.js +365 -2729
- 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 +15 -0
- package/dist/config/configLoader.d.ts.map +1 -1
- package/dist/config/configLoader.js +15 -16
- 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 +16 -14
- 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/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 +22 -4
- package/dist/daemon/main.js.map +1 -1
- package/dist/daemon/resolve.d.ts +18 -3
- package/dist/daemon/resolve.d.ts.map +1 -1
- package/dist/daemon/resolve.js +25 -4
- 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 +17 -8
- package/dist/dataPaths.d.ts.map +1 -1
- package/dist/dataPaths.js +16 -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/graph/resolutionEnvironment.d.ts +61 -0
- package/dist/graph/resolutionEnvironment.d.ts.map +1 -0
- package/dist/graph/resolutionEnvironment.js +57 -0
- package/dist/graph/resolutionEnvironment.js.map +1 -0
- 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 +827 -850
- 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 +491 -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 +1030 -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 +207 -0
- package/dist/phase/receiverConsumers.d.ts.map +1 -0
- package/dist/phase/receiverConsumers.js +1063 -0
- package/dist/phase/receiverConsumers.js.map +1 -0
- package/dist/phase/receiverProvenance.d.ts +120 -0
- package/dist/phase/receiverProvenance.d.ts.map +1 -0
- package/dist/phase/receiverProvenance.js +377 -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 +2199 -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 +1144 -984
- 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 +114 -71
- 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 +18 -9
- package/plugin/.claude-plugin/manifest.json +16 -0
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +7 -3
- package/plugin/scripts/hook-audit.sh +46 -16
- package/plugin/scripts/hook-common.sh +81 -12
- package/plugin/scripts/hook-drift-check.sh +76 -0
- package/plugin/scripts/hook-self-audit.sh +22 -14
- package/plugin/scripts/hook-warm.sh +5 -6
- package/plugin/skills/code-auditor/SKILL.md +1 -1
- package/server.json +10 -4
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Go receiver resolution — Spec 69 §10 S5e (#369).
|
|
3
|
+
*
|
|
4
|
+
* The Go half of the three-way receiver disposition. It answers the same
|
|
5
|
+
* question the TypeScript processor (`analyzers/receiverRoot.ts`) answers —
|
|
6
|
+
* "does this identifier resolve to a DB handle, a definitively non-DB value, or
|
|
7
|
+
* something undetermined?" — using Go's own declaration grammar:
|
|
8
|
+
*
|
|
9
|
+
* • `parameter_declaration` — `db *sql.DB` (function params AND method
|
|
10
|
+
* receivers; both are parameter_declarations).
|
|
11
|
+
* • `var_spec` — package-level `var db *sql.DB`.
|
|
12
|
+
* • `short_var_declaration` — `db, err := sql.Open(...)` / `c := New()`.
|
|
13
|
+
* • `field_declaration` — struct field `db *sql.DB`.
|
|
14
|
+
* • `function_declaration` / `method_declaration` — the return-type half of
|
|
15
|
+
* form-5: `func New() *Engine` resolves a
|
|
16
|
+
* `router := New()` receiver to not-a-handle.
|
|
17
|
+
*
|
|
18
|
+
* The ecosystem list lives HERE with the Go adapter — not in a shared constant
|
|
19
|
+
* and not in the TypeScript implementation's `DB_PACKAGES` (tsEcosystem.ts,
|
|
20
|
+
* which is npm/TypeScript only). A
|
|
21
|
+
* name is a *handle* because it resolved to the `database/sql` package (the
|
|
22
|
+
* parsed SQL argument proves the handle, not the type name), never because it
|
|
23
|
+
* *looks* like `db`; a name is
|
|
24
|
+
* *not-a-handle* because it resolved to a local type/primitive or an ambient
|
|
25
|
+
* global, never because it is on a list. A name that resolved to an
|
|
26
|
+
* *unrecognized* package (a non-`database/sql` import such as `gin`, `net/http`,
|
|
27
|
+
* `testing`) is `unproven` — Spec 70 R4 reports `cannot-fire` for a package the
|
|
28
|
+
* manifest does not recognize, rather than guessing it is not a DB client.
|
|
29
|
+
*
|
|
30
|
+
* The functions here are pure and parser-agnostic at their boundary: they take
|
|
31
|
+
* the already-parsed `AST` + adapter, so the analyzer layer (`receiverResolution.ts`)
|
|
32
|
+
* dispatches to them the same way it dispatches to the TypeScript processor.
|
|
33
|
+
*/
|
|
34
|
+
import { getRawNode } from '../tree-sitter/rawNode.js';
|
|
35
|
+
import databasePackages from './database-packages.json' with { type: 'json' };
|
|
36
|
+
import stdlibPackages from './stdlib-packages.json' with { type: 'json' };
|
|
37
|
+
/**
|
|
38
|
+
* Package paths whose types are DB handles. Go-only, stdlib-first.
|
|
39
|
+
*
|
|
40
|
+
* Spec 70 R4 / criterion 10: loaded from the per-ecosystem manifest
|
|
41
|
+
* (`src/languages/go/database-packages.json`, beside the format adapter), a
|
|
42
|
+
* declarative data file holding import paths only. An unlisted package reached
|
|
43
|
+
* by resolution reports `cannot-fire` (see `classifyGoRootIdentifier` /
|
|
44
|
+
* `classifyGoTypeText`), never a guessed `not-handle`.
|
|
45
|
+
*/
|
|
46
|
+
export const GO_DB_PACKAGES = new Set(databasePackages);
|
|
47
|
+
/**
|
|
48
|
+
* Go standard-library import paths — the authoritative `go list std` snapshot
|
|
49
|
+
* (committed from `scripts/generate-go-stdlib.mjs`, not hand-edited). A receiver
|
|
50
|
+
* whose import path resolves to a stdlib package (`fmt`, `strings`, `net/http`,
|
|
51
|
+
* `reflect`, …) is `not-handle` — it cannot be a database client. This is the
|
|
52
|
+
* package discriminant's `not-handle` half for Go, replacing the deleted method-
|
|
53
|
+
* name surface: the *package* a receiver resolves to proves it is not a DB handle,
|
|
54
|
+
* never the method name (criterion: the method name cannot discriminate).
|
|
55
|
+
*/
|
|
56
|
+
export const GO_STDLIB_PACKAGES = new Set(stdlibPackages);
|
|
57
|
+
/** Unqualified builtin types that are definitively not a DB handle. */
|
|
58
|
+
const GO_NON_HANDLE_TYPES = new Set([
|
|
59
|
+
'bool',
|
|
60
|
+
'byte',
|
|
61
|
+
'complex64',
|
|
62
|
+
'complex128',
|
|
63
|
+
'error',
|
|
64
|
+
'float32',
|
|
65
|
+
'float64',
|
|
66
|
+
'int',
|
|
67
|
+
'int8',
|
|
68
|
+
'int16',
|
|
69
|
+
'int32',
|
|
70
|
+
'int64',
|
|
71
|
+
'rune',
|
|
72
|
+
'string',
|
|
73
|
+
'uint',
|
|
74
|
+
'uint8',
|
|
75
|
+
'uint16',
|
|
76
|
+
'uint32',
|
|
77
|
+
'uint64',
|
|
78
|
+
'uintptr',
|
|
79
|
+
'any',
|
|
80
|
+
'nil',
|
|
81
|
+
]);
|
|
82
|
+
/**
|
|
83
|
+
* Project a live tree-sitter value node onto a {@link GoValueDescriptor}. Bounded
|
|
84
|
+
* to `depth` named-field hops — `classifyGoValue` reads at most `call_expression
|
|
85
|
+
* → function → operand` (two hops), so depth 4 is more than sufficient while
|
|
86
|
+
* guarding against pathological nesting.
|
|
87
|
+
*/
|
|
88
|
+
function describeGoValue(raw, depth = 4) {
|
|
89
|
+
// tree-sitter-go wraps even a single `const`/`var` value in an
|
|
90
|
+
// `expression_list` (`const x = `…`` → the `value` field is `expression_list`
|
|
91
|
+
// whose only named child is the `raw_string_literal`). Unwrap a one-element
|
|
92
|
+
// list so the descriptor carries the literal/expression itself, not the wrapper.
|
|
93
|
+
if (raw.type === 'expression_list') {
|
|
94
|
+
const children = raw.namedChildren ?? [];
|
|
95
|
+
if (children.length === 1)
|
|
96
|
+
return describeGoValue(children[0], depth - 1);
|
|
97
|
+
}
|
|
98
|
+
const child = (field) => {
|
|
99
|
+
if (depth <= 0)
|
|
100
|
+
return null;
|
|
101
|
+
const c = raw.childForFieldName(field);
|
|
102
|
+
return c ? describeGoValue(c, depth - 1) : null;
|
|
103
|
+
};
|
|
104
|
+
return {
|
|
105
|
+
type: raw.type,
|
|
106
|
+
text: raw.text ?? '',
|
|
107
|
+
function: child('function'),
|
|
108
|
+
operand: child('operand'),
|
|
109
|
+
typeNode: child('type'),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
// ── Import resolution ────────────────────────────────────────────────────────
|
|
113
|
+
/** The package name for an import path when no explicit alias is present. */
|
|
114
|
+
function defaultPackageName(source) {
|
|
115
|
+
const parts = source.split('/');
|
|
116
|
+
return parts[parts.length - 1] || source;
|
|
117
|
+
}
|
|
118
|
+
/** Strip surrounding quotes from a Go string-literal node text. */
|
|
119
|
+
function unquote(text) {
|
|
120
|
+
if (text.length >= 2 && (text[0] === '"' || text[0] === '`')) {
|
|
121
|
+
return text.slice(1, -1);
|
|
122
|
+
}
|
|
123
|
+
return text;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Build the package-name → import-path map for one Go file.
|
|
127
|
+
*
|
|
128
|
+
* Handles both `import "database/sql"` (single) and the parenthesized
|
|
129
|
+
* `import ( "database/sql"; alias "fmt" )` form — the latter is the shape
|
|
130
|
+
* `adapter.extractImports` misses (its `import_declaration` iteration only
|
|
131
|
+
* sees the `import_spec_list` wrapper, not the `import_spec` children). Dot and
|
|
132
|
+
* blank imports (`. "x"`, `_ "x"`) are skipped: they contribute no package name.
|
|
133
|
+
*
|
|
134
|
+
* @param ast the parsed Go file AST
|
|
135
|
+
* @param adapter the language adapter used to find `import_spec` nodes
|
|
136
|
+
* @returns the package-name → import-path map for this file
|
|
137
|
+
*/
|
|
138
|
+
export function buildGoImportMap(ast, adapter) {
|
|
139
|
+
const imports = new Map();
|
|
140
|
+
const specs = adapter.findNodes(ast, { custom: (n) => n.type === 'import_spec' });
|
|
141
|
+
for (const spec of specs) {
|
|
142
|
+
const raw = getRawNode(spec);
|
|
143
|
+
const pathNode = raw.childForFieldName('path');
|
|
144
|
+
if (!pathNode)
|
|
145
|
+
continue;
|
|
146
|
+
const source = unquote(pathNode.text);
|
|
147
|
+
if (!source)
|
|
148
|
+
continue;
|
|
149
|
+
const nameNode = raw.childForFieldName('name');
|
|
150
|
+
let pkgName;
|
|
151
|
+
if (!nameNode) {
|
|
152
|
+
pkgName = defaultPackageName(source);
|
|
153
|
+
}
|
|
154
|
+
else if (nameNode.type === 'package_identifier' || nameNode.type === 'identifier') {
|
|
155
|
+
pkgName = nameNode.text;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
continue; // dot or blank import — no package name to resolve
|
|
159
|
+
}
|
|
160
|
+
if (pkgName)
|
|
161
|
+
imports.set(pkgName, source);
|
|
162
|
+
}
|
|
163
|
+
return imports;
|
|
164
|
+
}
|
|
165
|
+
// ── Binding extraction ───────────────────────────────────────────────────────
|
|
166
|
+
/**
|
|
167
|
+
* Build the per-file binding environment: imports, parameters (incl. method
|
|
168
|
+
* receivers), package/local vars, short-vars, struct fields, function/method
|
|
169
|
+
* return types, and local type declarations.
|
|
170
|
+
*
|
|
171
|
+
* @param ast the parsed Go file AST
|
|
172
|
+
* @param adapter the language adapter used to walk nodes
|
|
173
|
+
* @param sourceCode the file source text for reading node text
|
|
174
|
+
* @returns the name → binding map for every name bound in the file
|
|
175
|
+
*/
|
|
176
|
+
export function buildGoBindingEnv(ast, adapter, sourceCode) {
|
|
177
|
+
const bindings = new Map();
|
|
178
|
+
const imports = buildGoImportMap(ast, adapter);
|
|
179
|
+
for (const [pkgName, source] of imports) {
|
|
180
|
+
if (!bindings.has(pkgName))
|
|
181
|
+
bindings.set(pkgName, { kind: 'import', source });
|
|
182
|
+
}
|
|
183
|
+
const rawWalk = (node, visit) => {
|
|
184
|
+
visit(getRawNode(node));
|
|
185
|
+
for (const child of adapter.getChildren(node))
|
|
186
|
+
rawWalk(child, visit);
|
|
187
|
+
};
|
|
188
|
+
rawWalk(ast.root, (raw) => {
|
|
189
|
+
switch (raw.type) {
|
|
190
|
+
case 'parameter_declaration': {
|
|
191
|
+
const nameNode = raw.childForFieldName('name');
|
|
192
|
+
const typeNode = raw.childForFieldName('type');
|
|
193
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
194
|
+
bindings.set(nameNode.text, {
|
|
195
|
+
kind: 'parameter',
|
|
196
|
+
typeText: typeNode?.text,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
case 'var_spec': {
|
|
202
|
+
const nameNode = raw.childForFieldName('name');
|
|
203
|
+
const typeNode = raw.childForFieldName('type');
|
|
204
|
+
const valueNode = raw.childForFieldName('value');
|
|
205
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
206
|
+
bindings.set(nameNode.text, {
|
|
207
|
+
kind: 'variable',
|
|
208
|
+
typeText: typeNode?.text,
|
|
209
|
+
value: valueNode ? describeGoValue(valueNode) : undefined,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
case 'short_var_declaration': {
|
|
215
|
+
const left = raw.childForFieldName('left');
|
|
216
|
+
const right = raw.childForFieldName('right');
|
|
217
|
+
const rightExprs = right?.namedChildren ?? [];
|
|
218
|
+
const singleRight = rightExprs.length === 1 ? rightExprs[0] : null;
|
|
219
|
+
for (const id of left?.namedChildren ?? []) {
|
|
220
|
+
if (id.type !== 'identifier' || bindings.has(id.text))
|
|
221
|
+
continue;
|
|
222
|
+
bindings.set(id.text, {
|
|
223
|
+
kind: 'variable',
|
|
224
|
+
value: singleRight ? describeGoValue(singleRight) : undefined,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
case 'field_declaration': {
|
|
230
|
+
const nameNode = raw.childForFieldName('name');
|
|
231
|
+
const typeNode = raw.childForFieldName('type');
|
|
232
|
+
const valueNode = raw.childForFieldName('value');
|
|
233
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
234
|
+
bindings.set(nameNode.text, {
|
|
235
|
+
kind: 'field',
|
|
236
|
+
typeText: typeNode?.text,
|
|
237
|
+
value: valueNode ? describeGoValue(valueNode) : undefined,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
case 'type_spec': {
|
|
243
|
+
const nameNode = raw.childForFieldName('name');
|
|
244
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
245
|
+
bindings.set(nameNode.text, { kind: 'type' });
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
case 'const_spec': {
|
|
250
|
+
// A package-level `const` — the sqlc-generated SQL surface: sqlc emits
|
|
251
|
+
// `const getAllUsers = `-- name: GetAllUsers :many\nSELECT …`` and the
|
|
252
|
+
// query method references it by identifier
|
|
253
|
+
// (`q.db.QueryContext(ctx, getAllUsers)`). The value is a literal; store
|
|
254
|
+
// it as a serializable descriptor so the analyzer can unquote it with
|
|
255
|
+
// `stripSqlQuotes` (raw strings are literal, interpreted strings un-escape).
|
|
256
|
+
const nameNode = raw.childForFieldName('name');
|
|
257
|
+
const valueNode = raw.childForFieldName('value');
|
|
258
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
259
|
+
bindings.set(nameNode.text, {
|
|
260
|
+
kind: 'const',
|
|
261
|
+
value: valueNode ? describeGoValue(valueNode) : undefined,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case 'function_declaration':
|
|
267
|
+
case 'method_declaration': {
|
|
268
|
+
const nameNode = raw.childForFieldName('name');
|
|
269
|
+
const resultNode = raw.childForFieldName('result');
|
|
270
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
271
|
+
bindings.set(nameNode.text, {
|
|
272
|
+
kind: raw.type === 'method_declaration' ? 'method' : 'function',
|
|
273
|
+
returnTypeText: resultNode?.text,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
return bindings;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Build a *package-scope* symbol table from a set of Go files in the same
|
|
284
|
+
* package: top-level `function_declaration`/`method_declaration` (name + return
|
|
285
|
+
* type), `type_declaration` → `type_spec` (name), and `var_declaration` →
|
|
286
|
+
* `var_spec` (name + type + value). Local declarations (params, short-vars,
|
|
287
|
+
* fields inside function bodies) are deliberately excluded — those are file/scope
|
|
288
|
+
* local and must never bleed across files.
|
|
289
|
+
*
|
|
290
|
+
* This is the Go equivalent of the TS cross-file in-repo resolution: an
|
|
291
|
+
* unqualified package-level call like `New()` / `CreateTestContext()` in one
|
|
292
|
+
* file resolves through the symbol declared in a *sibling* file, so its return
|
|
293
|
+
* type (`*Engine` / `*Context`) drives the receiver disposition instead of
|
|
294
|
+
* `unproven`.
|
|
295
|
+
*
|
|
296
|
+
* @param files the Go files (AST + adapter) that share this package
|
|
297
|
+
* @returns the package-scope name → binding symbol table
|
|
298
|
+
*/
|
|
299
|
+
export function buildGoPackageBindings(files) {
|
|
300
|
+
const bindings = new Map();
|
|
301
|
+
for (const { ast } of files) {
|
|
302
|
+
for (const [name, binding] of buildGoFileBindings(ast)) {
|
|
303
|
+
if (!bindings.has(name))
|
|
304
|
+
bindings.set(name, binding);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return bindings;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Extract one Go file's *package-scope* declarations — the per-file half of
|
|
311
|
+
* {@link buildGoPackageBindings}. Spec 70 Item 4 (2a): the phase model lifts
|
|
312
|
+
* this per-file extraction into the `go-package-bindings` file fact so the
|
|
313
|
+
* cross-file fixed point can group files by directory and merge first-wins,
|
|
314
|
+
* exactly as {@link buildGoPackageBindings} does, with no AST outliving its
|
|
315
|
+
* file. The bindings returned are `GoBinding` (already a serializable
|
|
316
|
+
* projection: `value` is a {@link GoValueDescriptor}, not a live node).
|
|
317
|
+
*
|
|
318
|
+
* @param ast the parsed Go file AST
|
|
319
|
+
* @returns this file's package-scope name → binding symbol table
|
|
320
|
+
*/
|
|
321
|
+
export function buildGoFileBindings(ast) {
|
|
322
|
+
const bindings = new Map();
|
|
323
|
+
const root = getRawNode(ast.root);
|
|
324
|
+
for (const decl of root.namedChildren) {
|
|
325
|
+
switch (decl.type) {
|
|
326
|
+
case 'function_declaration':
|
|
327
|
+
case 'method_declaration': {
|
|
328
|
+
const nameNode = decl.childForFieldName('name');
|
|
329
|
+
const resultNode = decl.childForFieldName('result');
|
|
330
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
331
|
+
bindings.set(nameNode.text, {
|
|
332
|
+
kind: decl.type === 'method_declaration' ? 'method' : 'function',
|
|
333
|
+
returnTypeText: resultNode?.text,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
case 'type_declaration': {
|
|
339
|
+
for (const spec of decl.namedChildren) {
|
|
340
|
+
if (spec.type !== 'type_spec')
|
|
341
|
+
continue;
|
|
342
|
+
const nameNode = spec.childForFieldName('name');
|
|
343
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
344
|
+
bindings.set(nameNode.text, { kind: 'type' });
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
case 'var_declaration': {
|
|
350
|
+
for (const spec of decl.namedChildren) {
|
|
351
|
+
if (spec.type !== 'var_spec')
|
|
352
|
+
continue;
|
|
353
|
+
const nameNode = spec.childForFieldName('name');
|
|
354
|
+
const typeNode = spec.childForFieldName('type');
|
|
355
|
+
const valueNode = spec.childForFieldName('value');
|
|
356
|
+
if (nameNode && !bindings.has(nameNode.text)) {
|
|
357
|
+
bindings.set(nameNode.text, {
|
|
358
|
+
kind: 'variable',
|
|
359
|
+
typeText: typeNode?.text,
|
|
360
|
+
value: valueNode ? describeGoValue(valueNode) : undefined,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return bindings;
|
|
369
|
+
}
|
|
370
|
+
// ── Classification ───────────────────────────────────────────────────────────
|
|
371
|
+
/** Resolve a package name to its import path (or null when not imported). */
|
|
372
|
+
function resolvePackage(pkgName, env) {
|
|
373
|
+
return env.imports.get(pkgName) ?? null;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* The first return *type* of a Go function signature text, e.g.
|
|
377
|
+
* `(*sql.DB, error)` → `*sql.DB`, `*Engine` → `*Engine`,
|
|
378
|
+
* `(c *Context, r *Engine)` → `*Context` (named results). Handles three shapes:
|
|
379
|
+
*
|
|
380
|
+
* 1. bare — `*Engine`, `error`, `map[string]*sql.DB`
|
|
381
|
+
* 2. parens — `(*sql.DB, error)` → strip the outer parens, take first
|
|
382
|
+
* 3. named — `(c *Context, r *Engine)` → drop the leading result *name*,
|
|
383
|
+
* keep its type
|
|
384
|
+
*
|
|
385
|
+
* Splits on top-level commas (tracking paren/bracket/brace depth) so
|
|
386
|
+
* `map[string]*sql.DB` and `func() error` stay whole.
|
|
387
|
+
*/
|
|
388
|
+
function firstReturnType(resultText) {
|
|
389
|
+
let t = resultText.trim();
|
|
390
|
+
// Strip a single outer paren group: `(c *Context, r *Engine)` →
|
|
391
|
+
// `c *Context, r *Engine`, `(*sql.DB, error)` → `*sql.DB, error`.
|
|
392
|
+
if (t.startsWith('(') && t.endsWith(')'))
|
|
393
|
+
t = t.slice(1, -1).trim();
|
|
394
|
+
let depth = 0;
|
|
395
|
+
let first = '';
|
|
396
|
+
for (const ch of t) {
|
|
397
|
+
if (ch === '(' || ch === '[' || ch === '{')
|
|
398
|
+
depth++;
|
|
399
|
+
if (ch === ')' || ch === ']' || ch === '}')
|
|
400
|
+
depth--;
|
|
401
|
+
if (ch === ',' && depth === 0)
|
|
402
|
+
break;
|
|
403
|
+
first += ch;
|
|
404
|
+
}
|
|
405
|
+
first = first.trim();
|
|
406
|
+
// Named result: `c *Context` → the name is a plain identifier prefix, the type
|
|
407
|
+
// is the rest. A bare type like `*Context` / `map[K]V` / `chan int` has no
|
|
408
|
+
// such leading identifier, and `map`/`chan`/`func`/`struct`/`interface` are
|
|
409
|
+
// type keywords, never result names.
|
|
410
|
+
const named = first.match(/^([A-Za-z_][A-Za-z0-9_]*)\s+(.+)$/s);
|
|
411
|
+
if (named && !/^(map|chan|func|struct|interface)$/.test(named[1])) {
|
|
412
|
+
return named[2].trim();
|
|
413
|
+
}
|
|
414
|
+
return first;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Classify a bare Go root identifier's disposition under the file's env.
|
|
418
|
+
*
|
|
419
|
+
* @param name the bare root identifier to classify
|
|
420
|
+
* @param env the file's Go resolution environment (provenance, bindings, imports)
|
|
421
|
+
* @param depth recursion guard; classification gives up past depth 8
|
|
422
|
+
* @returns `handle`, `not-handle`, or `unproven`
|
|
423
|
+
*/
|
|
424
|
+
export function classifyGoRootIdentifier(name, env, depth = 0) {
|
|
425
|
+
if (!name)
|
|
426
|
+
return 'unproven';
|
|
427
|
+
if (env.provenance.has(name))
|
|
428
|
+
return 'handle';
|
|
429
|
+
if (depth > 8)
|
|
430
|
+
return 'unproven';
|
|
431
|
+
const binding = env.bindings.get(name) ?? env.packageBindings?.get(name);
|
|
432
|
+
if (!binding)
|
|
433
|
+
return 'not-handle'; // ambient global → not-handle
|
|
434
|
+
switch (binding.kind) {
|
|
435
|
+
case 'import': {
|
|
436
|
+
const source = binding.source ?? '';
|
|
437
|
+
// A DB package proves handle; a stdlib package proves not-handle (it cannot
|
|
438
|
+
// be a DB client); any other package is unrecognized, not a DB client, or a
|
|
439
|
+
// DB client we do not list — all `unproven` (cannot-fire), never a guessed
|
|
440
|
+
// `not-handle` (Spec 70 R4).
|
|
441
|
+
return GO_DB_PACKAGES.has(source)
|
|
442
|
+
? 'handle'
|
|
443
|
+
: GO_STDLIB_PACKAGES.has(source)
|
|
444
|
+
? 'not-handle'
|
|
445
|
+
: 'unproven';
|
|
446
|
+
}
|
|
447
|
+
case 'variable':
|
|
448
|
+
case 'field':
|
|
449
|
+
if (binding.typeText)
|
|
450
|
+
return classifyGoTypeText(binding.typeText, env, depth);
|
|
451
|
+
if (binding.value)
|
|
452
|
+
return classifyGoValue(binding.value, env, depth);
|
|
453
|
+
return 'unproven';
|
|
454
|
+
case 'parameter':
|
|
455
|
+
if (binding.typeText)
|
|
456
|
+
return classifyGoTypeText(binding.typeText, env, depth);
|
|
457
|
+
return 'unproven';
|
|
458
|
+
case 'function':
|
|
459
|
+
case 'method':
|
|
460
|
+
if (binding.returnTypeText) {
|
|
461
|
+
return classifyGoTypeText(firstReturnType(binding.returnTypeText), env, depth + 1);
|
|
462
|
+
}
|
|
463
|
+
return 'unproven';
|
|
464
|
+
case 'type':
|
|
465
|
+
// A local type name is definitively not a DB handle (unless provenanced,
|
|
466
|
+
// checked above).
|
|
467
|
+
return 'not-handle';
|
|
468
|
+
case 'const':
|
|
469
|
+
// A `const` can only hold a compile-time literal (string/number/bool),
|
|
470
|
+
// never a DB handle, so it is definitively not a handle (unless provenanced,
|
|
471
|
+
// checked above). The sqlc SQL const reaches the parser via the SQL-argument
|
|
472
|
+
// source's `extractStaticSql` const resolution, not via this classifier.
|
|
473
|
+
return 'not-handle';
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Classify a Go type text (`*sql.DB`, `sql.DB`, `*gin.Context`, `string`).
|
|
478
|
+
* Strips pointer/slice prefixes, then dispatches on qualified (`pkg.Type`) vs
|
|
479
|
+
* unqualified (`Type` / builtin).
|
|
480
|
+
*
|
|
481
|
+
* @param typeText the Go type expression to classify
|
|
482
|
+
* @param env the file's Go resolution environment
|
|
483
|
+
* @param depth recursion guard
|
|
484
|
+
* @returns `handle`, `not-handle`, or `unproven`
|
|
485
|
+
*/
|
|
486
|
+
export function classifyGoTypeText(typeText, env, depth) {
|
|
487
|
+
let t = typeText.trim();
|
|
488
|
+
// Strip leading pointer (`*sql.DB`) and slice/array (`[]byte`, `[4]string`)
|
|
489
|
+
// prefixes. The slice regex is anchored to a leading `[`, so a `map[K]V` type
|
|
490
|
+
// (no leading `[`) is left untouched.
|
|
491
|
+
for (;;) {
|
|
492
|
+
if (t.startsWith('*')) {
|
|
493
|
+
t = t.slice(1).trim();
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
const slice = t.match(/^\[(\d*)\](.*)$/s);
|
|
497
|
+
if (slice) {
|
|
498
|
+
t = slice[2].trim();
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
const dot = t.indexOf('.');
|
|
504
|
+
if (dot > 0 && !/[\s()\[\]{},*]/.test(t)) {
|
|
505
|
+
// Qualified type: `pkg.Type`. Handle-ness follows the *package* (the
|
|
506
|
+
// `database/sql` import path), never the type name — the parsed SQL argument
|
|
507
|
+
// is the handle proof; the package is the resolution fallback.
|
|
508
|
+
const pkgName = t.slice(0, dot);
|
|
509
|
+
const source = resolvePackage(pkgName, env);
|
|
510
|
+
if (source === null)
|
|
511
|
+
return 'unproven'; // package not imported → unknown
|
|
512
|
+
if (GO_DB_PACKAGES.has(source))
|
|
513
|
+
return 'handle';
|
|
514
|
+
if (GO_STDLIB_PACKAGES.has(source))
|
|
515
|
+
return 'not-handle'; // stdlib → not a DB client
|
|
516
|
+
return 'unproven'; // unrecognized package → cannot-fire (Spec 70 R4)
|
|
517
|
+
}
|
|
518
|
+
// Unqualified: a builtin or a local named type.
|
|
519
|
+
if (GO_NON_HANDLE_TYPES.has(t))
|
|
520
|
+
return 'not-handle';
|
|
521
|
+
return classifyGoRootIdentifier(t, env, depth + 1);
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Classify a Go value expression's disposition (an initializer). A call to a
|
|
525
|
+
* function whose return type is known resolves through it — `c := New()` where
|
|
526
|
+
* `New() *Engine` is not-a-handle, `db := sql.Open(...)` is a handle.
|
|
527
|
+
*/
|
|
528
|
+
function classifyGoValue(raw, env, depth) {
|
|
529
|
+
if (raw.type === 'identifier') {
|
|
530
|
+
return classifyGoRootIdentifier(raw.text, env, depth + 1);
|
|
531
|
+
}
|
|
532
|
+
if (raw.type === 'call_expression') {
|
|
533
|
+
const fnNode = raw.function;
|
|
534
|
+
if (fnNode?.type === 'identifier') {
|
|
535
|
+
const name = fnNode.text;
|
|
536
|
+
if (env.provenance.has(name))
|
|
537
|
+
return 'handle';
|
|
538
|
+
const b = env.bindings.get(name) ?? env.packageBindings?.get(name);
|
|
539
|
+
if (b && (b.kind === 'function' || b.kind === 'method') && b.returnTypeText) {
|
|
540
|
+
return classifyGoTypeText(firstReturnType(b.returnTypeText), env, depth + 1);
|
|
541
|
+
}
|
|
542
|
+
return 'unproven';
|
|
543
|
+
}
|
|
544
|
+
if (fnNode?.type === 'selector_expression') {
|
|
545
|
+
const operand = fnNode.operand;
|
|
546
|
+
const root = operand?.text ?? '';
|
|
547
|
+
if (root && env.provenance.has(root))
|
|
548
|
+
return 'handle';
|
|
549
|
+
const b = env.bindings.get(root);
|
|
550
|
+
if (b && b.kind === 'import') {
|
|
551
|
+
const source = b.source ?? '';
|
|
552
|
+
if (GO_DB_PACKAGES.has(source))
|
|
553
|
+
return 'handle';
|
|
554
|
+
if (GO_STDLIB_PACKAGES.has(source))
|
|
555
|
+
return 'not-handle';
|
|
556
|
+
return 'unproven';
|
|
557
|
+
}
|
|
558
|
+
return 'unproven';
|
|
559
|
+
}
|
|
560
|
+
return 'unproven';
|
|
561
|
+
}
|
|
562
|
+
if (raw.type === 'selector_expression') {
|
|
563
|
+
const operand = raw.operand;
|
|
564
|
+
if (operand?.type === 'identifier')
|
|
565
|
+
return classifyGoRootIdentifier(operand.text, env, depth + 1);
|
|
566
|
+
return 'unproven';
|
|
567
|
+
}
|
|
568
|
+
if (raw.type === 'unary_expression') {
|
|
569
|
+
// `&Context{}` / `&sql.DB{}` — classify the operand (the address-of target).
|
|
570
|
+
const operand = raw.operand;
|
|
571
|
+
if (operand) {
|
|
572
|
+
const opText = operand.text;
|
|
573
|
+
if (opText)
|
|
574
|
+
return classifyGoTypeText(opText, env, depth + 1);
|
|
575
|
+
}
|
|
576
|
+
return 'unproven';
|
|
577
|
+
}
|
|
578
|
+
if (raw.type === 'composite_literal') {
|
|
579
|
+
const typeNode = raw.typeNode;
|
|
580
|
+
if (typeNode?.text)
|
|
581
|
+
return classifyGoTypeText(typeNode.text, env, depth + 1);
|
|
582
|
+
return 'unproven';
|
|
583
|
+
}
|
|
584
|
+
if (raw.type === 'interpreted_string_literal' ||
|
|
585
|
+
raw.type === 'raw_string_literal' ||
|
|
586
|
+
raw.type === 'int_literal' ||
|
|
587
|
+
raw.type === 'float_literal' ||
|
|
588
|
+
raw.type === 'true' ||
|
|
589
|
+
raw.type === 'false' ||
|
|
590
|
+
raw.type === 'nil') {
|
|
591
|
+
return 'not-handle';
|
|
592
|
+
}
|
|
593
|
+
return 'unproven';
|
|
594
|
+
}
|
|
595
|
+
// ── Unproven reason (Go) ─────────────────────────────────────────────────────
|
|
596
|
+
/** The package path a qualified type text (`*ent.Client`, `sqlx.DB`) resolves to,
|
|
597
|
+
* when that package is imported but absent from the database-packages manifest.
|
|
598
|
+
* Mirrors `classifyGoTypeText`'s pointer/slice stripping + qualified-type
|
|
599
|
+
* package resolution, but returns the *source* instead of the disposition. */
|
|
600
|
+
function unrecognizedPackageInType(typeText, env) {
|
|
601
|
+
let t = typeText.trim();
|
|
602
|
+
for (;;) {
|
|
603
|
+
if (t.startsWith('*')) {
|
|
604
|
+
t = t.slice(1).trim();
|
|
605
|
+
continue;
|
|
606
|
+
}
|
|
607
|
+
const slice = t.match(/^\[(\d*)\](.*)$/s);
|
|
608
|
+
if (slice) {
|
|
609
|
+
t = slice[2].trim();
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
const dot = t.indexOf('.');
|
|
615
|
+
if (dot > 0 && !/[\s()\[\]{},*]/.test(t)) {
|
|
616
|
+
const pkgName = t.slice(0, dot);
|
|
617
|
+
const source = resolvePackage(pkgName, env);
|
|
618
|
+
if (source !== null && !GO_DB_PACKAGES.has(source))
|
|
619
|
+
return source;
|
|
620
|
+
}
|
|
621
|
+
return null;
|
|
622
|
+
}
|
|
623
|
+
/** The package path a value/initializer descriptor resolves to when that package
|
|
624
|
+
* is imported but absent from the manifest (`client, _ := ent.Open(…)` → `ent` →
|
|
625
|
+
* `entgo.io/ent`). Mirrors `classifyGoValue`'s selector/identifier/type arms. */
|
|
626
|
+
function unrecognizedPackageInValue(raw, env, depth) {
|
|
627
|
+
if (depth > 8)
|
|
628
|
+
return null;
|
|
629
|
+
if (raw.type === 'selector_expression') {
|
|
630
|
+
if (raw.operand?.type === 'identifier') {
|
|
631
|
+
const b = env.bindings.get(raw.operand.text) ?? env.packageBindings?.get(raw.operand.text);
|
|
632
|
+
if (b?.kind === 'import')
|
|
633
|
+
return b.source && !GO_DB_PACKAGES.has(b.source) ? b.source : null;
|
|
634
|
+
}
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
if (raw.type === 'call_expression') {
|
|
638
|
+
const fn = raw.function;
|
|
639
|
+
if (!fn)
|
|
640
|
+
return null;
|
|
641
|
+
if (fn.type === 'identifier') {
|
|
642
|
+
const b = env.bindings.get(fn.text) ?? env.packageBindings?.get(fn.text);
|
|
643
|
+
if (b && (b.kind === 'function' || b.kind === 'method') && b.returnTypeText) {
|
|
644
|
+
return unrecognizedPackageInType(firstReturnType(b.returnTypeText), env);
|
|
645
|
+
}
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
return unrecognizedPackageInValue(fn, env, depth + 1);
|
|
649
|
+
}
|
|
650
|
+
if (raw.type === 'unary_expression' || raw.type === 'composite_literal') {
|
|
651
|
+
if (raw.typeNode?.text)
|
|
652
|
+
return unrecognizedPackageInType(raw.typeNode.text, env);
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
return null;
|
|
656
|
+
}
|
|
657
|
+
/** The package path a binding resolves to when it is imported but absent from the
|
|
658
|
+
* manifest — the source `describeGoUnprovenCause` names instead of a generic
|
|
659
|
+
* "indeterminate". Returns null when the binding does not resolve to an
|
|
660
|
+
* unrecognized package (no type, an unlisted-but-unimported name, etc.). */
|
|
661
|
+
function unrecognizedPackageOf(binding, env, depth = 0) {
|
|
662
|
+
if (depth > 8)
|
|
663
|
+
return null;
|
|
664
|
+
switch (binding.kind) {
|
|
665
|
+
case 'import':
|
|
666
|
+
return binding.source && !GO_DB_PACKAGES.has(binding.source) ? binding.source : null;
|
|
667
|
+
case 'parameter':
|
|
668
|
+
case 'variable':
|
|
669
|
+
case 'field':
|
|
670
|
+
if (binding.typeText)
|
|
671
|
+
return unrecognizedPackageInType(binding.typeText, env);
|
|
672
|
+
if (binding.value)
|
|
673
|
+
return unrecognizedPackageInValue(binding.value, env, depth + 1);
|
|
674
|
+
return null;
|
|
675
|
+
case 'function':
|
|
676
|
+
case 'method':
|
|
677
|
+
if (binding.returnTypeText) {
|
|
678
|
+
return unrecognizedPackageInType(firstReturnType(binding.returnTypeText), env);
|
|
679
|
+
}
|
|
680
|
+
return null;
|
|
681
|
+
default:
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Why a Go root classified `unproven` stayed unresolved — the Go-specific reason
|
|
687
|
+
* behind `goResolution.resolveRoot`. Where the generic `describeUnprovenCause`
|
|
688
|
+
* reports a qualified type as "indeterminate", this names the package the type
|
|
689
|
+
* *does* resolve to when that package is absent from the database-packages
|
|
690
|
+
* manifest: `*ent.Client` is not indeterminate — it resolves to `entgo.io/ent`,
|
|
691
|
+
* which the manifest simply does not list (Spec 70 R4 — an unrecognized package
|
|
692
|
+
* reached by resolution is an honest unknown, not a guessed clean).
|
|
693
|
+
*
|
|
694
|
+
* @param root the receiver's base identifier being described.
|
|
695
|
+
* @param env the file's Go resolution environment (provenance, bindings, imports).
|
|
696
|
+
* @returns a human-readable reason the root stayed `unproven`.
|
|
697
|
+
*/
|
|
698
|
+
export function describeGoUnprovenCause(root, env) {
|
|
699
|
+
if (env.provenance.has(root))
|
|
700
|
+
return 'resolved to a DB handle (misclassified)';
|
|
701
|
+
const binding = env.bindings.get(root) ?? env.packageBindings?.get(root);
|
|
702
|
+
if (!binding)
|
|
703
|
+
return 'has no binding in the file scope chain';
|
|
704
|
+
const pkg = unrecognizedPackageOf(binding, env);
|
|
705
|
+
if (pkg) {
|
|
706
|
+
return `resolves to \`${pkg}\` — an unrecognized package (not in the database-packages manifest)`;
|
|
707
|
+
}
|
|
708
|
+
switch (binding.kind) {
|
|
709
|
+
case 'import':
|
|
710
|
+
return `imports from '${binding.source ?? '?'}' — an unrecognized package (not in the database-packages manifest)`;
|
|
711
|
+
case 'parameter':
|
|
712
|
+
return binding.typeText ? `parameter type \`${binding.typeText}\` is indeterminate` : 'is an un-annotated parameter';
|
|
713
|
+
case 'variable':
|
|
714
|
+
if (binding.typeText)
|
|
715
|
+
return `declared type \`${binding.typeText}\` is indeterminate`;
|
|
716
|
+
return binding.value ? 'is an un-annotated factory return' : 'is an un-annotated declaration';
|
|
717
|
+
case 'field':
|
|
718
|
+
if (binding.typeText)
|
|
719
|
+
return `field type \`${binding.typeText}\` is indeterminate`;
|
|
720
|
+
return binding.value ? 'is an un-annotated field initializer' : 'is an un-annotated struct field';
|
|
721
|
+
case 'function':
|
|
722
|
+
case 'method':
|
|
723
|
+
return 'is a function reference without a DB return type';
|
|
724
|
+
case 'type':
|
|
725
|
+
return 'is a local type name';
|
|
726
|
+
default:
|
|
727
|
+
return 'is indeterminate';
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
// ── Within-file provenance ───────────────────────────────────────────────────
|
|
731
|
+
/**
|
|
732
|
+
* The Go within-file provenance: seed DB package names (`sql` for
|
|
733
|
+
* `database/sql`) plus every binding whose type/value resolves to a DB handle.
|
|
734
|
+
* `packageBindings` (optional) carries package-scope declarations from *other*
|
|
735
|
+
* files in the same package, so `router := New()` resolves `New`'s return type
|
|
736
|
+
* (`*Engine` → not-a-handle) instead of falling back to `unproven`.
|
|
737
|
+
*
|
|
738
|
+
* @param ast the parsed Go file AST
|
|
739
|
+
* @param adapter the language adapter used to walk nodes
|
|
740
|
+
* @param sourceCode the file source text for reading node text
|
|
741
|
+
* @param packageBindings package-scope declarations from sibling files (optional)
|
|
742
|
+
* @returns the name → provenance-evidence map of DB handles resolved in this file
|
|
743
|
+
*/
|
|
744
|
+
export function buildGoWithinFileProvenance(ast, adapter, sourceCode, packageBindings) {
|
|
745
|
+
const imports = buildGoImportMap(ast, adapter);
|
|
746
|
+
const bindings = buildGoBindingEnv(ast, adapter, sourceCode);
|
|
747
|
+
return classifyGoBindings(imports, bindings, packageBindings);
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* The corpus-side, no-AST arm of {@link buildGoWithinFileProvenance}: seed DB
|
|
751
|
+
* package names then classify every binding against the (already-extracted)
|
|
752
|
+
* imports + bindings + package-scope declarations. This is the functional
|
|
753
|
+
* half — it reads only the serializable maps, so the receiver-provenance corpus
|
|
754
|
+
* producer (Spec 70 Item 4) can finalize a Go file's within-file provenance once
|
|
755
|
+
* its sibling package-scope symbols are known, without re-holding the AST.
|
|
756
|
+
*
|
|
757
|
+
* @param imports package-name → import path for the file
|
|
758
|
+
* @param bindings the file's name → binding environment (from `buildGoBindingEnv`)
|
|
759
|
+
* @param packageBindings package-scope declarations from sibling `.go` files
|
|
760
|
+
* @returns the name → provenance-evidence map of DB handles resolved in this file
|
|
761
|
+
*/
|
|
762
|
+
export function classifyGoBindings(imports, bindings, packageBindings) {
|
|
763
|
+
const env = {
|
|
764
|
+
provenance: new Map(),
|
|
765
|
+
bindings,
|
|
766
|
+
imports,
|
|
767
|
+
packageBindings,
|
|
768
|
+
};
|
|
769
|
+
const prov = new Map();
|
|
770
|
+
for (const [pkgName, source] of imports) {
|
|
771
|
+
if (GO_DB_PACKAGES.has(source)) {
|
|
772
|
+
prov.set(pkgName, {
|
|
773
|
+
identifier: pkgName,
|
|
774
|
+
reason: 'package',
|
|
775
|
+
source: `import ${source}`,
|
|
776
|
+
chain: [],
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
for (const [name, binding] of bindings) {
|
|
781
|
+
let disposition = 'unproven';
|
|
782
|
+
if (binding.typeText)
|
|
783
|
+
disposition = classifyGoTypeText(binding.typeText, env, 0);
|
|
784
|
+
else if (binding.value)
|
|
785
|
+
disposition = classifyGoValue(binding.value, env, 0);
|
|
786
|
+
if (disposition === 'handle') {
|
|
787
|
+
prov.set(name, {
|
|
788
|
+
identifier: name,
|
|
789
|
+
reason: 'binding',
|
|
790
|
+
source: binding.typeText
|
|
791
|
+
? `declared ${binding.typeText}`
|
|
792
|
+
: 'declared as a DB handle',
|
|
793
|
+
chain: [],
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
return prov;
|
|
798
|
+
}
|
|
799
|
+
//# sourceMappingURL=goResolution.js.map
|