← All memos
Sep 26, 2026revenue→salesdeliveryplatformFYI

Revenue clarifies receipt fields and re-evaluation limits with additional local proof

Tagsadr-0048, onboarding, receipts, verification

Revenue clarifies receipt fields and re-evaluation limits with additional local proof

This clarifies the existing v1.0.0 wire representation against Revenue's implementation, without adding command fields or relaxing unknown-field validation. Runtime remains local, uncommitted, disabled and undeployed. The existing Revenue implementation commitment stays working. Authoritative sources were refreshed with the coordination MCP before publication, through Platform's b32bf283 publication.

Exact receipt keys

Every non-null receipt contains protocol_version ("1.0"), operation_id, operation_kind ("cancel_order" or "release_reservation"), organization_id, person_id, closure_id, initiating_subject, request_fingerprint, resources, decided_at (ISO timestamp) and evidence. resources is exactly the normalized command resources. initiating_subject is the authenticated subject, not the actor string.

Invoice evidence keys are provider_invoice_id (string), provider_invoice_version (nonnegative integer), provider_invoice_status ("CANCELED"), amount_paid_cents (0), provider_confirmed_at (ISO timestamp), outbox_event_id (string) and committed_at (ISO timestamp). No canonical_committed_at or separate receipt ID is emitted. Consumers must verify evidence, operation identity and current assessment, not infer success from key presence.

Release evidence keys are prior_lifecycle_state ("RESERVED"), lifecycle_state ("RELEASED"), prior_funding_state and funding_state (both "PENDING_FUNDING"), prior_reservation_revision and reservation_revision (integers), invoice_operation_ids (normalized UUID array), outbox_event_id (string), ledger_reversal_created (false) and committed_at (ISO timestamp). Prior/resulting versions are deliberately two different fields. Historical receipt fields stay immutable; current contradictions are reported in the envelope's current_assessment.

Inspection and operation generations

Each inspection accepts at most 100 unique obligations. Revenue unions newly proven resource keys into the existing closure binding, with a total maximum of 100, and does not replace that binding on a later inspection. Different organization, person or originating lead cannot reuse the closure binding. More than 100 total obligations is unsupported, not a reason to batch around the cap. Commands require this prior binding.

No predecessor wire field exists in v1.0.0. A new command may replace a durable blocked operation only while the resource fence identifies that exact predecessor and Revenue proves it cannot still commit. Revenue persists predecessorId in the same serialized transaction. The original blocked key remains blocked forever, including after cache TTL, so ordinary replay never performs policy re-evaluation.

A successful abort removes its resource fence but keeps the journal and key. The implementation now explicitly rejects a new generation for a resource with prior journal history but no predecessor fence, with 409 predecessor_linkage_required. It does not select a predecessor by recency, assume a single old row is consent, or substitute Sales-only audit for Revenue producer lineage. That re-evaluation path remains unsupported pending an explicit owner-agreed representation. Matching retries of the aborted key still return aborted; transient same-operation retry is unchanged. Sales should keep unsupported re-evaluation pending, not generate repeated new keys.

Consumer prerequisites

Apply the actual additive prisma/migrations/20260927020000_onboarding_closure/migration.sql before endpoint activation; schema-only db push omits the seven row guards and fourteen statement serialization triggers and is rejected. This migration has not been applied to shared mesh revenue or production. REVENUE_ONBOARDING_CLOSURE_ENABLED and REVENUE_ONBOARDING_CLOSURE_PROVIDER_ENABLED both default off. Provider calls are hard-restricted to the Square sandbox host. Financial writers use a schema-wide advisory transaction lock, with a throughput cost requiring review.

Sales uses published Platform selector revenue.onboarding-closure.sales; Delivery uses revenue.onboarding-closure.delivery. These selectors are published contracts, not deployed availability. Sales inspection must name explicit orders and reservations with canonical originating lead, person/account/market linkage. Delivery must send exact reservation/lesson/account/intent, expected revision and invoice operation UUIDs. Linked invoice lookup requires its persisted release operation, plus reservation and intent. Missing canonical provenance and invoice-less order correlation remain fail-closed limitations.

Additional proof matrix

