/** * One run, folded into the facts the review counts (DES-RUNS-REVIEW-001 §4). Pure: a `SessionView` and its recorded * events in, a {@link RunFact} out. Nothing here is estimated; a value the events do not carry is `null` or 0 and * says so (`spendReported`). */ import type { SessionView } from 'wicked-crew-api-types'; /** A recorded event as `runEvents` returns it: the frame plus `ts` (epoch ms). Read loosely, field by field. */ export type LooseEvent = { type: string; ts?: number; ord?: number; } & Record; export type RunOutcome = 'passed' | 'failed' | 'cancelled' | 'open'; export interface RunOverride { ord: number; /** The escalation's condition (`floor_failed`, `judge_unavailable`, …), else `unknown`. */ condition: string; /** What denied it (`repo_checks`, `substance`, …), when the engine said. */ source: string | null; } export interface RunFact { id: string; title: string; workflow: string; repo: string | null; projectId: string | null; /** Every CLI that was assigned a unit. */ agents: string[]; createdAtMs: number; endedAtMs: number | null; status: string; outcome: RunOutcome; deliverRequested: boolean; delivered: boolean; archived: boolean; /** Launch → the end of a delivered run, ms. `null` when nothing was delivered. */ timeToPrMs: number | null; /** Σ repo-check durations, ms (0 when no floor ran). */ floorMs: number; /** Σ time parked on a person, ms (a gate or an escalation, until it was decided). */ waitHumanMs: number; overrides: RunOverride[]; spendUsd: number; /** Whether any `cliUsage` frame carried a cost (an unreported CLI reads 0, which is not "free"). */ spendReported: boolean; tokens: number; /** Reassignments plus failed steps. */ retries: number; stalls: number; benched: { cli: string; reason: string; }[]; /** For a failed run: what stopped it, as one comparable line. */ failureSignature: string | null; /** A failure nobody archived, or a run open for over a day. */ unresolved: boolean; } /** A run open longer than this is unresolved (it is waiting on someone, or stuck). */ export declare const STALE_OPEN_MS: number; /** `created_at` is epoch seconds on the wire; a value already in ms is kept. */ export declare function epochMs(v: unknown): number; export declare function runFactOf(view: SessionView, events: readonly LooseEvent[], nowMs: number): RunFact; //# sourceMappingURL=run-facts.d.ts.map