Repository navigation
feat: add AIT retention capability primitives - #116
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe change adds promotion reward contracts and AIT host reconciliation, notification agreement support, an Apps in Toss mTLS partner API client, bridge fallbacks, tests, documentation, release changesets, and a Go toolchain update. ChangesPromotion and notification platform flows
Apps in Toss partner API
Toolchain configuration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant PlatformGateway
participant AitHostBridge
participant AuthorizationHook
participant NativeRewardProvider
participant Storage
PlatformGateway->>AitHostBridge: grantReward(campaignId, idempotencyKey)
AitHostBridge->>Storage: reconcile persisted claim
AitHostBridge->>AuthorizationHook: authorize claim
AitHostBridge->>Storage: save pending marker
AitHostBridge->>NativeRewardProvider: grant promotion
NativeRewardProvider-->>AitHostBridge: receipt
AitHostBridge->>Storage: save receipt
AitHostBridge-->>PlatformGateway: reward result
sequenceDiagram
participant GameService
participant PartnerApiClient
participant MtlsFetcher
participant AppsInTossApi
GameService->>PartnerApiClient: verify key or send functional message
PartnerApiClient->>MtlsFetcher: POST JSON over mTLS
MtlsFetcher->>AppsInTossApi: API request
AppsInTossApi-->>MtlsFetcher: response envelope
MtlsFetcher-->>PartnerApiClient: response
PartnerApiClient-->>GameService: verification or delivery result
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: c894c7aa92
ℹ️ 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".
|
Updated the branch with the requested authorization and reconciliation fixes. @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: 0f656b21d4
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00c0a00cfd
ℹ️ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd57f9c8b3
ℹ️ 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
packages/game-services/src/apps-in-toss-partner-api.test.ts (1)
1-236: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider adding boundary/timeout coverage.
Good coverage of the happy/error paths, but
normalizeTimeoutbounds,normalizeContext's 128-entry cap,normalizeBaseUrl's query/hash rejection, and the timeout/abort path inpostJson/createTimeoutSignalaren't exercised. Worth adding cases, especially once the timeout-error-typing issue onapps-in-toss-partner-api.tsis addressed.🤖 Prompt for 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. In `@packages/game-services/src/apps-in-toss-partner-api.test.ts` around lines 1 - 236, Extend the test coverage around createAppsInTossPartnerApiClient and its request helpers to exercise normalizeTimeout boundary values, normalizeContext rejecting more than 128 entries, normalizeBaseUrl rejecting query strings and fragments, and postJson/createTimeoutSignal aborting on timeout with the expected typed error. Reuse the existing assertThrows, assertRejects, and fake mtls fetch setup, preserving current happy-path assertions.
🤖 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 @.mise.toml:
- Line 2: Update the Go version pin in the mise configuration from 1.26.4 to
1.26.5, preserving the existing configuration format.
In `@docs/APPS_IN_TOSS_PRODUCTION_EVIDENCE.md`:
- Around line 211-217: Update the documentation around sendFunctionalMessage()
and NotificationDeliveryProvider to state that Toss-user keys are trusted only
when obtained through an authenticated Toss login and user-key mapping. Clarify
that verifyAnonymousKey() does not validate Toss-user keys and that
sendFunctionalMessage() must not be treated as validation for arbitrary
toss-user keys.
- Around line 134-139: Update the fetch handler around verifyAnonymousKey to
require authenticated, authorized callers before accepting requests, and apply
rate limiting before invoking the mTLS-backed provider. Document the route as
internal-only and ensure unauthorized or throttled requests do not reach
createAppsInTossPartnerApiClient verification.
In `@packages/game-services/src/apps-in-toss-partner-api.ts`:
- Around line 135-167: Update postJson to catch failures from input.mtls.fetch
and normalize them into AppsInTossPartnerApiError, while preserving existing
AppsInTossPartnerApiError instances and their details. Ensure timeout errors
from createTimeoutSignal and other transport failures are consistently wrapped
before the existing timeout.cleanup() finally block runs.
---
Nitpick comments:
In `@packages/game-services/src/apps-in-toss-partner-api.test.ts`:
- Around line 1-236: Extend the test coverage around
createAppsInTossPartnerApiClient and its request helpers to exercise
normalizeTimeout boundary values, normalizeContext rejecting more than 128
entries, normalizeBaseUrl rejecting query strings and fragments, and
postJson/createTimeoutSignal aborting on timeout with the expected typed error.
Reuse the existing assertThrows, assertRejects, and fake mtls fetch setup,
preserving current happy-path assertions.
🪄 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: e664438d-46f7-4522-b1a8-fa40a4753e61
📒 Files selected for processing (17)
.mise.toml.sampo/changesets/ardent-runesinger-joukahainen.md.sampo/changesets/focused-mtls-messenger.mdadapters/ait/src/host.test.tsadapters/ait/src/host.tsadapters/ait/src/index.test.tsadapters/ait/src/index.tsdocs/APPS_IN_TOSS_PRODUCTION_EVIDENCE.mddocs/PLATFORM_GAME_FLOW.mdpackages/bridge/src/cloudflare-pages.test.tspackages/bridge/src/cloudflare-pages.tspackages/bridge/src/index.tspackages/game-services/package.jsonpackages/game-services/src/apps-in-toss-partner-api.test.tspackages/game-services/src/apps-in-toss-partner-api.tspackages/game-services/src/index.tspackages/platform/src/index.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8a1ddc719
ℹ️ 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. Can't wait for the next one! 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
Safety
Verification
pnpm checkpnpm build:packagespnpm --filter @mpgd/game-services testpnpm --filter @mpgd/adapter-ait testpnpm graph:game-servicesSummary by CodeRabbit