import { z } from "zod"; import type { Annotator } from "../../runDirectory/annotations.js"; export type { Annotator }; /** Recursively readonly. The store hands these out so a caller cannot mutate * loaded rows and silently desynchronise them from what is on disk. */ export type DeepReadonly = Value extends (infer Element)[] ? readonly DeepReadonly[] : Value extends object ? { readonly [Key in keyof Value]: DeepReadonly; } : Value; /** Random suffix length for entity ids that are allocated, not derived. */ export declare const QUESTION_ID_RANDOM_LENGTH = 10; export declare const CHECKLIST_ID_RANDOM_LENGTH = 10; /** Anchored and filesystem-safe: these ids become path segments and file names. */ export declare const SessionIdSchema: z.ZodString; export declare const ContentHashSchema: z.ZodString; export declare const ChecklistIdSchema: z.ZodString; export declare const QuestionIdSchema: z.ZodString; /** A trace id is whatever the statelog says it is; it only has to be present. */ export declare const TraceIdSchema: z.ZodString; /** Field names are display-safe and stable: they become headers on the screen. * The charset also means a name can never carry a control character or a * `{style-tag}`. */ export declare const FieldNameSchema: z.ZodString; /** What the screen shows for one trace: named text, e.g. `input` and `output`. */ export declare const FieldsSchema: z.ZodRecord; export type Fields = z.infer; export declare const AnnotatorSchema: z.ZodObject<{ kind: z.ZodEnum<{ human: "human"; grader: "grader"; judge: "judge"; harness: "harness"; }>; id: z.ZodString; }, z.core.$strict>; /** Everything a resumable session is bound to. Order of `traceIds` is part of * the identity: a draft resumed against a differently ordered directory would * attach answers to the wrong traces. */ export type SessionIdentity = { traceIds: string[]; checklistId: string; annotator: Annotator; }; export declare const ChecklistQuestionSchema: z.ZodObject<{ id: z.ZodString; text: z.ZodString; weight: z.ZodNumber; deleted: z.ZodBoolean; }, z.core.$strict>; export type ChecklistQuestion = z.infer; export declare const ChecklistRevisionSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; checklistId: z.ZodString; name: z.ZodString; version: z.ZodNumber; parentVersion: z.ZodNullable; createdAt: z.ZodString; hash: z.ZodString; questions: z.ZodArray>; }, z.core.$strict>; export type ChecklistRevision = z.infer; /** The pointer file. Deliberately not a copy of the revision: two copies of the * same content eventually disagree, and the revision file is the truth. */ export declare const ChecklistCurrentSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; checklistId: z.ZodString; version: z.ZodNumber; hash: z.ZodString; }, z.core.$strict>; export type ChecklistCurrent = z.infer; /** The editable file the user points `--checklist` at. Lineage fields are * absent before first publication and written back afterwards, so a later * open can tell an exact current definition from a stale one from a legal * edit. */ export declare const ChecklistDefinitionSchema: z.ZodObject<{ name: z.ZodString; checklistId: z.ZodOptional; version: z.ZodOptional; hash: z.ZodOptional; questions: z.ZodArray; text: z.ZodString; weight: z.ZodOptional; deleted: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>; export type ChecklistDefinition = z.infer; /** @internal Named durable boundaries inside the store's multi-file * operations. Tests interrupt execution at one of these and reopen, so * recovery is exercised at every point a crash could actually land. Declared * here rather than in labelStore.ts because checklist publication needs to * signal them and must not import the store that imports it. */ export type LabelStoreFaultPoint = "after-revision-temp-write" | "after-revision-rename" | "after-current-update" | "after-external-definition-sync" | "after-annotation-append"; export type FaultHook = (point: LabelStoreFaultPoint) => void;