Commit Graph

270 Commits

Author SHA1 Message Date
cal
87599a67d5 Merge pull request 'docs: refractor card art mockup and visual spec' (#53) from wip/refractor-card-art into main 2026-04-04 03:13:34 +00:00
cal
e266f814ca Merge branch 'main' into wip/refractor-card-art 2026-04-04 03:13:29 +00:00
Cal Corum
f329d74ed8 docs: refractor tier mockup — diamond indicator, effects, and visual spec
Interactive mockup for refractor card art with:
- 4-quadrant diamond tier indicator (baseball base-path fill order)
- Metallic sheen + pulse glow effect (approved combo)
- Tier colors: T1 orange, T2 red, T3 purple, T4 blue-flame
- T3 gold shimmer sweep, T4 prismatic rainbow + dual glow + bar shimmer
- Cherry-pick reference: docs/refractor-visual-spec.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 19:33:31 -05:00
cal
c1f06eb9c7 Merge pull request 'fix: scrub exposed credentials from docs' (#52) from fix/scrub-exposed-credentials into main 2026-04-01 18:02:01 +00:00
cal
d6b65594b8 Merge branch 'main' into fix/scrub-exposed-credentials 2026-04-01 18:01:56 +00:00
Cal Corum
94fd72344d fix: scrub exposed API token from docs
Replace real API token in PD_CARDS_CLI_REFERENCE.md example command
with placeholder value to prevent credential exposure in the repo.

Closes #50
2026-04-01 11:58:58 -05:00
Cal Corum
43aff3568f fix: increase API timeouts to prevent bulk query failures
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>
2026-03-30 07:53:58 -05:00
cal
eaf4bdbd6c docs: refractor Phase 2 design validation spec (#51) 2026-03-24 21:09:06 +00:00
Cal Corum
6f67cfec9a docs: address PR #51 review — rarity naming, OPS threshold, truncation invariant
- 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>
2026-03-24 16:07:18 -05:00
Cal Corum
f2c09d09e6 docs: add Refractor Phase 2 design validation spec
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>
2026-03-24 09:07:09 -05:00
cal
8c00bacf59 Merge pull request 'feat: add return type annotations to async DB functions (#20)' (#47) from ai/paper-dynasty-card-creation-20 into main 2026-03-23 19:52:02 +00:00
cal
de9604364c Merge branch 'main' into ai/paper-dynasty-card-creation-20 2026-03-23 19:51:48 +00:00
cal
aa8306e844 Merge pull request 'fix: apply timeout parameter to all aiohttp sessions in db_calls.py (#4)' (#41) from ai/paper-dynasty-card-creation#4 into main 2026-03-23 13:25:37 +00:00
cal
d7c6e6da27 Merge branch 'main' into ai/paper-dynasty-card-creation#4 2026-03-23 13:25:19 +00:00
cal
4392f6c07f Merge pull request 'fix: add @pytest.mark.asyncio to async test methods (#21)' (#30) from ai/paper-dynasty-card-creation#21 into main 2026-03-23 13:25:11 +00:00
cal
3612b0710b Merge branch 'main' into ai/paper-dynasty-card-creation#4 2026-03-23 13:24:43 +00:00
cal
424b7da78d Merge branch 'main' into ai/paper-dynasty-card-creation#21 2026-03-23 13:24:40 +00:00
Cal Corum
82a8dac950 fix: correct url_get return type annotation to dict
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>
2026-03-23 08:14:24 -05:00
cal
461a469374 Merge pull request 'feat: implement tweak_archetype() and manual_adjustments() (#12)' (#49) from ai/paper-dynasty-card-creation-12 into main 2026-03-23 12:42:00 +00:00
Cal Corum
962b9cf6f1 feat: implement tweak_archetype() and manual_adjustments() (#12)
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>
2026-03-23 07:41:46 -05:00
cal
f2f70bfce5 Merge pull request 'fix: use archetype role ratings in pitcher card creation (#11)' (#46) from ai/paper-dynasty-card-creation#11 into main 2026-03-23 12:41:20 +00:00
Cal Corum
50ee2d0446 fix: use archetype role ratings in pitcher card creation (#11)
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>
2026-03-23 07:41:07 -05:00
cal
7286fd2203 Merge pull request 'fix: derive SEASON_PCT from date range instead of hardcoding half-season (#9)' (#36) from ai/paper-dynasty-card-creation#9 into main 2026-03-23 12:40:47 +00:00
Cal Corum
63a30bd434 fix: derive SEASON_PCT from date range instead of hardcoding half-season (#9)
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>
2026-03-23 07:40:35 -05:00
cal
770f296938 Merge pull request 'fix: remove import-time derived globals in retrosheet_data.py (#14)' (#48) from ai/paper-dynasty-card-creation#14 into main 2026-03-23 12:37:59 +00:00
Cal Corum
d43927258a fix: remove import-time derived globals in retrosheet_data.py (#14)
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>
2026-03-23 07:37:46 -05:00
cal
fd142c27d2 Merge pull request 'fix: replace wildcard import from db_calls_card_creation (#13)' (#34) from ai/paper-dynasty-card-creation-13 into main 2026-03-23 12:37:29 +00:00
Cal Corum
df6e96bc76 fix: replace wildcard import from db_calls_card_creation (#13)
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>
2026-03-23 07:37:16 -05:00
cal
dd42f35674 Merge pull request 'fix: use logger.exception() in calculate_pitcher_ratings error handler' (#33) from ai/paper-dynasty-card-creation#17 into main 2026-03-23 12:35:47 +00:00
Cal Corum
9e48616274 fix: use logger.exception() in calculate_pitcher_ratings error handler
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>
2026-03-23 07:35:31 -05:00
cal
deaa43432b Merge pull request 'fix: correct Dict[str, any] to Dict[str, Any] in type annotations (#15)' (#31) from ai/paper-dynasty-card-creation-15 into main 2026-03-23 12:12:28 +00:00
cal
3fd07b6d89 Merge branch 'main' into ai/paper-dynasty-card-creation-15 2026-03-23 12:12:18 +00:00
cal
55f2eda888 Merge pull request 'chore: pin peewee and polars to exact versions (#24)' (#32) from ai/paper-dynasty-card-creation-24 into main 2026-03-23 12:12:07 +00:00
cal
a432d37850 Merge branch 'main' into ai/paper-dynasty-card-creation-24 2026-03-23 12:11:56 +00:00
dde163e2fb Merge pull request 'fix: narrow swallowed exception in get_pitching_peripherals() (#10)' (#35) from ai/paper-dynasty-card-creation#10 into main 2026-03-23 03:53:18 +00:00
f485241dd7 Merge branch 'main' into ai/paper-dynasty-card-creation#10 2026-03-23 03:53:10 +00:00
6d0497431f Merge pull request 'fix: remove dead LAST_WEEK_RATIO ternary — both branches are 0.0 (#19)' (#45) from ai/paper-dynasty-card-creation-19 into main 2026-03-23 03:52:58 +00:00
f5cb72cc26 Merge branch 'main' into ai/paper-dynasty-card-creation-19 2026-03-23 03:52:52 +00:00
f67d111a66 Merge pull request 'fix: remove test_positions_df non-test that always passes (#16)' (#43) from ai/paper-dynasty-card-creation-16 into main 2026-03-23 03:52:48 +00:00
230f3e79ce Merge branch 'main' into ai/paper-dynasty-card-creation-16 2026-03-23 03:52:41 +00:00
ecc62a0521 Merge pull request 'fix: correct get_of() opposite-field direction for switch hitters' (#40) from ai/paper-dynasty-card-creation#5 into main 2026-03-23 03:52:38 +00:00
992feba79e Merge branch 'main' into ai/paper-dynasty-card-creation#5 2026-03-23 03:52:32 +00:00
57c379a8e0 Merge branch 'main' into ai/paper-dynasty-card-creation#10 2026-03-23 03:52:23 +00:00
e413fd5cc8 Merge pull request 'fix: return default 8 on XBT% parse error in running() (#8)' (#37) from ai/paper-dynasty-card-creation#8 into main 2026-03-23 03:52:19 +00:00
6a6767f5d8 Merge branch 'main' into ai/paper-dynasty-card-creation#8 2026-03-23 03:52:13 +00:00
2b955dd8f7 Merge pull request 'fix: resolve unreachable duplicate elif 'DO*' branch in result_string() (#6)' (#39) from ai/paper-dynasty-card-creation#6 into main 2026-03-23 03:51:33 +00:00
0e66ff71e7 Merge branch 'main' into ai/paper-dynasty-card-creation-19 2026-03-23 03:51:06 +00:00
b55820eec8 Merge branch 'main' into ai/paper-dynasty-card-creation-16 2026-03-23 03:51:01 +00:00
b4a3e4b865 Merge branch 'main' into ai/paper-dynasty-card-creation#5 2026-03-23 03:50:56 +00:00
bb546c6ded Merge branch 'main' into ai/paper-dynasty-card-creation#10 2026-03-23 03:50:51 +00:00