Commit Graph

73 Commits

Author SHA1 Message Date
NilsBriggen a1fb6d48c0 Fan Tier 2: venue pages, attack zones, broadcasts, push prefs, squads + UI/UX polish
Features (all from already-stored data):
- Venue pages: /venues hub + /venue/:name with each stadium's schedule,
  altitude badge (>1000 m), local timezone. Linked from the match hero,
  nav More sheet, and footer.
- Attacking-zones card on the match Stats tab (left/center/right share per
  side, from the stored FotMob payload).
- US broadcast networks on the pre-match hero (SUMMARY_V 6).
- Notification preferences: follow multiple teams + an all-matches feed
  ('*'); push_subs keyed by (endpoint, team) with a safe one-time migration;
  device drops its browser subscription only when the last follow is removed.
- FIFA tournament squad card on team pages (26-man list, position groups).
- Player match logs now show DNP rows for unused-squad appearances.
- OG/share meta for /player and /venue.

Polish (adversarial audit: 25 confirmed findings, all fixed):
- Mobile horizontal-scroll eliminated on /teams and /venues (grid-item
  min-w-0 blowout); two-line venue fixture rows.
- Truncation actually fires now across team fixtures, road-to-final,
  recent-form, H2H meetings, venue rows (min-w-0 on flex children).
- Team hero no longer detaches the standing block on wrap; bell denied-state
  no longer overflows the h1.
- AllMatchesBell: 36px touch target, aria-label, own i18n key, even rhythm.
- Server hardening: cached player index (one cross-fixture scan, not per
  request), migration rollback guard, 400 (not 500) on malformed name URLs,
  all-zero zones render nothing, tidyName fixes shouted particles (DE→De).
- German polish: removed stray English ("anytime", "Build-Geocode"), clearer
  squad note.

Gates: 170 tests, build, typecheck:server — all green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 10:05:27 +02:00
NilsBriggen 0fd13d4c24 Players become first-class: profile pages, unified names, deeper match data
- /player/:name pages assembled entirely from stored data: tournament
  totals, per-match log (rating, minutes, G/A, cards), aggregated shot
  map, suspension status, next-match scorer line. Either source's
  spelling resolves to the same page (token-set + romanization fold).
- Player names are now links everywhere: stats boards, golden boot,
  discipline, injuries, all-time scorers, lineups, the pitch dots,
  timeline events and assists, and the search palette (diacritic-folded).
- Golden Boot displays the FotMob form of each name — no more
  "Hwang In-Beom" and "In-Beom Hwang" on the same page.
- Match pages: detailed full-time stats card (passes, duels, xGOT… from
  the stored FotMob report), O/U + spread closing line, "Who scores?"
  pre-match props board, and a FIFA-confirmed-lineups badge.
- Stats hub: new boards — xA, chances created, save percentage, saves
  per 90.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 00:54:58 +02:00
NilsBriggen f0e0f7390d Tier 2: shootout panel, road to the final, ESPN videos, ICS export, injuries plumbing
- Penalty shootout panel: shootout-flagged events get a kicker-by-kicker
  dot strip on the Summary tab (and stay OFF the timeline/running score).
  Parsing is defensive — validate against the first real shootout June 28.
- Road to the final on team profiles: the model's projected knockout run
  (teamPath in whatif.ts forces the team through the model bracket) with
  per-round reach probabilities and a title-chance chip. Teams the model
  doesn't project through still get a hypothetical runner-up road.
- Match videos: ESPN summaries carry per-match clips (SUMMARY_V=5 keeps
  headline/duration/thumbnail/link) — a Videos card on the Summary tab,
  clips open on ESPN. Tokenless; replaces the parked ScoreBat idea.
- ICS calendar export: /api/calendar.ics[?team=X] (RFC 5545, escaped,
  folded, CRLF) + an Add-to-calendar chip on team pages.
- Injuries plumbing (dormant until API_FOOTBALL_KEY is set): twice-daily
  API-Football sweep into the injuries table, surfaced on team profiles
  and the match availability banner next to suspensions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 15:57:17 +02:00
