---
path: /studio/hathor/culture-evolution-simulation
surface: studio
domain: hathor
auth: signed-in + studio entitlement
source: apps/oshun/web/src/app/studio/hathor/culture-evolution-simulation/page.tsx
status: walked
last_walked:
  '2026-07-04 focused real-dev-infra Playwright — anonymous redirect,
  Hathor-admin catalog load, bearer propagation, live BFF culture assessments,
  fail-closed states, pending form lockout, mobile controls, scoped axe, and
  direct BFF contract gates. Evidence:
  WALKTHROUGH/results/v1-real-infra-run-2026-06-22.md §282; spec:
  apps/oshun/web/e2e/studio-hathor-culture-evolution-simulation.spec.ts'
---

# Studio Hathor · Culture Evolution Simulation

## Purpose

Admin lane console for the real `@hathor/domain-models` cultural-compatibility
and social-analysis algorithms. Describe two cultures (social structure, values,
mutual attitudes, social classes) and read back their compatibility score
(−100…100, from shared values + structure match + mutual attitudes) plus each
culture's dominant value category, social mobility, and Gini-like inequality
index. Admin-scoped and fail-closed.

## Entry points

- **Quick-action link from `/studio/hathor/politics-simulation`** — this page
  links out to politics-simulation, which reciprocally links back
- **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-culture-evolution-simulation-workspace>`:
  - `<h1>` (WorkspaceHeading) "Hathor Culture Evolution Simulation Workspace"
  - Summary `<p data-hathor-culture-evolution-simulation-summary>`
  - The assess form lane (catalog-gated): `data-hathor-ce-form`, strict catalog
    disclosure `data-hathor-ce-catalog`, two JSON editors, submit, and
    result/error output.
- **Route Map panel** (`data-hathor-culture-evolution-simulation-route-map`):
  `<h2>` "Route Map" + 5 entries from
  `STUDIO_HATHOR_CULTURE_EVOLUTION_SIMULATION_ROUTE_MAP`, with
  `data-hathor-ce-route-count` and
  `data-hathor-ce-route-map-entry[data-route-path]`.
- **Quick-action lane** (`data-hathor-ce-quick-actions`): two `Link.quickAction`
  anchors — Politics Simulation
  (`data-hathor-ce-quick-action="politics-simulation"`), Back to Studio
  workspace index (`data-hathor-ce-quick-action="studio-index"`).

## States

- [x] **Loading** — `<p data-hathor-ce-loading role="status">` "Loading culture
      engine…"
- [x] **Unauthorized** — `data-hathor-ce-unauthorized` "Access restricted." on
      401/403 (admin Hathor scope required); fail-closed with `role="alert"`.
- [x] **Error** — `data-hathor-ce-error` "Could not load the culture engine." on
      non-OK GET, network failure, or malformed catalog.
- [x] **Ready (form)** — `data-hathor-ce-form` once the complete catalog
      (`socialStructures`, `attitudes`) loads; idle state is
      `data-hathor-ce-form-state="idle"`.
- [x] **Pending assessment** — `data-hathor-ce-form-state="pending"` /
      `aria-busy="true"` while both editors and the submit button are disabled.
- [x] **Result** — `data-hathor-ce-result` after a 200 assess with
      `data-compatibility`; `data-hathor-ce-assess-error` for invalid JSON,
      non-object JSON, malformed 200 payloads, transport failure, or non-200.

## Interactions

### Workspace body (assess form lane)

- [x] **Culture A (JSON)** — `<textarea data-hathor-ce-culture-a>` (aria-label
      "culture a json"), seeded with a default culture
- [x] **Culture B (JSON)** — `<textarea data-hathor-ce-culture-b>` (aria-label
      "culture b json")
- [x] **Reference `<details>`** — `data-hathor-ce-catalog` with
      `data-hathor-ce-social-structure-count` / `data-hathor-ce-attitude-count`;
      `data-hathor-ce-structures` and `data-hathor-ce-attitudes` echo the
      catalog enums.
- [x] **Assess cultures** — `<button data-hathor-ce-submit type="submit">` →
      POST `/v1/admin/hathor/culture-evolution-simulation/assess` with
      `{ cultureA, cultureB }`.
- [x] **Result** — `data-hathor-ce-compatibility` ("compatibility: N / 100")
      plus two `data-hathor-ce-metrics` blocks (a / b) with `data-culture-id`,
      dominant value, social mobility, and inequality index.

### Route Map panel

- [x] **5 route entries** — verified against
      `STUDIO_HATHOR_CULTURE_EVOLUTION_SIMULATION_ROUTE_MAP`

### Quick-action lane

- [x] **"Open Hathor Politics Simulation workspace"** (link →
      `/studio/hathor/politics-simulation`)
- [x] **"Back to Studio workspace index"** (link → `/studio`)

## Data & contracts

- **Reads**: GET `/v1/admin/hathor/culture-evolution-simulation` (social
  structures + attitudes catalog) on mount
- **Writes**: POST `/v1/admin/hathor/culture-evolution-simulation/assess`
- **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
- **Catalog guard**: client requires every expected Hathor social-structure and
  attitude enum before exposing the form. Malformed or incomplete catalog
  payloads fail closed.
- **Assessment guard**: client rejects malformed JSON and non-object JSON before
  POST, rejects malformed 200 result payloads, and disables both editors while a
  real BFF assessment is pending.
- **Covered BFF outcomes**: seeded default pair (`compatibility: 70`),
  hostile/different-structure pair (`compatibility: -20`), unknown social
  structure detail, malformed success payload, transport failure, and direct BFF
  auth/schema gates.

## Cross-references

- Parent: [`../../studio-overview.md`](../../studio-overview.md)
- Shell:
  [`../../../shell/04-auth-session.md`](../../../shell/04-auth-session.md)
- Sibling routes:
  [`./studio-hathor-politics-simulation.md`](./studio-hathor-politics-simulation.md),
  [`./studio-hathor-economy-simulation.md`](./studio-hathor-economy-simulation.md)
- Component sources:
  - `apps/oshun/web/src/components/studio/StudioHathorCultureEvolutionSimulationWorkspace.tsx`
  - `apps/oshun/web/src/components/studio/StudioHathorCultureEvolutionSimulationRouteMap.ts`
- Focused E2E:
  `apps/oshun/web/e2e/studio-hathor-culture-evolution-simulation.spec.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 computes a one-shot pairwise compatibility assessment, not a
      multi-generation cultural-drift simulation; confirm whether a time-series
      evolution engine is planned for this route.
- [ ] Route Map advertises `scenarios/`, `clusters/`, `regions/`, and
      `governance/` sub-routes with no `page.tsx` yet.
