import type { AnalyzeResult } from "./study-analysis-service.js"; import { z } from "zod"; import { type PreparedRunArtifactPaths } from "./run-paths.js"; export declare const AUTOMATIC_STUDY_ANALYSIS_DIRECTORY = "analysis-automatic"; export declare const AUTOMATIC_STUDY_ANALYSIS_SCHEMA = "humanish.automatic-study-analysis.v1"; export declare const AUTOMATIC_STUDY_ANALYSIS_STALE_MS = 15000; /** Execution metadata only. Never a participant outcome or permission to dispatch. */ export interface AutomaticStudyAnalysisView { state: "queued" | "running" | "complete" | "partial" | "failed" | "cancelled" | "skipped" | "unknown"; analysisId: string | null; /** Safe stable code, not provider text. */ reason: string | null; updatedAt: string; } export interface AutomaticStudyAnalysisOutcome { state: "complete" | "partial" | "failed" | "cancelled" | "skipped" | "unknown"; reason: string | null; result?: AnalyzeResult; } export interface AutomaticStudyAnalysisCancellation { requested: boolean; reason: string | null; } declare const jobSchema: z.ZodObject<{ schema: z.ZodLiteral<"humanish.automatic-study-analysis.v1">; runId: z.ZodString; claimId: z.ZodUUID; attemptId: z.ZodString; state: z.ZodEnum<{ failed: "failed"; skipped: "skipped"; cancelled: "cancelled"; unknown: "unknown"; complete: "complete"; running: "running"; queued: "queued"; partial: "partial"; }>; analysisId: z.ZodNullable; reason: z.ZodNullable>; createdAt: z.ZodISODateTime; updatedAt: z.ZodISODateTime; configDigest: z.ZodString; promptVersion: z.ZodString; sourceRunSha256: z.ZodNullable; inputDigest: z.ZodNullable; analysisSha256: z.ZodNullable; receiptSha256: z.ZodNullable; startedAt: z.ZodNullable; finishedAt: z.ZodNullable; }, z.core.$strict>; type JobRecord = z.infer; /** Also guards direct HTML projection callers, not only the contained-file reader. */ export declare function projectAutomaticStudyAnalysisView(value: unknown): AutomaticStudyAnalysisView | undefined; /** Minimal historical accounting, without source validation, execution or liveness inference. */ export declare function readAutomaticStudyAnalysisAccounting(prepared: PreparedRunArtifactPaths): Promise<{ attemptId: string; analysisId: string | null; started: boolean; reused: boolean; uncertain: boolean; } | "unknown" | undefined>; /** Read-only projection. A stale timestamp or persisted claim never authorizes execution. */ export declare function readAutomaticStudyAnalysisPrepared(prepared: PreparedRunArtifactPaths, now?: number): Promise; export interface AutomaticStudyAnalysisJob { readonly attemptId: string; /** Serialized, awaited durability boundary. A failed write must prevent dispatch. */ update(update: Partial>): Promise; touch(): Promise; cancellationRequested(): Promise; } /** The directory is permanent, including after interrupted/failed writes. Never re-open it as a writer. */ export declare function claimAutomaticStudyAnalysis(prepared: PreparedRunArtifactPaths, metadata: { configDigest: string; promptVersion: string; }): Promise; /** A scoped cancellation request, never a PID signal and never permission to create a new job. */ export declare function requestAutomaticStudyAnalysisCancellationPrepared(prepared: PreparedRunArtifactPaths): Promise; export {};