WP-03: Track and Threshold Seed Data #68

Closed
opened 2026-03-12 20:55:21 +00:00 by cal · 1 comment
Owner

Description

Create the three universal evolution tracks with their formulas and tier thresholds as seed data. This is a trivial data fixture — just 3 rows.

Repo: database
Phase: 1a (Schema & Data Foundation)
Dependencies: None (can be written before models exist; depends on WP-01 to insert)
Complexity: XS

Seed Data (LOCKED)

[
  {"name": "Batter", "card_type": "batter", "formula": "pa+tb*2", "t1": 37, "t2": 149, "t3": 448, "t4": 896},
  {"name": "Starting Pitcher", "card_type": "sp", "formula": "ip+k", "t1": 10, "t2": 40, "t3": 120, "t4": 240},
  {"name": "Relief Pitcher", "card_type": "rp", "formula": "ip+k", "t1": 3, "t2": 12, "t3": 35, "t4": 70}
]

Thresholds calibrated against Season 10 production data. Design target: T1 ~5 games, T2 ~20 games, T3 ~60 games, T4 ~120 games for a median player.

Files

  • Create: database/app/seed/evolution_tracks.py + evolution_tracks.json

Tests (write first in database/tests/test_evolution_seed.py)

  • Unit: 3 tracks in seed data
  • Unit: card_types are exactly {batter, sp, rp}
  • Unit: all thresholds positive and ascending (t1 < t2 < t3 < t4)
  • Unit: all tracks have non-empty formula
  • Unit: tier thresholds match locked values
  • Integration: idempotent seed (get_or_create pattern)

Plan reference: docs/prd-evolution/PHASE1_PROJECT_PLAN.md WP-03

## Description Create the three universal evolution tracks with their formulas and tier thresholds as seed data. This is a trivial data fixture — just 3 rows. **Repo:** `database` **Phase:** 1a (Schema & Data Foundation) **Dependencies:** None (can be written before models exist; depends on WP-01 to insert) **Complexity:** XS ## Seed Data (LOCKED) ```json [ {"name": "Batter", "card_type": "batter", "formula": "pa+tb*2", "t1": 37, "t2": 149, "t3": 448, "t4": 896}, {"name": "Starting Pitcher", "card_type": "sp", "formula": "ip+k", "t1": 10, "t2": 40, "t3": 120, "t4": 240}, {"name": "Relief Pitcher", "card_type": "rp", "formula": "ip+k", "t1": 3, "t2": 12, "t3": 35, "t4": 70} ] ``` Thresholds calibrated against Season 10 production data. Design target: T1 ~5 games, T2 ~20 games, T3 ~60 games, T4 ~120 games for a median player. ## Files - **Create:** `database/app/seed/evolution_tracks.py` + `evolution_tracks.json` ## Tests (write first in `database/tests/test_evolution_seed.py`) - [ ] Unit: 3 tracks in seed data - [ ] Unit: card_types are exactly {batter, sp, rp} - [ ] Unit: all thresholds positive and ascending (t1 < t2 < t3 < t4) - [ ] Unit: all tracks have non-empty formula - [ ] Unit: tier thresholds match locked values - [ ] Integration: idempotent seed (get_or_create pattern) **Plan reference:** `docs/prd-evolution/PHASE1_PROJECT_PLAN.md` WP-03
cal added this to the Card Evolution Phase 1 milestone 2026-03-12 20:59:08 +00:00
cal added the
evolution
phase-1a
labels 2026-03-12 20:59:22 +00:00
Claude added the
ai-working
label 2026-03-12 22:31:49 +00:00
Claude removed the
ai-working
label 2026-03-12 22:35:40 +00:00
Collaborator

PR #83 opened: #83

Created app/seed/evolution_tracks.json with the 3 locked rows and app/seed/evolution_tracks.py with a seed(model_class=None) function using get_or_create. The seed script lazy-imports EvolutionTrack from db_engine so it can be used once WP-01 lands; tests use a minimal in-memory stub model so all 6 tests pass independently of WP-01.

PR #83 opened: https://git.manticorum.com/cal/paper-dynasty-database/pulls/83 Created `app/seed/evolution_tracks.json` with the 3 locked rows and `app/seed/evolution_tracks.py` with a `seed(model_class=None)` function using `get_or_create`. The seed script lazy-imports `EvolutionTrack` from `db_engine` so it can be used once WP-01 lands; tests use a minimal in-memory stub model so all 6 tests pass independently of WP-01.
Claude added the
ai-pr-opened
label 2026-03-12 22:35:48 +00:00
cal closed this issue 2026-03-16 16:12:20 +00:00
Sign in to join this conversation.
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-database#68
No description provided.