Skip to content

fix(devvit): align leaderboard capability reporting - #69

Merged
imjlk merged 2 commits into
mainfrom
codex/devvit-leaderboard-capability
Jul 14, 2026
Merged

imjlk merged 2 commits into
mainfrom
codex/devvit-leaderboard-capability

Conversation

@imjlk

@imjlk imjlk commented Jul 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • stop advertising a native Devvit leaderboard in the adapter, target server, and generated starter
  • disable the generic client score-submission path while preserving the server-only verified leaderboard provider for authoritative completion handlers
  • align the shared Reddit target metadata, generated documentation, runtime smoke coverage, and release changeset

Validation

  • mise exec -- pnpm test
  • pnpm check
  • pnpm graph:preflight
  • pnpm validate:target-config
  • pnpm validate:effective-config
  • pnpm validate:targets
  • pnpm smoke:target-config
  • pnpm smoke:effective-config
  • pnpm smoke:adapter-effective-config
  • pnpm validate:starter-workflow
  • pnpm build:devvit

Release

Includes a patch changeset for @mpgd/adapter-devvit, @mpgd/target-config, @mpgd/cli, and @mpgd/create-game.

Review

OpenCodeReview workspace scan: 0 comments. Commit scan: 0 High/Medium comments; one documentation-comment nit was not adopted because the generated README and verified leaderboard guide already explain the boundary and supported integration path.

Summary by CodeRabbit

  • Bug Fixes

    • Disabled generic Devvit platform leaderboard advertising and client score submissions.
    • Prevented unverified client scores from being accepted through the standard leaderboard path.
    • Preserved verified, server-side leaderboard updates and authenticated game-specific snapshots.
  • Documentation

    • Clarified leaderboard setup and behavior in Devvit guides and generated game templates.
  • Tests

    • Updated runtime and smoke-test expectations to reflect disabled native leaderboard capabilities.

imjlk commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please focus on whether the Devvit target now consistently distinguishes unsupported native platform leaderboards from the server-only verified leaderboard provider, and whether generated starters, target metadata, tests, docs, and release metadata remain aligned.

imjlk commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review the Devvit leaderboard capability boundary, disabled generic client score path, generated starter parity, smoke coverage, and Sampo release impact.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr view 69 --repo imjlk/mpgd-kit --json title,body,files,additions,deletions,commits -q '.'
echo "----DIFF----"
gh pr diff 69 --repo imjlk/mpgd-kit > /tmp/pr69.diff
wc -l /tmp/pr69.diff
echo "----FILES----"
gh pr view 69 --repo imjlk/mpgd-kit --json files -q '.files[].path'

Length of output: 3832


🏁 Script executed:

#!/bin/bash
set -euo pipefail
cat /tmp/pr69.diff

Length of output: 28023


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,40p' apps/target-devvit/src/server/index.ts
echo "---"
rg -n "redis\.|optionalObjectPayload|createBridgeError|errorMessage" apps/target-devvit/src/server/index.ts
echo "---imports---"
rg -n "^import" apps/target-devvit/src/server/index.ts

Length of output: 3185


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "== leaderboard.open handling =="
rg -n "leaderboard" adapters/devvit/src/index.ts
echo "== targets.json leaderboard section context =="
sed -n '200,250p' packages/target-config/targets.json
echo "== adapter-effective-config full context around edit =="
sed -n '190,270p' tools/smoke/adapter-effective-config.ts
echo "== check other targets (ait, web) for nativeLeaderboard consistency =="
rg -n "nativeLeaderboard|leaderboard" packages/target-config/targets.json
echo "== check schema for leaderboard.native field / defaultLeaderboardId optionality =="
fd -a "schema" packages/target-config | head -20

Length of output: 5342


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "== wrapGateway impl - leaderboard section =="
rg -n "wrapGateway|leaderboard" tools/smoke/adapter-effective-config.ts | head -40
echo "---"
rg -n "function wrapGateway" -A 60 tools/smoke/adapter-effective-config.ts | sed -n '1,80p'

Length of output: 3429


