Verified all acceptance criteria for Phase 3 task store implementation. Completed items: - SQLite backend with all 14 tables, WAL mode, schema versioning - Redis backend with hash storage and _index sets for O(n) queries - Unified TaskStore trait with runtime backend switching - Property tests for insert/get round-trip and upsert/list semantics - Integration tests for restart survival and Redis operations - Helm schema validation enforcing redis backend when replicas > 1 - Redis memory accounting documentation validated against representative loads Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 KiB
3 KiB
Phase 3 (miroir-r3j): Task Registry + Persistence — Verification
Date
2026-05-09
Verification Summary
Phase 3 implementation was already complete from prior work (commit 3556f64). This verification session confirmed all acceptance criteria are met.
Completed Items
1. SQLite Backend (crates/miroir-core/src/task_store/sqlite.rs)
- ✅
rusqlite-backed store with all 14 tables - ✅ Idempotent schema initialization with
CREATE TABLE IF NOT EXISTS - ✅ WAL mode enabled for better concurrency
- ✅ Schema version tracking in
schema_versiontable - ✅ Proper error handling with
TaskStoreErrorwrapper
2. Redis Backend (crates/miroir-core/src/task_store/redis.rs)
- ✅ Hash-based storage mirroring SQLite schema
- ✅
_indexsecondary sets for O(cardinality) list queries - ✅ Schema version validation on initialization
- ✅ All HA-mode specific operations (rate limiting, CDC overflow, scoped keys)
3. Unified API (crates/miroir-core/src/task_store/mod.rs)
- ✅
TaskStoretrait with 50+ methods - ✅ Runtime backend switching via
task_store.backendconfig - ✅
create_task_store()factory function
4. Schema Definitions (crates/miroir-core/src/task_store/schema.rs)
- ✅ All 14 tables defined as Rust structs:
- tasks
- node_settings_version
- aliases
- sessions
- idempotency_cache
- jobs
- leader_lease
- canaries
- canary_runs
- cdc_cursors
- tenant_map
- rollover_policies
- search_ui_config
- admin_sessions
5. Property Tests (crates/miroir-core/tests/task_store.rs)
- ✅
(insert, get)round-trip for all table types - ✅
(upsert, list)semantics validation - ✅ Proptest for task filtering
- ✅ Restart survival integration test
6. Redis Integration Tests (crates/miroir-core/tests/task_store_redis.rs)
- ✅ Uses
testcontainersfor real Redis instance - ✅ Leader lease acquisition tests
- ✅ Idempotency cache TTL tests
- ✅ Rate limiting increment/backoff tests
- ✅ CDC overflow buffer tests
- ✅ Scoped key rotation tests
- ✅ Job enqueue/dequeue FIFO tests
7. Helm Schema Validation (charts/miroir/values.schema.json)
- ✅ Enforces
taskStore.backend: rediswhenreplicas > 1 - ✅ Enforces
taskStore.backend: rediswhenhpa.enabled: true - ✅ Clear error messages explaining the constraint
8. Redis Memory Accounting (docs/redis-memory-accounting.md)
- ✅ All 14 tables documented with average size per entry
- ✅ HA-mode specific keys documented with TTL
- ✅ Representative load calculation (~2.8 MB baseline)
- ✅ Scaling characteristics explained
- ✅ Recommendations for Redis sizing
Dependencies
rusqlite 0.32(bundled)redis 0.25(with tokio-rustls-comp)async-trait 0.1proptest 1.0(dev)testcontainers 0.23(dev)
Future Work
All future features can now consume this persistence layer:
- Plan §13 advanced capabilities (read-your-writes sessions, idempotency, canaries, etc.)
- Plan §14 HA modes (multi-pod with HPA, leader election)