/** * strategies/boundary-commit.ts * * Boundary commit, persists a compacted snapshot as a named checkpoint with * full lineage tracking for replay-safe session resumption. * * A boundary commit is always created after a successful compaction strategy * run (microcompact, collapse, autocompact, or reactive). It forms the * persistent anchor point that the resume-repair pipeline uses to restore * a session from a corrupted or partial state. * * Lineage is append-only: each commit appends its own checkpointId to the * parent's lineage array. This means any checkpoint can be sliced from any * earlier commit without re-ordering. */ import type { BoundaryCommit } from '../types.js'; import type { StrategyOutput } from '../types.js'; /** * Options for creating a boundary commit. */ export interface BoundaryCommitOptions { /** Session ID this commit belongs to. */ sessionId: string; /** The compaction strategy output to commit. */ strategyOutput: StrategyOutput; /** Parent boundary commit, or null for the first commit. */ parent: BoundaryCommit | null; /** Estimated token count before compaction (for audit). */ tokensBefore: number; } /** * Creates a new BoundaryCommit from a strategy output. * * The new commit's lineage is derived by appending its own checkpointId * to the parent's lineage (or starting a fresh lineage if `parent` is null). * * @param options - Commit options. * @returns A fully populated BoundaryCommit. */ export declare function createBoundaryCommit(options: BoundaryCommitOptions): BoundaryCommit; /** * Validates a BoundaryCommit for replay-safety. * * A commit is replay-safe if: * - It has at least one message * - Its lineage is ordered and contains its own checkpointId * - Its tokenCount is positive * * @returns An array of validation error strings (empty = valid). */ export declare function validateBoundaryCommit(commit: BoundaryCommit): string[]; //# sourceMappingURL=boundary-commit.d.ts.map