bug: T4 rarity upgrade collision with live-series card updates #57
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-card-creation#57
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
post_player_updates()inbatters/creation.py(line ~456) unconditionally overwritesrarity_idwhen the OPS-derived rarity differs from the current rarity. There is no check for refractor T4 rarity upgrades.If a card reaches T4 and gets a rarity bump (e.g., Bronze → Silver), the next live-series pipeline run will overwrite it back to Bronze based on raw OPS. The player's earned progression silently disappears.
The Phase 2 Validation Spec (T4-3) documents this risk with three proposed resolution strategies, but none has been selected or implemented.
Impact
High — this is a trust violation. Players earn a reward through gameplay that is then silently reverted by an automated pipeline. Must be guarded before refractor ships to prod.
Scope
Touches both repos:
post_player_updates()needs a guard to skip rarity overwrites for cards with active T4 refractor state/api/v2/refractor/cards/{id}endpoint)Proposed Solutions (from Phase 2 Validation Spec T4-3)
Design decision needed on which approach.
References
card-creation/batters/creation.py—post_player_updates()card-creation/docs/REFRACTOR_PHASE2_VALIDATION_SPEC.md— T4-3database/app/services/refractor_boost.py— boost logic (writescurrent_tier,variant,fully_evolvedbut not rarity)PR #63 implements the T4 rarity guard using Strategy 1 from the validation spec.
Approach: Before each
post_player_updates()call, the pipeline identifies players whose OPS-derived rarity would be a downgrade, batch-queries a newGET /api/v2/refractor/fully-evolvedendpoint, and skips the rarity write for any T4-evolved players. All other rarity changes (upgrades and same-rarity) proceed normally.Safe fallback:
get_fully_evolved_players()returns an empty set on any API error, so the guard is a no-op until the database endpoint is added. No pipeline disruption.Database work still needed:
GET /api/v2/refractor/fully-evolved?player_ids=1,2,3→{"player_ids": [...]}must be added topaper-dynasty-database. The guard activates automatically once it's wired up.Bonus:
RARITY_LADDERadded torarity_thresholds.pyalso covers the prerequisite for #59.