Context. surface studio · domain hathor · route /studio/hathor/narrative-theory-tooling · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/hathor/narrative-theory-tooling/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 real @hathor/narrative quest ConditionEvaluator.
Given a game-state context and a set of quest/dialogue gating conditions, it
evaluates each one (type + operator + value, with optional negate) and combines
them with AND or OR to show exactly when a narrative branch unlocks. Admin-scoped
and fail-closed.
Entry points#
- Quick-action link from
/studio/hathor/game-design-theory-mda(this page links out to game-design-theory-mda) - Aggregator embed:
StudioHathorNarrativeApiWorkspacemounts this workspace inline as its "Narrative Theory Tooling Lane" - Direct URL / bookmark — yes;
alternates.canonicalset - Studio overview — see
../../studio-overview.md
Layout regions#
page.tsx renders inside <ShellLayout active="studio">:
- Workspace
<section data-hathor-narrative-theory-tooling-workspace>:<h1>(WorkspaceHeading) "Hathor Narrative Theory Tooling Workspace"- Summary
<p data-hathor-narrative-theory-tooling-summary> - The evaluate form lane:
data-hathor-ntt-evaluate-form
- Route Map panel
(
data-hathor-narrative-theory-tooling-route-map):<h2>"Route Map" + 5 entries fromSTUDIO_HATHOR_NARRATIVE_THEORY_TOOLING_ROUTE_MAP - Quick-action lane: two
Link.quickActionanchors — Game Design Theory (MDA), Back to Studio workspace index
States#
- Loading —
<p data-hathor-ntt-loading> - Unauthorized —
data-hathor-ntt-unauthorizedon 401/403 (admin Hathor scope required); fail-closed - Error —
data-hathor-ntt-erroron non-OK GET / malformed catalog - Ready (form) —
data-hathor-ntt-evaluate-formonce the catalog loads - Result —
data-hathor-ntt-resultafter a 200 evaluate;data-hathor-ntt-evaluate-errorfor invalid JSON / non-200
Interactions#
Workspace body (evaluate form lane)#
- Game-state context (JSON) —
<textarea data-hathor-ntt-context>(aria-label "context json") - Conditions (JSON array) —
<textarea data-hathor-ntt-conditions>(aria-label "conditions json"); each{ type, target, operator, value, value2?, negate?, description? } - Combine with —
<select data-hathor-ntt-logic>(AND / OR) - Evaluate conditions —
<button data-hathor-ntt-evaluate-submit type="submit">→ POST/v1/admin/hathor/narrative-theory-tooling/evaluate - Result —
data-hathor-ntt-verdictplus adata-hathor-ntt-conditions-listofdata-hathor-ntt-condition-itemrows
Route Map panel#
- 5 route entries — verify match with
STUDIO_HATHOR_NARRATIVE_THEORY_TOOLING_ROUTE_MAP
Quick-action lane#
- "Open Hathor Game Design Theory (MDA) workspace" (→
/studio/hathor/game-design-theory-mda) - "Back to Studio workspace index" (→
/studio)
Data & contracts#
- Reads: GET
/v1/admin/hathor/narrative-theory-toolingon mount - Writes: POST
/v1/admin/hathor/narrative-theory-tooling/evaluate - Realtime: none
- Caching: client
fetchon mount,cache: 'no-store';buildBffAuthHeaders - Auth/role check: admin-scoped fail-closed (401/403); behind the signed-in
- studio proxy gate
Cross-references#
- Parent:
../../studio-overview.md - Shell:
../../../shell/04-auth-session.md - Sibling routes:
./studio-hathor-narrative-api.md(aggregator that embeds this workspace),./studio-hathor-game-design-theory-mda.md - Component sources:
apps/oshun/web/src/components/studio/StudioHathorNarrativeTheoryToolingWorkspace.tsxapps/oshun/web/src/components/studio/StudioHathorNarrativeTheoryToolingRouteMap.ts
Open questions / known gaps#
- Hathor is
unconfirmed-v1perWALKTHROUGH/matrix/routes.csv. Confirm whether the dedicated/studio/hathor/*admin lane consoles ship in V1. - The lane exposes the quest
ConditionEvaluatoronly; despite the "narrative theory" name, no Aristotelian/MDA framework tooling renders — confirm whether broader theory analysers are planned for this route. - Route Map advertises
frameworks/,arcs/,beats/, andgovernance/sub-routes with nopage.tsxyet.