Replace replay native SQLite with bounded JSONL storage #159

Closed
opened 2026-07-26 00:21:50 +00:00 by coilyco-ops · 0 comments
Member

Outcome

Replace the replay mod's native SQLite dependency with one append-only JSONL store that both the C# recorder and Python reader can consume on Linux without native-library loading.

Decision source: #88.

Scope

  • Replace mods/replay/src/EventStore.cs persistence with newline-delimited Storage/EcoReplay.jsonl.
  • Preserve the bounded channel and background writer so game-thread work remains non-blocking.
  • Preserve the current event schema and bounded filtered query contract.
  • Implement bounded retention or compaction for the newest 2,000,000 rows without deleting the existing SQLite database.
  • Update the Python direct-file reader to consume JSONL. Keep the mod HTTP upstream path unchanged.
  • Remove Microsoft.Data.Sqlite, SQLitePCLRaw runtime assets, and the native-library resolver from the replay mod.
  • Add C# and Python coverage for append, malformed or partial final lines, filters, limits, retention, and restart recovery.
  • Update docs/replay/README.md and docs/FEATURES.md.

Safety and migration

The implementation must not delete, rewrite, or silently convert the existing EcoReplay.db. It remains a recoverable historical archive. Any one-time import of old rows is a separate operator-approved task because deduplication and backup boundaries need live evidence.

Validation

  • ward exec test
  • ward exec lint
  • ward exec build-mod-replay
  • ward exec test-mod-replay
  • ward exec precommit

Non-goals

No live mod deployment, server restart, Postgres provisioning, destructive SQLite cleanup, or production verification.

## Outcome Replace the replay mod's native SQLite dependency with one append-only JSONL store that both the C# recorder and Python reader can consume on Linux without native-library loading. Decision source: #88. ## Scope * Replace `mods/replay/src/EventStore.cs` persistence with newline-delimited `Storage/EcoReplay.jsonl`. * Preserve the bounded channel and background writer so game-thread work remains non-blocking. * Preserve the current event schema and bounded filtered query contract. * Implement bounded retention or compaction for the newest 2,000,000 rows without deleting the existing SQLite database. * Update the Python direct-file reader to consume JSONL. Keep the mod HTTP upstream path unchanged. * Remove `Microsoft.Data.Sqlite`, SQLitePCLRaw runtime assets, and the native-library resolver from the replay mod. * Add C# and Python coverage for append, malformed or partial final lines, filters, limits, retention, and restart recovery. * Update `docs/replay/README.md` and `docs/FEATURES.md`. ## Safety and migration The implementation must not delete, rewrite, or silently convert the existing `EcoReplay.db`. It remains a recoverable historical archive. Any one-time import of old rows is a separate operator-approved task because deduplication and backup boundaries need live evidence. ## Validation * `ward exec test` * `ward exec lint` * `ward exec build-mod-replay` * `ward exec test-mod-replay` * `ward exec precommit` ## Non-goals No live mod deployment, server restart, Postgres provisioning, destructive SQLite cleanup, or production verification.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/eco-app#159
No description provided.