<!-- SOLIDIVISM · part 10 -->
d control room NOT rendering (after Three.js fix).

**Root cause:** `labelMeshes` used in `addBuilding()` and `createControlRoom()` but never declared. ReferenceError crashed both functions on first call. Zero buildings created.

**Fix:** Added `let labelMeshes = [];` to module declarations.

**Verification:** Browser test confirmed buildings and control room visible.

### Phase O: Cache-Busting (October 8, ~22:43 HST)

**King's words:** "But if you check for flaws in an non updated version that the world is using. You may find culprit inaccuracies."

**My interpretation:** Browser may be running cached old code.

**Finding:** Demo loaded `foundation.js` without version parameter. All fixes invisible to cached browsers.

**Fix:** Added `?v=20261008zz` (later `?v=20261008aaa`), bumped per change.

**King was correct.** We were debugging versions the user wasn't running.

### Phase P: Toolbar Rebuild (October 8, ~22:44 HST)

**King's words:** "My buttons are gone and my control too" (with screenshot showing no UI buttons)

**What I implemented:**
- Right-side vertical toolbar with 3 buttons:
  - 📷 Reset camera
  - 🎛️ Teleport to control room door
  - ? Help alert
- CSS: circular red-bordered buttons, fixed position

**Note:** The Solidivism demo never had a toolbar. The King was comparing to the legacy /solidability/ world's toolbar. I built a minimal replacement; full feature parity not yet achieved.

### Phase Q: Code Completeness Audit (October 8, ~22:41 HST)

**King's words:** "Are the codes in the three.js complete or do they all not have color or structure width depth height etc…"

**Audit results:**
- 35 geometry definitions (all with dimensions)
- 17 material definitions (all with color/texture)
- 45 position definitions
- 9 scene.add calls

**Conclusion:** Codes are complete. Failures were bugs (undeclared variables, missing files), not incomplete definitions.

---

## SECTION 2: PROGRAMMING ERRORS AND DEPENDENCY CASCADES

### Error 1: Undeclared `labelMeshes`

**Source:** Programmer omission during addBuilding() rewrite (Phase J/K).

**Affected code:** `foundation.js`, functions `addBuilding()` and `createControlRoom()`.

**Immediate failure:** `ReferenceError: labelMeshes is not defined` on first `addBuilding()` call.

**Downstream consequences:**
- Loop over 8 buildings: first call crashes → zero buildings created
- `createControlRoom()` also crashes → zero control rooms
- Scene contains only floor, avatar, lights
- User sees empty world (except floor/avatar)

**Misleading symptoms:** Appeared as "buildings not rendering" — suggested a Three.js rendering issue, not a JavaScript ReferenceError. The avatar and floor rendered (they don't use labelMeshes), making it seem like a selective rendering failure.

**Discovery:** Browser test after Three.js restoration showed buildings missing. Searched code for `labelMeshes`, found 2 usages, 0 declarations.

**Evidence:** `grep -n "labelMeshes" foundation.js` returned lines 543, 863 (usages). `grep -n "let labelMeshes"` returned nothing.

**Correction:** Added `let labelMeshes = [];` to module scope.

**Regression test:** Browser test confirmed buildings and control room visible after fix.

**Exponential assessment:** This was CASCADING, not exponential. One error → blocked N subsequent operations in sequence. The impact was linear (N buildings blocked), not multiplicative. However, the DIAGNOSTIC cost was superlinear: the symptom (invisible buildings) suggested many possible causes (materials, geometry, scene graph, renderer), leading to investigation in wrong directions.

### Error 2: Deleted `three.min.js`

**Source:** Unknown delete command in legacy /solidability/ world (per King's theory). File missing from `/opt/epistles/public/solidability/js/`.

**Affected code:** `index.html` script tag: `<script src="/solidability/js/three.min.js">`

**Immediate failure:** 404 on Three.js load.

**Downstream consequences:**
- Browser fell back to cached Three.js (if any)
- Cached version may differ from expected r128
- Rendering glitches: floor appeared blocky/corrupted in King's screenshots
- Unpredictable behavior across different browsers/caches

**Misleading symptoms:** Glitches appeared as texture corruption or "exponential" Three.js bugs. Actually caused by version mismatch or partial cache.

**Discovery:** King proposed: "you may have deleted files connected to this code." Verified: `ls` showed file missing. Found 17 other copies on server, none at the required path.

**Evidence:** `ls: cannot access '/opt/epistles/public/solidability/js/three.min.js': No such file or directory`. `find` located copies elsewhere. MD5 of restored file: eb8549863a97355411c3259a3f93b8e1 (matches known good).

**Correction:** Copied from `/opt/epistles/public/solidability-world/js/three.min.js` to required path.

**Regression test:** Browser test confirmed floor renders cleanly without glitching.

**Exponential assessment:** This was UNPREDICTA