import type { AuditResult, Finding, ClassifyContext, Confidence, TokenMap, LyseConfig } from "../types.js"; /** * Build the ClassifyContext that confidence classification needs from audit * output. Single source of truth for the token fallback + component-set * derivation, used by the audit pipeline's confidence classification. */ export declare function buildClassifyContext(findings: Finding[], tokens: TokenMap | null | undefined, config: LyseConfig, repoRoot?: string, resolver?: ClassifyContext["resolver"]): ClassifyContext; /** * Dispatcher that delegates classifyConfidence to the rule that owns the finding. * Returns "low" (safe default) for unknown rules or rules without classifyConfidence. * * Open-Closed Principle: each rule owns its confidence classification logic. * This function is a thin dispatch layer, not a policy layer. */ export declare function classifyConfidence(finding: Finding, ctx: ClassifyContext): Confidence; /** * Populate `Finding.confidence` on every finding in an AuditResult. Downstream * CLI consumers (score gauge, ESLint-style tag, post-audit menu) all read * `finding.confidence`. * * PRECEDENCE — two independent signals, composed most-conservative-wins: * 1. The confidence the rule set at emit time (resolver-driven rules; see * tokens/no-hardcoded-color). The resolver IS repo-wide context available * at emit time, so those rules already know their drift class. * 2. The owning rule's `classifyConfidence` hook — the rule's own * false-positive suppression (AST role, alpha channel, token-definition * file), which repo-wide context alone cannot see. * * The hook may only DEMOTE the emission value, never promote it: a rule that * says "this is a functional-role color, grade it low" must still win over a * resolver that found an exact token match. When a finding carries NO emission * value, the hook's verdict is used verbatim — unchanged behaviour for every * rule that does not set one. When the owning rule has no hook at all, the * emission value stands: the dispatcher's "low" safe-default is the absence of * an opinion, not a demotion. * * Returns a NEW result with new finding objects (no in-place mutation) so * cached or reused references stay untouched. */ export declare function populateConfidence(result: AuditResult, ctx: ClassifyContext): AuditResult;