MindPuck.Web/BIBLE
MindPuck — Project Bible
Single source of truth for what MindPuck IS, is NOT, and the rules that keep it coherent. README says how to build and run it;
docs/DESIGN.mdholds every rule and tuning number; the finish line lives indocs/RELEASE.md. This repo (MindPuck.Web) is the canonical version.
1. The one sentence
Move a puck into the goal with your eyes: an air-hockey puck on a table of obstacles, pushed or pulled by where you look, tracked through an ordinary webcam or phone camera.
2. The product promise
- Three control schemes, stepped with F1: magnetic (default, gaze pulls), steer (look at the puck's edge), repulsor (gaze pushes).
- Every level is generated from a seed and won by a solver bot with an unsteady gaze in all three schemes before you see it, so every level is winnable each way; the bot's time is par.
- Playable with the computer's webcam, a phone's camera, or a mouse/finger with no camera.
- A run is shareable by address (
?seed=1234&level=5).
3. What it is NOT
- Not an eye-tracking library: gaze comes from MindAttic.Webcam.
- Not a multiplayer or scored-online game.
- Not three games: the Unity and Unreal versions are frozen ports of this one's rules.
4. Architecture canon
MindAttic.Webcam (EyeTracker | RemoteGazeSource | MouseGazeSource)
| gaze 0..1
src/main.ts (menu, gaze sources, loop) --> src/core (rules) --> src/game (three.js table, audio)
4.1 Modules
| Path | Role |
|---|---|
src/core/
|
Rules only, no browser or three.js: rng, geometry, level, physics, navgrid, bot, levelgen
|
src/game/
|
renderer.ts (three.js), audio.ts
|
src/main.ts
|
Wiring: gaze sources, menu, game loop, HUD |
tools/levels.mjs
|
npm run levels: what the solver made of a run
|
4.2 Domain model
Table (16 x 9 units, origin top-left, y down), puck (radius 0.42), goal pad (radius 1.1), Level (seed, obstacles, start, goal, par per mode), GazeMode (attract, steer, repel), PuckSim.
4.3 Key services
PuckSim.step (fixed 1/120 s), GenerateLevel with the solver as the check, SolverBot.decide, A* on NavGrid.
5. The Laws
Inherits MindAttic.HouseRules.md by reference.
- The core is pure.
src/corehas no browser, DOM or three.js dependency. - Every level is proven winnable in every scheme by the solver before it is shown.
- Rules change here first. The Unity and Unreal ports mirror this core file for file (same constants, same order of random draws); they are frozen and ported only on the owner's request.
- A zero-confidence gaze pushes nothing (blink, no face).
- New schemes follow DESIGN.md's recipe (physics, bot aim, par, verify, HUD).
6. Verified state
- Game with repulsor, solver-proven levels, camera/phone/pointer input (MP-T2,
87b9097). - Magnetic (MP-T5), steer (MP-T6) and steer anchoring (MP-T7,
67e8725). - 37/37 unit tests green at
91f140d(MS-1 check 2, 2026-11-20). - Not yet played by a real person with a real camera (MS-1 signoff).
7. Active frontier
docs/RELEASE.md: shared milestone MS-1 "MindPuck real-eye verification".
8. Quality bar
npm run build is clean; rule changes come with unit tests and DESIGN.md numbers; npm run levels still shows every level won in every scheme.
9. Glossary
- Par: the solver's time for the level in the current scheme.
- Hold: the 0.9 s (1.7 s in steer) at the start of an attempt when the puck is held still.
- Steer anchor: removal of the standing offset between gaze and puck in steer mode.
- Bridge: MindAttic.Webcam's local relay, which also serves the built game at
/play/.