Repository navigation
feat(catalog): support generic resource grants - #88
Conversation
|
Warning Review limit reached
Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds resource-based product grants to the catalog and game-services validation paths, preserves them in purchase ledger transactions, and makes Verse8 reject unsupported resource grants explicitly. ChangesResource Grant Support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AndroidPurchase
participant GameServicesServer
participant ProductCatalog
participant LedgerStore
AndroidPurchase->>GameServicesServer: verify HINT_PACK_5 purchase
GameServicesServer->>ProductCatalog: resolve resource grant
ProductCatalog-->>GameServicesServer: return hint amount 5
GameServicesServer->>LedgerStore: write grant transaction
LedgerStore-->>GameServicesServer: persist transaction
sequenceDiagram
participant Verse8Purchase
participant Agent8
participant applyGrant
Verse8Purchase->>Agent8: purchase hint-pack-5
Agent8->>applyGrant: apply resource grant
applyGrant-->>Agent8: throw unsupported resource error
Agent8-->>Verse8Purchase: reject purchase
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd52b6d350
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
4b63f06 to
605f4c6
Compare
|
@codex review |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/catalog/src/index.test.ts`:
- Around line 9-13: Remove the assertEqual wrapper around assertProductGrant in
the generic resource grant test, invoking the assertion function directly so
successful validation does not compare its void return value with resourceGrant.
Preserve the existing test description and valid-case behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 665f181f-9a00-4657-8970-0bc0dfd1ca17
📒 Files selected for processing (14)
.sampo/changesets/catalog-resource-grants.mdadapters/verse8/src/agent8.test.tsadapters/verse8/src/agent8.tsadapters/verse8/src/index.test.tsadapters/verse8/src/index.tsbackend/entitlement-ledger/src/index.test.tsbackend/entitlement-ledger/src/index.tspackages/catalog/package.jsonpackages/catalog/src/index.test.tspackages/catalog/src/index.tspackages/game-services/package.jsonpackages/game-services/src/server.test.tspackages/game-services/src/types.test.tspackages/game-services/src/types.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- .sampo/changesets/catalog-resource-grants.md
- packages/game-services/src/types.ts
- packages/catalog/src/index.ts
- packages/game-services/src/server.test.ts
|
@coderabbitai review |
|
@codex review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdcf753391
ℹ️ 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".
|
@coderabbitai review |
|
@codex review |
✅ Action performedReview finished.
|
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
@mpgd/catalog@mpgd/game-servicesledgerWhy
Consumable game resources such as hints are neither currency nor durable entitlements. A dedicated grant type lets platform fulfillment award them through the existing catalog and ledger boundaries without leaking game-specific concepts into the kit.
Validation
pnpm graph:game-servicespnpm --filter @mpgd/catalog checkpnpm --filter @mpgd/catalog testpnpm --filter @mpgd/game-services checkpnpm --filter @mpgd/game-services testpnpm --filter @mpgd/adapter-verse8 checkpnpm --filter @mpgd/adapter-verse8 exec vitest run src/agent8.test.tspnpm validate:catalogSAMPO_RELEASE_BRANCH=main pnpm sampo:release:dry-runSummary by CodeRabbit
New Features
Bug Fixes
Tests