/** * Annotation persistence. * * Every label carries its source, the model and prompt version that produced it, and the * deterministic baseline's verdict on the same block captured at the same moment. Storing the * baseline alongside is what makes a run reproducible as evidence: a later rule change cannot * silently rewrite what the disagreement was. */ import { type CorpusStore } from '../corpus/store'; import { type Label, type Reason } from '../types'; import { type LabelProbabilities } from './probabilities'; export interface AnnotationRow { path: string; representation: 'text' | 'html'; blockIndex: number; mimePart: string; blockStart: number; blockEnd: number; charCount: number; source: 'llm' | 'human' | 'weak' | 'distant'; label: Label; confidence: number; baselineLabel: Label | null; baselineConfidence: number | null; baselineReasons: readonly Reason[]; /** Full label distribution, when the annotator returns one. */ probabilities?: LabelProbabilities | null; } export interface AnnotationRunInfo { source: string; model: string | null; promptVersion: string | null; notes?: string; } export declare function startAnnotationRun(store: CorpusStore, info: AnnotationRunInfo): number; export declare function finishAnnotationRun(store: CorpusStore, runId: number, counts: { messages: number; blocks: number; failures: number; promptTokens: number; completionTokens: number; }): void; export declare function writeAnnotations(store: CorpusStore, runId: number, rows: readonly AnnotationRow[]): void; /** * Paths already annotated by this source, model and prompt version, so a run can resume. * * The prompt version is part of the key on purpose. Labels made under different prompt versions * are different data, and before this was keyed a PROMPT_VERSION bump followed by a resumed run * skipped every message the model had ever labelled and silently produced nothing new. */ export declare function annotatedPaths(store: CorpusStore, source: string, model: string | null, promptVersion?: string | null): Set; //# sourceMappingURL=store.d.ts.map