Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
Improve Eidoverse island design and world departure
[._.]/ Adam Eivy4f0b2b44101c
diff --git a/client/src/components/eidoverse/EidoverseTravel.jsx b/client/src/components/eidoverse/EidoverseTravel.jsxindex 8e10dededc..4b0513b6dd 100644--- a/client/src/components/eidoverse/EidoverseTravel.jsx+++ b/client/src/components/eidoverse/EidoverseTravel.jsx@@ -3,7 +3,7 @@ import { useAutoRefetch } from '../../hooks/useAutoRefetch';import useMounted from '../../hooks/useMounted';import { departEidoverse, getEidoverseDestinations } from '../../services/api';-export default function EidoverseTravel({ travelRef, enabled, objects = [], onDestinationsChange }) {+export default function EidoverseTravel({ travelRef, enabled, objects = [], onDestinationsChange, beforeDeparture }) {const [destinations, setDestinations] = useState([]);const [pending, setPending] = useState(null);const [error, setError] = useState('');@@ -38,7 +38,9 @@ export default function EidoverseTravel({ travelRef, enabled, objects = [], onDeconst current = generation.current;setPending(peerId);setError('');- await departEidoverse(peerId, { silent: true }).then(({ url }) => {+ await departEidoverse(peerId, { silent: true }).then(async ({ url }) => {+ if (!mounted.current || generation.current !== current) return;+ await beforeDeparture?.();if (mounted.current && generation.current === current) window.location.assign(url);}).catch((failure) => {if (mounted.current && generation.current === current) setError(failure.message || 'Guest travel failed.');@@ -46,14 +48,14 @@ export default function EidoverseTravel({ travelRef, enabled, objects = [], onDebusy.current = false;if (mounted.current) setPending(null);});- }, [enabled, mounted]);+ }, [enabled, mounted, beforeDeparture]);useEffect(() => {travelRef.current = depart;return () => { travelRef.current = null; };}, [depart, travelRef]);if (!enabled) return null;return <div className="flex flex-wrap items-center gap-2 border-b border-port-border px-4 py-2 text-sm">- <span className="text-gray-400">Teleport to</span>+ <span className="text-gray-400">Federation Terminal · Use a pod in-world or choose a destination</span>{destinations.map((destination) => <button key={destination.peerId} type="button" disabled={Boolean(pending)}onClick={() => depart(destination.peerId)} className="min-h-10 rounded-lg border border-port-border px-3 hover:border-port-accent disabled:opacity-50">{pending === destination.peerId ? 'Opening guest visit…' : destination.label}diff --git a/client/src/hooks/useEidoverseFrame.js b/client/src/hooks/useEidoverseFrame.jsindex 1fc5729f4f..621ebb9359 100644--- a/client/src/hooks/useEidoverseFrame.js+++ b/client/src/hooks/useEidoverseFrame.js@@ -13,6 +13,7 @@ export default function useEidoverseFrame(hostUrl, objects = [], onTravel = nullconst objectsRef = useRef(objects);objectsRef.current = objects;const sessionRef = useRef(null);+ const departureRef = useRef(null);const [loaded, setLoaded] = useState({ id: 0, url: null });const [connection, setConnection] = useState({ status: 'checking', capabilities: {} });const [labelVisibility, setLabelVisibility] = useState('off');@@ -21,6 +22,7 @@ export default function useEidoverseFrame(hostUrl, objects = [], onTravel = nullconst onFrameLoad = useCallback(() => {sessionRef.current = null;+ if (frameRef.current?.getAttribute('src') === 'about:blank') return;setConnection({ status: 'checking', capabilities: {} });setLoaded((current) => ({ id: current.id + 1, url: hostUrl }));}, [hostUrl]);@@ -42,13 +44,15 @@ export default function useEidoverseFrame(hostUrl, objects = [], onTravel = nullconst data = event.data;if (data.type === 'eidoverse:ready') {clearTimeout(timer);- session.capabilities = Object.fromEntries(['objectLabels', 'portosNavigation', 'labelPreferences']+ session.capabilities = Object.fromEntries(['objectLabels', 'portosNavigation', 'labelPreferences', 'worldDeparture', 'objectInteraction'].map((key) => [key, data.capabilities?.[key] === 1]));setConnection({ status: 'ready', capabilities: session.capabilities });if (session.capabilities.labelPreferences) source.postMessage({type: 'portos:label-preference', version: EIDOVERSE_FRAME_VERSION, nonce,labelVisibility: preferenceRef.current,}, origin);+ } else if (data.type === 'eidoverse:departed' && session.capabilities.worldDeparture) {+ departureRef.current?.(data.ok === true);} else if (data.type === 'eidoverse:navigate' && session.capabilities.portosNavigation) {const target = eidoverseNavigationTarget(data, objectsRef.current);if (!target) return;@@ -66,10 +70,52 @@ export default function useEidoverseFrame(hostUrl, objects = [], onTravel = nullreturn () => {clearTimeout(timer);window.removeEventListener('message', receive);+ departureRef.current?.(false);if (sessionRef.current === session) sessionRef.current = null;};}, [hostUrl, loaded, navigate]);+ const leaveWorld = useCallback(async () => {+ const session = sessionRef.current;+ const element = frameRef.current;+ if (!element) return;+ if (session?.capabilities.worldDeparture) {+ await new Promise((resolve, reject) => {+ const timer = setTimeout(() => finish(false), 5000);+ const finish = (ok) => {+ clearTimeout(timer);+ departureRef.current = null;+ if (ok) resolve();+ else reject(new Error('Could not leave the current world. Reload it before trying again.'));+ };+ departureRef.current = finish;+ session.source.postMessage({ type: 'portos:depart', version: EIDOVERSE_FRAME_VERSION,+ nonce: session.nonce }, session.origin);+ });+ }+ // Retire even legacy renderers before navigating. A page retained in the+ // browser's back/forward cache must not keep its old world alive.+ await new Promise((resolve, reject) => {+ const onLoad = () => { clearTimeout(timer); resolve(); };+ const timer = setTimeout(() => {+ element.removeEventListener('load', onLoad);+ reject(new Error('The previous world is still closing. Reload before trying again.'));+ }, 3000);+ element.addEventListener('load', onLoad, { once: true });+ element.src = 'about:blank';+ });+ }, []);++ useEffect(() => {+ const restore = (event) => {+ if (event.persisted && hostUrl && frameRef.current?.getAttribute('src') === 'about:blank') {+ frameRef.current.src = hostUrl;+ }+ };+ window.addEventListener('pageshow', restore);+ return () => window.removeEventListener('pageshow', restore);+ }, [hostUrl]);+const changeLabelVisibility = useCallback((value) => {if (!EIDOVERSE_LABEL_PREFERENCES.includes(value)) return;preferenceRef.current = value;@@ -83,5 +129,5 @@ export default function useEidoverseFrame(hostUrl, objects = [], onTravel = null}}, []);- return { frameRef, onFrameLoad, connection, labelVisibility, changeLabelVisibility };+ return { frameRef, onFrameLoad, connection, labelVisibility, changeLabelVisibility, leaveWorld };}diff --git a/client/src/hooks/useEidoverseFrame.test.jsx b/client/src/hooks/useEidoverseFrame.test.jsxindex adb2eb4780..83a5064772 100644--- a/client/src/hooks/useEidoverseFrame.test.jsx+++ b/client/src/hooks/useEidoverseFrame.test.jsx@@ -6,8 +6,9 @@ import { safeRemoveStorage, safeWriteStorage } from '../lib/safeStorage';const hostUrl = 'https://world.example.com/';const objects = [{ id: 'portos-design-v2-signal-app-example', route: '/apps' }];-function Harness({ projected = objects, onTravel } = {}) {+function Harness({ projected = objects, onTravel, capture } = {}) {const frame = useEidoverseFrame(hostUrl, projected, onTravel);+ capture?.(frame);const location = useLocation();return <><iframe title="Test renderer" ref={frame.frameRef} onLoad={frame.onFrameLoad} />@@ -28,6 +29,43 @@ afterEach(() => {});describe('hosted Eidoverse frame navigation', () => {+ it('waits for the current renderer departure acknowledgement before retiring its frame', async () => {+ let frame;+ render(<MemoryRouter><Harness capture={(value) => { frame = value; }} /></MemoryRouter>);+ const iframe = screen.getByTitle('Test renderer');+ const source = iframe.contentWindow;+ const post = vi.spyOn(source, 'postMessage').mockImplementation(() => {});+ fireEvent.load(iframe);+ const { nonce } = post.mock.calls.at(-1)[0];+ send(source, { type: 'eidoverse:ready', version: 1, nonce, capabilities: { worldDeparture: 1 } });+ const done = vi.fn();+ const leaving = frame.leaveWorld().then(done);+ expect(post.mock.calls.at(-1)[0]).toEqual({ type: 'portos:depart', version: 1, nonce });+ send(source, { type: 'eidoverse:departed', version: 1, nonce: 'stale', ok: true });+ expect(done).not.toHaveBeenCalled();+ send(source, { type: 'eidoverse:departed', version: 1, nonce, ok: true });+ await act(async () => { await Promise.resolve(); });+ fireEvent.load(iframe);+ await act(async () => leaving);+ expect(done).toHaveBeenCalledOnce();+ expect(iframe.getAttribute('src')).toBe('about:blank');+ });++ it('refuses travel when the current renderer cannot confirm departure', async () => {+ vi.useFakeTimers();+ let frame;+ render(<MemoryRouter><Harness capture={(value) => { frame = value; }} /></MemoryRouter>);+ const iframe = screen.getByTitle('Test renderer');+ const source = iframe.contentWindow;+ const post = vi.spyOn(source, 'postMessage').mockImplementation(() => {});+ fireEvent.load(iframe);+ const { nonce } = post.mock.calls.at(-1)[0];+ send(source, { type: 'eidoverse:ready', version: 1, nonce, capabilities: { worldDeparture: 1 } });+ const result = frame.leaveWorld().catch(error => error.message);+ await act(async () => { vi.advanceTimersByTime(5000); });+ expect(await result).toMatch(/Could not leave/);+ expect(iframe.getAttribute('src')).not.toBe('about:blank');+ });it('resolves a pod through the local legend rather than a destination claimed by the frame', () => {const onTravel = vi.fn();const pod = { id: 'example-pod', route: '/eidoverse', travelPeerId: 'peer-example' };diff --git a/client/src/pages/Eidoverse.jsx b/client/src/pages/Eidoverse.jsxindex e489cb40e3..7ef3cdda3e 100644--- a/client/src/pages/Eidoverse.jsx+++ b/client/src/pages/Eidoverse.jsx@@ -538,7 +538,7 @@ export default function Eidoverse() {return (<div className="flex h-full min-h-0 flex-col bg-port-bg">- <EidoverseTravel travelRef={travelRef} enabled={Boolean(hostUrl)} objects={worldState?.projection?.lastSummary?.objects || []}+ <EidoverseTravel travelRef={travelRef} beforeDeparture={frame.leaveWorld} enabled={Boolean(hostUrl)} objects={worldState?.projection?.lastSummary?.objects || []}onDestinationsChange={() => {if (projectionStatus === 'running' || draftDirty) return false;if (worldState?.recipe?.includes?.peers !== false) void runProjection().catch(() => {});diff --git a/client/src/pages/EidoverseGuest.jsx b/client/src/pages/EidoverseGuest.jsxindex 98ac74ad1d..480ed0fba0 100644--- a/client/src/pages/EidoverseGuest.jsx+++ b/client/src/pages/EidoverseGuest.jsx@@ -7,6 +7,7 @@ export default function EidoverseGuest() {const [hostUrl, setHostUrl] = useState(null);const [error, setError] = useState('');const [left, setLeft] = useState(false);+ const [leaving, setLeaving] = useState(false);const frame = useEidoverseFrame(hostUrl);useEffect(() => {const controller = new AbortController();@@ -30,7 +31,14 @@ export default function EidoverseGuest() {return <main className="flex h-dvh flex-col bg-port-bg text-white"><header className="flex flex-wrap items-center justify-between gap-3 border-b border-port-border px-4 py-3"><div><h1 className="font-semibold">Eidoverse guest visit</h1><p className="text-sm text-gray-400">Visitor access · Chat is visible to people and agents in this world</p></div>- {!left && <button type="button" className="min-h-10 rounded-lg border border-port-border px-3" onClick={() => {+ {!left && <button type="button" disabled={leaving} className="min-h-10 rounded-lg border border-port-border px-3" onClick={async () => {+ setLeaving(true);+ const departed = await frame.leaveWorld().then(() => true).catch((failure) => {+ setError(failure.message);+ setLeaving(false);+ return false;+ });+ if (!departed) return;setLeft(true);setHostUrl(null);if (window.history.length > 1) window.history.back();diff --git a/docs/features/eidoverse.md b/docs/features/eidoverse.mdindex 8c4bf67e60..4e1b69e4c2 100644--- a/docs/features/eidoverse.md+++ b/docs/features/eidoverse.md@@ -144,6 +144,11 @@ trees, planted beds, and timber seating soften the edges. The center staysclear for pedestrian agents, Persistent Mind avatars, and human guests.Buildings use Eidoverse's existing `comp.structure` grammar: tiled floors,glass frontage, open archways, walls, and roofs, with native collision.+Large district landmarks sit on rooftop plinths behind the frontage. Their+measured bottom and animation clearance keep the entrance and physical sign+visible. Accent-edged paths and shallow entrance canopies connect each hall+to the promenade. These geometry changes reconcile through the existing V3+projection without resetting user overrides or visitor-authored objects.A deterministic GLB adds walking surfaces, decorative seating, and physicaldistrict signs through Eidoverse's ordinary content-addressed upload API.Each install reuses the verified recipe-derived asset on later projections.@@ -503,12 +508,21 @@ The Federation Terminal gives every connected, guest-capable peer a walk-invisitor chamber. Chambers are infrastructure rather than sampled health signals,so the live signal cap cannot silently omit a destination. Inspect a chamberand choose **Teleport as guest**, or use the destination buttons above the world.+With an `objectInteraction: 1` renderer, approach a visible pod within three+metres and press **E**, or tap its action prompt. This works with labels hidden.The local controls name the destination; the authored chamber uses an opaquereference rather than writing machine names into the world log. Destinationchanges refresh the projection while the page is open and its draft is saved.Departure checks the saved peer and its current capabilities, admits a fresh-visitor identity, and opens that host's `/eidoverse/guest` page. The guest shell+visitor identity, and opens that host's `/eidoverse/guest` page. Before navigation, PortOS+requires the departing renderer's `worldDeparture: 1` acknowledgement+when supported: presence and reconnect attempts stop, then the socket closes.+PortOS waits for a blank replacement frame before navigating in the same tab;+older renderers use that frame teardown as their compatibility path. Returning+through browser history restores the home frame. This moves the human visitor;+the install's resident CoS presence continues to belong to its home world.+The guest shellloads its renderer without owner controls or private PortOS bootstrap requests,including when the destination uses the optional instance password. An existingEidoverse browser login cannot replace the guest identity. **Leave world** returns@@ -538,3 +552,24 @@ never automatically exports stored conversation history or private records.Incoming chat makes no AI call and is never an instruction or permission grant.The [guest-conversation ADR](../decisions/2026-09-05-eidoverse-guest-chat.md)documents this narrowly scoped exception to the machine-local record policy.++### Object controls++The Commons island extends into an irregular grassy shoreline, a sandy beach,+an eight-kilometre ocean horizon, and distant mountain islands. This is bounded+authored scenery, not an infinite terrain-streaming or swimming system. It uses+the same portable generated GLB as the city, without texture downloads or AI+calls. Renderers advertising `largeWorldColliders: 1` receive the larger scene;+older runtimes retain the compact city until upgraded. The renderer indexes+large landscape colliders once and uses their triangle BVH for local queries.++Worlds already supports `use {id, action}` and authored server-side behaviors.+The renderer's contextual control exposes a primary `comp.interaction` action+or a sole existing reaction. Switches can use a behavior to emit an ordinary+logged `light` or `comp` change; the world remains authoritative and late joiners+see the resulting state. PortOS pods use the validated frame bridge instead of+sending a world verb or embedding destination URLs in scene data. Keyboard+repeat, chat focus, overlays, distance, and occlusion suppress accidental use.+The renderer implementation and a toggle-lamp example live in the separate+Worlds repository. Controller support is tracked in+[Worlds #11](https://github.com/atomantic/eidoverse-worlds/issues/11).diff --git a/server/lib/README.md b/server/lib/README.mdindex d00208e045..5606c0e045 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -550,3 +550,6 @@ pm` default, `NPM_CONFIG_PREFIX`, nvm/Volta) installed `codex` successfully and| `eidoverseCityLayout.js` | Portable native building components, curated furniture placement, visitor chambers, and ordered signal bays for PortOS Commons. || `eidoverseCitySurface.js` | Deterministic GLB pedestrian paths, gathering terraces, and physical district signs, generated without AI and stored through Eidoverse's content-addressed upload API. || `fableLoomShots.js` | Short-shot grouping, spoken-dialogue timing estimates and 5–10 second render validation. |+| `eidoverseCityLayout.js` | Native halls, rooftop landmark clearance and plinths, curated furniture, visitor chambers, and ordered signal bays for PortOS Commons. |+| `eidoverseCitySurface.js` | Deterministic GLB island scenery, pedestrian paths, gathering terraces, and physical district signs, stored through Eidoverse's content-addressed upload API. |+| `eidoverseIslandLandscape.js` | `appendEidoverseIslandLandscape` appends deterministic coastline, ocean, and distant mountain-island geometry to the Commons asset. |diff --git a/server/lib/eidoverseCityLayout.js b/server/lib/eidoverseCityLayout.jsindex cfb20c53f3..c57e8abe95 100644--- a/server/lib/eidoverseCityLayout.js+++ b/server/lib/eidoverseCityLayout.js@@ -16,6 +16,11 @@ export function eidoverseDesktopHeight(assets = {}) {return 0.1 + (size ? 2.25 * size[1] / Math.max(...size) : 1.05);}+/** Roof slab top, shared by the hall, its plinth, and its landmark. */+export function eidoverseCityRoofHeight(district) {+ return (district.id === 'nexus' ? 5.2 : 3.8) + 0.26;+}+function hall(label, width = 8, height = 3.8) {const tiles = [];const walls = [];@@ -38,11 +43,20 @@ function hall(label, width = 8, height = 3.8) {/** Each building is one bounded component, including its navigable doorways. */export function eidoverseCityArchitecture(districts) {- return districts.map((district) => ({+ return districts.flatMap((district) => [{key: `hall-${district.id}`, districtId: district.id,pos: district.anchor, yaw: eidoverseDistrictYaw(district), structure: hall(district.label, district.id === 'nexus' ? 6 : 8,district.id === 'nexus' ? 5.2 : 3.8),- }));+ }, ...(district.id === 'apps' ? [] : [{+ key: `plinth-${district.id}`, districtId: district.id,+ pos: eidoverseDistrictPoint(district, 0, eidoverseCityRoofHeight(district), -8),+ yaw: eidoverseDistrictYaw(district),+ structure: { tile: 1, wallH: 0.25, slabT: 0.15,+ levels: [{ y: 0, tiles: [[-2, -2], [-1, -2], [0, -2], [1, -2],+ [-2, -1], [-1, -1], [0, -1], [1, -1], [-2, 0], [-1, 0], [0, 0], [1, 0],+ [-2, 1], [-1, 1], [0, 1], [1, 1]],+ walls: [-2, -1, 0, 1].flatMap((n) => [[0, n, -2], [0, n, 2], [1, -2, n], [1, 2, n]]) }] },+ }])]);}/** Furniture sits beside entrances; the forecourt and street stay unobstructed. */diff --git a/server/lib/eidoverseCitySurface.js b/server/lib/eidoverseCitySurface.jsindex d1369b8fd2..10f63c3dfd 100644--- a/server/lib/eidoverseCitySurface.js+++ b/server/lib/eidoverseCitySurface.js@@ -1,6 +1,7 @@/** Deterministic paving and physical signs, uploaded through Eidoverse's GLB door. */import { createHash } from 'node:crypto';import { eidoverseDistrictPoint, eidoverseDistrictYaw } from './eidoverseCityLayout.js';+import { appendEidoverseIslandLandscape } from './eidoverseIslandLandscape.js';// A small architectural stencil. Geometry, not a font download or raster asset.const GLYPHS = {@@ -25,9 +26,10 @@ const linearColor = (hex) => [1, 3, 5].map((start) => {return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;});-function surfaceGeometry(districts) {+function surfaceGeometry(districts, landscape) {const groups = [{ positions: [], normals: [], colors: [], indices: [] },{ positions: [], normals: [], colors: [], indices: [] }];+ if (landscape) groups.push({ positions: [], normals: [], colors: [], indices: [] });let districtFrame = null;const quad = (points, normal, color, material = 0) => {if (districtFrame) {@@ -67,6 +69,17 @@ function surfaceGeometry(districts) {floor(-8.4, -12.4, 8.4, -3.4, 0.02, '#d0c7b1');const distance = Math.hypot(district.anchor[0], district.anchor[2]);floor(-1.8, 3, 1.8, Math.max(4, distance - 30), 0.025, '#e1d9c3');+ // District-colored edges lead from the promenade to an unobstructed door.+ for (const side of [-1, 1]) {+ floor(side * 1.8 - 0.06, -3.5, side * 1.8 + 0.06, Math.max(4, distance - 30), 0.032, district.accent);+ for (let step = 0; step < 5; step += 1) {+ floor(side * 2.4 - 0.2, step * 1.3, side * 2.4 + 0.2, step * 1.3 + 0.65, 0.033, '#f0eadb');+ }+ }+ // A shallow entry canopy and accent fascia give the halls a human scale.+ const canopyY = district.id === 'nexus' ? 3.2 : 2.45;+ floor(-3, -4.2, 3, -2.8, canopyY, '#c6b994');+ sign(-3, canopyY - 0.12, 3, canopyY, -2.8, district.accent);// Low flower beds and timber seats frame the gathering terrace.for (const side of [-1, 1]) {ring(side * 8.5, 7, 0, 1.6, 0.03, '#527449', 20);@@ -99,23 +112,24 @@ function surfaceGeometry(districts) {});}districtFrame = null;+ if (landscape) appendEidoverseIslandLandscape(quad);return groups;}-/** Minimal standard glTF 2.0: two meshes, vertex colors, no external resources. */-export function buildEidoverseCitySurface(districts) {+/** Standard glTF 2.0: vertex colors and island scenery, no external resources. */+export function buildEidoverseCitySurface(districts, { landscape = true } = {}) {if (!Array.isArray(districts) || !districts.length || districts.length > 12|| districts.some(({ anchor }) => !Array.isArray(anchor) || anchor.length !== 3|| anchor.some((n) => !Number.isFinite(n) || Math.abs(n) > 10_000))) {throw new RangeError('City districts need finite anchors within 10,000 metres.');}const ordered = [...districts].sort((a, b) => a.id.localeCompare(b.id));- const geometry = surfaceGeometry(ordered);+ const geometry = surfaceGeometry(ordered, landscape);const chunks = [], bufferViews = [], accessors = [];let byteOffset = 0;const attribute = (values, components, integer = false) => {const bytes = Buffer.alloc(values.length * 4);- values.forEach((value, index) => integer ? bytes.writeUInt32LE(value, index * 4) : bytes.writeFloatLE(value, index * 4));+ values.forEach((value, index) => { if (integer) bytes.writeUInt32LE(value, index * 4); else bytes.writeFloatLE(value, index * 4); });const min = Array(components).fill(Infinity), max = Array(components).fill(-Infinity);values.forEach((value, index) => { const axis = index % components; const encoded = integer ? value : Math.fround(value); min[axis] = Math.min(min[axis], encoded); max[axis] = Math.max(max[axis], encoded); });chunks.push(bytes);@@ -130,9 +144,11 @@ export function buildEidoverseCitySurface(districts) {indices: attribute(group.indices, 1, true), material,}] }));const gltf = { asset: { version: '2.0', generator: 'PortOS Commons' }, scene: 0,- scenes: [{ nodes: [0, 1] }], nodes: [{ mesh: 0, name: 'Paving' }, { mesh: 1, name: 'District signs' }], meshes,+ scenes: [{ nodes: geometry.map((_, index) => index) }],+ nodes: geometry.map((_, mesh) => ({ mesh, name: ['Island and Commons', 'District signs', 'Ocean'][mesh] })), meshes,materials: [{ pbrMetallicRoughness: { baseColorFactor: [1, 1, 1, 1], metallicFactor: 0, roughnessFactor: 1 } },- { pbrMetallicRoughness: { baseColorFactor: [1, 1, 1, 1], metallicFactor: 0, roughnessFactor: 1 }, extensions: { KHR_materials_unlit: {} } }],+ { pbrMetallicRoughness: { baseColorFactor: [1, 1, 1, 1], metallicFactor: 0, roughnessFactor: 1 }, extensions: { KHR_materials_unlit: {} } },+ { pbrMetallicRoughness: { baseColorFactor: [1, 1, 1, 1], metallicFactor: 0.15, roughnessFactor: 0.38 } }],extensionsUsed: ['KHR_materials_unlit'], buffers: [{ byteLength: byteOffset }], bufferViews, accessors };const json = Buffer.from(JSON.stringify(gltf));const jsonLength = Math.ceil(json.length / 4) * 4;diff --git a/server/lib/eidoverseCitySurface.test.js b/server/lib/eidoverseCitySurface.test.jsindex f1463e47f3..a46cc1bd06 100644--- a/server/lib/eidoverseCitySurface.test.js+++ b/server/lib/eidoverseCitySurface.test.js@@ -10,7 +10,7 @@ describe('Commons portable GLB', () => {const first = buildEidoverseCitySurface(EIDOVERSE_WORLD_DESIGN_V3.districts);expect(buildEidoverseCitySurface([...EIDOVERSE_WORLD_DESIGN_V3.districts].reverse())).toEqual(first);const { bytes } = first;- expect(bytes.length).toBeLessThan(1_000_000);+ expect(bytes.length).toBeLessThan(1_500_000);expect(bytes.readUInt32LE(0)).toBe(0x46546c67);expect(bytes.readUInt32LE(4)).toBe(2);expect(bytes.readUInt32LE(8)).toBe(bytes.length);@@ -20,6 +20,16 @@ describe('Commons portable GLB', () => {expect(bytes.readUInt32LE(24 + jsonLength)).toBe(0x004e4942);expect(gltf.buffers).toEqual([{ byteLength: bytes.length - binStart }]);expect(gltf.images).toBeUndefined();+ const land = gltf.accessors[gltf.meshes[0].primitives[0].attributes.POSITION];+ const ocean = gltf.accessors[gltf.meshes[2].primitives[0].attributes.POSITION];+ expect(land.max[1]).toBeGreaterThan(200); // Mountain silhouettes beyond town.+ expect(ocean.max[0]).toBeGreaterThan(7000); // No nearby rectangular stage edge.+ expect(ocean.min[0]).toBeLessThan(-7000);+ expect(ocean.max[1]).toBeLessThan(0); // Water cannot cover the arrival plaza.+ const legacy = buildEidoverseCitySurface(EIDOVERSE_WORLD_DESIGN_V3.districts, { landscape: false });+ const legacyJson = JSON.parse(legacy.bytes.subarray(20, 20 + legacy.bytes.readUInt32LE(12)).toString());+ expect(legacyJson.meshes).toHaveLength(2); // Older collision grids keep their compact scene.+ expect(legacy.bytes.length).toBeLessThan(1_000_000);for (const mesh of gltf.meshes) for (const primitive of mesh.primitives) {const positions = gltf.accessors[primitive.attributes.POSITION];expect(positions.count).toBeGreaterThan(0);diff --git a/server/lib/eidoverseIslandLandscape.js b/server/lib/eidoverseIslandLandscape.jsnew file mode 100644index 0000000000..b26c498b7d--- /dev/null+++ b/server/lib/eidoverseIslandLandscape.js@@ -0,0 +1,57 @@+/** Bounded, deterministic island scenery. No textures, downloads, or AI calls. */+export function appendEidoverseIslandLandscape(quad) {+ const steps = 128;+ const tau = Math.PI * 2;+ const coast = (angle) => 1 + 0.07 * Math.sin(3 * angle) + 0.04 * Math.cos(7 * angle);+ const point = (radius, height, angle, irregular = true) => [+ Math.sin(angle) * radius * (irregular ? coast(angle) : 1), height,+ Math.cos(angle) * radius * (irregular ? coast(angle) : 1),+ ];+ const face = (points, color, material = 0) => {+ const [a, b, c] = points;+ const u = b.map((value, i) => value - a[i]), v = c.map((value, i) => value - a[i]);+ const normal = [u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]];+ const length = Math.hypot(...normal) || 1;+ quad(points, normal.map(value => value / length), color, material);+ };+ // The inner skirt starts beyond the halls, then covers every corner of the+ // original 180m terrain. A beach slopes into the water instead of a cut edge.+ const bands = [[65, 0.03], [82, 0.8], [110, 1.8], [145, 1.2], [160, 0.8], [178, -1.2]];+ for (let band = 0; band < bands.length - 1; band += 1) {+ for (let i = 0; i < steps; i += 1) {+ const a = i / steps * tau, b = (i + 1) / steps * tau;+ const [inner, low] = bands[band], [outer, high] = bands[band + 1];+ face([point(inner, low, a), point(outer, high, a), point(outer, high, b), point(inner, low, b)],+ band >= 3 ? '#cfbc91' : ['#527044', '#5d794b', '#698151'][band]);+ }+ }+ // Eight kilometres of ocean keep its edge beyond the useful horizon. Near+ // water carries a turquoise shelf; offshore water stays a quieter deep blue.+ for (const [inner, outer, color] of [[155, 205, '#4caaaa'], [205, 290, '#398e9e'], [290, 8000, '#326a83']]) {+ for (let i = 0; i < steps; i += 1) {+ const a = i / steps * tau, b = (i + 1) / steps * tau;+ face([point(inner, -0.65, a), point(outer, -0.65, a), point(outer, -0.65, b), point(inner, -0.65, b)], color, 2);+ }+ }+ // Separated islands leave sea passages and open horizon between silhouettes.+ // Several rings of asymmetric ridges read as a landscape rather than cones.+ for (const [index, [angle, distance, width, height]] of [+ [0.25, 680, 210, 160], [0.82, 1100, 270, 240], [1.6, 780, 150, 125],+ [2.45, 1400, 330, 280], [3.35, 920, 220, 180], [3.95, 1500, 290, 260],+ [4.65, 650, 150, 110], [5.5, 1250, 250, 225],+ ].entries()) {+ const cx = Math.sin(angle) * distance, cz = Math.cos(angle) * distance;+ const rings = [[1, -0.7], [0.82, height * 0.13], [0.52, height * 0.45], [0.22, height * 0.83], [0, height]];+ const vertex = (ring, theta) => {+ const [radius, y] = rings[ring];+ const ripple = 1 + 0.16 * Math.sin(theta * 5 + index) + 0.09 * Math.cos(theta * 3);+ return [cx + Math.sin(theta) * width * radius * ripple + (1 - radius) * width * 0.22,+ y * (1 + radius * 0.2 * Math.sin(theta * 3 + index)), cz + Math.cos(theta) * width * radius * ripple];+ };+ for (let ring = 0; ring < rings.length - 1; ring += 1) for (let i = 0; i < 40; i += 1) {+ const a = i / 40 * tau, b = (i + 1) / 40 * tau;+ face([vertex(ring + 1, a), vertex(ring, a), vertex(ring, b), vertex(ring + 1, b)],+ ['#697f72', '#63796e', '#7c8985', height > 200 ? '#d0d8d3' : '#8d9a95'][ring]);+ }+ }+}diff --git a/server/lib/index.js b/server/lib/index.jsindex 9b75a18e3f..d8aac7c2a5 100644--- a/server/lib/index.js+++ b/server/lib/index.js@@ -525,3 +525,4 @@ export * from './videoFailure.js';export * from './eidoverseCityLayout.js';export * from './eidoverseCitySurface.js';export * from './fableLoomShots.js';+export * from './eidoverseIslandLandscape.js';diff --git a/server/services/eidoverseWorld.js b/server/services/eidoverseWorld.jsindex 15e37089a9..22f5f36eed 100644--- a/server/services/eidoverseWorld.js+++ b/server/services/eidoverseWorld.js@@ -1237,7 +1237,8 @@ async function preflightEidoverseProtocol({ signal } = {}) {});}return {- capabilities: eidoverseLabelCapabilities(version),+ capabilities: { ...eidoverseLabelCapabilities(version),+ largeWorldColliders: version.capabilities?.largeWorldColliders === 1 ? 1 : null },sha: safeText(version.sha, 'unknown', 80),commitTime: safeText(version.commitTime, 'unknown', 80),};@@ -1332,7 +1333,9 @@ async function prepareCityAssetLock(resolutions, config, runtimeVersion, { signaconst overrides = config.design?.userOverrides?.assets || {};const measured = await measureAssetLocks(resolutions, overrides, config.design?.assetResolutions || {}, { signal });if (!overrides.citySurface) {- const surface = buildEidoverseCitySurface(config.recipe.districts);+ const surface = buildEidoverseCitySurface(config.recipe.districts, {+ landscape: runtimeVersion?.capabilities?.largeWorldColliders === 1,+ });const head = await waitWithSignal(fetch(libraryUrl(`/library/${surface.path}`), { method: 'HEAD', signal }), signal);if (head.status === 404) {const response = await waitWithSignal(fetch(libraryUrl('/upload', { by: 'portos', name: 'PortOS Commons paving and signs' }), {diff --git a/server/services/eidoverseWorld.runtime.test.js b/server/services/eidoverseWorld.runtime.test.jsindex 89fbadce0a..3950abba8e 100644--- a/server/services/eidoverseWorld.runtime.test.js+++ b/server/services/eidoverseWorld.runtime.test.js@@ -721,10 +721,11 @@ describe('Eidoverse private-world lifecycle', () => {mocks.appStatuses = [{ id: 'app-example', name: 'Example private title', overallStatus: 'online' }];fetch.mockImplementationOnce(async () => Response.json({sha: 'example-label-build', commitTime: '2026-01-01T00:00:00.000Z',- capabilities: { objectLabels: 1, portosNavigation: 1, labelPreferences: 99 },+ capabilities: { objectLabels: 1, portosNavigation: 1, labelPreferences: 99, largeWorldColliders: 1 },}));const first = await world.projectEidoverseWorld();- expect(first.design.reconciliation.runtimeVersion.capabilities).toEqual({ objectLabels: 1, portosNavigation: 1, labelPreferences: null });+ expect(first.design.reconciliation.runtimeVersion.capabilities).toEqual({ objectLabels: 1, portosNavigation: 1, labelPreferences: null, largeWorldColliders: 1 });+ expect(first.design.assetResolutions.citySurface.bytes).toBeGreaterThan(1_000_000);const object = first.summary.objects.find(({ kind }) => kind === 'app');expect(object).toBeDefined();await world.updateEidoverseWorldConfig({ labelAliases: { [object.resourceKey]: 'Example tower' } });diff --git a/server/services/eidoverseWorld.test.js b/server/services/eidoverseWorld.test.jsindex 8ff3fe3e2c..ff4bae8fc2 100644--- a/server/services/eidoverseWorld.test.js+++ b/server/services/eidoverseWorld.test.js@@ -71,7 +71,7 @@ describe('Eidoverse PortOS projection plan', () => {expect(first.summary).toMatchObject({designVersion: 3,liveEntityCount: 2,- infrastructureCount: 76,+ infrastructureCount: 83,sourceAvailability: { apps: true, agents: true, health: true, environment: true },});expect(first.operations).toEqual(expect.arrayContaining([@@ -92,7 +92,7 @@ describe('Eidoverse PortOS projection plan', () => {it('builds a bounded walkable city and retains it without repeat writes', () => {const first = buildProjectionPlan({ source: appSource() });- const structures = first.operations.filter(({ verb, args }) => verb === 'comp' && args.type === 'structure');+ const structures = first.operations.filter(({ verb, args }) => verb === 'comp' && args.type === 'structure' && args.id.includes('-hall-'));expect(structures).toHaveLength(8);for (const { args } of structures) {expect(JSON.stringify(args.data).length).toBeLessThan(8192);@@ -100,6 +100,16 @@ describe('Eidoverse PortOS projection plan', () => {expect(args.data.levels[0].apertures.some((edge) => edge[3] === 'arch')).toBe(true);}const state = snapshotFromPlan(first, { foldModelDefaults: true });+ // Rooftop landmarks must clear both the entrance and the sign, including+ // the bottom of animated landmarks at the lowest point of their bob.+ for (const district of DEFAULT_EIDOVERSE_PROJECTION_RECIPE.districts.filter(({ id }) => id !== 'apps')) {+ const hall = state.entities[`portos-design-v2-city-hall-${district.id}`];+ const landmark = state.entities[`portos-design-v2-infra-${district.id}`];+ const roof = hall.pos[1] + hall.comp.structure.wallH + 0.26;+ expect(landmark.pos[1] - (landmark.comp?.motion?.amp || 0)).toBeGreaterThan(roof);+ const dx = landmark.pos[0] - district.anchor[0], dz = landmark.pos[2] - district.anchor[2];+ expect(Math.hypot(dx, dz)).toBeCloseTo(8);+ }state.entities['visitor-building'] = { lib: 'store/example.glb', comp: { structure: { levels: [] } } };const next = buildProjectionPlan({ source: appSource(), currentState: state });expect(next.operations).toEqual([]);diff --git a/server/services/eidoverseWorldProjection.js b/server/services/eidoverseWorldProjection.jsindex bc7cfb78c4..7f10a0a989 100644--- a/server/services/eidoverseWorldProjection.js+++ b/server/services/eidoverseWorldProjection.js@@ -5,7 +5,7 @@* identical environment, infrastructure, live, ambient, and cleanup verbs.*/-import { eidoverseCityTravelPod, eidoverseCityArchitecture, eidoverseCityFurniture, eidoverseCitySignalPosition, eidoverseModelPlacement, eidoverseDistrictPoint, eidoverseDistrictYaw, eidoverseDesktopHeight } from '../lib/eidoverseCityLayout.js';+import { eidoverseCityRoofHeight, eidoverseCityTravelPod, eidoverseCityArchitecture, eidoverseCityFurniture, eidoverseCitySignalPosition, eidoverseModelPlacement, eidoverseDistrictPoint, eidoverseDistrictYaw, eidoverseDesktopHeight } from '../lib/eidoverseCityLayout.js';import { createHash } from 'node:crypto';import { canonicalStringify } from '../lib/objects.js';import {@@ -476,10 +476,11 @@ export function buildProjectionPlan({ source = {}, recipe = DEFAULT_EIDOVERSE_PRdesiredIds,id,lib: assetPathFor(effectiveRecipe, district.id === 'nexus' ? 'operations' : null, districtSlot),- pos: eidoverseDistrictPoint(district, district.id === 'nexus' ? 5 : (district.id === 'apps' ? -5 : 0),- district.id === 'apps' ? eidoverseDesktopHeight(assetResolutions) : 0, district.id === 'apps' ? 3 : -2),+ pos: eidoverseDistrictPoint(district, district.id === 'apps' ? -5 : 0,+ district.id === 'apps' ? eidoverseDesktopHeight(assetResolutions) : eidoverseCityRoofHeight(district) + 0.56 + (['agents', 'goals', 'memory'].includes(district.id) ? 0.3 : 0),+ district.id === 'apps' ? 3 : -8),yaw: eidoverseDistrictYaw(district) + (district.id === 'federation' ? Math.PI / 2 : 0),- modelSize: ({ nexus: 7, apps: 0.7, agents: 2.5, goals: 3.2, memory: 2.4, data: 2.8, federation: 10, activity: 3.5 })[district.id] || 2,+ modelSize: ({ nexus: 4.5, apps: 0.7, agents: 2.5, goals: 3.2, memory: 2.4, data: 2.8, federation: 5, activity: 3.5 })[district.id] || 2,scale: Number((districtScale * (1 + Math.min(affordances.length, 3) * 0.035)).toFixed(3)),component,motion: ['agents', 'goals', 'memory'].includes(district.id)