clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

main
miau-is-true / openspec / changes / archive / 2026-09-23-share-level-packs / tasks.md
tasks.md 3.6K rendered
1## 1. Stable content model23- [x] 1.1 Define normalized pack and level records with authored stable lowercase ids, version, origin metadata, ordered levels, vocabulary, and palette; reject generated identity fallbacks.4- [x] 1.2 Assign stable pack and level ids to the three MIAU teaching levels without changing their authored puzzle behavior.5- [x] 1.3 Define and validate the additional curated basic packs and their level ids.67## 2. Pack registry89- [x] 2.1 Implement atomic registration, active selection, origin tracking, and lookup by `{ packId, levelId }`.10- [x] 2.2 Retain multiple valid bundled and imported packs and preserve earlier packs after failed registration.11- [x] 2.3 Implement duplicate pack collision rejection and explicit atomic replacement.12- [x] 2.4 Add registry fixtures for same level ids across different packs, duplicate pack ids, unknown selection, and replacement failure.13- [x] 2.5 Add explicit `Keep both as a copy` fork handling with suffixed id, `forkOf`, and fresh progress identity.1415## 3. CommonJS pack compatibility1617- [x] 3.1 Adapt the existing validated local CommonJS manifest to include stable level ids and normalized pack identity.18- [x] 3.2 Keep local CJS import explicitly trusted and preserve existing pack content after module errors or unsupported imports.19- [x] 3.3 Add fixtures for loading two valid modules, malformed modules, duplicate pack ids, and palette/vocabulary retention.2021## 4. Data-only sharing and export2223- [x] 4.1 Implement canonical authored-pack serialization that excludes current positions, move history, win state, and UI state.24- [x] 4.2 Implement deterministic `.cjs` export and trusted local import round-trip verification.25- [x] 4.3 Implement `#pack=<versioned-payload>` URL-safe data encoding with a 16 KiB encoded payload cap.26- [x] 4.4 Decode and validate hash payloads without invoking CommonJS evaluation, imports, or hooks.27- [x] 4.5 Add fixtures for valid URL round trips, malformed encoding, unknown versions, tampering, oversized payloads, and code-execution isolation.28- [x] 4.6 Define the forward-version policy for the documented v1 share schema: keep v1 decoding compatible, reject unknown future versions before registration, and add adapters/fixtures only when a later schema is documented.2930## 5. Browser integration and feedback3132- [x] 5.1 Route bundled pack and level selection through the registry while retaining keyboard/touch movement, dynamic rule changes, and undo behavior.33- [x] 5.2 Add the E4 service hooks: `listPacks`, `importPackText`, `exportPack`, `packLink`, `decodePackLink`, `installPack`, and `removePack`; keep URL intake separate from CJS execution.34- [x] 5.3 Normalize preview and installed views, return duplicate `conflict` metadata before installation, and make every player-facing hook return structured no-throw `{ok, errors}` results with readable messages and raw details.35- [x] 5.4 Move URL intake to a pending Gift confirmation and provide Workshop operations for Import, Play, Share link, Export, and Remove; keep interim sidebar controls behind `?dev`.36- [x] 5.5 Add browser checks for built-in pack startup, level selection, rule editing, undo/reset, multi-pack retention, trusted CJS import, URL import, export, and failure feedback.3738## 6. Verification3940- [x] 6.1 Run the full Node test suite and production build with all bundled packs registered.41- [x] 6.2 Verify engine behavior remains deterministic after pack selection and imported level normalization.42- [x] 6.3 Review serialized output for stable ordering and absence of transient engine or UI state.4344Stage, scene, and visual layout work for Workshop/Gift remains a separate follow-up change owned by the designer.