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

opened this

Merged 39d 17h ago, live in production

I added staleFold(pulls, now) in src/flow/stalefold.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.

Notes

opened this

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 }, with lastPushAt as an ISO string. Each result is the same pull plus days and note.
  • Stale test: exactly 7 days counts as stale, and just under does not. D in 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 lastPushAt isn'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 with issueNumber: null is still listed, with note: 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.

Closes #6521

commented

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 }, with lastPushAt as an ISO string. Each result is the same pull plus days and note.
  • Stale test: exactly 7 days counts as stale, and just under does not. D in 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 lastPushAt isn'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 with issueNumber: null is still listed, with note: 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.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs