Card Evolution Phase 1c: bot integration → next-release #96
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#96
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "card-evolution-phase1c"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Merges all Phase 1c bot integration work into
next-releasefor testing./evo statusslash command with progress bars, filters (type/tier/progress/page)[T1]/[T2]/[T3]/[EVO])update-game+evaluate-gameafter every gameContext
The database API (paper-dynasty-database) already has all evolution endpoints deployed on
next-release. This PR adds the Discord bot side so we can test the full end-to-end flow.Test plan
.sync ~to register/evocommands in dev guild/evo statusshows team evolution progress with player names and progress barsAI Code Review
Files Reviewed
.dockerignore(modified)cogs/players_new/evolution.py(modified)command_logic/logic_gameplay.py(modified)helpers/main.py(modified)helpers/evolution_notifs.py(present in repo, added in earlier commit on branch)in_game/gameplay_models.py(modified — formatting only)tests/gameplay_models/test_managerai_model.py(modified — formatting only)tests/test_card_embed_evolution.py(modified)Previous Issues — All 4 Resolved
1. Dead-code stub replaced with real import
logic_gameplay.pynow importsnotify_tier_completionfromhelpers.evolution_notifs. The 19-line local stub has been deleted.helpers/evolution_notifs.pyis fully implemented: it builds tier-colored Discord embeds and wrapschannel.sendin its own try/except so notification failures are non-fatal at the helper level as well.2. Module-level logger in helpers/main.py
logger = logging.getLogger("discord_app")is now declared at module level and thelogging.warning()call is correctly updated tologger.warning(). The placement between import groups is slightly non-standard but is definitively module-level and not a mid-file lazy import.3. Duplicate @pytest.mark.asyncio removed
The duplicate decorator on
test_no_evolution_state_shows_plain_namehas been removed. The remaining single@pytest.mark.asyncioper test method is correct throughout the class.4. Pagination count fixed for progress='close'
total_count = len(items)is now reassigned immediately after the client-side filter (line 177), before the empty-check early return. The footerPage X/Y - N total cardscorrectly reflects the filtered count.Findings
Correctness
season-stats/update-game/{id}is called first, thenevolution/evaluate-game/{id}. The evaluate call therefore operates on up-to-date season stats.try/except Exceptionwithlogger.warning, making all failures non-fatal.notify_tier_completioninhelpers/evolution_notifs.pyhas its own inner try/except, providing a second layer of protection against Discord API failures propagating up.build_tier_up_embedaccessestier_up["player_name"],tier_up["new_tier"], andtier_up["track_name"]with direct key access. A missing key raisesKeyError, but this is caught by the try/except innotify_tier_completionand degrades to a logged error. Acceptable.Security
db_posthelper.Style & Conventions
helpers/evolution_notifs.pycorrectly useslogger = logging.getLogger("discord_app").TIER_NAMESandTIER_COLORSare clean module-level constants.gameplay_models.pyare correct and inert.Suggestions (non-blocking)
loggerdeclaration inhelpers/main.pysits between two import blocks rather than after all imports. A future cleanup pass could move it to follow the full import block per PEP 8 convention.build_tier_up_embedcould use.get()with defaults forplayer_name/track_nameto be fully defensive, but the outer try/except makes this optional.Verdict: APPROVED
All 4 previously flagged issues are correctly resolved. The post-game hook correctly sequences update-game before evaluate-game, all evolution API calls are non-fatal, no secrets are present, and the base branch is
next-release. Ready to merge.Automated review by Claude PR Reviewer
Closing — this aggregation PR is superseded by the individual WP PRs:
The
next-releasebranch pattern is retired; all work now targetsmaindirectly.Pull request closed