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
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?)
procedure
(explain-order storage provider order-id) → order-explanation?
storage : commerce-storage? provider : string? order-id : string?
procedure
(redrive-issuance-work! storage idempotency-key #:now now) → issuance-outbox-item? storage : commerce-storage? idempotency-key : string? now : exact-nonnegative-integer?
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.}