Skip to content

fix(sep-automation): close SEP pull requests after 180 days without progress - #3539

Open
claude[bot] wants to merge 3 commits into
mainfrom
sep-automation-inactivity-close
Open

claude[bot] wants to merge 3 commits into
mainfrom
sep-automation-inactivity-close

Conversation

@claude

@claude claude Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Requested by David Soria Parra · Slack thread

On hold: do not merge. The 180-day inactivity close and the dormant status are going into a separate Process SEP. This pull request waits until the Core Maintainers decide that SEP.

Before: Since #3535 the SEP lifecycle bot never closes anything. A quiet SEP pull request only gets reminders: a "Draft Check-in" after 90 days and a "Maintainer Activity Check" every two weeks. Those reminders also hid how quiet a pull request was, because the bot's own @mention counted as activity from the person it mentioned. #2343 is an example: its last commit, review or human comment was 252 days ago, and it has only collected bot pings since.

After: Every open pull request that carries the SEP label or the wg-support-needed label follows one rule, whether it is a draft pull request or ready for review, and whatever its status. accepted and in-review pull requests are covered too. After about 150 days without progress the bot posts one "Inactivity Notice". After about 180 days without progress the bot closes the pull request with one short comment that links the SEP guidelines. The close only happens after a notice that is at least 30 days old. The bot adds no label and no status. Progress is a new commit, a submitted review or a comment from a person. Draft pull requests get this inactivity rule and no status-based pings. A pull request that merely has "SEP" in its title, without either label, is never warned or closed.

How

  • Thresholds: INACTIVITY_WARNING_DAYS = 150 and INACTIVITY_CLOSE_DAYS = 180 in src/rules.ts, read through src/config.ts and overridable by environment variables of the same names.
  • Which pull requests: the rule runs in src/processor.ts for pull requests that carry the SEP or wg-support-needed label (SEP_LABEL and the new WG_SUPPORT_NEEDED_LABEL in src/sep/detector.ts). Status labels do not matter, so draft, in-review, accepted and deferred pull requests are all covered. Detection itself is unchanged: the bot still treats "SEP" in a title as a SEP for its other code paths, but the inactivity rule skips a pull request that matched by title only, such as docs: working-group sponsored SEP process #3529, docs(community): align Auth IG charter with SEP sponsorship guidelines #3531 and this one. SEP issues are not touched.
  • What counts as progress (progressTime and analyzeInactivity in src/sep/analyzer.ts): the bot now reads the issue timeline through a new getTimeline in src/github/client.ts. committed entries count by committer date, reviewed and commented entries count unless they come from a bot account or carry the bot's comment marker, and reopened restarts the clock so that a reopened pull request is not closed again on the next run. Everything else is ignored, including the mentioned and subscribed events that the bot's own pings create. The clock starts at the pull request's creation.
  • Notice before close: the close needs a notice posted since the last progress that is at least 30 days old (close days minus warning days). A pull request that is already past 180 days when this merges gets the notice first and is closed 30 days later. The notice carries its own marker, so it is posted once per quiet period.
  • Draft pull requests: SEPItem gets isDraft from the API's draft field. A draft pull request gets the inactivity rule and skips the status-based pings (draft check-in, maintainer activity check, accepted reminder), even if it carries a status label. Today that changes SEP-2343: Clarify that elicitation requires authorization for remote servers #2343 only. No ready_for_review or converted_to_draft trigger is added, because nothing in the code reacts to those events and the weekly sweep reads the flag.
  • Other changes: handleInactivity in src/actions/ping.ts closes first and comments second, so a failed close is retried without a duplicate comment. The run-automation job in sep-lifecycle.yml gets a concurrency group per pull request, so two label events cannot post the same notice twice. The Discord summary section "Marked Dormant" becomes "Inactive Pull Requests". The maintainer activity comment no longer talks about sponsoring.
  • Not changed: the per-person clock behind the 90-day draft check-in and the 14-day maintainer check. A bot mention still counts there, and it is what spaces those repeat pings today.
  • Not removed here: the unreachable dormant code (markDormant, createDormantComment, the dormant state) and TransitionHandler. Removing them with their tests is about 500 lines of pure deletion and is left for a separate follow-up pull request to keep this one reviewable.

Testing

npm run build, npm run typecheck and npm test pass in tools/sep-automation (8 files, 62 tests, 21 of them new in test/unit/inactivity.test.ts). npm run prep passes at the repo root. The new tests cover: the bot's own pings and other bots not counting as progress, mentioned and subscribed being ignored, the notice at 150 days, the close at 180 days for a draft and a ready pull request, the clock restarting on a commit, review, human comment or reopening, no second notice in the same quiet period, no close without a 30-day-old notice, a title-only match without either label being left alone at 150 and at 180+ days, a wg-support-needed pull request without the SEP label being covered, dry run, and issues being left alone.

I also ran the built processor read-only, in dry run, against the 32 open pull requests the bot detects today. The rule covers 27 of them. Two would get the notice on the first run (#2343 at 252 days and #2293 at 176 days), and none would be closed. It skips five that carry neither label: #3529, #3531 and this pull request, plus #2624 and #2633, which are SEP pull requests without labels and need the SEP or wg-support-needed label to be covered.

Follows #3535 and matches the wording in #3529: "SEP pull requests that have had no progress for about 180 days will be closed."

This PR was drafted with AI assistance (Claude Code).

…rogress

Add one inactivity rule for every open SEP pull request, draft or ready
for review: a single warning after 150 days without progress, then close
at 180 days once the warning has been up for 30 days. No label or status
is applied. Progress is a commit, a submitted review or a comment from a
non-bot account, read from the issue timeline, so the bot's own pings and
the mentioned/subscribed events they create no longer reset the clock.

Draft pull requests get only this rule. The lifecycle workflow runs one
job at a time per pull request.
@claude
claude Bot requested review from a team as code owners November 11, 2026 02:12
Apply the inactivity rule only to pull requests that carry the SEP or
wg-support-needed label. A pull request the detector matched only
because its title contains "SEP" gets no notice and is not closed.
Detection and the other code paths are unchanged.
@claude
claude Bot marked this pull request as draft November 11, 2026 16:04
@dend
dend marked this pull request as ready for review November 27, 2026 20:09
@dend dend added the do-not-merge Content that is on hold right now and should not be merged in any of the key branches. label Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Content that is on hold right now and should not be merged in any of the key branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants