Skip to content

feat(billing): apply claim-backed effective plan limits - #565

Draft
seonghobae wants to merge 12 commits into
feat/stripe-entitlement-claim-ledger-488from
feat/stripe-entitlement-effective-plan-488
Draft

feat(billing): apply claim-backed effective plan limits#565
seonghobae wants to merge 12 commits into
feat/stripe-entitlement-claim-ledger-488from
feat/stripe-entitlement-effective-plan-488

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Buyer/access outcome

Refs #488. This Draft child of #564 applies durable Stripe entitlement claims to ScopeWeave's existing project/member plan-limit authorization without mutating orgs.plan. A Free organization becomes effectively Pro only while at least one tenant-owned current claim head is entitled and unexpired; expiry or a revoke/deny head re-locks limits automatically.

Exact current stack

  • exact parent/base feat(billing): persist transactional Stripe entitlement claims #564: feat/stripe-entitlement-claim-ledger-488@c176efda6abbd3796fab776484422bb8efc612a8;
  • exact contributor head: c9d21ade938bb7eaba89a37a271bb5eed464c17a;
  • exact parent→child comparison: ahead-only, zero behind, exact parent as merge base, seven changed paths;
  • state: Draft and mechanically mergeable.

The current head is a non-destructive two-parent reconciliation of predecessor child 30d28a54543e05e9c54ca6db96fdfacef32a6885 with exact current #564. It starts from the repaired claim-ledger parent tree and overlays only this slice's seven effective-plan paths, so #564's new claim-head composite tenant-integrity constraint and regression remain inherited without rewriting this child.

Any parent/head movement invalidates this ancestry statement until freshly reconciled.

Authorization contract

  • Free limits remain enforced without a current claim;
  • one unexpired current tenant-owned entitled claim unlocks Pro project/member limits;
  • exact expiry and a later false/revoked current head re-lock limits without changing orgs.plan;
  • foreign-tenant claims never unlock this organization;
  • one valid local claim among multiple Subscriptions is sufficient;
  • explicit stored Pro remains a non-Stripe/manual override independent of claim-table health;
  • absent/unreadable claim storage fails closed to the stored plan rather than manufacturing paid authority; and
  • existing synchronous planOf consumers use the bootstrapped server-owned claim database while caller-selected claim identities remain impossible.

The production database enables SQLite foreign-key enforcement and the parent schema now binds every head to a decision for the same Subscription via a composite foreign key. This child does not weaken or duplicate that authority boundary.

Current exact-head evidence

Fresh repository-native workflows for exact head c9d21ade938bb7eaba89a37a271bb5eed464c17a are non-passing while in flight:

  • Server Tests 32345781144 — pending;
  • Dependency Review 32345781142 — queued; and
  • OSV Scanner 32345781572 — queued.

There are no submitted reviews or review threads on this exact head. No predecessor-head, queued/pending, absent, synthetic, status-only, author-only, or model-only evidence is treated as approval.

Scope boundary

This slice applies claim authority only to existing commercial resource-limit gates. It does not change authentication, membership/RBAC, persist a plan rewrite, issue capabilities, or itself define buyer-visible billing status. #568 owns that public-status child and has been reconciled to this exact parent.

Remain Draft. Do not integrate independently of #564 and its prerequisite stack. Hosted exact-head deterministic/browser/coverage/security/dependency/supply-chain/review evidence must be terminal and current before integration.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1aff7151-5533-495f-9ebf-9763b7e49db4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Caution

Review failed

An 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant