On this page:
find-issuance-work
order-explanation
explain-order
redrive-issuance-work!
17.1 Operator CLI

17 Operator surface🔗ℹ

 (require commerce/operator) package: commerce

Server processes explicitly require commerce/operator. The surface answers operator questions without exposing raw provider bytes; deep journal payload access stays behind commerce/journal.

procedure

(find-issuance-work storage 
  [#:status status]) 
 → (listof issuance-outbox-item?)
  storage : commerce-storage?
  status : (or/c symbol? #f) = #f
Enumeration is read-only and stable by id.

struct

(struct order-explanation (order events work credentials))

  order : (or/c order-projection? #f)
  events : (listof payment-event?)
  work : (listof issuance-outbox-item?)
  credentials : (listof issued-credential-record?)
The explanation carries the order projection, the canonical event snapshots (never raw provider payloads), the order’s outbox work, and its issued-credential records if any.

procedure

(explain-order storage provider order-id) → order-explanation?

  storage : commerce-storage?
  provider : string?
  order-id : string?
Explains one order from durable state only.

procedure

(redrive-issuance-work! storage 
  idempotency-key 
  #:now now) 
 → issuance-outbox-item?
  storage : commerce-storage?
  idempotency-key : string?
  now : exact-nonnegative-integer?
Makes one 'pending row due immediately without touching its attempts counter — the bounded answer to transient failures and short backoffs. It refuses to rewind in-flight work ('lease-not-held) or completed work ('work-already-completed), and unknown keys fail with 'unknown-issuance-work. Replay always reuses the immutable journal through the normal projection path; no operation edits a projection row.

17.1 Operator CLI🔗ℹ

raco commerce doctor   <database>

raco commerce find     <database>

raco commerce explain  <database> <provider> <order-id>

raco commerce redrive  <database> <idempotency-key>

raco commerce wraps commerce/operator for one service database. Output is JSON with redacted summaries; doctor exits 0 when the readiness snapshot has no warnings and 1 otherwise, and redrive exits 0 on success and 1 with a typed code on refusal.

doctor <database> is the read-only first-line probe: it reports the storage schema version, journal/projection counts, pending and stale-lease work, claim state, and every typed health warning in one JSON object. It opens the database with SQLite read-only access, never creates an index or migrates a schema, and reports a typed refusal for an absent or incompatible database. Use find|explain|redrive for the follow-up action.}