/** * reindex — reconcile-at-ingest index builder over VaultNote frontmatter. * * Walks a set of parsed VaultNotes, skips notes whose frontmatter.status is * SUPERSEDED_STATUS, maps surviving notes to FactInput records via noteToFacts, * and writes each fact through writeFact (the sanctioned reconcile-at-ingest path). * * PURE w.r.t. clock: accepts `now` as an injected ISO string — never calls * Date.now() or new Date() internally. * * bober: no judge is wired by default; ambiguous-key collisions fall back to * deterministic ADD (reconcile.ts:93-96). Wire a judge via opts.judge * if LLM-assisted conflict resolution is needed in a future sprint. */ import type { VaultNote } from "./types.js"; import type { FactStore } from "../state/facts.js"; import type { FactJudge } from "../orchestrator/memory/fact-judge.js"; import { SUPERSEDED_STATUS } from "./conventions.js"; export { SUPERSEDED_STATUS }; /** Summary of a reindex pass over a set of notes. */ export interface ReindexSummary { /** Number of notes actually indexed (excludes superseded notes). */ notesParsed: number; /** Facts written for the first time (ReconcileAction === "add"). */ factsAdded: number; /** * Facts whose value changed — prior row is superseded (ReconcileAction === "update"). * Named "superseded" in the summary because update = supersede the prior fact. */ factsSuperseded: number; /** Facts with an identical value already active — no write (ReconcileAction === "noop"). */ factsNoop: number; } /** * Walk `notes`, skip superseded ones, map each surviving note's frontmatter to * FactInput records, and write them through `writeFact` (never store.insertFact). * * Returns a tally of actions taken across all facts in all indexed notes. * * @param store Target FactStore — use new FactStore(':memory:') in tests. * @param notes Parsed VaultNotes from Sprint-1 parseNote / note-io. * @param opts.scope Fact scope label (e.g. "medical", "finance"). * @param opts.now Injected ISO-8601 wall-clock string; stamped on every * new FactInput as tValid and tCreated. * @param opts.sourceRunId Optional run provenance tag; null when absent. * @param opts.judge Optional LLM judge for ambiguous collisions; absent * = deterministic ADD fallback (reconcile.ts:93-96). */ export declare function reindexNotes(store: FactStore, notes: VaultNote[], opts: { scope: string; now: string; sourceRunId?: string | null; judge?: FactJudge; }): Promise; //# sourceMappingURL=reindex.d.ts.map