This confirms withTargetAvailability gates the leaderboard delegation based on effective config, which is consistent with the reddit leaderboard.enabled: false setting from targets.json. The implementation is consistent across the adapter, target-config, smoke tests, docs, and the generated starter template. Everything I checked lines up correctly:

  • adapters/devvit/src/index.ts and both apps/target-devvit/src/server/index.ts / generated CLI template report nativeLeaderboard: false and return { submitted: false } for leaderboard.submitScore, while the dead Redis-locking leaderboard logic was fully removed (no orphaned redis/optionalObjectPayload/createBridgeError usages — I confirmed those are still used by the storage handlers, so no unused-import risk).
  • packages/target-config/targets.json flips reddit.features.leaderboard and reddit.leaderboard.native to false, and tools/smoke/effective-target-config.ts correctly expects leaderboard.enabled: false, leaderboard.native: false, and defaultLeaderboardId: undefined.
  • tools/smoke/adapter-effective-config.ts and tools/smoke/target-config-runtime.ts both assert the gateway no longer delegates leaderboard.submitScore to the underlying bridge (bridge.methods.slice(1) / targetGateway.calls are now []), matching withTargetAvailability's gating on effectiveConfig.leaderboard.enabled.
  • docs/VERIFIED_LEADERBOARD_SERVICE.md, apps/target-devvit/README.md, and the generated starter README all now explicitly call out that the server-only verified leaderboard provider is distinct from the (now-disabled) native PlatformGateway leaderboard capability, which is the correct boundary framing.
  • The changeset at .sampo/changesets/devvit-leaderboard-capability.md covers all four affected packages (@mpgd/adapter-devvit, @mpgd/target-config, @mpgd/cli, @mpgd/create-game) as patches, matching the PR's release note.

One minor observation (not a blocker): gateway.leaderboard.open still exists and throws DEVVIT_LEADERBOARD_OPEN_UNAVAILABLE — that's unrelated to this capability flag and remains correctly gated separately, so no action needed there.

Overall this looks solid and internally consistent — nice work aligning the capability boundary end-to-end across the adapter, server, generated starter, docs, smoke tests, and release metadata.

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

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 36 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: 0a3383fb-f414-421f-ad25-f999b33eb0c4

📥 Commits

Reviewing files that changed from the base of the PR and between 0ee0108 and 155a3ea.

📒 Files selected for processing (1)
  • packages/target-config/targets.json
📝 Walkthrough

Walkthrough

Devvit and Reddit targets no longer advertise native leaderboards or accept generic client score submissions. Server bridges retain storage functionality while verified server-side completion and snapshot flows are documented and validated.

Changes

Devvit leaderboard disablement

Layer / File(s) Summary
Disable target and adapter capability
packages/target-config/targets.json, adapters/devvit/src/*
Reddit and Devvit sandbox capabilities now report leaderboard support as disabled, and sandbox score submissions return submitted: false.
Remove server leaderboard submission
apps/target-devvit/src/server/index.ts
Generic score submission is stubbed, and Redis-backed leaderboard validation, locking, retries, and writes are removed.
Update generated Devvit bridge
packages/cli/templates/phaser-game/apps/target-devvit/src/server/index.ts
Generated starters mirror the disabled capability and submission behavior.
Align documentation and validation
docs/*, apps/target-devvit/README.md, packages/cli/templates/phaser-game/apps/target-devvit/README.md, tools/smoke/*, .sampo/changesets/*
Documentation and smoke tests describe verified server-side leaderboard flows and validate disabled generic submissions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • imjlk/mpgd-kit#2: Introduced the Devvit leaderboard capability and submission behavior updated here.
  • imjlk/mpgd-kit#4: Added target wiring and smoke coverage directly changed by this PR.
  • imjlk/mpgd-kit#9: Added generated Devvit bridge leaderboard behavior superseded by these changes.

Poem

A bunny saw the scores go still,
No raw client hops across the hill.
Verified servers guard the race,
Snapshots show the proper place.
“Native boards sleep”—then I twitch my nose!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating Devvit leaderboard capability reporting.
Description check ✅ Passed The description matches the template’s core sections with Summary and Validation, though the Notes section is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/devvit-leaderboard-capability

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ee0108084

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

Comment thread packages/target-config/targets.json Resolved

imjlk commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please re-review the updated head 155a3ea. The prior P2 was addressed by bumping the target-config matrix version to 2026-07-14; verify that the new published metadata, effective config, release-manifest evidence, changeset, and Devvit capability boundary are now consistent.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 155a3ea21f

ℹ️ 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 e4a89d7 into main Jul 14, 2026
6 checks passed
@imjlk
imjlk deleted the codex/devvit-leaderboard-capability branch July 14, 2026 06:14
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