import type { Finding } from "./finding.js"; import type { FactStore } from "../state/facts.js"; import type { ReconcileAction } from "../state/facts.js"; /** * Persist a Finding into the hub pool via the reconcile layer. * Routes through writeFact (not raw insertFact) so dedup/supersede works. * * PURE: never reads the clock; `now` is injected by the CLI boundary. */ export declare function writeFinding(store: FactStore, finding: Finding, { now }: { now: string; }): Promise; /** * Read all active hub Findings from the store. * Uses FindingSchema.parse — throws on malformed rows (unlike the * safeParse+skip approach in FactStoreFindingSource). */ export declare function readFindings(store: FactStore): Finding[]; /** * Read the active Finding for `id`, apply `newStatus` (+ optional field * mutation), and write it back via writeFinding. Because subject=id and * predicate='finding' are unchanged but the value differs, reconcileFact * takes the UPDATE branch (supersede old + insert new), preserving the * prior row as bitemporal history (reconcile.ts:70-78). * * Returns the new Finding, or null if no active Finding has that id. * PURE: never reads the clock — `now` is injected at the CLI boundary. */ export declare function transitionFinding(store: FactStore, id: string, newStatus: Finding["status"], { now, mutate }: { now: string; mutate?: Partial; }): Promise; /** Tag prefix used to encode the wake time on a snoozed Finding. */ export declare const SNOOZE_TAG_PREFIX = "snooze-until:"; /** * Extract the wake-time ISO string from a Finding's tags, or null if absent * or if no valid snooze-until tag exists. * PURE: no clock read; tag parsing only. */ export declare function snoozeUntil(finding: Finding): string | null; /** * Returns true when a Finding should appear in the default task list. * * Visibility rules: * - open / in-progress → always visible * - snoozed + valid wake time in the future (wake > now) → hidden * - snoozed + wake time <= now (past or present) → visible again * - snoozed + no snooze-until tag → visible (user must re-triage) * - done / dropped → not visible * * PURE: `now` is injected; no Date.now() or new Date() inside. * Lexicographic ISO compare is safe because both sides are toISOString() * output (YYYY-MM-DDTHH:mm:ss.sssZ — fixed-width, lexicographically ordered). */ export declare function isVisibleInDefaultList(finding: Finding, now: string): boolean; /** * Validate + normalize a domain-supplied Finding payload, then persist it via * writeFinding so reconcile dedups a re-surfaced finding to a single active row. * * - Validates with .parse — THROWS on a missing required field (caught at the CLI boundary). * - Derives a content-stable id from domain|title|kind when absent (supplied id is kept). * - Sets surfacedAt = now when absent. PURE: never reads the clock; `now` is injected. * Returns the ReconcileAction (add | update | delete | noop). */ export declare function ingestFinding(store: FactStore, input: unknown, { now }: { now: string; }): Promise; //# sourceMappingURL=finding-store.d.ts.map