/** * What a verification run is DOING, while it is still doing it. * * A verification takes tens of seconds to minutes and the artifact only exists at the end, so * without narration a run that is working and a run that has died look identical for the whole of * its duration. * * These events are DERIVED from work that is already happening, never a second source of truth: the * run artifact remains the only record of what was proved, and nothing here is ever graded, stored * as evidence, or allowed to influence a verdict. * * ## The rules that keep it honest * * - **A reporter must never fail a run.** Emitting is best-effort at every layer; a listener that * throws, or a network that is down, changes nothing about the verification or its exit code. * - **Progress is not proof.** `flow_finished` carries `ok` so a watcher can colour a row, and * that is a convenience for a human reading a list — the verdict is computed from the artifact, * which is graded, and never from this. * - **`total` is known before the loop starts**, because "step 3" without "of 12" tells a reader * nothing about whether to keep waiting, which is the entire question they are asking. */ import { z } from 'zod'; /** The phases a run passes through, in the order they occur. */ export declare const VerifyPhase: { /** Opening the bridge connection. Fast, and the first thing that can fail. */ readonly CONNECTING: "connecting"; /** Connected, waiting for the app to attach a session. This is where a dead dev server shows up. */ readonly WAITING_FOR_APP: "waiting_for_app"; /** The suite is known. Carries `total`, which is what makes every later step legible. */ readonly FLOWS_FOUND: "flows_found"; /** One flow is replaying now. Carries its name and index. */ readonly FLOW_STARTED: "flow_started"; /** That flow is done. Carries `ok` — a convenience for a watcher, never a verdict. */ readonly FLOW_FINISHED: "flow_finished"; /** Every flow has run; the artifact is being assembled and graded. */ readonly GRADING: "grading"; /** The run reached the dashboard. The last thing anybody watching is waiting for. */ readonly PUSHED: "pushed"; }; export type VerifyPhase = (typeof VerifyPhase)[keyof typeof VerifyPhase]; /** * A flow name is user-supplied and unbounded, and this string is rendered in somebody's dashboard. * Bounded here rather than at the reader, so no consumer has to remember to truncate it. */ export declare const VERIFY_PROGRESS_NAME_MAX = 120; /** How many events a receiver keeps for one run. A walk nobody can scroll is not more honest. */ export declare const VERIFY_PROGRESS_MAX_EVENTS = 200; export declare const verifyProgressEventSchema: z.ZodObject<{ phase: z.ZodEnum<["connecting", "waiting_for_app", "flows_found", "flow_started", "flow_finished", "grading", "pushed"]>; /** 0-based position in the suite. Absent on phases that are not about one flow. */ index: z.ZodOptional; /** How many flows the run will replay. Present from `flows_found` onwards. */ total: z.ZodOptional; /** The flow being replayed. Absent on phases that are not about one flow. */ name: z.ZodOptional; /** Did that flow replay cleanly? A convenience for rendering, never a verdict. */ ok: z.ZodOptional; /** When the emitter saw it, from the injected clock — never `Date.now()` in logic. */ at: z.ZodNumber; }, "strip", z.ZodTypeAny, { at: number; phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed"; ok?: boolean | undefined; name?: string | undefined; total?: number | undefined; index?: number | undefined; }, { at: number; phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed"; ok?: boolean | undefined; name?: string | undefined; total?: number | undefined; index?: number | undefined; }>; export type VerifyProgressEvent = z.infer; /** The batch shape a run posts. Batched because one request per flow is a request per flow. */ export declare const verifyProgressBatchSchema: z.ZodObject<{ runId: z.ZodString; events: z.ZodArray; /** 0-based position in the suite. Absent on phases that are not about one flow. */ index: z.ZodOptional; /** How many flows the run will replay. Present from `flows_found` onwards. */ total: z.ZodOptional; /** The flow being replayed. Absent on phases that are not about one flow. */ name: z.ZodOptional; /** Did that flow replay cleanly? A convenience for rendering, never a verdict. */ ok: z.ZodOptional; /** When the emitter saw it, from the injected clock — never `Date.now()` in logic. */ at: z.ZodNumber; }, "strip", z.ZodTypeAny, { at: number; phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed"; ok?: boolean | undefined; name?: string | undefined; total?: number | undefined; index?: number | undefined; }, { at: number; phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed"; ok?: boolean | undefined; name?: string | undefined; total?: number | undefined; index?: number | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { runId: string; events: { at: number; phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed"; ok?: boolean | undefined; name?: string | undefined; total?: number | undefined; index?: number | undefined; }[]; }, { runId: string; events: { at: number; phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed"; ok?: boolean | undefined; name?: string | undefined; total?: number | undefined; index?: number | undefined; }[]; }>; export type VerifyProgressBatch = z.infer; /** Truncate a user-supplied flow name to the wire bound, so a caller cannot overflow the schema. */ export declare const boundFlowName: (name: string) => string;