Skip to content

feat(history): add a retention period, and collapse repeated statements - #600

Merged
EVWorth merged 1 commit into
mainfrom
feat/history-age-retention-and-dedup
Sep 10, 2026
Merged

EVWorth merged 1 commit into
mainfrom
feat/history-age-retention-and-dedup

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Closes #592, closes #590.

Stacked on #599 (→ #598 → #597 → #593 → #584). The commit to read here is the last one.

Retention period (#592)

FR-9.1.3 asked for a period and only ever got a count. Both apply now, and whichever bites first wins — they answer different questions: how much clutter to tolerate, and how long any of it should be kept at all.

  • Forever stays the default. Quietly starting to delete someone's history on upgrade is the wrong way to introduce the setting.
  • Applied at startup, not on a timer. A session left open for a week shouldn't start deleting rows out from under someone reading them.
  • An entry exactly at the cutoff is kept. "Keep 30 days" has to keep the entry from 30 days ago.
  • Raising it back to forever only records the choice — it can't bring anything back.
  • A failed prune doesn't stop the panel loading. Retention is housekeeping.

Repeated statements (#590)

Running the same statement ten times while iterating filled ten rows and pushed the rest of the session off the panel; with a 500-entry cap a tight edit-run loop could evict a morning's work. Consecutive identical runs now collapse into one row marked with a count.

Three deliberate limits, each with a test:

  • Only consecutive repeats. SELECT, UPDATE, SELECT is someone checking their work — merging the two selects would hide that.
  • Only under the default sort. Sorting by duration makes adjacency meaningless, so nothing collapses there at all.
  • A failure never merges into a success, even when the text matches. The outcome is the most important thing on the row, and "×5" beside a green tick when one of them failed would be a lie.

Verification

3 new Rust tests, 8 grouping tests, 7 store tests, 5 panel tests. Full suite 1894 passing, clippy clean, 0 lint errors. FR-9.1.3 updated to describe what now exists.

Two ways the panel filled with things nobody needed.

FR-9.1.3 asked for a retention period and only ever got a count (#592).
Both apply now, and whichever bites first wins: they answer different
questions — how much clutter to tolerate, and how long any of it should be
kept at all. Forever stays the default, because quietly starting to delete
someone's history on upgrade is the wrong way to introduce the setting.

Age retention is applied at startup rather than on a timer. A session left
open for a week should not start deleting rows out from under someone who
is reading them. An entry exactly at the cutoff is kept: "keep 30 days" has
to keep the entry from 30 days ago. Raising the period back to forever
cannot bring anything back, so it only records the choice. A failed prune
does not stop the panel loading — retention is housekeeping.

Running the same statement ten times while iterating filled ten rows and
pushed the rest of the session off the panel; with a 500-entry cap a tight
edit-run loop could evict a morning's work (#590). Consecutive identical
runs now collapse into one row marked with a count.

Only consecutive ones, and only under the default sort. Non-adjacent
repeats stay separate because the order is the story — SELECT, UPDATE,
SELECT is someone checking their work, and merging the two selects would
hide that. Sorting by duration makes adjacency meaningless, so nothing
collapses there at all. A failed run never merges into a successful one
even when the text matches: the outcome is the most important thing on the
row, and "×5" beside a green tick when one of them failed would be a lie.

Closes #592
Closes #590

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth force-pushed the feat/history-age-retention-and-dedup branch from 55412dc to 6001013 Compare September 10, 2026 00:07
@EVWorth
EVWorth merged commit b39b39b into main Sep 10, 2026
12 checks passed
@EVWorth
EVWorth deleted the feat/history-age-retention-and-dedup branch September 10, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2/doc-drift] No age-based history retention (FR-9.1.3) [P2/ux] Repeated identical statements each take a row

1 participant