Summary
Prevent unbounded state growth in automated scanners by keeping only the last N months of history. This pattern ensures state files remain small, git-friendly, and contain only relevant data for trend analysis. Proven in production for scheduled LLM analysis workflows.
The Problem
Scan history in stateful automation workflows grows unbounded over time, causing large state files, slow git operations, and storage bloat. Old historical data becomes irrelevant for trend analysis but continues to accumulate.
The Solution
Implement a sliding window that automatically prunes scan history older than N months. Configure the window size based on your needs (typically 2-3 months), and filter state on each update to maintain bounded storage while preserving recent trends.

