openalice-world
[Atlas card](https://atlas.blal.pro/repos/openalice-world) · Live at **[world.blal.pro](https://world.blal.pro)**
Architecture rating
Manifest present+valid with 52 features and roadmap score 100; AGENTS.md and README with Atlas card exist; however 393 missing docstrings across codebase and only 1 TODO/FIXME suggest no in-code architecture notes explaining the complex 3D/multiplayer wiring.
No owned tables (frontend/multiplayer service) so schema/migration/RLS not applicable; however no evidence of input validation or sanitization on the multiplayer/voice data paths; 39 'any' type usages weaken type-level data safety.
Drift score 0/100 in Atlas; 9 undeclared env vars vs 1 declared-unused; 147 format issues, 41 god modules, 61 complexity flags, 39 'any' usages, 10 missing React key props; 1 circular dependency; avg complexity 9.11 with max 166 outlier shows wildly uneven module discipline.
RT_JWT_SECRET in env but 9 env vars undeclared in manifest (drift risk); 33 bare/broad excepts can swallow auth failures; no evidence of rate-limiting, CSP headers, or SSRF guards; CI failing and service returning 404 with 0% uptime.
0% uptime, health probe 404, CI conclusion=failure; max cyclomatic complexity 166 with 7 deep-nesting sites; 33 bare/broad excepts swallow errors; 1 circular dep (IslandScene↔RemotePlayer); no evidence of graceful shutdown, retries, or idempotency on the WS/agent-runner path.
16 raw console.log statements instead of structured logging; health endpoint exists but returns 404; no evidence of metrics export, distributed tracing, or alerting; probe latency 24ms is meaningless when service is down.
Only 2 vitest configs (engine, multiplayer) across 7 packages; no test count or coverage data surfaced; 52 features with minimal test infrastructure means critical paths (terrain, voice, agent NPC, weather) are almost certainly untested.
source · auto-grader-2026-07-08
Ecosystem manifest
.atlas-deps.yml3D multiplayer open world (Three.js + R3F) with terrain, flora, weather, voice, and agent NPCs.
- openalice-authhttpvia NEXT_PUBLIC_AUTH_URLSession auth for world users; X-Internal-Secret for internal GDPR export endpoint
- via NEXT_PUBLIC_PERSONA_URLFetch and update persona profiles (avatar, emotion) displayed in-world
- via NEXT_PUBLIC_RT_URLServer-authoritative real-time state (presence, persona, room entities) via WS delta stream
- via NEXT_PUBLIC_VOICE_URLWebRTC SFU for spatial voice chat in 3D world rooms via @openalicelabs/voice-client
- via CDN_URLStatic assets — VRM models, textures, world scene files served from CDN
- NEXT_PUBLIC_RT_URL
- NEXT_PUBLIC_VOICE_URL
- NEXT_PUBLIC_PERSONA_URL
- NEXT_PUBLIC_AUTH_URL
- INTERNAL_SECRET
- INTERNAL_BROADCAST_SECRET
- docker_image: openalice-world-web
- http_endpoint: https://world.blal.pro
Atlas grepped the repo's source for env reads (rust env::var · ts process.env · py os.environ · shell $VAR) and diffed against the manifest's consumes_env. Two lists below: stale declarations and undeclared reads.
- AGENT_AVATAR_URL
- AGENT_ID
- AGENT_NAME
- IDLE_HEARTBEAT_MS
- NEXT_PUBLIC_WORLD_AOI_RADIUS
- RT_JWT_SECRET
- RT_WS_URL
- TICK_MS
- WORLD_ROOM_ID
- NEXT_PUBLIC_AUTH_URL
Roadmap · what's planned next
- forge-flora-integrationin progress59%ForgeFloraLayer mounted inside IslandScene — wind-swayed InstancedMesh trees + biome shedding + GPU wildlife, replacing the legacy world particles wildlife when active.
- spatial-voice-gain progress67%Spatial WebRTC voice chat via @openalicelabs/voice-client + spatialAudio panner — distance attenuation tuned, occlusion behind portals, mobile audio unlock flow polished.
- dynamic-weather-presetsplanned7%Server-authoritative weather state — clear/rain/snow/storm presets with smooth blends, particle-driven by WorldParticles, audio cues via soundManager.
- agent-npcsplanned12%Multi-agent NPC presence — useWorldAgent + worldAgent driving Alice instances as walking NPCs with persona iframe avatars and voice.
- vr-controlsplanned6%VRControls path productionised — WebXR session lifecycle, controller raycasts for interactions, fallback to mobile if no headset detected.
Code composition
tokei · loc- TSX54.5%
- TypeScript38.2%
- Rust4.6%
- JSON1.6%
- CSS0.5%
- Other0.6%
- TSX54.5%
- TypeScript38.2%
- Rust4.6%
- JSON1.6%
- CSS0.5%
- Other0.6%
- TSX54.5%· 11,364
- TypeScript38.2%· 7,956
- Rust4.6%· 967
- JSON1.6%· 330
- CSS0.5%· 109
- YAML0.3%· 72
- TOML0.1%· 29
- Dockerfile0.1%· 17
- +1 more0.0%· 6 · 1 files
| Language | % code | code | comments | blanks | files |
|---|---|---|---|---|---|
| TSX | 54.5% | 11,364 | 2,025 | 1,166 | 38 |
| TypeScript | 38.2% | 7,956 | 1,961 | 1,361 | 53 |
| Rust | 4.6% | 967 | 49 | 104 | 11 |
| JSON | 1.6% | 330 | 0 | 0 | 16 |
| CSS | 0.5% | 109 | 21 | 16 | 1 |
| YAML | 0.3% | 72 | 42 | 3 | 3 |
| TOML | 0.1% | 29 | 0 | 3 | 1 |
| Dockerfile | 0.1% | 17 | 31 | 8 | 1 |
| JavaScript | 0.0% | 6 | 1 | 1 | 1 |
| Markdown | 0.0% | 0 | 246 | 65 | 4 |
Telemetry ribbon · last 90 days
21 eventsworld-agent-runner/actor
1 feature- world-agent-runner.actorworld-agent-runner/src/actor.rs:5Applies movement/mood ToolCalls (`move_to` / `teleport_to` / `set_mood` / `respond`) from the AgentCore to embodied state, integrates an animated walk each tick (`walking`→`idle` on arrival, facing the travel direction), decays the speaking/lipsync flag, and snapshots to a `WorldPresence`.
world-agent-runner/auth
1 feature- world-agent-runner.auth.mintworld-agent-runner/src/auth.rs:8Mint a short-lived HS256 rt token for a server-side `agent` identity with can_write + can_subscribe, scoped to one room.
world-agent-runner/config
1 feature- world-agent-runner.configworld-agent-runner/src/config.rs:3Env-driven config: which rt server + room to join, the agent's presence identity, and the avatar/cadence. `WORLD_ROOM_ID` MUST equal the UUID the World browser uses for the same room (it derives one via uuid v5 from the room name) — co-location is by shared room UUID.
world-agent-runner/crate
1 feature- world-agent-runner.crateworld-agent-runner/src/lib.rs:17Embodies any AgentCore in an openalice-rt World room as a presence entity (move_to/teleport_to → walk, set_mood → emotion, respond → lipsync), publishing presence the World VRM client renders. Reuses agent-protocol-rs + agent-basic; mirrors the rt wire types (no rt dep).
world-agent-runner/presence
1 feature- world-agent-runner.presence.schemaworld-agent-runner/src/presence.rs:5Flat `x/y/z` (what the World client reads) PLUS a `position` array (what openalice-rt's spatial AOI grid reads) — so the agent renders today and is AOI-filterable when server-side AOI lands, at zero cost. Camel-cased keys (`rotY`, `avatarUrl`, `isSpeaking`, `lookAt`) match the browser's `PresenceData`. Optional puppetry fields (`emote`, `lookAt`) are omitted from the wire when absent (`skip_serializing_if`) so an idle agent's presence stays byte-stable for the dirty-check publisher.
world-agent-runner/protocol
1 feature- world-agent-runner.protocol.wireworld-agent-runner/src/protocol.rs:9Client subset of the rt WS contract: `ClientMessage` (subscribe / mutate / ping), `ServerMessage` (subscribed / delta / …), and the presence-relevant `SubQuery` / `EntityType` / `Action` / `DeltaEntry`.
world-agent-runner/rt-client
1 feature- world-agent-runner.rt-clientworld-agent-runner/src/rt_client.rs:6tokio-tungstenite client speaking the rt wire protocol: a write task drains an outbound queue to the socket; a read task parses `ServerMessage` and forwards presence `DeltaEntry`s to the runtime.
world-agent-runner/runtime
1 feature- world-agent-runner.runtime.loopworld-agent-runner/src/runtime.rs:8Drives one agent in one room: spatial perception in, presence out, every `tick_ms`. Any `AgentCore` plugs in (the demo `WandererAgent`, or the agent-lite ReAct core once extracted) with no change to the loop.
world-agent-runner/wanderer
1 feature- world-agent-runner.wandererworld-agent-runner/src/wanderer.rs:6Minimal AgentCore impl: emits a `move_to` to a random in-bounds point every few ticks, so the agent visibly walks the World room without any model wired up — a smoke harness for the runner.
world/agent
3 features- world.agent.multi-sceneapps/web/src/components/MultiAgentScene.tsx:3no description
- world.agent.runnerpackages/multiplayer/src/worldAgent.ts:13World-side adapter that wires room presence + spatial chat + voice utterances into the OpenAlice agent contract. Same AgentRuntime works in Live, Social, Persona, World — World just adds proximity filtering and exposes change_scene tool calls back to the host renderer.since 0.5.0
- world.web.protocol_agent_hookapps/web/src/hooks/useWorldAgent.ts:67React hook wiring WorldAgent + RestAgentRuntime + agent_config fetching for 3D rooms. Drop-in for legacy chat — once a contract-native runtime ships, only this hook's runtime ctor changes.hook:useWorldAgentsince 0.5.0
world/app
2 features- world.app.forge-demoapps/web/src/app/forge-demo/page.tsx:12Standalone Forge SceneSpec preview page — wind-swayed instanced foliage, Rapier physics collisions, FPS-style WASD/sprint/jump pointer-lock controls, per-biome petal shedding (sakura/maple/dry-husk tints).
- world.app.room-pageapps/web/src/app/[room]/page.tsx:10Per-room entry point for the 3D world — wires RT presence client, WebRTC voice chat, spatial audio, mobile controls, adaptive quality detection, dynamic-imported WorldScene Canvas, and the in-world HUD/chat panel.
world/app/hooks
1 feature- world.app.rt-client-hookapps/web/src/hooks/useRtClient.ts:4React hook bridging the world page to openalice-rt — deterministic UUID v5 from room name, presence connection lifecycle, avatar/emotion store sync, reconnect with backoff.
world/audio
3 features- world.audio.proceduralpackages/engine/src/audio/proceduralAudio.ts:1no description
- world.audio.sound-managerpackages/engine/src/audio/soundManager.ts:1no description
- world.audio.spatialpackages/multiplayer/src/spatialAudio.ts:1no description
world/avatar
2 features- world.avatar.remote-playerpackages/world/src/RemotePlayer.tsx:3no description
- world.avatar.vrmpackages/avatar/src/VRMAvatar.tsx:3no description
world/flora
1 feature- world.flora.biome-layerpackages/forge/src/ForgeBiomeLayer.tsx:414Biome-aware Forge flora — Poisson-spaced canopy/detail/ground meshes per biome with wind-reactive shader.component:ForgeBiomeLayersince 0.4.0
world/forge
7 features- world.forge.biome-layerpackages/forge/src/ForgeBiomeLayer.tsx:1no description
- world.forge.flora-layerpackages/forge/src/ForgeFloraLayer.tsx:15Drop-in R3F flora layer — fetches a Forge SceneSpec, renders every InstanceGroup as a wind-aware InstancedMesh with per-placement HSV tint, drives the foliage shader from a shared FoliageState, overlays biome-specific wind shedding + wildlife.
- world.forge.foliage-shaderpackages/forge/src/foliageShader.ts:1no description
- world.forge.instanced-meshpackages/forge/src/ForgeMesh.tsx:16GLB → Three.js InstancedMesh loader — one draw call per primitive group regardless of placement count, per-instance matrices, wind shader auto-patched on load via patchFoliageScene; module-level scratch objects keep per-frame allocations flat.
- world.forge.scenepackages/forge/src/ForgeScene.tsx:1no description
- world.forge.wildlifepackages/forge/src/Wildlife.tsx:1no description
- world.forge.wind-sheddingpackages/forge/src/WindShedding.tsx:1no description
world/input
2 features- world.input.avatar-movementpackages/world/src/hooks/useAvatarMovement.ts:3no description
- world.input.vr-controlspackages/world/src/VRControls.tsx:3no description
world/network
3 features- world.network.interpolationpackages/multiplayer/src/useInterpolation.ts:3no description
- world.network.predictionpackages/multiplayer/src/usePrediction.ts:3no description
- world.network.syncpackages/multiplayer/src/useWorldSync.ts:3no description
world/render
7 features- world.render.adaptive-qualitypackages/engine/src/quality/adaptive.ts:1no description
- world.render.grass-shaderpackages/engine/src/shaders/grass.ts:1no description
- world.render.particlespackages/engine/src/particles/engine.ts:1no description
- world.render.post-processingpackages/world/src/AnimePostProcessing.tsx:3no description
- world.render.procedural-geometrypackages/engine/src/geometry/procedural.ts:1no description
- world.render.skypackages/world/src/DynamicSky.tsx:3no description
- world.scene.islandpackages/world/src/IslandScene.tsx:2644Full island scene — terrain, ocean, sky, weather, flora, portals, multiplayer avatars, post-processing.component:IslandScenesince 0.1.0
world/scene
1 feature- world.scene.rootapps/web/src/components/WorldScene.tsx:3no description
world/social
3 features- world.social.emote-barpackages/world/src/EmoteBar.tsx:37On-screen emote menu (wave/dance/sit/thumbs-up) for desktop + mobile — a 56px toggle button opens a radial-ish stack of 48px emote buttons wired to triggerEmote (same 1-4 keys as the keyboard shortcuts); auto-closes after a pick.
- world.social.emotespackages/world/src/hooks/useEmotes.ts:3no description
- world.social.screen-sharepackages/world/src/ScreenShareBillboard.tsx:3no description
world/terrain
2 features- world.terrain.generatepackages/engine/src/terrain/generator.ts:179Procedural island terrain via FBM simplex noise — heightmap, biome map, vertex colours, normals, indices.fn:generateTerrainsince 0.1.0
- world.terrain.vegetation-scatterpackages/engine/src/terrain/generator.ts:471Poisson-disc vegetation placement on a terrain biome — deterministic, min-spaced, optional underwater.fn:getVegetationPositionssince 0.1.0
world/ui
1 feature- world.ui.hudpackages/world/src/WorldHUD.tsx:3no description
world/viewer
2 features- world.viewer.mobile-controlspackages/world/src/MobileControls.tsx:19Touch-first virtual joystick + action buttons overlay for the 3D world — 80px outer joystick, 64px Jump/Sprint/Chat buttons (44px touch target floor), auto-hides when desktop pointer-lock active.
- world.viewer.particlespackages/world/src/WorldParticles.tsx:35Aggregate particle host for the 3D world — weather (rain/snow), portal glows, underwater bubbles, water splash, footprints, wildlife (butterflies, fireflies); auto-skips wildlife when Forge flora layer ships its own GPU-instanced version.
world/voice
2 features- world.voice.chatpackages/voice/src/voiceChat.ts:19WebRTC voice chat in 3D world rooms via openalice-voice SFU. Now powered by @openalicelabs/voice-client.hook:useVoiceChatsince 0.4.0
- world.voice.inputpackages/voice/src/voiceInput.ts:1no description
world/weather
1 feature- world.weather.enginepackages/engine/src/weather/system.ts:44224h day/night cycle with 8 phases, 6 weather types, lightning, rainbow, wind, server-authoritative sync.class:WeatherEnginesince 0.1.0