import type { StoredRun, StoredRunStep, StoredSession } from '@opensip-cli/contracts'; import type { DataStore } from '@opensip-cli/datastore'; /** Bounds for one exact parent-Run evidence snapshot. */ export interface ResolveParentRunEvidenceOptions { readonly runId: string; readonly stepLimit?: number; readonly sessionLimit?: number; readonly byteBudget?: number; } /** Exact parent Run plus its admitted ordered steps and linked Sessions. */ export interface ParentRunEvidenceSnapshot { readonly run: StoredRun; readonly steps: readonly StoredRunStep[]; /** Linked Sessions ordered by their first included RunStep. */ readonly sessions: readonly StoredSession[]; } /** Count and truncation facts for one evidence collection. */ export interface ParentRunEvidenceInclusion { readonly total: number; readonly included: number; readonly truncated: boolean; } /** Bounded byte and inclusion evidence for one parent-Run snapshot. */ export interface ParentRunEvidenceMetadata { readonly steps: ParentRunEvidenceInclusion; readonly sessions: ParentRunEvidenceInclusion; readonly byteBudget: number; /** Bytes required for the mandatory exact Run with empty detail arrays. */ readonly baseBytes: number; /** Canonical JSON bytes of the complete returned `snapshot`. */ readonly serializedBytes: number; /** True when mandatory exact Run metadata alone exceeds `byteBudget`. */ readonly baseExceedsBudget: boolean; /** * True when a stored JSON byte-length preflight stopped before parsing a * linked payload. This check is intentionally conservative: legacy JSON * whitespace/escapes can make stored bytes larger than canonical output. */ readonly conservativePayloadPreflightTruncated: boolean; readonly truncated: boolean; } /** Successful exact parent-Run evidence projection. */ export interface ParentRunEvidenceFound { readonly status: 'found'; readonly snapshot: ParentRunEvidenceSnapshot; readonly metadata: ParentRunEvidenceMetadata; } /** Exact evidence read result without leaking persistence errors. */ export type ResolveParentRunEvidenceResult = ParentRunEvidenceFound | { readonly status: 'not-found'; }; /** * Resolve one immutable exact Run/RunStep/linked-Session snapshot. * * The mandatory exact Run is never dropped. Ordered step/session pairs are * admitted only while count caps and the canonical snapshot byte budget hold. * When the mandatory base alone exceeds the requested budget, the result * truthfully reports `serializedBytes > byteBudget` and returns no detail. */ export declare function resolveParentRunEvidence(store: DataStore, options: ResolveParentRunEvidenceOptions): ResolveParentRunEvidenceResult; //# sourceMappingURL=run-evidence-read.d.ts.map