code-auditor-mcp 5.0.2 → 5.3.3
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 +326 -3
- package/README.md +24 -2
- package/configs/hhra-compat.json +12 -118
- package/dist/analyzers/cross-language/DependencyGraphBuilder.d.ts.map +1 -1
- package/dist/analyzers/cross-language/DependencyGraphBuilder.js +11 -1
- package/dist/analyzers/cross-language/DependencyGraphBuilder.js.map +1 -1
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.js +57 -52
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.js.map +1 -1
- package/dist/analyzers/provenance.d.ts +9 -4
- package/dist/analyzers/provenance.d.ts.map +1 -1
- package/dist/analyzers/provenance.js +8 -25
- package/dist/analyzers/provenance.js.map +1 -1
- package/dist/analyzers/reactAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/reactAnalyzer.js +35 -14
- package/dist/analyzers/reactAnalyzer.js.map +1 -1
- package/dist/analyzers/ruleRegistry.js +4 -4
- package/dist/analyzers/ruleRegistry.js.map +1 -1
- package/dist/analyzers/ruleTiming.d.ts +1 -1
- package/dist/analyzers/ruleTiming.js +2 -2
- package/dist/analyzers/ruleTiming.js.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js +22 -26
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.d.ts +0 -2
- package/dist/analyzers/universal/UniversalDRYAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js +4 -5
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts +32 -15
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js +189 -115
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.d.ts +0 -2
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.js +0 -5
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts +2 -10
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js +7 -49
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/schema/codeAnalysis.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/codeAnalysis.js +51 -3
- package/dist/analyzers/universal/schema/codeAnalysis.js.map +1 -1
- package/dist/analyzers/universal/schema/config.d.ts.map +1 -1
- package/dist/analyzers/universal/schema/config.js +0 -2
- package/dist/analyzers/universal/schema/config.js.map +1 -1
- package/dist/analyzers/universal/schema/types.d.ts +0 -2
- package/dist/analyzers/universal/schema/types.d.ts.map +1 -1
- package/dist/analyzers/vendorSurfaces.d.ts +126 -0
- package/dist/analyzers/vendorSurfaces.d.ts.map +1 -0
- package/dist/analyzers/vendorSurfaces.js +580 -0
- package/dist/analyzers/vendorSurfaces.js.map +1 -0
- package/dist/auditRunner.d.ts +9 -1
- package/dist/auditRunner.d.ts.map +1 -1
- package/dist/auditRunner.js +198 -146
- package/dist/auditRunner.js.map +1 -1
- package/dist/cacheGc.d.ts +88 -0
- package/dist/cacheGc.d.ts.map +1 -0
- package/dist/cacheGc.js +196 -0
- package/dist/cacheGc.js.map +1 -0
- package/dist/churn/churnExtractor.d.ts +0 -1
- package/dist/churn/churnExtractor.d.ts.map +1 -1
- package/dist/churn/churnExtractor.js +2 -4
- package/dist/churn/churnExtractor.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +260 -47
- package/dist/cli.js.map +1 -1
- package/dist/codeIndex/migrations.d.ts.map +1 -1
- package/dist/codeIndex/migrations.js +4 -3
- package/dist/codeIndex/migrations.js.map +1 -1
- package/dist/codeIndexDB.d.ts +11 -2
- package/dist/codeIndexDB.d.ts.map +1 -1
- package/dist/codeIndexDB.js +27 -2
- package/dist/codeIndexDB.js.map +1 -1
- package/dist/config/configLoader.d.ts +60 -7
- package/dist/config/configLoader.d.ts.map +1 -1
- package/dist/config/configLoader.js +252 -60
- package/dist/config/configLoader.js.map +1 -1
- package/dist/config/defaults.d.ts +137 -43
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +174 -101
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/effectiveConfig.d.ts +1 -1
- package/dist/config/effectiveConfig.d.ts.map +1 -1
- package/dist/config/effectiveConfig.js +4 -6
- package/dist/config/effectiveConfig.js.map +1 -1
- package/dist/config/pathProfiles.d.ts +4 -3
- package/dist/config/pathProfiles.d.ts.map +1 -1
- package/dist/config/pathProfiles.js +3 -2
- package/dist/config/pathProfiles.js.map +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -1
- package/dist/daemon/main.d.ts +0 -1
- package/dist/daemon/main.d.ts.map +1 -1
- package/dist/daemon/main.js +11 -4
- package/dist/daemon/main.js.map +1 -1
- package/dist/dataPaths.d.ts +32 -9
- package/dist/dataPaths.d.ts.map +1 -1
- package/dist/dataPaths.js +69 -16
- package/dist/dataPaths.js.map +1 -1
- package/dist/hookLog.d.ts +54 -0
- package/dist/hookLog.d.ts.map +1 -0
- package/dist/hookLog.js +105 -0
- package/dist/hookLog.js.map +1 -0
- package/dist/hookLogPath.generated.d.ts +3 -0
- package/dist/hookLogPath.generated.d.ts.map +1 -0
- package/dist/hookLogPath.generated.js +8 -0
- package/dist/hookLogPath.generated.js.map +1 -0
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/dist/installConfig.d.ts +15 -2
- package/dist/installConfig.d.ts.map +1 -1
- package/dist/installConfig.js +17 -2
- package/dist/installConfig.js.map +1 -1
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +2 -1
- package/dist/installer.js.map +1 -1
- package/dist/languages/adapterBridge.d.ts +11 -0
- package/dist/languages/adapterBridge.d.ts.map +1 -1
- package/dist/languages/adapterBridge.js +11 -0
- package/dist/languages/adapterBridge.js.map +1 -1
- package/dist/languages/types.d.ts +8 -0
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts +13 -0
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js +135 -18
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js.map +1 -1
- package/dist/ledger.d.ts +7 -0
- package/dist/ledger.d.ts.map +1 -1
- package/dist/ledger.js +7 -0
- package/dist/ledger.js.map +1 -1
- package/dist/mcp-tools/workflowGuide.js +8 -8
- package/dist/mcp-tools/workflowGuide.js.map +1 -1
- package/dist/mcp-tools-shared.d.ts.map +1 -1
- package/dist/mcp-tools-shared.js +5 -2
- package/dist/mcp-tools-shared.js.map +1 -1
- package/dist/mcp-ui-simple.d.ts +5 -0
- package/dist/mcp-ui-simple.d.ts.map +1 -1
- package/dist/mcp-ui-simple.js +9 -2
- package/dist/mcp-ui-simple.js.map +1 -1
- package/dist/mcp.d.ts +0 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +36 -33
- package/dist/mcp.js.map +1 -1
- package/dist/mcpAuditJobs.d.ts +10 -0
- package/dist/mcpAuditJobs.d.ts.map +1 -1
- package/dist/mcpAuditJobs.js +10 -1
- package/dist/mcpAuditJobs.js.map +1 -1
- package/dist/mcpAutoIndex.d.ts.map +1 -1
- package/dist/mcpAutoIndex.js +2 -1
- package/dist/mcpAutoIndex.js.map +1 -1
- package/dist/mcpDiagnostics.d.ts +2 -0
- package/dist/mcpDiagnostics.d.ts.map +1 -1
- package/dist/mcpDiagnostics.js +2 -0
- package/dist/mcpDiagnostics.js.map +1 -1
- package/dist/phase/candidates.d.ts +53 -0
- package/dist/phase/candidates.d.ts.map +1 -0
- package/dist/phase/candidates.js +67 -0
- package/dist/phase/candidates.js.map +1 -0
- package/dist/phase/colorMath.d.ts +18 -5
- package/dist/phase/colorMath.d.ts.map +1 -1
- package/dist/phase/colorMath.js +88 -5
- package/dist/phase/colorMath.js.map +1 -1
- package/dist/phase/dataAccessCallsCandidates.js +1 -1
- package/dist/phase/dataAccessCallsCandidates.js.map +1 -1
- package/dist/phase/goFunctionAnalysis.d.ts +2 -2
- package/dist/phase/goFunctionAnalysis.js +2 -2
- package/dist/phase/goFunctions.d.ts +2 -2
- package/dist/phase/goFunctions.js +2 -2
- package/dist/phase/goImports.d.ts +2 -2
- package/dist/phase/goImports.js +2 -2
- package/dist/phase/goSwitches.d.ts +2 -2
- package/dist/phase/goSwitches.js +2 -2
- package/dist/phase/imports.d.ts.map +1 -1
- package/dist/phase/imports.js +1 -0
- package/dist/phase/imports.js.map +1 -1
- package/dist/phase/loopQueryCandidates.js +1 -1
- package/dist/phase/loopQueryCandidates.js.map +1 -1
- package/dist/phase/oracles.d.ts +28 -0
- package/dist/phase/oracles.d.ts.map +1 -1
- package/dist/phase/oracles.js +28 -0
- package/dist/phase/oracles.js.map +1 -1
- package/dist/phase/phaseModel.d.ts +47 -8
- package/dist/phase/phaseModel.d.ts.map +1 -1
- package/dist/phase/phaseModel.js +44 -8
- package/dist/phase/phaseModel.js.map +1 -1
- package/dist/phase/producers.d.ts.map +1 -1
- package/dist/phase/producers.js +24 -17
- package/dist/phase/producers.js.map +1 -1
- package/dist/phase/reachability.d.ts +44 -1
- package/dist/phase/reachability.d.ts.map +1 -1
- package/dist/phase/reachability.js +79 -0
- package/dist/phase/reachability.js.map +1 -1
- package/dist/phase/rules/conventions.d.ts.map +1 -1
- package/dist/phase/rules/conventions.js +6 -2
- package/dist/phase/rules/conventions.js.map +1 -1
- package/dist/phase/rules/crossDomain.d.ts.map +1 -1
- package/dist/phase/rules/crossDomain.js +16 -6
- package/dist/phase/rules/crossDomain.js.map +1 -1
- package/dist/phase/rules/dataAccess.d.ts.map +1 -1
- package/dist/phase/rules/dataAccess.js +13 -0
- package/dist/phase/rules/dataAccess.js.map +1 -1
- package/dist/phase/rules/documentation.d.ts.map +1 -1
- package/dist/phase/rules/documentation.js +11 -1
- package/dist/phase/rules/documentation.js.map +1 -1
- package/dist/phase/rules/dry.d.ts +16 -7
- package/dist/phase/rules/dry.d.ts.map +1 -1
- package/dist/phase/rules/dry.js +51 -32
- package/dist/phase/rules/dry.js.map +1 -1
- package/dist/phase/rules/goRules.d.ts +2 -2
- package/dist/phase/rules/goRules.js +2 -2
- package/dist/phase/rules/secrets.d.ts +22 -8
- package/dist/phase/rules/secrets.d.ts.map +1 -1
- package/dist/phase/rules/secrets.js +75 -69
- package/dist/phase/rules/secrets.js.map +1 -1
- package/dist/phase/rules/styles.d.ts +23 -9
- package/dist/phase/rules/styles.d.ts.map +1 -1
- package/dist/phase/rules/styles.js +61 -15
- package/dist/phase/rules/styles.js.map +1 -1
- package/dist/phase/rules/unreferencedModule.d.ts.map +1 -1
- package/dist/phase/rules/unreferencedModule.js +32 -10
- package/dist/phase/rules/unreferencedModule.js.map +1 -1
- package/dist/phase/runner.d.ts +16 -7
- package/dist/phase/runner.d.ts.map +1 -1
- package/dist/phase/runner.js +32 -20
- package/dist/phase/runner.js.map +1 -1
- package/dist/phase/stringLiterals.d.ts.map +1 -1
- package/dist/phase/stringLiterals.js +16 -7
- package/dist/phase/stringLiterals.js.map +1 -1
- package/dist/phase/stylesCss.d.ts.map +1 -1
- package/dist/phase/stylesCss.js +4 -0
- package/dist/phase/stylesCss.js.map +1 -1
- package/dist/phase/stylesMarkup.d.ts.map +1 -1
- package/dist/phase/stylesMarkup.js +4 -0
- package/dist/phase/stylesMarkup.js.map +1 -1
- package/dist/phase/stylesSource.d.ts.map +1 -1
- package/dist/phase/stylesSource.js +6 -0
- package/dist/phase/stylesSource.js.map +1 -1
- package/dist/phase/testProgram.d.ts +57 -0
- package/dist/phase/testProgram.d.ts.map +1 -0
- package/dist/phase/testProgram.js +244 -0
- package/dist/phase/testProgram.js.map +1 -0
- package/dist/phase/typeDeclarations.d.ts +2 -2
- package/dist/phase/typeDeclarations.js +2 -2
- package/dist/phase/types.d.ts +104 -0
- package/dist/phase/types.d.ts.map +1 -1
- package/dist/pipeline.d.ts +4 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +4 -0
- package/dist/pipeline.js.map +1 -1
- package/dist/pipelineAdapters.d.ts +1 -171
- package/dist/pipelineAdapters.d.ts.map +1 -1
- package/dist/pipelineAdapters.js +47 -1281
- package/dist/pipelineAdapters.js.map +1 -1
- package/dist/reporting/csvReportGenerator.d.ts.map +1 -1
- package/dist/reporting/csvReportGenerator.js +0 -6
- package/dist/reporting/csvReportGenerator.js.map +1 -1
- package/dist/reporting/htmlReportGenerator.d.ts.map +1 -1
- package/dist/reporting/htmlReportGenerator.js +0 -4
- package/dist/reporting/htmlReportGenerator.js.map +1 -1
- package/dist/reporting/jsonReportGenerator.d.ts.map +1 -1
- package/dist/reporting/jsonReportGenerator.js +0 -1
- package/dist/reporting/jsonReportGenerator.js.map +1 -1
- package/dist/reporting/sarifReportGenerator.d.ts.map +1 -1
- package/dist/reporting/sarifReportGenerator.js +0 -7
- package/dist/reporting/sarifReportGenerator.js.map +1 -1
- package/dist/services/auditJobService.d.ts +15 -0
- package/dist/services/auditJobService.d.ts.map +1 -1
- package/dist/services/auditJobService.js +15 -0
- package/dist/services/auditJobService.js.map +1 -1
- package/dist/services/projectTaskHelpers.d.ts +7 -0
- package/dist/services/projectTaskHelpers.d.ts.map +1 -1
- package/dist/services/projectTaskHelpers.js +7 -0
- package/dist/services/projectTaskHelpers.js.map +1 -1
- package/dist/services/whitelistService.d.ts +28 -0
- package/dist/services/whitelistService.d.ts.map +1 -1
- package/dist/services/whitelistService.js +28 -0
- package/dist/services/whitelistService.js.map +1 -1
- package/dist/sqlite/driver.d.ts +17 -1
- package/dist/sqlite/driver.d.ts.map +1 -1
- package/dist/sqlite/driver.js +28 -5
- package/dist/sqlite/driver.js.map +1 -1
- package/dist/styles/cssInJsHarvest.d.ts +36 -0
- package/dist/styles/cssInJsHarvest.d.ts.map +1 -0
- package/dist/styles/cssInJsHarvest.js +78 -0
- package/dist/styles/cssInJsHarvest.js.map +1 -0
- package/dist/styles/definedClasses.d.ts +95 -0
- package/dist/styles/definedClasses.d.ts.map +1 -0
- package/dist/styles/definedClasses.js +129 -0
- package/dist/styles/definedClasses.js.map +1 -0
- package/dist/styles/markupStyleHarvest.d.ts +33 -0
- package/dist/styles/markupStyleHarvest.d.ts.map +1 -0
- package/dist/styles/markupStyleHarvest.js +73 -0
- package/dist/styles/markupStyleHarvest.js.map +1 -0
- package/dist/styles/styleExtractor.d.ts +37 -0
- package/dist/styles/styleExtractor.d.ts.map +1 -1
- package/dist/styles/styleExtractor.js +89 -33
- package/dist/styles/styleExtractor.js.map +1 -1
- package/dist/styles/styleIndexer.d.ts.map +1 -1
- package/dist/styles/styleIndexer.js +11 -10
- package/dist/styles/styleIndexer.js.map +1 -1
- package/dist/styles/tailwindExpander.d.ts.map +1 -1
- package/dist/styles/tailwindExpander.js +31 -10
- package/dist/styles/tailwindExpander.js.map +1 -1
- package/dist/styles/tailwindUtilityExpander.d.ts +4 -0
- package/dist/styles/tailwindUtilityExpander.d.ts.map +1 -1
- package/dist/styles/tailwindUtilityExpander.js +4 -0
- package/dist/styles/tailwindUtilityExpander.js.map +1 -1
- package/dist/telemetry.d.ts +67 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +100 -20
- package/dist/telemetry.js.map +1 -1
- package/dist/types/crossLanguage.d.ts +1 -0
- package/dist/types/crossLanguage.d.ts.map +1 -1
- package/dist/types.d.ts +73 -56
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -4
- package/dist/types.js.map +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/examples/.auditrc.example.json +7 -22
- package/examples/.auditrc.json +12 -155
- package/examples/.code-auditor.json +8 -51
- package/examples/nextjs.auditrc.json +7 -34
- package/examples/node-api.auditrc.json +6 -46
- package/examples/react.auditrc.json +8 -25
- package/examples/tolerant-solid.auditrc.json +12 -44
- package/package.json +8 -5
- package/plugin/.claude-plugin/manifest.json +10 -9
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +4 -4
- package/plugin/scripts/hook-audit.sh +25 -10
- package/plugin/scripts/hook-common.sh +12 -7
- package/plugin/scripts/hook-drift-check.sh +10 -1
- package/plugin/scripts/hook-log-path.sh +7 -0
- package/plugin/scripts/hook-self-audit.sh +21 -6
- package/plugin/scripts/hook-warm.sh +17 -11
- package/plugin/skills/code-auditor/SKILL.md +26 -3
- package/server.json +2 -2
- package/dist/__tests__/fixtures/spec-20/scripts/tool.d.ts +0 -6
- package/dist/__tests__/fixtures/spec-20/scripts/tool.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-20/scripts/tool.js +0 -12
- package/dist/__tests__/fixtures/spec-20/scripts/tool.js.map +0 -1
- package/dist/__tests__/fixtures/spec-20/src/demo-module.d.ts +0 -7
- package/dist/__tests__/fixtures/spec-20/src/demo-module.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-20/src/demo-module.js +0 -13
- package/dist/__tests__/fixtures/spec-20/src/demo-module.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-01-prepare-in-loop.d.ts +0 -14
- package/dist/__tests__/fixtures/spec-52/item-01-prepare-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-01-prepare-in-loop.js +0 -16
- package/dist/__tests__/fixtures/spec-52/item-01-prepare-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-02-prepare-bind-accumulate-batch.d.ts +0 -15
- package/dist/__tests__/fixtures/spec-52/item-02-prepare-bind-accumulate-batch.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-02-prepare-bind-accumulate-batch.js +0 -17
- package/dist/__tests__/fixtures/spec-52/item-02-prepare-bind-accumulate-batch.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.d.ts +0 -14
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.js +0 -19
- package/dist/__tests__/fixtures/spec-52/item-03-exec-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.d.ts +0 -18
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.js +0 -19
- package/dist/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-05-upsert-forms.d.ts +0 -19
- package/dist/__tests__/fixtures/spec-52/item-05-upsert-forms.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-05-upsert-forms.js +0 -19
- package/dist/__tests__/fixtures/spec-52/item-05-upsert-forms.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.d.ts +0 -17
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.js +0 -19
- package/dist/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.d.ts +0 -25
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.js +0 -21
- package/dist/__tests__/fixtures/spec-52/item-07-chained-prepare-bind-first-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-08-promise-all-of-statements-in-loop.d.ts +0 -15
- package/dist/__tests__/fixtures/spec-52/item-08-promise-all-of-statements-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-08-promise-all-of-statements-in-loop.js +0 -19
- package/dist/__tests__/fixtures/spec-52/item-08-promise-all-of-statements-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-09-promise-all-map-of-statements-in-loop.d.ts +0 -14
- package/dist/__tests__/fixtures/spec-52/item-09-promise-all-map-of-statements-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-09-promise-all-map-of-statements-in-loop.js +0 -14
- package/dist/__tests__/fixtures/spec-52/item-09-promise-all-map-of-statements-in-loop.js.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.d.ts +0 -15
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.d.ts.map +0 -1
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.js +0 -16
- package/dist/__tests__/fixtures/spec-52/item-10-promise-all-map-of-eager-all-in-loop.js.map +0 -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 +0 -643
- package/dist/languages/go/analyzer-src/dataaccess.go +0 -388
- package/dist/languages/go/analyzer-src/go.mod +0 -3
- package/dist/languages/go/analyzer-src/indexer.go +0 -268
- package/dist/languages/go/analyzer-src/parser.go +0 -461
- package/dist/languages/go/analyzer-src/solid.go +0 -311
- package/dist/languages/go/analyzer-src/testconventions.go +0 -25
- package/dist/languages/go/analyzer-src/types.go +0 -156
- package/dist/languages/go/analyzer-windows-amd64.exe +0 -0
- package/dist/languages/go/go.mod +0 -7
- package/dist/languages/go/main.go +0 -203
- package/dist/native/ast-grep-napi.darwin-arm64.node +0 -0
- package/dist/native/ast-grep-napi.darwin-x64.node +0 -0
- package/dist/native/ast-grep-napi.linux-arm64-gnu.node +0 -0
- package/dist/native/ast-grep-napi.linux-arm64-musl.node +0 -0
- package/dist/native/ast-grep-napi.linux-x64-gnu.node +0 -0
- package/dist/native/ast-grep-napi.linux-x64-musl.node +0 -0
- package/dist/native/ast-grep-napi.win32-x64-msvc.node +0 -0
- package/dist/native-bootstrap.d.ts +0 -15
- package/dist/native-bootstrap.d.ts.map +0 -1
- package/dist/native-bootstrap.js +0 -75
- package/dist/native-bootstrap.js.map +0 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "code-auditor",
|
|
11
11
|
"source": "./plugin",
|
|
12
12
|
"description": "Diff-scoped code quality auditing on every edit. Indexes your codebase, enforces invariants, and feeds violations back to the agent so fixes happen inline.",
|
|
13
|
-
"version": "5.
|
|
13
|
+
"version": "5.3.3",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Ben Hammond"
|
|
16
16
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,331 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the Code Auditor MCP project.
|
|
4
4
|
|
|
5
|
+
## [5.3.3] — 2026-10-18
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **`dry/structural-similarity` now runs unconditionally in every path — the
|
|
10
|
+
dead `checkStructuralSimilarity` key is gone, not just unread.** The migrated
|
|
11
|
+
phase rule has ignored the key since the phase migration, but the legacy
|
|
12
|
+
`UniversalDRYAnalyzer` still read it and defaulted it off, so a config that
|
|
13
|
+
never mentioned it silently skipped the structural arm on that path. The key
|
|
14
|
+
(default, interface field, and reader) is deleted entirely, and both paths now
|
|
15
|
+
run the structural comparison unconditionally — the surviving, correct
|
|
16
|
+
behaviour. This is a **behaviour change, not a dead-key cleanup**: every user
|
|
17
|
+
whose config didn't explicitly enable structural similarity now sees
|
|
18
|
+
`dry/structural-similarity` findings they didn't before. At the default
|
|
19
|
+
`similarityThreshold: 0.85` that is 416 findings across the seven bench
|
|
20
|
+
corpora, concentrated in generated/repetitive code rather than hand-written
|
|
21
|
+
duplication. The threshold is unchanged: dropping it to catch the
|
|
22
|
+
`mergeClusters`/`splitCluster` near-twin in `endless-guessing` (31 lines each,
|
|
23
|
+
0.6494 bigram-Jaccard — well under 0.85) would add ~226 findings (a ~54%
|
|
24
|
+
increase) without meaningfully separating real duplication from template
|
|
25
|
+
repetition, so 0.85 stays.
|
|
26
|
+
|
|
27
|
+
## [5.3.2] — 2026-10-18
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **`function-documentation`'s `docsMinLines` floor was removed entirely in
|
|
32
|
+
5.3.1 instead of scoped.** The floor is restored and applies to non-exported
|
|
33
|
+
functions only: an exported function with no doc comment is flagged at any
|
|
34
|
+
length (a one-line exported predicate is still part of the surface callers
|
|
35
|
+
import), while an unexported helper under the floor is below the bar. This keeps
|
|
36
|
+
the 5.3.1 intent — short exports like `hasRejectedTerm` are no longer swallowed —
|
|
37
|
+
without turning internal one-line helpers into documentation findings.
|
|
38
|
+
- **`react` inline-function-prop gated only the `onClick` arm and missed
|
|
39
|
+
hyphenated custom elements.** The `isIntrinsicElement` discriminant now lives in
|
|
40
|
+
the shared inline-handler classifier so every `on*` handler prop goes through it,
|
|
41
|
+
and the tag predicate accepts hyphenated custom-element names (`<my-widget>`) as
|
|
42
|
+
intrinsic host elements.
|
|
43
|
+
- **`BUILTIN_PATH_PROFILES` was left as an empty list instead of removed.** An
|
|
44
|
+
empty list invites the neighbouring reading "there are built-ins, there just
|
|
45
|
+
happen to be zero today"; the built-in merge and name-replacement machinery is
|
|
46
|
+
now deleted entirely, and the project-config path-profile mechanism is unchanged.
|
|
47
|
+
- **`dry/structural-similarity` lacked an end-to-end pin.** Added an e2e check that
|
|
48
|
+
two functions sharing the same five-step transactional body report a
|
|
49
|
+
structural-similarity finding. The rule seeds unconditionally — `checkStructuralSimilarity`
|
|
50
|
+
defaults to `false` but is no longer read by the migrated rule, so the zero a
|
|
51
|
+
bare-config run produces comes from `minLineThreshold` / `similarityThreshold`,
|
|
52
|
+
not a default-off switch.
|
|
53
|
+
- **The cache GC deleted directories silently.** The prune of superseded CLI copies
|
|
54
|
+
and abandoned project indexes ran fire-and-forget with its result discarded, so a
|
|
55
|
+
user whose index vanished could not see that the tool collected it. The audit
|
|
56
|
+
output now reports what the GC collected on that run.
|
|
57
|
+
|
|
58
|
+
## [5.3.1] — 2026-10-17
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- **`react` inline-function-prop fired on intrinsic DOM elements.** The rule
|
|
63
|
+
reports an inline `onClick={() => …}` only because a fresh reference each render
|
|
64
|
+
defeats a *memoized* component's memoization. An intrinsic element (`<button>`,
|
|
65
|
+
`<div>`) is never memoized, so the old check — which fired on any inline prop
|
|
66
|
+
regardless of receiver — was 12/12 false on the fixture. It now keys on the
|
|
67
|
+
receiver's tag name and skips intrinsic elements.
|
|
68
|
+
- **`duplicate-import` flagged a type-only import as a duplicate of a value
|
|
69
|
+
import.** `import type { X } from 'm'` beside `import { Y } from 'm'` is a
|
|
70
|
+
separate declaration kind (erases at compile time, emits no runtime binding), so
|
|
71
|
+
the two never collide. The import fact now carries `isTypeOnly`, and the rule
|
|
72
|
+
groups on `source` + import kind instead of `source` alone.
|
|
73
|
+
- **`sql-injection-risk` missed two declaration shapes.** A `for (const t of
|
|
74
|
+
['a', 'b'])` inline-literal iterable is now resolved as a static value (every
|
|
75
|
+
loop value is a compile-time constant), and a bare `if (!/regex/.test(x)) throw`
|
|
76
|
+
whitelist guard is now recognised as the inline analogue of a `validateX(x)`
|
|
77
|
+
guard call — both previously left a substitution reading as attacker-controlled.
|
|
78
|
+
- **`duplicate-string-literal` flagged repeated markup attribute values.** An
|
|
79
|
+
SVG/JSX attribute value (`fill="var(--fleece)"`) is markup, not a factorable
|
|
80
|
+
code literal; the producer now marks it `isMarkupAttribute` from the node's
|
|
81
|
+
`jsx_attribute` parent, and the rule skips it.
|
|
82
|
+
- **`conventions/error-handling` reported an opaque confidence percentage.** The
|
|
83
|
+
message named `N%` without naming the population the percentage was over. It now
|
|
84
|
+
states the raw counts (`X of Y error-handling functions in this directory`), so
|
|
85
|
+
the reader can size the population instead of an unreproducible figure.
|
|
86
|
+
- **A compiled-in "scripts-and-tests" profile silently excluded scripts, tests,
|
|
87
|
+
and fixtures from the blocking gate.** That is a hand-maintained exemption list
|
|
88
|
+
baked into the binary — the same defect as a suppression file, just shipped.
|
|
89
|
+
`BUILTIN_PATH_PROFILES` is now empty; scripts/tests/fixtures gate like any other
|
|
90
|
+
file unless a team declares an explicit opt-out in its own `.codeauditor.json`.
|
|
91
|
+
- **`dry/structural-similarity` pairs were only seeded behind
|
|
92
|
+
`checkStructuralSimilarity`.** §10 made config *tune* similarity, never *select*
|
|
93
|
+
which pairs the divergence tracker sees, so the migrated rule runs unconditionally
|
|
94
|
+
but the seed still gated — leaving `dry/diverging-clone` with no sub-1.0 rows to
|
|
95
|
+
observe a decline from. Structural pairs now seed unconditionally.
|
|
96
|
+
- **`function-documentation` skipped short exported functions via a
|
|
97
|
+
`docsMinLines` size floor.** The floor answered "is this function long enough to
|
|
98
|
+
matter?" instead of the rule's own "is this function undocumented?", swallowing
|
|
99
|
+
short-but-real exports like `hasRejectedTerm`. The size gate is removed (it
|
|
100
|
+
survives only in the param/return *tag* completeness check).
|
|
101
|
+
- **The `schema` unproven-site total surfaced nowhere as per-rule risk.** 465 raw
|
|
102
|
+
`cannot-fire` sites reported as a single analyzer total, hiding which rule may
|
|
103
|
+
have under-reported. Each site now carries its `affectedRules` and `cause`, and
|
|
104
|
+
`summary.unprovenSitesByRule` plus a CLI breakdown surface them per rule.
|
|
105
|
+
- **The tool's own cache grew without bound.** Superseded pinned-CLI copies
|
|
106
|
+
(`cli/<version>`) and abandoned project indexes (`projects/<hash>`) accumulated
|
|
107
|
+
under the fallback OS cache with no reaping. A two-layer GC now prunes pinned-CLI
|
|
108
|
+
copies whose version differs from the running one and project indexes older than
|
|
109
|
+
30 days — process-scoped, fire-and-forget, and never touching a user
|
|
110
|
+
`CODE_AUDITOR_DATA_DIR` or the consuming repo.
|
|
111
|
+
|
|
112
|
+
## [5.3.0] — 2026-10-17
|
|
113
|
+
|
|
114
|
+
### Changed
|
|
115
|
+
|
|
116
|
+
- **`verify:gate-budget` now asserts deterministic work, not CPU time.** The
|
|
117
|
+
blocking gate's budget was a CPU-time figure that jittered with machine load
|
|
118
|
+
under `verify:close`'s own sustained load. It now asserts a receiver-resolution
|
|
119
|
+
count, single-sourced in `src/config/defaults.ts` and read by both the CLI and the
|
|
120
|
+
verifier, so they can never drift. The wall/CPU-time measurement moved to
|
|
121
|
+
`bench/gate-timing.mjs` as a measurement (always exits 0), not a gate.
|
|
122
|
+
- **The CLI's displayed budget reads the single source.** The `cli.ts` display
|
|
123
|
+
literal now reads `gateBudgetResolutions()` instead of a hard-coded number.
|
|
124
|
+
- **The gate budget's env knob is single-sourced and liveness-pinned.**
|
|
125
|
+
`CODE_AUDITOR_GATE_BUDGET_RESOLUTIONS` (with `0` as a valid "always fail"
|
|
126
|
+
override) is in the env-tunable single-source test and drives the gate-liveness
|
|
127
|
+
test, so a re-expressed gate that stopped tripping is caught, not silently
|
|
128
|
+
skipped.
|
|
129
|
+
|
|
130
|
+
### Fixed
|
|
131
|
+
|
|
132
|
+
**A clean install of 5.2.0 did not run 5.2.0 — the shipped manifests pinned a
|
|
133
|
+
stale CLI version.** `server.json` (the MCP-server manifest) declared
|
|
134
|
+
`code-auditor-mcp@5.0.2` while `package.json` and the rest of the release were
|
|
135
|
+
5.2.0, so a clean install resolved the 5.0.2 package and the plugin hook's
|
|
136
|
+
`resolve_pinned_bin` installed exactly that stale version. The three shipped JSON
|
|
137
|
+
manifests that carry the CLI version as published data — `plugin/.claude-plugin/plugin.json`
|
|
138
|
+
(the plugin manifest `hook-common.sh`'s `plugin_version()` reads),
|
|
139
|
+
`server.json` (the MCP-server manifest), and `.claude-plugin/marketplace.json`
|
|
140
|
+
(the marketplace listing) — now derive their `version` from `package.json` at
|
|
141
|
+
build time via `scripts/write-manifest-version.mjs` (run as
|
|
142
|
+
`build:manifest-version`), the same generated-file pattern as
|
|
143
|
+
`src/version.generated.ts`. `verify:version-fresh` now asserts every one of them
|
|
144
|
+
equals `package.json`, so a release that forgets to re-stamp the manifests fails
|
|
145
|
+
the gate instead of shipping a stale pin.
|
|
146
|
+
|
|
147
|
+
## [5.2.0] — 2026-10-15
|
|
148
|
+
|
|
149
|
+
### Action may be required
|
|
150
|
+
|
|
151
|
+
Four changes may require action from consumers of 5.0.x. The most prominent is
|
|
152
|
+
the stricter config loading below; the remaining three are narrow.
|
|
153
|
+
|
|
154
|
+
**Config files that loaded before now throw on unrecognized keys at any depth.**
|
|
155
|
+
`sanitizeProjectFileConfig` throws on an unknown top-level key, naming the key
|
|
156
|
+
and its live replacement where one exists (`analyzerConfig` → `analyzerConfigs`);
|
|
157
|
+
`validateAnalyzerConfigs` descends every `analyzerConfigs` key against the
|
|
158
|
+
runtime defaults and rejects a key absent at its path by full dotted location,
|
|
159
|
+
naming its live equivalent (`solid.classMethodThreshold` →
|
|
160
|
+
`solid.classMethodsThreshold`, `solid.interfaceMemberThreshold` →
|
|
161
|
+
`solid.maxInterfaceMembers`, `data-access.performanceThresholds.maxJoins` →
|
|
162
|
+
`data-access.performanceThresholds.joinedTableCount`), and a phantom namespace
|
|
163
|
+
(`component`, `security`) is rejected outright. *What a consumer must do:* a
|
|
164
|
+
`.codeauditor.json` that silently loaded under 5.0.x may now fail the audit —
|
|
165
|
+
rename or remove each key the error names, using the replacement it suggests.
|
|
166
|
+
|
|
167
|
+
**`getAvailableAnalyzers()` is removed from the public API.** The function, its
|
|
168
|
+
default-export entry, and its test pin are deleted (`src/index.ts`). Analyzer
|
|
169
|
+
selection no longer asks which analyzers exist; the analyzer list is derived
|
|
170
|
+
from the runtime config namespaces, and the MCP `config.get` / `config.set` /
|
|
171
|
+
`config.reset` tools validate `analyzerName` against that set (a phantom
|
|
172
|
+
namespace is rejected, not persisted). *What a consumer must do:* drop the
|
|
173
|
+
import and any call — there is no replacement export.
|
|
174
|
+
|
|
175
|
+
**Around twenty-five config keys are removed — every key declared in a type and
|
|
176
|
+
given a default but never read at runtime.** A user who set one previously got
|
|
177
|
+
silence; it is gone. Removed with no replacement: the top-level `outputFormats`,
|
|
178
|
+
`failOnCritical`, `showProgress`, `parallel`; the severity-gate thresholds
|
|
179
|
+
`maxSevere`, `maxCritical`, `maxHigh`, `maxWarnings`, `maxDuplication` (with
|
|
180
|
+
`maxComplexity` moving to `analyzerConfigs.solid.maxMethodComplexity`, and
|
|
181
|
+
`minHealthScore` surviving); SOLID `maxImportsPerFile`, `maxComplexity`,
|
|
182
|
+
`maxClassComplexity`; DRY `divergence.minPairSimilarity`; data-access
|
|
183
|
+
`databasePatterns`, `performanceThresholds.{maxJoins, warnOnSelectStar,
|
|
184
|
+
complexQueryCount, unfilteredQueryCount}`, `checkOrgFilters`,
|
|
185
|
+
`tablePatterns.queryBuilder`, `securityPatterns.sqlInjectionRisks`; schema
|
|
186
|
+
`detectUnusedTables`, `allowAdditionalProperties` (with `validatorPackageList`
|
|
187
|
+
moving to `analyzerConfigs.crossDomain.validatorBypass.validatorPackageList`);
|
|
188
|
+
react `detectFunctionalComponents`, `detectClassComponents`,
|
|
189
|
+
`detectMemoComponents`, `preventDirectDOMAccess`. The env tunable
|
|
190
|
+
`CODE_AUDIT_RULE_TIMING` is renamed `CODE_AUDITOR_RULE_TIMING` (no alias), and
|
|
191
|
+
the `loadFromEnvironment` / `environmentPrefix` mapping mechanism is deleted.
|
|
192
|
+
*What a consumer must do:* remove any of these keys from `.codeauditor.json` and
|
|
193
|
+
rename the env var — combined with the strict-throw change, a leftover key now
|
|
194
|
+
names itself at load instead of being silently ignored.
|
|
195
|
+
|
|
196
|
+
**The colour metric moved to CIEDE2000 (ΔE00), changing which findings a user
|
|
197
|
+
sees.** `styles/value-drift` now clusters with `ciede2000` (ΔE00) instead of
|
|
198
|
+
ΔE76, and the `styles.colorDeltaE` threshold re-derives from 2.5 to 1.0 (the
|
|
199
|
+
CIEDE2000 just-noticeable difference, Sharma–Wu–Dalal 2005); the ΔE76 value does
|
|
200
|
+
not transfer. Value-drift findings move 3 → 1 (recall-protocol only). *What a
|
|
201
|
+
consumer must do:* if you tuned `styles.colorDeltaE` or relied on value-drift
|
|
202
|
+
findings, re-derive against ΔE00 — a threshold chosen for ΔE76 means something
|
|
203
|
+
different now, and near-identical pairs that fired at ΔE76 may clear (or the
|
|
204
|
+
reverse).
|
|
205
|
+
|
|
206
|
+
### The code-index database now keys on project identity, not the working directory
|
|
207
|
+
|
|
208
|
+
The index database path was derived from `process.cwd()`, so a single project
|
|
209
|
+
audited from two different directories (a repo root and a nested folder, or a
|
|
210
|
+
symlinked path and its real path) produced two separate databases, and each new
|
|
211
|
+
invocation directory created yet another. The path now derives from the project's
|
|
212
|
+
own identity — its git root, `package.json`, or `go.mod` directory — so every
|
|
213
|
+
invocation inside one project lands on the same database.
|
|
214
|
+
|
|
215
|
+
**Earlier 5.0.x versions keyed on the working directory, and those databases are
|
|
216
|
+
still on disk under your OS cache directory.** Upgrading stops the growth but does
|
|
217
|
+
not remove what accumulated. They are a cache, never source data, so any stale
|
|
218
|
+
per-directory databases can be deleted safely. The directory is:
|
|
219
|
+
|
|
220
|
+
- macOS: `~/Library/Caches/code-auditor/projects/<hash>/index.db`
|
|
221
|
+
- Linux: `$XDG_CACHE_HOME/code-auditor/projects/<hash>/index.db` (or `~/.cache/code-auditor/...`)
|
|
222
|
+
- Windows: `%LOCALAPPDATA%\code-auditor\Cache\projects\<hash>\index.db`
|
|
223
|
+
|
|
224
|
+
(`<hash>` is the first 16 hex characters of `sha256` of the real project root;
|
|
225
|
+
the stale 5.0.x entries use the same directory but hashed the working directory.)
|
|
226
|
+
|
|
227
|
+
### `changed` reports an uncomputable diff instead of a false clean
|
|
228
|
+
|
|
229
|
+
`code-audit changed` against an index with no baseline — an empty `functions`
|
|
230
|
+
table, whether the index was never built or was discarded after corruption —
|
|
231
|
+
used to diff against nothing and report "nothing changed" (zero findings). The
|
|
232
|
+
empty diff and the no-baseline case are now distinguished at the source:
|
|
233
|
+
`detectModifiedFiles` returns `undefined` for "no baseline" and `[]` only for
|
|
234
|
+
"baseline present, nothing modified". A `changed` run in that state now reports
|
|
235
|
+
that it cannot determine what changed and names why (no index yet, or the index
|
|
236
|
+
was discarded), rather than a clean result. The corrupt-recovery path also now
|
|
237
|
+
logs one line stating the database was corrupt and rebuilt.
|
|
238
|
+
|
|
239
|
+
### `hardcoded-secret` reports on evidence, not suppression
|
|
240
|
+
|
|
241
|
+
The hardcoded-secret rule carried a set of suppression filters — a minimum value
|
|
242
|
+
length, a placeholder-word list, email/URL/camelCase shape tests, and a
|
|
243
|
+
test/fixture file skip — each of which made a finding vanish without establishing
|
|
244
|
+
anything about the site. A real credential in a test file, or a short token, or
|
|
245
|
+
an email-shaped secret was silently passed. Those filters are removed: a
|
|
246
|
+
candidate is now a secret on positive evidence only (a known token prefix, or
|
|
247
|
+
character entropy — a digit, an uppercase letter, or a hard symbol). The result
|
|
248
|
+
is more `hardcoded-secret` findings in exactly the places the old filters hid
|
|
249
|
+
them (predominantly test/fixture files and short placeholder-adjacent values).
|
|
250
|
+
|
|
251
|
+
### Verification fails closed instead of reporting green
|
|
252
|
+
|
|
253
|
+
Three corpus-comparison gates returned exit 0 having measured nothing when their
|
|
254
|
+
corpus directory was absent — a green result from a check that did not run. They
|
|
255
|
+
now fail closed (exit 2, naming the missing corpus), and four history-asserting
|
|
256
|
+
comparisons (a stored expected count, a stored pair list, a stored gap count, a
|
|
257
|
+
stored case list) are retired in favour of tests that assert the detectors
|
|
258
|
+
reject the pinned corpus sites directly. A check that was not run is reported as
|
|
259
|
+
not run.
|
|
260
|
+
|
|
261
|
+
### The hook log gets a reader
|
|
262
|
+
|
|
263
|
+
The PostToolUse and SessionStart hooks have written status records to `hook.log`
|
|
264
|
+
since 5.0.1, but nothing read them — a hook that stopped enqueueing (e.g.
|
|
265
|
+
`CLAUDE_PLUGIN_ROOT` unset) was invisible to the explicit audit, the exact
|
|
266
|
+
silent-disable the 4.1.0 guard was removed to escape. A write-only log is the
|
|
267
|
+
same silent disable with extra steps.
|
|
268
|
+
|
|
269
|
+
Both the CLI `audit` command and the MCP `audit.run` tool now read that log and,
|
|
270
|
+
when a hook-not-running condition is live, report a top-level notice that the
|
|
271
|
+
hook is not enqueueing and cached findings may be stale. The notice appears when
|
|
272
|
+
the newest `HOOK NOT RUNNING` record is newer than the newest `HOOK RAN` record
|
|
273
|
+
(or no `HOOK RAN` record exists), and it clears when a `HOOK RAN` record is
|
|
274
|
+
written at least as new as the condition — every hook script writes `HOOK RAN` on
|
|
275
|
+
a completed run (hook-audit.sh and hook-self-audit.sh on exit 0 or 2;
|
|
276
|
+
hook-warm.sh and hook-drift-check.sh on every path, since they never exit
|
|
277
|
+
non-zero), so a recovered hook resolves its own condition. The read is fail-open —
|
|
278
|
+
an absent, unreadable, or malformed log yields no notice and never changes the
|
|
279
|
+
audit exit code.
|
|
280
|
+
|
|
281
|
+
### Keyframe percentages no longer pollute the defined-class catalog
|
|
282
|
+
|
|
283
|
+
Every writer of the defined-class catalog scraped class names from a
|
|
284
|
+
declaration's selector context with `/\.([a-zA-Z0-9_-]+)/g`, which admitted a
|
|
285
|
+
keyframe percentage (`15.8%` → `8`) or a decimal attribute selector
|
|
286
|
+
(`[data-ratio="1.5"]` → `5`) as a class name — a class name can never start with
|
|
287
|
+
a digit. The catalog now derives from one shared harvest: CSS/SCSS use the
|
|
288
|
+
parser's class-selector walk, markup parses each embedded `<style>` block body
|
|
289
|
+
with the CSS parser (`harvestMarkupStyleClasses`), and TS/JS source parses each
|
|
290
|
+
CSS-in-JS template body with the same parser (`harvestCssInJsStyleClasses`).
|
|
291
|
+
Keyframes are excluded parser-structurally on all three paths — the parser's
|
|
292
|
+
`class_name`-under-`class_selector` walk never sees a keyframe's `from`/`to`/
|
|
293
|
+
percentage selectors. `isKeyframeVariant` survives only on the migration
|
|
294
|
+
backfill, which replays legacy `style_declarations` rows. The retired regex no
|
|
295
|
+
longer appears anywhere in `src/`. On recall-protocol this drops catalog
|
|
296
|
+
pollution from 2 (`5`/`8`) to 0 with `styles/undefined-class` unchanged.
|
|
297
|
+
|
|
298
|
+
### Anonymous telemetry opt-in is offered exactly once
|
|
299
|
+
|
|
300
|
+
The opt-in for anonymous dismissal feedback now records *whether a decision has
|
|
301
|
+
been made*, separately from what that decision is. `telemetry status` (and the
|
|
302
|
+
mirroring MCP tool) returns a new `decided` flag — false only until the user has
|
|
303
|
+
run `telemetry enable` or `telemetry disable`. The installer prints a one-line
|
|
304
|
+
nudge after a real install when `decided` is false, and the `code-auditor` SKILL
|
|
305
|
+
instructs the agent to surface the privacy facts and ask once, then run
|
|
306
|
+
`enable`/`disable` to record the choice. A user who has already decided is never
|
|
307
|
+
asked again.
|
|
308
|
+
|
|
309
|
+
### `code-audit request-rule` and the rule-request intake
|
|
310
|
+
|
|
311
|
+
New `request-rule` command submits a rule request (title, symptom, signal, plus a
|
|
312
|
+
firing and clean example) to the feedback service's bearer-guarded `/rule-requests`
|
|
313
|
+
endpoint, for defects no existing rule flags. The service dedupes by content hash,
|
|
314
|
+
caps the body size, and rate-limits per IP and globally.
|
|
315
|
+
|
|
316
|
+
### Bundled natives and the Go subprocess are gone from the package
|
|
317
|
+
|
|
318
|
+
The package no longer ships a bundled native binding. `@ast-grep/napi` loads its
|
|
319
|
+
binding from the seven per-platform `@ast-grep/napi-*@0.44.1` packages in
|
|
320
|
+
`optionalDependencies` — the same packages its `requireNative()` already
|
|
321
|
+
resolved — and they are now the only copy. There is no download step, no
|
|
322
|
+
`native-bootstrap`, and no bundled `.node` binary in `dist/`.
|
|
323
|
+
|
|
324
|
+
The dead Go subprocess path is also removed: the shipped Go binaries, `main.go`,
|
|
325
|
+
`go.mod`, and the `analyzer-src/` source (deleted in Spec 68 §11) are gone from
|
|
326
|
+
the package. Go analysis is unchanged — it runs through the TypeScript
|
|
327
|
+
`GoAdapter` — and compiled tests are excluded from `dist` so no `src/__tests__`
|
|
328
|
+
artifacts ship.
|
|
329
|
+
|
|
5
330
|
## [5.0.2]
|
|
6
331
|
|
|
7
332
|
### The plugin hooks self-locate — no `CLAUDE_PLUGIN_ROOT` env dependency
|
|
@@ -55,7 +380,7 @@ info, warnings, and failures alike — to `hook.log` and never exits non-zero
|
|
|
55
380
|
except to surface a gating finding (exit 2). The bootstrap guard for an unset
|
|
56
381
|
`CLAUDE_PLUGIN_ROOT` no longer prints to stderr and exits 1; it is a silent
|
|
57
382
|
no-op (exit 0) like the SessionStart warm hook. A broken install therefore
|
|
58
|
-
surfaces
|
|
383
|
+
surfaces in the log, never on the edit.
|
|
59
384
|
|
|
60
385
|
Resolution also stopped paying a full `--version` round-trip per candidate on
|
|
61
386
|
the per-edit hot path: the pinned install is version-guaranteed by its path and
|
|
@@ -314,8 +639,6 @@ but the fix is input normalization, not a regex fallback:
|
|
|
314
639
|
lossless for fact extraction, and it never re-introduces the hand-rolled parser
|
|
315
640
|
this release removed.
|
|
316
641
|
|
|
317
|
-
## [Unreleased]
|
|
318
|
-
|
|
319
642
|
### Any repo with a Go file silently dropped eleven analyzers
|
|
320
643
|
|
|
321
644
|
**v2.6.1 through v4.1.1 routed the *whole* repo through the polyglot
|
package/README.md
CHANGED
|
@@ -37,6 +37,26 @@ The hook auto-installs the auditor on first use via npx.
|
|
|
37
37
|
`npm install-scripts approve better-sqlite3 && npm rebuild better-sqlite3`
|
|
38
38
|
(with pnpm: `pnpm approve-builds`, then select `better-sqlite3`).
|
|
39
39
|
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
Project-level settings live in `.codeauditor.json` (invariant rules, analyzer settings, and thresholds). Eleven environment variables additionally tune process-scoped behavior — worker pool size, daemon and job-queue timeouts, the index location, the SQLite backend, and the UI port.
|
|
43
|
+
|
|
44
|
+
| Variable | Purpose | Accepted values | Default |
|
|
45
|
+
|----------|---------|-----------------|---------|
|
|
46
|
+
| `CODE_AUDITOR_WORKERS` | Phase-model worker pool size for per-file fan-out. `1` forces the serial path for byte-identical reports. | Positive integer | `max(1, cpus − 1)` |
|
|
47
|
+
| `CODE_AUDITOR_RULE_TIMING` | Per-rule wall-time accounting (one accumulated timer per rule ID, surfaced in the report). | `1` enables; unset disables | Off |
|
|
48
|
+
| `CODE_AUDITOR_DAEMON_IDLE_MS` | Idle timeout before the daemon shuts down. | Positive finite ms; invalid → default | `300000` (5 min) |
|
|
49
|
+
| `CODE_AUDITOR_DAEMON_LEASE_TTL_MS` | Daemon heartbeat lease TTL. | Finite ms; blank/`0` → default | `60000` (60 s) |
|
|
50
|
+
| `CODE_AUDITOR_DATA_DIR` | Overrides the code-index database directory. | Directory path (trimmed; blank → default) | user-level OS cache |
|
|
51
|
+
| `CODE_AUDITOR_EXIT_ON_FATAL` | Exit the MCP server on an uncaught exception / unhandled rejection. | `1` or `true` | Off |
|
|
52
|
+
| `CODE_AUDITOR_JOB_TIMEOUT_MS` | Per-job timeout for queued audits. | Finite ms, clamped to `60s`–`4h`; below the floor → default | `1800000` (30 min) |
|
|
53
|
+
| `CODE_AUDITOR_JOB_LEASE_TTL_MS` | Heartbeat lease TTL for reclaiming stale `running` job rows. | Strictly positive finite ms; invalid → default | `30000` (30 s) |
|
|
54
|
+
| `CODE_AUDITOR_MAX_RUNNING_JOBS` | Max concurrently running queued audit jobs. | Integer ≥ 1; invalid → default | `1` |
|
|
55
|
+
| `CODE_AUDITOR_SQLITE_BACKEND` | Forces a SQLite backend. An invalid value is reported as invalid and rejected — never silently probed past. | `node-sqlite` \| `better-sqlite3` | Auto (probe) |
|
|
56
|
+
| `MCP_UI_PORT` | HTTP UI server port (`--ui`). | Port number; invalid → default | `3001` |
|
|
57
|
+
|
|
58
|
+
When `CODE_AUDITOR_DATA_DIR` is set, the index is scoped per project (`<dir>/projects/<sha256(root)[:16]>/index.db`) so projects can't leak data into each other. When unset, the index lives in a user-level OS cache (`<os_cache>/code-auditor/projects/<hash>/index.db`) so it never lands inside the audited repo.
|
|
59
|
+
|
|
40
60
|
## Prompt examples
|
|
41
61
|
|
|
42
62
|
**"Index the codebase and run a full audit, then walk the violations file-by-file with `code-audit next-file`."**
|
|
@@ -81,6 +101,8 @@ One skill, one CLI, one MCP server. Every agent gets the same audit engine — t
|
|
|
81
101
|
| Other SKILL.md tools | `code-audit install --agent agents` | No | Yes | 2026-07-19 |
|
|
82
102
|
| ZCode | `code-audit install --agent zcode` | No (plugin-scoped) | Yes | 2026-09-10 |
|
|
83
103
|
|
|
104
|
+
**MCP config generation covers a wider set than skill install.** The MCP server's `generate` tool writes a client config file for any of `claude`, `codex`, `cursor`, `gemini`, `copilot`, `continue`, `awsq` (AWS Q Developer), `codeium` (Codeium/Windsurf), `vscode`, `cline`, and `zcode`. Four of those — **Continue**, **AWS Q Developer**, **Codeium/Windsurf**, and **Cline** — are MCP-only: they have no file-based skill or hook path, so they connect through the `generate` tool rather than `code-audit install`.
|
|
105
|
+
|
|
84
106
|
Hook behavior: **Blocking** means the diff-scoped `changed` gate is tripped — an invariant rule that declares `gating: true` (a binary, per-rule flag, independent of severity) blocks the edit from landing (the agent sees the violation and fixes inline). **Advisory** means violations are reported through the strongest available feedback channel but the edit has already occurred. Cursor's `afterFileEdit` hook is fire-and-forget with no output consumption. MCP is available everywhere for shell-less use.
|
|
85
107
|
|
|
86
108
|
## Findings: Deterministic vs Advisory
|
|
@@ -144,9 +166,9 @@ The `<fingerprint>` comes from the JSON report (every violation carries a `finge
|
|
|
144
166
|
|
|
145
167
|
The reason an agent gives for dismissing a finding is the most useful signal for improving the rules. Code Auditor can send dismissed findings to an anonymous feedback service that collects them.
|
|
146
168
|
|
|
147
|
-
It is **off by default** and turned on only by an explicit opt-in —
|
|
169
|
+
It is **off by default** and turned on only by an explicit opt-in — `code-audit telemetry status|enable|disable` (or the `telemetry` MCP tool), which records the choice in your user config dir. `enable` needs no arguments: it opts in against the built-in service endpoint (overridable for self-hosting). Opting in generates an **anonymous install ID**: a random value generated locally, never derived from your machine, user, or project, used only to group submissions by source.
|
|
148
170
|
|
|
149
|
-
**What is sent** — the reason
|
|
171
|
+
**What is sent** — the tool version, the rule ID, the urgency level, the dismissal reason exactly as typed, a structural AST signature (grammar kinds only, never their contents), a coarse language hint, a timestamp, and the anonymous install ID. **What is never sent** — source code, identifiers, literals, file paths, or anything derived from your code or environment. Sending is best-effort: offline or an unreachable endpoint is silent and never blocks an edit or fails a gate.
|
|
150
172
|
|
|
151
173
|
## Style Intelligence
|
|
152
174
|
|
package/configs/hhra-compat.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"projectRoot": "../..",
|
|
3
|
-
"reportTitle": "HHRA Architecture & Code Quality Audit",
|
|
4
|
-
|
|
5
2
|
"includePaths": [
|
|
6
3
|
"app/**/*.{ts,tsx}",
|
|
7
4
|
"src/**/*.{ts,tsx}",
|
|
8
5
|
"scripts/**/*.ts"
|
|
9
6
|
],
|
|
10
|
-
|
|
7
|
+
|
|
11
8
|
"excludePaths": [
|
|
12
9
|
"**/node_modules/**",
|
|
13
10
|
"**/.next/**",
|
|
@@ -22,73 +19,19 @@
|
|
|
22
19
|
"**/public/**",
|
|
23
20
|
"code-auditor/**"
|
|
24
21
|
],
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"withAuth",
|
|
30
|
-
"withAdminAuth",
|
|
31
|
-
"requireAuth",
|
|
32
|
-
"SessionAuth",
|
|
33
|
-
"useSession"
|
|
34
|
-
],
|
|
35
|
-
"adminPatterns": [
|
|
36
|
-
"withAdminAuth",
|
|
37
|
-
"requireAdmin",
|
|
38
|
-
"adminOnly"
|
|
39
|
-
],
|
|
40
|
-
"rateLimitPatterns": [
|
|
41
|
-
"rateLimit",
|
|
42
|
-
"withRateLimit",
|
|
43
|
-
"rateLimitGuard"
|
|
44
|
-
],
|
|
45
|
-
"publicPatterns": [
|
|
46
|
-
"public",
|
|
47
|
-
"noAuth",
|
|
48
|
-
"skipAuth"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
"component": {
|
|
53
|
-
"frameworkPatterns": {
|
|
54
|
-
"react": {
|
|
55
|
-
"components": ["*.tsx", "*.jsx"],
|
|
56
|
-
"hooks": ["use*"],
|
|
57
|
-
"context": ["*Context", "*Provider"]
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"checkErrorBoundaries": true,
|
|
61
|
-
"checkPropTypes": false,
|
|
62
|
-
"maxComplexity": 15,
|
|
63
|
-
"maxNesting": 4
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
"data-access": {
|
|
67
|
-
"databasePatterns": {
|
|
68
|
-
"postgres": ["app-db", "org-tracker-db", "@neondatabase", "neon"],
|
|
69
|
-
"drizzle": ["drizzle-orm", "db.query", "db.select", "db.insert", "db.update", "db.delete"]
|
|
70
|
-
},
|
|
71
|
-
"ormPatterns": {
|
|
72
|
-
"drizzle": ["drizzle-orm", "drizzle", "schema"]
|
|
73
|
-
},
|
|
74
|
-
"securityPatterns": {
|
|
75
|
-
"parameterized": ["?", "$1", ":param", "prepared"],
|
|
76
|
-
"sanitized": ["sanitize", "escape", "clean", "safe"]
|
|
77
|
-
},
|
|
78
|
-
"performanceThresholds": {
|
|
79
|
-
"maxJoins": 5,
|
|
80
|
-
"warnOnSelectStar": true
|
|
81
|
-
}
|
|
22
|
+
|
|
23
|
+
"analyzerConfigs": {
|
|
24
|
+
"react": {
|
|
25
|
+
"maxComponentComplexity": 15
|
|
82
26
|
},
|
|
83
|
-
|
|
27
|
+
|
|
84
28
|
"solid": {
|
|
85
29
|
"maxMethodsPerClass": 10,
|
|
86
30
|
"maxLinesPerMethod": 50,
|
|
87
31
|
"maxParametersPerMethod": 4,
|
|
88
|
-
"
|
|
89
|
-
"maxComplexity": 10
|
|
32
|
+
"maxMethodComplexity": 10
|
|
90
33
|
},
|
|
91
|
-
|
|
34
|
+
|
|
92
35
|
"dry": {
|
|
93
36
|
"minLineThreshold": 5,
|
|
94
37
|
"similarityThreshold": 0.85,
|
|
@@ -102,59 +45,10 @@
|
|
|
102
45
|
"checkStrings": true
|
|
103
46
|
}
|
|
104
47
|
},
|
|
105
|
-
|
|
106
|
-
"customPatterns": {
|
|
107
|
-
"components": [
|
|
108
|
-
"**/app/**/page.{ts,tsx}",
|
|
109
|
-
"**/app/**/layout.{ts,tsx}",
|
|
110
|
-
"**/app/**/error.{ts,tsx}",
|
|
111
|
-
"**/app/**/loading.{ts,tsx}",
|
|
112
|
-
"**/app/**/not-found.{ts,tsx}",
|
|
113
|
-
"**/components/**/*.{ts,tsx}",
|
|
114
|
-
"**/app/components/**/*.{ts,tsx}"
|
|
115
|
-
],
|
|
116
|
-
"endpoints": [
|
|
117
|
-
"**/app/api/**/route.{ts,tsx}",
|
|
118
|
-
"**/pages/api/**/*.{ts,tsx}",
|
|
119
|
-
"**/api/**/*.{ts,tsx}"
|
|
120
|
-
],
|
|
121
|
-
"tests": [
|
|
122
|
-
"**/*.test.{ts,tsx}",
|
|
123
|
-
"**/*.spec.{ts,tsx}",
|
|
124
|
-
"**/tests/**",
|
|
125
|
-
"**/e2e/**",
|
|
126
|
-
"**/__tests__/**"
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
"outputFormats": ["html", "json"],
|
|
131
|
-
"outputDirectory": "./audit-reports",
|
|
132
|
-
|
|
48
|
+
|
|
133
49
|
"minSeverity": "high",
|
|
134
|
-
|
|
135
|
-
"verbose": false,
|
|
136
|
-
"showProgress": true,
|
|
137
|
-
|
|
50
|
+
|
|
138
51
|
"thresholds": {
|
|
139
|
-
"
|
|
140
|
-
"maxWarnings": 100,
|
|
141
|
-
"minHealthScore": 75,
|
|
142
|
-
"maxComplexity": 10,
|
|
143
|
-
"maxDuplication": 10
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
"reportTheme": {
|
|
147
|
-
"primaryColor": "#0070f3",
|
|
148
|
-
"criticalColor": "#e00",
|
|
149
|
-
"warningColor": "#f5a623",
|
|
150
|
-
"suggestionColor": "#0070f3"
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
"integrations": {
|
|
154
|
-
"ci": {
|
|
155
|
-
"provider": "github",
|
|
156
|
-
"failOnThreshold": true,
|
|
157
|
-
"commentOnPR": false
|
|
158
|
-
}
|
|
52
|
+
"minHealthScore": 75
|
|
159
53
|
}
|
|
160
|
-
}
|
|
54
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DependencyGraphBuilder.d.ts","sourceRoot":"","sources":["../../../src/analyzers/cross-language/DependencyGraphBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,mBAAmB;IAClC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAMD,cAAM,0BAA0B;IAC9B,S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,UAAU,cAAc;IACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACvC;AAED,0GAA0G;AAC1G,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,qBAAqB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;IAClE,QAAQ,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IAC5D,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B"}
|
|
@@ -318,6 +318,15 @@ class DependencyGraphBuilderCore {
|
|
|
318
318
|
// treating it as such produced 857 false orphans on knex alone (97% of 885).
|
|
319
319
|
if (node.isMethod || node.name.includes('.'))
|
|
320
320
|
return false;
|
|
321
|
+
// A nested function (a closure) is lexically scoped inside its enclosing
|
|
322
|
+
// function, not a module top-level symbol. Its liveness is a lexical-scope
|
|
323
|
+
// question the flat name-based call graph cannot answer — a closure is
|
|
324
|
+
// reached through forms the graph does not model (`return closure`, passing
|
|
325
|
+
// it as a value, `closure.call`/`.apply`, …) — so "no edges" is not
|
|
326
|
+
// evidence of dead code. "Defined and used inside its enclosing function"
|
|
327
|
+
// must never read as "orphaned".
|
|
328
|
+
if (node.isNested)
|
|
329
|
+
return false;
|
|
321
330
|
if (connectedNodes.has(node.id))
|
|
322
331
|
return false;
|
|
323
332
|
if (node.exported)
|
|
@@ -414,7 +423,8 @@ class DependencyGraphBuilderTraversal extends DependencyGraphBuilderCore {
|
|
|
414
423
|
weight: this.calculateNodeWeight(entity),
|
|
415
424
|
cluster: this.determineCluster(entity),
|
|
416
425
|
exported: entity.visibility === 'public' || entity.metadata?.isExported === true,
|
|
417
|
-
isMethod: entity.metadata?.isMethod === true
|
|
426
|
+
isMethod: entity.metadata?.isMethod === true,
|
|
427
|
+
isNested: entity.metadata?.isNested === true
|
|
418
428
|
}));
|
|
419
429
|
}
|
|
420
430
|
/**
|