---
path: /studio/hathor/politics-simulation
surface: studio
domain: hathor
auth: signed-in + studio entitlement
source: apps/oshun/web/src/app/studio/hathor/politics-simulation/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 · Politics Simulation

## Purpose

Admin lane console for the real `@hathor/domain-models` diplomacy algorithms.
Describe a faction's diplomatic web (per-target standing −100…100), pick a
diplomatic action against a target (raw standing change, sign a treaty, or decay
over N years at 2 points/year toward neutral), and read back the before/after
standing + relationship category plus the faction's ally and enemy rosters.
Admin-scoped and fail-closed.

## Entry points

- **Quick-action link from `/studio/hathor/economy-simulation`** (this page
  links out to economy-simulation; culture-evolution-simulation links here)
- **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** `<section data-hathor-politics-simulation-workspace>`:
  - `<h1>` (WorkspaceHeading) "Hathor Politics Simulation Workspace"
  - Summary `<p data-hathor-politics-simulation-summary>`
  - The diplomacy form lane: `data-hathor-ps-form`
- **Route Map panel** (`data-hathor-politics-simulation-route-map`): `<h2>`
  "Route Map" + 5 entries from `STUDIO_HATHOR_POLITICS_SIMULATION_ROUTE_MAP`
- **Quick-action lane**: two `Link.quickAction` anchors — Economy Simulation,
  Back to Studio workspace index

## States

- [ ] **Loading** — `<p data-hathor-ps-loading>`
- [ ] **Unauthorized** — `data-hathor-ps-unauthorized` on 401/403 (admin Hathor
      scope required); fail-closed
- [ ] **Error** — `data-hathor-ps-error` on non-OK GET / malformed catalog
- [ ] **Ready (form)** — `data-hathor-ps-form` once the catalog loads
- [ ] **Result** — `data-hathor-ps-result` after a 200 simulate;
      `data-hathor-ps-sim-error` for invalid JSON / non-200

## Interactions

### Workspace body (diplomacy form lane)

- [ ] **Relationships (JSON array)** —
      `<textarea data-hathor-ps-relationships>` (aria-label "relationships json")
- [ ] **Target faction** — `<input data-hathor-ps-target>` (aria-label "target
      faction id")
- [ ] **Action** — `<select data-hathor-ps-kind>` (raw change / treaty / decay)
- [ ] **Amount** — `<input data-hathor-ps-amount>` (aria-label "amount")
- [ ] **Treaty** — `<select data-hathor-ps-treaty>`
- [ ] **Years** — `<input data-hathor-ps-years>` (aria-label "years")
- [ ] **Simulate diplomacy** —
      `<button data-hathor-ps-submit type="submit">` → POST
      `/v1/admin/hathor/politics-simulation/simulate`
- [ ] **Result** — `data-hathor-ps-transition` (before/after standing +
      category), `data-hathor-ps-allies`, `data-hathor-ps-enemies`

### Route Map panel

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

### Quick-action lane

- [ ] **"Open Hathor Economy Simulation workspace"** (→
      `/studio/hathor/economy-simulation`)
- [ ] **"Back to Studio workspace index"** (→ `/studio`)

## Data & contracts

- **Reads**: GET `/v1/admin/hathor/politics-simulation` on mount
- **Writes**: POST `/v1/admin/hathor/politics-simulation/simulate`
- **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-economy-simulation.md`](./studio-hathor-economy-simulation.md),
  [`./studio-hathor-culture-evolution-simulation.md`](./studio-hathor-culture-evolution-simulation.md)
- Component sources:
  - `apps/oshun/web/src/components/studio/StudioHathorPoliticsSimulationWorkspace.tsx`
  - `apps/oshun/web/src/components/studio/StudioHathorPoliticsSimulationRouteMap.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.
- [ ] The lane applies one diplomatic action against a single target, not a
      multi-turn multi-faction simulation; confirm whether a turn-based political
      engine is planned for this route.
- [ ] Route Map advertises `scenarios/`, `factions/`, `regions/`, and
      `governance/` sub-routes with no `page.tsx` yet.
