/** * Streaming Checks — stateless, pre-compiled pattern matchers for real-time verification. * * Extracts the regex-based formal verification checks from the existing * formal-verifier.ts into standalone StreamingCheck objects. Also loads * learned rules from the catalog and compiles them into the same format. * * All regex patterns are created once at module load time and reused across * invocations. The `runChecks` function targets <10ms for the full check set * against a single code unit. */ import type { StreamingCheck, CompiledCheckSet, CodeUnit, VerificationEvent } from './types.js'; import type { LearnedRule } from '../lib/learned-rules/types.js'; /** * Returns all hand-crafted formal checks as StreamingCheck objects. * * These cover the key vulnerability patterns from formal-verifier.ts, * adapted for streaming (line/statement-level) detection during generation. */ export declare function getFormalChecks(): StreamingCheck[]; /** * Derive context keywords for a learned rule based on its name, description, * and category. Returns undefined if no specific context can be inferred * (the rule will run against all code units). */ declare function deriveContextKeywords(rule: LearnedRule): string[] | undefined; /** * Extract literal substrings (4+ alphanumeric chars) from a regex pattern. * These are likely the actual identifiers the rule is looking for. */ declare function extractRegexLiterals(regexStr: string): string[]; /** * Load learned rules from the catalog and convert them to StreamingCheck format. * * Default path: `.assay/learned/rules.json` relative to process.cwd(). * Falls back to an empty set if the file doesn't exist (starter rules * are loaded separately by getFormalChecks equivalent in the catalog). * * Each rule is assigned contextKeywords for relevance filtering — the check * only runs on code units that contain at least one keyword. */ export declare function loadLearnedChecks(catalogPath?: string): StreamingCheck[]; export { deriveContextKeywords as _deriveContextKeywords, extractRegexLiterals as _extractRegexLiterals }; /** * Filter checks by language and return a pre-compiled set ready for fast execution. * * If no checks are provided, uses the built-in formal checks. */ export declare function compileCheckSet(language: string, checks?: StreamingCheck[]): CompiledCheckSet; /** * Run all checks in the set against a code unit. Returns verification events. * * Designed to complete in <10ms for the full check set against a typical code unit. */ export declare function runChecks(unit: CodeUnit, checkSet: CompiledCheckSet): VerificationEvent[];