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
fix: keep Eidoverse aliases manageable and tool results compact (#6275)
[._.]/ Adam Eivya054e64433d5
diff --git a/client/src/components/eidoverse/EidoverseObjectLegend.jsx b/client/src/components/eidoverse/EidoverseObjectLegend.jsxindex ae244b9a18..76213f076f 100644--- a/client/src/components/eidoverse/EidoverseObjectLegend.jsx+++ b/client/src/components/eidoverse/EidoverseObjectLegend.jsx@@ -8,8 +8,22 @@ const ASSET_REASONS = {unresolved: 'Resolution not verified for this model — refresh the world',};+function AliasField({ resourceKey, value, onChange, busy }) {+ return (+ <label className="mt-3 block text-xs text-gray-300" htmlFor={`eidoverse-alias-${resourceKey}`}>+ Display alias for {resourceKey.replace('-', ' ')}+ <input id={`eidoverse-alias-${resourceKey}`} maxLength={72} disabled={busy}+ className="mt-1 min-h-[44px] w-full rounded border border-port-border bg-port-card px-2 text-sm text-white"+ value={value || ''} placeholder="Use generic label"+ onChange={(event) => onChange(resourceKey, event.target.value)} />+ </label>+ );+}+export default function EidoverseObjectLegend({ objects, districts = [], aliases = {}, onAliasChange, busy, onAssets }) {const groups = new Map();+ const currentKeys = new Set((objects || []).map(({ resourceKey }) => resourceKey));+ const unmatchedAliases = Object.entries(aliases).filter(([key]) => !currentKeys.has(key));for (const object of objects || []) {if (!groups.has(object.districtId)) groups.set(object.districtId, []);groups.get(object.districtId).push(object);@@ -37,19 +51,25 @@ export default function EidoverseObjectLegend({ objects, districts = [], aliases<div><dt className="sr-only">Resolution reason</dt><dd className="text-gray-300">{ASSET_REASONS[object.asset?.reason] || ASSET_REASONS.unresolved}</dd></div></dl>{object.resourceKey && (- <label className="mt-3 block text-xs text-gray-300" htmlFor={`eidoverse-alias-${object.resourceKey}`}>- Display alias for {object.name}- <input id={`eidoverse-alias-${object.resourceKey}`} maxLength={72} disabled={busy}- className="mt-1 min-h-[44px] w-full rounded border border-port-border bg-port-card px-2 text-sm text-white"- value={aliases[object.resourceKey] || ''} placeholder="Use generic label"- onChange={(event) => onAliasChange(object.resourceKey, event.target.value)} />- </label>+ <AliasField resourceKey={object.resourceKey} value={aliases[object.resourceKey]}+ onChange={onAliasChange} busy={busy} />)}</article>))}</div></details>))}+ {unmatchedAliases.length > 0 && (+ <section aria-label="Saved aliases without a current object" className="rounded-xl border border-port-border bg-port-bg p-3">+ <h4 className="text-sm font-medium text-white">Saved aliases without a current object</h4>+ <p className="mt-1 text-xs leading-5 text-gray-400">Kept for objects that may return. Clear an alias to remove it without resetting the world.</p>+ <div className="grid gap-3 sm:grid-cols-2">+ {unmatchedAliases.map(([key, value]) => (+ <AliasField key={key} resourceKey={key} value={value} onChange={onAliasChange} busy={busy} />+ ))}+ </div>+ </section>+ )}<button type="button" onClick={onAssets} className="min-h-[44px] rounded-lg border border-port-border px-3 py-2 text-sm text-port-accent">Change or reset asset choices</button>diff --git a/client/src/components/eidoverse/EidoverseWorldDrawer.jsx b/client/src/components/eidoverse/EidoverseWorldDrawer.jsxindex 5db38b1493..d3473c7e15 100644--- a/client/src/components/eidoverse/EidoverseWorldDrawer.jsx+++ b/client/src/components/eidoverse/EidoverseWorldDrawer.jsx@@ -117,7 +117,7 @@ export default function EidoverseWorldDrawer({{labelSupportChecked && !labelSupport && (<p className="mt-2 text-sm text-port-warning" role="status">This renderer does not report object-label support. Update Eidoverse Worlds, then reload this page.- {' '}<Link className="underline" to={appId ? `/apps/${appId}/overview` : '/apps'}>Manage renderer updates</Link>+ {' '}<Link className="underline" to={appId ? `/apps/${appId}/overview` : '/apps'}>Manage renderer updates</Link>.{' '}Your design, aliases, and asset choices stay saved. The object legend below remains available.</p>)}diff --git a/client/src/pages/Eidoverse.test.jsx b/client/src/pages/Eidoverse.test.jsxindex b4fd9c2d0e..2856d59905 100644--- a/client/src/pages/Eidoverse.test.jsx+++ b/client/src/pages/Eidoverse.test.jsx@@ -190,7 +190,7 @@ describe('Eidoverse hosted page', () => {const legend = screen.getByRole('region', { name: 'Projected object labels' });expect(within(legend).getByText('Managed app 012345')).toBeInTheDocument();expect(within(legend).getByText('Fallback — available library asset')).toBeInTheDocument();- const alias = screen.getByLabelText('Display alias for Managed app 012345');+ const alias = screen.getByLabelText('Display alias for app 0123456789ab');expect(alias).toHaveValue('');await user.type(alias, 'Example tower');api.updateEidoverseWorldConfig.mockRejectedValueOnce(new Error('Example save failure'));@@ -208,6 +208,33 @@ describe('Eidoverse hosted page', () => {));});+ it('clears aliases for absent objects without resetting and distinguishes identical display names', async () => {+ const user = userEvent.setup();+ const keys = ['app-0123456789ab', 'app-abcdef012345'];+ const absentKey = 'agent-0123456789ab';+ const labelAliases = { [keys[0]]: 'Example tower', [keys[1]]: 'Example tower', [absentKey]: 'Example retired beacon' };+ const objects = keys.map((resourceKey) => ({+ id: `example-${resourceKey}`, resourceKey, kind: 'app', districtId: 'apps',+ name: 'Example tower', description: 'An app this install manages.', visibility: 'nearby',+ }));+ const saved = { ...worldResponse, design: { ...design, labelAliases }, projection: { lastSummary: { objects } } };+ api.getEidoverseWorldStatus.mockResolvedValueOnce(saved);+ api.projectEidoverseWorld.mockResolvedValueOnce({ success: true, ...saved });+ renderPage();+ await screen.findByTitle('Eidoverse Worlds');+ await user.click(screen.getByRole('button', { name: 'World controls' }));+ await user.click(screen.getByRole('tab', { name: 'Districts & Data' }));+ expect(screen.getByLabelText('Display alias for app 0123456789ab')).toHaveValue('Example tower');+ expect(screen.getByLabelText('Display alias for app abcdef012345')).toHaveValue('Example tower');+ const savedAliases = screen.getByRole('region', { name: 'Saved aliases without a current object' });+ await user.clear(within(savedAliases).getByLabelText('Display alias for agent 0123456789ab'));+ await user.click(screen.getByRole('button', { name: 'Save and project' }));+ await waitFor(() => expect(api.updateEidoverseWorldConfig).toHaveBeenCalled());+ const patch = api.updateEidoverseWorldConfig.mock.calls.at(-1)[0];+ expect(patch.labelAliases).toEqual({ [keys[0]]: 'Example tower', [keys[1]]: 'Example tower' });+ expect(patch).not.toHaveProperty('reset');+ });+it('preserves saved aliases when the initial projection fails and another setting is saved', async () => {const user = userEvent.setup();const labelAliases = { 'app-0123456789ab': 'Example saved tower' };@@ -536,8 +563,8 @@ describe('Eidoverse hosted page', () => {await user.clear(sunHour);await user.type(sunHour, '8.4');await user.click(screen.getByRole('tab', { name: 'Districts & Data' }));- await user.type(screen.getByLabelText('Display alias for Example app signal'), 'Unsaved app alias');- await user.type(screen.getByLabelText('Display alias for Example agent signal'), 'Keep agent alias');+ await user.type(screen.getByLabelText('Display alias for app 0123456789ab'), 'Unsaved app alias');+ await user.type(screen.getByLabelText('Display alias for agent 0123456789ab'), 'Keep agent alias');const appsSection = screen.getByRole('heading', { name: 'App Terraces' }).closest('section');const appsLimit = within(appsSection).getByRole('spinbutton', { name: 'Cap' });await user.clear(appsLimit);diff --git a/docs/features/eidoverse.md b/docs/features/eidoverse.mdindex e39aa46e1a..16d4bb97a3 100644--- a/docs/features/eidoverse.md+++ b/docs/features/eidoverse.md@@ -335,12 +335,18 @@ Search matches and catalog/recipe fallbacks are explicitly called fallbacks.A retained model whose path differs from the current resolution lock reportsunverified provenance. The link to **Appearance & Assets** uses the existingasset override, refresh, and reset controls. The legend remains readable with-floating labels off and on older renderers.+floating labels off and on older renderers. Agent projection-tool results keep+only the operation summary, object count, and presence; the full legend remains+in saved projection state for the drawer.Optional aliases name individual live indicators using stable opaque resourcekeys, never private record IDs or titles. The configuration accepts at most 128aliases, each plain text of at most 72 characters. Clear the field to restore-the generic label. Saving an alias explicitly publishes that display text into+the generic label. Every alias field displays its opaque resource reference,+including when multiple objects share a display name. Aliases for absent objects+remain editable in **Saved aliases without a current object**, so users can free+slots without resetting a district or losing aliases during a temporary outage.+Saving an alias explicitly publishes that display text intothe private world's append-only history; removing it changes the current label,not older history. Asset resets preserve aliases; district/all resets clear thematching aliases. Migration 343 upgrades existing config to schema V3, preservingdiff --git a/server/lib/eidoverseValidation.js b/server/lib/eidoverseValidation.jsindex 8762e58c88..e1b19934c0 100644--- a/server/lib/eidoverseValidation.js+++ b/server/lib/eidoverseValidation.js@@ -4,11 +4,12 @@// Split out of validation.js (#5698), which re-exports this module so every// existing consumer's import specifier keeps working.//-// Cycle rule: this module must import ONLY zod. Importing back from-// validation.js would TDZ — ESM hoists its `export * from` line, so this file-// evaluates before validation.js's body runs.+// Cycle rule: only import zod or dependency-free leaf contracts. Importing+// back from validation.js would TDZ — ESM hoists its `export * from` line,+// so this file evaluates before validation.js's body runs.import { z } from 'zod';+import { EIDOVERSE_LABEL_ALIAS_KEY } from './eidoverseWorldLabels.js';// Eidoverse identities are currently name-based when no archipelago session is// present. Keep the PortOS-side contract deliberately conservative: names and@@ -302,7 +303,7 @@ export const eidoverseWorldConfigPatchSchema = z.object({eidoverseModelAssetOverrideSchema,).optional(),labelAliases: z.record(- z.string().regex(/^(?:app|agent|task|feature|peer|health|productivity|activity|goal|memory|storage|jira|operations)-[0-9a-f]{12}$/),+ z.string().regex(EIDOVERSE_LABEL_ALIAS_KEY),z.string().trim().min(1).max(72).regex(/^[^\u0000-\u001f\u007f]+$/),).refine((aliases) => Object.keys(aliases).length <= 128, 'at most 128 display aliases may be configured').optional(),refreshAssets: z.boolean().optional(),diff --git a/server/lib/eidoverseWorldReset.parity.test.js b/server/lib/eidoverseWorldReset.parity.test.jsindex 9d879feccb..95a6afa2fe 100644--- a/server/lib/eidoverseWorldReset.parity.test.js+++ b/server/lib/eidoverseWorldReset.parity.test.js@@ -5,9 +5,16 @@ import {eidoverseResetAssetSlotsForDistrict,} from '../../client/src/lib/eidoverseWorldReset.js';import { EIDOVERSE_ASSET_SLOTS_BY_DISTRICT } from './eidoverseWorldDesign.js';-import { EIDOVERSE_PROJECTION_KINDS } from '../services/eidoverseWorldProjection.js';+import { COMPONENT_ROUTE_BY_KIND, EIDOVERSE_PROJECTION_KINDS } from '../services/eidoverseWorldProjection.js';+import { EIDOVERSE_SOURCE_ROUTES } from '../../client/src/lib/eidoverseFrame.js';++describe('Eidoverse client/server contract parity', () => {+ it('allows every projected source route through the frame bridge', () => {+ expect(EIDOVERSE_SOURCE_ROUTES).toEqual(Object.fromEntries(+ EIDOVERSE_PROJECTION_KINDS.map(({ source, kind }) => [source, COMPONENT_ROUTE_BY_KIND[kind]]),+ ));+ });-describe('Eidoverse reset client/server parity', () => {it('keeps district asset reset slots aligned with the server contract', () => {expect(EIDOVERSE_RESET_ASSET_SLOTS).toEqual(EIDOVERSE_ASSET_SLOTS_BY_DISTRICT);});diff --git a/server/services/cosToolRegistry.js b/server/services/cosToolRegistry.jsindex 17df1ee80f..2c1202f1e4 100644--- a/server/services/cosToolRegistry.js+++ b/server/services/cosToolRegistry.js@@ -431,7 +431,13 @@ const executeAdapter = async (tool, args, context) => {if (tool.adapter.kind === 'eidoverse-world') {const world = await import('./eidoverseWorld.js');if (tool.adapter.operation === 'status') return world.getEidoverseWorldStatus({ compact: true });- if (tool.adapter.operation === 'project') return world.projectEidoverseWorld({ signal: context.signal });+ if (tool.adapter.operation === 'project') {+ const result = await world.projectEidoverseWorld({ signal: context.signal });+ const { objects = [], ...summary } = result.summary || {};+ // The full recipe, aliases, and duplicate saved legend are for the+ // drawer; semantic callers need a bounded operation result.+ return { success: result.success, summary: { ...summary, objectCount: objects.length }, presence: result.presence };+ }if (tool.adapter.operation === 'augment') return world.augmentEidoverseWorld(args.operations, { signal: context.signal });return world.sayInEidoverseWorld(args.text, { signal: context.signal });}diff --git a/server/services/cosToolRegistry.test.js b/server/services/cosToolRegistry.test.jsindex db2d9adf71..1c1a18626d 100644--- a/server/services/cosToolRegistry.test.js+++ b/server/services/cosToolRegistry.test.js@@ -238,6 +238,16 @@ describe('cosToolRegistry', () => {authority: { scope: 'mind', capabilities: { readPortos: true } },context: { signal },});+ const objects = Array.from({ length: 78 }, (_, index) => ({+ id: `example-object-${index}`, description: 'Example semantic description. '.repeat(6),+ }));+ mocks.worldProject.mockResolvedValueOnce({+ success: true,+ summary: { operationCount: 2, objects },+ projection: { lastSummary: { objects } },+ design: { labelAliases: { 'app-0123456789ab': 'Example alias' } },+ recipe: { assets: { app: 'store/example-asset' } },+ });const project = await executeCosToolCall({call: { requestId: 'world-project', name: 'eidoverse.project', arguments: {} },authority: { scope: 'mind', capabilities: { readPortos: true, manageEidoverse: true } },@@ -271,6 +281,8 @@ describe('cosToolRegistry', () => {.toEqual(['completed', 'completed', 'completed', 'completed', 'completed']);expect(mocks.worldStatus).toHaveBeenCalledWith({ compact: true });expect(mocks.worldProject).toHaveBeenCalledWith({ signal });+ expect(project.result).toEqual({ success: true, summary: { operationCount: 2, objectCount: 78 } });+ expect(JSON.stringify(project.result).length).toBeLessThan(4096);expect(mocks.worldAugment).toHaveBeenCalledWith([{ verb: 'spawn', args: { id: 'example', lib: 'eidoverse/assets/example.glb' } }],{ signal },diff --git a/server/services/eidoverseWorldProjection.js b/server/services/eidoverseWorldProjection.jsindex 7cbb8bfee0..39a8a55a26 100644--- a/server/services/eidoverseWorldProjection.js+++ b/server/services/eidoverseWorldProjection.js@@ -35,7 +35,7 @@ const COMPONENT_RESOURCE_BY_KIND = Object.freeze({health: 'health', productivity: 'productivity', activity: 'activity', goal: 'goals',memory: 'memory', storage: 'storage', jira: 'jira', operations: 'operations',});-const COMPONENT_ROUTE_BY_KIND = Object.freeze({+export const COMPONENT_ROUTE_BY_KIND = Object.freeze({app: '/apps', agent: '/cos/agents', task: '/cos/tasks', feature: '/settings/features',peer: '/instances', health: '/cos/health', productivity: '/cos/productivity',activity: '/cos/productivity', goal: '/goals/list', memory: '/brain/memory',