Commit Graph

24 Commits

Author SHA1 Message Date
ejlewis 0523158e61 test(mystery): round-trip verification of migrated markdown
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:27:39 -05:00
ejlewis bbea3f4473 feat(mystery): migration script and produced markdown content
Adds scripts/migrate-mystery-content.ts which reads rooms, items,
encounters, and endings from TypeScript source and emits byte-identical
markdown files under src/mystery/world/{rooms,items,encounters,endings}/.
Installs tsx as a devDep to support .ts imports across src/ during the
one-shot run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:26:02 -05:00
ejlewis d3a2f4e1d7 feat(mystery): narration() helper and encounter narration registry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:23:37 -05:00
ejlewis bf8a693949 feat(mystery): parseEncounterNarration — phase and transition prose
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:21:29 -05:00
ejlewis e60844a937 feat(mystery): parseEnding — markdown to typed Ending
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:17:11 -05:00
ejlewis e108ca16e0 feat(mystery): parseItem — markdown to typed Item
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:13:51 -05:00
ejlewis cf257c040a fix(mystery): handle aliased wikilinks; symmetric locked-exit validation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:09:38 -05:00
ejlewis 5f3356ffb5 feat(mystery): parseRoom — markdown to typed Room
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:00:35 -05:00
ejlewis da7b6fac83 feat(mystery): add Zod schemas for markdown frontmatter
Defines runtime validation schemas (roomFrontmatterSchema,
itemFrontmatterSchema, endingFrontmatterSchema, encounterFrontmatterSchema)
and their inferred TypeScript types. All 8 TDD tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 08:56:44 -05:00
ejlewis 157dd07c9c fix(mystery): letter doesn't open in foyer 2026-05-09 01:03:47 -05:00
ejlewis f75030e7ee fix(mystery): persist player input lines so they survive reload
appendLines() only updated the DOM, never state.transcript, so any
UI-originated line (player input, restart/undo/quit messages) vanished
on page reload. Engine narration was unaffected because dispatch()
already adds its lines to state.transcript.

Fix: appendLines() now pushes into state.transcript (capped at
TRANSCRIPT_CAP) and renders. Engine output uses renderAll() directly
since dispatch already added its lines to state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 00:54:54 -05:00
ejlewis 33bc84e30b fix(mystery): wait verb routes to encounters; chip list reflects dynamic items
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 00:37:45 -05:00
ejlewis 9e49f1f519 feat(mystery): mobile chip computation and rendering
Pure computeChips function (TDD, 4 tests) generates context-aware direction/item/encounter/meta chips from game state; chip-render.ts wires chips to DOM; terminal.ts calls refreshChips on init, each Enter dispatch, restart, and undo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 00:18:25 -05:00
ejlewis 3c0c386bbe feat(mystery): theme toggle wiring with localStorage persistence
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 00:14:15 -05:00
ejlewis 5f5dc6071b feat(mystery): terminal — input handling, dispatch wiring, autosave 2026-05-08 23:45:10 -05:00
ejlewis 96d3036c4d feat(mystery): /mystery route + CRT bezel + theme scaffold 2026-05-08 23:39:58 -05:00
ejlewis 460626aad9 test(mystery): end-to-end playthrough against sample world 2026-05-08 23:32:33 -05:00
ejlewis d8c9b44058 feat(mystery): sample 3-room world for engine validation 2026-05-08 23:26:45 -05:00
ejlewis 49fc5a1015 feat(mystery): encounter phase machine wired into dispatcher 2026-05-08 23:18:22 -05:00
ejlewis 00f44ce817 feat(mystery): dispatcher — go, look, take, drop, examine, inventory
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 22:56:11 -05:00
ejlewis bd6b421ce9 feat(mystery): save layer — round-trip, schema versioning, transcript cap 2026-05-08 22:50:47 -05:00
ejlewis bf9e210b88 feat(mystery): parser — noun resolution, disambiguation, pronouns 2026-05-08 22:44:43 -05:00
ejlewis b59644270e feat(mystery): parser — verb-only, direction, and meta commands 2026-05-08 22:38:17 -05:00
ejlewis 7ee5cf96f6 feat(mystery): define engine and world type contracts 2026-05-08 22:31:36 -05:00