db_calls.py default timeouts raised from 3s to 30s across all methods
(db_get, url_get, db_patch, db_post, db_put). scouting_batters.py
fetch_data now passes timeout=120 for large card rating queries.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add rarity name cross-reference table in Background section mapping PRD
display names (Replacement/Reserve/Starter/All-Star/MVP/Hall of Fame) to
codebase names (Common/Bronze/Silver/Gold/Diamond/HoF) with IDs
- Fix T4-2: correct Gold OPS threshold from 0.700 to 0.900 (confirmed in
rarity_thresholds.py); add note that 0.700 is the Bronze floor
- Fix T4-1: restate truncation invariant as a single precise assertion —
sum(columns) == 108 - truncated_amount — instead of two independent checks
that can both pass while the sum is wrong for unrelated reasons
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Seven pre-implementation test cases covering: 108-sum invariant
preservation under profile-based boosts, D20 probability shift
magnitude at T4, pipeline collision risk between T4 rarity upgrade
and live-series post_player_updates, HoF rarity cap (non-contiguous
ID ladder), RP T1 achievability, SP/RP/batter T4 parity, and the
cross-season stat accumulation design decision that must be confirmed
before Phase 2 code is written.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
url_get returns await resp.json() which is a dict, not aiohttp.ClientResponse.
The wrong annotation was introduced in the original PR and would mislead
static analysis tools into expecting a response object from callers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Closes#12
- tweak_archetype(): prompts user for updated archetype stats (avg/obp/slg/bb%/k% vs L and R, power and batted-ball profile, baserunning for batters), then recalculates D20 card ratings via the existing calculator
- manual_adjustments(): prompts user to choose a split (vs L or vs R), displays all 22 D20 chance fields with running total, accepts field-number + value edits, and warns if total deviates from 108
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes#11
`starter_rating`, `relief_rating`, and `closer_rating` were hardcoded
stubs (5/5/None) in `create_pitching_card`. The chosen `PitcherArchetype`
already carries these values; now they are propagated through `card_data`
when the pitcher workflow builds its initial dict and consumed correctly
when writing the pitching card record to the database.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes#9
Previously SEASON_PCT was hardcoded to 81/162 (~0.5) while END_DATE was
set to 20050731 (~65% through the season). Running retrosheet_data.py
directly (without the CLI which overrides SEASON_PCT at runtime) would
silently generate cards using half-season normalizations on stats covering
a larger portion of the season.
Fix: move START_DATE/END_DATE before SEASON_PCT and derive SEASON_PCT
from the date range using SEASON_END_DATE (2005 regular season end).
Now changing END_DATE automatically produces the correct SEASON_PCT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes#14
Five globals (MIN_PA_VL, MIN_PA_VR, MIN_TBF_VL, MIN_TBF_VR, CARDSET_ID)
were derived from PLAYER_DESCRIPTION at module load time, creating a
hidden ordering dependency: any value baked in before the CLI overrides
PLAYER_DESCRIPTION would be silently wrong if a caller relied on the
derived relationship. The CLI explicitly sets all of them anyway, so
replacing with scalar defaults makes the module self-contained and safe.
Also collapses LAST_WEEK_RATIO dead ternary (both branches were 0.0).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes#13
Replace `from db_calls_card_creation import *` with an explicit
`from db_calls_card_creation import PitcherData`. Only PitcherData
is referenced in creation_helpers.py; the wildcard was also
pulling in all Peewee ORM internals via a transitive
`from peewee import *`, polluting the namespace.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces logger.error() with logger.exception() so the full stack trace
is captured when a pitcher card fails to generate, making it possible to
diagnose the root cause rather than just seeing the error message.
Closes#17
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>