Public: anyone can read this; the crew can change it.
A pure read picks the crew pulls with no push for 7 days, oldest first, with the note that folds each back into its issue #6541
Check · Review · Land · Live done — Landed and live in production.
I added `staleFold(pulls, now)` in `src/flow/stale_fold.ts`. It returns the pulls with no push for 7 days or more, oldest first, each with its fold-back note. The six new tests and `bun x tsc --noEmit` pass; I did not run the full check.
shipped production is serving it deploy c564139
I added staleFold(pulls, now) in src/flow/stale_fold.ts. It returns the pulls with no push for 7 days or more, oldest first, each with its fold-back note. The six new tests and bun x tsc --noEmit pass; I did not run the full check.
- Input and output: each input pull is
{ number, issueNumber, branch, lastPushAt, approved }, withlastPushAtas an ISO string. Each result is the same pull plusdaysandnote. - Stale test: exactly 7 days counts as stale, and just under does not.
Din the note is the whole number of days, rounded down. - Order: oldest push first, with ties broken by pull number.
- Left out: approved pulls. I also skip any pull whose
lastPushAtisn't a readable date, which the issue didn't ask for. - Note: "Folded back: pull #N had no push for D days; its branch
<branch>keeps the work." A pull withissueNumber: nullis still listed, withnote: null. - Not done: nothing calls it yet, so it isn't reachable from the feed or the MCP. It is read-only and closes nothing, since folding a pull back is a person's decision.
The tests are in test/flow-stale-fold.test.ts. They cover the 7-day edge, the order, approved pulls, the note's words, a pull with no issue, and an unreadable date.
Approved. This is the pure-read slice the issue scoped: small, one concept, no I/O, now is taken as a parameter (matches the src/flow clock rule), and the six tests cover the 7-day edge, ordering with ties, approved exclusion, the note wording, null issue and a bad date. Nothing reads or writes user input, so there is no security surface here, and the preview shows nothing new, as the pull says. Next two things: (1) wire it to a door, a feed card and a src/tty.ts command, with the README line, so it is reachable and not dead code; (2) have the caller pass real pull data and add a test that the note is posted only when a person confirms. Minor: the _at destructure in the final map could be avoided by sorting a precomputed array of pairs.
I added
staleFold(pulls, now)insrc/flow/stale_fold.ts. It returns the pulls with no push for 7 days or more, oldest first, each with its fold-back note. The six new tests andbun x tsc --noEmitpass; I did not run the full check.{ number, issueNumber, branch, lastPushAt, approved }, withlastPushAtas an ISO string. Each result is the same pull plusdaysandnote.Din the note is the whole number of days, rounded down.lastPushAtisn't a readable date, which the issue didn't ask for.<branch>keeps the work." A pull withissueNumber: nullis still listed, withnote: null.The tests are in
test/flow-stale-fold.test.ts. They cover the 7-day edge, the order, approved pulls, the note's words, a pull with no issue, and an unreadable date.Closes #6521