fix(statistics): exclude legacy excludePlayers from the player leaderboard (F9)#22
Merged
Conversation
…board (F9) Port the legacy `excludePlayers.json` date-interval exclusion — the last unfilled part of F9 (excludeReplays/includeReplays already live in game-type-config). An ambiguous callsign (one nickname mapping to two real players across a name change) has its per-game result dropped from the player leaderboard within the configured interval. New pure spec module `statistics/exclude-players` (config + `isPlayerExcluded`, mirroring `game-type-config`). The decision is carried as a per-(player, replay) `excluded` flag on `AggregatePlayerEvidence` (set in `resolvedPlayers`), not a drop at the shared loader: `calculatePlayerAndSquadAggregates` now keeps two entity maps so excluded players vanish from player_stats (all-time + per-rotation) but still count toward squad_stats — legacy excludes only the player aggregate, never squads, and squads are a compared parity surface. Bounty drops excluded players from kill attribution (consistency; not parity-compared, no legacy analog). Name match replicates legacy `getPlayerName` (strip `[...]` + stray brackets, case-insensitive); interval is inclusive `[minDate ?? -inf, maxDate ?? +inf]`. Unit + integration tests; 100% coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
F9 — apply the legacy excludePlayers exclusion
Ports the last unimplemented piece of F9: the legacy
excludePlayers.jsondate-interval player exclusion. (excludeReplays/includeReplaysalready live ingame-type-config.tsfrom F8.)An ambiguous callsign — one nickname mapping to two real players across a name change — has its per-game result dropped from the player leaderboard (
player_stats, all-time + per-rotation) within the configured interval.Scope (squad-parity-safe)
A parity-scope review confirmed squad stats are a compared parity surface and legacy does not exclude players from squads. The exclusion is carried as a per-(player, replay)
excludedflag and applied via two entity maps incalculatePlayerAndSquadAggregates: excluded players vanish from the player leaderboard but still count towardsquad_stats(matching legacygetSquadInfo). Bounty drops excluded players (player-attributed; not parity-compared).Name match replicates legacy
getPlayerName(strip[...], case-insensitive); interval inclusive[minDate ?? -inf, maxDate ?? +inf].Tests
New pure
exclude-playersmodule (100% branch); unit test for excluded-in-squad behavior; real-pg integration (excluded player dropped, victim's death survives, squad still counts them).pnpm verifygreen, 100% coverage.🤖 Generated with Claude Code