Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
data
target
node_modules
web/node_modules
web/.output
*.db
*.db-wal
*.db-shm
Expand Down
11 changes: 5 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ updates:
ignore:
- dependency-name: waveflow-core

# Web client (TanStack Start app) lives under web/ since the
# monorepo merge. The npm ecosystem covers Bun's package.json +
# bun.lock — Dependabot doesn't have a dedicated Bun parser yet,
# but the npm resolver reads the lockfile correctly.
- package-ecosystem: npm
directory: "/web"
# Embedded web client. The dedicated ecosystem keeps package.json and
# bun.lock in sync. GitHub currently supports Bun version updates, but not
# Dependabot security updates for Bun.
- package-ecosystem: bun
directory: "/webapp"
schedule:
interval: weekly
day: monday
Expand Down
76 changes: 29 additions & 47 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
- 'Cargo.toml'
- 'Cargo.lock'
- 'src/**'
- 'migrations/**'
- 'migrations-v2/**'
- 'build.rs'
- 'tests/**'

'scope: web':
- changed-files:
- any-glob-to-any-file:
- 'web/**'
- 'webapp/**'

# ─────────────────────────────────────────────────────────────
# Server-side fine scopes (inside src/).
Expand All @@ -34,75 +35,59 @@
'scope: api':
- changed-files:
- any-glob-to-any-file:
- 'src/api/**'
- 'src/http.rs'
- 'src/services.rs'
- 'src/lib.rs'

'scope: db':
- changed-files:
- any-glob-to-any-file:
- 'src/db.rs'
- 'src/db/**'
- 'migrations/**'
- 'src/database.rs'
- 'src/catalog.rs'
- 'migrations-v2/**'

'scope: auth':
- changed-files:
- any-glob-to-any-file:
- 'src/auth.rs'
- 'src/middleware.rs'
- 'web/src/auth/**'
- 'web/src/lib/auth.ts'
- 'web/src/lib/auth-client.ts'
# `sign-in.tsx` / `sign-up.tsx` are FILES at the root of
# `web/src/routes/`, not directories. minimatch's
# `{a,b}` brace expansion gives us a clean union of the
# two real shapes: the literal `.tsx` file today and a
# future `sign-in/` subtree (e.g. `sign-in.callback.tsx`,
# `sign-in/index.tsx`). The earlier `{,/**}` shape only
# produced `sign-in` (no extension, doesn't exist) and
# `sign-in/**`, missing the actual `.tsx` file.
- 'web/src/routes/sign-in{.tsx,/**}'
- 'web/src/routes/sign-up{.tsx,/**}'
- 'web/src/routes/api/auth/**'

'scope: sync':
- 'src/authentication.rs'
- 'src/oauth.rs'
- 'src/security.rs'

'scope: subsonic':
- changed-files:
- any-glob-to-any-file:
- 'src/api/sync.rs'
- 'src/apply.rs'
- 'src/apply/**'
- 'src/subsonic.rs'
- 'docs/subsonic-compatibility.md'

'scope: streaming':
- changed-files:
- any-glob-to-any-file:
- 'src/api/stream.rs'
- 'src/stream_token.rs'
- 'src/media.rs'
- 'src/stream_ticket.rs'

'scope: artwork':
'scope: scanner':
- changed-files:
- any-glob-to-any-file:
- 'src/api/artwork.rs'
- 'src/artwork_pipeline.rs'
- 'src/artwork_jobs.rs'
- 'src/storage.rs'
- 'src/scanner.rs'

# ─────────────────────────────────────────────────────────────
# Web fine scopes (inside web/src/).
# Web fine scopes (inside webapp/src/).
# ─────────────────────────────────────────────────────────────

'scope: routes':
- changed-files:
- any-glob-to-any-file:
- 'web/src/routes/**'
- 'webapp/src/main.tsx'

'scope: components':
- changed-files:
- any-glob-to-any-file:
- 'web/src/components/**'
- 'webapp/src/pages.tsx'

'scope: design-tokens':
- changed-files:
- any-glob-to-any-file:
- 'web/packages/design-tokens/**'
- 'webapp/src/design-tokens/**'

# ─────────────────────────────────────────────────────────────
# Cross-cutting.
Expand All @@ -112,19 +97,16 @@
- changed-files:
- any-glob-to-any-file:
- '.github/**'
- 'web/.husky/**'
- 'web/eslint.config.js'
- 'web/.prettierrc.json'
- 'web/.commitlintrc.cjs'
- 'web/vite.config.ts'
- 'web/vitest.config.ts'
- 'web/tsconfig.json'
- 'webapp/vite.config.ts'
- 'webapp/vitest.config.ts'
- 'webapp/tsconfig.json'

