rename: sort candidates by least-recently visited

Instead of a hard 7-day cutoff, sort rename candidates so the
least-recently visited come first. Naturally prioritizes unseen
nodes while allowing revisits once everything's been through.
This commit is contained in:
ProofOfConcept 2026-03-10 23:49:08 -04:00
parent 11cbd9664a
commit 9fef98b01e

View file

@ -275,7 +275,8 @@ pub fn format_rename_candidates(store: &Store, count: usize) -> (Vec<String>, St
.map(|(k, n)| (k.as_str(), n))
.collect();
candidates.sort_by(|a, b| b.1.timestamp.cmp(&a.1.timestamp));
// Least-recently visited first — naturally prioritizes unseen nodes
candidates.sort_by_key(|(key, _)| store.last_visited(key, "rename"));
candidates.truncate(count);
let keys: Vec<String> = candidates.iter().map(|(k, _)| k.to_string()).collect();