feat(SCOPONE-0010): vendor agent assets and clean docs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Architecture
|
||||
|
||||
> Last Updated: 2026-04-09T20:59:51.000Z
|
||||
> Last Updated: 2026-04-10T20:33:00.000Z
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
|-----------|-------|
|
||||
| Primary language | TypeScript |
|
||||
| Secondary language | Java |
|
||||
| Source counts | 15 TypeScript files under `src/`, 3 Java files under `android/` |
|
||||
| Source counts | 17 TypeScript source files under `src/`, 3 Java files under `android/app/src/` |
|
||||
| Project type | Phaser browser game packaged for Android with Capacitor |
|
||||
| Framework | Phaser 3.87.0 |
|
||||
| Tooling | Vite 5, TypeScript 5.x, Capacitor 8.3, tsx 4.19 |
|
||||
| Tooling | Vite 5.x, TypeScript 5.x, Capacitor 8.3.x, tsx 4.19.x |
|
||||
| Runtime layout | 1280 x 720, `Phaser.Scale.FIT`, centered in `#game` |
|
||||
| Build command | `npm run build` |
|
||||
| Test command | `npx tsc --noEmit` |
|
||||
| Verification command | `npx tsc --noEmit` |
|
||||
|
||||
The repository is a TypeScript-first implementation of Scopone Scientifico. Pure game rules, scoring, imperfect-information tracking, AI heuristics, worker transport, and benchmark code live under `src/game/`. Phaser scenes under `src/scenes/` own rendering, input, animation, menu flow, status messaging, and procedural audio. The `android/` tree is a Capacitor wrapper with a small custom `MainActivity` that forces immersive full-screen behavior.
|
||||
The repository is a TypeScript-first implementation of Scopone Scientifico. Pure rules, scoring, imperfect-information tracking, AI heuristics, worker transport, and benchmark code live under `src/game/`. Phaser scenes under `src/scenes/` own rendering, input, pacing, menus, and procedural audio. The `android/` tree is a Capacitor wrapper with Gradle configuration and a custom `MainActivity` for immersive full-screen behavior.
|
||||
|
||||
## Project Structure
|
||||
|
||||
@@ -25,24 +25,25 @@ scopone-phaser/
|
||||
|- src/
|
||||
| |- main.ts
|
||||
| |- game/
|
||||
| | |- types.ts
|
||||
| | |- engine.ts
|
||||
| | |- card-tracker.ts
|
||||
| | |- preferences.ts
|
||||
| | |- ai.ts
|
||||
| | |- ai-worker-protocol.ts
|
||||
| | |- ai-worker-client.ts
|
||||
| | |- ai.worker.ts
|
||||
| | |- ai-benchmark-fixtures.ts
|
||||
| | |- ai-benchmark.ts
|
||||
| | `- ai-benchmark-fixtures.ts
|
||||
| | |- ai-worker-client.ts
|
||||
| | |- ai-worker-protocol.ts
|
||||
| | |- ai.ts
|
||||
| | |- ai.worker.ts
|
||||
| | |- card-tracker.ts
|
||||
| | |- engine.ts
|
||||
| | |- preferences.ts
|
||||
| | `- types.ts
|
||||
| `- scenes/
|
||||
| |- BootScene.ts
|
||||
| |- GameScene.ts
|
||||
| |- MenuScene.ts
|
||||
| |- SettingsScene.ts
|
||||
| `- GameScene.ts
|
||||
| `- SettingsScene.ts
|
||||
|- public/
|
||||
|- android/
|
||||
| |- app/
|
||||
| |- build.gradle
|
||||
| `- variables.gradle
|
||||
|- docs/
|
||||
|- prompts/
|
||||
@@ -56,16 +57,16 @@ scopone-phaser/
|
||||
|
||||
| Directory | Purpose |
|
||||
|-----------|---------|
|
||||
| `src/game/` | Rules engine, score calculation, imperfect-information tracking, audio preference persistence, AI heuristics, worker transport, and benchmark harnesses |
|
||||
| `src/scenes/` | Phaser scene lifecycle, menus, settings UI, board rendering, interaction, HUD, audio, and FX |
|
||||
| `public/` | Atlas metadata and static assets loaded by Phaser |
|
||||
| `android/` | Capacitor Android project, Gradle configuration, generated wrapper assets, and the native activity |
|
||||
| `src/game/` | Rules engine, state transitions, score calculation, hidden-information tracking, audio preference persistence, AI heuristics, worker protocol, and benchmark harnesses |
|
||||
| `src/scenes/` | Phaser scene lifecycle, menu flow, settings UI, board rendering, HUD, interaction, particles, and audio playback |
|
||||
| `public/` | Card atlas metadata and other static assets loaded by Phaser |
|
||||
| `android/` | Capacitor Android project, Gradle configuration, generated wrapper assets, and native activity code |
|
||||
| `docs/` | Architecture, code style, findings, and cache metadata |
|
||||
| `prompts/` | JIRA workflow artifacts and iteration state |
|
||||
|
||||
## Design Patterns
|
||||
|
||||
No explicit GoF patterns were detected in the source or by semantic search.
|
||||
No explicit design patterns were detected by semantic search.
|
||||
|
||||
Observed architectural patterns:
|
||||
|
||||
@@ -73,10 +74,10 @@ Observed architectural patterns:
|
||||
|---------|------------------|
|
||||
| Scene-based flow | `BootScene -> MenuScene -> GameScene`, with `SettingsScene` opened from the menu and returning to it |
|
||||
| Functional core / imperative shell | `src/game/` avoids Phaser imports while `src/scenes/` owns runtime side effects |
|
||||
| Immutable state transitions | `applyMove()` clones `GameState` before mutating round state |
|
||||
| Immutable state transitions | `applyMove()` clones `GameState` before applying turn mutations |
|
||||
| Worker offload with fallback | `AIWorkerClient` uses `ai.worker.ts` when available and falls back to direct `chooseMove()` otherwise |
|
||||
| Typed message protocol | `ai-worker-protocol.ts` defines worker request, progress, result, and serialized error shapes |
|
||||
| Persistence adapter | `preferences.ts` normalizes and stores audio settings through a storage boundary instead of scene-local flags |
|
||||
| Persistence adapter | `preferences.ts` normalizes and stores audio settings through a storage boundary |
|
||||
| Deterministic benchmark harness | `ai-benchmark.ts` uses fixtures, seeded self-play, and simulated timing sources to evaluate AI quality |
|
||||
|
||||
## Key Components
|
||||
@@ -85,49 +86,49 @@ Observed architectural patterns:
|
||||
|
||||
- Creates the `Phaser.Game` instance.
|
||||
- Installs a one-shot fullscreen request on first user input when supported.
|
||||
- Registers `BootScene`, `MenuScene`, `GameScene`, and a local `SettingsScene` placeholder; `MenuScene` replaces that placeholder with the concrete `src/scenes/SettingsScene.ts` class before navigation.
|
||||
- Registers `BootScene`, `MenuScene`, `GameScene`, and `SettingsScene` directly in the Phaser game config.
|
||||
|
||||
### `src/game/types.ts`
|
||||
|
||||
- Defines the core game model: `Card`, `Capture`, `Player`, `GameState`, `TeamScore`, and `ScoreBreakdown`.
|
||||
- Models constrained domains with unions such as `PlayerIndex`, `Difficulty`, and `DealerRelativeRole`.
|
||||
- Stores `PRIMIERA_VALUES` for end-of-round scoring.
|
||||
- Stores `PRIMIERA_VALUES` for primiera scoring.
|
||||
|
||||
### `src/game/engine.ts`
|
||||
|
||||
- Builds and shuffles the 40-card deck.
|
||||
- Creates a round state for four players with dealer-relative opening order and stable player labels.
|
||||
- Creates a four-player round state with dealer-relative opening order and stable player labels.
|
||||
- Implements Scopone capture rules where direct value matches take priority over subset-sum captures.
|
||||
- Applies moves immutably, awards scopa only before the final play, assigns leftover table cards to the last capturing team, and computes round and match scoring.
|
||||
- Applies moves immutably, awards scopa only before the final play, assigns leftover table cards to the last capturing team, and computes round scoring.
|
||||
|
||||
### `src/game/card-tracker.ts`
|
||||
|
||||
- Tracks cards visible through play and capture events without exposing hidden hands.
|
||||
- Reconstructs unseen cards from `played + myHand + table`.
|
||||
- Supplies suit counts, same-rank residue summaries, and hand-value probabilities used by the AI tiers.
|
||||
- Reconstructs unseen cards from visible information.
|
||||
- Supplies suit counts, same-rank residue summaries, and probability signals used by higher AI tiers.
|
||||
|
||||
### `src/game/preferences.ts`
|
||||
|
||||
- Defines the persisted audio preference model.
|
||||
- Normalizes possibly invalid storage payloads back to safe defaults.
|
||||
- Normalizes invalid storage payloads back to safe defaults.
|
||||
- Loads and saves preferences through `localStorage` when available, with browser-safe fallbacks.
|
||||
|
||||
### `src/game/ai.ts`
|
||||
|
||||
- Exposes `chooseMove()` as the async AI entry point.
|
||||
- Implements three difficulty tiers: `beginner`, `advanced`, and `master`.
|
||||
- Uses role-aware heuristics, tracker-based inference, tactical priority scoring, determinization sampling, and alpha-beta search.
|
||||
- Applies dynamic master search profiles based on total cards remaining, ranging from the base profile `4300 ms / 8 samples / depth 5 / batch 2` down to `3200 ms / 4 samples / exact endgame depth / batch 1` in the last four cards.
|
||||
- Uses tracker-based inference, tactical scoring, determinization sampling, and alpha-beta search.
|
||||
- Applies dynamic master search profiles, with a base profile of `4300 ms / 8 samples / depth 5 / batch 2` and tighter endgame branches down to `3200 ms / 4 samples / exact remaining depth / batch 1`.
|
||||
|
||||
### `src/game/ai-worker-protocol.ts`
|
||||
|
||||
- Defines a single `choose-move` worker request type.
|
||||
- Defines typed progress, result, and serialized error responses.
|
||||
- Keeps worker communication schema isolated from UI code.
|
||||
- Keeps worker communication schema isolated from scene code.
|
||||
|
||||
### `src/game/ai-worker-client.ts`
|
||||
|
||||
- Wraps worker lifecycle and pending-request tracking behind the same `chooseMove()` API that scenes consume.
|
||||
- Wraps worker lifecycle and pending-request tracking behind the same `chooseMove()` API scenes consume.
|
||||
- Creates the worker as an ES module with `new Worker(new URL('./ai.worker.ts', import.meta.url), { type: 'module' })`.
|
||||
- Fails over pending requests to in-thread AI execution if worker creation, posting, or deserialization fails.
|
||||
|
||||
@@ -139,21 +140,21 @@ Observed architectural patterns:
|
||||
|
||||
### `src/game/ai-benchmark.ts` and `src/game/ai-benchmark-fixtures.ts`
|
||||
|
||||
- Define the AI quality harness invoked by `npm run benchmark:ai-quality`.
|
||||
- Combine fixed fixtures, critical-concept checks, seeded self-play, regression watchlists, and simulated timing sources.
|
||||
- Encode the current iteration 5 benchmark contract: 13 fixed fixtures, 6 critical concepts, and 48 self-play matches.
|
||||
- Define the AI quality harness exposed as `npm run benchmark:ai-quality`.
|
||||
- Combine fixed fixtures, critical-concept checks, seeded self-play, and simulated timing sources.
|
||||
- Enforce the current iteration 5 contract: 13 fixed fixtures, 6 critical concepts, and 48 self-play matches.
|
||||
|
||||
### `src/scenes/BootScene.ts`
|
||||
|
||||
- Loads the card atlas and card back.
|
||||
- Displays a simple loading bar.
|
||||
- Displays a loading bar.
|
||||
- Transitions into `MenuScene` after asset load.
|
||||
|
||||
### `src/scenes/MenuScene.ts`
|
||||
|
||||
- Renders the title, compact rules summary, difficulty selection, and audio-settings entry point.
|
||||
- Reads persisted audio preferences to describe current state before match start.
|
||||
- Ensures the concrete `SettingsScene` class is registered before opening it.
|
||||
- Renders the title, rules summary, difficulty selection, and audio-settings entry point.
|
||||
- Reads persisted audio preferences before match start.
|
||||
- Computes separate desktop and compact-viewport layouts for responsive menu composition.
|
||||
|
||||
### `src/scenes/SettingsScene.ts`
|
||||
|
||||
@@ -163,16 +164,16 @@ Observed architectural patterns:
|
||||
|
||||
### `src/scenes/GameScene.ts`
|
||||
|
||||
- Owns match flow, dealing, selection, capture resolution, AI turn orchestration, score HUD, status UI, think bar, particles, and procedural audio.
|
||||
- Owns match flow, dealing, selection, capture resolution, AI orchestration, score HUD, status UI, think bar, particles, and procedural audio.
|
||||
- Instantiates and disposes `AIWorkerClient` on scene lifecycle events.
|
||||
- Enforces a minimum AI think display time and timer-based move outcome status messages.
|
||||
- Enforces `AI_MIN_THINK_MS = 1000` and `MOVE_OUTCOME_STATUS_MS = 2000` through timer-backed scene logic.
|
||||
- Reads normalized audio preferences from scene data or persisted storage.
|
||||
- Updates `CardTracker` after play and capture events so AI inference remains derived from visible information.
|
||||
|
||||
### `android/app/src/main/java/com/phaser/scopa/MainActivity.java`
|
||||
|
||||
- Extends `BridgeActivity`.
|
||||
- Applies immersive mode during `onCreate()` and whenever window focus returns.
|
||||
- Applies immersive mode during `onCreate()` and when window focus returns.
|
||||
- Hides status and navigation bars with transient swipe behavior.
|
||||
|
||||
## Dependencies
|
||||
@@ -219,7 +220,7 @@ Observed architectural patterns:
|
||||
main.ts
|
||||
-> BootScene
|
||||
-> MenuScene
|
||||
-> SettingsScene (opened on demand after dynamic registration)
|
||||
-> SettingsScene
|
||||
-> GameScene
|
||||
-> engine.ts
|
||||
-> types.ts
|
||||
@@ -248,7 +249,7 @@ Application-level dependency direction is one-way:
|
||||
2. `BootScene` loads atlas assets and starts `MenuScene`.
|
||||
3. `MenuScene` reads persisted audio preferences, lets the player choose difficulty, and can open `SettingsScene` for audio toggles.
|
||||
4. `SettingsScene` writes audio preferences immediately and returns to `MenuScene`.
|
||||
5. `GameScene.create()` normalizes incoming scene data, creates a fresh `CardTracker`, constructs a new `GameState`, and starts the opening deal.
|
||||
5. `GameScene.create()` normalizes incoming scene data, creates a fresh `CardTracker`, creates a new `GameState`, and starts the opening deal.
|
||||
6. Human turns use pointer-driven card selection and `findCaptures()` output to choose legal captures.
|
||||
7. AI turns call `AIWorkerClient.chooseMove(state, playerIdx, difficulty, tracker, onProgress)`.
|
||||
8. `AIWorkerClient` posts a typed request to `ai.worker.ts`; if workers are unavailable, it reruns the same request in-thread.
|
||||
@@ -262,7 +263,9 @@ Application-level dependency direction is one-way:
|
||||
| Command | Source | Purpose |
|
||||
|---------|--------|---------|
|
||||
| `npm run dev` | `package.json` | Starts the Vite dev server |
|
||||
| `npm run build` | user-provided build command | Runs `tsc && vite build` and writes web output to `dist/` |
|
||||
| `npm run build` | `package.json` | Runs `tsc && vite build` and writes web output to `dist/` |
|
||||
| `npm run preview` | `package.json` | Serves the built app with Vite preview |
|
||||
| `npm run benchmark:ai-quality` | `package.json` | Runs the AI benchmark harness through `tsx` |
|
||||
| `npx tsc --noEmit` | user-provided test command | Type-checks the TypeScript codebase without emitting files |
|
||||
| `npx tsc --noEmit` | inferred TypeScript verification | Type-checks the codebase without emitting build artifacts |
|
||||
|
||||
No top-level `tests/` directory was discovered in the repository.
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
# Findings
|
||||
|
||||
> Last Updated: 2026-04-10T09:39:37.000Z
|
||||
> Last Updated: 2026-04-10T20:33:00.000Z
|
||||
|
||||
## Summary
|
||||
|
||||
Initializer refresh for SCOPONE-0010. The cache was invalid because `docs/FINDINGS.md` no longer matched its recorded hash and still contained an outdated note about a `SettingsScene` placeholder in `main.ts`. The observations below reflect the current repository state; `docs/ARCHITECTURE.md` and `docs/CODE_STYLE.md` were revalidated unchanged against the live source.
|
||||
Documentation refresh for the current repository state. `docs/ARCHITECTURE.md` and `docs/FINDINGS.md` were updated to remove stale workflow-specific notes and now reflect the live source tree directly. `docs/CODE_STYLE.md` remains valid without changes.
|
||||
|
||||
## Codebase Observations
|
||||
|
||||
- Primary gameplay code currently lives in 15 TypeScript source files under `src/`; the Android wrapper adds 3 Java files.
|
||||
- Primary gameplay code currently lives in 17 TypeScript source files under `src/`; the Android wrapper adds 3 Java files under `android/app/src/`.
|
||||
- The project is structurally split between framework-free gameplay modules in `src/game/` and Phaser scene code in `src/scenes/`.
|
||||
- `src/scenes/GameScene.ts` and `src/game/ai.ts` remain the two largest concentrations of application logic.
|
||||
- A dedicated audio preference path now exists: `src/game/preferences.ts`, `src/scenes/MenuScene.ts`, and `src/scenes/SettingsScene.ts`.
|
||||
- `main.ts` now imports and registers `SettingsScene` directly in the Phaser scene list; the earlier placeholder-scene workaround is no longer present.
|
||||
- A dedicated audio preference seam exists in `src/game/preferences.ts`, and it is consumed from both `MenuScene` and `SettingsScene`.
|
||||
- `main.ts` imports and registers `SettingsScene` directly in the Phaser scene list.
|
||||
- The AI transport layer is a stable three-file path: `ai-worker-protocol.ts`, `ai-worker-client.ts`, and `ai.worker.ts`.
|
||||
- The AI exposes three difficulty levels: `beginner`, `advanced`, and `master`.
|
||||
- `advanced` and `master` both use `CardTracker` to reason about unseen cards without directly reading hidden hands.
|
||||
- The base `master` search profile is `4300 ms / 8 samples / depth 5 / batch 2`, with tighter endgame branches down to `3200 ms / 4 samples / exact remaining depth / batch 1` when 4 cards remain.
|
||||
- `GameScene` consumes AI progress callbacks to update an on-screen think bar while a worker request is running.
|
||||
- `GameScene` now enforces `AI_MIN_THINK_MS = 1000` and `MOVE_OUTCOME_STATUS_MS = 2000` through timer-backed scene logic.
|
||||
- `GameScene` enforces `AI_MIN_THINK_MS = 1000` and `MOVE_OUTCOME_STATUS_MS = 2000` through timer-backed scene logic.
|
||||
- `AIWorkerClient` fails over pending work to in-thread `chooseMove()` if worker creation, posting, or deserialization fails.
|
||||
- `MenuScene` now includes a responsive layout path for compact viewports, driven by calculated panel bounds and camera zoom instead of a fixed desktop-only composition.
|
||||
- The AI benchmark harness is now in source under `src/game/ai-benchmark.ts` and `src/game/ai-benchmark-fixtures.ts`, and `package.json` exposes it as `npm run benchmark:ai-quality`.
|
||||
- `MenuScene` includes a compact-viewport layout path driven by calculated panel bounds and camera zoom.
|
||||
- The AI benchmark harness lives in source under `src/game/ai-benchmark.ts` and `src/game/ai-benchmark-fixtures.ts`, and `package.json` exposes it as `npm run benchmark:ai-quality`.
|
||||
- The current benchmark contract is iteration 5: 13 fixed fixtures, 6 critical concepts, and 48 self-play matches.
|
||||
- The Android wrapper targets SDK 36 with `minSdkVersion` 24 and applies immersive mode from the native activity.
|
||||
- Audio remains procedural via Web Audio; there is still no dedicated audio asset pipeline in the source tree.
|
||||
- No ESLint or Prettier configuration is present.
|
||||
- The only repository-wide verification command supplied is `npx tsc --noEmit`.
|
||||
- Audio remains procedural via Web Audio; no dedicated audio asset pipeline was discovered in the source tree.
|
||||
- No ESLint or Prettier configuration was discovered.
|
||||
- No top-level `tests/` directory was discovered during analysis.
|
||||
|
||||
## Potential Improvement Areas
|
||||
|
||||
- `GameScene.ts` still centralizes layout, turn flow, HUD updates, effects, audio, status messaging, and AI orchestration in one scene class.
|
||||
- `ai.ts` still combines heuristic tiers, inference helpers, determinization, move ordering, and alpha-beta evaluation in one module.
|
||||
- `MenuScene.ts` now carries substantial responsive layout and decorative rendering logic in the same scene that handles navigation and difficulty selection.
|
||||
- `MenuScene.ts` carries responsive layout and decorative rendering logic in the same scene that handles navigation and difficulty selection.
|
||||
- Worker transport is isolated cleanly, but progress rendering and fallback behavior remain coupled to scene-level UI concerns.
|
||||
- A 3.2 to 4.35 second master search window may still be noticeable on slower mobile devices even with yielding and the minimum-think pacing already in place.
|
||||
- There is no dedicated automated rules test suite beyond type-checking and the AI benchmark harness.
|
||||
- A 3.2 to 4.3 second master search window may still be noticeable on slower mobile devices even with yielding and minimum-think pacing already in place.
|
||||
- No dedicated automated rules test suite was discovered beyond type checking and the AI benchmark harness.
|
||||
- Formatting and style are enforced socially rather than by automated linting or formatting tools.
|
||||
|
||||
## Current Rule / Implementation Notes
|
||||
@@ -54,7 +54,7 @@ Initializer refresh for SCOPONE-0010. The cache was invalid because `docs/FINDIN
|
||||
- `advanced` adds race awareness, anti-scopa logic, partner setup, denari pressure, and tracker-based probability estimates.
|
||||
- `master` orders legal moves with a quick evaluator, samples hidden hands, and scores them with alpha-beta search under a dynamic deadline.
|
||||
- Progress is reported through `AIDecisionProgress` so the scene can keep the think bar responsive.
|
||||
- `CardTracker` now exposes same-rank residue summaries through `getValueRankResidue()` and `getValueRankResidueSummary()`, and those semantics are the live inference surface for unseen-value reasoning.
|
||||
- `CardTracker` remains the inference surface for unseen-card reasoning across higher difficulties.
|
||||
|
||||
### Worker execution snapshot
|
||||
|
||||
@@ -68,7 +68,7 @@ Initializer refresh for SCOPONE-0010. The cache was invalid because `docs/FINDIN
|
||||
|
||||
- `BootScene` loads atlas assets and presents a simple loading bar.
|
||||
- `main.ts` registers `BootScene`, `MenuScene`, `GameScene`, and `SettingsScene` directly in the Phaser game config.
|
||||
- `MenuScene` now exposes both difficulty selection and a dedicated entry point into `SettingsScene`, with a separate compact-layout branch for smaller viewports.
|
||||
- `MenuScene` exposes both difficulty selection and a dedicated entry point into `SettingsScene`, with a separate compact-layout branch for smaller viewports.
|
||||
- `SettingsScene` persists music and effects toggles immediately through `saveAudioPreferences()`.
|
||||
- `GameScene` reads normalized audio preferences from scene data or persisted storage before match start.
|
||||
- `GameScene` tracks played and captured cards in `CardTracker` as the round evolves.
|
||||
@@ -77,9 +77,9 @@ Initializer refresh for SCOPONE-0010. The cache was invalid because `docs/FINDIN
|
||||
|
||||
### Benchmark snapshot
|
||||
|
||||
- `ai-benchmark.ts` now uses a simulated timing source for fixture and self-play evaluation instead of depending only on wall-clock timing.
|
||||
- `ai-benchmark.ts` uses a simulated timing source for fixture and self-play evaluation rather than only wall-clock timing.
|
||||
- The benchmark summary records per-seed aggregates, dual-loss seeds, and a regression watchlist intersection.
|
||||
- The harness remains source-local under `src/`, so it is covered by the default `npx tsc --noEmit` include set.
|
||||
- The harness remains source-local under `src/`, so it is covered by the default TypeScript include set.
|
||||
|
||||
## Research Performed
|
||||
|
||||
@@ -137,16 +137,9 @@ Initializer refresh for SCOPONE-0010. The cache was invalid because `docs/FINDIN
|
||||
|
||||
### SCOPONE-0010: UI, settings, and benchmark refresh notes (2026-04-09)
|
||||
|
||||
- `src/game/preferences.ts` is now the authoritative audio preference seam. It normalizes stored values and shields scenes from malformed storage state.
|
||||
- `src/scenes/MenuScene.ts` now reads persisted audio preferences and exposes a dedicated settings entry point instead of keeping audio options implicit.
|
||||
- `src/game/preferences.ts` is the authoritative audio preference seam. It normalizes stored values and shields scenes from malformed storage state.
|
||||
- `src/scenes/MenuScene.ts` reads persisted audio preferences and exposes a dedicated settings entry point.
|
||||
- `src/scenes/SettingsScene.ts` exists as a real scene and persists music and effects toggles independently through `saveAudioPreferences()`.
|
||||
- `src/scenes/GameScene.ts` already contains the previously planned pacing and status work: `AI_MIN_THINK_MS = 1000`, `MOVE_OUTCOME_STATUS_MS = 2000`, timer-backed `setStatus(...)`, and `handleSceneShutdown()` timer cleanup are all present in source and should be treated as current behavior, not future work.
|
||||
- `src/game/ai-benchmark.ts` now enforces an iteration 5 contract with simulated timing, cross-seed aggregation, dual-loss reporting, and a regression watchlist intersection. Older findings that described iteration 4 targets or wall-clock-only timing are stale.
|
||||
- `src/main.ts` now imports and registers `SettingsScene` directly; the earlier placeholder-scene note is no longer accurate.
|
||||
|
||||
### SCOPONE-0010: Phaser scene-manager and resize notes (2026-04-10)
|
||||
|
||||
- Source: Context7 `/websites/phaser_io_api-documentation`, queries `Phaser 3.87 ScenePlugin add remove get duplicate key behavior and Scale Manager resize event for responsive UI layout in scenes` and `Phaser 3.87 SceneManager add scene duplicate key error getScene get key existing scene unique key documentation`.
|
||||
- `SceneManager.add(key, ...)` requires a unique scene key; replacing a scene under the same key should remove the existing scene first rather than attempting a duplicate add.
|
||||
- `SceneManager.remove(key)` clears the scene key from the cache and destroys that scene's systems, so the current `MenuScene.ensureSettingsSceneAvailable()` pattern is intentionally destructive when it replaces the placeholder scene.
|
||||
- Phaser's resize path dispatches resize events from the Scale Manager / renderer when the display changes size, which is the framework-supported hook for responsive scene relayout if this iteration introduces viewport-aware menu composition.
|
||||
- `src/scenes/GameScene.ts` contains the current pacing and status behavior: `AI_MIN_THINK_MS = 1000`, `MOVE_OUTCOME_STATUS_MS = 2000`, timer-backed status updates, and shutdown cleanup.
|
||||
- `src/game/ai-benchmark.ts` enforces an iteration 5 contract with simulated timing, cross-seed aggregation, dual-loss reporting, and a regression watchlist intersection.
|
||||
- `src/main.ts` imports and registers `SettingsScene` directly.
|
||||
|
||||
12
docs/docs_cache_state.yaml
Normal file
12
docs/docs_cache_state.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
architecture_doc_hash: "958c504e4851227088c4df510b532381"
|
||||
code_style_doc_hash: "e5c92756bf89bc3362c1c1aaa8fb58f6"
|
||||
findings_doc_hash: "a67a017514e3904a183ec291ab9aae6b"
|
||||
workspace_fingerprint: "f2838b2e7a3046fed1c208f5a3fe7026"
|
||||
trust_status: "trusted"
|
||||
trust_reason: "ARCHITECTURE and FINDINGS were refreshed to remove stale workflow-specific references and now describe the repository state directly; CODE_STYLE was revalidated unchanged, and all document hashes plus the manifest fingerprint were recomputed with md5sum."
|
||||
docs_trusted_for_planning: true
|
||||
refresh_required:
|
||||
architecture: false
|
||||
code_style: false
|
||||
findings: false
|
||||
updated_at: "2026-04-10T20:33:00.000Z"
|
||||
Reference in New Issue
Block a user