Skip to content

fix(copi): evaluate special_lead_cards per round in highest_scoring_cards_in_game - #3792

Open
shikhabhadoria wants to merge 1 commit into
OWASP:masterfrom
shikhabhadoria:fix-highest-scoring-cards-per-round-3783
Open

shikhabhadoria wants to merge 1 commit into
OWASP:masterfrom
shikhabhadoria:fix-highest-scoring-cards-per-round-3783

Conversation

@shikhabhadoria

@shikhabhadoria shikhabhadoria commented Nov 15, 2026 •

Copy link
Copy Markdown

Description

In copi.owasp.org/lib/copi/cornucopia.ex, highest_scoring_cards_in_game/1 previously called special_lead_cards/1 on the flat list of all scoring cards across the entire game before grouping by played_in_round. Because special_lead_cards/1 checks jokers, trump suits, and List.first(ordered_played_cards).card.category across its input list, a different lead suit, trump card, or joker in one round filtered out scoring cards from other rounds.

This PR groups scoring cards by played_in_round first and applies special_lead_cards/1 followed by highest_card/1 independently to each round's cards, and adds multi-round regression tests in copi.owasp.org/test/copi/cornucopia_logic_test.exs.

Fixes #3783

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

Copilot AI balanced review requested due to automatic review settings November 15, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(copi): highest_scoring_cards_in_game applies special_lead_cards across all rounds before grouping by round

2 participants