/** * Real cases, captured from the run store (DES-DEFAULT-EVALS-001 §4). Pure: runs, their events, the operator's * gate decisions and the QE ledger's verdicts in; cases out. Idempotent: a case id is derived from the run, unit and * event it came from, so capturing twice yields the same cases. * * `observed` is always what the system recorded THEN (`by: 'recorded'`). `expected` comes from the operator's answer * at the gate when it says something about the class, else from a deterministic rule over the case's own evidence. * A case is only made when such a label exists: a label that merely repeats the observation would inflate agreement. */ import type { EvalCase } from './types.js'; /** The slice of a run (`GET /runs` row: `{session, units}`) capture reads. */ export interface RunLike { session: Record; units: Array>; } /** One engine event (`GET /runs/:id/events`). */ export interface EventLike { type: string; ord?: number; seq?: number; ts?: number; [k: string]: unknown; } /** One operator decision (`GET /decisions` row). */ export interface DecisionLike { id: string; at: number; host?: string; origin: { run_id?: string | null; ord?: number | null; choice?: string | null; }; } /** One QE ledger verdict of a run. */ export interface QeVerdictLike { runId: string; id: string; verdict: string; reason: string; tree: string | null; createdAt: string; } export interface CaptureInput { runs: RunLike[]; events: (runId: string) => EventLike[]; decisions: DecisionLike[]; qeVerdicts: QeVerdictLike[]; } /** The place a run belongs to: its project, else its repo. */ export declare function placeOf(session: Record): string | null; /** Short, path-free text for a case input: home paths and absolute paths are cut, length capped. */ export declare function scrub(text: string, max?: number): string; export declare const FLOOR_CLASSES: readonly ["pass", "real_fail", "base_red", "inconclusive", "boundary_deny"]; export type FloorClass = (typeof FLOOR_CLASSES)[number]; /** What a floor's own check outcomes say it is (the rule the escalation class must agree with). */ export declare function floorClassOf(ev: EventLike): FloorClass; /** What the engine TOLD the operator: the escalation's condition, read with the floor it sits on. */ export declare function engineFloorClass(esc: EventLike, floor: EventLike | null): FloorClass; /** What the floor's own evidence says an escalation on it is. An escalation is never a pass: a floor with no * failing row behind a denial could not say what failed (inconclusive). */ export declare function ruleFloorClass(esc: EventLike, floor: EventLike | null): FloorClass; export declare function captureFloorCases(input: CaptureInput): EvalCase[]; /** * The verdict a QE reason states in its own words, read conservatively: only an explicit verdict token counts, at * the very start of the reason (after an optional `[tag]`), or after `verdict:` or a colon (`review: PASS.`). * Prose that merely mentions passing or failing ("no tests failed", "cannot pass") states no verdict: `null`, * and the case is left unlabelled rather than labelled wrong. */ export declare function verdictInReason(reason: string): 'PASS' | 'FAIL' | 'INCONCLUSIVE' | null; /** The tree the run's QE decision named last at or before `at` (ms); `null` when none did. */ export declare function qeTreeAt(events: readonly EventLike[], at: number): string | null; export declare function captureQeCases(input: CaptureInput): EvalCase[]; /** * The seats whose attempts on a unit changed the tree, and the last of them. One chronological pass: the seat in * force is the latest of the engine's own seat events for the unit (`skillsSnapshotHanded {cli}` for an attempt, * `unitReassigned.newCli`, a `stepFailed` "failing over to"); the plan-time `unitDistributed.cli` is only the * starting point (it can name a seat the unit never ran on). An attempt is an author only when its floor recorded * changed paths. `null` when the unit ran no floor (nothing to read). */ export declare function changingSeats(events: readonly EventLike[], ord: number, firstCli: string | null): { authors: string[]; last: string | null; } | null; export declare function captureAttributionCases(input: CaptureInput): EvalCase[]; /** An input-governance deny the operator then let through is a candidate false alarm; one they stopped stood. */ export declare function captureSteeringDenials(input: CaptureInput): EvalCase[]; /** The workflow a person launched → the garden archetype it is. System workflows are not a routing choice. */ export declare function archetypeOfWorkflow(workflowId: string): string | null; export declare function captureArchetypeCases(input: CaptureInput): EvalCase[]; /** Every real case the run store yields. */ export declare function captureAll(input: CaptureInput): EvalCase[]; //# sourceMappingURL=capture.d.ts.map