Skip to content

feat(game-services-worker): add durable verified leaderboards - #60

Merged
imjlk merged 3 commits into
mainfrom
codex/d1-verified-leaderboard
Jul 13, 2026
Merged

imjlk merged 3 commits into
mainfrom
codex/d1-verified-leaderboard

Conversation

@imjlk

@imjlk imjlk commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a D1-backed verified leaderboard provider and migration
  • expose trusted write/read methods only through the Worker's private service binding
  • exercise the provider against the shared conformance suite using a real Miniflare D1 database
  • document durable storage setup and migration deployment

Validation

  • pnpm check
  • pnpm --dir apps/game-services-worker check
  • pnpm --dir apps/game-services-worker test
  • pnpm --dir apps/game-services-worker build
  • NODE_PATH=node_modules node tools/graph/run-graph-presets.mjs game-services-backend
  • git diff --check

Review

  • Open Code Review was run for every commit
  • actionable schema hardening findings were applied and re-reviewed
  • equivalent timestamp representations and participant labels intentionally remain outside attempt identity, matching the shared provider contract

Release

No Sampo changeset is needed: this changes a private Worker app, its deployment documentation, and root validation wiring without changing a publishable package contract.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@imjlk, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee9ac1e3-4587-4ebc-95bb-6a9de6be30bf

📥 Commits

Reviewing files that changed from the base of the PR and between 1e06a48 and 760590d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • README.md
  • apps/game-services-worker/migrations/0002_verified_leaderboards.sql
  • apps/game-services-worker/package.json
  • apps/game-services-worker/src/handler.ts
  • apps/game-services-worker/src/index.test.ts
  • apps/game-services-worker/src/index.ts
  • apps/game-services-worker/src/verifiedLeaderboardD1.test.ts
  • apps/game-services-worker/src/verifiedLeaderboardD1.ts
  • apps/game-services-worker/wrangler.toml
  • docs/CLOUDFLARE_WORKER_DEPLOY.md
  • docs/GAME_SERVICES_BACKEND.md
  • docs/ROADMAP_CHECKLIST.md
  • docs/VERIFIED_LEADERBOARD_SERVICE.md
  • package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/d1-verified-leaderboard

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.

@imjlk

imjlk commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Open Code Review completed for every commit.

  • 11fcec7: initial D1 implementation reviewed; valid schema and maintainability findings were patched
  • 5c878cf: follow-up review identified immutable timestamp text columns
  • 6578d24: final review only repeated a contract-incompatible suggestion; equivalent timestamp strings are intentionally idempotent and the original stored response is preserved by the conformance suite

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the detailed commit-by-commit review summary. I'll kick off a fresh review of the current state of the PR now.


✏️ Learnings added
Learnt from: imjlk
URL: https://github.com/imjlk/mpgd-kit/pull/60

Timestamp: 2026-07-13T14:16:38.836Z
Learning: In the mpgd-kit repository's `apps/game-services-worker` package, the D1-backed durable verified leaderboard provider intentionally stores equivalent timestamp representations as immutable text columns, and equivalent timestamp strings/participant labels are treated as idempotent and kept outside attempt identity. This is by design to match the shared leaderboard provider conformance contract, so flags suggesting normalization of these timestamp strings should be treated as contract-incompatible unless the shared provider contract changes.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 6578d24dbd

ℹ️ 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".

@imjlk
imjlk force-pushed the codex/d1-verified-leaderboard branch from 6578d24 to 760590d Compare July 13, 2026 14:37
@imjlk

imjlk commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto the latest main after documentation-only PR #59 merged. The feature diff is unchanged and the branch was updated with --force-with-lease. @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 760590dbfb

ℹ️ 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".

@imjlk
imjlk merged commit a048121 into main Jul 13, 2026
6 checks passed
@imjlk
imjlk deleted the codex/d1-verified-leaderboard branch July 15, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant