/** * Cross-Domain Analyzer — Spec 15. * * Post-analysis analyzer that queries the SQLite database for cross-domain * findings no single per-file analyzer can produce: * * R1 — Schema Lifecycle: * cross-domain/written-never-read — Table written but never read * cross-domain/read-never-written — Table read but never written * cross-domain/transaction-boundary — Function writes to too many tables * * R3 — Validation Bypass (future): * cross-domain/validation-bypass — Writer doesn't reach a validator * * R4 — Coverage by Importance: * cross-domain/uncovered-risk — Top-risk function with no test coverage * * All findings enter at suggestion severity per the entry rule. * Higher tiers require Spec 11 R5 recalibration bars (precision ≥ 0.95 * AND judged-true ≥ 0.90) on real-corpus evidence. */ import type { AnalyzerResult } from '../../types.js'; import { UniversalAnalyzer } from '../../languages/UniversalAnalyzer.js'; export declare class CrossDomainAnalyzer extends UniversalAnalyzer { readonly name = "cross-domain"; readonly description = "Detects cross-domain issues (schema lifecycle, validation bypass, coverage gaps)"; readonly category = "architecture"; /** * Full override: query the code index DB for cross-domain findings. * The base-class per-file AST loop is bypassed — all detection is * post-analysis across the indexed data. */ analyze(files: string[], config?: any, options?: any): Promise; /** No-op — all detection is DB-based. */ analyzeAST(): Promise; /** * Detect tables that are written to (INSERT/UPDATE/DELETE/CREATE) but * never read from (SELECT). These might be dead writes or missed read paths. */ private detectWrittenNeverRead; /** * Detect tables that are read from (SELECT) but never written to * (INSERT/UPDATE/DELETE/CREATE). These may be external/managed tables * or indicate missing write coverage. */ private detectReadNeverWritten; /** * Detect functions that write to ≥ txnTableMax distinct tables, including * tables written by depth-1 callees via the call graph (graph_cache). * * This surfaces functions that may have transaction-boundary risk: * writing to too many tables in a single logical operation can lead to * long-running transactions, lock contention, and partial-failure complexity. */ private detectTransactionBoundaryRisk; /** * Detect write functions that don't reach a validator, when a majority of * peer writers in the same directory do (BFS ≤ configurable depth). * * Validator identification (priority order): * 1. User-configured validators list * 2. Provenanced: exported functions in files importing VALIDATOR_PACKAGES * 3. Heuristic fallback: name GLOB 'validate*' OR 'assert*' (when both * above are silent) */ private detectValidationBypass; /** * Detect exported, high-risk functions with no test coverage. * Uses the getUntestedTopDecile() query that joins functions with * hotspot_scores and coverage_data to find untested high-risk functions. * * Static-reach fallback: when no measured coverage exists, falls back * to static reach analysis from test files (BFS from test-file functions * into the call graph). */ private detectUncoveredRisk; /** * BFS through the call graph (graph_cache) up to maxDepth to check if * any path from startFuncId reaches a validator function ID. */ private bfsReachesValidator; } //# sourceMappingURL=CrossDomainAnalyzer.d.ts.map