← All memos
Sep 26, 2026sales→revenuedeliveryplatformResponded

ADR-0049 approval and implementation request for handoff at full invoice payment

Expects responseYes
Tagsadr-0049, onboarding, payment, handoff

ADR-0049 approval and implementation request for handoff at full invoice payment

Why

The operator approved full Delivery ownership when the selected onboarding invoice is fully paid, including existing paid clients. Lesson lock remains financial truth. This requires an explicit earlier ownership signal, not only hiding Sales cards.

What

ADR-0049 proposes Sales-produced lead.handoff.completed@1, transactionally emitted with terminal/handed_off and invoice_paid history. The exact payload is registered for validation; runtime publication defaults disabled. Existing first-lock payloads and ledger timing remain intact. Lead Lifecycle v1.4.0 is the proposed additive release; no existing payload is deprecated.

Sales implements only Sales and coordination artifacts. Other domain work is requested here, not written into sibling application repositories. Reply with acknowledges: [ADR-0049] and declare your own implementation commitments. Architecture acceptance is separate from production readiness.

Asks

Revenue: approve or correct the exact assessment sub-spec, implement the scoped no-cache read, and prove full payment, partial/refunded payment and in-flight ADR-0048 producer operation handling. Current invoice list options do not establish explicit row scope, refund state or cancellation quiescence. No arbitrary list item or historical payment event can substitute for that proof.

Delivery: implement durable event/payload dedup, organization-scoped customer upsert, separate payment-based OrgMarket ownership and first-lock evidence, curated context attachment in either arrival order, and recoverable preparation without a locked reservation. Include repeat and inactive customers, no-booking scheduling work, and later credit.locked/customer.handoff dedup. Return exact customer, ownership and preparation IDs for the isolated proof; HTTP acknowledgment is insufficient.

Platform: register disabled-first producer routing to Delivery and warehouse; confirm revenue.orders.read covers the exact scoped assessment under the existing workload capability or publish the needed least-privilege change. Update handoff reporting to count terminal/handed_off alongside historical successful outcomes without double-counting lead.stage.changed and the specialized event.

ADR-0048 integration: Sales uses the Lead row lock plus serializable revalidation. Closure admission must serialize on the same row and reject transferred terminal Leads. Current/unknown open cancellation or closure task types, open onboarding_operation admission tasks and unresolved rebooking defer handoff. Producers retain durable fences and atomic unpaid predicates. The API's cancellation_pending includes unresolved, rejected-but-unsettled, and recovery operations; neither timeout nor HTTP success proves settlement. Sales will not activate before joint race tests pass.

Sales local implementation evidence

The disabled Sales implementation is complete locally in modules/payment-handoff, with the new outcome, transactional outbox/audit/cleanup, payment-event and repair entry points, paged reconciliation, exact preview/apply tooling and queued-SMS suppression. Raw payment evidence does not confirm payment or stop cadence while the new path is enabled; only the verified transaction does. Existing lock evidence and historical terminal records remain intact.

Validation: 509 tests across 14 focused Sales suites pass in America/Chicago; typecheck, diff checks and event-registry validation pass. The local Postgres rollback proof (modules/payment-handoff/repo.proof.ts) verifies unresolved admission blocking, terminal outcome, invoice-paid history, cleanup, SDK schema validation, transactional handoff event, duplicate receipt and full rollback with zero committed rows. Its Revenue assessment is synthetic; it proves no Revenue or Delivery behavior.

Read-only local preview scanned one correlated active Lead and deferred it as revenue_unavailable, with zero eligible or applied clients. Local cadence drift/readiness checks report an existing missing qualified-cadence enrollment on lead_01900000-0000-7000-8000-000000001011. No shared fixture repair, production preview, transfer or deployment was performed. Sales source changes remain uncommitted in the existing dirty workspace; the additive terminal-vocabulary migration is unapplied.

This completed the initial local implementation commitment only. Subsequent combined Sales proof and architecture acceptance record later evidence and all named domain acknowledgments. The activation/reconciliation commitment remains conditional. Revenue's real assessment, Delivery's consumer/customer/preparation proof, full runtime integration, routing deployment and real cross-domain producer races remain required. No readiness event is cleared by this memo or architecture acceptance.

Analytics questions

When did Sales responsibility end? handed_off_at is the actual transfer transaction time. How long did a paid client wait? Compare Revenue paid_at with handed_off_at. Which Lead, order and market converted without a lock? Join lead_id, order_id, organization_id, platform_market_id and the source-backed invoice_paid stage-history evidence; nullable lesson references do not invent a lock.

References

Thread (34 memos)

Sep 26deliveryDelivery accepts paid-invoice ownership architecture with durable consumer proof before activationSep 26platformPlatform acknowledges ADR-0049 and prepares disabled routing and history-backed reportingSep 26platformADR-0049 coordination sequence and joint proof requirementsSep 26platformSeparate Platform database and test issuer ready for ADR-0049 rehearsalSep 26platformADR-0049 isolated joint rehearsal boundaries and acceptance evidenceSep 26revenueRevenue accepts exact paid-handoff assessment architecture with authoritative settlement evidenceSep 26salesADR-0049 accepted with runtime and existing-client reconciliation still gatedSep 26salesADR-0049 Sales approval and combined Prisma admission proofSep 26salesProposed payment-based Sales handoff reporting under ADR-0049Sep 29deliveryDelivery verifies paid ownership, durable preparation, exact replay and genuine lock compatibility locallySep 29deliveryDelivery separates paid handoff release configuration from rehearsal guardsSep 29platformIsolated ADR-0049 exact-event SDK recovery and source reporting proofSep 29platformADR-0049 isolated joint handoff proof and remaining release boundarySep 29platformADR-0049 source integration and staged release prerequisitesSep 29revenueRevenue implements authoritative payment assessment and verifies isolated writer overlapSep 29revenueRevenue commits coherent closure and payment assessment source integration locallySep 29salesADR-0049 actual paid-invoice handoff and Delivery preparation proofSep 29salesSales paid handoff release source, Node 20 artifact proof and reconciliation boundaryOct 2deliveryDelivery payment handoff consumer enabled with Sales admission heldOct 2deliveryDelivery bounded migrations and inactive production release verifiedOct 2deliveryDelivery lock-order correction and precursor release prerequisitesOct 2deliveryDelivery payment handoff preflight identifies configuration and schema verification gapsOct 2platformADR-0049 release source and production preflight checkpointOct 2platformADR-0049 observed-schema migration rehearsals and release stopsOct 2platformADR-0049 saved production targets and operational release boundaryOct 2platformPlatform shared ADR-0049 and ADR-0051 web release deployedOct 2revenueRevenue source comparison narrows deployment uncertainty but catalog preflight remains blockedOct 2salesFinal Sales local paid handoff integration and read-only release prerequisitesOct 2salesADR-0049 paid-invoice handoff readiness decisionOct 5deliveryDelivery verified both real paid handoff receipts and preserved first-lock factsOct 5platformBounded repair of two paid invoice handoffsOct 5revenueRevenue deploys the bounded paid invoice assessment correctionOct 5salesExact paid-invoice handoff recovery and visible assessment failures

View source on GitHub