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
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
# 0 — clean pass, no fresh result yet (the daemon is seeding/indexing, or
|
|
9
9
|
# this edit hasn't been re-audited — feedback arrives one edit later), or
|
|
10
10
|
# a broken tool (the failure is written to the log file, not stderr)
|
|
11
|
-
# 2 — a gating finding was read from the daemon's cache (
|
|
12
|
-
#
|
|
13
|
-
# The hook never exits 1 and
|
|
14
|
-
# edit is worse than one that reports
|
|
15
|
-
# broken tool is written to the log
|
|
16
|
-
#
|
|
11
|
+
# 2 — a gating finding was read from the daemon's cache (the finding is
|
|
12
|
+
# written to stderr — the channel Claude Code feeds back on exit 2)
|
|
13
|
+
# The hook never exits 1, and writes stderr only to surface a finding on
|
|
14
|
+
# exit 2. A hook that can fail the edit is worse than one that reports
|
|
15
|
+
# nothing (Spec 68 §hook-contract). A broken tool is written to the log
|
|
16
|
+
# file, not stderr, and still exits 0 — a failure surfaces on the next
|
|
17
|
+
# explicit audit, never on the edit.
|
|
17
18
|
set -euo pipefail
|
|
18
19
|
|
|
19
20
|
# Shared resolver + compatibility pinning (see hook-common.sh). Source it from
|
|
@@ -85,16 +86,30 @@ assert_compatible "${CODE_AUDIT_BIN}" || exit 0
|
|
|
85
86
|
mkdir -p "$(hook_log_dir)" 2>/dev/null || true
|
|
86
87
|
set +e
|
|
87
88
|
if [ -n "${CLAUDE_PROJECT_DIR:-}" ]; then
|
|
88
|
-
echo "${file}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} changed --stdin --json -p "${CLAUDE_PROJECT_DIR}" 2>>"$(hook_log_file)"
|
|
89
|
+
finding="$(echo "${file}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} changed --stdin --json -p "${CLAUDE_PROJECT_DIR}" 2>>"$(hook_log_file)")"
|
|
89
90
|
else
|
|
90
|
-
echo "${file}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} changed --stdin --json 2>>"$(hook_log_file)"
|
|
91
|
+
finding="$(echo "${file}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} changed --stdin --json 2>>"$(hook_log_file)")"
|
|
91
92
|
fi
|
|
92
93
|
exit_code=$?
|
|
93
94
|
set -e
|
|
94
95
|
|
|
95
|
-
#
|
|
96
|
-
#
|
|
96
|
+
# A completed run — clean (0) or finding (2) — is the positive "the hook is
|
|
97
|
+
# alive and enqueueing" signal. Write it so the explicit-audit reader
|
|
98
|
+
# (src/hookLog.ts) can clear a prior HOOK NOT RUNNING condition: the reader
|
|
99
|
+
# resolves a condition by newest-record order, and without this line a hook that
|
|
100
|
+
# recovered would leave the stale condition live forever.
|
|
101
|
+
if [ "${exit_code}" -eq 0 ] || [ "${exit_code}" -eq 2 ]; then
|
|
102
|
+
hook_log "[code-auditor] HOOK RAN"
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
# Exit 2 = a finding read from the daemon cache. A PostToolUse hook's feedback
|
|
106
|
+
# channel on exit 2 is stderr (stdout is discarded), so re-emit the finding
|
|
107
|
+
# there before propagating exit 2 — otherwise the finding is lost and Claude
|
|
108
|
+
# Code reports an empty-stderr block. The finding is also written to the hook
|
|
109
|
+
# log so the diagnostic trail records what surfaced to the agent.
|
|
97
110
|
if [ ${exit_code} -eq 2 ]; then
|
|
111
|
+
hook_log "[code-auditor] FINDING: ${finding}"
|
|
112
|
+
printf '%s\n' "${finding}" >&2
|
|
98
113
|
exit 2
|
|
99
114
|
fi
|
|
100
115
|
|
|
@@ -53,18 +53,23 @@ plugin_root() {
|
|
|
53
53
|
printf '%s' "${root}"
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
# The hook-log path tail + file name are single-sourced in hook-log-path.sh,
|
|
57
|
+
# generated by scripts/write-hook-log-path.mjs from the same source as
|
|
58
|
+
# src/hookLogPath.generated.ts (the reader's copy). Sourced here so the write
|
|
59
|
+
# half and the read half (src/hookLog.ts) can never drift apart.
|
|
60
|
+
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)/hook-log-path.sh"
|
|
61
|
+
|
|
56
62
|
# hook_log_dir / hook_log_file / hook_log — the hook's diagnostic log.
|
|
57
63
|
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
-
#
|
|
61
|
-
#
|
|
62
|
-
# (and in this log), never on the edit itself.
|
|
64
|
+
# Diagnostics (info, warnings, failures) go here, never to stderr, and the hook
|
|
65
|
+
# still exits 0 — a broken install surfaces on the next explicit audit (and in
|
|
66
|
+
# this log), never as a blocked edit. The one intentional stderr write is a
|
|
67
|
+
# gating finding on exit 2, which is the hook's purpose, not a diagnostic.
|
|
63
68
|
hook_log_dir() {
|
|
64
|
-
printf '%s' "${XDG_CACHE_HOME:-$HOME/.cache}
|
|
69
|
+
printf '%s' "${XDG_CACHE_HOME:-$HOME/.cache}/${HOOK_LOG_DIR_TAIL}"
|
|
65
70
|
}
|
|
66
71
|
hook_log_file() {
|
|
67
|
-
printf '%s' "$(hook_log_dir)
|
|
72
|
+
printf '%s' "$(hook_log_dir)/${HOOK_LOG_FILE}"
|
|
68
73
|
}
|
|
69
74
|
hook_log() {
|
|
70
75
|
mkdir -p "$(hook_log_dir)" 2>/dev/null || return 0
|
|
@@ -33,7 +33,13 @@ manifest=""
|
|
|
33
33
|
for f in "${ROOT}/.claude-plugin/manifest.json" "${ROOT}/manifest.json"; do
|
|
34
34
|
if [ -f "$f" ]; then manifest="$f"; break; fi
|
|
35
35
|
done
|
|
36
|
-
[ -
|
|
36
|
+
if [ -z "${manifest}" ]; then
|
|
37
|
+
# No manifest to compare against is still a completed run — the drift check
|
|
38
|
+
# never exits non-zero, so write the success record that resolves a prior
|
|
39
|
+
# HOOK NOT RUNNING condition before the no-op exit.
|
|
40
|
+
hook_log "[code-auditor] HOOK RAN"
|
|
41
|
+
exit 0
|
|
42
|
+
fi
|
|
37
43
|
|
|
38
44
|
MANIFEST_PATH="${manifest}" PLUGIN_ROOT="${ROOT}" node <<'NODE'
|
|
39
45
|
const fs = require('fs');
|
|
@@ -73,4 +79,7 @@ if (problems.length > 0) {
|
|
|
73
79
|
}
|
|
74
80
|
NODE
|
|
75
81
|
|
|
82
|
+
# A completed run (drift found or not) resolves a prior HOOK NOT RUNNING
|
|
83
|
+
# condition — the drift check never exits non-zero.
|
|
84
|
+
hook_log "[code-auditor] HOOK RAN"
|
|
76
85
|
exit 0
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @generated — do not edit. Written by `scripts/write-hook-log-path.mjs`.
|
|
2
|
+
#
|
|
3
|
+
# Single source of truth for the hook-log path, shared by the TS reader
|
|
4
|
+
# (src/hookLog.ts) and the bash writer (plugin/scripts/hook-common.sh).
|
|
5
|
+
# Regenerate with `npm run build:hooklog`.
|
|
6
|
+
HOOK_LOG_DIR_TAIL='code-auditor/logs'
|
|
7
|
+
HOOK_LOG_FILE='hook.log'
|
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
# Exit codes:
|
|
16
16
|
# 0 — clean pass, out of scope, or a broken tool (the failure is written to
|
|
17
17
|
# the log file, not stderr)
|
|
18
|
-
# 2 — a blocking self-audit finding (
|
|
19
|
-
#
|
|
20
|
-
#
|
|
18
|
+
# 2 — a blocking self-audit finding (the finding is written to stderr — the
|
|
19
|
+
# channel Claude Code feeds back on exit 2)
|
|
20
|
+
# The hook never exits 1, and writes stderr only to surface a finding on
|
|
21
|
+
# exit 2: a broken tool is written to the log file, not stderr, and still
|
|
22
|
+
# exits 0 (Spec 68 §hook-contract).
|
|
21
23
|
set -euo pipefail
|
|
22
24
|
|
|
23
25
|
# Shared resolver + compatibility pinning (see hook-common.sh). Source it from
|
|
@@ -85,15 +87,28 @@ assert_compatible "${CODE_AUDIT_BIN}" || exit 0
|
|
|
85
87
|
mkdir -p "$(hook_log_dir)" 2>/dev/null || true
|
|
86
88
|
set +e
|
|
87
89
|
if [ -n "${CLAUDE_PROJECT_DIR:-}" ]; then
|
|
88
|
-
echo "${file_abs}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} self-audit --stdin --json -p "${CLAUDE_PROJECT_DIR}" 2>>"$(hook_log_file)"
|
|
90
|
+
finding="$(echo "${file_abs}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} self-audit --stdin --json -p "${CLAUDE_PROJECT_DIR}" 2>>"$(hook_log_file)")"
|
|
89
91
|
else
|
|
90
|
-
echo "${file_abs}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} self-audit --stdin --json 2>>"$(hook_log_file)"
|
|
92
|
+
finding="$(echo "${file_abs}" | CODE_AUDITOR_HOOK=1 ${CODE_AUDIT_BIN} self-audit --stdin --json 2>>"$(hook_log_file)")"
|
|
91
93
|
fi
|
|
92
94
|
exit_code=$?
|
|
93
95
|
set -e
|
|
94
96
|
|
|
95
|
-
#
|
|
97
|
+
# A completed run — clean (0) or finding (2) — is the positive "the hook is
|
|
98
|
+
# alive" signal, mirroring hook-audit.sh. Write it so the reader (src/hookLog.ts)
|
|
99
|
+
# can clear a prior HOOK NOT RUNNING condition: the reader resolves by
|
|
100
|
+
# newest-record order, and without this line a recovered hook would leave the
|
|
101
|
+
# stale condition live forever.
|
|
102
|
+
if [ "${exit_code}" -eq 0 ] || [ "${exit_code}" -eq 2 ]; then
|
|
103
|
+
hook_log "[code-auditor] HOOK RAN"
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# Exit 2 = a blocking self-audit finding; re-emit it to stderr — the channel
|
|
107
|
+
# Claude Code feeds back on exit 2 — before propagating, and record it in the
|
|
108
|
+
# hook log so the diagnostic trail shows what surfaced to the agent.
|
|
96
109
|
if [ ${exit_code} -eq 2 ]; then
|
|
110
|
+
hook_log "[code-auditor] FINDING: ${finding}"
|
|
111
|
+
printf '%s\n' "${finding}" >&2
|
|
97
112
|
exit 2
|
|
98
113
|
fi
|
|
99
114
|
|
|
@@ -26,18 +26,24 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
|
26
26
|
# Nothing safe to warm if the manifest version can't be read: warming @latest
|
|
27
27
|
# could pin a different version than resolve_code_audit's fallback would fetch.
|
|
28
28
|
pv="$(plugin_version)"
|
|
29
|
-
[ -n "${pv}" ] || exit 0
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
if [ -n "${pv}" ]; then
|
|
31
|
+
dir="$(pin_dir)"
|
|
32
|
+
bin="${dir}/node_modules/.bin/code-audit"
|
|
33
33
|
|
|
34
|
-
# Already installed — nothing to warm. Re-running npm install here would re-check
|
|
35
|
-
# the registry on every session, which is exactly the cost this hook exists to avoid.
|
|
36
|
-
[ -x "${bin}" ]
|
|
34
|
+
# Already installed — nothing to warm. Re-running npm install here would re-check
|
|
35
|
+
# the registry on every session, which is exactly the cost this hook exists to avoid.
|
|
36
|
+
if [ ! -x "${bin}" ]; then
|
|
37
|
+
# Background the exact install the hook's last-resort path runs. Output to
|
|
38
|
+
# /dev/null (silent), stdin from /dev/null (don't hold the hook's stdin open),
|
|
39
|
+
# nohup so the install survives this hook's exit.
|
|
40
|
+
nohup npm install --prefer-offline --prefix "${dir}" "code-auditor-mcp@${pv}" \
|
|
41
|
+
--no-audit --no-fund --ignore-scripts --silent >/dev/null 2>&1 </dev/null &
|
|
42
|
+
fi
|
|
43
|
+
fi
|
|
37
44
|
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
--no-audit --no-fund --ignore-scripts --silent >/dev/null 2>&1 </dev/null &
|
|
45
|
+
# A completed run — the warm hook never exits non-zero, so every path through it
|
|
46
|
+
# is a success — writes the positive record that resolves a prior HOOK NOT RUNNING
|
|
47
|
+
# condition (CLAUDE_PLUGIN_ROOT unset) in the reader (src/hookLog.ts).
|
|
48
|
+
hook_log "[code-auditor] HOOK RAN"
|
|
43
49
|
exit 0
|
|
@@ -5,7 +5,7 @@ description: Audit code quality, search the codebase semantically, enforce invar
|
|
|
5
5
|
|
|
6
6
|
# Code Auditor Skill
|
|
7
7
|
|
|
8
|
-
> **Version 5.
|
|
8
|
+
> **Version 5.3.3** • Run `code-audit --version` to check your installed version.
|
|
9
9
|
> If versions differ, the CLI is authoritative — use `code-audit <command> --help` to see what your install actually supports.
|
|
10
10
|
|
|
11
11
|
You have the `code-audit` CLI available. It indexes every function, component, and struct in the codebase for semantic search and invariant enforcement. Use these commands instead of raw grep/find whenever possible.
|
|
@@ -82,10 +82,31 @@ A dismissal is for *this finding is not relevant*, not for *I don't want to fix
|
|
|
82
82
|
|
|
83
83
|
The tool can send dismissed findings to an anonymous feedback service that collects them. It is **off by default** and is turned on only by an explicit opt-in:
|
|
84
84
|
|
|
85
|
-
- `
|
|
85
|
+
- `code-audit telemetry status` / `enable` / `disable` manage the opt-in (the `mcp__code-auditor__telemetry` tool mirrors the same toggle). `enable` needs no arguments — it opts in against the built-in service endpoint and generates the anonymous install ID.
|
|
86
86
|
- When opted in, each dismissal sends only the reason plus a structural shape — **no code, identifiers, or file paths**.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
On first contact, run `code-audit telemetry status` and read its `decided` field:
|
|
89
|
+
|
|
90
|
+
- **`decided` is false** — the user has never been asked. Tell them the privacy facts (below), then ask **once** whether to opt in. Run `code-audit telemetry enable` on yes and `code-audit telemetry disable` on no — either records the decision so the question is never repeated.
|
|
91
|
+
- **`decided` is true** — the user has already chosen. Never ask again; leave the setting exactly as it is.
|
|
92
|
+
|
|
93
|
+
The privacy facts: each submission contains the tool version, the rule ID, the urgency level, the dismissal reason exactly as typed, a structural AST signature (grammar node types only, never their contents), a coarse language hint, a timestamp, and an anonymous install ID generated locally on your machine. Source code, identifiers, literals, file paths, and environment details are never sent, unless the user types them into the reason.
|
|
94
|
+
|
|
95
|
+
### `code-audit request-rule` — request a rule for an unflagged defect
|
|
96
|
+
|
|
97
|
+
When you find a *class* of defect the audit did not flag, request a new rule instead of silently working around it:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
code-audit request-rule \
|
|
101
|
+
--title "Flag unbounded loops" \
|
|
102
|
+
--symptom "A loop with no exit condition hangs the process at runtime." \
|
|
103
|
+
--signal "A for-loop over a dynamic collection with no bound check." \
|
|
104
|
+
--language typescript \
|
|
105
|
+
--fires bad.ts \
|
|
106
|
+
--clean fixed.ts
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Call `lookup_rule` or `explain_symptom` first to confirm no existing rule covers it. Provide a minimal example that *should* be flagged (`--fires`) and a corrected example that *should not* (`--clean`), each reduced to the smallest code that shows the difference, with secrets and proprietary identifiers removed. The CLI prints a receipt id so the request can be tracked.
|
|
89
110
|
|
|
90
111
|
### `code-audit config` — know the project's laws
|
|
91
112
|
|
|
@@ -235,6 +256,8 @@ The hook auto-installs the package to a cache dir on first use — no manual npm
|
|
|
235
256
|
| Resolve file profiles | `code-audit config profiles --file <path>` |
|
|
236
257
|
| Next file to fix | `code-audit next-file` |
|
|
237
258
|
| Dismiss a false positive | `code-audit dismiss <fingerprint> --reason "…"` |
|
|
259
|
+
| Telemetry opt-in | `code-audit telemetry status` / `enable` / `disable` |
|
|
260
|
+
| Request a new rule | `code-audit request-rule` |
|
|
238
261
|
| Sync index | `code-audit index sync --path .` |
|
|
239
262
|
| Codebase map | `code-audit map -p .` |
|
|
240
263
|
| Mine conventions | `code-audit conventions list` |
|
package/server.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"url": "https://github.com/BenAHammond/code-auditor-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "5.
|
|
9
|
+
"version": "5.3.3",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "code-auditor-mcp",
|
|
15
|
-
"version": "5.
|
|
15
|
+
"version": "5.3.3",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/fixtures/spec-20/scripts/tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAMtD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scripts-tree module with an undocumented exported function.
|
|
3
|
-
* Same code as src/demo-module.ts — the profile controls what fires.
|
|
4
|
-
*/
|
|
5
|
-
export function calculateTotal(items) {
|
|
6
|
-
let total = 0;
|
|
7
|
-
for (const item of items) {
|
|
8
|
-
total += item * 1.1;
|
|
9
|
-
}
|
|
10
|
-
return total;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../../src/__tests__/fixtures/spec-20/scripts/tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,IAAI,IAAI,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Source-tree module with an undocumented exported function.
|
|
3
|
-
* When requireFunctionDocs is true (default), the documentation analyzer
|
|
4
|
-
* flags this. When a profile sets requireFunctionDocs=false, skip entirely.
|
|
5
|
-
*/
|
|
6
|
-
export declare function calculateTotal(items: number[]): number;
|
|
7
|
-
//# sourceMappingURL=demo-module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demo-module.d.ts","sourceRoot":"","sources":["../../../../../src/__tests__/fixtures/spec-20/src/demo-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAMtD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Source-tree module with an undocumented exported function.
|
|
3
|
-
* When requireFunctionDocs is true (default), the documentation analyzer
|
|
4
|
-
* flags this. When a profile sets requireFunctionDocs=false, skip entirely.
|
|
5
|
-
*/
|
|
6
|
-
export function calculateTotal(items) {
|
|
7
|
-
let total = 0;
|
|
8
|
-
for (const item of items) {
|
|
9
|
-
total += item * 1.1;
|
|
10
|
-
}
|
|
11
|
-
return total;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=demo-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demo-module.js","sourceRoot":"","sources":["../../../../../src/__tests__/fixtures/spec-20/src/demo-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,IAAI,IAAI,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 1 — loop-query FALSE positive (oracle: MUST NOT fire).
|
|
3
|
-
*
|
|
4
|
-
* `db.prepare(sql)` inside a loop builds a statement object; it performs no I/O.
|
|
5
|
-
* The statements are accumulated and executed once by a single `.batch()` after
|
|
6
|
-
* the loop. This is the `mod.ts:213/218/223/266` shape — not an N+1.
|
|
7
|
-
*/
|
|
8
|
-
interface Row {
|
|
9
|
-
id: number;
|
|
10
|
-
name: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function insertMany(db: any, rows: Row[]): Promise<void>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=item-01-prepare-in-loop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-01-prepare-in-loop.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-01-prepare-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,UAAU,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAOpE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 1 — loop-query FALSE positive (oracle: MUST NOT fire).
|
|
3
|
-
*
|
|
4
|
-
* `db.prepare(sql)` inside a loop builds a statement object; it performs no I/O.
|
|
5
|
-
* The statements are accumulated and executed once by a single `.batch()` after
|
|
6
|
-
* the loop. This is the `mod.ts:213/218/223/266` shape — not an N+1.
|
|
7
|
-
*/
|
|
8
|
-
export async function insertMany(db, rows) {
|
|
9
|
-
const stmts = [];
|
|
10
|
-
for (const row of rows) {
|
|
11
|
-
const stmt = db.prepare('INSERT INTO items (id, name) VALUES (?, ?)');
|
|
12
|
-
stmts.push(stmt);
|
|
13
|
-
}
|
|
14
|
-
await db.batch(stmts);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=item-01-prepare-in-loop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-01-prepare-in-loop.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-01-prepare-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAO,EAAE,IAAW;IACnD,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;QACtE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 2 — accumulate-then-batch (oracle: MUST NOT fire).
|
|
3
|
-
*
|
|
4
|
-
* The explicit accumulate-then-batch shape: each loop iteration prepares and
|
|
5
|
-
* binds a statement (statement construction — no I/O), pushes it to an array,
|
|
6
|
-
* and a single `.batch()` after the loop executes them all. The eager call sits
|
|
7
|
-
* outside the loop, so this is not an N+1.
|
|
8
|
-
*/
|
|
9
|
-
interface ScoreRow {
|
|
10
|
-
id: number;
|
|
11
|
-
score: number;
|
|
12
|
-
}
|
|
13
|
-
export declare function rescoreMany(db: any, items: ScoreRow[]): Promise<void>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=item-02-prepare-bind-accumulate-batch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-02-prepare-bind-accumulate-batch.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-02-prepare-bind-accumulate-batch.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3E"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 2 — accumulate-then-batch (oracle: MUST NOT fire).
|
|
3
|
-
*
|
|
4
|
-
* The explicit accumulate-then-batch shape: each loop iteration prepares and
|
|
5
|
-
* binds a statement (statement construction — no I/O), pushes it to an array,
|
|
6
|
-
* and a single `.batch()` after the loop executes them all. The eager call sits
|
|
7
|
-
* outside the loop, so this is not an N+1.
|
|
8
|
-
*/
|
|
9
|
-
export async function rescoreMany(db, items) {
|
|
10
|
-
const stmts = [];
|
|
11
|
-
for (const item of items) {
|
|
12
|
-
const stmt = db.prepare('UPDATE scores SET score = ? WHERE id = ?').bind(item.score, item.id);
|
|
13
|
-
stmts.push(stmt);
|
|
14
|
-
}
|
|
15
|
-
await db.batch(stmts);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=item-02-prepare-bind-accumulate-batch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-02-prepare-bind-accumulate-batch.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-02-prepare-bind-accumulate-batch.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAO,EAAE,KAAiB;IAC1D,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9F,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 3 — loop-query TRUE positive (oracle: MUST fire).
|
|
3
|
-
*
|
|
4
|
-
* `db.exec(sql)` inside a loop is an eager member call — immediate I/O on every
|
|
5
|
-
* iteration. This is the simplest genuine-N+1 positive arm: the prepare/bind
|
|
6
|
-
* skip must be surgical and leave eager member methods firing.
|
|
7
|
-
*/
|
|
8
|
-
interface ItemRow {
|
|
9
|
-
id: number;
|
|
10
|
-
name: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function renameAll(items: ItemRow[]): Promise<void>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=item-03-exec-in-loop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-03-exec-in-loop.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-03-exec-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAQD,wBAAsB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 3 — loop-query TRUE positive (oracle: MUST fire).
|
|
3
|
-
*
|
|
4
|
-
* `db.exec(sql)` inside a loop is an eager member call — immediate I/O on every
|
|
5
|
-
* iteration. This is the simplest genuine-N+1 positive arm: the prepare/bind
|
|
6
|
-
* skip must be surgical and leave eager member methods firing.
|
|
7
|
-
*/
|
|
8
|
-
import Database from 'better-sqlite3';
|
|
9
|
-
// Spec 70 R4 — the handle is proven by the manifest-package import
|
|
10
|
-
// (`better-sqlite3`), not a `D1Database` type annotation. `db.exec(sql)` with a
|
|
11
|
-
// dynamic (interpolated) argument has no static SQL for R3, so the import is the
|
|
12
|
-
// proof; the `D1Database` binding would read `unproven` (cannot-fire).
|
|
13
|
-
const db = new Database(':memory:');
|
|
14
|
-
export async function renameAll(items) {
|
|
15
|
-
for (const item of items) {
|
|
16
|
-
db.exec(`UPDATE items SET name = 'renamed' WHERE id = ${item.id}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=item-03-exec-in-loop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-03-exec-in-loop.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-03-exec-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAOtC,mEAAmE;AACnE,gFAAgF;AAChF,iFAAiF;AACjF,uEAAuE;AACvE,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAgB;IAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,EAAE,CAAC,IAAI,CAAC,gDAAgD,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 4 — loop-query TRUE positive (oracle: MUST fire).
|
|
3
|
-
*
|
|
4
|
-
* The `Leaderboard.ts:113` discriminating positive: `this.ctx.storage.sql.exec(...)`
|
|
5
|
-
* inside a loop. `.exec()` is an eager method (immediate I/O), so this is a real
|
|
6
|
-
* N+1 that must keep firing — the two-direction proof's positive arm.
|
|
7
|
-
*/
|
|
8
|
-
interface RankRow {
|
|
9
|
-
id: number;
|
|
10
|
-
rank: number;
|
|
11
|
-
}
|
|
12
|
-
export declare class Leaderboard {
|
|
13
|
-
private sql;
|
|
14
|
-
constructor(sql: D1Database);
|
|
15
|
-
applyRanks(rows: RankRow[]): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=item-04-storage-sql-exec-in-loop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-04-storage-sql-exec-in-loop.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,GAAG,CAAa;gBAEZ,GAAG,EAAE,UAAU;IAIrB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAKjD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 4 — loop-query TRUE positive (oracle: MUST fire).
|
|
3
|
-
*
|
|
4
|
-
* The `Leaderboard.ts:113` discriminating positive: `this.ctx.storage.sql.exec(...)`
|
|
5
|
-
* inside a loop. `.exec()` is an eager method (immediate I/O), so this is a real
|
|
6
|
-
* N+1 that must keep firing — the two-direction proof's positive arm.
|
|
7
|
-
*/
|
|
8
|
-
export class Leaderboard {
|
|
9
|
-
sql;
|
|
10
|
-
constructor(sql) {
|
|
11
|
-
this.sql = sql;
|
|
12
|
-
}
|
|
13
|
-
async applyRanks(rows) {
|
|
14
|
-
for (const row of rows) {
|
|
15
|
-
this.sql.exec('UPDATE leaderboard SET rank = ? WHERE id = ?', row.rank, row.id);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=item-04-storage-sql-exec-in-loop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-04-storage-sql-exec-in-loop.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-04-storage-sql-exec-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,OAAO,WAAW;IACd,GAAG,CAAa;IAExB,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAe;QAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,8CAA8C,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R2 — the four SQLite/Postgres upsert write forms (oracle: all MUST be
|
|
3
|
-
* classified as `insert` writes).
|
|
4
|
-
*
|
|
5
|
-
* `INSERT OR IGNORE INTO`, `INSERT OR REPLACE INTO`, `REPLACE INTO`, and
|
|
6
|
-
* `INSERT INTO ... ON CONFLICT ... DO UPDATE` all mutate the target table; the
|
|
7
|
-
* write classifier previously only matched `INSERT INTO`, so every rule reading
|
|
8
|
-
* the write set (written-never-read, multi-table-write) missed them.
|
|
9
|
-
*
|
|
10
|
-
* This fixture is exercised by the spec-52 test through `parseSqlTables`, which
|
|
11
|
-
* is the table-extraction path that feeds `schema_usage.usage_type`.
|
|
12
|
-
*/
|
|
13
|
-
export declare const UPSERT_QUERIES: {
|
|
14
|
-
readonly insertOrIgnore: "INSERT OR IGNORE INTO feature_flags (key, enabled) VALUES (?, ?)";
|
|
15
|
-
readonly insertOrReplace: "INSERT OR REPLACE INTO feature_flags (key, enabled) VALUES (?, ?)";
|
|
16
|
-
readonly replaceInto: "REPLACE INTO feature_flags (key, enabled) VALUES (?, ?)";
|
|
17
|
-
readonly onConflictDoUpdate: "INSERT INTO feature_flags (key, enabled) VALUES (?, ?) ON CONFLICT (key) DO UPDATE SET enabled = excluded.enabled";
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=item-05-upsert-forms.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-05-upsert-forms.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-05-upsert-forms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,cAAc;;;;;CASjB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R2 — the four SQLite/Postgres upsert write forms (oracle: all MUST be
|
|
3
|
-
* classified as `insert` writes).
|
|
4
|
-
*
|
|
5
|
-
* `INSERT OR IGNORE INTO`, `INSERT OR REPLACE INTO`, `REPLACE INTO`, and
|
|
6
|
-
* `INSERT INTO ... ON CONFLICT ... DO UPDATE` all mutate the target table; the
|
|
7
|
-
* write classifier previously only matched `INSERT INTO`, so every rule reading
|
|
8
|
-
* the write set (written-never-read, multi-table-write) missed them.
|
|
9
|
-
*
|
|
10
|
-
* This fixture is exercised by the spec-52 test through `parseSqlTables`, which
|
|
11
|
-
* is the table-extraction path that feeds `schema_usage.usage_type`.
|
|
12
|
-
*/
|
|
13
|
-
export const UPSERT_QUERIES = {
|
|
14
|
-
insertOrIgnore: 'INSERT OR IGNORE INTO feature_flags (key, enabled) VALUES (?, ?)',
|
|
15
|
-
insertOrReplace: 'INSERT OR REPLACE INTO feature_flags (key, enabled) VALUES (?, ?)',
|
|
16
|
-
replaceInto: 'REPLACE INTO feature_flags (key, enabled) VALUES (?, ?)',
|
|
17
|
-
onConflictDoUpdate: 'INSERT INTO feature_flags (key, enabled) VALUES (?, ?) ON CONFLICT (key) DO UPDATE SET enabled = excluded.enabled',
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=item-05-upsert-forms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-05-upsert-forms.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-05-upsert-forms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,cAAc,EACZ,kEAAkE;IACpE,eAAe,EACb,mEAAmE;IACrE,WAAW,EACT,yDAAyD;IAC3D,kBAAkB,EAChB,mHAAmH;CAC7G,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 6 — chained prepare→bind→run in a loop (oracle: MUST fire).
|
|
3
|
-
*
|
|
4
|
-
* `db.prepare(sql).bind(x).run()` executes I/O on every iteration. Unlike the
|
|
5
|
-
* accumulate-then-batch shape (where the statement is pushed to an array and a
|
|
6
|
-
* single `.batch()` runs after the loop), the eager `.run()` sits *inside* the
|
|
7
|
-
* loop here, so this is a genuine N+1. The prepare/bind skip must be surgical:
|
|
8
|
-
* it skips standalone construction but leaves a prepare/bind that is chained
|
|
9
|
-
* into an eager call firing.
|
|
10
|
-
*/
|
|
11
|
-
interface SyncJob {
|
|
12
|
-
id: number;
|
|
13
|
-
slug: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function syncBuildsForHeroes(db: D1Database, jobs: SyncJob[]): Promise<void>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=item-06-chained-prepare-run-in-loop.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-06-chained-prepare-run-in-loop.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,UAAU,OAAO;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASxF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec-52 R1 item 6 — chained prepare→bind→run in a loop (oracle: MUST fire).
|
|
3
|
-
*
|
|
4
|
-
* `db.prepare(sql).bind(x).run()` executes I/O on every iteration. Unlike the
|
|
5
|
-
* accumulate-then-batch shape (where the statement is pushed to an array and a
|
|
6
|
-
* single `.batch()` runs after the loop), the eager `.run()` sits *inside* the
|
|
7
|
-
* loop here, so this is a genuine N+1. The prepare/bind skip must be surgical:
|
|
8
|
-
* it skips standalone construction but leaves a prepare/bind that is chained
|
|
9
|
-
* into an eager call firing.
|
|
10
|
-
*/
|
|
11
|
-
export async function syncBuildsForHeroes(db, jobs) {
|
|
12
|
-
for (const job of jobs) {
|
|
13
|
-
await db
|
|
14
|
-
.prepare(`UPDATE sync_jobs SET status = 'running', started_at = datetime('now') WHERE id = ?`)
|
|
15
|
-
.bind(job.id)
|
|
16
|
-
.run();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=item-06-chained-prepare-run-in-loop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-06-chained-prepare-run-in-loop.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/spec-52/item-06-chained-prepare-run-in-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EAAc,EAAE,IAAe;IACvE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,EAAE;aACL,OAAO,CACN,oFAAoF,CACrF;aACA,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;aACZ,GAAG,EAAE,CAAC;IACX,CAAC;AACH,CAAC"}
|