miroir/notes
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
..
bf-3gfw.md OP#5 (bf-3gfw): Complete dump import variant catalog and documentation 2026-05-08 15:25:12 -04:00
bf-4d9a.md P12.OP1: Shard migration write safety - chaos testing 2026-05-08 15:29:48 -04:00
bf-5xs1.md OP#3: Add completion notes for resharding vs scaling documentation 2026-05-08 15:26:37 -04:00
bf-dijm.md OP#2 (bf-dijm): Add Raft vs Redis research summary note 2026-05-08 15:25:24 -04:00
miroir-qon-final-verification.md Phase 0 (miroir-qon): Final verification complete 2026-05-09 02:29:38 -04:00
miroir-qon-phase-0-verification.md Phase 0 (miroir-qon): Verify foundation completion 2026-05-09 02:24:21 -04:00
miroir-qon-verification-2026-05-09.md Phase 0 (miroir-qon): Verification complete - foundation confirmed 2026-05-09 02:24:21 -04:00
miroir-qon.md Phase 0 (miroir-qon): Re-verify foundation completion 2026-05-09 02:25:45 -04:00
miroir-r3j.md Phase 3 (miroir-r3j): Task Registry + Persistence — Complete 2026-05-09 02:29:38 -04:00
miroir-zc2.1.md P12.OP1: Shard migration cutover race window analysis (miroir-zc2.1) 2026-05-08 20:44:09 -04:00
miroir-zc2.2.md P12.OP2 (miroir-zc2.2): Verify Raft research — findings confirmed 2026-05-08 20:38:59 -04:00
miroir-zc2.3.md P12.OP1: Shard migration write safety - chaos testing 2026-05-08 15:29:48 -04:00
miroir-zc2.4.md Phase 0 (miroir-qon): Foundation — verification complete 2026-05-08 19:20:18 -04:00
miroir-zc2.5.md OP#5 (miroir-zc2.5): Verify dump import compatibility matrix completeness 2026-05-08 15:29:25 -04:00
miroir-zc2.6-session-summary.md P12.OP6 (miroir-zc2.6): Session summary - ARM64 deferral confirmed 2026-05-08 20:47:19 -04:00
miroir-zc2.6.md P12.OP6 (miroir-zc2.6): Document arm64 support deferral to v1.x+ 2026-05-08 20:43:41 -04:00
phase0-completion.md Phase 0 (miroir-qon): Verification complete - foundation established 2026-05-09 02:12:30 -04:00