import type { Corpus } from "./types.ts"; /** One thing wrong with a corpus, named precisely enough to fix. */ export type CorpusProblem = { file: string; /** The row index inside `items`, or null for a whole-file problem. */ index: number | null; message: string; /** * The row's own id, when it has one. * * An index is a counting exercise in a file of four hundred rows, and the id * is already in the row. The command prints this in place of the index. */ id?: string; }; export type LoadResult = { ok: true; corpus: Corpus; problems: CorpusProblem[]; } | { ok: false; corpus: null; problems: CorpusProblem[]; }; /** * Read a corpus directory, validating every row. * * Rows that fail validation are DROPPED and reported, and the load still * succeeds. That is deliberate: one malformed card must not cost a reader the * whole rulebook. A missing file or a version mismatch does fail the load, * because neither has a partial reading that means anything. */ export declare function loadCorpus(dir: string): Promise; /** * Check that every link in a corpus points at something that exists. * * Schema validation proves each row is shaped right. It cannot prove that a * rule's `parent_id` names a rule in the same file. A dangling parent is the * failure that matters most here, because the hierarchy tools walk those links * and a broken one silently truncates a branch of the rulebook. */ export declare function checkIntegrity(corpus: Corpus): CorpusProblem[]; //# sourceMappingURL=load.d.ts.map