miroir/docs
jedarden 3556f64742 Phase 3 (miroir-r3j): Task Registry + Persistence — Complete
This phase implements a comprehensive task store with dual backend support
(SQLite for single-pod, Redis for multi-pod deployments), covering all 14
tables from plan §4.

## What Was Already Implemented

The task store module was already complete with:
- Complete 14-table schema (tasks, aliases, sessions, jobs, etc.)
- SQLite backend with idempotent schema initialization
- Redis backend with hash+index pattern for O(n) list queries
- Unified TaskStore trait with runtime backend selection
- Comprehensive property tests and integration tests
- Helm schema validation enforcing Redis for replicas > 1

## What Was Added

- Redis memory accounting documentation (docs/redis-memory-accounting.md)
  - Complete keyspace inventory with size estimates
  - Representative load calculation (~2.8 MB baseline)
  - Scaling characteristics and production recommendations

- Fixed job_dequeue() to properly fetch the updated job after transaction
  - Previously returned a stale Job object from before the UPDATE
  - Now fetches the job after the status change for accuracy

## Definition of Done — All Complete 

- [x] rusqlite-backed store initializing every table idempotently
- [x] Redis-backed store mirroring the same API (TaskStore trait)
- [x] Schema versioning with schema_version row
- [x] Property tests on SQLite backend
- [x] Integration test for pod restart simulation
- [x] Redis-backend integration tests with testcontainers
- [x] miroir:tasks:_index pattern for list endpoints (no SCAN)
- [x] Helm schema enforces taskStore.backend:redis when replicas > 1
- [x] Redis memory accounting validated against representative load

All future features (§13 advanced capabilities, §14 HA modes) can consume
this persistence layer without modification.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 02:29:38 -04:00
..
benchmarks P12.OP3: Validate 2× transient load caveat and add CLI schedule window guard 2026-04-18 22:00:57 -04:00
dump-import P12.OP5: Add dump import compatibility matrix 2026-04-18 21:06:46 -04:00
notes Add repo hygiene: LICENSE, CHANGELOG, .gitignore 2026-04-18 20:47:36 -04:00
plan Phase 0 (miroir-qon): Rust 1.88 upgrade + test infrastructure 2026-05-09 02:05:44 -04:00
research Phase 0 (miroir-qon): Foundation — verification complete 2026-05-08 19:20:18 -04:00
arm64-support.md OP#6: Add ARM64 (aarch64-unknown-linux-musl) target support 2026-05-08 15:25:12 -04:00
chaos_testing_report.md P12.OP1: Shard migration write safety - chaos testing 2026-05-08 15:29:48 -04:00
migration_runbook.md P12.OP1: Shard migration write safety - chaos testing 2026-05-08 15:29:48 -04:00
redis-memory-accounting.md Phase 3 (miroir-r3j): Task Registry + Persistence — Complete 2026-05-09 02:29:38 -04:00
trade-offs.md OP#3: Document S-change (resharding) vs N-change (node scaling) trade-offs 2026-05-08 15:25:53 -04:00