/** * Model-facing evidence retrieval (2.5.0 extension). * * Bridges a deterministic evidence reference (the id embedded in virtualized * tool results and checkpoint preambles) back to its authoritative cold * artifact. Retrieval is: * - read-only: it returns DATA, never privileged instructions * - bounded: a hard page cap so a single call can never re-inflate the model * context beyond the Context Governor's budget * - integrity-checked: content is rehashed against the stored contentHash and * fails closed on mismatch (never a synopsis, never fabricated content) * - deterministic: character-range paging so the model can page the same * artifact repeatedly and reconstruct it exactly * * Retrieval does NOT move completion authority. Merely fetching an archived * `node --test` output never means "tests verified"; the Reliability Kernel / * Completion Gate remain the sole authority for mission completion. */ import { type EvidenceArchive, type EvidenceRecord } from "./evidence-archive.js"; /** Default characters returned per page when the model does not specify a limit. */ export declare const DEFAULT_EVIDENCE_PAGE_CHARS = 4000; /** Hard maximum characters returned by a single retrieval (provider-independent). */ export declare const MAX_EVIDENCE_PAGE_CHARS = 8000; export type EvidenceRetrievalStatus = "ok" | "not-found" | "corrupt" | "invalid-range"; export type EvidenceIntegrity = "verified" | "unverified"; export interface EvidenceRetrievalMetadata { evidenceId: string; kind: EvidenceRecord["kind"]; source: string; contentHash: string; integrity: EvidenceIntegrity; totalBytes: number; totalChars: number; /** Inclusive start character index of the returned page. */ start: number; /** Exclusive end character index of the returned page. */ end: number; /** Number of characters actually returned. */ retrievedChars: number; /** True when more content exists after this page. */ hasMore: boolean; /** * The archive always stores the redacted representation, so retrieval only * ever returns the safe authoritative stored form — never the pre-redaction * secret material that was scrubbed at archive time. */ redaction: "archive-scrubbed"; } export interface EvidenceRetrievalResult { ok: boolean; status: EvidenceRetrievalStatus; evidenceId: string; /** Present only when status === "ok". */ content?: string; /** Present only when status === "ok". */ metadata?: EvidenceRetrievalMetadata; /** Human/LLM-readable reason for non-ok results. */ reason?: string; } export interface EvidenceRetrievalOptions { /** 0-based character offset. Default 0. */ offset?: number; /** Maximum characters to return. Default DEFAULT_EVIDENCE_PAGE_CHARS, hard-capped at MAX_EVIDENCE_PAGE_CHARS. */ limit?: number; } /** Clamp a requested page limit to [1, MAX_EVIDENCE_PAGE_CHARS], defaulting to the bounded default. */ export declare function clampEvidencePageLimit(limit: number | undefined): number; /** * Retrieve a bounded, integrity-verified page of an archived evidence artifact. * * Fails closed: * - unknown id -> status "not-found" * - hash mismatch -> status "corrupt" (no content returned) * - offset out of -> status "invalid-range" */ export declare function retrieveEvidencePage(archive: EvidenceArchive, evidenceId: string, options?: EvidenceRetrievalOptions): Promise; //# sourceMappingURL=evidence-retrieval.d.ts.map