Skip to content

inspection

Stable inspection errors never include stored cargo or raw SQL failures.

  • Error

new DeliveryInspectionError(code): DeliveryInspectionError

"unavailable" | "invalid_query"

DeliveryInspectionError

Error.constructor

readonly code: "unavailable" | "invalid_query"

DeliveryInspectionPageQuery = Schema.Codec.Encoded<typeof DeliveryInspectionPageQuerySchema>>

An email receipt page uses the same producer-key pagination.


DeliveryInspectionQuery = Schema.Codec.Encoded<typeof DeliveryInspectionQuerySchema>>

Input to one producer-local inspection. Cursors are producer keys, without storage prefixes.


PostReceiptSummary = Schema.Schema.Type<typeof PostReceiptSummarySchema>>

Metadata for one retained Post row.


PostInspectionPage = Schema.Schema.Type<typeof PostInspectionPageSchema>>

One read of producer-local Post dispatch evidence.


CarrierInspectionPage = Schema.Schema.Type<typeof CarrierInspectionPageSchema>>

One read of aggregate email dispatch evidence.

const DeliveryInspectionPageQuerySchema: Struct<{ limit: withDecodingDefaultType<Int, never>>; after: optional<String>>; }>

One bounded scan; an empty filtered page can still have a continuation.


const DeliveryInspectionQuerySchema: Struct<{ limit: withDecodingDefaultType<Int, never>>; after: optional<String>>; view: Literals<readonly ["receipts", "deadLetters"]>; }>

Post can filter dead letters while scanning at most one bounded page.


const PostReceiptSummarySchema: Union<readonly [Struct<{ key: String; state: Literal<"delivered">>; }>, Struct<{ key: String; state: Literal<"pending">>; kind: String; attempts: Int; nextAttemptAt: Number; }>, Struct<{ key: String; state: Literal<"dead">>; kind: String; attempts: Int; reason: Literals<readonly ["refused", "exhausted"]>; }>]>

Dispatch evidence deliberately omits the address and event.


const PostInspectionPageSchema: Union<readonly [Struct<{ status: Literal<"uninitialized">>; }>, Struct<{ status: Literal<"available">>; records: $Array<Union<readonly [Struct<{ key: String; state: Literal<"delivered">>; }>, Struct<{ key: String; state: Literal<"pending">>; kind: String; attempts: Int; nextAttemptAt: Number; }>, Struct<{ key: String; state: Literal<"dead">>; kind: String; attempts: Int; reason: Literals<readonly […, …]>; }>]>>; nextCursor: NullOr<String>>; }>]>

Bounded evidence with an explicit distinction between empty and uninitialized storage.


const CarrierReceiptSummarySchema: Struct<{ id: String; status: Literals<readonly ["queued", "dispatching", "provider_accepted", "outcome_unknown", "rejected", "refused", "expired", "superseded"]>; attempts: Int; retryAt: NullOr<Number>>; providerMessageId: optional<NonEmptyString>>; providerRejection: optional<Struct<{ code: NonEmptyString; class: Literals<readonly ["permanent", "temporary"]>; }>>; }>

Aggregate email evidence without bodies, headers or recipient addresses.


const CarrierInspectionPageSchema: Union<readonly [Struct<{ status: Literal<"uninitialized">>; }>, Struct<{ status: Literal<"available">>; records: $Array<Struct<{ id: String; status: Literals<readonly ["queued", "dispatching", "provider_accepted", "outcome_unknown", "rejected", "refused", "expired", "superseded"]>; attempts: Int; retryAt: NullOr<Number>>; providerMessageId: optional<NonEmptyString>>; providerRejection: optional<Struct<{ code: NonEmptyString; class: Literals<…>; }>>; }>>; nextCursor: NullOr<String>>; }>]>

Carrier’s bounded metadata page; unavailable storage is never reported as empty.

createDeliveryInspection(sql): object

Read existing storage without opening a sender, initializing tables, repairing jobs or arming a wake. The trusted host must admit an operator before calling.

Readonly<{ exec: (statement, …bindings) => WatchdogSqliteCursor; }>

email(input): { status: "uninitialized"; } | { status: "available"; records: readonly object[]; nextCursor: string | null; }

Read aggregate dispatch evidence without email cargo or recipient addresses.

number = ...

string = ...

{ status: "uninitialized"; } | { status: "available"; records: readonly object[]; nextCursor: string | null; }

post(input): { status: "uninitialized"; } | { status: "available"; records: readonly ({ key: string; state: "delivered"; } | { key: string; state: "pending"; kind: string; attempts: number; nextAttemptAt: number; } | { key: string; state: "dead"; kind: string; attempts: number; reason: "refused" | "exhausted"; })[]; nextCursor: string | null; }

Read Post metadata; filtered pages retain their continuation through other states.

number = ...

string = ...

"deadLetters" | "receipts" = ...

{ status: "uninitialized"; } | { status: "available"; records: readonly ({ key: string; state: "delivered"; } | { key: string; state: "pending"; kind: string; attempts: number; nextAttemptAt: number; } | { key: string; state: "dead"; kind: string; attempts: number; reason: "refused" | "exhausted"; })[]; nextCursor: string | null; }