'scope: deps':
- changed-files:
- any-glob-to-any-file:
- 'web/package.json'
- 'web/bun.lock'
- 'webapp/biome.json'
- 'webapp/package.json'
- 'webapp/bun.lock'
- 'Cargo.toml'
- 'Cargo.lock'

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ jobs:
# instead of silently regenerating against the registry.
run: bun install --frozen-lockfile

# Biome covers formatting and linting in one pass.
- name: Lint
run: bun run lint

# `bun run build` typechecks before bundling, so this covers both.
- name: Build
run: bun run build
Expand Down
3 changes: 1 addition & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
This monorepo is being rebuilt as WaveFlow Server v2. The accepted design is `docs/rfcs/RFC-002-waveflow-server-v2.md`; read it before adding a module or public route.

- `/`: one axum binary with SQLite as the only v2 database.
- `web/`: the superseded TanStack/Better Auth v1 front end, kept only until its reusable parts are salvaged. It is not built, served or tested.
- `webapp/`: the embedded React client, built to `webapp/dist` and compiled into the binary by `rust_embed`. Build it before the server, never after.
- The v1 PostgreSQL/JWKS **server** implementation has been removed; it lives in git history only. This does not extend to `web/`, which is still present in the tree as described above.
- The v1 PostgreSQL/JWKS server and the TanStack/Better Auth front end that fronted it have been removed; both live in git history only.

## Commands

Expand Down
3 changes: 1 addition & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ Layout:

- `/` — the server crate (`waveflow-server`).
- `webapp/` — the embedded React client, built to `webapp/dist` and compiled in by `rust_embed`.
- `web/` — the superseded v1 TanStack/Better Auth front end. Not built, not served, not tested; kept only until its reusable parts are salvaged. Do not extend it.

The desktop app at [`InstaZDLL/WaveFlow`](https://github.com/InstaZDLL/WaveFlow) is a separate repository. It consumes this API but is not part of this codebase.

The v1 PostgreSQL/JWKS server was removed once M4 landed. If you find a reference to `/api/v1`, `src/db.rs`, `src/apply.rs`, the sync log or the Postgres `migrations/` directory, it is stale documentation — the code lives in git history only.
The v1 PostgreSQL/JWKS server and its TanStack/Better Auth front end were removed once M4 landed. If you find a reference to `/api/v1`, `src/db.rs`, `src/apply.rs`, the sync log or the Postgres `migrations/` directory, it is stale documentation — the code lives in git history only.

## Commands

Expand Down
51 changes: 30 additions & 21 deletions docs/M4-handoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
- **M0, M1, M2 : fermés.**
- **M3 : fermé.** Symfonium 14.1.0 a validé authentification, synchronisation,
lecture native/transcodée, favoris, scrobbles et playlists.
- **M4 : fusionné** (`14aec76`). Le nettoyage de `web/` reste porté par la PR
#84 tant qu'elle n'est pas fusionnée.
- **M4 : fusionné** (`14aec76`). L'ancien `web/` est retiré par la PR #84 après
extraction de ses design tokens utiles.
- **M5, M6 : non commencés.**

## Validation sur bibliothèque réelle (2026-08-09)
Expand Down Expand Up @@ -60,14 +60,11 @@ dans `lib.rs` / `Cargo.toml`).
Ces choix ont été pris délibérément ; les « corriger » sans contexte serait une
régression.

- **Symfonium conditionne le tag `v2.0-beta`, et lui seul.** La dérogation
approuvée par le user le 2026-08-03 couvre **le démarrage et la fusion de
M4** : le travail M4 avance et se fusionne sans attendre M3. Ce qui reste
bloqué, c'est le tag `v2.0-beta`, rien d'autre. C'est une dérogation
explicite à la règle « pas de milestone suivant avant la porte précédente »
d'`AGENTS.md`, consignée en tête de `docs/M3-symfonium-validation.md`.
Quatre revues automatisées ont demandé de l'annuler ; c'est à écarter en s'y
référant.
- **La validation Symfonium a fermé M3 après la fusion de M4.** La dérogation
approuvée le 2026-08-03 autorisait explicitement le démarrage et la fusion de
M4 avant cette validation, sans autoriser le tag `v2.0-beta`. Elle expliquait
l'écart temporaire avec l'ordre des jalons d'`AGENTS.md` ; elle est désormais
historique puisque la porte M3 est fermée.
- **Un code d'autorisation est dépensé à la première présentation**, quelle que
soit l'issue. Un verifier erroné brûle le code. Cela ferme le devinage et suit
la règle de révocation-sur-réutilisation d'OAuth 2.1 ; un client qui rate son
Expand All @@ -82,8 +79,10 @@ régression.
- **Le contrat Subsonic est gelé.** `search3` filtre encore en mémoire sans
utiliser l'index FTS5 — dette assumée : y toucher risquerait une régression
sur les trois clients validés.
- **`web/` reste dans l'arbre**, hors de toute CI, en attendant qu'on décide
quoi en récupérer. Il n'est ni construit, ni servi, ni testé.
- **`web/` a été supprimé** (décision user du 2026-08-08) après extraction de
`packages/design-tokens` vers `webapp/src/design-tokens/`. Le reste était
arrimé à la hiérarchie profil/bibliothèque de la v1 et aux server functions
Better Auth : git en garde l'historique.

