Vocabulary follows CONTEXT.md (Match, Format, Placement, Top N, Win, Challenge, Completed, Attempt, First Try, Season, Account, Official Progress). Decisions already recorded: ADR-0001 (two data sources), ADR-0002 (GPUI through gpui-kit), ADR-0003 (build with the Windows toolchain from WSL).
Problem Statement
I play League of Legends Arena with a personal goal: get a top 1 with every champion in the game, in as few games as possible. The game client only shows me a single number per Season (how many champions it considers completed). It does not tell me which champions are left, how many games each champion cost me, which ones I got on the first try, or which ones I keep failing on. Its match history only goes back 20 games, so I cannot reconstruct any of this by hand. During champ select I have to pick from memory, without knowing which available champions still count for my goal or how many games I have already sunk into the one I am hovering.
Solution
A Windows desktop app that keeps a complete local record of my Arena Matches and turns it into a view of my Challenge.
It imports my whole Arena history from the Riot API and keeps it up to date, following whichever Account is signed in to the game client.
Its main page shows the Challenge for the current Season: champions Completed out of the total, the total number of Attempts spent, the average Attempts per Completed champion and how many were a First Try, with small charts and a sortable table of every champion.
During an Arena champ select, the window switches to a view of my statistics on the champion I am picking and the pickable champions I have not Completed yet.
The app only reads. It never acts in the game client.
User Stories
Challenge progress
As an Arena player, I want to see how many champions are Completed out of all champions in the game for the current Season, so that I know how far along my Challenge is.
As an Arena player, I want a champion to become Completed as soon as I have one top 1 with it in the Season, in any Format, so that the app counts the same way the game client does.
As an Arena player, I want the Challenge total to include every champion in the game at the current patch, so that a newly released champion shows up as remaining.
As an Arena player, I want the Challenge to start again from zero each Season, so that it mirrors the reset in the game.
As an Arena player, I want to open a past Season and see its Challenge as it ended, so that I can compare Seasons.
As an Arena player, I want the app to compare its count of Completed champions with the game's Official Progress, so that I am told when the two disagree.
As an Arena player, I want a visible notice when the app's count and the Official Progress differ, with both numbers, so that I know my data may be incomplete.
Attempts and difficulty
As an Arena player, I want each champion to show its number of Attempts, so that I can see how hard it was to complete.
As an Arena player, I want Attempts to count my Matches with a champion in the Season up to and including its first top 1, so that the number means "games it took".
As an Arena player, I want Matches played with a champion after it is Completed not to count as Attempts, so that replaying a champion for fun does not hurt my Challenge.
As an Arena player, I want a champion I have played without a top 1 to show its Attempts so far as "in progress", so that I can tell it apart from a champion I never played.
As an Arena player, I want to see the total Attempts spent on the Challenge, including those on champions not yet Completed, so that I have one figure for my overall efficiency.
As an Arena player, I want to see the average Attempts per Completed champion, so that I can judge how close I am to the ideal of 1.
As an Arena player, I want to see how many champions were a First Try, so that I can see how often I succeed immediately.
As an Arena player, I want to sort the champion table by Attempts, so that my hardest champions come to the top.
Statistics page
As an Arena player, I want the app to open on the statistics page for the current Season, so that I see my Challenge without navigating.
As an Arena player, I want a table with one row per champion in the game, so that champions I never played are visible too.
As an Arena player, I want each row to show number of Matches, best Placement, number of top 1, number of Wins, average Placement, Attempts and date of the last Match, so that I have the full picture per champion.
As an Arena player, I want to sort the table by any column, so that I can explore it my own way.
As an Arena player, I want to filter the table to Completed, remaining or never-played champions, so that I can focus on what is left.
As an Arena player, I want to filter statistics by Format, so that I can look at Arena 3x6 separately from Bravery Arena, knowing this does not split the Challenge.
As an Arena player, I want to switch between the current Season, a past Season and all Seasons, so that I can see both my current run and my lifetime statistics.
As an Arena player, I want a small chart of how my Placements are distributed, so that I can see at a glance how often I finish first, second and so on.
As an Arena player, I want a small chart of Completed champions over time, so that I can see the pace of my Challenge.
As an Arena player, I want a small chart of how many champions were Completed in 1, 2, 3, 4, or 5 and more Attempts, so that I can see how much of my Challenge was easy or hard.
As an Arena player, I want champion names and portraits in the table, so that I can recognise champions quickly.
As a French-speaking player, I want the interface in French, so that it reads naturally to me.
History and synchronisation
As an Arena player, I want the app to import all my past Arena Matches that the Riot API still holds, so that my Challenge does not start empty.
As an Arena player, I want each Match assigned to a Season by its date, so that past Seasons are reconstructed correctly.
As an Arena player, I want the app to fetch the Matches I played while it was closed when I next start it, so that I never have a gap.
As an Arena player, I want a Match to appear shortly after it ends when the app is open, so that the page updates without my doing anything.
As an Arena player, I want a refresh button, so that I can force an update when I think something is missing.
As an Arena player, I want a long import to show progress and to resume where it stopped if interrupted, so that the first launch is not a black box.
As an Arena player, I want the app to work on my stored Matches when I have no network, the Riot API is down or the game client is closed, so that I can always consult my statistics.
As an Arena player, I want a clear banner when the app cannot update, saying why, so that I do not mistake stale data for current data.
As an Arena player, I want the same Match never to be counted twice, so that my statistics stay correct however often I sync.
As an Arena player, I want the Season boundaries shipped with the app and editable by me, so that I can correct or add a Season without waiting for a new version.
Accounts
As a player with several Accounts, I want the app to follow the Account signed in to the game client, so that I see the right Challenge without choosing.
As a player with several Accounts, I want each Account to have its own Matches and its own Challenge, so that progress is never mixed.
As a player, I want the app to show the last active Account when the game client is closed, so that I can check my statistics without launching the game.
As a player with several Accounts, I want to select any Account the app has already seen, so that I can consult it without signing in to it.
As a player, I want an Account I am viewing but not signed in to marked as not updating, so that I understand why it may be behind.
Setup
As a new user, I want to be asked for my Riot API key on first launch, so that the app can start importing.
As a user, I want to change the key in a settings screen, so that I can replace an expired development key or switch to a personal key.
As a user, I want the app to tell me clearly when my key is invalid or expired, so that I know what to fix.
As a user, I want my key stored only on my machine and never in the repository, so that it is not leaked.
As a user, I want the app to find the game client by itself when it is running, so that I have nothing to configure.
Champ select
As an Arena player, I want the window to switch to a champ select view when an Arena champ select starts, so that the relevant information is in front of me.
As an Arena player, I want to see my statistics on the champion I am hovering or have locked, including its Attempts so far and whether it is Completed, so that I can decide whether to insist or change.
As an Arena player, I want a list of the champions I can pick that are not yet Completed, so that I can choose one that advances my Challenge.
As an Arena player, I want that list to exclude champions I cannot pick (banned, not owned, disabled), so that every suggestion is actionable.
As an Arena player, I want the view to update as picks and bans change, so that it stays accurate through the whole champ select.
As an Arena player, I want the window to return to the statistics page when champ select ends, so that I do not have to navigate back.
As an Arena player, I want the app never to pick, ban or act in the game client for me, so that I stay clearly within what Riot tolerates.
Implementation Decisions
Shape of the code
One workspace with two crates: a UI-free core crate holding all domain logic, storage and integrations, and a thin app crate holding the GPUI interface. The app only renders view data produced by the core and forwards user actions to it.
The core exposes one small public interface: synchronise an Account, report the active Account and client state, and answer queries (Challenge summary, champion rows, chart series, champ select view, known Accounts and Seasons). Everything else is internal.
The core reaches the outside world through two ports, each with one real adapter: a match history source (Riot web API) and a game client source (local League client API). Champion reference data (names, portraits) is a third, minor port.
The interface uses GPUI through gpui-kit pinned to exactly 0.9.1, using its data table and chart components (ADR-0002).
The app is compiled by the Windows Rust toolchain invoked from WSL, with the build directory on the Windows drive; the core crate is also built and tested natively in WSL (ADR-0003). The pinned GPUI line needs a Rust newer than 1.93.
Code and glossary are in English; all user-facing text is in French.
Data sources (ADR-0001)
Riot web API, authenticated with the user's own key: resolve the Account from its Riot ID, list its Match identifiers filtered to Arena queues with pagination, then fetch each Match. This is the only source for history; it retains about two years.
Calls are throttled to the personal-key limits (about 20 requests per second and 100 per two minutes) and the import is resumable.
Local game client API: discovered through the lockfile the client writes in its install directory, reached over HTTPS on localhost with the credentials in that file, plus its event stream. Used for: the active Account, the end of a Match, champ select state, and the Official Progress. Strictly read-only.
The client and the Riot API identify an Account differently; the Riot ID read from the client is the bridge between them.
Measured on 2026-11-15: the client's own match history returns only the 20 most recent games across all modes, so it is never used for backfill. It does carry Placement and the game's win flag for Arena games.
When the client reports the end of a Match, the app fetches that Match from the Riot API, retrying for a short while if it is not yet available.
Domain rules
A Match is stored once per Account, keyed by the game's match identifier, with its raw payload kept in full so that later features (augments, teammates) need no re-download.
Format is derived from the game queue: Arena 3x6 (queue 1750), Bravery Arena (1740), and the 16-player Arena (queues 1700 and 1710, treated as one Format). The PBE queue (1704) is ignored. An unknown Arena queue becomes its own Format named after the queue rather than being dropped.
Placement is the team's final rank as reported by the game. Win is the game's own win flag, not a threshold computed by the app.
Season boundaries come from a table shipped with the app and editable by the user; a Match belongs to the Season whose period contains its start date. Known starts: 2025 Season from 2025-03-05 (to be confirmed), 2026 Season 1 from 2026-01-08, 2026 Season 2 from 2026-04-29.
A Challenge is scoped to one Account and one Season, across all Formats. Its total is every champion in the game at the current patch.
A champion is Completed when the Challenge contains at least one top 1 with it. Its Attempts are its Matches in that Challenge in chronological order up to and including the first top 1; later Matches are not Attempts. A champion Completed in one Attempt is a First Try.
Challenge figures: Completed count over total; total Attempts including those on champions not yet Completed; average Attempts per Completed champion; First Try count.
All figures are computed from stored Matches on demand. No counter is stored, so a late-arriving Match or an edited Season table can never leave statistics inconsistent.
Official Progress is read from the client's progression track for the current Season (the track named after the Season's "Champs Completed" counter) and compared with the Completed count. It is a single number with no champion list, so it can only signal a difference, not locate it.
The Format filter applies to statistics (Matches, Placements, Wins) but never to the Challenge, Completed state or Attempts.
Storage and configuration
A SQLite database in the app's per-user data directory on Windows holds Accounts, Matches (raw payload plus the few extracted fields needed for queries) and sync state.
The Riot API key and the Season table live in local configuration files in the same directory, outside the repository.
Champion names and portraits come from Riot's public game data, cached locally and refreshed when the game version changes.
Behaviour
On launch: open on the statistics page for the last active Account immediately from stored data, then catch up in the background.
Sync runs at launch, after each Match the client reports as finished, and on the refresh button. It is incremental: only Matches newer than the latest stored one are fetched, after the initial full import.
When the client is running, the Account signed in to it becomes the active Account, and is created locally on first sight. When it is not running, the last active Account is shown.
An Account selector lists every Account already seen; viewing one that is not signed in shows stored data and marks it as not updating.
When an Arena champ select starts, the window switches to the champ select view and back to the statistics page when it ends. The view shows the user's row for the hovered or locked champion and the pickable champions not yet Completed in the current Challenge.
Failure states (no network, invalid or expired key, client not running, rate limited) never block the stored data; each shows a specific banner.
The app is an ordinary window: no notification-area icon, no start with Windows.
Open points to settle during implementation
Whether the game counts a top 1 from every Format toward its Season counter. Verify after the first import by comparing the Completed count with the Official Progress (52 for 2026 Season 2 on 2026-11-15). If the game counts only some Formats, the Challenge follows the game.
The placement field of the Riot API was seen in the documentation and its equivalent in the client data, but not yet in a real API response for Arena 3x6. Confirm on the first fetched Match.
The shape of champ select data in Arena has not been observed (the client was idle during exploration). Capture a real session before building the champ select view.
The start date of the 2025 Season.
Testing Decisions
A good test drives the system through the core crate's public interface and asserts what a user would see: the Challenge summary, champion rows, chart series, the champ select view. It never asserts on database tables, internal types or call order.
One seam: the core's public interface, with the two external ports replaced by fakes. The fake match history source and fake game client source are fed recorded real payloads, trimmed and stripped of other players' identities. Storage is the real SQLite engine on an in-memory or temporary database, not a mock.
Behaviours to cover at that seam:
Completed, Attempts and First Try for one champion across sequences such as fail-fail-win-replay, win on the first Match, and never a top 1.
Challenge totals and averages, including Attempts on champions not yet Completed.
A top 1 in one Format completing the champion for the Challenge, and the Format filter changing statistics without changing the Challenge.
Season assignment at the boundaries, a past Season's Challenge, and the all-Seasons view.
Two Accounts kept separate; the active Account following the fake client; the last active Account shown when the client is absent.
Importing the same Matches twice changes nothing; an interrupted import resumes; a Match arriving out of order is placed correctly.
Queue-to-Format mapping, including the merged 16-player queues, the ignored PBE queue and an unknown Arena queue.
Official Progress equal to and different from the Completed count.
Champ select view: statistics for the current pick and the list of pickable champions not yet Completed, updating as the fake client state changes.
Each failure state (invalid key, network error, client absent) leaves stored data readable and reports the right condition.
The real adapters (Riot API, game client) are kept thin and are checked by decoding the recorded payloads, not by calling live services in the test suite.
The GPUI app crate has no automated tests in this spec. It is verified by running it: the window opens, shows the statistics page, and reacts to a sync.
There is no prior art: the repository contains no code yet. These tests set the pattern for later work.
Out of Scope
Any action in the game client: picking, banning, accepting queues.
Overlays drawn on top of the game or the client, and an always-on-top mini window.
Statistics on augments or Arena items, and in particular their win rates, which Riot's developer policy forbids displaying.
Manual correction of Matches or of the Completed state.
A per-row sparkline of recent Placements, and a Matches-per-day chart.
Merging the statistics of several Accounts.
Linux or macOS support, an installer, automatic updates, running in the background or starting with Windows.
Further Notes
Delivery order agreed: (1) workspace skeleton with a GPUI window that opens, (2) history import through the Riot API and storage, (3) statistics page, (4) game client connection for the active Account and automatic Matches, (5) champ select view. Steps 1 to 4 form the first usable version; step 5 follows directly.
A Riot "personal" API key has to be requested by the user on the Riot developer portal. Until it is granted, a development key works but expires every 24 hours.
The local client API is unofficial and can change with any patch. Tolerate unknown or missing fields and degrade to stored data rather than failing.
gpui-kit releases weekly and GPUI is pre-1.0. Upgrade deliberately, one version at a time.
Vocabulary follows `CONTEXT.md` (Match, Format, Placement, Top N, Win, Challenge, Completed, Attempt, First Try, Season, Account, Official Progress). Decisions already recorded: ADR-0001 (two data sources), ADR-0002 (GPUI through gpui-kit), ADR-0003 (build with the Windows toolchain from WSL).
## Problem Statement
I play League of Legends Arena with a personal goal: get a top 1 with every champion in the game, in as few games as possible. The game client only shows me a single number per Season (how many champions it considers completed). It does not tell me which champions are left, how many games each champion cost me, which ones I got on the first try, or which ones I keep failing on. Its match history only goes back 20 games, so I cannot reconstruct any of this by hand. During champ select I have to pick from memory, without knowing which available champions still count for my goal or how many games I have already sunk into the one I am hovering.
## Solution
A Windows desktop app that keeps a complete local record of my Arena Matches and turns it into a view of my Challenge.
- It imports my whole Arena history from the Riot API and keeps it up to date, following whichever Account is signed in to the game client.
- Its main page shows the Challenge for the current Season: champions Completed out of the total, the total number of Attempts spent, the average Attempts per Completed champion and how many were a First Try, with small charts and a sortable table of every champion.
- During an Arena champ select, the window switches to a view of my statistics on the champion I am picking and the pickable champions I have not Completed yet.
The app only reads. It never acts in the game client.
## User Stories
### Challenge progress
1. As an Arena player, I want to see how many champions are Completed out of all champions in the game for the current Season, so that I know how far along my Challenge is.
2. As an Arena player, I want a champion to become Completed as soon as I have one top 1 with it in the Season, in any Format, so that the app counts the same way the game client does.
3. As an Arena player, I want the Challenge total to include every champion in the game at the current patch, so that a newly released champion shows up as remaining.
4. As an Arena player, I want the Challenge to start again from zero each Season, so that it mirrors the reset in the game.
5. As an Arena player, I want to open a past Season and see its Challenge as it ended, so that I can compare Seasons.
6. As an Arena player, I want the app to compare its count of Completed champions with the game's Official Progress, so that I am told when the two disagree.
7. As an Arena player, I want a visible notice when the app's count and the Official Progress differ, with both numbers, so that I know my data may be incomplete.
### Attempts and difficulty
8. As an Arena player, I want each champion to show its number of Attempts, so that I can see how hard it was to complete.
9. As an Arena player, I want Attempts to count my Matches with a champion in the Season up to and including its first top 1, so that the number means "games it took".
10. As an Arena player, I want Matches played with a champion after it is Completed not to count as Attempts, so that replaying a champion for fun does not hurt my Challenge.
11. As an Arena player, I want a champion I have played without a top 1 to show its Attempts so far as "in progress", so that I can tell it apart from a champion I never played.
12. As an Arena player, I want to see the total Attempts spent on the Challenge, including those on champions not yet Completed, so that I have one figure for my overall efficiency.
13. As an Arena player, I want to see the average Attempts per Completed champion, so that I can judge how close I am to the ideal of 1.
14. As an Arena player, I want to see how many champions were a First Try, so that I can see how often I succeed immediately.
15. As an Arena player, I want to sort the champion table by Attempts, so that my hardest champions come to the top.
### Statistics page
16. As an Arena player, I want the app to open on the statistics page for the current Season, so that I see my Challenge without navigating.
17. As an Arena player, I want a table with one row per champion in the game, so that champions I never played are visible too.
18. As an Arena player, I want each row to show number of Matches, best Placement, number of top 1, number of Wins, average Placement, Attempts and date of the last Match, so that I have the full picture per champion.
19. As an Arena player, I want to sort the table by any column, so that I can explore it my own way.
20. As an Arena player, I want to filter the table to Completed, remaining or never-played champions, so that I can focus on what is left.
21. As an Arena player, I want to filter statistics by Format, so that I can look at Arena 3x6 separately from Bravery Arena, knowing this does not split the Challenge.
22. As an Arena player, I want to switch between the current Season, a past Season and all Seasons, so that I can see both my current run and my lifetime statistics.
23. As an Arena player, I want a small chart of how my Placements are distributed, so that I can see at a glance how often I finish first, second and so on.
24. As an Arena player, I want a small chart of Completed champions over time, so that I can see the pace of my Challenge.
25. As an Arena player, I want a small chart of how many champions were Completed in 1, 2, 3, 4, or 5 and more Attempts, so that I can see how much of my Challenge was easy or hard.
26. As an Arena player, I want champion names and portraits in the table, so that I can recognise champions quickly.
27. As a French-speaking player, I want the interface in French, so that it reads naturally to me.
### History and synchronisation
28. As an Arena player, I want the app to import all my past Arena Matches that the Riot API still holds, so that my Challenge does not start empty.
29. As an Arena player, I want each Match assigned to a Season by its date, so that past Seasons are reconstructed correctly.
30. As an Arena player, I want the app to fetch the Matches I played while it was closed when I next start it, so that I never have a gap.
31. As an Arena player, I want a Match to appear shortly after it ends when the app is open, so that the page updates without my doing anything.
32. As an Arena player, I want a refresh button, so that I can force an update when I think something is missing.
33. As an Arena player, I want a long import to show progress and to resume where it stopped if interrupted, so that the first launch is not a black box.
34. As an Arena player, I want the app to work on my stored Matches when I have no network, the Riot API is down or the game client is closed, so that I can always consult my statistics.
35. As an Arena player, I want a clear banner when the app cannot update, saying why, so that I do not mistake stale data for current data.
36. As an Arena player, I want the same Match never to be counted twice, so that my statistics stay correct however often I sync.
37. As an Arena player, I want the Season boundaries shipped with the app and editable by me, so that I can correct or add a Season without waiting for a new version.
### Accounts
38. As a player with several Accounts, I want the app to follow the Account signed in to the game client, so that I see the right Challenge without choosing.
39. As a player with several Accounts, I want each Account to have its own Matches and its own Challenge, so that progress is never mixed.
40. As a player, I want the app to show the last active Account when the game client is closed, so that I can check my statistics without launching the game.
41. As a player with several Accounts, I want to select any Account the app has already seen, so that I can consult it without signing in to it.
42. As a player, I want an Account I am viewing but not signed in to marked as not updating, so that I understand why it may be behind.
### Setup
43. As a new user, I want to be asked for my Riot API key on first launch, so that the app can start importing.
44. As a user, I want to change the key in a settings screen, so that I can replace an expired development key or switch to a personal key.
45. As a user, I want the app to tell me clearly when my key is invalid or expired, so that I know what to fix.
46. As a user, I want my key stored only on my machine and never in the repository, so that it is not leaked.
47. As a user, I want the app to find the game client by itself when it is running, so that I have nothing to configure.
### Champ select
48. As an Arena player, I want the window to switch to a champ select view when an Arena champ select starts, so that the relevant information is in front of me.
49. As an Arena player, I want to see my statistics on the champion I am hovering or have locked, including its Attempts so far and whether it is Completed, so that I can decide whether to insist or change.
50. As an Arena player, I want a list of the champions I can pick that are not yet Completed, so that I can choose one that advances my Challenge.
51. As an Arena player, I want that list to exclude champions I cannot pick (banned, not owned, disabled), so that every suggestion is actionable.
52. As an Arena player, I want the view to update as picks and bans change, so that it stays accurate through the whole champ select.
53. As an Arena player, I want the window to return to the statistics page when champ select ends, so that I do not have to navigate back.
54. As an Arena player, I want the app never to pick, ban or act in the game client for me, so that I stay clearly within what Riot tolerates.
## Implementation Decisions
### Shape of the code
- One workspace with two crates: a UI-free **core** crate holding all domain logic, storage and integrations, and a thin **app** crate holding the GPUI interface. The app only renders view data produced by the core and forwards user actions to it.
- The core exposes one small public interface: synchronise an Account, report the active Account and client state, and answer queries (Challenge summary, champion rows, chart series, champ select view, known Accounts and Seasons). Everything else is internal.
- The core reaches the outside world through two ports, each with one real adapter: a **match history source** (Riot web API) and a **game client source** (local League client API). Champion reference data (names, portraits) is a third, minor port.
- The interface uses GPUI through `gpui-kit` pinned to exactly 0.9.1, using its data table and chart components (ADR-0002).
- The app is compiled by the Windows Rust toolchain invoked from WSL, with the build directory on the Windows drive; the core crate is also built and tested natively in WSL (ADR-0003). The pinned GPUI line needs a Rust newer than 1.93.
- Code and glossary are in English; all user-facing text is in French.
### Data sources (ADR-0001)
- **Riot web API**, authenticated with the user's own key: resolve the Account from its Riot ID, list its Match identifiers filtered to Arena queues with pagination, then fetch each Match. This is the only source for history; it retains about two years.
- Calls are throttled to the personal-key limits (about 20 requests per second and 100 per two minutes) and the import is resumable.
- **Local game client API**: discovered through the lockfile the client writes in its install directory, reached over HTTPS on localhost with the credentials in that file, plus its event stream. Used for: the active Account, the end of a Match, champ select state, and the Official Progress. Strictly read-only.
- The client and the Riot API identify an Account differently; the Riot ID read from the client is the bridge between them.
- Measured on 2026-11-15: the client's own match history returns only the 20 most recent games across all modes, so it is never used for backfill. It does carry Placement and the game's win flag for Arena games.
- When the client reports the end of a Match, the app fetches that Match from the Riot API, retrying for a short while if it is not yet available.
### Domain rules
- A **Match** is stored once per Account, keyed by the game's match identifier, with its raw payload kept in full so that later features (augments, teammates) need no re-download.
- **Format** is derived from the game queue: Arena 3x6 (queue 1750), Bravery Arena (1740), and the 16-player Arena (queues 1700 and 1710, treated as one Format). The PBE queue (1704) is ignored. An unknown Arena queue becomes its own Format named after the queue rather than being dropped.
- **Placement** is the team's final rank as reported by the game. **Win** is the game's own win flag, not a threshold computed by the app.
- **Season** boundaries come from a table shipped with the app and editable by the user; a Match belongs to the Season whose period contains its start date. Known starts: 2025 Season from 2025-03-05 (to be confirmed), 2026 Season 1 from 2026-01-08, 2026 Season 2 from 2026-04-29.
- A **Challenge** is scoped to one Account and one Season, across all Formats. Its total is every champion in the game at the current patch.
- A champion is **Completed** when the Challenge contains at least one top 1 with it. Its **Attempts** are its Matches in that Challenge in chronological order up to and including the first top 1; later Matches are not Attempts. A champion Completed in one Attempt is a **First Try**.
- Challenge figures: Completed count over total; total Attempts including those on champions not yet Completed; average Attempts per Completed champion; First Try count.
- All figures are computed from stored Matches on demand. No counter is stored, so a late-arriving Match or an edited Season table can never leave statistics inconsistent.
- **Official Progress** is read from the client's progression track for the current Season (the track named after the Season's "Champs Completed" counter) and compared with the Completed count. It is a single number with no champion list, so it can only signal a difference, not locate it.
- The Format filter applies to statistics (Matches, Placements, Wins) but never to the Challenge, Completed state or Attempts.
### Storage and configuration
- A SQLite database in the app's per-user data directory on Windows holds Accounts, Matches (raw payload plus the few extracted fields needed for queries) and sync state.
- The Riot API key and the Season table live in local configuration files in the same directory, outside the repository.
- Champion names and portraits come from Riot's public game data, cached locally and refreshed when the game version changes.
### Behaviour
- On launch: open on the statistics page for the last active Account immediately from stored data, then catch up in the background.
- Sync runs at launch, after each Match the client reports as finished, and on the refresh button. It is incremental: only Matches newer than the latest stored one are fetched, after the initial full import.
- When the client is running, the Account signed in to it becomes the active Account, and is created locally on first sight. When it is not running, the last active Account is shown.
- An Account selector lists every Account already seen; viewing one that is not signed in shows stored data and marks it as not updating.
- When an Arena champ select starts, the window switches to the champ select view and back to the statistics page when it ends. The view shows the user's row for the hovered or locked champion and the pickable champions not yet Completed in the current Challenge.
- Failure states (no network, invalid or expired key, client not running, rate limited) never block the stored data; each shows a specific banner.
- The app is an ordinary window: no notification-area icon, no start with Windows.
### Open points to settle during implementation
- Whether the game counts a top 1 from every Format toward its Season counter. Verify after the first import by comparing the Completed count with the Official Progress (52 for 2026 Season 2 on 2026-11-15). If the game counts only some Formats, the Challenge follows the game.
- The `placement` field of the Riot API was seen in the documentation and its equivalent in the client data, but not yet in a real API response for Arena 3x6. Confirm on the first fetched Match.
- The shape of champ select data in Arena has not been observed (the client was idle during exploration). Capture a real session before building the champ select view.
- The start date of the 2025 Season.
## Testing Decisions
- A good test drives the system through the core crate's public interface and asserts what a user would see: the Challenge summary, champion rows, chart series, the champ select view. It never asserts on database tables, internal types or call order.
- **One seam**: the core's public interface, with the two external ports replaced by fakes. The fake match history source and fake game client source are fed recorded real payloads, trimmed and stripped of other players' identities. Storage is the real SQLite engine on an in-memory or temporary database, not a mock.
- Behaviours to cover at that seam:
- Completed, Attempts and First Try for one champion across sequences such as fail-fail-win-replay, win on the first Match, and never a top 1.
- Challenge totals and averages, including Attempts on champions not yet Completed.
- A top 1 in one Format completing the champion for the Challenge, and the Format filter changing statistics without changing the Challenge.
- Season assignment at the boundaries, a past Season's Challenge, and the all-Seasons view.
- Two Accounts kept separate; the active Account following the fake client; the last active Account shown when the client is absent.
- Importing the same Matches twice changes nothing; an interrupted import resumes; a Match arriving out of order is placed correctly.
- Queue-to-Format mapping, including the merged 16-player queues, the ignored PBE queue and an unknown Arena queue.
- Official Progress equal to and different from the Completed count.
- Champ select view: statistics for the current pick and the list of pickable champions not yet Completed, updating as the fake client state changes.
- Each failure state (invalid key, network error, client absent) leaves stored data readable and reports the right condition.
- The real adapters (Riot API, game client) are kept thin and are checked by decoding the recorded payloads, not by calling live services in the test suite.
- The GPUI app crate has no automated tests in this spec. It is verified by running it: the window opens, shows the statistics page, and reacts to a sync.
- There is no prior art: the repository contains no code yet. These tests set the pattern for later work.
## Out of Scope
- Any action in the game client: picking, banning, accepting queues.
- Overlays drawn on top of the game or the client, and an always-on-top mini window.
- Statistics on augments or Arena items, and in particular their win rates, which Riot's developer policy forbids displaying.
- Teammate statistics, kills/deaths/assists, damage, per-patch breakdowns.
- A separate Challenge per Format.
- Manual correction of Matches or of the Completed state.
- A per-row sparkline of recent Placements, and a Matches-per-day chart.
- Merging the statistics of several Accounts.
- Linux or macOS support, an installer, automatic updates, running in the background or starting with Windows.
## Further Notes
- Delivery order agreed: (1) workspace skeleton with a GPUI window that opens, (2) history import through the Riot API and storage, (3) statistics page, (4) game client connection for the active Account and automatic Matches, (5) champ select view. Steps 1 to 4 form the first usable version; step 5 follows directly.
- A Riot "personal" API key has to be requested by the user on the Riot developer portal. Until it is granted, a development key works but expires every 24 hours.
- The local client API is unofficial and can change with any patch. Tolerate unknown or missing fields and degrade to stored data rather than failing.
- `gpui-kit` releases weekly and GPUI is pre-1.0. Upgrade deliberately, one version at a time.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Vocabulary follows
CONTEXT.md(Match, Format, Placement, Top N, Win, Challenge, Completed, Attempt, First Try, Season, Account, Official Progress). Decisions already recorded: ADR-0001 (two data sources), ADR-0002 (GPUI through gpui-kit), ADR-0003 (build with the Windows toolchain from WSL).Problem Statement
I play League of Legends Arena with a personal goal: get a top 1 with every champion in the game, in as few games as possible. The game client only shows me a single number per Season (how many champions it considers completed). It does not tell me which champions are left, how many games each champion cost me, which ones I got on the first try, or which ones I keep failing on. Its match history only goes back 20 games, so I cannot reconstruct any of this by hand. During champ select I have to pick from memory, without knowing which available champions still count for my goal or how many games I have already sunk into the one I am hovering.
Solution
A Windows desktop app that keeps a complete local record of my Arena Matches and turns it into a view of my Challenge.
The app only reads. It never acts in the game client.
User Stories
Challenge progress
Attempts and difficulty
Statistics page
History and synchronisation
Accounts
Setup
Champ select
Implementation Decisions
Shape of the code
gpui-kitpinned to exactly 0.9.1, using its data table and chart components (ADR-0002).Data sources (ADR-0001)
Domain rules
Storage and configuration
Behaviour
Open points to settle during implementation
placementfield of the Riot API was seen in the documentation and its equivalent in the client data, but not yet in a real API response for Arena 3x6. Confirm on the first fetched Match.Testing Decisions
Out of Scope
Further Notes
gpui-kitreleases weekly and GPUI is pre-1.0. Upgrade deliberately, one version at a time.