feat(billing): fetch authoritative Stripe subscription state - #525
feat(billing): fetch authoritative Stripe subscription state#525seonghobae wants to merge 22 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Buyer/reliability outcome
Refs #488. This Draft stacked slice establishes a bounded authoritative Stripe Subscription read boundary before webhook evidence can influence durable lifecycle or entitlement state. A signed webhook remains authenticated evidence and a reconciliation trigger; it is not proof that its embedded subscription snapshot is current.
Exact current stack
develop:df0fa17bd5035af6455c889022c540b4f439e3d6;feat/stripe-webhook-event-ledger-488@3f63e97cc730cd3874f3d78baf6ecadf50c38623;e4f75a48c248b4c6cf8cc9f97d75803a58415b75;The current head is a non-destructive two-parent reconciliation of predecessor child
ad92d99138fe76d4dbef0dc673932bb9891957e7with the exact current event-ledger parent. The effective diff preserves the parent’s composed app/toast route, OpenCode/changelog/orchestrator registrations, Checkout attempt/reconciliation/provider regressions, webhook verifier/event ledger, accessibility coverage, and exact owned-production coverage.CHANGELOG.mdadds exactly five subscription-reader lines with zero parent deletions.Any parent, contributor-head, or protected-base movement invalidates ancestry- and head-specific evidence until freshly reconciled.
Implemented bounded trust boundary
server/stripe_subscription_provider.mjs:sub_...identity, bounded server-owned secret, and transport/timeout contracts before network access;server/billing.mjspropagatesorgIdon both Checkout Session metadata andsubscription_data.metadataso later authoritative reads can verify exact tenant binding. SDK-style and direct form-encoded regressions enforce the same contract.Causal failure repair
Predecessor Server Tests run
32086012041,unit-and-apijob95558580836, failed because the stale child monolith returned404for protected/toast-state.css. The current repair starts from the exact parent tree and overlays only the nine subscription-reader paths, so it inherits the parent’s composed app entry and restores the shipped static accessibility asset without weakening the smoke test.The exact semantic package/coverage merge retains all current parent suites and adds:
server/stripe_subscription_provider.mjsto owned production instrumentation;stripe-subscription-provider.test.mjs; andstripe-subscription-metadata-propagation.test.mjsto both canonical unit and c8 coverage execution.
Current exact-head evidence
Fresh repository-native workflows for exact contributor head
e4f75a48c248b4c6cf8cc9f97d75803a58415b75are queued and therefore non-passing:32273546163;32273545097; and32273545835.No submitted review or review thread exists on the current head, and no qualifying independent current-head approval exists. Queued, pending, skipped-required, cancelled, absent, neutral, failed, stale, predecessor, synthetic, status-only, author-only, or model-only evidence is non-passing.
Scope and merge boundary
This slice does not persist authoritative subscription observations, implement monotonic/out-of-order reconciliation, mutate plan state, or grant/revoke entitlement. #526 owns the append-only normalized observation child and must be reconciled to this exact parent. This PR must not integrate independently of #521/#520/#516/#511/#507/#505.
After the prerequisite stack reaches protected
develop, reconcile this bounded semantic diff onto the resulting live head and rerun every then-applicable exact-head CI, browser E2E, statement/branch/function/line coverage, docstring, SAST, security, dependency, supply-chain, package/provenance, migration/recovery, resolved-thread, and qualifying independent-approval gate required by live policy.