Repository navigation
Land billing-core Phase 2: combinators and checkout reservation - #2
Conversation
Phase 2 of billing-core: sticky and firstWins combinators run inside the update decider, and reservation ids are minted per decider run then read back from storage. TTL uses the injected Clock. Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Applying a granting event also redeems the offer, so the subscribed gate is asserted against a stored live row that is not yet redeemed. Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8800b29a4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Reject forbidden host field names, require reservation provenance before skipping the watermark, freeze empty-string firstWins writes, keep the encoder compile-checked complete, and redeem from granting history so a Phase 1 cancel cannot reopen the offer. Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 68b2e71. Configure here.
Terminal canceled/unpaid without a granting status no longer burns the one-per-customer reservation. Live or historically granting rows still redeem, including a Phase 1 active row that later cancels. Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>

Phase 2 of Billing Core: declared invariant combinators and the single-opportunity checkout reservation, in-tree and unpublished.
What landed
@pegma/billing-core(0.1.0, unpublished) now includes:sticky— a host-declared flag that only flips one way, enforced inside the update decider so a later price reversion cannot clear itfirstWins— a host-declared field or named group whose first write is permanent (consent capture under concurrent deliveries)@pegma/spineClocktrialing,active,past_due) redeem the one-per-customer offer and clear the reservation.offerRedeemedis sticky.createMemoryStore()and Azure Tables against real Azurite:firstWinsunder concurrent deliveries, then a later event that cannot change the groupExplicitly not in this PR
packages/billing-stripe(Phase 4)Plan status is Phase 2 in-tree, unpublished. Do not merge from this PR unless a reviewer asks. Do not publish or tag.