## Pièges connus

Expand All @@ -105,22 +104,32 @@ régression.

## Ce qui reste

1. **Fusionner la PR #84** pour retirer l'ancien `web/`, après avoir conservé
les design tokens utiles dans `webapp/` et résolu sa revue en attente.
2. **Trancher la sécurité de session navigateur avant `v2.0` stable**, comme
1. **Trancher la sécurité de session navigateur avant `v2.0` stable**, comme
détaillé dans les dettes ci-dessous.
3. **Taguer une release uniquement sur demande explicite du user.** M3 et sa
2. **Taguer une release uniquement sur demande explicite du user.** M3 et sa
validation Symfonium sont terminés ; aucune action de compatibilité ne reste
ouverte pour cette porte.
4. **M5** : réconciliation locale/serveur conservatrice.
5. **M6** : finition web studio-nocturne, bilingue, WCAG AA, Playwright.
3. **M5** : réconciliation locale/serveur conservatrice.
4. **M6** : finition web studio-nocturne, bilingue, WCAG AA, Playwright.

## Outillage front

`webapp/` utilise **Biome** (lint + format en une passe) plutôt qu'eslint +
prettier : `bun run lint`, `bun run format`. La suite vitest tourne sous jsdom,
nécessaire aux design tokens qui écrivent sur `document.documentElement`. La CI
web lint, construit et teste.

La directive `biome-ignore` de `useAsync` (`src/pages.tsx`) est placée **juste
avant `}, deps)`**, pas avant `useEffect` : la règle se déclenche sur
l'argument de dépendances, et déplacée plus haut elle ne supprime plus rien —
vérifié.

## Dettes identifiées, non traitées

- `search3` n'exploite pas FTS5 (voir ci-dessus).
- `webapp/` n'a pas de linter. Les tests se limitent aux gardes de redirection
(`isAllowedRedirect`, `safeInternalPath`) : aucun test de composant ni de
parcours. La CI web installe, construit et lance ce vitest.
- `webapp/` n'a pas de test de composant ni de parcours : la suite couvre les
gardes de redirection et les design tokens. La CI web lint (biome), construit
et lance vitest.
- Les jetons de session vivent en `localStorage`, donc exposés à une XSS. C'est
le compromis SPA habituel ; un cookie éviterait cela mais ajouterait une
authentification ambiante et une surface CSRF à une API sinon purement par
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
"build:web": "bun --cwd=webapp run build",
"test": "concurrently --names server,web --prefix-colors blue,magenta \"bun run test:server\" \"bun run test:web\"",
"test:server": "cargo test --all-features",
"lint": "bun run lint:server",
"lint": "concurrently --names server,web --prefix-colors blue,magenta \"bun run lint:server\" \"bun run lint:web\"",
"lint:server": "cargo clippy --all-targets --all-features -- -D warnings",
"fmt": "bun run fmt:server",
"fmt": "concurrently --names server,web --prefix-colors blue,magenta \"bun run fmt:server\" \"bun run fmt:web\"",
"fmt:server": "cargo fmt --all",
"fmt:check": "bun run fmt:check:server",
"fmt:check:server": "cargo fmt --all --check",
"typecheck": "concurrently --names server,web --prefix-colors blue,magenta \"bun run typecheck:server\" \"bun run typecheck:web\"",
"typecheck:server": "cargo check --all-targets --all-features",
"typecheck:web": "bun --cwd=webapp run typecheck",
"check": "bun run typecheck",
"db:migrate": "bun --cwd=web run db:migrate",
"test:web": "bun --cwd=webapp run test"
"test:web": "bun --cwd=webapp run test",
"lint:web": "bun --cwd=webapp run lint",
"fmt:web": "bun --cwd=webapp run format"
},
"devDependencies": {
"concurrently": "^10.0.4"
Expand Down
84 changes: 0 additions & 84 deletions web/.coderabbit.yaml

This file was deleted.

Loading
Loading