/** * The daemon's journal fold policy: which retained records a partition may * forget at replay and at compaction (journal sprint owner decision D1). The * journal package stays generic — it applies these verdicts in seq order — and * this module decides WHAT is dead, per record type, from the payload alone. * * Every verdict is a pure function of the record: no state between records, * so the one frozen policy serves every partition and every pass (read-only * preparation, activation, background compaction). An unknown or malformed * record is always kept — the fold forgets superseded history, never evidence * it cannot classify. * * Invariants the projections replay under (the equivalence test pins them): * - a command keeps its `command.accepted` (a group per id, so a duplicate * acceptance survives) and its latest `command.updated`; * `command.pruned` forgets both plus the pruned runs' journaled run events, * and survives itself as the latest tombstone per root set so crash-GC keeps * the pruned commands' project roots (model-operation receipts are never * pruned by retention — INV-064); * - a terminal run keeps its terminal `run.event` (exactly one in a * well-formed journal; duplicate terminals survive until the run's prune * tombstone retires the whole group, so replay validation fails on them * as loudly as on an unfolded journal); a live run keeps `run.created` * plus its journaled progress events; * - a resolved interaction forgets its request AND its resolution as a pair * through the resolution (a resolution follows its request, so retiring * on the resolution can never leave a partial pair — an `interrupted` or * `run_terminal` resolution lands AFTER the run's terminal event); a * pending request is kept per id as a group, so a duplicate request frame * survives for the InteractionStore's own duplicate check until its * resolution retires the whole group. Every `interaction.resolved` frame * is dropped, so an orphan or duplicate resolution the unfolded replay * refuses ("interaction resolution precedes request") is forgotten on the * folded path — inherent in the pair rule, disclosed; * - quota keeps the latest projection marker and, per subject key, two * slots: the latest scoped prepare and the latest upsert. Sequence numbers * are preserved, so the registry's adjacency check (`upsert.seq === * prepare.seq + 1`) commits exactly the pairs that were adjacent on disk; * a prepare left behind by a later plain upsert is non-adjacent and ignored * on replay like any orphan prepare today (residual: at most one stale * prepare frame per subject). `quota.subject.removed` retires both slots * of that (harness, subject_id) across routes and sources; * - `thread.head.updated` keeps the latest revision per thread; * - `setup.job.saved` is kept whole (the setup reducer validates every * state/phase/evidence transition, so intermediate saves are replay * authority); a terminal save retires the job's `setup.job.log` lines. */ import type { JournalFold } from "@claudexor/journal"; /** The one frozen policy for every partition and every pass. */ export declare const journalFoldPolicy: JournalFold; //# sourceMappingURL=journal-fold-policy.d.ts.map