Skip to content

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

Preserve custom landscapes and verify departure navigation

[._.]/ Adam Eivy4e42de456d77
diff --git a/client/src/components/eidoverse/EidoverseTravel.test.jsx b/client/src/components/eidoverse/EidoverseTravel.test.jsx
index ee98f467ab..788963cacc 100644
--- a/client/src/components/eidoverse/EidoverseTravel.test.jsx
+++ b/client/src/components/eidoverse/EidoverseTravel.test.jsx
@@ -1,6 +1,6 @@
import { createRef } from 'react';
import { act, fireEvent, render, screen } from '@testing-library/react';
-import { expect, it, vi } from 'vitest';
+import { afterEach, expect, it, vi } from 'vitest';
vi.mock('../../services/api', () => ({
getEidoverseDestinations: vi.fn(async () => ({
@@ -12,6 +12,26 @@ vi.mock('../../services/api', () => ({
import { departEidoverse } from '../../services/api';
import EidoverseTravel from './EidoverseTravel';
+afterEach(() => { vi.restoreAllMocks(); vi.clearAllMocks(); });
+
+it('enters the admitted destination only after the current world leaves, and stays put if departure fails', async () => {
+ const assign = vi.spyOn(window.location, 'assign').mockImplementation(() => {});
+ const url = 'https://example.com/eidoverse/guest#example-ticket';
+ departEidoverse.mockResolvedValue({ url });
+ let finish;
+ const beforeDeparture = vi.fn().mockRejectedValueOnce(new Error('World is still closing'))
+ .mockImplementationOnce(() => new Promise(resolve => { finish = resolve; }));
+ render(<EidoverseTravel enabled travelRef={createRef()} beforeDeparture={beforeDeparture} />);
+ fireEvent.click(await screen.findByRole('button', { name: 'Example world' }));
+ expect(await screen.findByRole('alert')).toHaveTextContent('World is still closing');
+ expect(assign).not.toHaveBeenCalled();
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Example world' })); });
+ expect(screen.getByRole('button', { name: 'Opening guest visit…' })).toBeDisabled();
+ expect(assign).not.toHaveBeenCalled();
+ await act(async () => { finish(); });
+ expect(assign).toHaveBeenCalledExactlyOnceWith(url);
+});
+
it('restores departure controls after a pending visit settles across a renderer restart', async () => {
let finishDeparture;
departEidoverse.mockReturnValueOnce(new Promise((resolve) => { finishDeparture = resolve; }));
diff --git a/docs/features/eidoverse.md b/docs/features/eidoverse.md
index 4e1b69e4c2..fb509d2756 100644
--- a/docs/features/eidoverse.md
+++ b/docs/features/eidoverse.md
@@ -559,8 +559,11 @@ 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
+calls. Renderers advertising `largeWorldColliders: 1` receive the larger scene
+for the default terrain and district layout. Customized terrain or district
+positions retain the compact city so scenery cannot cover authored buildings;
+custom labels and assets remain supported. Older runtimes also 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.
diff --git a/server/lib/README.md b/server/lib/README.md
index 5606c0e045..96fdad2d16 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -547,8 +547,6 @@ pm` default, `NPM_CONFIG_PREFIX`, nvm/Volta) installed `codex` successfully and
| `testDataIsolation.js` | Runtime backstop against a test WRITING into the install's real `data/` tree — the filesystem analogue of `db.js`'s row-write guard. `isInsideRealDataRoot(path)` canonicalizes a target through symlinked ancestors (it need not exist yet) and tests containment with `pathSafety.js#isPathAtOrInsideDir`, so a `..` climb, a relative path, a `data-archive` sibling, or a differently-cased spelling on a case-insensitive filesystem can't walk in sideways; the real root is re-derived through `dataRoot.js` rather than read from `PATHS`, so a suite that redirects `PATHS.data` to a temp root can't also redirect the guard. `assertNotRealDataWrite(path, operation)` throws under the test runner from `atomicWrite`, the guarded wrappers in `fileCore.js` (`writeFileGuarded`, `appendFileGuarded`, `copyFileGuarded`, `rmGuarded`, `unlinkGuarded`, `createWriteStreamGuarded`), and `collectionStore`'s record delete; `assertNotNewRealDataDir(dir)` is the create-only variant `ensureDir` uses, since `mkdir -p` on an existing directory mutates nothing. Inert outside the runner — the `isTestRunner()` check precedes every syscall. Services mutating files under `data/` route through these guarded wrappers. Closes the write half of the bug class `testDataIsolation.guards.test.js` covers statically and the two-run probe covers for reads (#6176, after #6171, #6203). |
| `testHelper.js` | Test helpers: `request()` (supertest-style HTTP) + `mockJsonResponse`/`mockTextResponse` (fetch `Response` mocks with `.text()`, `.json()`, and a `headers.get` content-type), `startLoopbackServer(app)`/`closeLoopbackServer(server)`/`waitForAbort(signal)` for tests that need a real socket (raw disconnects, SSE streaming) that `request()`'s run-to-completion fetch harness can't model, plus the source-scan pair `collectServerSources()` / `readServerSource(rel)` (and `SERVER_DIR`) used by the whole-tree guard suites — `spawnCwd.test.js` (#3193) and `cliChildEnv.test.js` (#3194). Those guards overlap deliberately, so they share one definition of "a source file"; change the ignore rules here and both move together. Cross-platform trio: `posixPath(v)` normalizes a RECEIVED path before comparing it to a POSIX-spelled literal (no-op on POSIX — never normalize the expectation, which would hide a genuinely wrong path), and `resolveTestPython()` returns an interpreter that actually runs, probing by execution because Windows ships a `python` Store-alias stub that exists but fails; `null` when there is none, for `describe.skipIf`; `pinPlatform(value)` pins `process.platform` and returns a restore that reinstates the ORIGINAL descriptor (deleting the pin when there was none) — it carries the one hazard every hand-rolled pin had to rediscover: never pin above an import that loads a native addon, which picks its prebuilt binary off the platform at load time (#4085). Python-shelling suites also take their two nested budgets from here: `PY_TEST_TIMEOUT_MS` (vitest per-test, passed as `it()`'s third argument — a real interpreter's wall time tracks machine load, not the assertion, so a ~4s case crosses the tight global 10s `testTimeout` on a contended full-suite worker) and the strictly smaller `PY_SUBPROCESS_TIMEOUT_MS` (every `execFileSync` spawn's own `timeout`, so a hung interpreter trips the spawn guard first and names the command instead of producing a bare vitest timeout; a subprocess allowance ABOVE the vitest budget is dead intent — vitest always wins). |
-| `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. |
diff --git a/server/services/eidoverseWorld.js b/server/services/eidoverseWorld.js
index 22f5f36eed..0c6d48c05c 100644
--- a/server/services/eidoverseWorld.js
+++ b/server/services/eidoverseWorld.js
@@ -1333,8 +1333,16 @@ async function prepareCityAssetLock(resolutions, config, runtimeVersion, { signa
const overrides = config.design?.userOverrides?.assets || {};
const measured = await measureAssetLocks(resolutions, overrides, config.design?.assetResolutions || {}, { signal });
if (!overrides.citySurface) {
+ // The authored coast fits the shipped footprint. Preserve customized land
+ // and district positions rather than raising scenery through their halls.
+ const defaultDistricts = DEFAULT_EIDOVERSE_PROJECTION_RECIPE.districts;
+ const fitsLandscape = config.recipe.districts.length === defaultDistricts.length
+ && config.recipe.districts.every(({ id, anchor }) => canonicalStringify(anchor)
+ === canonicalStringify(defaultDistricts.find((district) => district.id === id)?.anchor))
+ && canonicalStringify(config.recipe.environment.terrain)
+ === canonicalStringify(DEFAULT_EIDOVERSE_PROJECTION_RECIPE.environment.terrain);
const surface = buildEidoverseCitySurface(config.recipe.districts, {
- landscape: runtimeVersion?.capabilities?.largeWorldColliders === 1,
+ landscape: runtimeVersion?.capabilities?.largeWorldColliders === 1 && fitsLandscape,
});
const head = await waitWithSignal(fetch(libraryUrl(`/library/${surface.path}`), { method: 'HEAD', signal }), signal);
if (head.status === 404) {
diff --git a/server/services/eidoverseWorld.runtime.test.js b/server/services/eidoverseWorld.runtime.test.js
index 3950abba8e..4d67d1d9c7 100644
--- a/server/services/eidoverseWorld.runtime.test.js
+++ b/server/services/eidoverseWorld.runtime.test.js
@@ -751,6 +751,28 @@ describe('Eidoverse private-world lifecycle', () => {
expect((await world.getEidoverseWorldStatus()).design.labelAliases).toEqual({});
});
+ it.each(['district anchor', 'terrain'])('preserves custom %s geometry on a landscape-capable runtime', async (customization) => {
+ const recipe = structuredClone(world.DEFAULT_EIDOVERSE_PROJECTION_RECIPE);
+ if (customization === 'district anchor') recipe.districts.find(({ id }) => id === 'apps').anchor = [50, 0, 50];
+ else recipe.environment.terrain.flatRadius = 100;
+ await world.updateEidoverseWorldConfig({ recipe });
+ fetch.mockImplementationOnce(async () => Response.json({
+ sha: 'example-landscape-build', commitTime: '2026-01-01T00:00:00.000Z',
+ capabilities: { largeWorldColliders: 1 },
+ }));
+
+ const result = await world.projectEidoverseWorld();
+
+ expect(result.design.reconciliation.runtimeVersion.capabilities.largeWorldColliders).toBe(1);
+ expect(result.recipe.districts).toEqual(recipe.districts);
+ expect(result.recipe.environment.terrain).toEqual(recipe.environment.terrain);
+ const upload = fetch.mock.calls.find(([input]) => new URL(String(input)).pathname === '/upload');
+ const bytes = upload[1].body;
+ const gltf = JSON.parse(bytes.subarray(20, 20 + bytes.readUInt32LE(12)).toString());
+ expect(gltf.meshes).toHaveLength(2); // No raised coast or ocean overlays custom land.
+ expect(result.design.assetResolutions.citySurface.bytes).toBeLessThan(1_000_000);
+ });
+
it('preflights and locks recipe assets before completing a V2 reconciliation', async () => {
const result = await world.projectEidoverseWorld();