Commit Graph

635 Commits

Author SHA1 Message Date
cal
2ce6bbe57a Merge pull request 'chore(cogs): remove dead gameplay_legacy cog (4,723 lines, zero references)' (#162) from autonomous/delete-gameplay-legacy into main
Reviewed-on: #162
Reviewed-by: Claude <cal.corum+openclaw@gmail.com>
2026-04-10 11:47:11 +00:00
Cal Corum
6b55aed732 chore(cogs): remove dead gameplay_legacy cog (4,723 lines, zero references)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 30s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 02:52:42 -05:00
cal
662c1c5448 Merge pull request 'feat: add /dev refractor-test integration test command' (#161) from feat/refractor-integration-test into main
All checks were successful
Build Docker Image / build (push) Successful in 3m14s
2026-04-10 02:23:21 +00:00
cal
d123437f0e Merge branch 'main' into feat/refractor-integration-test
All checks were successful
Ruff Lint / lint (pull_request) Successful in 31s
2026-04-10 02:23:09 +00:00
Cal Corum
f3a83f91fd fix: remove dead parameters from PR review feedback
All checks were successful
Ruff Lint / lint (pull_request) Successful in 13s
Remove unused `player_name` param from `_execute_refractor_test` and
unused `final` param from `update_embed` closure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 08:34:02 -05:00
Cal Corum
5b43f8dad3 fix: address code review — use PD_SEASON, top-level imports, fix kwargs typing
All checks were successful
Ruff Lint / lint (pull_request) Successful in 22s
- Replace hardcoded CURRENT_SEASON = 11 with PD_SEASON from helpers.constants
- Move get_team_by_owner import to top-level (no circular dependency)
- Replace kwargs dict unpacking with explicit keyword args (fixes Pyright)
- Remove unused os import
- Add comment documenting on_timeout limitation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 08:00:11 -05:00
Cal Corum
c683e36daf feat: conditionally load dev_tools cog when not in prod
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:54:33 -05:00
Cal Corum
9257852c3e feat: add refractor-test execute phase with step-by-step reporting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:53:10 -05:00
Cal Corum
129971e96b feat: add DevToolsCog with refractor-test setup phase
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:20:38 -05:00
Cal Corum
2067a02a23 feat: add play/game/decision data builders for refractor test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:12:15 -05:00
Cal Corum
777e6de3de feat: add CleanupView for refractor test data
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:06:37 -05:00
Cal Corum
0aeed0c76f feat: add refractor test stat calculation helpers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 07:05:43 -05:00
Cal Corum
9922f3bb3e chore: add .worktrees/ to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 06:55:47 -05:00
cal
5d86641fda Merge pull request 'feat: show refractor progress in post-game summary embed (#147)' (#160) from issue/147-feat-show-refractor-progress-in-post-game-summary into main
Reviewed-on: #160
2026-04-08 23:21:57 +00:00
Cal Corum
39424f7157 feat: show refractor progress in post-game summary embed (#147)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 24s
Closes #147

Adds a "Refractor Progress" field to the game summary embed showing:
- Cards that tiered up during this game (⬆ Name → Tier Name)
- Cards currently ≥80% toward their next tier on either team (◈ Name (pct%))

The field is omitted entirely when there is nothing to show.

Implementation:
- _run_post_game_refractor_hook() now returns evo_result (or None on failure)
- New _build_refractor_progress_text() fetches close-to-tier cards from both
  teams via refractor/cards?progress=close and formats the combined output
- complete_game() adds the field between Rewards and Highlights sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 13:36:32 -05:00
cal
8842d80f26 Merge pull request 'feat: include refractor card image in tier-up notification embed (#144)' (#159) from issue/144-feat-tier-up-notification-should-include-refractor into main 2026-04-08 15:25:50 +00:00
Cal Corum
25b63b407f feat: include refractor card image in tier-up notification embed (#144)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
Closes #144

- build_tier_up_embed() accepts optional image_url and calls set_image() when provided
- notify_tier_completion() accepts optional image_url and passes it through
- _trigger_variant_renders() now captures the render response image_url per player and returns a player_id->image_url dict
- _run_post_game_refractor_hook() triggers renders first (to obtain image URLs), then sends notifications with card art included
- Updated test_post_game_refractor_hook.py to reflect new render-before-notify ordering and image_url kwarg in notify calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 09:38:43 -05:00
cal
bd6c387902 Merge pull request 'test: mock-based integration tests for post-game refractor hook (#148)' (#158) from issue/148-test-mock-based-integration-tests-for-post-game-re into main 2026-04-08 14:26:05 +00:00
Cal Corum
eb022c3d66 test: mock-based integration tests for post-game refractor hook (#148)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 28s
Extract _run_post_game_refractor_hook() from complete_game() so the hook
logic can be tested directly without a live game session. Add 13 tests
covering endpoint ordering, tier-up notification dispatch, variant render
triggers, and non-fatal error handling.

Closes #148

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 08:34:50 -05:00
cal
63a25ea0ba Merge pull request 'perf: parallelize scout opportunity creation and remove sleep(2) (#101)' (#156) from issue/101-perf-parallelize-scout-opportunity-creation-and-re into main 2026-04-08 10:26:17 +00:00
cal
e5ec88f794 Merge branch 'main' into issue/101-perf-parallelize-scout-opportunity-creation-and-re
All checks were successful
Ruff Lint / lint (pull_request) Successful in 15s
2026-04-08 10:26:10 +00:00
cal
ff57b8fea3 Merge pull request 'perf: parallelize get_card_embeds calls in display_cards (#98)' (#157) from issue/98-perf-parallelize-get-card-embeds-calls-in-display into main 2026-04-08 10:26:04 +00:00
Cal Corum
2f22a11e17 perf: parallelize get_card_embeds calls in display_cards (#98)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 17s
Closes #98

Replace sequential await-in-list-comprehension with asyncio.gather() so
all card embed fetches run concurrently. Cuts 50 sequential DB round-trips
(5 packs × 5 cards × 2 calls each) down to ~2 concurrent batches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:32:56 -05:00
Cal Corum
8ddd58101c perf: parallelize scout opportunity creation and remove sleep(2) (#101)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 12s
Closes #101

Replace sequential for-loop with asyncio.gather() so all scout
opportunities are created concurrently. Remove asyncio.sleep(2) that
added ~8s of post-display delay for multi-pack opens. create_scout_opportunity()
already guards against empty pack_cards with an early return.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 01:02:10 -05:00
cal
24420268cf Merge pull request 'refactor: extract TIER_NAMES/TIER_COLORS to shared constants module (#146)' (#155) from issue/146-refactor-extract-tier-names-tier-colors-to-shared into main 2026-04-08 05:25:33 +00:00
Cal Corum
21bad7af51 refactor: extract TIER_NAMES/TIER_COLORS to shared constants module (#146)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 12s
Closes #146

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 00:03:46 -05:00
cal
224250b03d Merge pull request 'fix: add logging to silent error swallowing in badge lookup (#150)' (#152) from issue/150-fix-add-logging-to-silent-error-swallowing-in-badg into main 2026-04-08 03:25:41 +00:00
Cal Corum
1a3f8994a9 fix: add debug logging to silent badge lookup exception in get_card_embeds
All checks were successful
Ruff Lint / lint (pull_request) Successful in 22s
Replaces bare `except Exception: pass` with `logging.debug(..., exc_info=True)`
so badge lookup failures are traceable in logs without affecting card display.

Closes #150

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 22:02:00 -05:00
cal
f67c1c41a7 Merge pull request 'feat: add team param to _build_refractor_response for collection view (#138)' (#140) from issue/138-feat-collection-view-refractor-card-images-in-web into main 2026-04-08 01:45:24 +00:00
cal
435bfd376f Merge branch 'main' into issue/138-feat-collection-view-refractor-card-images-in-web
All checks were successful
Ruff Lint / lint (pull_request) Successful in 27s
2026-04-08 01:45:19 +00:00
cal
c01167b097 Merge pull request 'docs: update refractor test plan with 2026-04-07 results' (#143) from docs/update-refractor-test-plan into main 2026-04-08 01:45:16 +00:00
Cal Corum
59a41e0c39 docs: update refractor integration test plan with 2026-04-07 results
All checks were successful
Ruff Lint / lint (pull_request) Successful in 25s
Fix incorrect command names (/card→/player, /roster→/team, /buy→/buy card-by-name,
/openpack→/open-packs, /scout→/scout-tokens). Update execution checklist with full
Playwright test session results — API tests, filter tests, pagination, edge cases
all passing. Note badge propagation design gap and REF-22 fix (discord#141).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:08:37 -05:00
cal
3210d5d6a4 Merge pull request 'fix: move health server from port 8080 to 8081 (#130)' (#131) from issue/130-move-bot-health-server-off-port-8080-to-avoid-admi into main
All checks were successful
Build Docker Image / build (push) Successful in 3m2s
Reviewed-on: #131
2026-04-07 15:54:03 +00:00
Cal Corum
8e5242a6b7 fix: move health server from port 8080 to 8081 (#130)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 18s
Adminer is exposed on host port 8080, shadowing the bot health endpoint.
Change health server default to 8081 to avoid the conflict.

Closes #130

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 15:53:33 +00:00
cal
8f9242bed8 Merge pull request 'fix: clamp page overflow to last page in /refractor status (#141)' (#142) from issue/141-bug-refractor-status-page-overflow-shows-no-data-i into main
Reviewed-on: #142
2026-04-07 15:52:06 +00:00
Cal Corum
cb17b99220 fix: clamp page overflow to last page in /refractor status (#141)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 30s
When page exceeds total pages, API returns empty items but non-zero
count. Now detects this case and re-fetches the last valid page.

Closes #141

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 10:31:55 -05:00
Cal Corum
ddc9a28023 fix: use Optional[dict] for team param type annotation
All checks were successful
Ruff Lint / lint (pull_request) Successful in 12s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 17:36:04 -05:00
Cal Corum
f488cb66e0 feat: add team param to _build_refractor_response for collection view (#138)
Closes #138

The test suite passes `team` to _build_refractor_response but the
function signature did not accept it. Adds `team: dict = None` so
tests for the refractor card image collection view pass without
changing any existing behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 17:35:46 -05:00
cal
5cfddaa89a Merge pull request 'feat: refractor card art pipeline — render trigger + /player view' (#139) from feat/refractor-card-art-pipeline into main 2026-04-06 22:34:01 +00:00
Cal Corum
78f313663e fix: review feedback — variant 0 guard, remove dead team param
All checks were successful
Ruff Lint / lint (pull_request) Successful in 11s
- Use `variant is None` instead of `not variant` to avoid skipping
  variant 0 tier-ups (0 is falsy in Python)
- Remove unused `team` parameter from _build_refractor_response
- Update tests to match

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 17:33:36 -05:00
Cal Corum
46744d139c feat: add /player refractor_tier parameter for viewing evolved cards
All checks were successful
Ruff Lint / lint (pull_request) Successful in 13s
Adds optional refractor_tier parameter to the /player slash command.
When provided: looks up the user's team refractor data, shows the
evolved card image if available, triggers on-demand render if image
not yet generated, or shows top 5 refractor cards as fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 17:21:28 -05:00
Cal Corum
730d4b4f60 feat: trigger variant card renders after post-game tier-ups
After refractor tier-ups, the bot hits the card render URL for each
variant card to trigger Playwright render + S3 upload as a side
effect. Fire-and-forget — failures are logged but never raised.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 17:10:13 -05:00
cal
9ee4a76cd6 Merge pull request 'fix: remove stale Superfractor "Rating Boosts" teaser' (#137) from fix/remove-stale-superfractor-text into main 2026-04-06 20:13:36 +00:00
Cal Corum
80e99b075f chore: fix stale docstring referencing removed note field
All checks were successful
Ruff Lint / lint (pull_request) Successful in 15s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 15:09:21 -05:00
Cal Corum
ef270ec1ab fix: remove stale "Rating Boosts coming soon" from Superfractor notification
All checks were successful
Ruff Lint / lint (pull_request) Successful in 52s
Tier boosts shipped in Phase 2 — the teaser field in the T4 tier-up
embed was outdated. Remove it and update tests + test plan to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 14:59:56 -05:00
cal
b65d91a65b Merge pull request 'fix: remove docker-compose.yml from tracking, add example template' (#136) from fix/docker-compose-secrets-untrack into main 2026-04-01 18:02:35 +00:00
cal
4bda3bf0de Merge branch 'main' into fix/docker-compose-secrets-untrack
All checks were successful
Ruff Lint / lint (pull_request) Successful in 15s
2026-04-01 18:02:29 +00:00
cal
ff768c95f5 Merge pull request 'chore: add .env.example with placeholder values' (#135) from chore/add-env-example into main 2026-04-01 18:02:17 +00:00
Cal Corum
fb545ef34a fix: remove docker-compose.yml from tracking, add example template
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
docker-compose.yml contains hardcoded credentials (BOT_TOKEN, API_TOKEN,
RESTART_WEBHOOK_URL) and should never be committed. The *compose.yml gitignore
rule already excluded it but docker-compose.example.yml was not provided as a
reference for contributors.

- Add !docker-compose.example.yml negation to .gitignore so example is tracked
- Add docker-compose.example.yml with placeholder values for all secrets

Closes paper-dynasty-database#9

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:59:40 -05:00
Cal Corum
f704b09933 chore: add .env.example with placeholder values
All checks were successful
Ruff Lint / lint (pull_request) Successful in 29s
Document all required environment variables for running the Discord bot,
including bot token, API credentials, database config, and webhook URL.

References paper-dynasty-database#9
2026-04-01 11:59:44 -05:00