Skip to content

Standings history for current_rating-ranked tournaments - #308

Merged
amrtgaber merged 2 commits into
mainfrom
current-mode-history
Jul 26, 2026
Merged

Standings history for current_rating-ranked tournaments#308
amrtgaber merged 2 commits into
mainfrom
current-mode-history

Conversation

@amrtgaber

@amrtgaber amrtgaber commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #305: /standings/history now serves current_rating-ranked tournaments — the 501 guard is gone, completing the rank_by feature surface (#290).

The sweep gains a second value-resolution mode alongside the peak ratchet, reusing all shared machinery (daily anchors + reorder-stamped buckets, roster visibility gating, team series, response shape):

  • Last-value semantics: an entrant's as-of-bucket current rating is the latest recorded value at-or-before the bucket — the in-window match log (points at completion time) merged with the snapshot observations (recorded on every current change since Per-tournament scoring config: rank_by (peak_rating | current_rating) #290), with the log winning ties, mirroring _frozen_current_by_profile's precedence. Non-monotone by nature: declines chart as declines.
  • Exact-first baseline, no reconstruction fold: the rating held entering the window (the first in-window game's old_rating — exact, games are the only mover) → else the latest pre-start observation → else earliest in-window observation carried back → else a flat line at live current_rating (the recorder's self-seeding argument). Current-mode tournaments postdate the Per-tournament scoring config: rank_by (peak_rating | current_rating) #290 recorder, so observation coverage is complete from first poll — none of the peak mode's log-reconstruction (#357) is needed.
  • No clamp: the live clamp exists for rebased-away peak noise; current has no such invariant. The peak path is byte-identical (its pre-event-peak query is now skipped in current mode — one query saved).
  • Ranking per bucket: as-of-bucket current desc, live max_rating desc (static tiebreak), name — the live table's current-mode order, so the final bucket provably matches /standings.

Contract (additive): StandingHistoryPoint.current_rating and TeamStandingHistoryPoint.combined_current_elo — exactly one of the two rating fields per point is populated, matching rank_by (the same split as the summary's rating cards); combined_peak_elo becomes nullable but is always populated in peak mode, so existing consumers see identical bytes. Consumers regenerate orval clients.

Tests

594 passed. New: a decline charts as a decline with the reorder captured (the case peak mode can't express); final bucket equals the live /standings current-mode order; baselines hold before the first data point (entry old_rating exact for a player with games, carried-back observation for a snapshot-only player); team series sums current with null peak fields. The five existing peak-mode whole-point assertions updated for the additive null keys — peak values and positions unchanged.

Closes #305

@amrtgaber
amrtgaber merged commit 55e8b77 into main Jul 26, 2026
3 checks passed
@amrtgaber
amrtgaber deleted the current-mode-history branch July 26, 2026 04: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.

Standings history sweep for current_rating-ranked tournaments

1 participant