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.canonicalset - 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 fromSTUDIO_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…" - Unauthorized —
data-hathor-es-unauthorized"Access restricted." on 401/403 (admin Hathor scope required); fail-closed - Error —
data-hathor-es-error"Could not load the economy engine." on non-OK GET or malformed catalog - Ready (form) —
data-hathor-es-formonce the catalog (categories,rarities) loads, withdata-hathor-es-catalog - Pending submit —
data-hathor-es-submit-state="pending"; submit is disabled witharia-disabled="true"andaria-busy="true"until the BFF response returns - Result —
data-hathor-es-resultafter a 200 price;data-hathor-es-price-errorfor 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/pricewith{ baseValue, category, rarity, supplyDemandRatio, qualityMultiplier } - Result —
data-hathor-es-price("market price: N") plus adata-hathor-es-curvetable ofdata-hathor-es-curve-pointrows (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
fetchon mount,cache: 'no-store';buildBffAuthHeaders - Auth/role check: admin-scoped fail-closed (401/403); behind the signed-in and studio proxy gate
Cross-references#
- Parent:
../../studio-overview.md - Shell:
../../../shell/04-auth-session.md - Sibling routes:
./studio-hathor-faction-modeling.md,./studio-hathor-politics-simulation.md - Component sources:
apps/oshun/web/src/components/studio/StudioHathorEconomySimulationWorkspace.tsxapps/oshun/web/src/components/studio/StudioHathorEconomySimulationRouteMap.ts
E2E coverage#
apps/oshun/web/e2e/studio-hathor-economy-simulation.spec.tscovers 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.csvandWALKTHROUGH/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/, andgovernance/sub-routes with nopage.tsxyet. - Manual screen-reader pass remains for the live browser surface; automated axe and touch-target coverage now pass for the standalone route.