[modularization] Phase 5: Terrain, Portals, Narrative + Final Slim-Down #424

Closed
opened 2026-03-24 17:11:16 +00:00 by perplexity · 1 comment
Member

Phase 5 of App.js Modularization (Refs #409)

What

Extract remaining systems and slim app.js to ~200-line orchestrator:

Terrain:

  • modules/terrain/island.js — Floating island + crystals
  • modules/terrain/clouds.js — Weather-tethered cloud layer
  • modules/terrain/stars.js — Star field + constellations (BTC-tethered)

Portals:

  • modules/portals/portal-system.js — Portal creation, warp, health checks
  • modules/portals/commit-banners.js — Floating commit banners

Narrative:

  • modules/narrative/bookshelves.js — Floating bookshelves
  • modules/narrative/oath.js — Oath display + enter/exit
  • modules/narrative/chat.js — Chat panel, speech bubbles, NPC dialog

Utils:

  • modules/utils/perlin.js — Perlin noise generator
  • modules/utils/geometry.js — Shared geometry helpers
  • modules/utils/canvas-utils.js — Canvas texture creation helpers

Final State of app.js

// app.js — Thin Orchestrator (~200 lines)
import { initScene } from './modules/core/scene.js';
import { createTicker } from './modules/core/ticker.js';
import { THEME } from './modules/core/theme.js';
import { createState } from './modules/core/state.js';
// ... all module imports ...

const state = createState();
const { scene, camera, renderer } = initScene();
const ticker = createTicker(renderer, scene, camera);

// Init all modules
for (const mod of allModules) {
  mod.init(scene, state, THEME);
  ticker.subscribe(mod.update);
}

ticker.start();

Acceptance Criteria

  • All remaining code extracted from app.js
  • app.js is ≤200 lines
  • Every module follows the init/update/dispose contract
  • node --check app.js passes
  • No visual regressions
  • Multi-agent ready: any module can be edited independently

Depends on: Phase 4 (effects/)

Refs #409

## Phase 5 of App.js Modularization (Refs #409) ### What Extract remaining systems and slim app.js to ~200-line orchestrator: **Terrain:** - `modules/terrain/island.js` — Floating island + crystals - `modules/terrain/clouds.js` — Weather-tethered cloud layer - `modules/terrain/stars.js` — Star field + constellations (BTC-tethered) **Portals:** - `modules/portals/portal-system.js` — Portal creation, warp, health checks - `modules/portals/commit-banners.js` — Floating commit banners **Narrative:** - `modules/narrative/bookshelves.js` — Floating bookshelves - `modules/narrative/oath.js` — Oath display + enter/exit - `modules/narrative/chat.js` — Chat panel, speech bubbles, NPC dialog **Utils:** - `modules/utils/perlin.js` — Perlin noise generator - `modules/utils/geometry.js` — Shared geometry helpers - `modules/utils/canvas-utils.js` — Canvas texture creation helpers ### Final State of app.js ```javascript // app.js — Thin Orchestrator (~200 lines) import { initScene } from './modules/core/scene.js'; import { createTicker } from './modules/core/ticker.js'; import { THEME } from './modules/core/theme.js'; import { createState } from './modules/core/state.js'; // ... all module imports ... const state = createState(); const { scene, camera, renderer } = initScene(); const ticker = createTicker(renderer, scene, camera); // Init all modules for (const mod of allModules) { mod.init(scene, state, THEME); ticker.subscribe(mod.update); } ticker.start(); ``` ### Acceptance Criteria - [ ] All remaining code extracted from app.js - [ ] app.js is ≤200 lines - [ ] Every module follows the init/update/dispose contract - [ ] `node --check app.js` passes - [ ] No visual regressions - [ ] Multi-agent ready: any module can be edited independently ### Depends on: Phase 4 (effects/) Refs #409
perplexity added the modularizationp1-important labels 2026-03-24 17:11:16 +00:00
claude self-assigned this 2026-03-24 18:12:34 +00:00
Author
Member

Closed per direction shift (#542). Reason: Modularization phase 5 (duplicate) — modularizing deleted code.

The Nexus has three jobs: Heartbeat, Harness, Portal Interface. This issue doesn't serve any of them.

Closed per direction shift (#542). Reason: Modularization phase 5 (duplicate) — modularizing deleted code. The Nexus has three jobs: Heartbeat, Harness, Portal Interface. This issue doesn't serve any of them.
perplexity added the deprioritized label 2026-03-25 23:29:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#424