V1 Web PWA · Surface walkthrough

Studio Hathor · Economy Simulation

A per-surface walkthrough of the V1 Web PWA studio surface: layout, states, interactions, data, and cross-references.

walked
9sections4 minread

On this page

Context. surface studio · domain hathor · route /studio/hathor/economy-simulation · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/hathor/economy-simulation/page.tsx

Last walked. 2026-06-29 standalone real-BFF route addendum: the dedicated Playwright spec now covers direct admin navigation, real economy catalog GET, seeded luxury/rare elastic pricing, edited land/common scarce pricing, zero-ratio maximum-scarcity pricing, client-only numeric rejection, live BFF 400 detail, catalog loading/error state, pending submit disablement, non-admin fail-closed state, route-map and quick-action affordances, 44px touch checks, shared axe, and anonymous redirect. Evidence: WALKTHROUGH/results/v1-real-infra-run-2026-06-22.md §231; apps/oshun/web/e2e/studio-hathor-economy-simulation.spec.ts. 2026-05-29 automated runtime walk 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/domain-models calculateResourcePrice market-pricing model. Pick a resource's base value, category, rarity, supply/demand ratio, and quality multiplier, and read back its market price plus a three-point supply/demand sensitivity curve (scarce 0.5 / balanced 1.0 / abundant 2.0) that shows how elastic the price is. Admin-scoped and fail-closed.

Entry points#

  • Quick-action link from /studio/hathor/politics-simulation — that page links to economy-simulation; this page links out to faction-modeling
  • Direct URL / bookmark — yes; alternates.canonical set
  • Studio overview — see ../../studio-overview.md

Layout regions#

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

  • Workspace <section data-hathor-economy-simulation-workspace>:
    • <h1> (WorkspaceHeading) "Hathor Economy Simulation Workspace"
    • Summary <p data-hathor-economy-simulation-summary>
    • The catalog state (data-hathor-es-catalog) and pricing form lane (catalog-gated): data-hathor-es-form
  • Route Map panel (data-hathor-economy-simulation-route-map, data-hathor-es-route-count="5"): <h2> "Route Map" + 5 entries from STUDIO_HATHOR_ECONOMY_SIMULATION_ROUTE_MAP
  • Quick-action lane (data-hathor-es-quick-actions, data-hathor-es-quick-action-count="2"): Faction Modeling (data-hathor-es-quick-action="faction-modeling"), Back to Studio workspace index (data-hathor-es-quick-action="studio-index")

States#

  • Loading<p data-hathor-es-loading> "Loading economy engine…"
  • Unauthorizeddata-hathor-es-unauthorized "Access restricted." on 401/403 (admin Hathor scope required); fail-closed
  • Errordata-hathor-es-error "Could not load the economy engine." on non-OK GET or malformed catalog
  • Ready (form)data-hathor-es-form once the catalog (categories, rarities) loads, with data-hathor-es-catalog
  • Pending submitdata-hathor-es-submit-state="pending"; submit is disabled with aria-disabled="true" and aria-busy="true" until the BFF response returns
  • Resultdata-hathor-es-result after a 200 price; data-hathor-es-price-error for invalid numeric inputs / non-200

Interactions#

Workspace body (pricing form lane)#

  • Base value<input data-hathor-es-base> (aria-label "base value")
  • Category<select data-hathor-es-category> from catalog categories
  • Rarity<select data-hathor-es-rarity> from catalog rarities
  • Supply/demand<input data-hathor-es-ratio> (aria-label "supply demand ratio")
  • Quality ×<input data-hathor-es-quality> (aria-label "quality multiplier")
  • Price resource<button data-hathor-es-submit type="submit"> → POST /v1/admin/hathor/economy-simulation/price with { baseValue, category, rarity, supplyDemandRatio, qualityMultiplier }
  • Resultdata-hathor-es-price ("market price: N") plus a data-hathor-es-curve table of data-hathor-es-curve-point rows (supply/demand → price)

Route Map panel#

  • 5 route entries — verify match with STUDIO_HATHOR_ECONOMY_SIMULATION_ROUTE_MAP

Quick-action lane#

  • "Open Hathor Faction Modeling workspace" (link → /studio/hathor/faction-modeling)
  • "Back to Studio workspace index" (link → /studio)

Data & contracts#

  • Reads: GET /v1/admin/hathor/economy-simulation (categories + rarities catalog) on mount
  • Writes: POST /v1/admin/hathor/economy-simulation/price
  • Realtime: none
  • Caching: client fetch on mount, cache: 'no-store'; buildBffAuthHeaders
  • Auth/role check: admin-scoped fail-closed (401/403); behind the signed-in and studio proxy gate

Cross-references#

E2E coverage#

  • apps/oshun/web/e2e/studio-hathor-economy-simulation.spec.ts covers the standalone route against the real dev BFF: direct admin navigation, catalog GET with bearer forwarding, seeded luxury/rare elastic pricing, edited land/common scarce pricing, zero-ratio maximum-scarcity pricing, client-only numeric rejection, live BFF 400 detail, catalog loading/error state, pending submit lockout, non-admin fail-closed state, route-map and quick-action affordances, 44px checks for controls and quick-action links, anonymous redirect-before-render, and the shared axe gate.

Open questions / known gaps#

  • Hathor is confirmed in V1 per WALKTHROUGH/matrix/routes.csv and WALKTHROUGH/matrix/coverage.md (product-owner confirmation recorded 2026-05-29 for Bellona / Hathor / Neith).
  • The lane prices a single resource against a static supply/demand ratio, not a multi-agent market simulation; confirm whether an agent-based or time-series economy engine is planned for this route.
  • Route Map advertises scenarios/, simulations/, markets/, and governance/ sub-routes with no page.tsx yet.
  • Manual screen-reader pass remains for the live browser surface; automated axe and touch-target coverage now pass for the standalone route.