v2.6.2: Opt-in local SQLite mirror for study search and count
Opt-in local SQLite mirror for study search and count
Adds a self-refreshing SQLite+FTS5 local mirror of the ~577K-study corpus (off by default). When CT_MIRROR_ENABLED=true, search and count queries route to the mirror first and fall back to the live API transparently.
Added:
- MirrorService (src/services/clinical-trials/mirror/) backed by @cyanheads/mcp-ts-core/mirror
- getMirrorConfig() — parses CT_MIRROR_ENABLED, CT_MIRROR_PATH, CT_MIRROR_REFRESH_CRON, CT_MIRROR_FALLBACK_LIVE
- ClinicalTrialsService.mirrorStatus() — exposes mirror readiness and study count
- Mirror routing in searchStudies and getStudiesBatch — transparent live-API fallback for unsupported queries
- Incremental refresh job scheduled on HTTP transport via schedulerService (default: 3 AM daily)
- Mirror unit tests (mirror.test.ts) — 514 tests pass; bun run devcheck clean
Fixes: #56