import type { GoalAcceptanceContract, GoalTerminalReceipt, GoalFlightEventRecord } from "../core/goal-bound.js"; type Span = { start: number; end: number; }; type Check = Span & { command: string; passed: boolean; }; export interface DebriefSession { readonly id: string; readonly root: boolean; readonly spans: Span[]; readonly checks: Check[]; readonly mutations: Span[]; readonly models: Record; /** Optional per-model input/cache/cost observations for compatibility with older snapshots. */ readonly modelUsage?: Record; readonly reviews: Array<{ at: number; status: "PASS" | "FAIL" | "WAIVED"; source?: "reviewer" | "controller"; }>; readonly tasks: string[]; complete: boolean; timingComplete: boolean; failed: boolean; lastPossibleMutation?: number; } export interface DebriefObservation { readonly complete: boolean; readonly sessions: readonly DebriefSession[]; readonly window: Span | undefined; } export interface Debrief { readonly pack: readonly { readonly model: string; readonly count: number; }[] | null; readonly mix: readonly { readonly model: string; readonly tokens: number; readonly percent: number; readonly inputCache?: { readonly uncachedInputTokens: number; readonly cacheReadTokens: number; readonly cacheWriteTokens: number; }; readonly hostCostZero?: boolean; }[] | null; readonly estimatedCost?: { readonly usd: number; readonly pricedRequests: number; readonly unpricedRequests: number; }; readonly validation: "PASS" | "FAIL" | "未確認"; readonly review: "PASS" | "FAIL" | "WAIVED" | "未確認"; readonly reviewSource?: "reviewer" | "controller"; readonly notes?: readonly string[]; readonly traits: readonly ("連携作戦" | "修正から復帰" | "一発完遂")[]; readonly firstPassEligible?: boolean; readonly overlap?: { readonly workerMilliseconds: number; readonly wallMilliseconds: number; }; readonly validationEfficiency: { readonly completed: number; readonly skipped: number; readonly rejected: number; readonly redundantMilliseconds: number; readonly medianMilliseconds: number | null; readonly p90Milliseconds: number | null; }; } /** Extract only bounded typed metadata during the existing host history traversal. No conversation text survives. */ export declare function observeDebriefSession(id: string, root: boolean, messages: readonly Record[], window?: Span): DebriefSession; export declare function buildDebrief(receipt: GoalTerminalReceipt, contract: GoalAcceptanceContract | null, observation: DebriefObservation | undefined, records?: readonly GoalFlightEventRecord[]): Debrief; export declare function renderDebrief(debrief: Debrief | undefined): string[]; export declare function renderDebriefProof(debrief: Debrief | undefined): { validation: string; review: string; }; export {};