Commit Graph

580 Commits

Author SHA1 Message Date
Cal Corum
bbad1daba2 fix: clean up refractor status display — suffix tags, compact layout, dead code removal
All checks were successful
Ruff Lint / lint (pull_request) Successful in 20s
- Tier labels as suffix tags: **Name** — Base Chrome [T1] (T0 gets no suffix)
- Compact progress line: bar value/threshold (pct) — removed formula and tier arrow
- Fully evolved shows `MAX` instead of FULLY EVOLVED
- Deleted unused FORMULA_LABELS dict
- Added _FULL_BAR constant, moved T0-branch lookups into else
- Fixed mock API shape in test (cards → items)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:22:35 -05:00
cal
2d7c19814e Merge pull request 'fix: replace abstract tier symbols with readable labels' (#132) from fix/refractor-tier-labels into main
All checks were successful
Build Docker Image / build (push) Successful in 2m46s
2026-03-26 04:49:19 +00:00
Cal Corum
c3ff85fd2d fix: replace abstract tier symbols with readable labels in /refractor status
All checks were successful
Ruff Lint / lint (pull_request) Successful in 11s
Unicode symbols (○ ◈ ◆ ✦ ★) were too similar to distinguish at a glance.
Now uses T1/T2/T3/T4★ prefixes with no prefix for base cards (T0).
Summary header reads "Base: 1  T1: 9 — 64 total" instead of cryptic symbols.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 23:47:03 -05:00
cal
64c656ce91 Merge pull request 'feat: redesign /refractor status with rich Unicode display' (#129) from feat/refractor-status-redesign into main
All checks were successful
Build Docker Image / build (push) Successful in 2m42s
2026-03-26 03:50:41 +00:00
Cal Corum
cd822857bf feat: redesign /refractor status with rich Unicode display and team branding
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
Replace plain ASCII progress bars and text badges with a polished embed:
- Unicode block progress bars (▰▱) replacing ASCII [===---]
- Tier-specific symbols (○ ◈ ◆ ✦ ★) instead of [BC]/[R]/[GR]/[SF] badges
- Team-branded embeds via get_team_embed (color, logo, season footer)
- Tier distribution summary header in code block
- Percentage display and backtick-wrapped values
- Tier-specific accent colors for single-tier filtered views
- Sparkle treatment for fully evolved cards (✧ FULLY EVOLVED ✧)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:46:38 -05:00
cal
34774290b8 Merge pull request 'fix: context-aware empty state messages for /refractor status' (#128) from fix/refractor-empty-filter-message into main
All checks were successful
Build Docker Image / build (push) Successful in 3m29s
2026-03-25 23:57:53 +00:00
Cal Corum
6239f1177c fix: context-aware empty state messages for /refractor status
All checks were successful
Ruff Lint / lint (pull_request) Successful in 23s
When filters are active and return 0 results, show which filters were
applied and suggest removing them, instead of the misleading
"No refractor data found for your team."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:57:32 -05:00
cal
dea6316201 Merge pull request 'feat: add Prev/Next navigation buttons to /refractor status' (#127) from feat/refractor-pagination-buttons into main
All checks were successful
Build Docker Image / build (push) Successful in 3m8s
2026-03-25 22:43:29 +00:00
Cal Corum
b9deb14b62 feat: add Prev/Next navigation buttons to /refractor status
All checks were successful
Ruff Lint / lint (pull_request) Successful in 24s
- RefractorPaginationView with ◀ Prev / Next ▶ buttons
- Buttons re-fetch from API on each page change
- Prev disabled on page 1, Next disabled on last page
- Only the command invoker can use the buttons
- Buttons auto-disable after 2 min timeout
- Single-page results show no buttons

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:43:06 -05:00
cal
48392a9bbe Merge pull request 'feat: use Discord Choice menus for /refractor status parameters' (#126) from enhancement/refractor-choice-params into main
All checks were successful
Build Docker Image / build (push) Successful in 2m40s
2026-03-25 22:16:53 +00:00
Cal Corum
a53cc5cac3 feat: use Discord Choice menus for /refractor status parameters
All checks were successful
Ruff Lint / lint (pull_request) Successful in 22s
Replace freeform text inputs with dropdown selections:
- card_type: Batter, Starting Pitcher, Relief Pitcher
- tier: T0-T4 with names (Base Card through Superfractor)
- progress: "Close to next tier" option
- Removed season param (not useful for current UX)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:16:26 -05:00
cal
a8b4d6cdbb Merge pull request 'fix: round refractor values to integers in display' (#125) from fix/refractor-round-values into main
All checks were successful
Build Docker Image / build (push) Successful in 2m39s
2026-03-25 21:55:24 +00:00
Cal Corum
8d2cdc81fe fix: round refractor values to integers in display
All checks were successful
Ruff Lint / lint (pull_request) Successful in 19s
Cast current_value and next_threshold to int to avoid ugly floating
point numbers like 53.0/149.0 in the progress display.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:55:03 -05:00
cal
27ce8b3617 Merge pull request 'fix: add debug logging for successful refractor API responses' (#124) from fix/refractor-debug-logging into main
All checks were successful
Build Docker Image / build (push) Successful in 2m47s
2026-03-25 21:47:41 +00:00
Cal Corum
17d124feb4 fix: add debug logging for successful refractor API responses
All checks were successful
Ruff Lint / lint (pull_request) Successful in 9s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:46:01 -05:00
Cal Corum
1c21f674c2 fix: add error logging and user-facing message for API failures
All checks were successful
Ruff Lint / lint (pull_request) Successful in 20s
- Log API error detail when refractor endpoint returns an error
- Show "Something went wrong" instead of misleading "No refractor data"
- Log empty response case for debugging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:44:20 -05:00
Cal Corum
a9ef04d102 fix: use server-side pagination and fix limit=500 exceeding API max
- Switch from client-side pagination (fetch all, slice) to server-side
  (pass limit/offset/progress params to API)
- Fixes limit=500 rejection (API max is 100)
- Footer now shows total_count from API response
- progress=close filter delegated to API instead of client-side

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:43:58 -05:00
c285e9e12d Merge pull request 'fix: align refractor status command with API response schema' (#122) from fix/refractor-status-field-names into main
All checks were successful
Build Docker Image / build (push) Successful in 2m50s
2026-03-25 21:20:20 +00:00
Cal Corum
7a3c21f6bd fix: align refractor status command with API response schema
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
- data.get("cards") → data.get("items") to match list endpoint response
- formula_value → current_value (API field name)
- card_type from top-level → track.card_type (nested in track object)
- Add limit=500 param so API returns all cards instead of default 10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:18:07 -05:00
cal
b185874607 Merge pull request 'docs: update refractor test plan — resolve list endpoint gap, add API tests' (#121) from docs/update-refractor-test-plan into main
All checks were successful
Build Docker Image / build (push) Successful in 3m2s
2026-03-25 16:25:39 +00:00
Cal Corum
7191400b5b docs: update refractor test plan — resolve list endpoint gap, add API tests
All checks were successful
Ruff Lint / lint (pull_request) Successful in 17s
- Mark CRITICAL missing endpoint gap as resolved (database PR #173 merged)
- Add REF-API-06 through REF-API-10 covering the new GET /refractor/cards
  list endpoint (team filter, card_type, tier, progress, pagination)
- Update prerequisites, execution checklist, and time estimates
- Total test cases: 87 (was 82)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:19:40 -05:00
cal
fd89349f29 Merge pull request 'docs: note manual game testing in refractor test plan' (#120) from docs/test-plan-note into main 2026-03-25 06:28:55 +00:00
Cal Corum
3b36dc33ee docs: note manual game testing in refractor test plan
All checks were successful
Ruff Lint / lint (pull_request) Successful in 10s
Sections 7-8 (game simulation, tier-up notifications) are marked as
manual testing by Cal — impractical to automate via Playwright.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 01:28:21 -05:00
cal
cf1d9c372d Merge pull request 'test: add refractor integration test plan and preflight script' (#119) from test/refractor-integration-plan into main 2026-03-25 06:20:06 +00:00
Cal Corum
190aa88d43 test: add refractor integration test plan and preflight script
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
82-case in-app test plan for Playwright automation covering /refractor status,
tier badges, post-game hooks, tier-up notifications, and edge cases.
Preflight script for quick deploy verification via curl.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 01:16:21 -05:00
cal
24a59e9670 Merge pull request 'fix: wire WP-14 tier-up notification embeds into post-game hook' (#118) from fix/wp14-wire-notifications into main
All checks were successful
Build Docker Image / build (push) Successful in 2m44s
2026-03-25 04:45:14 +00:00
Cal Corum
571a86fe7e fix: wire WP-14 tier-up notification embeds into post-game hook
All checks were successful
Ruff Lint / lint (pull_request) Successful in 25s
Replace the logging-only stub in logic_gameplay.py with the real
notify_tier_completion from helpers/refractor_notifs.py. Tier-up
events now send Discord embeds instead of just logging.

- Import notify_tier_completion from helpers.refractor_notifs
- Remove 16-line stub function and redundant inline logging
- Update tests: verify real embed-sending behavior, replace
  bug-documenting T1-5 diagnostic with shape validation guards

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:43:05 -05:00
cal
8c0c2eb21a test: refractor system comprehensive test coverage (#117)
test: add comprehensive refractor system test coverage (23 tests)

Covers TIER_NAMES/TIER_BADGES cross-module consistency, WP-14 tier_up dict
shape mismatch (latent KeyError documented), None channel handling, filter
combinations, progress bar boundaries, and malformed API response handling.
2026-03-24 21:06:13 +00:00
cal
55efdb39de Merge pull request 'fix: update evolution/cards endpoint to refractor/cards (#113)' (#114) from issue/113-update-evolution-cards-endpoint-to-refractor-cards into main
All checks were successful
Build Docker Image / build (push) Successful in 2m31s
2026-03-24 05:20:10 +00:00
Cal Corum
fddac59f7e fix: update test mock endpoint strings to refractor/cards/ (#114)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 20s
Mock routing in _patch_db_get and _failing_db_get still checked for
"evolution/cards/" after the production endpoint was renamed, causing
all badge-presence assertions to pass vacuously (evo_state=None).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 00:19:23 -05:00
Cal Corum
45894c72ee fix: update evolution/cards endpoint to refractor/cards (#113)
Closes #113

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 00:19:23 -05:00
cal
8940965ff8 Merge pull request 'ci: switch buildx cache from registry to local volume' (#116) from ci/local-buildx-cache into main
All checks were successful
Build Docker Image / build (push) Successful in 2m51s
2026-03-24 02:17:17 +00:00
Cal Corum
6e45686457 ci: switch buildx cache from registry to local volume
All checks were successful
Ruff Lint / lint (pull_request) Successful in 1m20s
Replaces type=registry cache (which causes 400 errors from Docker Hub
due to stale buildx builders) with type=local backed by a named Docker
volume on the runner. Adds cache rotation step to prevent unbounded growth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:16:08 -05:00
cal
f85ead1f60 Merge pull request 'ci: add dev tag trigger to Docker build workflow' (#115) from ci/dev-tag-workflow into main
Some checks failed
Build Docker Image / build (push) Has been cancelled
2026-03-23 21:10:24 +00:00
Cal Corum
9bbd5305ef ci: add dev tag trigger to Docker build workflow
All checks were successful
Ruff Lint / lint (pull_request) Successful in 15s
Allows deploying to dev environment by pushing a "dev" tag.
Dev tags build with :dev Docker tag instead of :production.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 16:10:08 -05:00
cal
187ae854ca Merge pull request 'feat: WP-14 tier completion notification embeds' (#112) from feature/wp14-tier-notifications into main 2026-03-23 20:26:22 +00:00
cal
dc128ad995 Merge branch 'main' into feature/wp14-tier-notifications
All checks were successful
Ruff Lint / lint (pull_request) Successful in 14s
2026-03-23 20:26:04 +00:00
cal
aa2fce94b8 Merge pull request 'feat: WP-13 post-game evolution callback hook' (#111) from feature/wp13-postgame-hook into main 2026-03-23 20:25:43 +00:00
cal
80344fe473 Merge branch 'main' into feature/wp13-postgame-hook
All checks were successful
Ruff Lint / lint (pull_request) Successful in 14s
2026-03-23 20:25:31 +00:00
Cal Corum
29f2a8683f fix: rename evolution/ to refractor/ endpoint and remove misplaced notifs module
All checks were successful
Ruff Lint / lint (pull_request) Successful in 14s
- Change `evolution/evaluate-game/` API call to `refractor/evaluate-game/` in
  complete_game() hook (was calling the wrong endpoint path)
- Update all test assertions in test_complete_game_hook.py to match the
  corrected endpoint path and update docstrings to "refractor" naming
- Remove helpers/evolution_notifs.py and tests/test_evolution_notifications.py
  from this PR — they belong to PR #112 (WP-14 tier notifications). The
  notify_tier_completion stub in logic_gameplay.py remains as the WP-14
  integration target.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:22:25 -05:00
Cal Corum
9940b160db fix: rename evolution to refractor terminology, fix tier names
All checks were successful
Ruff Lint / lint (pull_request) Successful in 12s
- Rename helpers/evolution_notifs.py -> helpers/refractor_notifs.py
- Rename tests/test_evolution_notifications.py -> tests/test_refractor_notifs.py
- Delete utilities/evolution_notifications.py (replaced by helpers/refractor_notifs.py)
- Update TIER_NAMES to canonical names: Base Card, Base Chrome, Refractor, Gold Refractor, Superfractor
- Update T4 embed title from "FULLY EVOLVED!" to "SUPERFRACTOR!"
- Update FOOTER_TEXT from "Paper Dynasty Evolution" to "Paper Dynasty Refractor"
- Update non-max tier embed title from "Evolution Tier Up!" to "Refractor Tier Up!"
- Add discord.abc.Messageable type annotation to notify_tier_completion channel param
- Update all test assertions to match new tier names and strings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:12:59 -05:00
cal
d2410ab374 Merge pull request 'feat: /refractor status slash command (WP-11)' (#87) from ai/paper-dynasty-database#76 into main 2026-03-23 20:11:32 +00:00
cal
c85359ca5d Merge branch 'main' into ai/paper-dynasty-database#76
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
2026-03-23 20:11:17 +00:00
Cal Corum
45d71c61e3 fix: address reviewer issues — rename evolution endpoints, add TIER_BADGES
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m32s
- Update module docstring: replace evolution/cards with refractor/cards,
  drop old tier names (Unranked/Initiate/Rising/Ascendant/Evolved), add
  correct tier names (Base Card/Base Chrome/Refractor/Gold Refractor/
  Superfractor)
- Fix API call: db_get("evolution/cards") → db_get("refractor/cards")
- Add TIER_BADGES dict {1:"[BC]", 2:"[R]", 3:"[GR]", 4:"[SF]"}
- Update format_refractor_entry to prepend badge label for T1-T4 (T0 has
  no badge)
- Add TestTierBadges test class (11 tests) asserting badge values and
  presence in formatted output
- Update test_player_name_in_output to accommodate badge-prefixed bold name

Dead utilities/evolution_notifications.py has no source file on this branch
(WP-14/PR #112 already delivered the replacement).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:08:39 -05:00
cal
7a50ab0bce Merge pull request 'feat: Refractor tier badge prefix in card embed title (WP-12) (#77)' (#88) from ai/paper-dynasty-database#77 into main 2026-03-23 20:05:44 +00:00
cal
3ce5aebc57 Merge branch 'main' into ai/paper-dynasty-database#77
All checks were successful
Ruff Lint / lint (pull_request) Successful in 16s
2026-03-23 20:05:29 +00:00
Cal Corum
3a85564a6d fix: remove unused Optional import
All checks were successful
Ruff Lint / lint (pull_request) Successful in 18s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:55:03 -05:00
Cal Corum
911c6842e4 feat: WP-14 tier completion notification embeds
Adds helpers/evolution_notifs.py with build_tier_up_embed() and
notify_tier_completion(). Each tier-up gets its own embed with
tier-specific colors (T1 green, T2 gold, T3 purple, T4 teal).
Tier 4 uses a special 'FULLY EVOLVED!' title with a future rating
boosts note. Notification failure is non-fatal (try/except). 23
unit tests cover all tiers, empty list, and failure path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 14:55:03 -05:00
Cal Corum
2c57fbcdf5 fix: remove dead real_notify import in test
All checks were successful
Ruff Lint / lint (pull_request) Successful in 23s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:52:49 -05:00
Cal Corum
b04219d208 feat: WP-13 post-game callback hook for season stats and evolution
After complete_game() saves the game result and posts rewards, fire two
non-blocking API calls in order:
  1. POST season-stats/update-game/{game_id}
  2. POST evolution/evaluate-game/{game_id}

Any failure in the evolution block is caught and logged as a warning —
the game is already persisted so evolution will self-heal on the next
evaluate pass. A notify_tier_completion stub is added as a WP-14 target.

Closes #78 on cal/paper-dynasty-database

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 14:52:36 -05:00