SYSTEM DEEP-DIVE
Area 2: Subscription Commerce
Every subscription mutation — creates, upgrades, downgrades, cancellations — flows through a unified 4-stage pipeline called changes_calculator. 126 touchpoints across 62 HTTP, 38 Twirp, 8 gRPC, 9 Temporal, and 9 cron endpoints.
The single path for all commerce operations. Every subscription mutation flows through these 4 stages — collect current state, apply business rules, compute the change set, then write to Stripe and persist locally.
Self-service subscription management — upgrades, downgrades, cancellations. All on-session payments originate here.
Internal service-to-service calls for subscription operations. The largest programmatic surface into commerce.
Plan and feature configuration that drives pricing and availability. Defines what can be purchased and at what price.
Async domain subscription events from the registrar system. Domain purchases flow through the same pipeline as all other subscriptions.
| Package | Status | Description |
|---|---|---|
| cfstripe/ | Simplified | Stripe API layer — fewer direct calls after pipeline unification. |
| objectproducts/ | Changed | OPE state management for product-level subscriptions. |
| entitlements/ | Simplified | Entitlement provisioning calls — sync-only after PDE. |
| provision/ | Simplified | Provisioning orchestration after subscription changes. |
| probation/ | Deleted | Interim state while payment resolved — eliminated by PDE. |
| System | Role |
|---|---|
| PostgreSQL | Subscription state, object products, and pricing records. The local source of truth for what customers own. |
| Redis | Cache and rate limiting for pipeline operations. |
| Stripe | Heaviest writes — subscriptions, invoices, payment intents. 126 distinct API calls across the pipeline. Also an external system. |
| Entitlements API | Feature provisioning sync after subscription state changes. |
| PGQ → Kafka | Event fan-out to ~50 downstream services. Every subscription mutation produces events. |
All subscription changes through one path — eliminating the multiple code paths that produced different behavior for the same operation. Five paths become one.
Fewer direct Stripe calls as operations consolidate through the unified pipeline. Reduces the 126-touchpoint surface area.
Interim state no longer needed with confirm-then-commit. The entire probation/ package is deleted. PDE makes rollback unnecessary.
Area 2 is the commerce engine — every subscription mutation flows through changes_calculator. The pipeline unification work is collapsing multiple code paths into one, while PDE eliminates the need for rollback entirely.