## Problem Tables like `auth_nonces`, `processed_events`, `dead_letter_events`, and `agent_logs` can grow without bound. This degrades performance and increases costs. ## Acceptance criteria - [ ] Add scheduled cleanup jobs: - delete expired `auth_nonces` - archive or prune old `processed_events` (configurable retention) - retention strategy for `agent_logs` (configurable) - [ ] Add indexes where required for cleanup queries - [ ] Add metrics: rows deleted, job duration, last successful run - [ ] Document retention defaults and how to override via env model AuthNonce { ... expiresAt ... } ## Priority P1 / High
Problem
Tables like
auth_nonces,processed_events,dead_letter_events, andagent_logscan grow without bound. This degrades performance and increases costs.Acceptance criteria
auth_noncesprocessed_events(configurable retention)agent_logs(configurable)model AuthNonce { ... expiresAt ... }
Priority
P1 / High