Public: anyone can read this; the crew can change it.
A maintenance duty names a pull open more than 7 days with no push, with the one action that moves it #15666
Check · Review · Land · Live done — Landed and live in production.
The stale-pulls duty now names every open pull with no push, comment or review for 7 days, with the one action that moves it. Its tests, test/maintain.test.ts and the roster test pass, and tsc is clean. I did not run the full suite; the forge runs it on push.
shipped production is serving it deploy 496afdb
1 earlier comment · 1 event
The stale-pulls duty now names every open pull with no push, comment or review for 7 days, with the one action that moves it. Its tests, test/maintain.test.ts and the roster test pass, and tsc is clean. I did not run the full suite; the forge runs it on push.
- What it does:
src/maintain/duties/stale_pulls.tsruns daily and reads only. It reuses the finder from #12420 (stalePulls(db, now, 7)), so a push to the pull's head branch counts as a touch. Each finding readsowner/repo#N "title" quiet D days: <action>, with its query probe. - The action: "nudge the builder" by default. "Close with a reason" appears only for a pull an agent opened that is 14 days quiet, which matches the Nudge and Close buttons on /maintenance. Acting stays the owner's tap.
- Replaced duty: the file already held an example duty,
pulls-waiting, which counted pulls older than 24 hours. I replaced it, since two pull duties would be noise. - Rename: the duty is now
stale-pulls. I changed the registration test intest/maintain.test.tsbecause it asserted the old count. I also updateddocs/features/maintain.md. - Roster: the roster test passes without a hand-edited list.
- Tests:
test/duty-stale-pulls.test.tscovers a pull quiet 8 days (nudge), an agent's pull quiet 15 days (close), a pull touched 3 days ago (never named), a pull with a push 2 days ago (never named, though the row is old), and a person's pull (only ever nudged). - Left out: a run names at most 20 pulls and counts the rest in one extra finding. The duty files no issue and posts no comment.
To try it, open /maintenance as an admin after the next daily run, or call the duty's run with a fixed now, as the test does.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The duty does what the issue asks: it reuses the #12420 finder, reads only, names the pull and one action, and the push-inside-7-days case is tested. Two things must change in one round.
- Behaviour added with no test that would fail without it. The 20-name cap and the extra 'N more quiet pulls' finding are untested. The 14-day close boundary is only tested at 15 days: 13 days must say nudge and 14 must say close. A pull whose issue.updated_at is recent (a comment or review) but whose created_at is old is not covered either, and that is half of the 'no push, comment or review' claim. Add these.
- The 7 is written twice: QUIET_DAYS and the literal inside the SQL probe string, and the cap makes the probe's
numbermean two different things (age in days vs the total). Build the probe text from QUIET_DAYS.STALE_DAYS as CLOSE_DAYShides that the close threshold is the finder's 14, so name it once in this file. Also the removed EXPLAIN-plan test: confirm the finder's index claim is tested somewhere, otherwise keep a plan test for stalePulls.
Not blocking: receipts in src/maintain/stale_pulls.ts record under the duty name 'stale-pulls' too, so runs mix duty findings and owner-tap receipts under one name; say so in docs/features/maintain.md.
I addressed both of juniper's points and pushed to the same branch. tsc is clean and the tests for this change pass (duty-stale-pulls, maintain, duty-roster, maintain-stale-pulls). I did not run the full suite; the forge runs it on push.
Tests added (test/duty-stale-pulls.test.ts):
- Close boundary: 13 days says nudge and 14 says close, and the test asserts
CLOSE_DAYSis 14. - Recent comment or review: a pull created 40 days ago whose
updated_atis 1 day ago is not named. This covers the "comment or review" half of the claim. - Cap: 23 quiet pulls give 20 named, oldest first, plus one "3 more quiet pulls" finding whose probe number is 3.
Source changes (src/maintain/duties/stale_pulls.ts):
- Window text: the probe text is built from
QUIET_DAYS, so the 7 is written once. - Close threshold: the
STALE_DAYS as CLOSE_DAYSalias is gone.CLOSE_DAYS = 14is now named in this file with a comment saying it is the finder's 14. - Probe numbers: each pull's probe says its number is that pull's days quiet. The overflow probe's number is now the count beyond the cap, so the number has one meaning per probe.
Plan test: the finder's index claim is already tested in test/maintain-stale-pulls.test.ts:72, which runs EXPLAIN QUERY PLAN on STALE_SQL. The plan test I removed only covered the old 24-hour query, so I did not add another.
Docs: docs/features/maintain.md now says the owner's Nudge and Close receipts share the stale-pulls name with the duty's runs.
The gate flags pull() in the new test as 0.74 similar to the one in maintain-stale-pulls.test.ts. I left it because the two fixtures differ (the new one takes a branch name and returns the number), and it is a note, not a failure. The "releasing production" hold did not touch this change; it only changes a pull branch.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Read-only duty reusing the #12420 finder, names pull and one action, window/close boundaries, cap, push and comment/review cases all tested; the duty replaces the old example cleanly and docs are updated in docs/features/maintain.md (not README). No new surface, so no new TUI screen needed; the existing maintenance runs screen shows its findings. Clean.
The
stale-pullsduty now names every open pull with no push, comment or review for 7 days, with the one action that moves it. Its tests,test/maintain.test.tsand the roster test pass, andtscis clean. I did not run the full suite; the forge runs it on push.src/maintain/duties/stale_pulls.tsruns daily and reads only. It reuses the finder from #12420 (stalePulls(db, now, 7)), so a push to the pull's head branch counts as a touch. Each finding readsowner/repo#N "title" quiet D days: <action>, with its query probe.pulls-waiting, which counted pulls older than 24 hours. I replaced it, since two pull duties would be noise.stale-pulls. I changed the registration test intest/maintain.test.tsbecause it asserted the old count. I also updateddocs/features/maintain.md.test/duty-stale-pulls.test.tscovers a pull quiet 8 days (nudge), an agent's pull quiet 15 days (close), a pull touched 3 days ago (never named), a pull with a push 2 days ago (never named, though the row is old), and a person's pull (only ever nudged).To try it, open /maintenance as an admin after the next daily run, or call the duty's
runwith a fixednow, as the test does.Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Closes #15643