import { z } from 'zod'; /** * The durable causal journal. Each session gets an append-only pair on disk: * `.reticle/sessions//events.jsonl` (one `ReticleEvent` per line — already seq/actionId-stamped * and browser-edge-redacted) and `actions.jsonl` (one JournalAction per line). The ring buffer becomes * a hot cache over this ledger, so evidence survives eviction. Local-only; JSONL is versioned per line * so a schema bump never orphans an old file. */ /** Per-record schema version. JSONL is line-addressable, so versioning rides each record, not a header. */ export declare const JOURNAL_FILE_VERSION = 1; /** * An action entity — every act/navigate the server dispatches. `seqRange`/`tRange` are the window used * to attribute events to this action (`attribution:"window"`); `effect` is a bounded summary of what * the tool returned. Args are already edge-redacted by the browser before they reach here. */ export declare const JournalActionSchema: z.ZodObject<{ v: z.ZodLiteral<1>; /** The command correlation id (`c`) — the natural, cross-side-stable action identity. */ actionId: z.ZodString; /** The MCP tool / command name that drove it (e.g. "reticle_act"). */ tool: z.ZodString; /** Redacted invocation args. */ args: z.ZodDefault>; /** Bounded effect summary (settle glyph, target, etc.). Kept open; narrowed by the writer. */ effect: z.ZodOptional; /** Whether the page settled within budget after the action, when known. */ settled: z.ZodOptional; /** Time from dispatch to settle in ms, when known. */ settledInMs: z.ZodOptional; /** Inclusive seq range of events attributed to this action, when any were observed. */ seqRange: z.ZodOptional>; /** Elapsed-ms window [dispatch, resolve] used for window attribution. */ tRange: z.ZodObject<{ from: z.ZodNumber; to: z.ZodNumber; }, "strip", z.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; /** Elapsed-ms timestamp the action was recorded at (clock injected by the writer). */ at: z.ZodNumber; }, "strip", z.ZodTypeAny, { at: number; tool: string; args: Record; actionId: string; v: 1; tRange: { from: number; to: number; }; settled?: boolean | undefined; effect?: unknown; settledInMs?: number | undefined; seqRange?: { from: number; to: number; } | undefined; }, { at: number; tool: string; actionId: string; v: 1; tRange: { from: number; to: number; }; settled?: boolean | undefined; effect?: unknown; args?: Record | undefined; settledInMs?: number | undefined; seqRange?: { from: number; to: number; } | undefined; }>; export type JournalAction = z.infer; /** * The bounded verdict summary a verification tool writes into a journal action's `effect`. * * `effect` is deliberately open (`unknown`) and narrowed by its writer; this is that narrowing for * the one writer whose record has to be READ back later. Without it a verdict lives only in the tool * response, which is exactly the place that disappears when an agent compacts, so "what did this run * already prove" would have no ledger to fold and the answer would be silently empty. * * Three fields and no more: the claim the verdict was about, how it came out, and where in the * source it pointed. A transcript here would grow the journal without making the answer better. */ export declare const JournalVerdictEffectSchema: z.ZodObject<{ /** What was claimed, in the caller's own words — the subject a later proof supersedes. */ claim: z.ZodString; /** The verdict, as the one field an agent reads. The enum, never a re-typed copy of it. */ verified: z.ZodNativeEnum<{ readonly YES: "yes"; readonly NO: "no"; readonly UNKNOWN: "unknown"; readonly NO_FAULT: "no-fault"; }>; /** `file:line` for the element driven, when the page told us one. */ source: z.ZodOptional; /** * Was the claim written down BEFORE the action, or after it? * * The difference between a check and a rationalisation. Recorded here because the journal is the * durable record a run artifact is built from: a fact that never reaches it is a fact nothing * downstream can ever report, however well the verdict knew it at the time. * * Absent is not `false`. `false` says the claim came afterwards; absent says nobody recorded which. */ declaredBeforeActing: z.ZodOptional; /** * What kind of evidence bought the answer -- the grade the verdict actually proved. * * A green paid for with "something matching was on screen" is not the green paid for with "the * request went out", and a record that keeps only the word `yes` cannot tell them apart later. */ grade: z.ZodOptional; /** * What could not be seen while this was being checked. * * The one property with no prior art: every other kind of test record is silent about its own * blind spots. Empty means nothing was hidden; absent means nobody looked. */ couldNotSee: z.ZodOptional>; /** * WHY the verdict came out this way, in the engine's own vocabulary. * * Without it, `unknown` is one word for facts that need opposite responses: "the outcome has * not arrived yet" and "the capture was dirty so I could not see" are both `unknown`, and only * the first can ever be answered by waiting. A reader of the record -- or a fold over it -- * cannot tell a question that is still open from one that was never answerable. * * Optional, because a record written before this existed has no reason to offer and must not * be read as though it did. */ reason: z.ZodOptional; }, "strip", z.ZodTypeAny, { claim: string; verified: "unknown" | "yes" | "no" | "no-fault"; source?: string | undefined; reason?: string | undefined; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; }, { claim: string; verified: "unknown" | "yes" | "no" | "no-fault"; source?: string | undefined; reason?: string | undefined; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; }>; export type JournalVerdictEffect = z.infer;