Context. surface studio · domain hathor · route /studio/hathor/lore-compilation-for-engines · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/hathor/lore-compilation-for-engines/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)' - '2026-07-03 focused real-dev-infra walk — apps/oshun/web/e2e/studio-hathor-lore-compilation-for-engines.spec.ts now covers anonymous redirect, Hathor-admin live catalog, real @hathor/lore-compiler JSON / YAML / SQLite exports through the local BFF, browser bearer propagation, client/BFF/malformed/transport errors, loading/503/malformed catalog states, non-admin fail-closed state, pending lockout, route-map and quick-action selectors, mobile 44px/no-overflow checks, scoped axe, and direct BFF auth/schema gates. Evidence: WALKTHROUGH/results/v1-real-infra-run-2026-06-22.md §277.
Purpose#
Admin lane console for the real @hathor/lore-compiler QuestCompiler. The
operator compiles a batch of source quests (objectives + NPCs) into engine-ready
artifacts, then exports the batch to a selected engine-inspection format
(json, yaml, xml, binary, or sqlite). The surfaced result includes
compile success, quest count, processed/skipped/error/warning counts, error and
warning codes, selected format, and the artifact text when available.
Admin-scoped and fail-closed.
Entry points#
- Direct URL / bookmark —
/studio/hathor/lore-compilation-for-engines;alternates.canonicalis set. - Quick-action from siblings — e.g. the Hathor Lore Compiler aggregator links here; this page links to the Unified Validation Dashboard.
- Studio overview — see
../../studio-overview.md.
Layout regions#
page.tsx renders inside <ShellLayout active="studio">:
- Workspace (
StudioHathorLoreCompilationForEnginesWorkspace,data-hathor-lore-compilation-for-engines-workspace):<h1>WorkspaceHeading— "Hathor Lore Compilation for Engines Workspace"- Summary
<p data-hathor-lore-compilation-for-engines-summary> - Quest Compile Lane: catalog state, then the source-quests JSON form, engine-format select, pending state, result, or inline error.
- Route Map panel
(
<section data-hathor-lore-compilation-for-engines-route-map>,data-hathor-lce-route-count="5",<h2>Route Map</h2>): 5 entries fromSTUDIO_HATHOR_LORE_COMPILATION_FOR_ENGINES_ROUTE_MAP, each carryingdata-hathor-lce-route-map-entryanddata-route-path. - Quick-action lane (
data-hathor-lce-quick-actions,data-hathor-lce-quick-action-count="2"): Unified Validation Dashboard and Back to Studio workspace index. Each link carriesdata-hathor-lce-quick-action.
States#
- Loading —
<p data-hathor-lce-loading role="status" aria-live="polite">"Loading quest compiler…" while the GET catalog request is in flight. - Unauthorized —
data-hathor-lce-unauthorized role="alert"on 401/403 (admin-scope required). - Error —
data-hathor-lce-error role="alert"on a non-OK catalog response, malformed catalog payload, or network failure. - Ready (form) —
data-hathor-lce-compile-form,data-hathor-lce-form-state="idle", andaria-busy="false"with the source-quests textarea and engine-format select. - Pending compile —
data-hathor-lce-form-state="pending",aria-busy="true", disabled textarea/select/submit,data-hathor-lce-submit-state="pending", and "Compiling…" button copy. - Result —
data-hathor-lce-result role="status" aria-live="polite"withdata-hathor-lce-verdictanddata-hathor-lce-outputwhen the compiler returns artifact text. - Validation error —
data-hathor-lce-compile-error role="alert"for client JSON validation, empty arrays, BFF 400 reason/detail responses, malformed 200 result payloads, or transport failure.
Interactions#
-
data-hathor-lce-quests(textarea,aria-label="quests json") — edit the source-quests JSON array; disabled while compilation is pending. -
data-hathor-lce-format(select) — choose the engine export format fromcatalog.formats; disabled while compilation is pending. -
data-hathor-lce-compile-submit("Compile for engine" / "Compiling…") — parses JSON, requires a non-empty array, and POSTs{ quests, format }; on 200 with a validresultit renders verdict and output, otherwise it setsdata-hathor-lce-compile-errorfromdetail,reason, or the fail-closed fallback. - Route Map entries — verify against
STUDIO_HATHOR_LORE_COMPILATION_FOR_ENGINES_ROUTE_MAP(5 entries), with stabledata-route-pathordering. - Quick-action links — Unified Validation Dashboard
(
data-hathor-lce-quick-action="unified-validation-dashboard"→/studio/hathor/unified-validation-dashboard), Back to Studio (data-hathor-lce-quick-action="studio-index"→/studio).
Data & contracts#
- Reads:
GET /v1/admin/hathor/lore-compilation-for-engines(catalog:formats,defaultFormat). - Writes:
POST /v1/admin/hathor/lore-compilation-for-engines/compilewith{ quests, format }. - Realtime: none.
- Caching: client fetch on mount,
cache: 'no-store',buildBffAuthHeaders(),AbortControlleron unmount. - Auth: admin-scoped, fail-closed (401/403 → unauthorized state); route is behind the signed-in + studio proxy gate.
- Client parsing: GET catalog requires
formats: string[]anddefaultFormat: string; POST success requires booleansuccess, numericquestCount, numericprocessedElements, numericskippedElements, numericerrorCount,errorCodes: string[], numericwarningCount,warningCodes: string[], stringformat, andoutput: string | nullbefore rendering a result.
Cross-references#
- Parent:
../../studio-overview.md - Component sources:
apps/oshun/web/src/components/studio/StudioHathorLoreCompilationForEnginesWorkspace.tsxapps/oshun/web/src/components/studio/StudioHathorLoreCompilationForEnginesRouteMap.ts
- Siblings:
./studio-hathor-lore-compiler.md,./studio-hathor-unified-validation-dashboard.md
Automated coverage#
apps/oshun/web/e2e/studio-hathor-lore-compilation-for-engines.spec.tscovers: anonymous redirect, Hathor-admin shell entry, live engine-format catalog, seeded JSON compile result, edited three-quest YAML compile result, edited SQLite export result, browser bearer propagation, scoped axe, 44 px controls, route map, quick actions, client-only malformed JSON and empty-array validation with zero POSTs, BFFinvalid_questreason surfacing, malformed success payload handling, transport failure, catalog loading/503/malformed states, non-admin fail-closed state, pending compile lockout, mobile no-overflow containment, and direct BFF auth/schema gates.- Focused component tests:
StudioHathorLoreCompilationForEnginesWorkspace.test.tsxandStudioHathorLoreCompilationForEnginesWorkspace.integration.test.tsx. - Focused BFF route test:
apps/oshun/bff/src/__tests__/admin-hathor-lore-compilation-for-engines-route.test.ts.
Open questions / known gaps#
- Hathor is
unconfirmed-v1perWALKTHROUGH/matrix/routes.csv; confirm whether the dedicated/studio/hathor/*admin lanes ship V1 or are internal-only. Confirmed in V1 viaV1/TODOS.md§34 and the 2026-05-29 surface inventory. - SQLite export is exercised in-browser and at the BFF contract layer, but downstream round-trip into a Bellona engine artifact pipeline remains outside this route.
- The route-map sub-routes are listed but their concrete
page.tsxfiles are not present; confirm whether they remain route-map placeholders or need dedicated deep-link pages. - Manual assistive-technology pass remains pending; automated scoped axe and touch-target assertions pass for this route.