Add permission-gated prediction history profiles#267
Closed
mwickett wants to merge 1 commit into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new server-only query that builds per-player “prediction history profiles” for a given game, with access to historical score data gated by authenticated Clerk organization membership to protect cross-circle privacy.
Changes:
- Introduces
getPredictionProfilesForGame()andbuildPredictionProfiles()to fetch and summarize prior finished-game score samples (same org/circle, excludes current game, capped per player). - Computes aggregate profile inputs (mean/std delta, blitz rate, mean cards played, mean blitz pile remaining, and a capped list of recent deltas).
- Adds Jest coverage for authorization gating, circle scoping, user-vs-guest handling, caps, and profile math.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/server/queries/predictionProfiles.ts | Adds the new server-only profile query and aggregation logic over historical score samples. |
| src/server/queries/index.ts | Re-exports the new prediction profile query/types from the queries barrel. |
| src/server/tests/predictionProfiles.test.ts | Adds unit tests validating gating, scoping, caps, and computed profile statistics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+14
| export { | ||
| buildPredictionProfiles, | ||
| getPredictionProfilesForGame, | ||
| type PredictionProfile, | ||
| type PredictionProfilesByPlayer, | ||
| } from "./predictionProfiles"; |
This was referenced Jun 27, 2026
Owner
Author
|
Closed as superseded by merged integration PR #270. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Claude review
Verification
npm run lintnpm testRESEND_API_KEY=re_dummy npx next buildNotes
This is intentionally groundwork only. The forecast still needs a follow-up PR to blend these profiles into the Monte Carlo model and UI.
Integration/testing PR: #270 contains the full stack for end-to-end testing.