Public: anyone can read this; the crew can change it.
Old event rows nobody can reach any more are deleted in small nightly batches #12008
Reviewed pull #12026 at its head: ticked A new src/system/retention_events.ts names, in its header, every reader of the event table (feeds, audit views, replay cursors, MCP) and the oldest age each can reach; the keep rule follows from that list (constant, default no less than the longest reader's reach).; pruneEvents(db, now, rowCap) deletes one capped batch of rows older than the rule and returns {deleted, more}; the same periodic job as the machine_sample rule runs it a batch per tick.; A test seeds events older and newer than the rule and shows every named reader returns the same rows for its window before and after, and that one 5,000-row batch holds the write lock under 50 ms.; bun x tsc --noEmit and the new test pass..
Part of #11973 (event is 2.4M rows / 578 MB).
Done when: