import { type RiskTier } from "./risk-tiers.js"; export interface RedFinding { trapId: string; severity: "warn" | "block"; description: string; resolvedAt?: string; } export interface RedFindings { riskTier: RiskTier; probesRun: number; findingsCount: number; findings: RedFinding[]; modelCallMade: boolean; modelUsed?: string; budgetUsedUsd: number; } /** Minimal interface for the Anthropic model client (mockable in tests). */ export interface MockModelClient { complete(prompt: string): Promise<{ findings: RedFinding[]; tokensUsed: number; costUsd: number; model?: string; }>; } export interface RunRedPhaseOptions { /** Inject a mock or real Anthropic client. Required for release_critical tier. */ modelClient?: MockModelClient; /** Callback fired with each ledger event produced by the phase. */ onLedgerEvent?: (event: RedLedgerEvent) => void; } export interface RedLedgerEvent { type: "red_phase_findings"; runId?: string; riskTier: RiskTier; probesRun: number; findingsCount: number; modelCallMade: boolean; timestamp: string; } export interface PatchInput { patchId: string; diff: string; changedFiles: string[]; } /** * Runs the Red phase for a given patch and risk tier. * * - baseline: programmatic probes only, no model call * - high_risk: paranoid programmatic scan, no model call * - release_critical: paranoid scan + one configured model-client call */ export declare function runRedPhase(patch: PatchInput, tier: RiskTier, blueBudgetUsd: number, options?: RunRedPhaseOptions): Promise; /** * Returns true only if the findings contain zero block-severity entries. * A single block finding rejects the patch regardless of warn count. */ export declare function shouldAcceptPatch(findings: RedFindings): boolean; /** * Convenience builder for RedFindings — useful in tests and policy engine. */ export declare function buildRedFindings(input: Partial & { riskTier: RiskTier; findings: RedFinding[]; }): RedFindings;