import type { CompiledDefinition, FeedbackRecord } from './types.js'; export declare function parseLedger(src: string): FeedbackRecord[]; export declare function serializeRecord(r: FeedbackRecord): string; export interface NewFeedback { kind: string; target: { concept: string; block?: string; row?: string; }; fields: Record; } /** Validate a submission against the definition and mint the record. */ export declare function createRecord(def: CompiledDefinition, input: NewFeedback, existing: FeedbackRecord[], now: string): FeedbackRecord; /** Same entity + same kind — the identity a replace-mode capture collapses on. */ export declare function sameTarget(a: FeedbackRecord['target'], b: FeedbackRecord['target']): boolean; /** * Apply a submission under the capture kind's declared semantics: * append → a new record; replace → supersede the existing record for this * entity+kind (same id kept — references stay stable; status resets to the * default because a changed answer needs re-triage). */ export declare function upsertRecord(def: CompiledDefinition, input: NewFeedback, existing: FeedbackRecord[], now: string): { records: FeedbackRecord[]; record: FeedbackRecord; replaced: boolean; }; /** Remove a record outright — for junk that never deserved the ledger. * NB: ids number from the surviving maximum, so deleting the NEWEST record * lets its id be minted again. Archive (a status) is the reversible path; * delete is for submissions that should never have existed. */ export declare function removeRecord(records: FeedbackRecord[], id: string): FeedbackRecord[]; /** Status change — only values from the definition's vocabulary are legal. */ export declare function setStatus(def: CompiledDefinition, records: FeedbackRecord[], id: string, status: string): FeedbackRecord[];