---
path: /studio/hathor/dialogue-tree-authoring
surface: studio
domain: hathor
auth: signed-in + studio entitlement
source: apps/oshun/web/src/app/studio/hathor/dialogue-tree-authoring/page.tsx
status: walked
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)'
---

# Studio Hathor · Dialogue Tree Authoring

## Purpose

Admin console whose load-bearing surface is the **Live Dialogue Tree Analyzer**
lane: paste a dialogue tree (rootId + nodes with choice targets) and read back a
reachability analysis — which nodes are reachable, their depth from the root,
terminal nodes, unreachable nodes, and dangling choices. The analyzer is the only
`/v1`-wired path; the rest of the workspace is a large client-only expert-mode
shell (posture, accessibility QA, capability lanes) with no backend writes.
Admin-scoped and fail-closed.

## Entry points

- **Quick-action link from `/studio/hathor/quest-authoring`** (this page links
  out to quest-authoring)
- **Direct URL / bookmark** — yes; `alternates.canonical` set
- **Studio overview** — see
  [`../../studio-overview.md`](../../studio-overview.md)

## Layout regions

`page.tsx` renders inside `<ShellLayout active="studio">`:

- **Workspace** `StudioHathorDialogueTreeAuthoringWorkspace`:
  - `<h1>` (WorkspaceHeading) "Hathor Dialogue Tree Authoring Workspace" + a
    plain summary `<p>` (no data-summary attribute)
  - **Live Dialogue Tree Analyzer** (`<section data-dta-lane>` →
    `<h2 data-dta-heading>` "Live Dialogue Tree Analyzer") — the
    `/v1`-wired analyze form `data-dta-form`
  - **Workspace posture** (`data-hathor-dialogue-tree-authoring-workspace-posture`)
    and **Accessibility QA** (`data-hathor-dialogue-tree-authoring-accessibility`,
    `<h2>`, with a high-contrast toggle + focus region) — client-only, no fetch
  - Additional client-only expert-mode panels (capability lanes, density /
    viewport controls, collaboration, audit log, change history) render below;
    none issue `/v1` writes
- **Route Map panel** (`data-hathor-dialogue-tree-authoring-route-map`): `<h2>`
  "Route Map" + 5 entries from `STUDIO_HATHOR_DIALOGUE_TREE_AUTHORING_ROUTE_MAP`
- **Quick-action lane**: two `Link.quickAction` anchors — Quest Authoring, Back
  to Studio workspace index

## States

(of the Live Dialogue Tree Analyzer lane — the `/v1`-wired surface)

- [ ] **Loading** — `<p data-dta-loading>` "Loading dialogue-tree analyzer…"
- [ ] **Unauthorized** — `data-dta-unauthorized` on 401/403 (admin Hathor scope
      required); fail-closed
- [ ] **Error** — `data-dta-error` on non-OK GET / unreachable analyzer
- [ ] **Ready (form)** — `data-dta-form` once the GET probe returns 200
- [ ] **Result** — `data-dta-result` after a 200 analyze;
      `data-dta-analyze-error` for invalid JSON / non-200

## Interactions

### Live Dialogue Tree Analyzer lane

- [ ] **Dialogue tree (JSON)** — `<textarea data-dta-payload>` (aria-label
      "dialogue tree json"), seeded with a default tree
- [ ] **Analyze tree** — `<button data-dta-submit type="submit">` → POST
      `/v1/admin/hathor/dialogue-tree-authoring/analyze`
- [ ] **Result** — `data-dta-headline` (reachable/total, max depth, dangling
      count), `data-dta-unreachable`, and a `data-dta-nodes` table of
      `data-dta-node-row` rows (`data-dta-node-reachable`, `-node-depth`,
      `-node-terminal`)

### Accessibility QA panel (client-only)

- [ ] **Enable high contrast mode** —
      `<input data-hathor-dialogue-tree-authoring-high-contrast-toggle>` toggles
      the workspace high-contrast styles (local state, no fetch)

### Route Map panel

- [ ] **5 route entries** — verify match with
      `STUDIO_HATHOR_DIALOGUE_TREE_AUTHORING_ROUTE_MAP`

### Quick-action lane

- [ ] **"Open Hathor Quest Authoring workspace"** (→
      `/studio/hathor/quest-authoring`)
- [ ] **"Back to Studio workspace index"** (→ `/studio`)

## Data & contracts

- **Reads**: GET `/v1/admin/hathor/dialogue-tree-authoring` (probe) on mount
- **Writes**: POST `/v1/admin/hathor/dialogue-tree-authoring/analyze`
- **Realtime**: none
- **Caching**: client `fetch` on 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`](../../studio-overview.md)
- Shell:
  [`../../../shell/04-auth-session.md`](../../../shell/04-auth-session.md)
- Sibling routes:
  [`./studio-hathor-quest-authoring.md`](./studio-hathor-quest-authoring.md),
  [`./studio-hathor-narrative-theory-tooling.md`](./studio-hathor-narrative-theory-tooling.md)
- Component sources:
  - `apps/oshun/web/src/components/studio/StudioHathorDialogueTreeAuthoringWorkspace.tsx`
  - `apps/oshun/web/src/components/studio/StudioHathorDialogueTreeAuthoringRouteMap.ts`

## Open questions / known gaps

- [ ] Hathor is `unconfirmed-v1` per `WALKTHROUGH/matrix/routes.csv`. Confirm
      whether the dedicated `/studio/hathor/*` admin lane consoles ship in V1.
- [ ] This component retains a large client-only expert-mode shell (capability
      lanes, collaboration, audit log, density / viewport controls) around the
      `/v1`-wired analyzer; those panels mutate local state only. Confirm whether
      they are intended to wire to a backend or should be trimmed to the analyzer
      lane like the other Hathor consoles.
- [ ] Route Map advertises nested `dialogues/[id]/nodes|branches/` and
      `governance/` sub-routes with no `page.tsx` yet.
