Commit Graph

14 Commits

Author SHA1 Message Date
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 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
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 Corum
81622cceb3 docs: update Phase 0 status with PR references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:13:18 -05:00
Cal Corum
8bddf31bf6 feat: configurable API URL for local high-concurrency card rendering
Allow upload scripts to target a local API server instead of the remote
production server, enabling 32x+ concurrency for dramatically faster
full-cardset uploads (~30-45s vs ~2-3min for 800 cards).

- pd_cards/core/upload.py: add api_url param to upload_cards_to_s3(),
  refresh_card_images(), and check_card_images()
- pd_cards/commands/upload.py: add --api-url CLI option to upload s3
- check_cards_and_upload.py: read PD_API_URL env var with prod fallback
- Update CLAUDE.md, CLI reference, and Phase 0 project plan docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 10:27:16 -05:00
Cal Corum
0a17745389 Run black and ruff across entire codebase
Standardize formatting with black and apply ruff auto-fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:24:33 -05:00
Cal Corum
931416a7c7 Add FullCard migration status doc for session continuity
Documents current branch state, what's built, what's left,
known bugs, and decision points so the next session can pick
up without re-investigating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:58:55 -06:00
Cal Corum
1de8b1db2f Add custom card profiles, S3 upload with timestamp cache-busting, and CLI enhancements
- Add Sippie Swartzel custom batter profile (0.820 OPS, SS/RF, no HR power)
- Update Kalin Young profile (0.891 OPS, All-Star rarity)
- Update Admiral Ball Traits profile with innings field
- Fix S3 cache-busting to include Unix timestamp for same-day updates
- Add pd_cards/core/upload.py and scouting.py modules
- Add custom card submission scripts and documentation
- Add uv.lock for dependency tracking
2026-01-25 21:57:35 -06:00
Cal Corum
9a121d370f Add card builder architecture redesign documentation
Documents proposed architecture for moving card-building logic upstream
to Python, including:
- Executive summary with problem statement and migration path
- CardBuilder sketch with contract system for pluggable placement strategies
- Support for different card "personalities" (Standard, Clutch, Power Heavy, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 10:56:55 -06:00
Cal Corum
cc5f93eb66 Fix critical asterisk regression in player names
CRITICAL BUG FIX: Removed code that was appending asterisks to left-handed
players' names and hash symbols to switch hitters' names in production.

## Changes

### Core Fix (retrosheet_data.py)
- Removed name_suffix code from new_player_payload() (lines 1103-1108)
- Players names now stored cleanly without visual indicators
- Affected 20 left-handed batters in 2005 Live cardset

### New Utility Scripts
- fix_player_names.py: PATCH player names to remove symbols (uses 'name' param)
- check_player_names.py: Verify all players for asterisks/hashes
- regenerate_lefty_cards.py: Update image URLs with cache-busting dates
- upload_lefty_cards_to_s3.py: Fetch fresh cards and upload to S3

### Documentation (CRITICAL - READ BEFORE WORKING WITH CARDS)
- docs/LESSONS_LEARNED_ASTERISK_REGRESSION.md: Comprehensive guide
  * API parameter is 'name' NOT 'p_name'
  * Card generation caching requires timestamp cache-busting
  * S3 keys must not include query parameters
  * Player names only in 'players' table
  * Never append visual indicators to stored data

- CLAUDE.md: Added critical warnings section at top

## Key Learnings
1. API param for player name is 'name', not 'p_name'
2. Cards are cached - use timestamp in ?d= parameter
3. S3 keys != S3 URLs (no query params in keys)
4. Fix data BEFORE generating/uploading cards
5. Visual indicators belong in UI, not database

## Impact
- Fixed 20 player records in production
- Regenerated and uploaded 20 clean cards to S3
- Documented to prevent future regressions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 14:38:04 -06:00
Cal Corum
4be418d6f0 Card Creation Automation 2025-11-23 01:28:33 -06:00