Skip to content

Consolidate transcript recording, storage, and autosave into src/core-engine/transcript#587

Merged
SorraTheOrc merged 2 commits into
mainfrom
feature/CG-0MP12WI75001L9P4-transcript-saveload-consolidation
May 24, 2026
Merged

Consolidate transcript recording, storage, and autosave into src/core-engine/transcript#587
SorraTheOrc merged 2 commits into
mainfrom
feature/CG-0MP12WI75001L9P4-transcript-saveload-consolidation

Conversation

@SorraTheOrc

Copy link
Copy Markdown
Member

Goal

Consolidate transcript recording, storage, and autosave into src/core-engine/transcript/ and provide thin adapters for per-game recorders. Addresses CG-0MP12WI75001L9P4.

Work Done

1. Created consolidated transcript module (src/core-engine/transcript/)

  • TranscriptRecorder.tsTranscriptRecorderBase<T>, BaseTranscript
  • TranscriptStore.tsTranscriptStore, StoredTranscript, TranscriptStoreOptions
  • TranscriptTypes.tsCardSnapshot, snapshotCard()
  • autoSaveTranscript.ts — fire-and-forget persistence helper
  • index.ts — barrel file exporting all of the above

2. Backward-compatible re-export shims

The legacy top-level files (TranscriptRecorder.ts, TranscriptStore.ts, TranscriptTypes.ts, autoSaveTranscript.ts) now re-export from ./transcript/. All existing imports continue to work without changes.

3. Main Street autosave integration

  • Added finalizeMainStreetTranscript() and getMainStreetTranscript() helpers to MainStreetTranscript.ts
  • Main Street now auto-saves transcripts when a game ends (via autoSaveTranscript from the consolidated module)

4. Tests

  • New integration test: tests/main-street/transcript-autosave.integration.test.ts
    • Exercises transcript recording, finalization, autosave persistence
    • Tests full save/load + autosave round-trip
    • Verifies consolidated barrel exports and backward compatibility
  • All existing tests continue to pass (2570 tests, 158 test files)

5. Documentation

  • Migration guide at docs/core-engine/transcript-migration.md

Acceptance Criteria

  • Unit tests for TranscriptRecorderBase and SaveLoadStore exist and pass
  • One example game (Main Street) uses the consolidated module in an integration test exercising save/load and autosave
  • Migration notes are present documenting any API renames or adapter usage
  • No runtime regressions observed in the migrated game(s); smoke tests pass

How to Test

  1. Run npm test — all 2570 tests should pass
  2. Run npm run build — TypeScript and Vite build should succeed
  3. Run the Main Street game and complete a run — transcript should be auto-saved to browser storage
  4. Verify the integration test: npx vitest run tests/main-street/transcript-autosave.integration.test.ts

Review Focus

  • The consolidated transcript/ barrel exports and the backward-compat shim pattern
  • Main Street autosave integration in MainStreetTurnController.ts
  • The integration test coverage for autosave + save/load round-trips

Related

  • Work item: CG-0MP12WI75001L9P4
  • Migration guide: docs/core-engine/transcript-migration.md

Map added 2 commits May 24, 2026 01:35
…utosave into src/core-engine/transcript

- Create src/core-engine/transcript/ directory with barrel file and
  all transcript-related modules (TranscriptRecorderBase, TranscriptStore,
  autoSaveTranscript, TranscriptTypes)
- Convert legacy top-level files to backward-compatible re-exports
- Update core-engine index.ts to export from consolidated barrel
- Add autosave to Main Street (finalizes transcript on game end)
- Add finalizeMainStreetTranscript() and getMainStreetTranscript() helpers
- Add integration test exercising save/load + autosave round-trip
- Add migration guide at docs/core-engine/transcript-migration.md
…engine/transcript imports

All example game files now import from the canonical consolidated module
instead of the legacy shim paths. The legacy files remain as backward-
compatible re-exports so existing code continues to work.

Games migrated:
- golf/GameTranscript.ts, golf/scenes/GolfOverlayManager.ts
- feudalisim/GameTranscript.ts, feudalisim/scenes/FeudalismOverlayManager.ts
- sushi-go/GameTranscript.ts, sushi-go/scenes/SushiGoOverlayManager.ts
- lost-cities/GameTranscript.ts, lost-cities/scenes/LostCitiesOverlayManager.ts
- beleaguered-castle/GameTranscript.ts
- the-mind/GameTranscript.ts
- main-street/MainStreetTranscript.ts
@SorraTheOrc SorraTheOrc merged commit 3e35a36 into main May 24, 2026
1 check failed
@SorraTheOrc SorraTheOrc deleted the feature/CG-0MP12WI75001L9P4-transcript-saveload-consolidation branch May 24, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant