Commit Graph

80 Commits

Author SHA1 Message Date
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 2ad81f356a docs(mystery): implementation plan for markdown content migration
14-task plan covering: gray-matter+zod setup, schemas, four pure
parsers (room/item/ending/encounter), narration() helper with
auto-registration, one-shot migration script, round-trip
verification, world assembly cutover, encounters.ts refactor,
manual playthrough, and Obsidian vault config.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 08:50:58 -05:00
ejlewis baed9dd2f7 docs(mystery): camelCase frontmatter, prototype goal, content collections rationale
Address spec review feedback: switch frontmatter convention from snake_case
to camelCase to match existing TS field names; surface the working
three-room prototype as the explicit deliverable; rephrase the Astro
content collections out-of-scope item to clarify the import.meta.glob
choice is a tooling decision, not a feature exclusion.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 08:42:12 -05:00
ejlewis 1a283076ac docs(mystery): spec for markdown content migration
Move rooms, items, encounter narration, and endings from TypeScript
object literals to markdown files editable in Obsidian. Engine code,
tests, and the World shape are unchanged. Tonal refinement is a
separate spec that follows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 08:36:38 -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 d3e2bd72a5 Merge feature: mystery text adventure (Halfstreet) — engine + UI + bible
14 implementation tasks + 1 critical-fix commit + 1 follow-on notes commit.

Adds:
- Pure-function text-adventure engine (parser, dispatcher, encounters,
  save) with 53 vitest tests passing
- /mystery route with fullscreen CRT terminal (amber + ANSI themes)
- Mobile tap-chip input system above the soft keyboard
- 3-room sample world for engine validation and UI scaffolding
- Halfstreet content bible (gating artifact for room-prose follow-on plan)
- Launch script for the future MysteryCard click on the homepage

Bundle: 6.2 KB gzipped (target <80 KB).
No runtime LLM calls.

Spec: docs/superpowers/specs/2026-05-08-mystery-text-adventure-design.md
Plan: docs/superpowers/plans/2026-05-08-mystery-text-adventure.md
Bible: docs/superpowers/specs/halfstreet-bible.md
Follow-on notes: docs/superpowers/specs/halfstreet-followon-notes.md
2026-05-09 00:41:23 -05:00
ejlewis 731e51c6b9 docs(mystery): notes for follow-on room-prose plan
Captures the final code reviewer's recommendations: hard prerequisites
(read/light/extinguish/use verbs; disambiguation; endedWith ending screen),
should-fix items (look-at parser polish, theme-state divergence, roomState
type lie), and a polish backlog. Read this before generating the next plan.
2026-05-09 00:40:13 -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 1b7d2ce4e7 docs(mystery): author Halfstreet content bible — gating artifact for room prose 2026-05-09 00:22:57 -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
ejlewis 20c977db1f docs: add mystery text adventure (Halfstreet) design spec
Gothic mystery, M-scope (18-22 rooms), authored TypeScript engine,
no LLM at runtime, fullscreen CRT terminal at /mystery, two themes
(amber + ANSI), context-aware mobile chips, auto-save to localStorage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 22:07:24 -05:00