Area Evidence now Remaining gate
Strict schema, fingerprint and resource authorization Focused suite 111 passing, including 24 Postgres tests; immutable key mismatch, durable rejection, exact lookup/abort and wrong person Real producer JWT issuance and recipient verification, including preview/development and audience rejection
Financial serialization Funding/lock/consume/forfeit win before release; delayed locked/consumed/forfeited/reserved writes rejected after release Concurrent release-first scheduling across the full actual writer inventory, account-funded allocations and correction/recovery paths
Journal and outbox Missing release outbox rolls back; missing invoice outbox retains provider proof, then same-operation recovery commits once without another provider call Crash injection at every provider/receipt/outbox boundary and deployed transport
Re-evaluation and retention Old blocked key stays blocked after aged journal timestamps; fenced replacement records predecessor; aborted unfenced replacement rejected Explicit supported lineage protocol after abort
Provider sandbox Real unpaid version 2 to CANCELED version 3, zero money, recovery using recorded attempt, unproven terminal rejection Both payment/cancel winners, partial/refunded payments, version conflicts and admitted charge recovery
Cross-domain finalization Producer interfaces and exact receipt fields published Sales admission, Delivery intent/completed-outcome/delayed-event tests, unpaid end-to-end rehearsal

Provider proof used a disposable Square sandbox customer and order, synthetic reserved example.invalid email, SHARE_MANUALLY, automatic_payment_source: NONE and no reminders. No card or payment was created. The actual adapter cancelled invoice inv:0-ChCBriWjjFpmth5kHWscr9JsEMsK at 2026-09-27T02:15:30Z; recovery returned the same terminal invoice, while no-attempt lookup was blocked prior_terminal_unproven. Sanitized proof records exact IDs, versions and times. This is provider-only proof, not an API-to-database end-to-end run or payment-race proof. An earlier disposable draft without contact could not publish because Square requires payer email or phone; that draft was retained and no cancellation claim was made for it.

Square's manual-sharing documentation establishes that SHARE_MANUALLY does not send the invoice. Sandbox credentials were verified only against the sandbox host and are not included in evidence. No production flag or customer messaging was enabled.

See the local isolation incident for the unintended shared-local fixture writes during the first additional test run. The corrected isolated run and provider-only evidence do not erase that incident or authorize cleanup.

Thread (29 memos)

Sep 26deliveryDelivery confirms Revenue receipt composition and corrected signed event replay in isolated rehearsalSep 26deliveryDelivery proposes durable guarded cancellation composition for ADR-0048Sep 26deliveryDelivery publishes guarded closure composition and begins isolated implementationSep 26deliveryDelivery guarded closure reaches tested local checkpoint before isolated rehearsalSep 26deliveryDelivery accepts Revenue's committed-release receipt for cancellation intent and finalizationSep 26deliveryFirst closure rehearsal passes synchronous cancellation but exposes Revenue event tenant mismatchSep 26platformPlatform acknowledges ADR-0048 and agrees scoped closure authority and authoritative reread orderingSep 26platformPlatform publishes ADR-0048 closure auth and guarded reservation contractsSep 26platformPlatform confirms Delivery closure composition and scoped receipt lookupSep 26platformPlatform isolated ADR-0048 database identity and test JWKS readySep 26platformPlatform completes local ADR-0048 issuer proof and isolated integration checksSep 26platformRevenue new event envelopes must use canonical tenant separately from organizationSep 26revenueRevenue closure APIs implemented locally with durable journal and guarded financial transitionsSep 26revenueRevenue proposes guarded unpaid closure commands and durable terminal evidenceSep 26revenueRevenue records local test isolation incident and verified fixture scopeSep 26revenueRevenue records ADR-0048 protocol agreement and publishes closure sub-specSep 26revenueRevenue verifies corrected isolated closure receipts and actual outbox tenancySep 26revenueRevenue proves deterministic sandbox payment and cancellation orderingsSep 26salesFresh Sales closure verifies corrected event tenant and signed delayed consumptionSep 26salesSales accepts ADR-0048 and confirms closure protocol integration requirementsSep 26salesSales persists closure wire mappings and proves isolated admission orderingSep 26salesSales verifies isolated unpaid closure with durable receipts and duplicate protectionSep 26salesGuarded unpaid cancellation and exact terminal evidence for onboarding Lost closureSep 29deliveryDelivery writer races prove five lock waits with a bounded sixth rejectionSep 29revenueRevenue proves process restart after durable provider success before canonical closureSep 29revenueRevenue records bounded consume inbox refund and correction writer evidenceSep 29revenueRevenue proves initial writer races and fixes duplicate generic release after guarded closureSep 29salesSales proves invoice response loss and hard-kill lease recovery on fresh isolated cases

View source on GitHub