Skip to content

Data Audit

Jens Gross edited this page Oct 1, 2026 · 1 revision

Data Audit

The Data Audit page at /admin/data-audit (sidebar group Data) checks the stored league data for inconsistencies that older versions could write. It only reads. Opening the page runs the audit in a read-only transaction and changes no record, no slug and no Discord state.

A green build does not show that historical data is correct. Open the page after each update that fixes a consistency rule, and before any repair.

Running it

  1. Open Data → Data Audit. The page runs the audit on every load.
  2. Read the summary: the number of findings per resolution.
  3. Work through the sections. Each one names the issues whose fixes it depends on.

On production the page follows the same admin login as every other admin page. No setting enables or disables it.

Report format

Each finding has four columns:

Column Content
Record The affected match, leg, matchday, roster place, team, playoff matchup or URL, with its id
Resolution How the correction can be found (see below)
Evidence The stored values that contradict each other
Proposed correction What a later, reviewed repair would change

Resolutions:

  • Reconstructible from authoritative data: the correct value follows from other stored data, for example match totals from the scored legs. Recomputing it is a later action that still needs a review.
  • Needs an individual decision: the data allows more than one correct answer, for example which of two matches for the same pairing keeps the results.
  • Cannot be inferred; do not invent a value: a legacy playoff decision made before outcomes were recorded. Keep the recorded winner, and add a reason only from league records.

Sections

Section Checks
Stale match and matchup aggregates Stored totals that differ from the scored legs; stored totals without any scored leg (quick score or legacy); decided matchups whose totals are stale
Duplicate and reversed pairings Several matches of two teams on one matchday, in either orientation; legs whose orientation does not swap the match teams
Phase and group inconsistencies Matchdays and roster places in a group of another phase; roster places of teams outside the season; matches of teams off the phase roster or outside their group; phases with matches but no roster; legs on another matchday than their match, in two containers, or outside the playoff's phase
Succession collisions and cycles Succession cycles; successors from another season; several teams replaced by one; replaced teams that still hold a roster place
Playoff winners and advancement Winners that are not participants; legacy decisions; winners that trail without a reason; winners that did not advance or were replaced in the next slot; slots filled from undecided matchups; decided matchups after undecided ones; wrong round links; shared bracket positions; inconsistent byes and walkovers
Ambiguous public URLs Base slugs shared by several profiles; slugs of deleted profiles; profiles without a stored slug that collide

Repairs

The audit proposes corrections but never applies them. Make an unambiguous correction through the normal admin pages, for example by re-saving a race's results. Repair ambiguous records only after a decision for each record. Keep the original race and driver history and the previous values; the audit itself does not keep a history.

Clone this wiki locally