Add domain documents and workspace skeleton with a GPUI window #14

Merged
nessar merged 2 commits from feat/workspace-skeleton into main 2026-11-16 10:33:41 +01:00
17 changed files with 8873 additions and 0 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
/target
*.local.toml
.env
+13
View File
@@ -0,0 +1,13 @@
## Agent skills
### Issue tracker
Issues are tracked on the self-hosted Gitea (`nessar/arena-tracker`) via the `tea` CLI. See `docs/agents/issue-tracker.md`.
### Triage labels
Default five-role vocabulary (`needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`). See `docs/agents/triage-labels.md`.
### Domain docs
Single-context: one `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
+70
View File
@@ -0,0 +1,70 @@
# Arena Tracker
Personal tracking of League of Legends Arena matches, centred on progress through the Challenge: placing first with every champion.
## Language
**Match**:
A finished Arena game played by an Account with one champion, in one Format.
_Avoid_: Game, session
**Format**:
A variant of Arena with its own team structure and rules, such as Arena 3x6 or Bravery Arena; it filters statistics but does not split the Challenge.
_Avoid_: Mode, type, queue
**Placement**:
The final rank of the player's team in a Match, 1 being the best.
_Avoid_: Rank, position, standing
**Top N**:
A Match whose Placement is N or better; a top 1 is therefore also a top 3.
_Avoid_: Podium
**Win**:
A Match the game itself counts as won, which is a Placement in the upper half of the Format (top 3 in Arena 3x6).
_Avoid_: Victory
**Challenge**:
The goal of getting a top 1 with every champion in the game in as few Attempts as possible, scoped to one Account and one Season across all Formats, mirroring how the game client counts it.
_Avoid_: Checklist, goal, Arena God
**Completed**:
The state of a champion that has at least one top 1 within a given Challenge.
_Avoid_: Done, validated, won
**Attempt**:
A Match played with a champion within a Challenge up to and including that champion's first top 1; Matches played after the champion is Completed are not Attempts.
_Avoid_: Try, game count, difficulty
**First Try**:
A champion Completed in exactly one Attempt.
_Avoid_: One-shot, flawless
**Season**:
A period of Arena after which Challenge progress starts again from zero.
_Avoid_: Split, run
**Account**:
A League of Legends account; the active Account is the one signed in to the game client.
_Avoid_: Player, profile, summoner
**Official Progress**:
The game's own per-Season count of champions it considers completed, used only to cross-check a Challenge.
_Avoid_: Riot challenge, tracker
## Interface terms
The interface is in French. Each glossary term has one French word in user-facing text; the _Avoid_ lists above govern English naming in code and documents, not these words.
| Term | In the interface |
| --- | --- |
| Match | Partie |
| Challenge | Défi |
| Attempt | Tentative |
| First Try | du premier coup |
| Completed | validé |
| Win | Victoire |
| Season | Saison |
| Account | Compte |
| Official Progress | Progression officielle |
| Placement, Format, Top N | unchanged |
Generated
+8493
View File
File diff suppressed because it is too large. Load diff
+9
View File
@@ -0,0 +1,9 @@
[workspace]
resolver = "3"
members = ["crates/core", "crates/app"]
default-members = ["crates/core"]
[workspace.package]
edition = "2024"
rust-version = "1.98"
version = "0.1.0"
+26
View File
@@ -0,0 +1,26 @@
# Arena Tracker
Application de bureau Windows qui suit les Parties d'Arena de League of Legends. Le vocabulaire du domaine est dans `CONTEXT.md` et les décisions d'architecture dans `docs/adr/`.
## Prérequis
- Windows avec la chaîne d'outils Rust (rustup), version 1.98 ou plus récente, accessible depuis WSL sous le nom `cargo.exe`.
- WSL avec une chaîne d'outils Rust Linux (`cargo`), version 1.98 ou plus récente, pour exécuter les tests du coeur.
- Les outils de compilation C++ de Visual Studio (Build Tools) côté Windows.
## Commandes
Depuis WSL, à la racine du dépôt :
- `scripts/win build` : compile l'application avec la chaîne d'outils Windows. Le dossier de build est `%LOCALAPPDATA%\arena-tracker\target`, sur le disque Windows. Les arguments supplémentaires sont transmis à cargo (par exemple `scripts/win build --release`).
- `scripts/win run` : compile si besoin puis lance l'application ; la fenêtre « Arena Tracker » s'ouvre sur Windows.
La première compilation de GPUI prend plusieurs minutes.
## Tests
Les tests du coeur (`arena-tracker-core`, sans dépendance graphique) s'exécutent nativement dans WSL :
```
cargo test
```
+9
View File
@@ -0,0 +1,9 @@
[package]
name = "arena-tracker"
edition.workspace = true
rust-version.workspace = true
version.workspace = true
[dependencies]
arena-tracker-core = { path = "../core" }
gpui-kit = "=0.9.1"
+32
View File
@@ -0,0 +1,32 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use gpui_kit::component::*;
use gpui_kit::*;
struct RootView;
impl Render for RootView {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.v_flex()
.size_full()
.items_center()
.justify_center()
.child(arena_tracker_core::startup_message())
}
}
fn main() {
gpui_kit::application().run(move |cx| {
gpui_kit::init(cx);
let options = WindowOptions {
titlebar: Some(TitlebarOptions {
title: Some("Arena Tracker".into()),
..Default::default()
}),
..Default::default()
};
gpui_kit::open_window(options, cx, |_, cx| cx.new(|_| RootView))
.expect("Failed to open window");
});
}
+7
View File
@@ -0,0 +1,7 @@
[package]
name = "arena-tracker-core"
edition.workspace = true
rust-version.workspace = true
version.workspace = true
[dependencies]
+14
View File
@@ -0,0 +1,14 @@
/// Text shown at startup while no Match has been imported yet.
pub fn startup_message() -> &'static str {
"Aucune Partie importée pour l'instant."
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn startup_message_announces_no_imported_match() {
assert_eq!(startup_message(), "Aucune Partie importée pour l'instant.");
}
}
@@ -0,0 +1,17 @@
---
status: accepted
---
# Two data sources: the local game client and the Riot API
The app reads the local League client API for the active Account and for live state (champ select, end of a Match), and the Riot web API for Match history. We accept the cost of a second integration and a personal Riot API key because the client alone cannot backfill: measured on 2026-11-15, its match history endpoint returns only the 20 most recent games across all game modes and ignores paging, while the Riot API keeps about two years.
## Considered Options
- **Client only**: no API key, but history limited to 20 recent games, so past Seasons and any Match played while the app was closed for long would be lost.
- **Riot API only**: full history, but no knowledge of which Account is signed in and no champ select.
## Consequences
- The client API is unofficial and may change between patches; the app must keep working on stored Matches when it is unavailable.
- The app only ever reads from the client. It never picks, bans or acts on the player's behalf.
+18
View File
@@ -0,0 +1,18 @@
---
status: accepted
---
# GPUI through gpui-kit, pinned to an exact version
The interface is built with GPUI, taken through `gpui-kit` 0.9.1 pinned exactly, rather than the official `gpui` crate. The official crate on crates.io has been frozen at 0.2.2 since October 2025 and ships no components, while `gpui-kit` brings a current GPUI plus the data table and charts the statistics page needs. The cost is that GPUI's own code reaches us as `gpui-pre`, a snapshot of the Zed repository republished by the `gpui-kit` maintainer (Longbridge) and not by Zed, so we trust that maintainer for the framework itself.
## Considered Options
- **Official `gpui` 0.2.2**: published by Zed, but a year old and the table and charts would be hand-written.
- **Git dependency on the Zed repository**: official and current, but a heavy clone with no guaranteed matching component library.
- **egui or Tauri**: faster to a result, rejected because GPUI is a deliberate preference for this project.
## Consequences
- `gpui-kit` releases weekly and GPUI is pre-1.0: upgrades are deliberate, one version at a time, never a loose version range.
- This line needs a Rust newer than 1.93.
@@ -0,0 +1,18 @@
---
status: accepted
---
# Build with the Windows Rust toolchain, driven from WSL
The repository, shell, editor and git live in WSL, but the app is compiled by Windows' own `cargo.exe` invoked from WSL, with the build directory on `C:`. Real cross-compilation from Linux was the first choice and was abandoned after testing on 2026-11-15: with `cargo-xwin`, GPUI 0.2.2 compiles but the executable exits at launch, because GPUI loads its DirectX shaders from the build machine's source path in debug builds and only generates them in release builds when the build host is Windows. The Windows toolchain driven from WSL produced a visible, responsive window for both GPUI 0.2.2 and `gpui-kit` 0.9.1.
## Considered Options
- **Cross-compile from WSL with `cargo-xwin`**: fails at runtime as described; not retested on the current GPUI line.
- **Develop on Linux under WSLg, build for Windows at the end**: rejected, no Vulkan support was found in this WSL and it would test a platform that is not the target.
- **Move the repository to the Windows filesystem**: works, but gives up the WSL working environment for no gain.
## Consequences
- The UI-free core crate is still built and tested natively in WSL; only the GPUI app crate needs the Windows toolchain.
- Two Rust toolchains must stay recent enough: Windows' to build the app, WSL's for editor diagnostics and core tests.
+51
View File
@@ -0,0 +1,51 @@
# Domain Docs
How the engineering skills should consume this repo's domain documentation when exploring the codebase.
## Before exploring, read these
- **`CONTEXT.md`** at the repo root, or
- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
- **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
## File structure
Single-context repo (most repos):
```
/
├── CONTEXT.md
├── docs/adr/
│ ├── 0001-event-sourced-orders.md
│ └── 0002-postgres-for-write-model.md
└── src/
```
Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
```
/
├── CONTEXT-MAP.md
├── docs/adr/ ← system-wide decisions
└── src/
├── ordering/
│ ├── CONTEXT.md
│ └── docs/adr/ ← context-specific decisions
└── billing/
├── CONTEXT.md
└── docs/adr/
```
## Use the glossary's vocabulary
When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
## Flag ADR conflicts
If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
> _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
+39
View File
@@ -0,0 +1,39 @@
# Issue tracker: Gitea
Issues and specs for this repo live as Gitea issues on `https://gitea.nessar.fr` (repo `nessar/arena-tracker`). Use the `tea` CLI (login `srvhome`) for all operations; fall back to `tea api` for anything `tea` doesn't cover. `tea` infers the repo from `git remote -v`; otherwise pass `-r nessar/arena-tracker -l srvhome`.
## Conventions
- **Create an issue**: `tea issues create -t "..." -d "..." [-L "label1,label2"]`. For long bodies use `--description-file file.md` (or `-` for stdin).
- **Read an issue**: `tea issues <number> --comments`
- **List issues**: `tea issues list --state open -o json -f index,title,body,labels,comments` with `-L <label>` / `--state` filters.
- **Comment on an issue**: `tea comment <number> "..."`
- **Apply / remove labels**: `tea issues edit <number> --add-labels "..."` / `--remove-labels "..."` (check `tea issues edit --help` for exact flags).
- **Close**: `tea comment <number> "..."` then `tea issues close <number>`
**Labels must already exist** — an unknown label makes creation fail. List with `tea labels list`, create with `tea labels create --name <name> --color <hex>`.
Publishing an issue is externally visible: confirm title and content with the user first unless they explicitly asked to publish directly.
## Pull requests as a triage surface
**PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
## When a skill says "publish to the issue tracker"
Create a Gitea issue with `tea issues create`.
## When a skill says "fetch the relevant ticket"
Run `tea issues <number> --comments`.
## Wayfinding operations
Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets. Gitea has no native sub-issues, so children are tracked in a task list.
- **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body.
- **Child ticket**: an issue listed as a task-list item (`- [ ] #<n>`) in the map body, with `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
- **Blocking**: Gitea's **native issue dependencies** — `tea api -X POST /repos/nessar/arena-tracker/issues/<child>/dependencies -F index=<blocker> -f owner=nessar -f repo=arena-tracker` (the child is blocked by the blocker). Read with `tea api /repos/nessar/arena-tracker/issues/<child>/dependencies`. Also write a `Blocked by: #<n>, #<n>` line at the top of the child body as a readable fallback. A ticket is unblocked when every blocker is closed.
- **Frontier query**: list the map's open children (task list in the map body), drop any with an open blocker or an assignee; first in map order wins.
- **Claim**: `tea issues edit <n> --add-assignees nessar` — the session's first write.
- **Resolve**: `tea comment <n> "<answer>"`, then `tea issues close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
+14
View File
@@ -0,0 +1,14 @@
# Triage Labels
The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
| Label in mattpocock/skills | Label in our tracker | Meaning |
| -------------------------- | -------------------- | ---------------------------------------- |
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
| `needs-info` | `needs-info` | Waiting on reporter for more information |
| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
| `ready-for-human` | `ready-for-human` | Requires human implementation |
| `wontfix` | `wontfix` | Will not be actioned |
When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
Executable
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Builds and runs Arena Tracker with the Windows Rust toolchain, from WSL (ADR-0003).
set -euo pipefail
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.."
usage() {
echo "Usage : scripts/win <build|run> [arguments cargo...]" >&2
exit 2
}
[ $# -ge 1 ] || usage
subcommand="$1"
shift
case "$subcommand" in
build | run) ;;
*) usage ;;
esac
if ! command -v cargo.exe >/dev/null 2>&1; then
echo "Erreur : cargo.exe est introuvable. Installez Rust pour Windows (rustup) et vérifiez qu'il est dans le PATH de WSL." >&2
exit 1
fi
if ! command -v cmd.exe >/dev/null 2>&1; then
echo "Erreur : cmd.exe est introuvable. Vérifiez que les programmes Windows sont dans le PATH de WSL." >&2
exit 1
fi
# The build directory lives on the Windows drive: %LOCALAPPDATA%\arena-tracker\target.
# cmd.exe is started from a Windows directory to avoid its warning about UNC paths.
windows_dir="$(dirname "$(command -v cmd.exe)")"
local_app_data="$(cd "$windows_dir" && cmd.exe /c 'echo %LOCALAPPDATA%' 2>/dev/null | tr -d '\r' || true)"
if [ -z "$local_app_data" ] || [ "$local_app_data" = '%LOCALAPPDATA%' ]; then
echo "Erreur : impossible de déterminer %LOCALAPPDATA% via cmd.exe." >&2
exit 1
fi
target_dir="${local_app_data}\\arena-tracker\\target"
# --locked: fail when Cargo.lock is stale instead of rewriting it (run `cargo test` in WSL to refresh it).
exec cargo.exe "$subcommand" --locked -p arena-tracker --target-dir "$target_dir" "$@"