/** * The ReticleVerificationRun artifact — the stable, versioned contract a host platform (an OEM/design * partner) or CI consumes after Reticle verifies a generated/edited app. It is assembled from data Reticle * already produces (flow replay, asserts, evidence timeline, source mapping); this file only defines * the WIRE/DISK shape so it can be frozen under semver. Persisted at `.reticle/runs/.json` and * returned by the programmatic Replay/Verify API. * * Conventions match the rest of `@reticlehq/core`: enums are `as const` objects narrowed with * `z.nativeEnum`, timestamps are epoch-ms NUMBERS (the clock is injected — never read inside pure * logic), no `any` (opaque evidence is `z.unknown`), and every domain string is a named constant. */ import { z } from 'zod'; import { PredicateKind } from './consequence.js'; import { Verified } from './verified-constants.js'; /** Schema version stamped into every run file so a reader can reject/upgrade old artifacts. */ export declare const RUN_FILE_VERSION = 3; /** * A run's identity, branded so it can't be confused with another id (e.g. a flow name) that also feeds * path helpers. The schema brands on parse; mint a fresh one with asRunId at a trusted/validated point. */ export declare const RunIdSchema: z.ZodBranded; export type RunId = z.infer; /** Mint a RunId from a raw string — call only at a validated boundary (e.g. behind isValidRunId). */ export declare const asRunId: (value: string) => RunId; /** * Retention bound for .reticle/runs/ so disk stays bounded over a long-running pipeline. Pruned * oldest-first only once the count exceeds RUN_RETENTION + RUN_RETENTION_SLACK, then back down to * RUN_RETENTION — so the O(n) prune is amortized (≈ once per SLACK writes), not paid on every write. */ export declare const RUN_RETENTION = 500; export declare const RUN_RETENTION_SLACK = 100; /** Structured outcome when reading a run file fails (never thrown). Mirrors ProjectReadError. */ export declare const RunReadError: { readonly MISSING: "run-missing"; readonly MALFORMED: "run-malformed"; }; export type RunReadError = (typeof RunReadError)[keyof typeof RunReadError]; /** The overall verdict on a verification run. PARTIAL = some flows passed, some failed/were gated. */ export declare const VerdictStatus: { readonly PASS: "pass"; readonly FAIL: "fail"; readonly PARTIAL: "partial"; /** * Nothing was proved either way -- no flow and no check produced an outcome, so there is nothing * to pass and nothing to fail. * * This is deliberately NOT a pass. A run that checked nothing and a run that checked everything * successfully are different facts, and flattening them into one word is how a green light comes * to mean "we did not look". It matches how a single action is already judged, where "could not * tell" has always been its own answer. */ readonly UNKNOWN: "unknown"; }; export type VerdictStatus = (typeof VerdictStatus)[keyof typeof VerdictStatus]; /** Per-flow outcome inside a run. HEALED = a drifted anchor was consequence-verified and rebound. */ export declare const RunFlowStatus: { readonly PASS: "pass"; readonly FAIL: "fail"; readonly SKIPPED: "skipped"; readonly HEALED: "healed"; }; export type RunFlowStatus = (typeof RunFlowStatus)[keyof typeof RunFlowStatus]; /** * The kind of standalone assertion captured outside a flow. * * This is `PredicateKind` -- the vocabulary assertions are written in -- and not a second list: two * lists drift, and an artifact can only record what somebody can actually assert. Re-exported so * the places that read it from this file still can. */ export { PredicateKind }; /** * What a check came out as. * * `Verified` and not a second list. A binary one here would lose `unknown` and `no-fault` -- the * two the specification says make the other two mean anything -- at the moment the verdict is * written down. Re-exported so the places that read it from this file still can. */ export { Verified }; /** * A risk surface a changed file / observed behaviour touches. The governance seed: a host can gate * a deploy when a high-severity surface is hit. Mirrors the surfaces real AI-app-builder incidents * cluster around (production data loss, auth/payment/RLS mistakes). */ export declare const RiskSurface: { readonly AUTH: "auth"; readonly PAYMENT: "payment"; readonly DB: "db"; readonly MIGRATION: "migration"; readonly RLS: "rls"; readonly SECRETS: "secrets"; readonly DESTRUCTIVE: "destructive"; readonly EXTERNAL: "external"; }; export type RiskSurface = (typeof RiskSurface)[keyof typeof RiskSurface]; /** Severity of a flagged risk. */ export declare const RiskSeverity: { readonly LOW: "low"; readonly MEDIUM: "medium"; readonly HIGH: "high"; readonly CRITICAL: "critical"; }; export type RiskSeverity = (typeof RiskSeverity)[keyof typeof RiskSeverity]; /** What caused the run (so a host can distinguish an agent's inner loop from a CI gate). */ export declare const RunTrigger: { readonly EDIT: "edit"; readonly CI: "ci"; readonly MANUAL: "manual"; readonly OEM: "oem"; }; export type RunTrigger = (typeof RunTrigger)[keyof typeof RunTrigger]; /** How a changed file changed (drives the risk tagger). */ export declare const RunChangeKind: { readonly ADDED: "added"; readonly MODIFIED: "modified"; readonly DELETED: "deleted"; }; export type RunChangeKind = (typeof RunChangeKind)[keyof typeof RunChangeKind]; /** Who/what drove the run. */ export declare const RunAgentKind: { readonly CODING_AGENT: "coding-agent"; readonly OEM_PIPELINE: "oem-pipeline"; readonly HUMAN: "human"; }; export type RunAgentKind = (typeof RunAgentKind)[keyof typeof RunAgentKind]; /** The app framework, when known. */ export declare const RunFramework: { readonly REACT: "react"; readonly NEXT: "next"; readonly VITE: "vite"; readonly OTHER: "other"; }; export type RunFramework = (typeof RunFramework)[keyof typeof RunFramework]; /** Where the run executed. */ export declare const RunEnv: { readonly PREVIEW: "preview"; readonly CI: "ci"; readonly LOCAL: "local"; }; export type RunEnv = (typeof RunEnv)[keyof typeof RunEnv]; /** Verdict confidence. */ export declare const RunConfidence: { readonly HIGH: "high"; readonly MEDIUM: "medium"; readonly LOW: "low"; }; export type RunConfidence = (typeof RunConfidence)[keyof typeof RunConfidence]; /** * The data profile a run was produced under. DEV exposes dev-only fields (source file:line, raw * network bodies, full state dumps); PROD_PREVIEW redacts them. The artifact records which profile * produced it so a consumer can never mistake a redacted run for a complete one. */ export declare const RunProfile: { readonly DEV: "dev"; readonly PROD_PREVIEW: "prod-preview"; }; export type RunProfile = (typeof RunProfile)[keyof typeof RunProfile]; /** A source coordinate, when source mapping is available (DEV profile only). */ export declare const SourceLocationSchema: z.ZodObject<{ file: z.ZodString; line: z.ZodOptional; component: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; component?: string | undefined; line?: number | undefined; }, { file: string; component?: string | undefined; line?: number | undefined; }>; export type SourceLocation = z.infer; /** A file the change set touched, with the risk surfaces it implicates. */ export declare const RunChangedFileSchema: z.ZodObject<{ path: z.ZodString; changeKind: z.ZodNativeEnum<{ readonly ADDED: "added"; readonly MODIFIED: "modified"; readonly DELETED: "deleted"; }>; risk: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { path: string; changeKind: "added" | "modified" | "deleted"; risk: ("auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external")[]; }, { path: string; changeKind: "added" | "modified" | "deleted"; risk?: ("auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external")[] | undefined; }>; export type RunChangedFile = z.infer; /** A flow that was replayed as part of the run. */ export declare const RunFlowResultSchema: z.ZodObject<{ name: z.ZodString; status: z.ZodNativeEnum<{ readonly PASS: "pass"; readonly FAIL: "fail"; readonly SKIPPED: "skipped"; readonly HEALED: "healed"; }>; steps: z.ZodNumber; durationMs: z.ZodNumber; oracle: z.ZodOptional; healed: z.ZodOptional>; evidenceRef: z.ZodOptional; failureReason: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "pass" | "fail" | "healed" | "skipped"; name: string; steps: number; durationMs: number; healed?: { from: string; to: string; consequenceVerified: boolean; } | undefined; oracle?: string | undefined; evidenceRef?: string | undefined; failureReason?: string | undefined; }, { status: "pass" | "fail" | "healed" | "skipped"; name: string; steps: number; durationMs: number; healed?: { from: string; to: string; consequenceVerified: boolean; } | undefined; oracle?: string | undefined; evidenceRef?: string | undefined; failureReason?: string | undefined; }>; export type RunFlowResult = z.infer; /** A standalone assertion not tied to a flow. `evidence` is opaque (narrowed per kind by the caller). */ export declare const RunCheckSchema: z.ZodObject<{ kind: z.ZodEffects, "signal" | "text" | "net" | "state" | "element" | "route" | "console" | "animation" | "settled" | "allOf" | "anyOf" | "not", unknown>; predicate: z.ZodString; status: z.ZodEffects, "unknown" | "yes" | "no" | "no-fault", unknown>; evidence: z.ZodOptional; /** * Was this claim written down BEFORE the action, or after it? * * The difference between a check and a rationalisation. Afterwards, anything that happened can be * described as what you meant; a claim made in advance can only be met or missed. * * Optional, and absence is not `false`. `false` says the claim came afterwards. Absent says nobody * recorded which, and those are different facts about the evidence. */ declaredBeforeActing: z.ZodOptional; /** * What kind of evidence bought this answer. * * A green paid for with "something matching was on screen" is not the same green as one paid for * with "the request went out", and a report that flattens them lets the cheap one pass for the * dear one. Free-form because the grades belong to whoever produced the verdict. */ grade: z.ZodOptional; /** * What could not be seen while this was being checked. * * The property with no prior art: every other test report in existence is silent about its own * blind spots. An empty list means nothing was hidden; absence means nobody looked. */ couldNotSee: z.ZodOptional>; /** * Why the verdict came out this way, in the engine's vocabulary. * * Carried so a reader -- and the fold that looks for late answers -- can tell an outcome that * has not arrived from a capture that could not be read. Both are `unknown`, and only the * first is a question that waiting can settle. */ reason: z.ZodOptional; /** This check's own name, so a later verdict can cite it. See revision.ts. */ checkId: z.ZodOptional; /** * The earlier check this one corrects, as `#`. * * Present only on a correction, and the check it names is NOT edited: both stand, so a reader * can see that the first answer was given, when it changed, and why. */ supersedes: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "unknown" | "yes" | "no" | "no-fault"; kind: "signal" | "text" | "net" | "state" | "element" | "route" | "console" | "animation" | "settled" | "allOf" | "anyOf" | "not"; predicate: string; reason?: string | undefined; evidence?: unknown; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; checkId?: string | undefined; supersedes?: string | undefined; }, { predicate: string; status?: unknown; kind?: unknown; reason?: string | undefined; evidence?: unknown; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; checkId?: string | undefined; supersedes?: string | undefined; }>; export type RunCheck = z.infer; /** A flagged risk. `gated` = a policy gate tripped on this surface. */ export declare const RunRiskSchema: z.ZodObject<{ surface: z.ZodNativeEnum<{ readonly AUTH: "auth"; readonly PAYMENT: "payment"; readonly DB: "db"; readonly MIGRATION: "migration"; readonly RLS: "rls"; readonly SECRETS: "secrets"; readonly DESTRUCTIVE: "destructive"; readonly EXTERNAL: "external"; }>; severity: z.ZodNativeEnum<{ readonly LOW: "low"; readonly MEDIUM: "medium"; readonly HIGH: "high"; readonly CRITICAL: "critical"; }>; detail: z.ZodString; evidence: z.ZodOptional; line: z.ZodOptional; network: z.ZodOptional; }, "strip", z.ZodTypeAny, { file?: string | undefined; line?: number | undefined; network?: string | undefined; }, { file?: string | undefined; line?: number | undefined; network?: string | undefined; }>>; gated: z.ZodDefault; }, "strip", z.ZodTypeAny, { surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external"; severity: "low" | "medium" | "high" | "critical"; detail: string; gated: boolean; evidence?: { file?: string | undefined; line?: number | undefined; network?: string | undefined; } | undefined; }, { surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external"; severity: "low" | "medium" | "high" | "critical"; detail: string; evidence?: { file?: string | undefined; line?: number | undefined; network?: string | undefined; } | undefined; gated?: boolean | undefined; }>; export type RunRisk = z.infer; /** The cross-layer evidence behind the verdict. Raw bodies / full state appear only under DEV profile. */ export declare const VerificationEvidenceSchema: z.ZodObject<{ consoleErrors: z.ZodDefault, "many">>; networkAnomalies: z.ZodDefault; issue: z.ZodString; }, "strip", z.ZodTypeAny, { method: string; url: string; issue: string; status?: number | undefined; }, { method: string; url: string; issue: string; status?: number | undefined; }>, "many">>; stateAssertions: z.ZodDefault, "many">>; timeline: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { consoleErrors: { message: string; at: number; level: string; }[]; networkAnomalies: { method: string; url: string; issue: string; status?: number | undefined; }[]; stateAssertions: { ok: boolean; path: string; store: string; expected?: unknown; actual?: unknown; }[]; timeline: { kind: string; at: number; summary: string; }[]; }, { consoleErrors?: { message: string; at: number; level: string; }[] | undefined; networkAnomalies?: { method: string; url: string; issue: string; status?: number | undefined; }[] | undefined; stateAssertions?: { ok: boolean; path: string; store: string; expected?: unknown; actual?: unknown; }[] | undefined; timeline?: { kind: string; at: number; summary: string; }[] | undefined; }>; /** One paste-ready fix instruction for the host's coding agent. */ export declare const RepairPacketSchema: z.ZodObject<{ flow: z.ZodOptional; step: z.ZodOptional; expected: z.ZodString; actual: z.ZodString; sourceLocation: z.ZodOptional; component: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; component?: string | undefined; line?: number | undefined; }, { file: string; component?: string | undefined; line?: number | undefined; }>>; suggestedPrompt: z.ZodString; }, "strip", z.ZodTypeAny, { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }, { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }>; export type RepairPacket = z.infer; /** The verdict block — what a deploy gate reads. */ export declare const RunVerdictSchema: z.ZodObject<{ status: z.ZodNativeEnum<{ readonly PASS: "pass"; readonly FAIL: "fail"; readonly PARTIAL: "partial"; /** * Nothing was proved either way -- no flow and no check produced an outcome, so there is nothing * to pass and nothing to fail. * * This is deliberately NOT a pass. A run that checked nothing and a run that checked everything * successfully are different facts, and flattening them into one word is how a green light comes * to mean "we did not look". It matches how a single action is already judged, where "could not * tell" has always been its own answer. */ readonly UNKNOWN: "unknown"; }>; reasons: z.ZodDefault>; confidence: z.ZodNativeEnum<{ readonly HIGH: "high"; readonly MEDIUM: "medium"; readonly LOW: "low"; }>; blockingRisks: z.ZodDefault; /** * Which check this verdict is about, so a later one can say it corrects this. * * Optional because a run's overall verdict is not about one check. A verdict with no check named * cannot be cited, and therefore cannot be corrected -- see revision.ts. */ checkId: z.ZodOptional; /** * The verdict this one replaces, written as `#`. * * Present only on a correction. The verdict it names is NOT edited: it stays exactly as it was * given, and this is a second, later answer that cites it. Rewriting the first in place would * erase the fact that it was ever given, and "we always knew" is the shape of the problem this * whole system exists to prevent. */ supersedes: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "pass" | "fail" | "unknown" | "partial"; reasons: string[]; confidence: "low" | "medium" | "high"; blockingRisks: number; checkId?: string | undefined; supersedes?: string | undefined; }, { status: "pass" | "fail" | "unknown" | "partial"; confidence: "low" | "medium" | "high"; checkId?: string | undefined; supersedes?: string | undefined; reasons?: string[] | undefined; blockingRisks?: number | undefined; }>; export type RunVerdict = z.infer; /** Optional tamper-evidence signature over the run (for audit; populated later). */ export declare const RunSignatureSchema: z.ZodObject<{ alg: z.ZodString; value: z.ZodString; signedAt: z.ZodNumber; }, "strip", z.ZodTypeAny, { value: string; alg: string; signedAt: number; }, { value: string; alg: string; signedAt: number; }>; /** * The top-level verification-run artifact. Stable contract — additive changes only within a * RUN_FILE_VERSION; a breaking change bumps it. Arrays default to empty so a minimal run (e.g. a * single smoke flow) still validates. Version 1 files are still read; see the note on the constant. */ export declare const ReticleVerificationRunSchema: z.ZodObject<{ schemaVersion: z.ZodUnion<[z.ZodLiteral<3>, z.ZodLiteral<2>, z.ZodLiteral<1>]>; runId: z.ZodBranded; createdAt: z.ZodNumber; durationMs: z.ZodNumber; profile: z.ZodNativeEnum<{ readonly DEV: "dev"; readonly PROD_PREVIEW: "prod-preview"; }>; project: z.ZodObject<{ name: z.ZodString; framework: z.ZodNativeEnum<{ readonly REACT: "react"; readonly NEXT: "next"; readonly VITE: "vite"; readonly OTHER: "other"; }>; commit: z.ZodOptional; env: z.ZodOptional>; previewUrl: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; framework: "other" | "react" | "next" | "vite"; commit?: string | undefined; env?: "local" | "preview" | "ci" | undefined; previewUrl?: string | undefined; }, { name: string; framework: "other" | "react" | "next" | "vite"; commit?: string | undefined; env?: "local" | "preview" | "ci" | undefined; previewUrl?: string | undefined; }>; agent: z.ZodObject<{ id: z.ZodString; kind: z.ZodNativeEnum<{ readonly CODING_AGENT: "coding-agent"; readonly OEM_PIPELINE: "oem-pipeline"; readonly HUMAN: "human"; }>; model: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; kind: "human" | "coding-agent" | "oem-pipeline"; model?: string | undefined; }, { id: string; kind: "human" | "coding-agent" | "oem-pipeline"; model?: string | undefined; }>; trigger: z.ZodObject<{ kind: z.ZodNativeEnum<{ readonly EDIT: "edit"; readonly CI: "ci"; readonly MANUAL: "manual"; readonly OEM: "oem"; }>; diffRef: z.ZodOptional; note: z.ZodOptional; }, "strip", z.ZodTypeAny, { kind: "manual" | "edit" | "ci" | "oem"; note?: string | undefined; diffRef?: string | undefined; }, { kind: "manual" | "edit" | "ci" | "oem"; note?: string | undefined; diffRef?: string | undefined; }>; /** * Which round of source edits this evidence belongs to. * * Evidence gathered before the change under test is true about the OLD code. Reporting it as true * about the new code is a false pass, and it is the kind nobody notices because everything looks * green. Absent when the run had no way to know. */ editEpoch: z.ZodOptional; /** * What was verified, in the protocol's own vocabulary. * * The artifact recorded the project, the agent, the trigger and the edit round, and never what * KIND of thing was on the other end -- so a run against a Tauri desktop app and one against a * web page were indistinguishable to every reader of this file. `surface` is the field that * separates them, and `instance` is the one that says which document the evidence belongs to, * which is the difference between evidence about this page and evidence that survived a * navigation. * * `SubjectRef` is the specification's, imported rather than restated. Optional because a run * assembled without a live session -- in CI, from flows alone -- genuinely does not know, and * an invented subject is worse than an absent one. */ subject: z.ZodOptional, z.ZodString]>; instance: z.ZodString; epoch: z.ZodOptional; locator: z.ZodOptional; revision: z.ZodOptional; }, "strip", z.ZodTypeAny, { surface: string; instance: string; epoch?: number | undefined; locator?: string | undefined; revision?: string | undefined; }, { surface: string; instance: string; epoch?: number | undefined; locator?: string | undefined; revision?: string | undefined; }>>; changedFiles: z.ZodDefault; risk: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { path: string; changeKind: "added" | "modified" | "deleted"; risk: ("auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external")[]; }, { path: string; changeKind: "added" | "modified" | "deleted"; risk?: ("auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external")[] | undefined; }>, "many">>; flows: z.ZodDefault; steps: z.ZodNumber; durationMs: z.ZodNumber; oracle: z.ZodOptional; healed: z.ZodOptional>; evidenceRef: z.ZodOptional; failureReason: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "pass" | "fail" | "healed" | "skipped"; name: string; steps: number; durationMs: number; healed?: { from: string; to: string; consequenceVerified: boolean; } | undefined; oracle?: string | undefined; evidenceRef?: string | undefined; failureReason?: string | undefined; }, { status: "pass" | "fail" | "healed" | "skipped"; name: string; steps: number; durationMs: number; healed?: { from: string; to: string; consequenceVerified: boolean; } | undefined; oracle?: string | undefined; evidenceRef?: string | undefined; failureReason?: string | undefined; }>, "many">>; checks: z.ZodDefault, "signal" | "text" | "net" | "state" | "element" | "route" | "console" | "animation" | "settled" | "allOf" | "anyOf" | "not", unknown>; predicate: z.ZodString; status: z.ZodEffects, "unknown" | "yes" | "no" | "no-fault", unknown>; evidence: z.ZodOptional; /** * Was this claim written down BEFORE the action, or after it? * * The difference between a check and a rationalisation. Afterwards, anything that happened can be * described as what you meant; a claim made in advance can only be met or missed. * * Optional, and absence is not `false`. `false` says the claim came afterwards. Absent says nobody * recorded which, and those are different facts about the evidence. */ declaredBeforeActing: z.ZodOptional; /** * What kind of evidence bought this answer. * * A green paid for with "something matching was on screen" is not the same green as one paid for * with "the request went out", and a report that flattens them lets the cheap one pass for the * dear one. Free-form because the grades belong to whoever produced the verdict. */ grade: z.ZodOptional; /** * What could not be seen while this was being checked. * * The property with no prior art: every other test report in existence is silent about its own * blind spots. An empty list means nothing was hidden; absence means nobody looked. */ couldNotSee: z.ZodOptional>; /** * Why the verdict came out this way, in the engine's vocabulary. * * Carried so a reader -- and the fold that looks for late answers -- can tell an outcome that * has not arrived from a capture that could not be read. Both are `unknown`, and only the * first is a question that waiting can settle. */ reason: z.ZodOptional; /** This check's own name, so a later verdict can cite it. See revision.ts. */ checkId: z.ZodOptional; /** * The earlier check this one corrects, as `#`. * * Present only on a correction, and the check it names is NOT edited: both stand, so a reader * can see that the first answer was given, when it changed, and why. */ supersedes: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "unknown" | "yes" | "no" | "no-fault"; kind: "signal" | "text" | "net" | "state" | "element" | "route" | "console" | "animation" | "settled" | "allOf" | "anyOf" | "not"; predicate: string; reason?: string | undefined; evidence?: unknown; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; checkId?: string | undefined; supersedes?: string | undefined; }, { predicate: string; status?: unknown; kind?: unknown; reason?: string | undefined; evidence?: unknown; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; checkId?: string | undefined; supersedes?: string | undefined; }>, "many">>; risks: z.ZodDefault; severity: z.ZodNativeEnum<{ readonly LOW: "low"; readonly MEDIUM: "medium"; readonly HIGH: "high"; readonly CRITICAL: "critical"; }>; detail: z.ZodString; evidence: z.ZodOptional; line: z.ZodOptional; network: z.ZodOptional; }, "strip", z.ZodTypeAny, { file?: string | undefined; line?: number | undefined; network?: string | undefined; }, { file?: string | undefined; line?: number | undefined; network?: string | undefined; }>>; gated: z.ZodDefault; }, "strip", z.ZodTypeAny, { surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external"; severity: "low" | "medium" | "high" | "critical"; detail: string; gated: boolean; evidence?: { file?: string | undefined; line?: number | undefined; network?: string | undefined; } | undefined; }, { surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external"; severity: "low" | "medium" | "high" | "critical"; detail: string; evidence?: { file?: string | undefined; line?: number | undefined; network?: string | undefined; } | undefined; gated?: boolean | undefined; }>, "many">>; evidence: z.ZodObject<{ consoleErrors: z.ZodDefault, "many">>; networkAnomalies: z.ZodDefault; issue: z.ZodString; }, "strip", z.ZodTypeAny, { method: string; url: string; issue: string; status?: number | undefined; }, { method: string; url: string; issue: string; status?: number | undefined; }>, "many">>; stateAssertions: z.ZodDefault, "many">>; timeline: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { consoleErrors: { message: string; at: number; level: string; }[]; networkAnomalies: { method: string; url: string; issue: string; status?: number | undefined; }[]; stateAssertions: { ok: boolean; path: string; store: string; expected?: unknown; actual?: unknown; }[]; timeline: { kind: string; at: number; summary: string; }[]; }, { consoleErrors?: { message: string; at: number; level: string; }[] | undefined; networkAnomalies?: { method: string; url: string; issue: string; status?: number | undefined; }[] | undefined; stateAssertions?: { ok: boolean; path: string; store: string; expected?: unknown; actual?: unknown; }[] | undefined; timeline?: { kind: string; at: number; summary: string; }[] | undefined; }>; repair: z.ZodOptional; step: z.ZodOptional; expected: z.ZodString; actual: z.ZodString; sourceLocation: z.ZodOptional; component: z.ZodOptional; }, "strip", z.ZodTypeAny, { file: string; component?: string | undefined; line?: number | undefined; }, { file: string; component?: string | undefined; line?: number | undefined; }>>; suggestedPrompt: z.ZodString; }, "strip", z.ZodTypeAny, { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }, { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { failurePackets: { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }[]; }, { failurePackets?: { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }[] | undefined; }>>; verdict: z.ZodObject<{ status: z.ZodNativeEnum<{ readonly PASS: "pass"; readonly FAIL: "fail"; readonly PARTIAL: "partial"; /** * Nothing was proved either way -- no flow and no check produced an outcome, so there is nothing * to pass and nothing to fail. * * This is deliberately NOT a pass. A run that checked nothing and a run that checked everything * successfully are different facts, and flattening them into one word is how a green light comes * to mean "we did not look". It matches how a single action is already judged, where "could not * tell" has always been its own answer. */ readonly UNKNOWN: "unknown"; }>; reasons: z.ZodDefault>; confidence: z.ZodNativeEnum<{ readonly HIGH: "high"; readonly MEDIUM: "medium"; readonly LOW: "low"; }>; blockingRisks: z.ZodDefault; /** * Which check this verdict is about, so a later one can say it corrects this. * * Optional because a run's overall verdict is not about one check. A verdict with no check named * cannot be cited, and therefore cannot be corrected -- see revision.ts. */ checkId: z.ZodOptional; /** * The verdict this one replaces, written as `#`. * * Present only on a correction. The verdict it names is NOT edited: it stays exactly as it was * given, and this is a second, later answer that cites it. Rewriting the first in place would * erase the fact that it was ever given, and "we always knew" is the shape of the problem this * whole system exists to prevent. */ supersedes: z.ZodOptional; }, "strip", z.ZodTypeAny, { status: "pass" | "fail" | "unknown" | "partial"; reasons: string[]; confidence: "low" | "medium" | "high"; blockingRisks: number; checkId?: string | undefined; supersedes?: string | undefined; }, { status: "pass" | "fail" | "unknown" | "partial"; confidence: "low" | "medium" | "high"; checkId?: string | undefined; supersedes?: string | undefined; reasons?: string[] | undefined; blockingRisks?: number | undefined; }>; signature: z.ZodOptional>; }, "strip", z.ZodTypeAny, { flows: { status: "pass" | "fail" | "healed" | "skipped"; name: string; steps: number; durationMs: number; healed?: { from: string; to: string; consequenceVerified: boolean; } | undefined; oracle?: string | undefined; evidenceRef?: string | undefined; failureReason?: string | undefined; }[]; createdAt: number; runId: string & z.BRAND<"RunId">; agent: { id: string; kind: "human" | "coding-agent" | "oem-pipeline"; model?: string | undefined; }; project: { name: string; framework: "other" | "react" | "next" | "vite"; commit?: string | undefined; env?: "local" | "preview" | "ci" | undefined; previewUrl?: string | undefined; }; durationMs: number; evidence: { consoleErrors: { message: string; at: number; level: string; }[]; networkAnomalies: { method: string; url: string; issue: string; status?: number | undefined; }[]; stateAssertions: { ok: boolean; path: string; store: string; expected?: unknown; actual?: unknown; }[]; timeline: { kind: string; at: number; summary: string; }[]; }; schemaVersion: 1 | 2 | 3; profile: "dev" | "prod-preview"; trigger: { kind: "manual" | "edit" | "ci" | "oem"; note?: string | undefined; diffRef?: string | undefined; }; changedFiles: { path: string; changeKind: "added" | "modified" | "deleted"; risk: ("auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external")[]; }[]; checks: { status: "unknown" | "yes" | "no" | "no-fault"; kind: "signal" | "text" | "net" | "state" | "element" | "route" | "console" | "animation" | "settled" | "allOf" | "anyOf" | "not"; predicate: string; reason?: string | undefined; evidence?: unknown; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; checkId?: string | undefined; supersedes?: string | undefined; }[]; risks: { surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external"; severity: "low" | "medium" | "high" | "critical"; detail: string; gated: boolean; evidence?: { file?: string | undefined; line?: number | undefined; network?: string | undefined; } | undefined; }[]; verdict: { status: "pass" | "fail" | "unknown" | "partial"; reasons: string[]; confidence: "low" | "medium" | "high"; blockingRisks: number; checkId?: string | undefined; supersedes?: string | undefined; }; editEpoch?: number | undefined; subject?: { surface: string; instance: string; epoch?: number | undefined; locator?: string | undefined; revision?: string | undefined; } | undefined; repair?: { failurePackets: { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }[]; } | undefined; signature?: { value: string; alg: string; signedAt: number; } | undefined; }, { createdAt: number; runId: string; agent: { id: string; kind: "human" | "coding-agent" | "oem-pipeline"; model?: string | undefined; }; project: { name: string; framework: "other" | "react" | "next" | "vite"; commit?: string | undefined; env?: "local" | "preview" | "ci" | undefined; previewUrl?: string | undefined; }; durationMs: number; evidence: { consoleErrors?: { message: string; at: number; level: string; }[] | undefined; networkAnomalies?: { method: string; url: string; issue: string; status?: number | undefined; }[] | undefined; stateAssertions?: { ok: boolean; path: string; store: string; expected?: unknown; actual?: unknown; }[] | undefined; timeline?: { kind: string; at: number; summary: string; }[] | undefined; }; schemaVersion: 1 | 2 | 3; profile: "dev" | "prod-preview"; trigger: { kind: "manual" | "edit" | "ci" | "oem"; note?: string | undefined; diffRef?: string | undefined; }; verdict: { status: "pass" | "fail" | "unknown" | "partial"; confidence: "low" | "medium" | "high"; checkId?: string | undefined; supersedes?: string | undefined; reasons?: string[] | undefined; blockingRisks?: number | undefined; }; flows?: { status: "pass" | "fail" | "healed" | "skipped"; name: string; steps: number; durationMs: number; healed?: { from: string; to: string; consequenceVerified: boolean; } | undefined; oracle?: string | undefined; evidenceRef?: string | undefined; failureReason?: string | undefined; }[] | undefined; editEpoch?: number | undefined; subject?: { surface: string; instance: string; epoch?: number | undefined; locator?: string | undefined; revision?: string | undefined; } | undefined; changedFiles?: { path: string; changeKind: "added" | "modified" | "deleted"; risk?: ("auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external")[] | undefined; }[] | undefined; checks?: { predicate: string; status?: unknown; kind?: unknown; reason?: string | undefined; evidence?: unknown; declaredBeforeActing?: boolean | undefined; grade?: string | undefined; couldNotSee?: string[] | undefined; checkId?: string | undefined; supersedes?: string | undefined; }[] | undefined; risks?: { surface: "auth" | "payment" | "db" | "migration" | "rls" | "secrets" | "destructive" | "external"; severity: "low" | "medium" | "high" | "critical"; detail: string; evidence?: { file?: string | undefined; line?: number | undefined; network?: string | undefined; } | undefined; gated?: boolean | undefined; }[] | undefined; repair?: { failurePackets?: { expected: string; actual: string; suggestedPrompt: string; step?: number | undefined; flow?: string | undefined; sourceLocation?: { file: string; component?: string | undefined; line?: number | undefined; } | undefined; }[] | undefined; } | undefined; signature?: { value: string; alg: string; signedAt: number; } | undefined; }>; export type ReticleVerificationRun = z.infer; export type VerificationEvidence = z.infer; export type RunSignature = z.infer;