Skip to content

fix(statistics): exclude legacy excludePlayers from the player leaderboard (F9)#22

Merged
Afgan0r merged 2 commits into
masterfrom
fix/f9-exclude-players
Jun 15, 2026
Merged

fix(statistics): exclude legacy excludePlayers from the player leaderboard (F9)#22
Afgan0r merged 2 commits into
masterfrom
fix/f9-exclude-players

Conversation

@Afgan0r

@Afgan0r Afgan0r commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

F9 — apply the legacy excludePlayers exclusion

Ports the last unimplemented piece of F9: the legacy excludePlayers.json date-interval player exclusion. (excludeReplays/includeReplays already live in game-type-config.ts from 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) excluded flag and applied via two entity maps in calculatePlayerAndSquadAggregates: excluded players vanish from the player leaderboard but still count toward squad_stats (matching legacy getSquadInfo). Bounty drops excluded players (player-attributed; not parity-compared).

Aggregate Legacy This PR
player_stats (all-time + per-rotation) excluded excluded
squad_stats kept kept
bounty_points n/a excluded
commander_side_stats n/a unaffected

Name match replicates legacy getPlayerName (strip [...], case-insensitive); interval inclusive [minDate ?? -inf, maxDate ?? +inf].

Tests

New pure exclude-players module (100% branch); unit test for excluded-in-squad behavior; real-pg integration (excluded player dropped, victim's death survives, squad still counts them). pnpm verify green, 100% coverage.

🤖 Generated with Claude Code

Afgan0r and others added 2 commits June 15, 2026 22:07
…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>
@Afgan0r Afgan0r merged commit e956f50 into master Jun 15, 2026
3 checks passed
@Afgan0r Afgan0r deleted the fix/f9-exclude-players branch June 15, 2026 16:09
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.

1 participant