3.4 KiB
3.4 KiB
Browser Contract — The Nexus
The minimal set of guarantees a working Nexus browser surface must satisfy. This is the target the smoke suite validates against.
1. Static Assets
The following files MUST exist at the repo root and be serveable:
| File | Purpose |
|---|---|
index.html |
Entry point HTML shell |
app.js |
Main Three.js application |
style.css |
Visual styling |
portals.json |
Portal registry data |
vision.json |
Vision points data |
manifest.json |
PWA manifest |
gofai_worker.js |
GOFAI web worker |
server.py |
WebSocket bridge |
2. DOM Contract
The following elements MUST exist after the page loads:
| ID | Type | Purpose |
|---|---|---|
nexus-canvas |
canvas | Three.js render target |
loading-screen |
div | Initial loading overlay |
hud |
div | Main HUD container |
chat-panel |
div | Chat interface panel |
chat-input |
input | Chat text input |
chat-messages |
div | Chat message history |
chat-send |
button | Send message button |
chat-toggle |
button | Collapse/expand chat |
debug-overlay |
div | Debug info overlay |
nav-mode-label |
span | Current navigation mode display |
ws-status-dot |
span | Hermes WS connection indicator |
hud-location-text |
span | Current location label |
portal-hint |
div | Portal proximity hint |
spatial-search |
div | Spatial memory search overlay |
enter-prompt |
div | Click-to-enter overlay (transient) |
3. Three.js Contract
After initialization completes:
windowhas a THREE renderer created from#nexus-canvas- The canvas has a WebGL rendering context
sceneis aTHREE.Scenewith fogcamerais aTHREE.PerspectiveCameraportalsarray is populated fromportals.json- At least one portal mesh exists in the scene
- The render loop is running (
requestAnimationFrameactive)
4. Loading Contract
- Page loads → loading screen visible
- Progress bar fills to 100%
- Loading screen fades out
- Enter prompt appears
- User clicks → enter prompt fades → HUD appears
5. Provenance Contract
A validation run MUST prove:
- The served files match a known hash manifest from
Timmy_Foundation/the-nexusmain - No file is served from
/Users/apayne/the-matrixor other stale source - The hash manifest is generated from a clean git checkout
- Screenshot evidence is captured and timestamped
6. Data Contract
portals.jsonMUST parse as valid JSON array- Each portal MUST have:
id,name,status,destination vision.jsonMUST parse as valid JSONmanifest.jsonMUST havename,start_url,theme_color
7. WebSocket Contract
server.pystarts without error on port 8765- A browser client can connect to
ws://localhost:8765 - The connection status indicator reflects connected state