Skip to content

[#6] Enhanced diversity scoring#24

Merged
javaisbetterthanpython merged 2 commits into
mainfrom
issue-6-enhanced-diversity
Jun 7, 2026
Merged

[#6] Enhanced diversity scoring#24
javaisbetterthanpython merged 2 commits into
mainfrom
issue-6-enhanced-diversity

Conversation

@javaisbetterthanpython

Copy link
Copy Markdown
Owner

Summary

  • Add partnerPairCounts tracking keyed by sorted player-id pairs, with squared penalties in team scoring (mirroring full-match dedup).
  • Wire getVariance() into getNextBestRound as a final tiebreaker after duplicates, partner score, and opponent score.
  • Remove duplicate getActiveFixedTeams / getUnpairedPlayers definitions that blocked test compilation, and cap team-set generation attempts to avoid infinite loops with fixed pairs.

Test plan

  • yarn test:ci passes (18/18)
  • yarn build — fails on main due to pre-existing PlayersModal.tsx lint error (unescaped apostrophe)
  • Partner pair penalty discourages repeated partnerships in team selection
  • Variance tiebreaker balances partner-count distribution across lookahead rounds

Closes #6

Made with Cursor

Track explicit partner-pair repetition with squared penalties in team
selection and use getVariance() as a final tiebreaker in getNextBestRound.

Co-authored-by: Cursor <cursoragent@cursor.com>
@javaisbetterthanpython

Copy link
Copy Markdown
Owner Author

APPROVE

Implements all four acceptance criteria for #6: partnerPairCounts keyed by sorted player-id pairs, squared repeat penalty in team scoring, getVariance() as the final tiebreaker in getNextBestRound, and existing heuristics tests pass on CI (18/18). Also removes duplicate getActiveFixedTeams/getUnpairedPlayers definitions that block test compilation on main, and caps team-set generation attempts to avoid infinite loops with fixed pairs.

Findings

  • 🟢 Fixed-pair test now skips assertion only when both paired players sit out (if (teamWithA)); behavior is sound — a comment explaining that would help future readers.
  • 🟢 partnerPairCounts / getPartnerPairIdentifier are exported but not covered by dedicated unit tests; acceptable since issue only requires existing tests to pass.
  • 🟢 GitHub CI lint step fails on pre-existing PlayersModal.tsx unescaped apostrophe (not introduced here); yarn test:ci passes locally (18/18).

Escape the apostrophe in PlayersModal copy, replace invalid react-iconly Link import, fix duplicate fixedPairs in cacheState, and use Array.from for Set iteration under es5 target.

Co-authored-by: Cursor <cursoragent@cursor.com>
@javaisbetterthanpython javaisbetterthanpython merged commit a0e292a into main Jun 7, 2026
1 check passed
@javaisbetterthanpython javaisbetterthanpython deleted the issue-6-enhanced-diversity branch June 8, 2026 15:54
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.

Enhanced diversity scoring

1 participant