/** * The state machine: what happens when a finding is seen again. * * Every rule here is about not losing an adjudication. A defect somebody ruled * by-design must not come back as new work the next time the judge files it; a * fixed finding that reappears must reopen rather than arrive as a second * issue; and a finding still open when it is seen again is refreshed, not * duplicated. Status transitions live here for the same reason: they are the * other half of the same machine. */ import { deterministicToFindings } from "./ingest.js"; import { type Absorption } from "./rekey.js"; import type { Backlog, BacklogFinding, FindingStatus } from "./lib.js"; export interface MergeResult { added: string[]; refreshed: string[]; reopened: string[]; suppressed: string[]; /** Shell findings that folded route-scoped history into themselves. */ absorbed: Absorption[]; } export declare function mergeFindings(backlog: Backlog, incoming: ReturnType, runId: string, now: string): MergeResult; export declare function setStatus(backlog: Backlog, fingerprint: string, status: FindingStatus, opts: { reason?: string; commit?: string; runId: string; now: string; }): BacklogFinding;