Files
lanspread/CLAUDE.md
T
ddidderr 6b65a66465 feat(catalog): separate generated production and local test authority
The launcher previously defaulted to fixtures and production generation used
the source database directly. Generate a separate database and manifest set
from package directories, validating staged output with the application loader
before installation. Keep strict selection by default, with independent
opt-ins for missing games and package version overrides in the copied database.
Share database filtering and staging with the fixture publisher, and include
source metadata and generation modes in the publication cache.

Make normal runs consume existing production authority. Add an explicit local
test recipe with separate resources, app settings, and a compiled startup game
directory. Build-time gates exclude local authority from production and require
Tauri development mode. Document the generation and launch workflows.

Clear generated catalog copies before Tauri copies the selected resource tree
so mode switches and reduced catalogs cannot retain stale manifests. Watch the
copied files to repair deletion and preserve prior output mtimes only when the
bytes are unchanged, allowing subsequent builds to become fresh.

Test Plan:
- `just fmt` -- passed.
- `just clippy` -- passed with warnings denied.
- `just test` -- workspace tests passed using fixture authority.
- `just frontend-test` -- 94 passed.
- `python3 -m unittest discover -s tools -p 'test_catalog_source_cache.py'`
  -- 4 passed.
- `git diff --cached --check` -- passed.
- Interactive GUI launches and production bundles were not exercised.
2026-09-12 19:41:35 +02:00

72 lines
2.9 KiB
Markdown

# lanspread
Peer-to-peer game library sharing for LAN parties. Peers discover each other on
the local network via mDNS, exchange library metadata over QUIC, and let users
browse and download games from each other. Ships as a Tauri desktop app.
## Git
Always commit changes without asking me.
## Workspace layout
Cargo workspace under `crates/`:
- `lanspread-peer` — core peer: networking, library, downloads, services. Start
here for behavior changes. See `crates/lanspread-peer/ARCHITECTURE.md`.
- `lanspread-proto` — wire protocol types shared across peers.
- `lanspread-mdns` — mDNS-SD discovery wrapper.
- `lanspread-db` — database/schema types (sqlx + sqlite).
- `lanspread-compat` — compatibility/migration glue between db and other crates.
- `lanspread-utils` — small shared helpers.
- `lanspread-peer-cli` — JSONL peer harness for scripted and containerized
tests.
- `lanspread-tauri-deno-ts/` — frontend (Vite + Deno + TS in `src/`) and Tauri
shell (`src-tauri/`). This is the GUI client.
Top-level `Cargo.toml` pins workspace dependency versions; per-crate
`Cargo.toml`s set lints (pedantic clippy, `unsafe_code = forbid` on most).
## Commands (justfile)
Never use normal cargo ... commands, use the just ... commands instead.
- `just run` — run the GUI with the already-published production catalogue.
- `just run-local GAMES_DIR` — create/reuse a separate local test catalogue from
the supplied game files and start a development-only launcher with that
folder.
- `just build` — validate production authority and build the launcher without
bundling.
- `just build-production PACKAGES_DIR` — generate/reuse production authority and
build.
- `just run-fixture` / `just build-fixture` — use the test-only catalogue
explicitly.
- `just fmt` — format the workspace.
- `just clippy` — lint the workspace.
- `just test` — run the workspace unit tests.
- `just frontend-test` — run frontend reducer/unit tests.
- `just fix` — auto-apply cargo/clippy fixes, then format.
- `just clean` — wipe the build cache.
- `just peer-cli-build` — build the scripted peer harness.
- `just peer-cli-image` — build the peer harness Docker image.
- `just peer-cli-run NAME` — run one named harness container with persistent
state under `.lanspread-peer-cli/NAME/`.
## Protocol policy
There is only one wire version — the current one. No legacy peers, no
compatibility shims, no fallback paths for older builds. Anyone who wants to
interop must run the current build; everyone else is out. Do not add
backward-compat code, `#[serde(other)]` escape hatches, or "what if an old peer
sends X" defenses.
## Manual CLI testing (docker container)
Start `just peer-cli-alpha`, `just peer-cli-bravo` and `just peer-cli-charlie`
each in its own terminal. You then have 3 peers that you can interact with via
stdin/stdout (JSONL). Use this setup to manually test peer functionality.
## General info
See `README.md`.