/** * Backing detector — classifies each red line as `cli-backed`, `partial`, * or `prose-only`. The classifier already sets the backing for catalog hits * (cli-backed when an enforcer file path is present). This module exists to * handle the post-classification nuances: heuristics for the "partial" tier * (a gate exists but the LLM can bypass it), verification that the enforcer * file exists on disk, and — since A9 of the 2026-09-15 diagnosis — * verification that the enforcer is actually reachable from a call site. * * `cli-backed` means "a CLI surface runs this rule". A file that exists but * that nothing imports runs nothing, so it is `prose-only` with the same * weight as an unwritten rule. Callers pass the live set from * `enforcer-liveness.ts`; `null` means "liveness undecidable for this * project" (no `src/` tree), in which case the existing file is trusted. */ import type { RedLineEntry } from './types.js'; /** * `liveEnforcers` is the set of enforcerRefs with a call site (see * `enforcer-liveness.ts`), or `null` when the project has no `src/` tree to * scan and liveness therefore cannot be decided. */ export type LiveEnforcerSet = ReadonlySet | null; export interface BackingResult { readonly entry: RedLineEntry; readonly enforcerExists: boolean; /** True when the enforcer file exists but no call site imports it. */ readonly enforcerDead: boolean; } /** * Re-classify a single RedLineEntry. Returns a new entry with the * `backing` field updated; `enforcerRef` is preserved even when the * backing is downgraded, because the dead reference is the triage * information the report needs. */ export declare function classifyBacking(entry: RedLineEntry, projectRoot: string, liveEnforcers: LiveEnforcerSet): BackingResult; export interface BackingBatchResult { readonly entries: readonly RedLineEntry[]; readonly warnings: readonly string[]; /** Sorted, deduplicated enforcerRefs downgraded for having no call site. */ readonly deadEnforcers: readonly string[]; } export declare function classifyBackingBatch(entries: readonly RedLineEntry[], projectRoot: string, liveEnforcers: LiveEnforcerSet): BackingBatchResult;