bug: scouting reports must filter variant=0 to exclude boosted stats #58

Closed
opened 2026-04-08 00:23:34 +00:00 by cal · 1 comment
Owner

Problem

Scouting reports in scouting_batters.py and pd_cards/core/scouting.py query batting card ratings. If variant rows (with refractor-boosted stats) are present in the same tables, scouting could report evolved stats as baseline player ratings.

Scouting reports should reflect a card's base power level, not a specific team's evolved version.

Fix

Ensure all scouting queries filter to variant=0 (or equivalent) to exclude refractor variant rows from baseline stat calculations.

Impact

Data integrity issue. Without filtering, scouting reports become misleading once refractor variants exist in prod — players would see inflated stats that don't match the card they'd actually receive.

## Problem Scouting reports in `scouting_batters.py` and `pd_cards/core/scouting.py` query batting card ratings. If variant rows (with refractor-boosted stats) are present in the same tables, scouting could report evolved stats as baseline player ratings. Scouting reports should reflect a card's base power level, not a specific team's evolved version. ## Fix Ensure all scouting queries filter to `variant=0` (or equivalent) to exclude refractor variant rows from baseline stat calculations. ## Impact Data integrity issue. Without filtering, scouting reports become misleading once refractor variants exist in prod — players would see inflated stats that don't match the card they'd actually receive.
Claude added the
ai-working
label 2026-04-08 10:31:12 +00:00
Claude removed the
ai-working
label 2026-04-08 10:34:21 +00:00
Collaborator

Fixed in PR #62.

Added variant=0 client-side filter on the API response in all four scouting data-fetch paths (scouting_batters.py, scouting_pitchers.py, and both functions in pd_cards/core/scouting.py). The filter uses .get("variant", 0) == 0 so it's safe even if the variant field is absent from older API responses.

Fixed in PR #62. Added `variant=0` client-side filter on the API response in all four scouting data-fetch paths (`scouting_batters.py`, `scouting_pitchers.py`, and both functions in `pd_cards/core/scouting.py`). The filter uses `.get("variant", 0) == 0` so it's safe even if the `variant` field is absent from older API responses.
Claude added the
ai-pr-opened
label 2026-04-08 10:34:26 +00:00
cal closed this issue 2026-04-08 12:25:49 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-card-creation#58
No description provided.