import { type ArtifactProvenance, type ReportCarryTarget } from './report-carry.js'; import type { PreparedSituationReport, SituationReporterSnapshot } from './situation-report.js'; export interface PendingReportOccurrence { kind: 'digest' | 'scheduled_full' | 'on_demand_full'; hourKey?: string; firedAtIso?: string; } export interface PendingReportDelivery extends PreparedSituationReport { deliveryId: string; occurrence: PendingReportOccurrence; target: ReportCarryTarget; payloadIdentity: string; } export interface PendingReportRequest { mode: 'full'; deliveryId: string; occurrence: PendingReportOccurrence; acceptedAtIso: string; target: ReportCarryTarget; payloadIdentity: string; } export interface PendingReportState { version: 1; digest: SituationReporterSnapshot; full: SituationReporterSnapshot; delivery?: PendingReportDelivery; request?: PendingReportRequest; } export interface PendingReportEmptyOutcome { status: 'empty'; revision: null; } export interface PendingReportQuarantinedOutcome { status: 'quarantined'; } export interface PendingReportReadyOutcome { status: 'ready'; /** SHA-256 of the exact validated source bytes used for a later CAS save. */ revision: string; state: PendingReportState; } export type PendingReportLoadOutcome = PendingReportEmptyOutcome | PendingReportQuarantinedOutcome | PendingReportReadyOutcome; export type PendingReportSaveExpectation = PendingReportEmptyOutcome | PendingReportReadyOutcome; export interface PendingReportStore { /** One transactionally consistent durable read, including any quarantine decision. */ loadOutcome?(): PendingReportLoadOutcome; load(): PendingReportState | null; /** * A quarantined outbox is distinct from an absent outbox: callers must not * replace an operation whose persisted intent could not be safely decoded. */ loadStatus?(): 'empty' | 'ready' | 'quarantined'; save(state: PendingReportState, expected?: PendingReportSaveExpectation): void; /** Explicit operator/API repair for a quarantined outbox. */ recoverWithValidState?(state: PendingReportState): void; } interface PendingReportRequestIdentityInput { mode: 'full'; deliveryId: string; occurrence: PendingReportOccurrence; acceptedAtIso: string; target: ReportCarryTarget; } interface PendingReportDeliveryIdentityInput { mode: 'digest' | 'full'; deliveryId: string; text: string; citedTriggerIds: readonly string[]; createdAtIso: string; provenance?: ArtifactProvenance; occurrence: PendingReportOccurrence; target: ReportCarryTarget; } export declare function pendingReportRequestPayloadIdentity(request: PendingReportRequestIdentityInput): string; export declare function pendingReportDeliveryPayloadIdentity(delivery: PendingReportDeliveryIdentityInput): string; interface PendingReportStoreTestHooks { /** Test-only synchronous barrier after invalid bytes are read but before marker+move. */ afterInvalidReadBeforeQuarantine?: () => void; } export declare class FilePendingReportStore implements PendingReportStore { private readonly path; private readonly log; private readonly testHooks?; constructor(path: string, log?: (line: string) => void, testHooks?: PendingReportStoreTestHooks | undefined); private quarantineMarkerPath; loadStatus(): 'empty' | 'ready' | 'quarantined'; loadOutcome(): PendingReportLoadOutcome; load(): PendingReportState | null; save(state: PendingReportState, expected?: PendingReportSaveExpectation): void; recoverWithValidState(state: PendingReportState): void; private readOutcomeInsideTransaction; } export {}; //# sourceMappingURL=pending-report-store.d.ts.map