You're offline — showing cached data

MC-4305

Inbox cleanup (72K rows) + auto-expire routine messages
2026-06-13 08:50:48 SAST
Home Board MC-4305

Inbox cleanup (72K rows) + auto-expire routine messages

# MC-4294: Inbox cleanup + kill-switch wiring **Priority:** medium **Assigned:** luci **Depends on:** nothing (can start immediately, in parallel with everything) ## What to d...
State Done Next Action Closed Owner Luci Runtime Closed Age 17d ago
MC-4305
Ticket is done; runtime is closed. · profile claude_opus_1m_medium · cwd /home/lucienne/workspace/mission-control · uptime 16d 18h · last activity 16d 16h ago

Description

MC-4305
# MC-4294: Inbox cleanup + kill-switch wiring **Priority:** medium **Assigned:** luci **Depends on:** nothing (can start immediately, in parallel with everything) ## What to do The `orchestrator_inbox` table has 72,000+ rows, most of them routine scheduler messages ("completed cleanly"). The Controller can't see real signals through the noise. ## Steps ### Part A: Bulk-clean old inbox rows 1. Mark all `orchestrator_inbox` rows older than 7 days with `priority='low'` and `source_type='scheduler'` as `status='processed'` and set `processed_at` to now. ```sql UPDATE orchestrator_inbox SET status = 'processed', processed_at = datetime('now') WHERE status = 'pending' AND priority = 'low' AND source_type = 'scheduler' AND created_at < datetime('now', '-7 days'); ``` 2. Add a daily cleanup task (or add to an existing nightly task) that auto-processes routine scheduler messages older than 24 hours: ```sql UPDATE orchestrator_inbox SET status = 'processed', processed_at = datetime('now') WHERE status = 'pending' AND priority = 'low' AND source_type = 'scheduler' AND created_at < datetime('now', '-24 hours'); ``` 3. Verify the drain function (`drain_orchestrator_inbox`) only fetches `status='pending'` rows. If it fetches all rows, fix it. 4. After cleanup, the inbox should have only recent, actionable items — not thousands of "completed cleanly" messages. ### Part B: Auto-expire routine messages 1. In `mc_pickup.py` or wherever inbox items are created, add auto-expiry for routine items: - If `source_type='scheduler'` and `priority='low'`, set `status='processed'` and `processed_at=created_at` immediately. These never need the Controller's attention. - Only non-routine items (errors, reviewer verdicts, escalation signals) should stay `pending`. ### Part C: Verify the kill-switch is wired (This overlaps with MC-4293 Part C — coordinate or just verify it's done.) 1. Check that `mc_orchestrator_flags.killswitch_active()` is called in `mc_pickup.py` before auto-dispatch. 2. If not wired, add the check at the top of the dispatch function: if kill-switch is active, return early without dispatching. 3. The kill-switch file is `.mc_killswitch` in the mission-control root. Test by creating and removing it. 4. **Commit and push.** ## Acceptance criteria - Inbox has fewer than 100 pending items after cleanup - Routine scheduler messages auto-expire immediately on creation - Daily cleanup task exists and runs - Kill-switch verified working in `mc_pickup.py` ## If blocked - If the drain function is complex and touches processed rows, simplify it: drain should only fetch `pending` + `unprocessed` rows, oldest first, with a reasonable limit (e.g., 50 per drain) - If adding a scheduled task is complex, add the cleanup SQL to an existing nightly task (e.g., `luci_operator_tuner`) - Do NOT delete rows — mark them processed. The data is useful for debugging. ## What NOT to do - Do not change the shadow reviewer (MC-4290) - Do not change the review loop (MC-4291) - Do not touch Tessa (MC-4292) - Do not change the operator beyond the kill-switch check (MC-4293)

Activity

done
Luci is working...
Live
No activity yet
Help