Summary
SuggestionStore.LoadAll / SaveUnlocked (SuggestionStore.cs) read and write the entire .cdidx/suggestions.json file on every operation. There is no TTL (max_age), no max-row cap, no archival policy, and no vacuum command. Over a year of AI-driven suggestions at modest rates (e.g. 50/week from a multi-agent audit), the store grows to thousands of records, inflating JSON read/write latency and making cdidx suggestions list painful to browse. Old, never-acted-on suggestions also pollute fuzzy-dedup baselines (cross-link C602).
Where
Suggested approach
(1) Add a MaxSuggestionAge (default 365 days) and MaxSuggestionCount (default 5000) config to .cdidx/config.json (cross-link C595). (2) On each TryAddAndSubmit, prune records older than MaxAge OR exceeding MaxCount (oldest-first); archive pruned records to .cdidx/suggestions.archive.jsonl (append-only) rather than discarding. (3) Add cdidx vacuum-suggestions subcommand for manual cleanup with a --dry-run mode that reports what would be pruned. (4) Surface "pruned N stale records" in stderr on each vacuum trigger so operators see the maintenance. (5) Add regression test: seed store with 100 records dated 400 days ago, call TryAddAndSubmit, assert they're archived and the live store has only the new record. (6) Cross-link with #1874, #1728, C602, C604, C595.
Summary
SuggestionStore.LoadAll/SaveUnlocked(SuggestionStore.cs) read and write the entire.cdidx/suggestions.jsonfile on every operation. There is no TTL (max_age), no max-row cap, no archival policy, and novacuumcommand. Over a year of AI-driven suggestions at modest rates (e.g. 50/week from a multi-agent audit), the store grows to thousands of records, inflating JSON read/write latency and makingcdidx suggestions listpainful to browse. Old, never-acted-on suggestions also pollute fuzzy-dedup baselines (cross-link C602).Where
src/CodeIndex/Cli/SuggestionStore.cs(LoadAll, SaveUnlocked — no expiry / cap logic)Suggested approach
(1) Add a
MaxSuggestionAge(default 365 days) andMaxSuggestionCount(default 5000) config to.cdidx/config.json(cross-link C595). (2) On eachTryAddAndSubmit, prune records older than MaxAge OR exceeding MaxCount (oldest-first); archive pruned records to.cdidx/suggestions.archive.jsonl(append-only) rather than discarding. (3) Addcdidx vacuum-suggestionssubcommand for manual cleanup with a--dry-runmode that reports what would be pruned. (4) Surface "pruned N stale records" in stderr on each vacuum trigger so operators see the maintenance. (5) Add regression test: seed store with 100 records dated 400 days ago, call TryAddAndSubmit, assert they're archived and the live store has only the new record. (6) Cross-link with #1874, #1728, C602, C604, C595.