feat(billing): derive monotonic Stripe entitlement policy - #528
feat(billing): derive monotonic Stripe entitlement policy#528seonghobae wants to merge 15 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
2 similar comments
|
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/data-integrity objective
Refs #488. This Draft stacked slice derives deterministic entitlement candidates from already-authoritative Stripe Subscription and Invoice evidence. Provider lifecycle status alone is never sufficient paid-access authority: an
activeSubscription can grant or extend paid access only when its exactlatest_invoiceis independently observed aspaidfor the same Subscription and its current period remains future.Exact current stack
develop:df0fa17bd5035af6455c889022c540b4f439e3d6;feat/stripe-subscription-current-projection-488@a8a66035ceaa1abbee2f20873adbc0353c8217d7;9da3f3663a80cf20aa9562132eb3d1b7f5fcb1d0;The current head is a non-destructive two-parent reconciliation of predecessor child
71d184adc236b1199b8629e901b543eebc44182fwith exact current #527. The effective delta is limited toCHANGELOG.md, policy doctoring,package.json,server/stripe_entitlement_policy.mjs, the coverage contract, and three focused policy suites including the duplicate-claim regression.CHANGELOG.mdadds exactly six entitlement-policy lines with zero parent deletions.The semantic package/coverage merge preserves the parent’s composed app/toast route, OpenCode/changelog tests, contextual-orchestrator attribution/routing regressions, Checkout attempt/reconciliation/provider tests, webhook trust/event-ledger coverage, provider-read/observation/projection coverage, and accessibility suites while adding only entitlement-policy production/test registrations.
Any parent or contributor-head movement invalidates this ancestry statement until freshly reconciled.
Policy contract
trialing: grants only through a future authoritativetrialEndSec; exact/past expiry fails closed;active: grants or extends only with exact matching authoritative paid-Invoice evidence and a futurecurrentPeriodEndSec; missing, mismatched, open, void, uncollectible, or otherwise non-paid evidence never creates or lengthens access;past_due: never provisions or extends; an already-paid unexpired prior claim may remain only through its existing validity window;unpaid,paused,canceled,incomplete, andincomplete_expired: deny or revoke the affected Subscription claim;Outputs are immutable candidates. This slice performs no database mutation, writes no
orgs.plan, grants no session capability, and is not itself a production authorization path.Causal failure repair
Predecessor Server Tests run
32086408812,unit-and-apijob95559754722, passed the complete unit suite—including all entitlement-policy suites—but failed API smoke because stale application composition returned404for protected/toast-state.css. The predecessorcloud-e2ejob was green. Current head starts from exact current #527’s composed application tree and overlays only the eight entitlement-policy paths, preserving the shipped static accessibility asset instead of weakening the smoke contract.tests/unit/coverage-script-contract.test.mjsnow proves the inheritedserver/application_routes.mjs, orchestrator attribution, provider reader, observation ledger, current projection, and new entitlement policy all remain instrumented; it also locks all three entitlement suites into normal unit CI and canonical c8 execution.Current exact-head evidence
Fresh repository-native workflows for exact contributor head
9da3f3663a80cf20aa9562132eb3d1b7f5fcb1d0are queued and therefore non-passing:32275677574;32275677501; and32275678237.The current review inventory contains no submitted review and no review thread, so there is no qualifying independent current-head approval. Queued, pending, skipped-required, cancelled, absent, neutral-required, failed, stale, predecessor, synthetic, status-only, author-only, or model-only evidence is non-passing.
Remaining boundary and merge gate
This does not complete #488. Authoritative Invoice/payment retrieval and normalized persistence, transactional claim/audit storage, reversible grant/revoke application, operator recovery, out-of-order reconciliation, authorization/API integration, migration/restart/concurrency acceptance, and release evidence remain prerequisite work.
Remain Draft. Do not integrate independently of #527 and its prerequisite stack. After the stack reaches protected
develop, reconcile this bounded semantic delta to the resulting live head and regenerate every then-applicable exact-head deterministic/browser/statement/branch/function/line coverage/docstring/SAST/security/dependency/supply-chain/package/provenance/migration/recovery/review gate under live policy.