Public: anyone can read this; the crew can change it.
One slow backup night is a finding, not an issue: the growth duty files on duration only after two slow nights in a row #15233
Check · Review · Land · Live done — Landed and live in production.
One slow upload night is now only a finding. Duration files an issue only when the last two nights are each over twice the median of the seven before them. bun x tsc --noEmit, bun scripts/gate.ts --fix and test/backup-growth.test.ts (9 tests) pass here.
shipped production is serving it deploy cfe12e4
One slow upload night is now only a finding. Duration files an issue only when the last two nights are each over twice the median of the seven before them. bun x tsc --noEmit, bun scripts/gate.ts --fix and test/backup-growth.test.ts (9 tests) pass here. I did not run the full suite.
What changed
- Window logic:
Growthinsrc/snapshot/growth.tsgainsprevious(the night before the last, read against its own prior seven) andfiles(the measures that justify an issue). Size files on one night, as before. Duration files only when the previous night was also over twice its median.overis unchanged, so the duty still reports a single slow night as a finding. - Duty:
src/maintain/duties/backup_growth.tsreturns the finding without filing whenfilesis empty. The two-day freshness guard,fileIssueOnceand the closed-since-this-night check are untouched. - Filed body: it names which measure tripped. When duration tripped it gives both nights' numbers. It ends with one line saying what to look at: the upload path to the destination, not the code, when only duration tripped. When size tripped it points at what grew in the data directory first, then the upload path.
- Tests: new cases in
test/backup-growth.test.tscover one slow night (finding, no issue), two slow nights (one issue naming both nights), a slow night then a normal one (nothing), and one night of size growth (files). The duration cases would fail on the old code. No new test file, so nothing to add to the gate list.
Judgement calls
- I read "the seven before them" as each of the two nights against its own preceding seven. A slow first night barely moves the median, so this is close to the other reading.
- In the test I back-dated the earlier closed defect, because issue
created_atuses the real clock and would otherwise trip the closed-since-this-night check.
Approved. Duration now files only after two consecutive nights over twice their own prior-seven median. Size still files on one night. The body names the tripped measure, both nights for duration, and an upload-path line. Tests cover the four cases and no new test file was added. This is a backend duty with no page, so the preview has nothing to exercise.
Two things I would do next:
- Add a duty-level test that a size-only night files with no duration line for the previous night. At the moment that case is asserted only on
growthOf().files. - Compute
previousone level deep rather than recursing through the whole history ingrowthOf. Each night currently carries a full chain ofprevious. Also break the long one-line expressions inbodyOfand rewrap the header comment, which wraps unevenly.
One slow upload night is now only a finding. Duration files an issue only when the last two nights are each over twice the median of the seven before them.
bun x tsc --noEmit,bun scripts/gate.ts --fixandtest/backup-growth.test.ts(9 tests) pass here. I did not run the full suite.What changed
Growthinsrc/snapshot/growth.tsgainsprevious(the night before the last, read against its own prior seven) andfiles(the measures that justify an issue). Size files on one night, as before. Duration files only when the previous night was also over twice its median.overis unchanged, so the duty still reports a single slow night as a finding.src/maintain/duties/backup_growth.tsreturns the finding without filing whenfilesis empty. The two-day freshness guard,fileIssueOnceand the closed-since-this-night check are untouched.test/backup-growth.test.tscover one slow night (finding, no issue), two slow nights (one issue naming both nights), a slow night then a normal one (nothing), and one night of size growth (files). The duration cases would fail on the old code. No new test file, so nothing to add to the gate list.Judgement calls
created_atuses the real clock and would otherwise trip the closed-since-this-night check.Closes #15232