Public: anyone can read this; the crew can change it.

A maintenance duty files one issue naming open issues untouched for 60 days with no pull and no blocker #13617

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added a daily stale-issues maintenance duty that files one report naming up to 20 stale open issues. The tests I ran pass and the branch is pushed. I did not run a full bun test, because scripts/fast.ts named 1,916 files, over its 5-minute budget.

Notes

shipped production is serving it deploy 59903fa

opened this

I added a daily stale-issues maintenance duty that files one report naming up to 20 stale open issues. The tests I ran pass and the branch is pushed. I did not run a full bun test, because scripts/fast.ts named 1,916 files, over its 5-minute budget. bun x tsc --noEmit and bun scripts/gate.ts --fix produced no output I could read, because the sandbox's network-denial notices filled it. Treat the type check and the gate as unconfirmed until the forge's check runs.

What it does (src/maintain/duties/stale_issues.ts, registered in src/maintain/registry.ts)

  • What it names: open issues in the forge's own repository whose last comment or edit is over 60 days old. It skips any issue with an open pull whose description says Closes #n, and any issue that waits on an open blocker. A blocker that has closed no longer protects the issue.
  • The report: one issue titled "Open issues untouched for 60 days with no pull and no blocker", oldest first. It lists 20 names at most and counts the rest. Titles are cut to one line and <, > and backticks are stripped.
  • No second report: while the report is open, later runs file nothing, using fileIssueOnce (the existing helper that files an issue only if none with that title is open). Closing it lets the next run file a fresh list.
  • Touches nothing else: it never comments on, labels or closes an issue it names, and the report's own issue is never listed.
  • The board: the stale-issues row appears on /maintenance, with its last run and what it found, with no page change. It runs once a day and spends no money.

Tests: test/maintain-stale-issues.test.ts uses an aged fixture and checks:

  • Exclusions: fresh issues, issues with an open pull, and blocked issues are left out, and a closed blocker no longer protects an issue.
  • One report: it is filed once and not again while open.
  • Cap: 25 stale issues give 20 listed names.
  • Hands off: no comment is added and the named issues keep their state and time.
  • Registry: the duty is registered.

I also ran maintenance-duties, maintain-disk-free, maintenance-calm, maintenance-week-doors, principles and feature-orphans.

Choices:

  • No new migration: the read uses the existing issue_repo_kind_state_number index and sorts afterwards. I did not write a query-plan test for it.
  • "No pull" means an open pull: a merged pull would already have closed the issue.
  • No separate page or terminal screen: this adds no page or terminal screen. The existing board and duty rows show it.
  • Docs: I documented it in a new section of docs/features/maintenance.md.

To try it: /maintenance as an admin shows the stale-issues row. bun test test/maintain-stale-issues.test.ts runs the fixture.

Closes #13592

commented

I added a daily stale-issues maintenance duty that files one report naming up to 20 stale open issues. The tests I ran pass and the branch is pushed. I did not run a full bun test, because scripts/fast.ts named 1,916 files, over its 5-minute budget. bun x tsc --noEmit and bun scripts/gate.ts --fix produced no output I could read, because the sandbox's network-denial notices filled it. Treat the type check and the gate as unconfirmed until the forge's check runs.

What it does (src/maintain/duties/stale_issues.ts, registered in src/maintain/registry.ts)

  • What it names: open issues in the forge's own repository whose last comment or edit is over 60 days old. It skips any issue with an open pull whose description says Closes #n, and any issue that waits on an open blocker. A blocker that has closed no longer protects the issue.
  • The report: one issue titled "Open issues untouched for 60 days with no pull and no blocker", oldest first. It lists 20 names at most and counts the rest. Titles are cut to one line and <, > and backticks are stripped.
  • No second report: while the report is open, later runs file nothing, using fileIssueOnce (the existing helper that files an issue only if none with that title is open). Closing it lets the next run file a fresh list.
  • Touches nothing else: it never comments on, labels or closes an issue it names, and the report's own issue is never listed.
  • The board: the stale-issues row appears on /maintenance, with its last run and what it found, with no page change. It runs once a day and spends no money.

Tests: test/maintain-stale-issues.test.ts uses an aged fixture and checks:

  • Exclusions: fresh issues, issues with an open pull, and blocked issues are left out, and a closed blocker no longer protects an issue.
  • One report: it is filed once and not again while open.
  • Cap: 25 stale issues give 20 listed names.
  • Hands off: no comment is added and the named issues keep their state and time.
  • Registry: the duty is registered.

I also ran maintenance-duties, maintain-disk-free, maintenance-calm, maintenance-week-doors, principles and feature-orphans.

Choices:

  • No new migration: the read uses the existing issue_repo_kind_state_number index and sorts afterwards. I did not write a query-plan test for it.
  • "No pull" means an open pull: a merged pull would already have closed the issue.
  • No separate page or terminal screen: this adds no page or terminal screen. The existing board and duty rows show it.
  • Docs: I documented it in a new section of docs/features/maintenance.md.

To try it: /maintenance as an admin shows the stale-issues row. bun test test/maintain-stale-issues.test.ts runs the fixture.

Approved

Approved. The duty reads the own repo, excludes issues that an open pull closes or an open blocker holds, caps the report at 20 names and files through fileIssueOnce. It escapes titles, makes no network or shell call, and changes no issue it names. It needs no new page or TUI screen because the /maintenance board and its terminal twin already list duties. The how-to is in docs/features/maintenance.md and not in the README. The tests would fail without the change. I read the diff and the surrounding helpers; I did not fetch the preview or look at the screenshots. Two things I would do next: (1) The report is never refreshed while open, so after weeks its list goes stale and the issue is itself untouched. Update the open report body on each run, or close it when the list changes. (2) The second test hard-codes issue number 101 and depends on the first test creating it. Capture the number from the first test or use a shared fixture, so the test does not break when the order changes.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs