Context. surface studio · domain hathor · route /studio/hathor/legal-systems-modeling · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/hathor/legal-systems-modeling/page.tsx
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)
Purpose#
Admin lane console for the @hathor/domain-models law model. The single Legal
System Assessment Lane assesses a fictional legal system — effective fairness
(base type fairness minus corruption penalty plus rights/appeals bonuses), crime
detection rate, typical case duration, and per-charge punishment proportionality
(lenient / proportional / harsh). Admin-scoped and fail-closed.
Entry points#
- Direct URL / bookmark —
/studio/hathor/legal-systems-modeling;alternates.canonicalis set. - Quick-action from siblings — this page links to Culture Modeling and Economy Modeling; the Hathor Theory aggregator embeds this same lane.
- Studio overview — see
../../studio-overview.md.
Layout regions#
page.tsx renders inside <ShellLayout active="studio">:
- Workspace (
StudioHathorLegalSystemsModelingWorkspace,data-hathor-legal-systems-modeling-workspace):<h1>WorkspaceHeading— "Hathor Legal Systems Modeling Workspace"- Summary
<p data-hathor-legal-systems-modeling-summary> - Legal System Assessment Lane (
<h2 data-legal-lane-heading>): catalog state, then the assessment form + result.
- Route Map panel (
<section data-hathor-legal-systems-modeling-route-map>,<h2>Route Map</h2>): 5 entries fromSTUDIO_HATHOR_LEGAL_SYSTEMS_MODELING_ROUTE_MAP(path + purpose). - Quick-action lane (
className="quickAction"Links): Culture Modeling, Economy Modeling, Back to Studio workspace index.
States#
- Loading —
<p data-legal-loading>"Loading legal assessor…". - Unauthorized —
data-legal-unauthorizedon 401/403 (admin-scope). - Error —
data-legal-erroron a non-OK catalog response or network failure. - Ready (form) —
data-legal-enums(system types · crime severities · punishment types counts) +data-legal-form. - Result —
data-legal-resultwithdata-legal-headline,data-legal-scores(data-legal-scorefor effectiveFairness / detectionRate / caseDuration), thedata-legal-chargestable (data-legal-charge-rowcarryingdata-proportionality), anddata-legal-issuesrows when present. - Validation error —
data-legal-assess-errorfor malformed JSON or a failed POST.
Interactions#
-
data-legal-payload(textarea,aria-label="legal system json") — edit the legal-system JSON ({ type, corruptionLevel, appealsAllowed, rights[], enforcementAgencies[{ type, strength }], charges[{ chargeId, crimeSeverity, punishmentType }] }). -
data-legal-submit("Assess legal system") — parses the JSON and POSTs it to the assess endpoint; on 200 with a validresultrenders the assessment, otherwise setsdata-legal-assess-errorfromdetail. - Route Map entries — verify against
STUDIO_HATHOR_LEGAL_SYSTEMS_MODELING_ROUTE_MAP(5 entries). - Quick-action links — Culture Modeling
(
/studio/hathor/culture-modeling), Economy Modeling (/studio/hathor/economy-modeling), Back to Studio (/studio).
Data & contracts#
- Reads:
GET /v1/admin/hathor/legal-systems-assessment(catalog:systemTypes,crimeSeverities,punishmentTypes). Note the endpoint slug (legal-systems-assessment) differs from the route slug (legal-systems-modeling). - Writes:
POST /v1/admin/hathor/legal-systems-assessment/assesswith the legal-system payload. - Realtime: none.
- Caching: client fetch on mount,
cache: 'no-store',buildBffAuthHeaders(),AbortControlleron unmount. - Auth: admin-scoped, fail-closed (401/403 → unauthorized); route is behind the signed-in + studio proxy gate.
Cross-references#
- Parent:
../../studio-overview.md - Component sources:
apps/oshun/web/src/components/studio/StudioHathorLegalSystemsModelingWorkspace.tsxapps/oshun/web/src/components/studio/StudioHathorLegalSystemsModelingRouteMap.ts
- Siblings:
./studio-hathor-culture-modeling.md,./studio-hathor-economy-modeling.md,./studio-hathor-theory.md(aggregator that embeds this lane)
Open questions / known gaps#
- The route slug and endpoint slug differ (
legal-systems-modeling→legal-systems-assessment); confirm whether they should converge. - Hathor is
unconfirmed-v1perWALKTHROUGH/matrix/routes.csv; confirm whether the dedicated/studio/hathor/*admin lanes ship V1 or are internal-only.