From cf643a07df843b6f0526bd5a1b759b8549ff5a4e Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 26 Aug 2026 00:23:47 -0400 Subject: [PATCH] docs: honesty sync to post-loop-2 reality (iteration 92) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Counts verified against tree: cargo 461/21, pytest 1035 collected (1006 pass/29 skip), vitest 407/33 + relay 66/4. Feature claims grep-verified before writing; stale spell-enrichment figure corrected 73→82 by running enrich_compendium directly. All documented commands resolve as written. Co-Authored-By: Claude --- AGENTS.md | 8 +++++--- CLAUDE.md | 13 +++++++------ README.md | 25 +++++++++++++++++-------- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 587515c..a98b326 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -51,7 +51,9 @@ PYTHONPATH=python pytest python/tests -v ### Client Build & Typecheck ```bash -cd client && npm run build +cd client && npm run build # tsc typecheck + vite build +npm run test # Vitest unit suite (407 tests across 33 files) +npx vitest run --config vitest.relay.config.mjs # relay unit suite (66 tests in scripts/__tests__) ``` ### Generate SRD Compendiums from Markdown @@ -63,8 +65,8 @@ PYTHONPATH=python python3 -m vtt_orchestrator.compendium.srd_importer ## 4. Codebase Navigation Map -* **`crates/vtt-core/`**: D&D 5e SRD 5.1 rules, 15 conditions, attack & saving throw resolvers, concentration checks, death save state machine, 4-tier task resolution. -* **`crates/vtt-spatial/`**: Bresenham LoS raycasting, half/three-quarters/total cover, A* pathfinding. +* **`crates/vtt-core/`**: D&D 5e SRD 5.1 rules, 15 conditions, attack & saving throw resolvers, concentration checks, death save state machine, dice notation parsing (`kh`/`kl`, `ro` reroll-once, exploding), opportunity attacks with Disengage suppression, Ready actions with structured `ReadiedTrigger`s, inspiration lifecycle, hit-dice short rests, and the exhaustion ladder. +* **`crates/vtt-spatial/`**: Bresenham LoS raycasting, half/three-quarters/total cover, lighting zones & vision modes, visibility polygons (`visibility.rs`), A* pathfinding. * **`crates/vtt-wfc/`**: Wave Function Collapse procedural map & dungeon synthesis. * **`crates/vtt-crdt-sync/`**: Real-time Yjs CRDT relay server (default transport via HMAC-authenticated upgrade; falls back to the engine LWW relay). * **`crates/vtt-scripting/`**: Sandboxed Rhai and Wasmtime execution engines with an absolute 1,000,000-fuel ceiling (`MAX_FUEL_CEILING`; client-requested limits are clamped, never raised) and a max-operation cap on Rhai. diff --git a/CLAUDE.md b/CLAUDE.md index 5075647..ef0eaf0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -14,14 +14,14 @@ This repository contains the **AI-Native Virtual Tabletop (VTT)** system. Use th ### Rust Engine (`crates/`) ```bash cargo build --workspace -cargo test --workspace # 235 tests across 18 suites +cargo test --workspace # 461 tests across 21 suites cargo test -p vtt-core --test srd_rules_tests ``` ### Python Orchestrator (`python/`) ```bash # Run pytest with PYTHONPATH -PYTHONPATH=python pytest python/tests -v # ~580 collected tests (engine-live and live-LLM suites skip when unset) +PYTHONPATH=python pytest python/tests -v # 1035 collected (1006 pass, 29 skip; engine-live and live-LLM suites skip when unset) # Run a specific test module PYTHONPATH=python pytest python/tests/test_srd_importer.py -k test_srd_spell_parser @@ -33,7 +33,8 @@ cd client npm install npm run build # Typechecks via tsc and runs vite build (typically well under 15s) npm run dev # Starts Vite dev server on http://localhost:3000 -npm run test # Vitest unit suite (69 tests across 4 files) +npm run test # Vitest unit suite (407 tests across 33 files) +npx vitest run --config vitest.relay.config.mjs # relay unit suite (66 tests in scripts/__tests__) ``` --- @@ -63,8 +64,8 @@ npm run test # Vitest unit suite (69 tests across 4 files) ## 🛡️ Invariant Checklists Before finalizing changes: -- [ ] All Rust crates compile cleanly with 0 errors; `cargo test --workspace` passes (235 tests across 18 suites). -- [ ] `PYTHONPATH=python pytest python/tests` passes (~580 collected tests; the engine-live and live-LLM suites skip when unset). -- [ ] `cd client && npm run test` passes (69 Vitest tests across 4 files). +- [ ] All Rust crates compile cleanly with 0 errors; `cargo test --workspace` passes (461 tests across 21 suites). +- [ ] `PYTHONPATH=python pytest python/tests` passes (1035 collected tests; the engine-live and live-LLM suites skip when unset). +- [ ] `cd client && npm run test` passes (407 Vitest tests across 33 files), plus the relay suite (`npx vitest run --config vitest.relay.config.mjs`, 66 tests). - [ ] Synthetic playtest benchmark achieves MCR ≥ 98.5%, HCI ≥ 0.95, AFPR ≤ 1.5%, auditor recall ≥ 95% (`./scripts/run_all_benchmarks.sh`). - [ ] `cd client && npm run build` completes in under 15s with zero TypeScript diagnostics. diff --git a/README.md b/README.md index 271d475..cdff91a 100644 --- a/README.md +++ b/README.md @@ -165,9 +165,9 @@ Gates enforced by `scripts/run_all_benchmarks.sh` and CI: | **Hallucination & Continuity Index (HCI)** | $\ge 0.95$ | | **Auditor False-Positive Rate (AFPR)** | $\le 1.5\%$ | | **Auditor Recall** (lethal-narrative probes) | $\ge 95\%$ | -| **Rust Test Suite** (`cargo test --workspace`) | all pass (235 tests) | -| **Python Test Suite** (`PYTHONPATH=python pytest python/tests`) | all pass (~580 collected; engine-live and live-LLM suites gate/skip when unset) | -| **Client Unit Tests** (`npx vitest run`) | all pass (69 tests) | +| **Rust Test Suite** (`cargo test --workspace`) | all pass (461 tests) | +| **Python Test Suite** (`PYTHONPATH=python pytest python/tests`) | all pass (1035 collected; 1006 pass, 29 skip — engine-live and live-LLM suites gate/skip when unset) | +| **Client Unit Tests** (`npx vitest run`) | all pass (407 tests across 33 files; plus the relay suite via `vitest.relay.config.mjs`, 66 tests) | | **Client Production Build** (`npm run build`) | zero TypeScript errors | Latest full local run (2026-08-24, `./scripts/run_all_benchmarks.sh`, 200 turns against a live engine): MCR 100%, HCI 1.00, AFPR 0.0%, auditor recall 100% (15/15 probes), trust-boundary probes 7/7 rejected; measured latency SLA: rules 0.39ms p50, spatial ~0.35ms, intent keyword 1.10ms. These are synthetic self-play results against a scripted playtester; they are not a claim about arbitrary homebrew content. @@ -178,7 +178,9 @@ Latest full local run (2026-08-24, `./scripts/run_all_benchmarks.sh`, 200 turns **Real and exercised today:** - **Engine-authoritative rules**: server-side attack/cast/move/death-save resolution in `vtt-core` with ids-only payloads (`deny_unknown_fields`), action budgets, condition lifecycle timers, spell slot deduction, concentration checks, reaction stack, and safety rewind with full state replay. -- **Full SRD combat maneuver suite**: grapple/shove contested checks with reach and economy gates, two-weapon fighting, and the Help action — wired end-to-end through engine, gateway, and client (with rewind on contested-action failure). +- **Full SRD combat maneuver suite**: grapple/shove contested checks with reach and economy gates, two-weapon fighting, the Help action, opportunity attacks (with Disengage suppression), and Ready actions with structured triggers (`ReadiedTrigger` variants; trigger resolution stays GM-adjudicated) — wired end-to-end through engine, gateway, and client (with rewind on contested-action failure). +- **Player-facing resource systems**: inspiration (award/spend lifecycle wired on the wire), hit-dice short rests, and the 6-level exhaustion ladder in `vtt-core`. +- **Dice notation**: `kh`/`kl` keep-drop, `ro` reroll-once, and exploding dice parsed in `vtt-core/src/dice.rs` (unit-tested in `dice_notation_tests.rs`). - **RBAC at every tier**: role claims in gateway tokens (legacy no-role tokens default to Player), entity ownership enforcement, spectator restrictions, fog-layer ownership, owner-or-GM guards on privileged session routes, GM-only monster spawns, and **wire-level relay RBAC** — hidden tokens, spectator ingress, private fog, and role-projected initial-state snapshots enforced inside the Rust WS relay. - **WFC dungeons**: real solver with reseed retries, wildcard sockets, flood-fill single-region guarantee, deterministic dressing — and a client studio that generates real maps through an engine proxy (no fabricated previews). - **AI orchestrator with live LLM support**: tool-calling agent (`agents/tool_agent.py`) plus streaming narrative against any OpenAI-compatible endpoint configured via `.env` (`LLM_API`/`LLM_KEY`/`LLM_MODEL`); audited-before-yield streaming with honest degradation when no key is present, plus an opt-in live-LLM test suite. @@ -187,15 +189,19 @@ Latest full local run (2026-08-24, `./scripts/run_all_benchmarks.sh`, 200 turns - **Handouts & campaign autosave**: role-enforced handout persistence (create/read/update with owner + role checks) and GM campaign autosave from live engine state, both fail-closed on auth. - **CRDT sync**: Yjs is the default transport via an HMAC-authenticated relay upgrade, with automatic fallback to the engine LWW relay; atmosphere state syncs over the same relay with client-side LWW convergence. - **WebRTC video & voice** via PeerJS (lobby-scoped mesh with real `