import type { StoredRun, StoredRunStep, StoredSession, StoredSessionHostMetrics } from '@opensip-cli/contracts'; import type { DataStore } from '@opensip-cli/datastore'; /** Maximum Sessions accepted by one all-or-nothing host evidence commit. */ export declare const MAX_EVIDENCE_BUNDLE_SESSIONS = 256; /** Maximum ordered RunSteps accepted by one all-or-nothing evidence commit. */ export declare const MAX_EVIDENCE_BUNDLE_STEPS = 512; /** Maximum canonical serialized input size accepted by one evidence commit. */ export declare const MAX_EVIDENCE_BUNDLE_BYTES: number; export interface EvidenceBundleSession { readonly session: StoredSession; readonly hostMetrics: StoredSessionHostMetrics; } export interface EvidenceBundleRun { readonly run: StoredRun; readonly steps: readonly StoredRunStep[]; } /** * A synchronous, read-only condition evaluated after both the datastore write * lock and SQLite transaction are active. Returning false rejects the bundle * without writing any row. */ export type EvidenceBundlePrecondition = () => boolean; export interface EvidenceBundleInput { readonly sessions: readonly EvidenceBundleSession[]; readonly run?: EvidenceBundleRun; readonly precondition?: EvidenceBundlePrecondition; } export type EvidenceBundleFailureReason = 'invalid-input' | 'limit-exceeded' | 'duplicate-id' | 'missing-session-link' | 'write-failed'; export type EvidenceBundleCommitResult = { readonly status: 'committed'; readonly sessionIds: readonly string[]; readonly runId?: string; readonly sessionCount: number; readonly stepCount: number; readonly serializedBytes: number; readonly persistMs: number; } | { readonly status: 'precondition-rejected'; } | { readonly status: 'failed'; readonly reason: EvidenceBundleFailureReason; }; /** * Atomically commit host-owned evidence without exposing raw SQL or datastore * handles. All shape, count, identity, mapping, and byte checks complete before * the first insert. Retained Session-link checks and the optional precondition * execute inside the same write lock and transaction as every insert. */ export declare function commitEvidenceBundle(store: DataStore, input: EvidenceBundleInput): EvidenceBundleCommitResult; /** * Measure an input with the exact canonical byte accounting enforced by * {@link commitEvidenceBundle}. Host accumulators can use this pure seam to * reject an over-budget contribution before finalization. */ export declare function measureEvidenceBundleBytes(input: EvidenceBundleInput): number; //# sourceMappingURL=evidence-bundle.d.ts.map