/** * Storage key builders for the durable application delivery outbox (WFT-85). * * Spread into `KEYS` in `interface.ts` rather than declared there, so the * outbox keyspace can carry its full rationale without pushing that file past * its documented line ceiling. Callers still reach these through `KEYS`. * * Every key is scoped by an opaque `(namespace, ownerId)` pair. Weft never * interprets either component, and no key here overlaps the mailbox, workflow, * schedule, or worker-protocol keyspaces. * * @module storage/outbox-keys */ /** * Outbox header, delivery record, time-keyed due index, sequence-ordered * listing index, idempotency binding, terminal-retention index, and sink-probe * keys. * * Spread into `KEYS`; not intended to be imported directly by outbox code. */ export declare const OUTBOX_KEYS: { /** * The durable outbox header for one `(namespace, ownerId)` delivery outbox: * the listing sequence allocator plus the open-backlog counter that enqueue * backpressure reads. One key per outbox, so enqueue and terminal transitions * serialize against each other per outbox rather than globally. */ readonly applicationOutbox: (namespace: string, ownerId: string) => string; /** * A single-use probe an event sink writes in the first commit it makes for an * outbox, read back from the outbox's own storage. Its presence proves the * sink committed here rather than to some other backend; it is deleted as * soon as it has been observed. */ readonly applicationOutboxSinkProbe: (namespace: string, ownerId: string, nonce: string) => string; /** Scan prefix for every canonical delivery record in one outbox. */ readonly applicationDeliveryPrefix: (namespace: string, ownerId: string) => string; /** * The one authoritative record for a delivery. Every transition proves the * expected prior bytes through `storage.conditionalBatch`, so this key is the * delivery's compare-and-swap fence. */ readonly applicationDelivery: (namespace: string, ownerId: string, deliveryId: string) => string; /** Scan prefix for an outbox's time-keyed due index. */ readonly applicationDeliveryDuePrefix: (namespace: string, ownerId: string) => string; /** * The due index, keyed by the instant a delivery becomes claimable and then * by its id. Unlike the mailbox's FIFO index this is TIME-keyed: deliveries * are independent of one another, so a retry scheduled for later must not * hold back one queued for now. */ readonly applicationDeliveryDue: (namespace: string, ownerId: string, availableAt: number, deliveryId: string) => string; /** * Maps an idempotency key to the delivery id enqueued for it. Written in the * same conditional batch as the delivery record, gated on this key being * absent, so concurrent same-key enqueues converge on one delivery. Retained * past terminal so a post-terminal retry resolves the original receipt. */ readonly applicationDeliveryIdempotency: (namespace: string, ownerId: string, key: string) => string; /** Scan prefix for an outbox's full sequence-ordered listing index. */ readonly applicationDeliveryBySequencePrefix: (namespace: string, ownerId: string) => string; /** * Every delivery in the outbox, ordered by enqueue sequence. Distinct from * the due index, which holds only the claimable subset; a delivery stays here * until retention retires it, so bounded listing has an index covering every * state. */ readonly applicationDeliveryBySequence: (namespace: string, ownerId: string, sequence: number) => string; /** Scan prefix for an outbox's terminal-receipt retention index. */ readonly applicationDeliveryTerminalPrefix: (namespace: string, ownerId: string) => string; /** * Terminal-receipt retention index, sorted by the time the delivery reached * a terminal disposition so retention sweeps delete the oldest bounded batch * first. */ readonly applicationDeliveryTerminal: (namespace: string, ownerId: string, terminalAt: number, deliveryId: string) => string; };