Context. surface studio · domain hathor · route /studio/hathor/npc-world-awareness · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/hathor/npc-world-awareness/page.tsx
Last walked. 2026-05-29 automated runtime walk (Playwright headless) — render, /v1 data (2xx), console/page-errors, expected content, screenshot verified; live screen-reader, touch, offline, and telemetry-delivery checks pending a manual AT pass. Evidence: WALKTHROUGH/results/runtime-sweep-2026-05-29.md; body re-derived 2026-06-03 from current source (lane-console architecture)
Purpose#
Admin lane console for the @hathor/llm-npc WorldAwarenessManager
spatial-perception engine. From the NPC's position and a seeded scene of objects
and characters, the engine computes 3D distance, flags what lies inside the 120°
visual field, drops anything beyond 50 m, sorts by distance, and surfaces the
nearest character, the objects in reach, and any threats. Admin-scoped and
fail-closed.
Entry points#
- Direct URL / bookmark —
/studio/hathor/npc-world-awareness;alternates.canonicalis set. - Quick-action from siblings — this page links to the NPC Memory System lane.
- Studio overview — see
../../studio-overview.md.
Layout regions#
page.tsx renders inside <ShellLayout active="studio">:
- Workspace (
StudioHathorNpcWorldAwarenessWorkspace,data-hathor-npc-world-awareness-workspace):<h1>WorkspaceHeading— "Hathor NPC World Awareness Workspace"- Summary
<p data-hathor-npc-world-awareness-summary> - Catalog state, then the Seeded scene list (
data-hathor-nwa-scene) and the perception form + result.
- Route Map panel (
<section data-hathor-npc-world-awareness-route-map>,<h2>Route Map</h2>): 5 entries fromSTUDIO_HATHOR_NPC_WORLD_AWARENESS_ROUTE_MAP(path + purpose). - Quick-action lane (
className="quickAction"Links): NPC Memory System, Back to Studio workspace index.
States#
- Loading —
<p data-hathor-nwa-loading>"Loading perception engine…". - Unauthorized —
data-hathor-nwa-unauthorizedon 401/403 (admin-scope). - Error —
data-hathor-nwa-erroron a non-OK catalog response or network failure. - Ready (form) — the seeded scene list +
data-hathor-nwa-perceive-formwith the NPC position and reach inputs. - Result —
data-hathor-nwa-resultwithdata-hathor-nwa-nearest,data-hathor-nwa-threats,data-hathor-nwa-interactable,data-hathor-nwa-visible-count, and the per-object / per-character lists. - Validation error —
data-hathor-nwa-perceive-errorfor non-numeric position/reach or a failed POST.
Interactions#
-
data-hathor-nwa-pos-x/-pos-y/-pos-z(inputs,aria-label="npc x/y/z") — the NPC position. -
data-hathor-nwa-reach(input,aria-label="reach") — interactable reach in metres. -
data-hathor-nwa-perceive-submit("Run perception") — validates the coordinates and reach, then POSTs{ npcPosition, npcOrientation, objects, characters, interactableMaxDistance }(objects/characters are the seeded scene); on 200 with a validperceptionrenders the read-out. - Route Map entries — verify against
STUDIO_HATHOR_NPC_WORLD_AWARENESS_ROUTE_MAP(5 entries). - Quick-action links — NPC Memory System
(
/studio/hathor/npc-memory-system), Back to Studio (/studio).
Data & contracts#
- Reads:
GET /v1/admin/hathor/npc-world-awareness(catalog:limits,characterTypes,emotions). - Writes:
POST /v1/admin/hathor/npc-world-awareness/perceivewith the NPC position + seeded scene. - Realtime: none.
- Caching: client fetch on mount,
cache: 'no-store',buildBffAuthHeaders(),AbortControlleron unmount. - Auth: admin-scoped, fail-closed (401/403 → unauthorized); route is behind the signed-in + studio proxy gate.
Cross-references#
- Parent:
../../studio-overview.md - Component sources:
apps/oshun/web/src/components/studio/StudioHathorNpcWorldAwarenessWorkspace.tsxapps/oshun/web/src/components/studio/StudioHathorNpcWorldAwarenessRouteMap.ts
- Siblings:
./studio-hathor-npc-memory-system.md,./studio-hathor-npc-behavior-control.md,./studio-hathor-npc-emotional-state.md
Open questions / known gaps#
- The scene (objects + characters) is seeded in the component; confirm whether operators should be able to supply a custom scene rather than only varying the NPC position and reach.
- Hathor is
unconfirmed-v1perWALKTHROUGH/matrix/routes.csv; confirm whether the dedicated/studio/hathor/*admin lanes ship V1 or are internal-only.