Skip to content

fix(runs): old runs go, and the newest runs of each flow stay - #268

Merged
xiduzo merged 1 commit into
fix/issues/10-legacy-schemafrom
fix/issues/11-run-retention
Dec 2, 2026
Merged

xiduzo merged 1 commit into
fix/issues/10-legacy-schemafrom
fix/issues/11-run-retention

Conversation

@xiduzo

@xiduzo xiduzo commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Summary

Changes

Test plan

  • [ ]

Related

The cleanup job removes the history of runs past retention (PD 54): every run
of the window stays (max of 180 days and twice the longest day range of a
view), and the newest runsToKeepPerFlow (default 20) of each flow stay. A run
that did not end, a run whose events have not reached its Host, and a run
that holds the last event of a walker stay too. Everything else goes with its
rows, walk files, transcripts and logs, and so do the files of runs that are
gone. Each place sweeps its own history, a minute after the start and every
6 hours.

Red -> green (sweep-run-history.test.ts, retention.test.ts):
- old run beyond the newest N: kept everything -> removed with rows and files
- old run within the newest N: kept -> kept
- young run: kept -> kept
- unfinished old run (working, sleeping, at a Gate): kept -> kept, failed one goes
- orphan files: kept -> removed after a day of rest
- window follows the view ranges: Infinity -> max(180, 2 x longest)
- the setting changes N: kept everything -> 20 keeps 4, 1 keeps 1

Closes #238

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: sander boer <mail@sanderboer.nl>
@xiduzo
xiduzo added this pull request to stack #270 December 2, 2026 09:17
@xiduzo
xiduzo marked this pull request as ready for review December 2, 2026 10:21
@xiduzo
xiduzo merged commit 823f143 into main Dec 2, 2026
24 checks passed
@xiduzo
xiduzo deleted the fix/issues/11-run-retention branch December 2, 2026 10:23
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.

1 participant