fn deduplicate_entries(entries: Vec<HistoryEntry>) -> Vec<HistoryEntry>Expand description
Deduplicate history entries by command string, keeping the most recent occurrence.
Entries are already sorted by timestamp (most recent first), so we keep the first
occurrence of each command, accumulating the number of collapsed duplicates in
its use_count for the frequency component of scoring. Trailing whitespace is
ignored for dedup since “df -h” and “df -h “ are visually identical and
semantically the same.