NilsBriggen f2203ed4a4 Tournament stats hub, suspension tracker, card-aware live probabilities
- /stats: FotMob tournament boards (goals/assists/rating/xG player+team
  categories from the data.fotmob.com CDN, capture-first via scheduler),
  Golden Boot race with DraftKings anytime-line benchmark from the
  already-captured scorer props, and an attack-vs-defence xG scatter.
- Discipline engine (src/lib/discipline.ts): FIFA suspension rules folded
  from stored event feeds — red/second-yellow bans, two-yellow accumulation,
  post-QF wipe. Surfaces on /stats, team profiles and match lineups tabs.
- In-play win probability now accounts for red cards (10 men: own rate
  x0.67, opponent x1.15 per card) on the server tick and the match page.
- Fix ModelDiary infinite render loop (unstable zustand snapshot while the
  model loads crashed the Methodology route under React 19).
- Drop dead tables squad + goalscorers; scorer_props is now read.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 15:42:00 +02:00
NilsBriggen 9e1f6e5cee Cleaner event panels: hide raw feed prose, one best report sentence
- the ESPN feed description and attribution line are gone from goal
  panels whenever the report narrative or shot data tells the story
  (attribution lives in a tooltip); bookings keep their reason line
- one report sentence per event, ranked by event vocabulary with a
  bonus when the player is the actor ('Quinones, who drove a low
  shot…' beats 'goals from Quinones and Jimenez gave…')
- momentum verdicts only ever applied to goals (a clear-pressure
  booking no longer claims it was 'scored against the run of play')

Routine events the report never mentions (e.g. an early booking) show
what the sources have: the reason. There is no richer feed for those.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 14:41:27 +02:00
NilsBriggen 2d52995967 The why behind events: narrative context from the match report
'X is shown the red card' explains nothing. ESPN's summary carries the
full post-match report (Reuters-style narrative) that we fetched and
discarded — it has exactly the missing why ('red-carded for bringing
down Gutierrez just outside the box').

- normalizer keeps the report (headline + plain-text story, schema v4;
  boot backfill re-stores played matches automatically)
- expanding an event surfaces the report sentences about that player,
  scored by event vocabulary so a player's sending-off sentence beats
  his goal mention; attribution line marks the source
- the raw no-reason fallback line is suppressed once the report
  explains a booking; xG/momentum/VAR layers stay underneath

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 14:16:59 +02:00
NilsBriggen 089d789e49 Event context from data, not adjacent feed lines
The buildup timeline mostly surfaced unrelated events (a substitution
before a goal explains nothing). Replaced with the sources that
actually describe the event:

- goals match to their captured shot: situation (corner / counter /
  set piece / penalty), distance to goal, xG as a plain-language
  chance percentage, and xGOT for the finish quality
- the attack-momentum curve judges whether the goal came with or
  against the run of play (prior five minutes, only when clear-cut)
- VAR / video-review feed lines still surface on the matching event —
  the one slice of play-by-play that genuinely explains a decision
- the feed's action description stays as the de-emphasized last line,
  with the redundant scorer prefix stripped; booking reasons unchanged
- name matching shared from the lineup pitch (diacritic/order-proof),
  with a unique same-side-and-minute fallback

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 14:03:54 +02:00
NilsBriggen 15d955e65c Starters-on-pitch, chart movers sort, pre-filled what-if bracket, vs/@ fix
- Finished matches show the STARTING XIs on the pitch (red markers with
  the minute on everyone subbed off) with 'Subbed on' / 'Subbed off'
  lists below, minutes and ratings included; live matches keep the
  current-XI view that swaps substitutes in
- Title-race chart gets a sort toggle, defaulting to 'Biggest movers'
  (the teams whose odds changed most at the latest update — what's
  relevant now) with 'Title favorites' as the alternative
- Entering what-if on the bracket now pre-fills the model's most likely
  tournament: group slots seeded from win-group/advance odds (best-
  thirds assigned to their allowed slots via backtracking), every
  pairing picked by the model — a complete overview to edit by tapping;
  Reset returns to the projection
- Team fixtures drop the US 'vs/@' convention: always 'vs' plus an H/A
  badge with a tooltip

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:46:27 +02:00
NilsBriggen f78f599ed2 Richer event context: buildup lines from the full play-by-play feed
'X is shown a red card' alone isn't insight — the story is in the
surrounding plays. The ESPN summary carries a ~110-line play-by-play
feed (attempts, fouls, corners, VAR checks) we cached but never used:

- normalizer keeps a trimmed commentary list (schema v3; the boot
  backfill re-stores older matches automatically)
- previews serve it; expanding a timeline event now shows up to four
  feed lines from the three minutes leading in, then the event's own
  description — e.g. Korea's saved attempt and corner right before
  Czechia's counter-goal header, or the foul behind a booking

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:30:27 +02:00
NilsBriggen 0e2e1dc44f Tap-to-expand context on timeline events
Goals and bookings on the match timeline now expand on tap/click (or
Enter/Space) to show what actually happened, parsed from the live
feed's commentary: the shot description for goals ('header from very
close range to the bottom right corner…') and the reason for cards
('For a bad foul.'). A chevron marks expandable rows; substitutions
and neutral rows carry nothing extra so they stay inert. Works on both
the center-spine and the mobile rail layouts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:20:25 +02:00
NilsBriggen 3d3267d803 Show the predicted scoreline, not decimal expected goals
Coming-up cards and the post-match comparison now use the model's most
likely score ('2-0') instead of decimal goal expectations ('2.3-0.4');
the pre-match model card keeps just the honesty note since the bar's
chip already carries the predicted scoreline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:14:08 +02:00
NilsBriggen e85053aa0a Predicted lineups, predicted-vs-actual goals, and goals on upcoming cards
- Scheduler now captures FotMob details for fixtures inside 48h, so the
  projected XIs exist before kickoff; the Lineups tab shows the pitch
  pre-match under a 'Predicted lineups' header with an honest note
  (official lineups ~1h before kickoff), switching to the confirmed
  view at kickoff
- Finished matches get their forecast back: the preview falls back to
  the prediction frozen <=15min before kickoff (the scoreboard's
  no-hindsight snapshot), with the most-likely-score chip rebuilt from
  the frozen expected goals; the model card now reads 'Model's
  pre-match expected goals: 1.60 - 1.02 · final score 2-1', and the
  market-movement chart returns to finished matches too
- Upcoming match cards append the model's expected goals to the hint:
  'Model: Brazil 64% · 1.3-0.9 goals'

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:04:13 +02:00
NilsBriggen b552bc8ba9 Fix title-race chart: persist the diary, dedupe restarts, date axis
The chart looked broken because its data was: history lived in memory,
so every deploy wiped it (yesterday's points were gone), and each boot
plus the +5min refit appended a fresh point labeled with the same last
result — leaving two identical flat segments on an index axis.

- model_history table: every diary point persists with the finished-
  result signature it was computed from; restored at boot
- points only append when the finished set actually changes — refit
  and boot recomputes update the snapshot without spamming the diary
- one-time rebuild when nothing is persisted: replay finished results
  in kickoff order, re-running the sim after each with later results
  masked, so the historical points are recreated faithfully
- chart x-axis shows localized dates instead of raw indices

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:26:33 +02:00
NilsBriggen 1ffa9fba36 Lineup pitch: breathing room — no more overlapping parts
The to-scale pitch was the problem: eleven rows of dots, names and
chips can't fit 105x68 proportions. Now:
- canvas stretched both ways (84x132) like every lineup UI
- rows re-spread evenly per team (keeper pinned at the goal, outfield
  spans the half) instead of FotMob's bunched raw coordinates
- rating chips point toward the pitch center and are sized so two
  facing chips across the halfway column can never touch; sub markers
  point outward so nothing clips the touchlines
- keeper names sit beside the dot — their row is always alone, and the
  name was colliding with the back line either side of the goal
- goal badge moved onto the dot rim on the marker side

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:15:53 +02:00
NilsBriggen 09c543b009 Lineup pitch with live substitution tracking + polish pass
- LineupPitch: both XIs on a vertical pitch at FotMob's per-player
  formation coordinates — shirt numbers, live ratings, goal badges,
  formation + coach labels. Substitutes take over the outgoing player's
  slot (paired through ESPN's 'X replaces Y' commentary with a unique
  same-minute fallback — the sources romanize names differently), with
  a subbed-off strip below; the page's live refetch keeps it current
  through the match. Falls back to the list view (and hides predicted
  pre-kickoff XIs) when no confirmed lineup is captured.
- /api/match-rich now serves the trimmed FotMob lineup (only complete,
  fully-positioned XIs)
- Fix: vs-Market label box was too narrow — the probability bar covered
  the end of 'DraftKings'
- Timeline spine no longer runs past the kick-off/full-time pills

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:02:49 +02:00
NilsBriggen 4faedd60c4 Surrounding screens refresh: live hero, row-style match cards, form bars, unified bracket
Design handoff steps 4-5:
- LivePage: headline live-match hero (gradient card, live ring, smallcaps
  stage/venue + minute, big mono score, 3-segment in-play win-prob bar);
  favorite team's live match takes the hero slot
- MatchCard: played matches as stacked team rows with the beaten side
  dimmed; scheduled matches as a centered 'vs' pairing (model hint and
  venue stay)
- GroupTable: Form column — tiny W/D/L bars (accent/gold/loss) computed
  from finished group matches
- BracketPage: one round-selector layout on every screen size (cards in
  a 2-col grid, losers dimmed), gold 'Projected champion' banner on the
  Final view; what-if mode, advance bars, R32 and the third-place
  play-off all unchanged
- Predict title race: leader bar, rank and percentage in gold

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 11:37:06 +02:00
NilsBriggen d1d294da5d Untrack local DB archive snapshots; ignore data/archive
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 11:20:51 +02:00
NilsBriggen b9b79df51e Match center redesign: center-spine timeline + hero scoreboard + tabbed layout
Implements steps 1-3 of the Claude Design handoff:
- MatchTimeline: vertical center spine (home left, away right, minute
  pills on the rail), goal cards with parsed scorer/assist/running
  score, sub and booking chips, synthetic kick-off/half-time/full-time
  dividers; single left rail under the sm breakpoint
- matchEvents: pure ESPN commentary parser (scorer, assist, penalty,
  own goal, sub in/out, embedded score) with tests on real feed shapes
- Hero scoreboard: panel gradient + accent glow, smallcaps meta, mono
  score, stat chips (xG / POTM / attendance / referee; possession and
  shots while live); weather line stays for upcoming matches
- Sticky Summary/Timeline/Stats/Lineups sub-nav; all existing cards
  re-bucketed with no feature loss (in-play win prob, swing chart,
  xG race, shot map, momentum, odds movement, form, H2H, lineups)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 11:19:16 +02:00
NilsBriggen b823bef2d0 Match center v2: xG race, shot map, attack momentum, weather, officials
The captured FotMob/FIFA/Open-Meteo data becomes visible. Match pages
now carry: a cumulative xG race with goal dots and team totals, a full-
pitch shot map (each side attacking its own end, dots sized by xG,
goals filled), the 90-minute attack-momentum chart, player-of-the-match
with rating, the official info line (stadium · attendance · referee),
and a kickoff-hour weather line for upcoming matches with an altitude
chip above 1,000m. All hand-rolled SVG on the existing token
conventions — design-ready for the upcoming visual overhaul. EN/DE
included, with an honest 'xG and ratings are FotMob estimates' note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 10:10:35 +02:00
NilsBriggen b2f680906b Match-rich API: oriented shots/xG, momentum, POTM, officials, weather
GET /api/match-rich/:num projects the captured provider data for the
match center: every shot with pitch coords and xG oriented to
home/away (FotMob payloads now carry team ids, v2 + settle-versioned
refetch), team xG sums, the momentum curve, player of the match with
rating, FIFA's official attendance/stadium/referee, and kickoff-hour
weather. Verified on real data: South Korea 2.31-0.83 Czechia on 22
oriented shots, POTM Hwang 8.9, referee Amin Mohamed Omar.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 09:30:34 +02:00
NilsBriggen 94db4274a0 Results backfill: ESPN dates are US-Eastern — fetch both candidates
The first heal attempt missed both matches: a 02:00 UTC kickoff files
under the PREVIOUS day in ESPN's ?dates= param (ET-based), and the
backfill skipped today's UTC date entirely. Now any started-but-
forgotten fixture triggers fetches for its UTC date and the day
before, covering the ET offset in both directions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 09:25:45 +02:00
NilsBriggen 66cbbc3dde Self-healing results backfill: re-fetch past match days at boot
The persistence table shipped empty just as ESPN's default scoreboard
window rolled past matchday 1 — prod forgot both results. Rather than
patching the DB by hand, boot now re-fetches the date-scoped
scoreboard for any past day whose fixtures still look scheduled and
merges + persists the results. Heals fresh databases and any future
data loss the same way.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 09:22:24 +02:00
NilsBriggen 517a86233a v2 Phase D: capture-first ingestion — FotMob, FIFA, weather, scorer props
Four new feeds, all verified against real tournament matches:
- FotMob (unofficial, works from the VPS again): per-shot xG/xGOT with
  pitch coords, team xG, player ratings, POTM, momentum, attacking
  zones — trimmed payloads (~87KB/match) on a gentle 90s-live/30m-idle
  cadence. Capture-first: this source could lock again any day.
- FIFA official v3: confirmed lineups with player IDs, typed XY event
  timelines (80 events for the opener), attendance + named referees,
  tactics — id-mapped via the calendar, hot while live.
- Open-Meteo: kickoff-hour weather per venue from a build-time geocoded
  venues.json (with elevation — Azteca 2,240m); fetched in the enrich
  loop inside the 48h horizon.
- DraftKings scorer props (first/last/anytime goalscorer per athlete)
  via ESPN's core propBets, insert-if-changed line history, athlete
  names resolved through a 30-day cache.

Also fixes a real resilience gap found along the way: fixture results
now persist in SQLite and restore at boot — previously a restart after
ESPN's scoreboard window moved on would silently forget a match day
(standings, model and scoreboard would all regress).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 09:19:10 +02:00
NilsBriggen ae984bba7b v2 plan: the data leap — recon-verified sources, model and feature phases
Six-source reconnaissance from both vantage points found the v3-era
blockers gone: FotMob serves full xG/shotmaps/player-ratings from the
VPS with no signed header, and FIFA's official v3 API (lineups with
player IDs + headshots, XY timelines, attendance) is open too. The
plan: capture-first ingestion (FotMob/FIFA/ESPN-deep/weather), four
CV-gated model experiments (xG-informed Team-DC, lineup-aware refresh,
bias-corrected in-play, a scorer model benchmarked against DraftKings
props), and a feature tier built on it — with explicit design-handoff
slots for the visual overhaul arriving from Claude Design.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 09:00:51 +02:00
NilsBriggen 27897f048f Boot order: live scores first, slow sweeps after
A restart during a live match sat behind the multi-minute odds sweep
before the first scoreboard poll. The live loop now starts immediately
after fixture mapping; odds/backfill/enrich follow on their own
rate-limit keys.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:27:02 +02:00
NilsBriggen 74b6b7b77f Best-thirds race: the cross-group table nobody can track by eye
All twelve third-placed teams ranked by points/GD/goals under the
group grid — top 8 highlighted (they reach the Round of 32), the rest
dimmed. Appears once group play has started.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:24:49 +02:00
NilsBriggen 04dfad1a26 Refit Team-DC once more after boot ingestion settles
The boot refit fires before live state is restored, so restarts lost
this tournament's matches from the fit until the nightly timer. A
one-shot follow-up at +5 minutes closes the gap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:22:38 +02:00
NilsBriggen 03b0fa734e Web Push: goal, kickoff and full-time alerts for a followed team
Fully progressive: without VAPID keys in the environment the API says
404, the bell never renders, and the service worker addition (a push
handler via workbox importScripts — no SW strategy change) is inert.
With keys: a bell on each team page requests permission, subscribes
(one team per device) and the server diffs fixture states on every
broadcast to push Kickoff / Goal / Full time to that team's followers.
Dead endpoints (404/410) self-clean. Round-trip verified locally with
dev VAPID keys; disabled mode verified too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:21:55 +02:00
NilsBriggen ce83d4dbc4 Golden Boot race from structured ESPN scoring plays
ESPN's keyEvents carry participants[].athlete for goals — no text
parsing needed. The normalizer now extracts scorer/scoring/shootout
(payload versioned, with a boot backfill that re-stores summaries
saved by the old normalizer), /api/goldenboot aggregates per-player
goals (own goals and shootout kicks excluded), and the Teams page
leads with the top-10 race. Verified against tonight's real goals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:18:19 +02:00
NilsBriggen 06e4835ad4 Route-level code splitting for the heavy, less-trafficked pages
Story, Methodology, Data and Compare load as their own chunks via
lazyRouteComponent (prefetched on intent) — the main bundle drops ~10%
and hot paths (Live, match, team) stay eager.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:16:53 +02:00
NilsBriggen b59a10eceb V5 plan: record what shipped and what's deferred, with cause
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:24:55 +02:00
NilsBriggen 5f32d1657f a11y: probability bars carry their numbers for screen readers
The model/market split stays readable when the numeric triple is
hidden on narrow screens (title + aria-label on the bar row).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:23:41 +02:00
NilsBriggen 9aea49ba42 Shared links unfurl: per-route OG meta for match and team pages
Crawler-visible <title> + og:title/description are injected into the
SPA shell server-side: match links carry the score or the model's
probability split, team links the current title odds — honest framing
included. Plain shell for every other route.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:22:36 +02:00
NilsBriggen 64f5d28e1a Fix offline banner: Snapshot's timestamp field is updatedAt
The previous commit referenced a non-existent generatedAt and slipped
past a grep-based gate (grep exit 0 on finding the error). Build gate
checked by exit code from here on.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:20:50 +02:00
NilsBriggen 7882c9af01 Offline banner: say how old the data is instead of failing silently
When the live connection drops, a slim notice under the header shows
the timestamp of the last snapshot — the page keeps working from it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:20:18 +02:00
NilsBriggen 17ec56bceb Model diary: a transparency log of every model update
The Methodology page lists each recompute (the finished match that
triggered it) with the biggest title-odds move it caused — the model's
thinking made visible, feeding the openness story.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:19:37 +02:00
NilsBriggen 343a3e1829 Compare page: any two teams, model matchup + 150-year record
/compare (also in the mobile More sheet): pick any two of the 48 —
defaults to the top title favourites — and get the model's
neutral-ground matchup plus the full head-to-head from the historical
archive (wins/draws/goals and the last six meetings).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:18:07 +02:00
NilsBriggen b61d839c8e Daily digest on the Live tab: yesterday's results + title-odds movers
A compact card up top: yesterday's scores at a glance and the teams
whose championship odds moved most over the last day (from the model's
recompute history), with up/down trends linking through to team pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:14:56 +02:00
NilsBriggen a91f7902e4 Global search: Cmd/Ctrl-K palette for teams and matches
A keyboard-first palette (plus a header button) that jumps to any team
page or match page — arrow keys, enter, esc; flags and kickoff days in
the results. Pure client, searches the snapshot already in memory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:13:57 +02:00
NilsBriggen 047e9f8767 Elo trajectories: a century of strength on every team page
buildRatings samples each WC team's rating along the full walk (yearly
historically, monthly since 2022) into elohistory.json (~72KB, 48
teams). Team pages plot it as a clean SVG line with year and rating
gridlines — Germany's century, 1908 → today, in one glance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:12:36 +02:00
NilsBriggen f58d6566fb Upset meter: the results the model found least likely
The scoreboard gains a Biggest surprises card — finished matches whose
actual outcome the frozen model priced under 30%, sorted by shock
value, each linking to its match page. Pure client derivation from
data the scoreboard already had.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:10:02 +02:00
NilsBriggen 88afbfad74 Isotonic calibration layer — validated leave-one-fold-out, shipped
The CV harness gained a calibration experiment: per-outcome isotonic
maps (pool-adjacent-violators) fit walk-forward on the five folds and
judged leave-one-fold-out against a pre-registered bar. It cleared it:
LOFO ECE improves 16% (0.0146 → 0.0122) with RPS slightly better too
(0.1724 → 0.1722). The final maps (fit on all folds) are committed as
a research artifact, embedded into ratings.json by buildRatings when
the shipped config matches, and applied in matchMatrix by scaling the
score-matrix outcome regions — scorelines, Monte Carlo and displayed
probabilities all stay mutually consistent. Without the field, output
is bit-identical (golden tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:08:20 +02:00
NilsBriggen 005b4d72ca Group qualification scenarios: who's through, who needs what
Once a group reaches its closing stretch (≤3 open matches), every
remaining win/draw/loss combination is enumerated and ranked with the
real tiebreaker logic. Under each table: Top 2 secured / Top 2 with a
win / Still possible (n of N outcomes) / Can't reach the top 2 — with
an honest footnote that tight cases hinge on goal difference and third
place runs through the cross-group best-thirds race. Pure, tested
enumeration in src/lib/scenarios.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:01:42 +02:00
NilsBriggen 8e6c9416fa Favorite team: star a side, get its next match pinned on Live
A star on the team page (localStorage, no accounts) pins that team's
next or running match in a My team section at the top of the Live tab.
EN/DE strings + aria-pressed on the toggle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:59:15 +02:00
NilsBriggen c2f4b4be83 Bracket what-if mode: pick winners, watch the tree fill
A wand toggle turns the bracket interactive: tap a side to send that
team through; W/L placeholders resolve down the tree (pure, tested
logic in src/lib/whatif.ts). Real results always override picks; picks
that stop making sense after an upstream change are pruned. Each open
pairing shows the model's advance probability (ratings.json fetched
lazily), and once your final resolves, a summary banner names your
champion with the model's chance of exactly that run. EN/DE included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:58:01 +02:00
NilsBriggen ec185b5918 Market-movement chart: the bookmaker line vs our model, per match
The odds history we have been capturing every 3h finally gets a face:
de-vigged DraftKings probabilities drift as solid lines toward
kickoff, with the model's numbers as dashed references — the honest
benchmark framing, right on the match page. Renders only when at least
two pre-kickoff lines exist. EN/DE copy included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:53:42 +02:00
NilsBriggen cbc5ff0468 In-play win-probability timeline: the momentum curve on match pages
While a match runs, every poll records the in-play model probability
per game state (insert-if-new on minute+score) into inplay_history.
The match page draws it as a stacked area chart — home fills from the
bottom, away from the top, the gap is the draw — with minute ticks and
a 50% guide. Shows live (under the win-probability bar) and after full
time as its own card. EN/DE strings included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:50:56 +02:00
NilsBriggen acd8c3e75d v5 model protocol: rolling-origin CV search harness
Five two-year walk-forward folds (2014-2024), each with its own
pre-fold parameter fit; selection by mean fold RPS; staged greedy over
Team-DC decay/shrinkage/weight, fast-Elo blend, form multiplier, and
new Elo-walk axes (home advantage, K scale); untouched 2024-26 final
test. Result: the shipped v4 config holds — the staged champion gained
0.0003, under the 0.0005 ship bar, and the final test agrees. v4 is no
longer a one-window result.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:41:37 +02:00
NilsBriggen 2c945dfd54 Snapshot via local temp + plain copy — CIFS can't host VACUUM INTO
The first prod snapshot landed as a 0-byte file with a stale journal:
SQLite needs byte-range locking on the VACUUM INTO destination, which
the CIFS storage box refuses. Now: vacuum into a local temp file, then
a plain sequential copy to the archive (always CIFS-safe), cleaning up
the temp and any leftover journal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:40:44 +02:00
NilsBriggen ac1de66e6d Nightly DB snapshots to the 1TB storage box (live DB stays local)
The 'external drive' turned out to be a CIFS-mounted Hetzner storage
box — SQLite cannot run on a network mount (WAL shared memory and
locking break), and the live DB is only ~7MB anyway. So: the hot
database stays on the local volume, and a nightly VACUUM INTO snapshot
(transactionally consistent, a plain sequential file write — perfect
for CIFS) lands in /data/archive, which compose binds to the storage
box via HOST_ARCHIVE_DIR. 14-day retention, plus a snapshot at boot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:36:05 +02:00