import type { RolePolicyConfig } from "../domain/role-policy.js"; import { type ProcessResult, type ProcessRunner } from "./process.js"; export interface CodexStructuredRequest { config: RolePolicyConfig; roleId: "oms.exec-advisor" | "oms.grader.codex"; prompt: string; requestId: string; cwd: string; temporaryRoot: string; packageRoot?: string; timeoutMs?: number; confirmBilledUse?: boolean; beforeProviderContact?: () => void; env?: NodeJS.ProcessEnv; runner?: ProcessRunner; } export interface CodexStructuredResult { value: T; outputPath: string; process: Pick; } export interface CodexStructuredResultIdentity { readonly request_id: string; readonly role_id: CodexStructuredRequest["roleId"]; readonly fresh_session_id: string; readonly certifying: boolean; readonly engine: "codex"; readonly model_id: string; readonly reasoning_effort: string | null; readonly schema_id: string; readonly schema_digest: string; readonly prompt_digest: string; readonly evidence_digest: string; readonly output_digest: string; readonly output_path: string; readonly cwd: string; readonly process_status: number | null; readonly process_success: boolean; } /** Evidence binds prompt digest + schema digest (recomputable without raw prompt). */ export declare function computeCodexEvidenceDigest(fields: { readonly prompt_digest: string; readonly schema_digest: string; }): string; export declare function runCodexStructured(request: CodexStructuredRequest): CodexStructuredResult; export declare function codexStructuredResultIdentity(value: unknown): CodexStructuredResultIdentity; /** * Read-only durable inspect of a prior Codex structured-exec final output. * Never relaunches. Returns null when the exact receipt is absent or invalid. * Validates exact keys, effort, process success, and recomputes digests. */ export declare function readCodexStructuredIfExists(request: { readonly config: RolePolicyConfig; readonly roleId: "oms.grader.codex"; readonly requestId: string; readonly temporaryRoot: string; readonly packageRoot?: string; /** Required exact configured workspace — receipt.cwd must equal it. */ readonly expectedCwd: string; /** Caller-known expected prompt digest (durable inspect bind). */ readonly expectedPromptDigest: string; /** Caller-known expected evidence digest (durable inspect bind). */ readonly expectedEvidenceDigest: string; }): CodexStructuredResult | null;