Persistent ContentStore for --continue Sessions
Previously, indexed content (FTS5 knowledge base) was stored in a per-PID temporary database that died with each process restart. Even with --continue, all indexed docs were re-fetched from scratch.
Now, ContentStore uses a per-project persistent path (~/.context-mode/content/{projectHash}.db). Combined with the 24h TTL cache from v1.0.29, this means:
--continue: Indexed docs persist across sessions. No re-fetching needed.- Fresh start: Store DB is wiped for a clean slate (detected via cleanup flag).
- 14-day auto-cleanup: Stale content DBs older than 14 days are deleted on startup.
What changed
getStorePath()— SHA256 of project dir (Windows-normalized) → persistent DB pathisFreshStart()— scans all platform config dirs for cleanup flag written by SessionStart hook- Shutdown:
close()with WAL checkpoint instead ofcleanup()(preserves DB files) cleanupStaleSources(maxAgeDays)— delete old indexed content from within DBcleanupStaleContentDBs(dir, maxAgeDays)— scan directory, mtime-based file cleanupgetDBSizeBytes()— file size tracking for monitoring
Verification
- 4-agent architecture review: store.ts, server.ts, CI/tests, cross-OS+DX
- Critical bug found and fixed:
isFreshStart()was checking wrong cleanup flag path - 1175 tests, 39 files, TSC + bundle clean
Full diff: v1.0.29...v1.0.30