/** * Durable evidence that a single-PR Shepherd poll observed a ready PR after * its ready-delay elapsed. The ref OIDs and readiness fingerprint are part of * the evidence: a receipt is never a general-purpose "this PR is ready" * cache. */ export interface ReadyReceipt { version: 1; owner: string; repo: string; pr: number; headRefOid: string; baseRefOid: string; status: "READY"; isDraft: false; /** Canonical representation of the readiness inputs observed by Shepherd. */ readinessFingerprint: string; /** Exact merge-queue removal observed by the one-PR session, if any. */ acknowledgedQueueRemovalId?: string; recordedAtUnix: number; } export interface ReadyReceiptKey { owner: string; repo: string; pr: number; } export interface ReadyReceiptCurrentState { headRefOid: string; baseRefOid: string; readinessFingerprint: string; status: string; isDraft: boolean; } /** Read a persisted one-PR readiness receipt. Invalid/stale-shaped files are ignored. */ export declare function readReadyReceipt(key: ReadyReceiptKey): Promise; /** Persist evidence for a completed one-PR ready-delay observation. */ export declare function writeReadyReceipt(receipt: ReadyReceipt): Promise; /** Remove a receipt after the observed PR state no longer matches it. */ export declare function clearReadyReceipt(key: ReadyReceiptKey): Promise; /** * Check the complete binding before using a receipt for aggregate routing. * Callers must provide a fresh fingerprint from the same readiness inputs used * to create the receipt; ref OIDs alone are not sufficient. */ export declare function isReadyReceiptCurrent(receipt: ReadyReceipt | null, current: ReadyReceiptCurrentState): receipt is ReadyReceipt;