PB-001 — Spatial Site v2 Build Loop · pb-001-spatial-site-loop
Owner directive (2026-07-10), canonical. "Create Blueprints, schemas, schematics, plabooks, cookbooks so you may Loop each part into the generation of the environments of the universe. […] Go executing each step until you have a the whole site, make it so we can optimize the Plabook, enhance the Kernel and adapt the cogni." [src: wiki/development/prompts-archive/by-topic/knowledge-management-and-concept-modeling.md:479]
Content
The full build loop for a Spatial Site v2 instance (spatial-site, first instance: Royal Orbit per squad-instance). A playbook is an ordered table of loop steps; each row is one work particle a squad loops on under sop-001-loop-execution, dispatched by pb-003-run-dispatch. Every step names the gear-sets entry (context + models + tools the datan equips as neuralware) and a machine-checkable verify gate — the method → execute check of the cognitive-loop [src: wiki/engines/cognitive-loop.md:57]. A row that fails its gate bounces back, per the gate-retry rule [src: wiki/engines/cognitive-loop.md:82].
The target of the loop is the WHAT defined in bp-001-spatial-site; the born instance follows the triad flow in sc-001-kernel-cogni-genome and is described in data by schema-genome-spatial-strand with per-asset schema-holonprint contracts.
| step | action | cookbooks | gear-set | verify gate |
|---|---|---|---|---|
| 1 | Scaffold — workspace (packages/engine vanilla-TS engine + app shell), pinned deps, typecheck script [src: HOS-Instance/packages/engine/package.json:16] | cb-vite · cb-threejs | gear.web-core | tsc --noEmit = 0 errors in every package |
| 2 | Contracts — author/extend engine contracts: chapter ids, DOM section map, camera keys, world slabs, theme arc [src: HOS-Instance/packages/engine/src/engine/contracts.ts:40] | cb-patterns-royal-orbit | gear.web-core | contracts compile; every ChapterId has a section id + a disjoint slab [src: HOS-Instance/packages/engine/src/engine/contracts.ts:179] |
| 3 | Generators — offline splat generators (scripts/gen-splats) bake .splat files + manifest.json per quality tier [src: HOS-Instance/packages/engine/src/engine/contracts.ts:13] | cb-spark | gear.gen-splats | manifest bytes/count match files on disk; per-asset count within bm-002-splat-budget |
| 4 | Letterforms — bake the Arabic-letterform sceneries ("old arabic letters forming the scenarios, sand" [src: wiki/development/prompts-archive/by-topic/knowledge-management-and-concept-modeling.md:481]) with dual-position bake (scenery pose A / letterform pose B) for the morph plan | cb-spark | gear.gen-splats | both poses inside the chapter slab AABB; tier counts within bm-002-splat-budget |
| 5 | Loader — streaming byte-progress loader, id-cache, safe mid-flight dispose [src: HOS-Instance/packages/engine/src/engine/loader.ts:108] | cb-spark | gear.web-core | progress events monotonic to total; dispose-during-load leaves no mesh in scene [src: HOS-Instance/packages/engine/src/engine/loader.ts:147] |
| 6 | Renderer shell — one fixed canvas, one SparkRenderer, frame fan-out, viewport fallback chain [src: HOS-Instance/packages/engine/src/engine/renderer.ts:49] | cb-spark · cb-threejs | gear.web-core | boots in 0×0/headless env; MAX_DT clamp active; single canvas in DOM |
| 7 | Scroll spine — Lenis on gsap.ticker emits pageProgress ∈ [0,1]; reduced-motion path emits identical events from native scroll [src: HOS-Instance/packages/engine/src/engine/scroll.ts:60] | cb-lenis · cb-gsap | gear.web-core | progress reaches 0 and 1 at extremes on both paths; QA hook exposed |
| 8 | Chapters — implement Chapter.mount/update/unmount per slab; director prefetch-next / evict-≥2-away [src: HOS-Instance/packages/engine/src/engine/director.ts:182] | cb-patterns-royal-orbit | gear.web-core | resident splats ≤ SPLAT_BUDGET[tier] at every chapter change (bm-002-splat-budget) |
| 9 | Behavior loops — the live-scenery routines ("sceneries running with Loops of behavior … a drone flight over a live scenery" [src: wiki/development/prompts-archive/by-topic/knowledge-management-and-concept-modeling.md:461]): beings, physics events, sparks, per-slice routine of slice/scenery | cb-gsap · cb-patterns-royal-orbit | gear.web-core | fps EMA ≥ 50 with all active-chapter behaviors on (bm-001-web-perf) |
| 10 | Theme + modes — dawn→night arc drives canvas clear color AND --bg each frame (fog = background dissolve); immersive / functional / notebook modes [src: HOS-Instance/packages/engine/src/engine/theme.ts:60] | cb-tailwind · cb-patterns-hosweb | gear.web-core | --bg equals canvas clear hue every frame; ink set swaps exactly once at the night threshold |
| 11 | Pages — the five app pages + notebook + login of bp-001-spatial-site (immersive, interactive PAD/POD, workstation, method, library) | cb-nextjs · cb-react | gear.web-app | all routes 200; hydration clean; login session persists |
| 12 | Hardening — a11y, prefers-reduced-motion, ?lite=1 weak-hardware mode, WebGL-absent fallback [src: HOS-Instance/packages/engine/src/engine/quality.ts:16] | cb-patterns-hosweb | gear.web-app | Lighthouse a11y = 100; CLS < 0.1; site readable with WebGL blocked |
| 13 | Perf pass — DPR governor tuning (down < 50 fps, up after 6 s > 58 fps), asset re-budgeting [src: HOS-Instance/packages/engine/src/engine/quality.ts:38] | cb-patterns-royal-orbit | gear.web-core | all bm-001-web-perf and bm-002-splat-budget thresholds green on desktop and mobile tiers |
| 14 | Deploy — production build, droplet/nginx or edge worker, cache headers, health checks | cb-vite · cb-nextjs | gear.ops | prod URL 200 over TLS; splats served with immutable cache headers; src-status-health green |
Loop discipline: "every loop should have a commit" [src: wiki/development/prompts-archive/by-topic/knowledge-management-and-concept-modeling.md:586] — each row closes with a commit before the squad takes the next particle.
Composition
- uses: cb-spark, cb-threejs, cb-lenis, cb-gsap, cb-vite, cb-react, cb-nextjs, cb-tailwind, cb-patterns-royal-orbit, cb-patterns-hosweb (step references) · bm-001-web-perf, bm-002-splat-budget (gates) · gear-sets (equipment) · schema-genome-spatial-strand, schema-holonprint (data contracts)
- used-by: pb-003-run-dispatch (queued playbook) · squad-eggtech, squad-instance (executing squads) · bp-001-spatial-site (delivery vehicle)
See also
- sc-001-kernel-cogni-genome — how the instance is born before this loop runs
- sop-001-loop-execution — the per-particle loop procedure
- spatial-site · gaussian-splatting · spark-renderer