Skip to content
API reference

inspection

Import
import * as api from "@fungi.computer/carrier/inspection";
Kind Export Description
class DeliveryInspectionError Stable inspection errors never include stored cargo or raw SQL failures.
type alias DeliveryInspectionPageQuery An email receipt page uses the same producer-key pagination.
type alias DeliveryInspectionQuery Input to one producer-local inspection. Cursors are producer keys, without storage prefixes.
type alias PostReceiptSummary Metadata for one retained Post row.
type alias PostInspectionPage One read of producer-local Post dispatch evidence.
type alias CarrierInspectionPage One read of aggregate email dispatch evidence.
constant DeliveryInspectionPageQuerySchema One bounded scan; an empty filtered page can still have a continuation.
constant DeliveryInspectionQuerySchema Post can filter dead letters while scanning at most one bounded page.
constant PostReceiptSummarySchema Dispatch evidence deliberately omits the address and event.
constant PostInspectionPageSchema Bounded evidence with an explicit distinction between empty and uninitialized storage.
constant CarrierReceiptSummarySchema Aggregate email evidence without bodies, headers or recipient addresses.
constant CarrierInspectionPageSchema Carrier’s bounded metadata page; unavailable storage is never reported as empty.
function createDeliveryInspection() Read existing storage without opening a sender, initializing tables, repairing jobs or arming a wake. The trusted host must admit an operator before calling.

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

  • Error
Signature
new DeliveryInspectionError(code): DeliveryInspectionError;
Parameter Type
code "unavailable" | "invalid_query"

DeliveryInspectionError

Signature
Error.constructor;
Signature
readonly code: "unavailable" | "invalid_query";

DeliveryInspectionPageQuerytype alias

Section titled “DeliveryInspectionPageQuery”
Signature
type DeliveryInspectionPageQuery = Schema.Codec.Encoded<
typeof DeliveryInspectionPageQuerySchema
>;

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


DeliveryInspectionQuerytype alias

Section titled “DeliveryInspectionQuery”
Signature
type DeliveryInspectionQuery = Schema.Codec.Encoded<
typeof DeliveryInspectionQuerySchema
>;

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


PostReceiptSummarytype alias

Section titled “PostReceiptSummary”
Signature
type PostReceiptSummary = Schema.Schema.Type<typeof PostReceiptSummarySchema>;

Metadata for one retained Post row.


PostInspectionPagetype alias

Section titled “PostInspectionPage”
Signature
type PostInspectionPage = Schema.Schema.Type<typeof PostInspectionPageSchema>;

One read of producer-local Post dispatch evidence.


CarrierInspectionPagetype alias

Section titled “CarrierInspectionPage”
Signature
type CarrierInspectionPage = Schema.Schema.Type<
typeof CarrierInspectionPageSchema
>;

One read of aggregate email dispatch evidence.

DeliveryInspectionPageQuerySchemaconstant

Section titled “DeliveryInspectionPageQuerySchema”
Signature
const DeliveryInspectionPageQuerySchema: Struct<{
limit: withDecodingDefaultType<Int, never>;
after: optional<String>;
}>;

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


DeliveryInspectionQuerySchemaconstant

Section titled “DeliveryInspectionQuerySchema”
Signature
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.


PostReceiptSummarySchemaconstant

Section titled “PostReceiptSummarySchema”
Signature
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", "expired"]>;
}>,
]
>;

Dispatch evidence deliberately omits the address and event.


PostInspectionPageSchemaconstant

Section titled “PostInspectionPageSchema”
Signature
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.


CarrierReceiptSummarySchemaconstant

Section titled “CarrierReceiptSummarySchema”
Signature
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.


CarrierInspectionPageSchemaconstant

Section titled “CarrierInspectionPageSchema”
Signature
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()function

Section titled “createDeliveryInspection()”
Signature
function 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.

Parameter Type
sql Readonly<{ exec: (statement, …bindings) => WatchdogSqliteCursor; }>
Name Type Description
email() (input) => | { status: "uninitialized"; } | { status: "available"; records: readonly object[]; nextCursor: string | null; } Read aggregate dispatch evidence without email cargo or recipient addresses.
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: "expired" | "refused" | "exhausted"; })[]; nextCursor: string | null; } Read Post metadata; filtered pages retain their continuation through other states.