code-auditor-mcp 3.4.17 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +94 -0
- package/README.md +5 -5
- package/dist/analyzers/applicability.d.ts +13 -0
- package/dist/analyzers/applicability.d.ts.map +1 -1
- package/dist/analyzers/applicability.js +37 -0
- package/dist/analyzers/applicability.js.map +1 -1
- package/dist/analyzers/cross-language/APIContractAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/cross-language/APIContractAnalyzer.js +23 -2
- package/dist/analyzers/cross-language/APIContractAnalyzer.js.map +1 -1
- package/dist/analyzers/cross-language/DependencyGraphBuilder.d.ts +52 -9
- package/dist/analyzers/cross-language/DependencyGraphBuilder.d.ts.map +1 -1
- package/dist/analyzers/cross-language/DependencyGraphBuilder.js +228 -55
- package/dist/analyzers/cross-language/DependencyGraphBuilder.js.map +1 -1
- package/dist/analyzers/cross-language/SchemaValidator.d.ts +19 -12
- package/dist/analyzers/cross-language/SchemaValidator.d.ts.map +1 -1
- package/dist/analyzers/cross-language/SchemaValidator.js +78 -111
- package/dist/analyzers/cross-language/SchemaValidator.js.map +1 -1
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.d.ts +0 -6
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.js +85 -73
- package/dist/analyzers/crossDomain/CrossDomainAnalyzer.js.map +1 -1
- package/dist/analyzers/documentationAnalyzer.js +5 -5
- package/dist/analyzers/documentationAnalyzer.js.map +1 -1
- package/dist/analyzers/invariantsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/invariantsAnalyzer.js +1 -0
- package/dist/analyzers/invariantsAnalyzer.js.map +1 -1
- package/dist/analyzers/provenance.d.ts +7 -9
- package/dist/analyzers/provenance.d.ts.map +1 -1
- package/dist/analyzers/provenance.js +88 -124
- package/dist/analyzers/provenance.js.map +1 -1
- package/dist/analyzers/reactAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/reactAnalyzer.js +120 -21
- package/dist/analyzers/reactAnalyzer.js.map +1 -1
- package/dist/analyzers/ruleRegistry.d.ts +21 -0
- package/dist/analyzers/ruleRegistry.d.ts.map +1 -1
- package/dist/analyzers/ruleRegistry.js +61 -12
- package/dist/analyzers/ruleRegistry.js.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js +60 -24
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js +5 -2
- package/dist/analyzers/universal/UniversalDRYAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js +173 -56
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.d.ts +2 -1
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.js +23 -12
- package/dist/analyzers/universal/UniversalDocumentationAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.d.ts +11 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.js +60 -22
- package/dist/analyzers/universal/UniversalSOLIDAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts +2 -3
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js +258 -87
- 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 +7 -1
- package/dist/analyzers/universal/schema/codeAnalysis.js.map +1 -1
- package/dist/analyzers/universal/schema/jsonSchema.js +7 -11
- package/dist/analyzers/universal/schema/jsonSchema.js.map +1 -1
- package/dist/applyDataDirEnv.js +1 -1
- package/dist/applyDataDirEnv.js.map +1 -1
- package/dist/auditRouter.d.ts +41 -0
- package/dist/auditRouter.d.ts.map +1 -0
- package/dist/auditRouter.js +185 -0
- package/dist/auditRouter.js.map +1 -0
- package/dist/auditRunner.d.ts.map +1 -1
- package/dist/auditRunner.js +97 -58
- package/dist/auditRunner.js.map +1 -1
- package/dist/cli.js +247 -23
- package/dist/cli.js.map +1 -1
- package/dist/codeIndexDB.d.ts.map +1 -1
- package/dist/codeIndexDB.js +36 -2
- package/dist/codeIndexDB.js.map +1 -1
- package/dist/componentScanner.d.ts.map +1 -1
- package/dist/componentScanner.js +7 -2
- package/dist/componentScanner.js.map +1 -1
- package/dist/config/configLoader.d.ts +9 -0
- package/dist/config/configLoader.d.ts.map +1 -1
- package/dist/config/configLoader.js +30 -2
- package/dist/config/configLoader.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +10 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/dataPaths.d.ts +8 -1
- package/dist/dataPaths.d.ts.map +1 -1
- package/dist/dataPaths.js +57 -5
- package/dist/dataPaths.js.map +1 -1
- package/dist/functionScanner.d.ts.map +1 -1
- package/dist/functionScanner.js +1 -17
- package/dist/functionScanner.js.map +1 -1
- package/dist/grammars/tree-sitter-scss.wasm +0 -0
- package/dist/invariants/ruleEngine.d.ts +8 -0
- package/dist/invariants/ruleEngine.d.ts.map +1 -1
- package/dist/invariants/ruleEngine.js +35 -16
- package/dist/invariants/ruleEngine.js.map +1 -1
- package/dist/languages/LanguageOrchestrator.d.ts +10 -11
- package/dist/languages/LanguageOrchestrator.d.ts.map +1 -1
- package/dist/languages/LanguageOrchestrator.js +135 -101
- package/dist/languages/LanguageOrchestrator.js.map +1 -1
- package/dist/languages/RuntimeManager.d.ts +28 -1
- package/dist/languages/RuntimeManager.d.ts.map +1 -1
- package/dist/languages/RuntimeManager.js +160 -49
- package/dist/languages/RuntimeManager.js.map +1 -1
- package/dist/languages/go/GoAdapter.d.ts +2 -0
- package/dist/languages/go/GoAdapter.d.ts.map +1 -1
- package/dist/languages/go/GoAdapter.js +15 -22
- package/dist/languages/go/GoAdapter.js.map +1 -1
- package/dist/languages/go/analyzer +0 -0
- package/dist/languages/go/analyzer-src/analyzer.go +510 -0
- package/dist/languages/go/analyzer-src/go.mod +3 -0
- package/dist/languages/go/analyzer-src/indexer.go +268 -0
- package/dist/languages/go/analyzer-src/parser.go +461 -0
- package/dist/languages/go/analyzer-src/solid.go +395 -0
- package/dist/languages/go/analyzer-src/testconventions.go +25 -0
- package/dist/languages/go/analyzer-src/types.go +148 -0
- package/dist/languages/go/go.mod +7 -0
- package/dist/languages/go/main.go +203 -0
- package/dist/languages/testConventions.d.ts +35 -0
- package/dist/languages/testConventions.d.ts.map +1 -0
- package/dist/languages/testConventions.js +51 -0
- package/dist/languages/testConventions.js.map +1 -0
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts +3 -0
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js +25 -18
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js.map +1 -1
- package/dist/mcp-tools/whitelistTools.d.ts +1 -1
- package/dist/mcp-tools/workflowGuide.js +3 -3
- package/dist/mcp-tools/workflowGuide.js.map +1 -1
- package/dist/mcp-tools-shared.d.ts +0 -3
- package/dist/mcp-tools-shared.d.ts.map +1 -1
- package/dist/mcp-tools-shared.js +24 -128
- package/dist/mcp-tools-shared.js.map +1 -1
- package/dist/mcp.js +18 -12
- package/dist/mcp.js.map +1 -1
- package/dist/mcpAuditJobs.d.ts.map +1 -1
- package/dist/mcpAuditJobs.js +13 -0
- package/dist/mcpAuditJobs.js.map +1 -1
- package/dist/mcpAutoIndex.js +1 -1
- package/dist/mcpAutoIndex.js.map +1 -1
- package/dist/nextFile.d.ts +21 -0
- package/dist/nextFile.d.ts.map +1 -0
- package/dist/nextFile.js +51 -0
- package/dist/nextFile.js.map +1 -0
- package/dist/nextFileIncremental.d.ts +141 -0
- package/dist/nextFileIncremental.d.ts.map +1 -0
- package/dist/nextFileIncremental.js +314 -0
- package/dist/nextFileIncremental.js.map +1 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +22 -0
- package/dist/pipeline.js.map +1 -1
- package/dist/pipelineAdapters.d.ts +17 -0
- package/dist/pipelineAdapters.d.ts.map +1 -1
- package/dist/pipelineAdapters.js +800 -44
- package/dist/pipelineAdapters.js.map +1 -1
- package/dist/reporting/jsonReportGenerator.d.ts.map +1 -1
- package/dist/reporting/jsonReportGenerator.js +11 -30
- package/dist/reporting/jsonReportGenerator.js.map +1 -1
- package/dist/styles/styleIndexer.d.ts +7 -0
- package/dist/styles/styleIndexer.d.ts.map +1 -1
- package/dist/styles/styleIndexer.js +44 -61
- package/dist/styles/styleIndexer.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 +27 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/fileDiscovery.d.ts +11 -2
- package/dist/utils/fileDiscovery.d.ts.map +1 -1
- package/dist/utils/fileDiscovery.js +23 -5
- package/dist/utils/fileDiscovery.js.map +1 -1
- package/dist/utils/reactDetection.d.ts.map +1 -1
- package/dist/utils/reactDetection.js +59 -44
- package/dist/utils/reactDetection.js.map +1 -1
- package/package.json +31 -27
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/README.md +6 -6
- package/plugin/hooks/hooks.json +4 -0
- package/plugin/scripts/hook-audit.sh +0 -0
- package/plugin/scripts/hook-self-audit.sh +107 -0
- package/plugin/skills/code-auditor/SKILL-RULE-KINDS.md +55 -7
- package/plugin/skills/code-auditor/SKILL.md +22 -23
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incremental `next-file` — snapshot + content-hash diff + per-analyzer merge.
|
|
3
|
+
*
|
|
4
|
+
* The refactoring loop (`code-audit next-file`) must not pay a full cold audit
|
|
5
|
+
* on every call, or an agent calls it once and stops. This module seeds a full
|
|
6
|
+
* audit once, persists a snapshot of (file → content hash + mtime + findings),
|
|
7
|
+
* then on each warm call hashes the current file set, re-audits only what
|
|
8
|
+
* changed, and merges per-analyzer.
|
|
9
|
+
*
|
|
10
|
+
* ## Per-analyzer cacheability (the crux of incremental correctness)
|
|
11
|
+
*
|
|
12
|
+
* Findings fall into three buckets, decided per analyzer rather than globally —
|
|
13
|
+
* a uniform "cache everything" or "recompute everything" is wrong for one of
|
|
14
|
+
* the three, and that is the part that silently corrupts a cached queue.
|
|
15
|
+
*
|
|
16
|
+
* | Bucket | Analyzers | On a warm call | Why it is safe |
|
|
17
|
+
* |--------|-----------|----------------|----------------|
|
|
18
|
+
* | **File-local** (cache per file) | solid, data-access, documentation, react, dry, schema-sql, schema-code, schema-prisma, schema-json, invariants | re-audit only changed/added files; unchanged files keep their cache | a finding on file F is a pure function of F's AST + the (session-stable) rules. `dry` cross-file findings are re-emitted from whichever file is (re)visited, so a still-broken file comes back. |
|
|
19
|
+
* | **Corpus (DB-backed)** (recompute every call) | styles, conventions, cross-domain | recompute from the scoped audit's reducer output | these reducers read the persistent SQLite index (full corpus), not the scoped file list, so their scoped-run output is already full-corpus. |
|
|
20
|
+
* | **Corpus (fact-based) — schema** (cache + escalate) | schema | reuse cached findings UNLESS a schema-definition file changed, in which case force a full re-seed | the known-tables catalog is built in-memory from the current run's visitor facts. A scoped run sees only scoped facts, so an unchanged migration's tables would vanish and query files would be falsely flagged `unknown-table`. The catalog can only change when a schema-definition file changes — detect that and re-seed; otherwise the cache is correct. |
|
|
21
|
+
*
|
|
22
|
+
* The two file-local caveats, documented rather than hidden:
|
|
23
|
+
* - `invariants` is a Stage-3 reducer that runs per-file. Its `module-boundary`
|
|
24
|
+
* import resolution uses the *scope's* known-files set, so a warm re-audit of
|
|
25
|
+
* a changed file that imports an unchanged file can under-resolve a boundary.
|
|
26
|
+
* This is the same limitation the diff-scoped `changed` hook already has; the
|
|
27
|
+
* cold seed (full known-files) is the authoritative baseline.
|
|
28
|
+
* - `schema` (fact-based) is the only analyzer that must NOT be recomputed from
|
|
29
|
+
* a scoped run; see the escalation rule above.
|
|
30
|
+
*
|
|
31
|
+
* ## Staleness is structural, not periodic
|
|
32
|
+
*
|
|
33
|
+
* The snapshot records a content hash AND mtime per file it covers. On every
|
|
34
|
+
* call the current file set is hashed; if a file's content changed but its
|
|
35
|
+
* mtime did not, the (mtime-based) diff missed a change and that is a hard
|
|
36
|
+
* error — never a quiet re-seed. Same shape as the file-accounting balance
|
|
37
|
+
* assertion.
|
|
38
|
+
*/
|
|
39
|
+
import type { Violation } from './types.js';
|
|
40
|
+
/** Per-file record in the snapshot: content hash + mtime for the staleness gate. */
|
|
41
|
+
export interface FileRecord {
|
|
42
|
+
hash: string;
|
|
43
|
+
mtimeMs: number;
|
|
44
|
+
}
|
|
45
|
+
export interface NextFileSnapshot {
|
|
46
|
+
version: 1;
|
|
47
|
+
projectRoot: string;
|
|
48
|
+
files: Record<string, FileRecord>;
|
|
49
|
+
visitorFindings: Record<string, Violation[]>;
|
|
50
|
+
corpusFindings: Violation[];
|
|
51
|
+
schemaFindings: Violation[];
|
|
52
|
+
}
|
|
53
|
+
export interface FileDiff {
|
|
54
|
+
changed: string[];
|
|
55
|
+
added: string[];
|
|
56
|
+
deleted: string[];
|
|
57
|
+
}
|
|
58
|
+
export type StalenessReason = 'mtime-preserved-content-change' | 'missing-on-disk';
|
|
59
|
+
export interface StalenessViolation {
|
|
60
|
+
file: string;
|
|
61
|
+
reason: StalenessReason;
|
|
62
|
+
}
|
|
63
|
+
/** Hash + stat every file, keyed by project-relative path. */
|
|
64
|
+
export declare function hashAndStatFiles(files: string[], projectRoot: string): Record<string, FileRecord>;
|
|
65
|
+
/** Diff the current file set against the snapshot's recorded set. */
|
|
66
|
+
export declare function diffFiles(snapshotFiles: Record<string, FileRecord>, current: Record<string, FileRecord>): FileDiff;
|
|
67
|
+
/**
|
|
68
|
+
* Structural staleness check. Returns violations that must hard-error rather
|
|
69
|
+
* than quietly proceeding with stale cache:
|
|
70
|
+
*
|
|
71
|
+
* - `mtime-preserved-content-change`: a file's content hash changed but its
|
|
72
|
+
* mtime did not — an mtime-based diff would have missed this change.
|
|
73
|
+
* - `missing-on-disk`: a file left the current set but still exists on disk —
|
|
74
|
+
* discovery missed it, and dropping its findings would be silent data loss.
|
|
75
|
+
*/
|
|
76
|
+
export declare function assertNoStaleFiles(snapshotFiles: Record<string, FileRecord>, current: Record<string, FileRecord>, projectRoot: string): StalenessViolation[];
|
|
77
|
+
/** A structural view of one analyzer result (violations only). */
|
|
78
|
+
export interface AnalyzerResultLike {
|
|
79
|
+
violations: Violation[];
|
|
80
|
+
}
|
|
81
|
+
export interface SplitResult {
|
|
82
|
+
visitorFindings: Record<string, Violation[]>;
|
|
83
|
+
corpusFindings: Violation[];
|
|
84
|
+
schemaFindings: Violation[];
|
|
85
|
+
}
|
|
86
|
+
/** Split an audit result into file-local / corpus-DB / schema-fact buckets. */
|
|
87
|
+
export declare function splitFindings(analyzerResults: Record<string, AnalyzerResultLike>, projectRoot: string): SplitResult;
|
|
88
|
+
export interface MergeInput {
|
|
89
|
+
cachedVisitor: Record<string, Violation[]>;
|
|
90
|
+
freshVisitor: Record<string, Violation[]>;
|
|
91
|
+
freshCorpus: Violation[];
|
|
92
|
+
freshSchema: Violation[];
|
|
93
|
+
changed: string[];
|
|
94
|
+
added: string[];
|
|
95
|
+
deleted: string[];
|
|
96
|
+
}
|
|
97
|
+
export interface MergeOutput {
|
|
98
|
+
visitorFindings: Record<string, Violation[]>;
|
|
99
|
+
corpusFindings: Violation[];
|
|
100
|
+
schemaFindings: Violation[];
|
|
101
|
+
all: Violation[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Merge cached per-file findings with fresh scoped results. Unchanged files
|
|
105
|
+
* keep their cache; changed/added files are overwritten (including to empty —
|
|
106
|
+
* a fixed file must not fall back to its stale cache); deleted files drop.
|
|
107
|
+
* Corpus-DB findings are replaced wholesale (they are full-corpus); schema
|
|
108
|
+
* findings are passed through (the caller decides cache-vs-re-seed).
|
|
109
|
+
*/
|
|
110
|
+
export declare function mergeFindings(input: MergeInput): MergeOutput;
|
|
111
|
+
export interface RunNextFileResult {
|
|
112
|
+
snapshot: NextFileSnapshot;
|
|
113
|
+
violations: Violation[];
|
|
114
|
+
cold: boolean;
|
|
115
|
+
summary: NextFileSummary;
|
|
116
|
+
}
|
|
117
|
+
export interface NextFileSummary {
|
|
118
|
+
totalViolations: number;
|
|
119
|
+
criticalIssues: number;
|
|
120
|
+
warnings: number;
|
|
121
|
+
suggestions: number;
|
|
122
|
+
violationsByCategory: Record<string, number>;
|
|
123
|
+
topIssues: Array<{
|
|
124
|
+
type: string;
|
|
125
|
+
count: number;
|
|
126
|
+
}>;
|
|
127
|
+
}
|
|
128
|
+
/** Compute a summary from a merged violation set (cached + fresh). */
|
|
129
|
+
export declare function summarizeViolations(violations: Violation[]): NextFileSummary;
|
|
130
|
+
/**
|
|
131
|
+
* Orchestrate one `next-file` call. Cold (no snapshot) → full audit + seed.
|
|
132
|
+
* Warm → hash current set, assert no stale files, re-audit only changed/added,
|
|
133
|
+
* merge, and persist the refreshed snapshot. A warm call that touches a
|
|
134
|
+
* schema-definition file escalates to a full re-seed (the schema catalog can
|
|
135
|
+
* only be rebuilt correctly from the full corpus).
|
|
136
|
+
*/
|
|
137
|
+
export declare function runNextFile(options: {
|
|
138
|
+
projectRoot: string;
|
|
139
|
+
configName?: string;
|
|
140
|
+
}): Promise<RunNextFileResult>;
|
|
141
|
+
//# sourceMappingURL=nextFileIncremental.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextFileIncremental.d.ts","sourceRoot":"","sources":["../src/nextFileIncremental.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAUH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAoC5C,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,CAAC,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,cAAc,EAAE,SAAS,EAAE,CAAC;IAC5B,cAAc,EAAE,SAAS,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GAAG,gCAAgC,GAAG,iBAAiB,CAAC;AAEnF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;CACzB;AAMD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAc5B;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CACvB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACzC,OAAO,E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,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAmB5D;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,eAAe,CAiB5E;AAmBD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA4F7B"}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incremental `next-file` — snapshot + content-hash diff + per-analyzer merge.
|
|
3
|
+
*
|
|
4
|
+
* The refactoring loop (`code-audit next-file`) must not pay a full cold audit
|
|
5
|
+
* on every call, or an agent calls it once and stops. This module seeds a full
|
|
6
|
+
* audit once, persists a snapshot of (file → content hash + mtime + findings),
|
|
7
|
+
* then on each warm call hashes the current file set, re-audits only what
|
|
8
|
+
* changed, and merges per-analyzer.
|
|
9
|
+
*
|
|
10
|
+
* ## Per-analyzer cacheability (the crux of incremental correctness)
|
|
11
|
+
*
|
|
12
|
+
* Findings fall into three buckets, decided per analyzer rather than globally —
|
|
13
|
+
* a uniform "cache everything" or "recompute everything" is wrong for one of
|
|
14
|
+
* the three, and that is the part that silently corrupts a cached queue.
|
|
15
|
+
*
|
|
16
|
+
* | Bucket | Analyzers | On a warm call | Why it is safe |
|
|
17
|
+
* |--------|-----------|----------------|----------------|
|
|
18
|
+
* | **File-local** (cache per file) | solid, data-access, documentation, react, dry, schema-sql, schema-code, schema-prisma, schema-json, invariants | re-audit only changed/added files; unchanged files keep their cache | a finding on file F is a pure function of F's AST + the (session-stable) rules. `dry` cross-file findings are re-emitted from whichever file is (re)visited, so a still-broken file comes back. |
|
|
19
|
+
* | **Corpus (DB-backed)** (recompute every call) | styles, conventions, cross-domain | recompute from the scoped audit's reducer output | these reducers read the persistent SQLite index (full corpus), not the scoped file list, so their scoped-run output is already full-corpus. |
|
|
20
|
+
* | **Corpus (fact-based) — schema** (cache + escalate) | schema | reuse cached findings UNLESS a schema-definition file changed, in which case force a full re-seed | the known-tables catalog is built in-memory from the current run's visitor facts. A scoped run sees only scoped facts, so an unchanged migration's tables would vanish and query files would be falsely flagged `unknown-table`. The catalog can only change when a schema-definition file changes — detect that and re-seed; otherwise the cache is correct. |
|
|
21
|
+
*
|
|
22
|
+
* The two file-local caveats, documented rather than hidden:
|
|
23
|
+
* - `invariants` is a Stage-3 reducer that runs per-file. Its `module-boundary`
|
|
24
|
+
* import resolution uses the *scope's* known-files set, so a warm re-audit of
|
|
25
|
+
* a changed file that imports an unchanged file can under-resolve a boundary.
|
|
26
|
+
* This is the same limitation the diff-scoped `changed` hook already has; the
|
|
27
|
+
* cold seed (full known-files) is the authoritative baseline.
|
|
28
|
+
* - `schema` (fact-based) is the only analyzer that must NOT be recomputed from
|
|
29
|
+
* a scoped run; see the escalation rule above.
|
|
30
|
+
*
|
|
31
|
+
* ## Staleness is structural, not periodic
|
|
32
|
+
*
|
|
33
|
+
* The snapshot records a content hash AND mtime per file it covers. On every
|
|
34
|
+
* call the current file set is hashed; if a file's content changed but its
|
|
35
|
+
* mtime did not, the (mtime-based) diff missed a change and that is a hard
|
|
36
|
+
* error — never a quiet re-seed. Same shape as the file-accounting balance
|
|
37
|
+
* assertion.
|
|
38
|
+
*/
|
|
39
|
+
import { readFileSync, statSync, existsSync } from 'fs';
|
|
40
|
+
import { createHash } from 'crypto';
|
|
41
|
+
import { relative, resolve, join, isAbsolute } from 'path';
|
|
42
|
+
import { createAuditRunner } from './auditRunner.js';
|
|
43
|
+
import { CodeIndexDB } from './codeIndexDB.js';
|
|
44
|
+
import { findConfigFileUp, loadConfig } from './config/configLoader.js';
|
|
45
|
+
import { discoverFilesDetailed } from './utils/fileDiscovery.js';
|
|
46
|
+
const SNAPSHOT_KEY = 'next-file:snapshot';
|
|
47
|
+
/** Extensions that carry table/DDL definitions — a deleted one can shift the catalog. */
|
|
48
|
+
const SCHEMA_DEFINITION_EXTENSIONS = new Set(['.sql', '.prisma']);
|
|
49
|
+
/**
|
|
50
|
+
* File-local analyzers: a finding on F is a pure function of F's AST (+ rules).
|
|
51
|
+
* Cacheable per file. `dry` is a stage-2 visitor; its within-file findings are
|
|
52
|
+
* file-local and its cross-file findings are re-emitted from whatever file is
|
|
53
|
+
* (re)visited, so caching per file preserves the "a still-broken file comes
|
|
54
|
+
* back" guarantee. `invariants` runs per-file (see module doc caveat).
|
|
55
|
+
*/
|
|
56
|
+
const FILE_LOCAL = new Set([
|
|
57
|
+
'solid',
|
|
58
|
+
'data-access',
|
|
59
|
+
'documentation',
|
|
60
|
+
'react',
|
|
61
|
+
'dry',
|
|
62
|
+
'schema-sql',
|
|
63
|
+
'schema-code',
|
|
64
|
+
'schema-prisma',
|
|
65
|
+
'schema-json',
|
|
66
|
+
'invariants',
|
|
67
|
+
]);
|
|
68
|
+
/**
|
|
69
|
+
* Corpus (DB-backed) analyzers: findings depend on the whole corpus but are
|
|
70
|
+
* re-derived from the persistent index on every scoped run, so recomputing them
|
|
71
|
+
* each warm call is correct. Anything not listed and not `schema`/FILE_LOCAL is
|
|
72
|
+
* also treated as DB-backed (safe default: never cache what you can't prove is
|
|
73
|
+
* file-local).
|
|
74
|
+
*/
|
|
75
|
+
const CORPUS_DB = new Set(['styles', 'conventions', 'cross-domain']);
|
|
76
|
+
function sha256(data) {
|
|
77
|
+
return createHash('sha256').update(data).digest('hex');
|
|
78
|
+
}
|
|
79
|
+
/** Hash + stat every file, keyed by project-relative path. */
|
|
80
|
+
export function hashAndStatFiles(files, projectRoot) {
|
|
81
|
+
const out = {};
|
|
82
|
+
for (const file of files) {
|
|
83
|
+
const abs = isAbsolute(file) ? file : join(projectRoot, file);
|
|
84
|
+
try {
|
|
85
|
+
out[relative(projectRoot, abs)] = {
|
|
86
|
+
hash: sha256(readFileSync(abs)),
|
|
87
|
+
mtimeMs: statSync(abs).mtimeMs,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// Unreadable (deleted between discovery and hash) — excluded from the set.
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/** Diff the current file set against the snapshot's recorded set. */
|
|
97
|
+
export function diffFiles(snapshotFiles, current) {
|
|
98
|
+
const changed = [];
|
|
99
|
+
const added = [];
|
|
100
|
+
const deleted = [];
|
|
101
|
+
for (const [rel, rec] of Object.entries(current)) {
|
|
102
|
+
const prev = snapshotFiles[rel];
|
|
103
|
+
if (!prev)
|
|
104
|
+
added.push(rel);
|
|
105
|
+
else if (prev.hash !== rec.hash)
|
|
106
|
+
changed.push(rel);
|
|
107
|
+
}
|
|
108
|
+
for (const rel of Object.keys(snapshotFiles)) {
|
|
109
|
+
if (!(rel in current))
|
|
110
|
+
deleted.push(rel);
|
|
111
|
+
}
|
|
112
|
+
// Sort for deterministic output.
|
|
113
|
+
changed.sort();
|
|
114
|
+
added.sort();
|
|
115
|
+
deleted.sort();
|
|
116
|
+
return { changed, added, deleted };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Structural staleness check. Returns violations that must hard-error rather
|
|
120
|
+
* than quietly proceeding with stale cache:
|
|
121
|
+
*
|
|
122
|
+
* - `mtime-preserved-content-change`: a file's content hash changed but its
|
|
123
|
+
* mtime did not — an mtime-based diff would have missed this change.
|
|
124
|
+
* - `missing-on-disk`: a file left the current set but still exists on disk —
|
|
125
|
+
* discovery missed it, and dropping its findings would be silent data loss.
|
|
126
|
+
*/
|
|
127
|
+
export function assertNoStaleFiles(snapshotFiles, current, projectRoot) {
|
|
128
|
+
const out = [];
|
|
129
|
+
for (const [rel, prev] of Object.entries(snapshotFiles)) {
|
|
130
|
+
const cur = current[rel];
|
|
131
|
+
if (!cur) {
|
|
132
|
+
if (existsSync(join(projectRoot, rel))) {
|
|
133
|
+
out.push({ file: rel, reason: 'missing-on-disk' });
|
|
134
|
+
}
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (prev.hash !== cur.hash && prev.mtimeMs === cur.mtimeMs) {
|
|
138
|
+
out.push({ file: rel, reason: 'mtime-preserved-content-change' });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
/** Split an audit result into file-local / corpus-DB / schema-fact buckets. */
|
|
144
|
+
export function splitFindings(analyzerResults, projectRoot) {
|
|
145
|
+
const visitorFindings = {};
|
|
146
|
+
const corpusFindings = [];
|
|
147
|
+
const schemaFindings = [];
|
|
148
|
+
for (const [name, ar] of Object.entries(analyzerResults)) {
|
|
149
|
+
const vs = ar.violations || [];
|
|
150
|
+
if (FILE_LOCAL.has(name)) {
|
|
151
|
+
for (const v of vs) {
|
|
152
|
+
const rel = relative(projectRoot, v.file || '');
|
|
153
|
+
(visitorFindings[rel] = visitorFindings[rel] || []).push(v);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else if (name === 'schema') {
|
|
157
|
+
schemaFindings.push(...vs);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// CORPUS_DB or unknown — recompute each warm call (safe: DB-backed).
|
|
161
|
+
corpusFindings.push(...vs);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { visitorFindings, corpusFindings, schemaFindings };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Merge cached per-file findings with fresh scoped results. Unchanged files
|
|
168
|
+
* keep their cache; changed/added files are overwritten (including to empty —
|
|
169
|
+
* a fixed file must not fall back to its stale cache); deleted files drop.
|
|
170
|
+
* Corpus-DB findings are replaced wholesale (they are full-corpus); schema
|
|
171
|
+
* findings are passed through (the caller decides cache-vs-re-seed).
|
|
172
|
+
*/
|
|
173
|
+
export function mergeFindings(input) {
|
|
174
|
+
const drop = new Set([...input.deleted, ...input.changed, ...input.added]);
|
|
175
|
+
const visitorFindings = {};
|
|
176
|
+
for (const [rel, vs] of Object.entries(input.cachedVisitor)) {
|
|
177
|
+
if (!drop.has(rel))
|
|
178
|
+
visitorFindings[rel] = vs;
|
|
179
|
+
}
|
|
180
|
+
for (const rel of [...input.changed, ...input.added]) {
|
|
181
|
+
visitorFindings[rel] = input.freshVisitor[rel] || [];
|
|
182
|
+
}
|
|
183
|
+
const corpusFindings = input.freshCorpus;
|
|
184
|
+
const schemaFindings = input.freshSchema;
|
|
185
|
+
const all = [
|
|
186
|
+
...Object.values(visitorFindings).flat(),
|
|
187
|
+
...corpusFindings,
|
|
188
|
+
...schemaFindings,
|
|
189
|
+
];
|
|
190
|
+
return { visitorFindings, corpusFindings, schemaFindings, all };
|
|
191
|
+
}
|
|
192
|
+
/** Compute a summary from a merged violation set (cached + fresh). */
|
|
193
|
+
export function summarizeViolations(violations) {
|
|
194
|
+
let criticalIssues = 0;
|
|
195
|
+
let warnings = 0;
|
|
196
|
+
let suggestions = 0;
|
|
197
|
+
const violationsByCategory = {};
|
|
198
|
+
for (const v of violations) {
|
|
199
|
+
if (v.severity === 'critical')
|
|
200
|
+
criticalIssues++;
|
|
201
|
+
else if (v.severity === 'warning')
|
|
202
|
+
warnings++;
|
|
203
|
+
else if (v.severity === 'suggestion')
|
|
204
|
+
suggestions++;
|
|
205
|
+
const cat = v.analyzer || v.type || 'other';
|
|
206
|
+
violationsByCategory[cat] = (violationsByCategory[cat] || 0) + 1;
|
|
207
|
+
}
|
|
208
|
+
const topIssues = Object.entries(violationsByCategory)
|
|
209
|
+
.sort(([, a], [, b]) => b - a)
|
|
210
|
+
.slice(0, 5)
|
|
211
|
+
.map(([type, count]) => ({ type, count }));
|
|
212
|
+
return { totalViolations: violations.length, criticalIssues, warnings, suggestions, violationsByCategory, topIssues };
|
|
213
|
+
}
|
|
214
|
+
/** The three-violation arrays flattened into one, in a stable order. */
|
|
215
|
+
function flatten(s) {
|
|
216
|
+
return [...Object.values(s.visitorFindings).flat(), ...s.corpusFindings, ...s.schemaFindings];
|
|
217
|
+
}
|
|
218
|
+
/** Build a snapshot from a full-audit result split. */
|
|
219
|
+
function seedSnapshot(root, files, split) {
|
|
220
|
+
return {
|
|
221
|
+
version: 1,
|
|
222
|
+
projectRoot: root,
|
|
223
|
+
files,
|
|
224
|
+
visitorFindings: split.visitorFindings,
|
|
225
|
+
corpusFindings: split.corpusFindings,
|
|
226
|
+
schemaFindings: split.schemaFindings,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Orchestrate one `next-file` call. Cold (no snapshot) → full audit + seed.
|
|
231
|
+
* Warm → hash current set, assert no stale files, re-audit only changed/added,
|
|
232
|
+
* merge, and persist the refreshed snapshot. A warm call that touches a
|
|
233
|
+
* schema-definition file escalates to a full re-seed (the schema catalog can
|
|
234
|
+
* only be rebuilt correctly from the full corpus).
|
|
235
|
+
*/
|
|
236
|
+
export async function runNextFile(options) {
|
|
237
|
+
const root = resolve(options.projectRoot || process.cwd());
|
|
238
|
+
// Load config (walk-up) so discovery matches what the audit actually sees.
|
|
239
|
+
const configPath = await findConfigFileUp(root);
|
|
240
|
+
const config = await loadConfig({ configPath: configPath ?? undefined });
|
|
241
|
+
const discovered = await discoverFilesDetailed(root, {
|
|
242
|
+
includePaths: config.includePaths,
|
|
243
|
+
excludePaths: config.excludePaths,
|
|
244
|
+
});
|
|
245
|
+
const current = hashAndStatFiles(discovered.files, root);
|
|
246
|
+
const db = CodeIndexDB.getInstance(undefined, root);
|
|
247
|
+
await db.initialize();
|
|
248
|
+
const raw = db.getMeta(SNAPSHOT_KEY);
|
|
249
|
+
const snapshot = raw ? JSON.parse(raw) : null;
|
|
250
|
+
// Shared full-audit-and-seed (cold path + schema escalation).
|
|
251
|
+
const fullSeed = async () => {
|
|
252
|
+
const runner = createAuditRunner({ projectRoot: root, configName: options.configName });
|
|
253
|
+
const result = await runner.run();
|
|
254
|
+
const split = splitFindings(result.analyzerResults, root);
|
|
255
|
+
const seeded = seedSnapshot(root, current, split);
|
|
256
|
+
db.setMeta(SNAPSHOT_KEY, JSON.stringify(seeded));
|
|
257
|
+
return { snapshot: seeded, violations: flatten(seeded), cold: true, summary: summarizeViolations(flatten(seeded)) };
|
|
258
|
+
};
|
|
259
|
+
if (!snapshot) {
|
|
260
|
+
return fullSeed();
|
|
261
|
+
}
|
|
262
|
+
const diff = diffFiles(snapshot.files, current);
|
|
263
|
+
const stale = assertNoStaleFiles(snapshot.files, current, root);
|
|
264
|
+
if (stale.length > 0) {
|
|
265
|
+
const detail = stale
|
|
266
|
+
.map((s) => `${s.file}: ${s.reason}`)
|
|
267
|
+
.join('; ');
|
|
268
|
+
throw new Error(`next-file: structural staleness check failed — the diff missed a change. ` +
|
|
269
|
+
`Refusing to proceed with a stale cache. ${detail}`);
|
|
270
|
+
}
|
|
271
|
+
if (diff.changed.length === 0 && diff.added.length === 0 && diff.deleted.length === 0) {
|
|
272
|
+
// Nothing changed — reuse the cached queue wholesale.
|
|
273
|
+
return { snapshot, violations: flatten(snapshot), cold: false, summary: summarizeViolations(flatten(snapshot)) };
|
|
274
|
+
}
|
|
275
|
+
const scopeFiles = [...diff.changed, ...diff.added].map((rel) => join(root, rel));
|
|
276
|
+
const runner = createAuditRunner({
|
|
277
|
+
projectRoot: root,
|
|
278
|
+
configName: options.configName,
|
|
279
|
+
scope: scopeFiles,
|
|
280
|
+
});
|
|
281
|
+
const result = await runner.run();
|
|
282
|
+
const fresh = splitFindings(result.analyzerResults, root);
|
|
283
|
+
// Schema catalog hazard: the known-tables catalog is rebuilt in-memory from a
|
|
284
|
+
// run's visitor facts, so a scoped run only sees the tables *changed* files
|
|
285
|
+
// define. If a changed/added file defined any table (a non-empty tableCatalog
|
|
286
|
+
// in this scoped run) — or a schema-definition file was deleted — the catalog
|
|
287
|
+
// may have shifted and must be rebuilt from the full corpus: escalate to a
|
|
288
|
+
// full re-seed rather than return a silently-wrong unknown-table verdict.
|
|
289
|
+
const schemaCatalogTouched = (result.metadata?.tableCatalog?.length ?? 0) > 0;
|
|
290
|
+
const schemaDefinitionDeleted = diff.deleted.some((rel) => SCHEMA_DEFINITION_EXTENSIONS.has(rel.slice(rel.lastIndexOf('.'))));
|
|
291
|
+
if (schemaCatalogTouched || schemaDefinitionDeleted) {
|
|
292
|
+
return fullSeed();
|
|
293
|
+
}
|
|
294
|
+
const merged = mergeFindings({
|
|
295
|
+
cachedVisitor: snapshot.visitorFindings,
|
|
296
|
+
freshVisitor: fresh.visitorFindings,
|
|
297
|
+
freshCorpus: fresh.corpusFindings,
|
|
298
|
+
freshSchema: snapshot.schemaFindings,
|
|
299
|
+
changed: diff.changed,
|
|
300
|
+
added: diff.added,
|
|
301
|
+
deleted: diff.deleted,
|
|
302
|
+
});
|
|
303
|
+
const refreshed = {
|
|
304
|
+
version: 1,
|
|
305
|
+
projectRoot: root,
|
|
306
|
+
files: current,
|
|
307
|
+
visitorFindings: merged.visitorFindings,
|
|
308
|
+
corpusFindings: merged.corpusFindings,
|
|
309
|
+
schemaFindings: merged.schemaFindings,
|
|
310
|
+
};
|
|
311
|
+
db.setMeta(SNAPSHOT_KEY, JSON.stringify(refreshed));
|
|
312
|
+
return { snapshot: refreshed, violations: merged.all, cold: false, summary: summarizeViolations(merged.all) };
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=nextFileIncremental.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextFileIncremental.js","sourceRoot":"","sources":["../src/nextFileIncremental.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAE1C,yFAAyF;AACzF,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,OAAO;IACP,aAAa;IACb,eAAe;IACf,OAAO;IACP,KAAK;IACL,YAAY;IACZ,aAAa;IACb,eAAe;IACf,aAAa;IACb,YAAY;CACb,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AA8BrE,SAAS,MAAM,CAAC,IAAqB;IACnC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,8DAA8D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AK,OAAO,CAAC,IAAI,CAAC,GAC5D,OAAO,CAAC;IACT,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC,CAcD;AAID;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM;YACrC,aAAa;;EAC/B;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM;YACpC,aAAa;;EAC/B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAKhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAK/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAE/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAE/D;AA4CD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOrG;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EAC/C,MAAM,EAAE,cAAc,EACtB,aAAa,CAAC,EAAE,aAAa,EAC7B,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,GACzD,YAAY,EAAE,CAwIhB"}
|
package/dist/pipeline.js
CHANGED
|
@@ -425,6 +425,8 @@ async function runStage3(allFacts, reducers, config, indexHandle) {
|
|
|
425
425
|
indexHandle,
|
|
426
426
|
abortSignal: config.abortSignal,
|
|
427
427
|
readSource,
|
|
428
|
+
isScoped: config.isScoped,
|
|
429
|
+
styleContributingFiles: config.styleContributingFiles,
|
|
428
430
|
};
|
|
429
431
|
try {
|
|
430
432
|
const r0 = performance.now();
|
|
@@ -494,6 +496,8 @@ async function runStage4(allFacts, derivedReducers, config, indexHandle) {
|
|
|
494
496
|
config: reducerConfig,
|
|
495
497
|
indexHandle,
|
|
496
498
|
abortSignal: config.abortSignal,
|
|
499
|
+
isScoped: config.isScoped,
|
|
500
|
+
styleContributingFiles: config.styleContributingFiles,
|
|
497
501
|
};
|
|
498
502
|
try {
|
|
499
503
|
const r0 = performance.now();
|
|
@@ -759,6 +763,7 @@ export async function runPipeline(config, indexHandle) {
|
|
|
759
763
|
ruleId,
|
|
760
764
|
applicable: app.applicable,
|
|
761
765
|
reason: app.reason,
|
|
766
|
+
kind: app.kind,
|
|
762
767
|
})),
|
|
763
768
|
tableCatalog,
|
|
764
769
|
...(skippedFiles.length > 0 && { skippedFiles }),
|
|
@@ -954,6 +959,21 @@ export function buildCoverageReport(analyzerResults, config, inputPresence, rule
|
|
|
954
959
|
if (!(analyzerName in (config.config ?? {}))) {
|
|
955
960
|
continue;
|
|
956
961
|
}
|
|
962
|
+
// Spec 44 bucket 2 — a `cannot-fire` rule is broken in the tool (its
|
|
963
|
+
// predicate reads a field no extractor populates). That verdict holds on
|
|
964
|
+
// every run regardless of whether the analyzer found input, so it precedes
|
|
965
|
+
// the run-status checks below.
|
|
966
|
+
const cannotFire = ruleApplicability?.get(ruleId);
|
|
967
|
+
if (cannotFire && !cannotFire.applicable && cannotFire.kind === 'cannot-fire') {
|
|
968
|
+
coverage.push({
|
|
969
|
+
ruleId,
|
|
970
|
+
analyzer: analyzerName,
|
|
971
|
+
state: 'cannot-fire',
|
|
972
|
+
count: 0,
|
|
973
|
+
reason: cannotFire.reason,
|
|
974
|
+
});
|
|
975
|
+
continue;
|
|
976
|
+
}
|
|
957
977
|
const result = analyzerResults[analyzerName];
|
|
958
978
|
// Analyzer not in results → notRun-equivalent
|
|
959
979
|
if (!result) {
|
|
@@ -1018,6 +1038,8 @@ export function buildCoverageReport(analyzerResults, config, inputPresence, rule
|
|
|
1018
1038
|
}
|
|
1019
1039
|
// Spec 39 — derived applicability. A rule whose predicate evaluated false is
|
|
1020
1040
|
// `notApplicable` with the predicate's reason, before any finding is counted.
|
|
1041
|
+
// (`cannot-fire` was already reported above; only per-corpus `notApplicable`
|
|
1042
|
+
// reaches this branch.)
|
|
1021
1043
|
const applicability = ruleApplicability?.get(ruleId);
|
|
1022
1044
|
if (applicability && !applicability.applicable) {
|
|
1023
1045
|
coverage.push({
|