Appearance
Simulator logger and diagnostic dump implementation plan
For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: Add one-click diagnostic dump export/import with automatic state restore, and provide a header-level logger toggle that reloads the simulator with the selected logger mode.
Architecture: Keep docs server CLI focused on serving/opening docs and remove logger-specific startup flags. In simulator runtime, keep enableLogger as local UI state (default off), rebuild the map instance after toggle, and show explicit ON/OFF state in the header.
Tech Stack: Node.js CLI (bin/docs-server.js), Vue 3 composables/components in src/simulator, TypeScript runtime guards, browser File API.
Task 1: Simplify docs CLI logger behavior
Files:
- Modify:
bin/docs-server.js
- Remove
--loggerand--no-loggeroptions from CLI help text and parser. - Remove simulator logger URL mapping logic during auto-open.
- Keep
--openbehavior unchanged and open the docs root endpoint directly.
Task 2: Add simulator dump types and payload model
Files:
- Modify:
src/simulator/types/index.ts
- Add
SimulatorDiagnosticDumpPayloadandSimulatorDiagnosticDumpFiletypes. - Keep payload minimal:
mapHex,pathHex,roomProperties,runtime. - Use versioned schema (
version: 1) for forward compatibility.
Task 3: Add robust export/import behavior in playground composable
Files:
- Modify:
src/simulator/core/useRuntimeBindings.ts - Modify:
src/simulator/core/usePlaygroundRender.ts - Modify:
src/simulator/core/useMapPlayground.ts
- Add a runtime snapshot apply helper to
useRuntimeBindingsfor post-render runtime restore. - Implement
exportDiagnosticDump():- Serialize current input + runtime to JSON.
- Trigger browser file download with local-time filename suffix
.simulator-dump.json.
- Implement
importDiagnosticDump(file):- Read and validate JSON shape.
- Validate and normalize runtime fields against runtime defaults.
- Restore input values.
- Re-render map.
- Stop import flow if rendering fails.
- Apply runtime snapshot only after successful render.
Task 4: Add global header controls for dump and logger toggle
Files:
- Modify:
src/simulator/components/SimulatorActionBar.vue - Modify:
src/simulator/components/SimulatorMapPlayground.vue - Modify:
src/simulator/core/useMapPlayground.ts
- Keep dump import/export controls in the global header toolbar.
- Add a dedicated logger toggle button with clear ON/OFF visual states.
- Set logger default state to off.
- On logger toggle, rebuild/re-render map so
config.global.enableLoggertakes effect immediately.
Task 5: Add traceability record for this iteration
Files:
- Modify:
docs/records/plans/2026-03-11-simulator-logger-dump-plan.md
- Update approach to reflect header-level logger toggle.
- Remove outdated CLI logger-flag acceptance criteria.
- Keep record in English and aligned with project traceability requirements.
Task 6: Verify and report
Commands:
- Run
npm run lint. - Run
npx tsc --noEmit. - Report results and any follow-up risks.