diff --git a/CLAUDE-index.md b/CLAUDE-index.md new file mode 100644 index 00000000..dbd3f29e --- /dev/null +++ b/CLAUDE-index.md @@ -0,0 +1,636 @@ +# CLAUDE-index.md — where things are in CLAUDE.md + +Generated by `node scripts/claude-index.cjs` (never edit; on a merge conflict, run it again). +Grep this file for a word, then read CLAUDE.md from that line (`Read CLAUDE.md offset= limit=60`). +7059 lines indexed. + + 1 # CLAUDE.md — theprototype.app + + 12 ## Architecture map + 14 - `src/stores/` — `appStore` (UI panels + `openSceneSection(label)`/`inspectorScrollTo` + 25 - `src/lib/peerHandler.svelte.js` — PeerConnection class; **all incoming messages** + 35 - Open-core seams (#13 M1 + #14 PM, contract in committed `OPEN-CORE.md`): a closed + 77 - `src/lib/triggerSync.js` (DEVX #18, the gameSync/hudSync shape — data in the leaf + 105 - `src/lib/sim/` (36-sim, 1.22): buoyancy, jiggle, fluid tanks. ONE per-frame entry + 128 - `src/lib/spawner.js` + `src/lib/transientObjects.js` (21-B B7): mid-sim body creation, + 147 - `src/lib/sharedLibrary.js` + `src/lib/transferLedger.js` + `components/editors/ + 204 - `src/lib/mountedVolumes.js` (R22 round 13, a LEAF: svelte/store + idb + toast; `sessions` + 228 - `src/lib/storageUsage.js` + `components/menu/StorageModal.svelte` (R22 round 13, a + 246 - `src/lib/explorerView.js` (R22 round 9, a LEAF — stores + arithmetic, imports NOTHING + 252 · THE MODE IS GLOBAL; COLUMNS AND SORT ARE PER VIEW. + 264 · THE SORT IS APPLIED IN `gridEntries` + 281 · R22 ROUND 11 — THE HEADER BECOMES A REAL ONE + 290 · THE SPACER CELL, and why a resizable table needs one. + 305 - R22 ROUND 36 — DELETED KEEPS ITS STRUCTURE + 394 - R22 ROUND 36 (ROOMS) — THE UNNAMED WORLD IS A ROOM WITH AN IDENTITY + 430 - `src/lib/filePreview.js` + `components/editors/FilePreviewWindow.svelte` + + 435 · THE SIBLING LIST IS PUBLISHED, NOT DERIVED. + 446 · PASSTHROUGH STANDS THE PANEL DOWN, NOT THE BODY + 463 · R22 ROUND 12 — MULTIPLE WINDOWS, AND THE 3D FACE. + 481 · R22 ROUND 13 — THE MODEL IS THE SWITCH, AND THE VIEW IS NAVIGABLE. + 498 · R22 ROUND 15 — THE PREVIEW PLAYS ANIMATIONS + 523 · "TYPING" IS NOT "FOCUS IS ON A CONTROL" + 528 · R22 ROUNDS 19-28 — THE CORNER, THE HEADER, AND THE TRANSPORTS. + 547 - `src/lib/saveAs.js` (R22 round 11) — "SAVE AS…", AND WHAT A PREFAB IS MADE OF. A prefab + 549 · A PREFAB RECORD MAY NOW CARRY A `format` AND THE FILE'S OWN `bytes` + 553 · THE BYTES RIDE BESIDE THE SNAPSHOT, NEVER INSTEAD OF IT. + 571 - WINDOW CHROME, R22 ROUNDS 20/25/26/28 + 579 - ROOMS ARE CONTENT PARTITIONS (R22 round 30, the whole arc) + 594 · THE RE-SYNC that makes the gate safe + 604 · getgame was measured INERT and removed + 607 · ROUND 32: THE ARRIVING REPLY HEALS + 621 · ROUND 32: THE ASK HOLDS BOTH DIRECTIONS + 638 · ROUND 33: THE CONNECT DECISION + 663 · ROUND 34: A SAVE NAMES THE ROOM + 673 · ROUND 35: PRIVATE SCENES + 703 · THE CONNECT CONTRACT + 727 · THE MANIFEST + 740 · THE LIBRARY'S FIRST CONTACT + 751 - `src/lib/objectPermissions.js` (#14, store-only) — viewer object permissions, ONLY + 765 - `src/lib/connectionState.js` (store-only) — `sessionHost` (peer that approved OUR + 771 - `src/components/menu/Connect.svelte` — a 3-state pill (`data-state` + 792 - `src/lib/commandsHandler.svelte.js` — receive-side scene appliers + `sendObjects` + 794 - Domain modules in `src/lib/`: `objectActions`, `geometries.svelte.js`, + 822 · The mesh is a triangle soup, but the face TOPOLOGY IS STORED NOW + 1016 · CL-A colliders v2 + 1043 · THE LOWER PEER ID KEEPS THE WORLD + 1272 · SHADER GRAPHS + 1351 · SH5 + 1371 · THE HUD + 1384 · The anchor is the 9-GRID plus PIXEL offsets, never 0..1 fractions + 1390 · **GOLDEN RULE 8, the decision that matters: the authored DOCUMENT replicates + 1424 · 21-D — THE HUD BECOMES INTERACTIVE, AND THE GAME SHELL + 1492 · 21-E — GAME HARDENING + 1538 · E7 HUD content + 1553 · 21-F — LEVELS, COLLECTIBLES v2, HUD EDITOR POLISH + 1626 · 21-G1 — SCENES NOT LEVELS; RECIPE RE-HOMING + 1651 · 21-G2..G5 — PROJECTS, PER-PLAYER PROGRESS, CROSS-SCENE PRESENCE. + 1665 · R22 ROUND 11 CORRECTS THE "PROVEN STABLE" CLAIM + 1901 · SCOPE, settled after C4 shipped and worth not re-litigating: + 1990 · R22 round 12 + 2004 · R22 round 11 + 2014 - `src/modules/` — core modules (hello = the smallest complete example, button = + 2019 · 17-A moved piano/avatar/essentials/car/DUNGEON OUT to `theprototype-app/modules` + 2029 - UI: `components/menu/*` (drawers/modals; visibility via stores + `hidePanels/ + 2104 - `tests/e2e/` — committed Playwright suites (`npm run e2e`, subset by name); + 2106 - Docs (2026-07-24 split): SDK authoring docs live on the PUBLIC docs site + 2112 - `src/lib/knock.js` + `knockMath.js` (24-A) — A HAND KNOCKS A BODY. `knockMath` is the pure + 2126 - `src/lib/lookPresence.js` (P2) — a peer's LOOK as PRESENCE, in the `campreview` shape: + 2131 - `src/lib/postGraphs.js` + `postGraphPresets.js` (P4) — a shader graph whose output IS a + 2136 - `src/lib/materialSharing.js` (D2) — two objects, ONE material, by id. The id is scene data + 2143 - `src/lib/flowPrefs.js` (114) — the node editor's mouse bindings as a LOCAL pref leaf + 2146 - `docking.js` (81.4) — an edge holds TWO stacked panels: `docked` is + 2150 - `meshEdit.js` (F1/F3) — a proportional drag ends in ONE whole-geometry `meshgeo` commit + 2157 - THE VOCABULARY (roadmap 22 R4, locked): + 2160 · room + 2162 - `src/lib/sceneRename.js` (R22 R5, a LEAF, imports nothing): `manifest.renames = {from:{to,at}}` + 2181 - `peerScenes.peersAtScene(map, scene, mine, host)` (R22 R4) — the per-scene session roster, + 2188 - `src/lib/sceneLoader.js` (33 L1, a LEAF: svelte/store only) — A SCENE LOAD MAY TAKE TIME; IT + 2220 · The autosave writes pristine kit pieces as STUBS + 2229 - `src/lib/flowLayout.js` + `src/lib/coalesce.js` (R29 S1/S2, both LEAVES, vitest-covered): + 2235 - `scripts/templates/` — ONE FILE PER TEMPLATE (34 R4 A3). + 2241 - `scripts/author-templates.cjs` (21-C C6-b): a `MODULE_DEFS` LOADER region (now in `templates/index.cjs`; … + 2253 - `playMode.js` `embedMode` / `embedSceneId` / `embedOpenUrl()` (R29 fork 4): the additive + 2261 - ROADMAP 30 — EDIT / INTERACT, AND THE SELECTION THAT FINDS THINGS + 2277 · THE POINTER-CAPTURE THROW (P0) + 2283 · SELECT-THROUGH + 2292 · MODULE CONTENT IN THE OBJECT LIST + 2304 - ROADMAP 30 — GAMES START ON START + 2316 · FREE-CURSOR GAMES + 2325 · STORAGE + 2332 · CONSOLE HYGIENE + 2337 - ROADMAP 30 — THE AUTHOR KIT + 2357 - ROADMAP 30b — THE QUEST ROUND (games in a headset) + 2395 - ROADMAP 30c — THE MESHY ASSET ROUND + 2408 - ROADMAP 31 — TOWERS BECOMES A GAME + 2437 - ROADMAP 31 — THE SECOND QUEST ROUND + 2469 · 34 R5: + 2474 · 34 PF/R1 — `src/lib/perf/` + 2481 · 36 (1.21) — export, touch, loading, theme tokens. + 2498 - ROADMAP 33 — MODULES ACROSS A SCENE SWITCH (33-scene-switch, L2/L3/L4) + 2542 - ROADMAP 33 — LOD GROUPS (33-lod-editor, contract P1) + 2557 - ROADMAP 33 — FUNCTIONAL PACK ITEMS (33-anim-core, contract P2) + 2558 · NOTHING AUTOPLAYS + 2568 · `animRef` (33-scenes) + 2570 - ROADMAP 33 — KIT INSTANCING (33-scenes) + 2579 - ROADMAP 34 — THE GAME KIT, part 1 (34-kit-core, contract T3) + 2605 - ROADMAP 34 R3 — BEHAVIOURS, code-first game logic with a DERIVED live node view (34-behaviours, D1+D2) + 2638 - ROADMAP 33 — EDITOR UI + GAMES (33-editor-ui, 33-games, 33-untangle-core) + + 2652 ## UI design system (redesign epic) + 2654 - All UI follows the redesign spec kept in the `cloud` repo: `docs/design/redesign/SPEC.md` + 2657 - Build UI only from `src/components/ui` primitives (WindowChrome, Tabs, Segmented, Chips, + 2660 - Colours, radii, spacing and type come from the semantic tokens in `app.css` only — no raw + 2662 - Every icon goes through `ui/Icon.svelte` (sizes 16 or 20 only; custom glyphs as `tool:`; enforced by … + 2663 - A redesign change must not alter behaviour: DragRow scrubbing, modifiers, click-to-type, + + 2667 ## Replication golden rules + + 2759 ## Hard-won gotchas (do not rediscover) + 2761 - RAPIER'S KinematicCharacterController COLLIDES WITH SENSORS unless the query passes `EXCLUDE_SENSORS` + 2765 - HEADLESS GPU SCREENSHOTS ON THIS MACHINE (ANGLE/Vulkan, RADV) CAN MISS TEXTURED KIT MESHES + 2768 - A LEVEL WITH NO DYNAMIC BODY STARTS NO SIMULATION, so its walker collides with nothing + 2770 - A sliced load changes what "right after" means. + 2773 - A two-page "in phase" check must compare CLOCKS, not poses + 2776 - A HEADSET'S EYE BUFFER IS NEVER LOWERED + 2780 - AN INSTALLED USER MODULE NEVER UPDATES ITSELF. + 2784 - A VITE STARTED INSIDE `e2e-slot` INHERITS FDS 8/9 AND HOLDS BOTH MACHINE-WIDE E2E LOCKS + 2787 - A LEGACY-MODE TEMPLATE CALL `fn(x)` IS UNTRACKED BEYOND ITS ARGUMENTS + 2790 - A `$state` (deep) PROXY OVER THREE OBJECTS IS A PER-FRAME COST + 2793 - `a ?? b + '/'` IS `a ?? (b + '/')` + 2796 - **HELPER_LAYER MUST NEVER BE 1 OR 2: three's WebXRManager gives the LEFT eye layer 1 and the + 2800 - three's `Euler.toArray()` IS `[x, y, z, 'XYZ']` + 2804 - A BLANKET SHAPE RENAME HITS EVERY KEY OF THAT SHAPE. + 2808 - A rapier collider with no body is FIXED AND SOLID. + 2813 - A THIRD SOFTWARE-GL PAGE BOOTS PAST setupPage's 30 s ON THE 1.17 UNION + 2818 - An ADDITIVE burst vanishes against a bright sky + 2821 - A module effect/click on a Quest cannot rely on the DOM HUD + 2824 - Known, not fixed (30c pack lanes): + 2828 - `TubeGeometry` HANDED A 2D `Shape` BUILDS EVERY VERTEX AS NaN + 2833 - A rAF TIMESTAMP IS THE FRAME'S START, WHICH CAN PRECEDE THE CALL THAT SCHEDULED IT. + 2838 - A HUD TEXT BOX IS A FLEX ROW, SO `text-align` ALONE NEVER CENTRED A SINGLE LINE. + 2842 - A perRound LATCH READS UN-SET THE INSTANT THE ROUND ENDS + 2845 - PARTICLE EMITTERS ARE COUNTED PER PAIR + 2848 - `--use-angle=gl` IS SWIFTSHADER ON LINUX. + 2851 - **EVERY TOP-LEVEL OBJECT IN objectsGroup BECOMES A FIXED PHYSICS BODY, and a decoration GROUP's + 2854 - DESKTOP PLAY SPAWNS AT Scene.svelte's FIXED `` + 2856 - THE EDITOR GRID DRAWS AT y = 0 + 2859 - A FLAT GROUND DISC ENDS IN A BAND, NOT A HORIZON + 2862 - THREE LANES NUMBERING ONE LIST FROM THE SAME BASE COLLIDE. + 2865 - jsDelivr PARSES `@v2` AS A SEMVER VERSION, AND A VERSION IS NEVER RE-RESOLVED. + 2874 · 29f CLOSED IT BY MEASUREMENT + 2888 - A jsDelivr BRANCH ref is `max-age=604800` IN THE BROWSER + 2895 - flowbite-svelte's `Button` FREEZES its class string at mount. + 2904 - An INVALIDATION KEY must name the thing whose change should invalidate. + 2910 - TWO LANES CAN EACH BE CORRECT AND COMPOSE WRONG — the enumerated-roots edition. + 2918 - A guard that saves INTO a store the guarded action then WIPES is a lie. + 2926 - A movement keydown guard must include ALT. + 2931 - e2e: the runner kills a suite at 8 minutes + 2940 - SessionsManager test hooks + 2948 - Vite watches `tests/` + 2954 - **A mount SAVE is several awaits long, so an edit made DURING one is not in the bytes + 2959 - ConfirmModal RESTORES FOCUS AFTER the thing you open next mounts. + 2964 - A SUITE THAT PASSES WITH SECONDS OF HEADROOM AGAINST THE 480s RUNNER CAP IS A COIN. + 2968 - CONSENT MUST BE RECORDED BEFORE THE WRITE THAT PUBLISHES IT. + 2974 - **A HASH IN `currentLevel` MEANS "THESE ARE THE BYTES I LOADED", and adoption must not + 2982 - A RE-SYNC REQUEST IS NOT A JOIN, and the receiver cannot tell unless it is told. + 2988 - FORK 3'S CARRY SEMANTICS MAKE A PULLED gameState ALWAYS LOSE. + 2994 - **WHEN A FLEX ROW OVERFLOWS, WHAT FALLS OFF THE END IS WHATEVER IS LAST IN THE MARKUP — + 3005 - A GROUPED WINDOW IS PLACED BY ITS GROUP, AND `dragWindow` HAS TO BE TOLD. + 3020 - ZERO IS NOT A WIDTH. + 3025 - A TAB GROUP'S MINIMUM IS THE WORST CASE ACROSS ITS MEMBERS, not a constant. + 3032 - A GATE THAT DISABLES THE GESTURE THAT WOULD UNDO ITS OWN STATE STRANDS THE USER. + 3038 - **A COUNTER THAT GAINS A DIGIT MOVES EVERYTHING AFTER IT, and `tabular-nums` alone does + 3045 - **A FRAME -> SECONDS -> FRAME ROUND TRIP IS NOT THE IDENTITY, and the first casualty is + 3056 - **DUPLICATE DOM ids ACROSS COMPONENT INSTANCES ARE HARMLESS UNTIL A `