ACT 3
The Plan
Four work streams, one timeline, clear dependencies. Every step from where we are to where we're going — what's shipped, what's in flight, and what's next.
Act 1 named the structural flaw. Act 2 described the destination. Act 3 is the concrete plan — four work streams that address different facets of the same root cause, sequenced by dependencies, tracked by measurable KPIs. This isn't a wish list. It's an execution plan with shipped code behind it and a clear critical path ahead.
Two dependency chains converge at domain ownership. The top path — payment ordering — must complete before the bottom path — policy engine — can benefit from provider-aware signals. PDE inverts the ordering. Deferred collection generalizes it per provider. The provider boundary makes adding providers safe. On the other chain, the recompute engine sees all state. One Code Path routes all dunning through it. Customer state unifies the model. The policy engine makes decisions.
Q3 2025 through Q1 2026. The foundation is largely built — payment ordering inverted, recompute engine live, checkout unified, observability instrumented.
On-session payments now confirm before committing state. default_incomplete on all payment intents. Rollbacks dropped from 196/day to near zero for on-session flows. The ordering inversion that makes everything else possible.
One function reads all 5 stores and produces a unified account health assessment. Disagreeing accounts dropped from 691 to near zero. Invoice coverage went from 19% to full observability. The kernel of customer state.
Card vaulting and PayPal vaulting through one Turnstile-protected flow. Replaced the fragmented per-product checkout paths with a single entry point. The front door to billing.
Domain events from the recompute engine. Account health telemetry. Payment outcome tracking. Bad debt drift monitoring (13K → 500). The system can now see what it's doing — for the first time.
Stabilizing the recompute engine for production-scale dunning. Billing history corrected. Payment flow protected. Full remediation for state consistency. Cancellation enforced. Bad debt endpoint isolated. Counters instrumented.
Extending pay-before-commit to off-session flows — subscription renewals, invoice finalization, and retry attempts without the customer present. The harder half of the ordering inversion.
Designing the next iteration: 2-click checkout, editable line items, multi-product cart, Workers+Media bundle support, Google Pay, Apple Pay, and improved PayPal vaulting.
| Phase | Work | Enables |
|---|---|---|
| PDE Steps 3–4 | Plan+commit split. Pricing becomes a projection; commitment waits for payment confirmation. Full reversal logic deletion. | Provider-agnostic payment contract. The seam where provider adapters plug in. |
| Deferred Collection | Subscribe first, collect through any provider. The client_secret return pattern generalizes per provider. | Provider-agnostic checkout. PayPal-first and card-first flows use the same API. |
| One Code Path | All dunning logic through the recompute engine. Eliminate the legacy handler-per-event paths. 27 processors → direct PubSub subscription. | Single point of control for dunning policy. Prerequisite for the policy engine. |
| Stripe Consolidation | 15 Stripe packages → 1 boundary with adapters. Scoping phase to determine the provider interface contract. | The provider boundary. Adding a new payment provider means writing one adapter. |
| Entitlements Mapping | 7 packages → 1 function with 3 callers. Entitlements follow payment outcomes, not subscription events. | Provider-agnostic entitlements. The single function becomes the entitlement contract. |
Payment ordering inversion — confirm payment before committing state. Steps 1–4, plan+commit split, reversal logic deletion. Every complication traces to one decision: commit state before payment confirms. PDE inverts the order.
From blind handlers to a seeing engine. Recompute engine, graduated consequences, entitlement-connected outcomes. When recurring payment fails and the customer isn't present — one engine sees everything.
Single checkout surface replacing per-product pages. Card vaulting, PayPal vaulting, Turnstile, and the path to multi-product cart with Google Pay and Apple Pay.
Cross-cutting work that every initiative depends on. Provider abstraction via Go interfaces, canary deployments via Argo Rollouts, Sentry noise reduction, payments health dashboard.
Four streams, one destination. Each step narrows the gap between where the system is and where it needs to be. The path is tactical — reliability, observability, consolidation. The direction is strategic — a billing platform that owns its domain.