execution/canary-branch-resolution-store
@sarj-ai/workspace-sync/execution/canary-branch-resolution-store ยท Source
import type { D1PreparedStatement } from "@cloudflare/workers-types";import { z } from "zod";import type { CanaryResolutionPins } from "./policy.ts";export type { CanaryResolutionPins } from "./policy.ts";import { WorkspaceScheduleTickSchema } from "./schedule-health-contracts.ts";import type { WorkspaceDatabase, WorkspaceStatement } from "./workspace-database.ts";declare const RowSchema: z.ZodObject<{ revision: z.ZodNumber; snapshot_json: z.ZodString; scheduled_at_ms: z.ZodNumber; worker_version_id: z.ZodString; worker_revision: z.ZodString; proof_json: z.ZodString; claimed_at_ms: z.ZodNumber; expires_at_ms: z.ZodNumber; budget_key: z.ZodString; google_user_id: z.ZodString; reserved_at_ms: z.ZodNumber; triggers_json: z.ZodString;}, z.core.$strict>;declare const ResolutionRowSchema: z.ZodObject<{ intent_id: z.ZodString; source_hash: z.ZodString; snapshot_json: z.ZodString; proof_json: z.ZodString; triggers_json: z.ZodString; tick_revision: z.ZodNumber; claimed_at_ms: z.ZodNumber; budget_key: z.ZodString; kind: z.ZodLiteral<"not-dispatched">; evidence_id: z.ZodString; recorded_at_ms: z.ZodNumber; workflow_status: z.ZodLiteral<"errored">; resolution_change_hash: z.ZodString;}, z.core.$strict>;export interface VerifiedCanaryResolution { readonly resolution: z.output<typeof ResolutionRowSchema>; readonly row: z.output<typeof RowSchema>; readonly sourceHash: string; readonly tick: z.output<typeof WorkspaceScheduleTickSchema>;}export interface CanaryBranchResolutionStoreContract { readForHealth(): Promise<VerifiedCanaryResolution | null>;}/** Revalidates retained historical evidence; no method writes or dispatches anything. */export declare class CanaryBranchResolutionStore<Statement extends WorkspaceStatement<Statement> = D1PreparedStatement> implements CanaryBranchResolutionStoreContract { #private; constructor(db: WorkspaceDatabase<Statement>, now?: () => number, pins?: CanaryResolutionPins); readForHealth(): Promise<VerifiedCanaryResolution | null>;}