Base sheriff stale clock on blocker age#364
Conversation
Deploying impeccable with
|
| Latest commit: |
9ffb055
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8e3a2bb0.impeccable-2rv.pages.dev |
| Branch Preview URL: | https://codex-sheriff-blocker-age.impeccable-2rv.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adjusts the GitHub “sheriff” automation so stale warnings/auto-close timing is based on how long a PR has been waiting on contributor action, rather than how long the PR has been open, preventing immediate warnings after fresh maintainer feedback.
Changes:
- Compute and expose
waitingDaysbased on the most recent contributor-action blocker timestamp. - Gate auto-close on a sheriff warning marker that is newer than the current blocker (not just the
stalelabel). - Update stale warning/close comment copy to describe “days waiting on contributor action”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
scripts/github/sheriff.mjs |
Re-bases stale/warn/close logic on blocker age (waitingDays) and updates marker gating + message copy. |
tests/github-sheriff.test.mjs |
Updates existing tests and adds new scenarios covering the new waiting-days and marker-recency behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f2a880 to
85a918f
Compare
85a918f to
63a13f6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 63a13f6. Configure here.
63a13f6 to
0bdc3b3
Compare
0bdc3b3 to
9ffb055
Compare
New upstream features: - Fix light-mode command demo contrast (pbakaus#370) - chore(deps): bump bun-minor-and-patch group ×10 (pbakaus#368) - Base sheriff stale clock on blocker age (pbakaus#364) Security findings: 0 secrets, 0 dependency CVEs, 0 Semgrep findings. mcps-audit 1360 findings reviewed as heuristic false positives (execSync/delete/join idioms), consistent with prior cycles. Security fixes: none required; bun.lock re-synced after upstream dep bump.

Summary
Why
On #307, a maintainer requested changes on an old PR and the sheriff warned the contributor less than a day later because the PR itself was old. The contributor should get a real response window after fresh maintainer feedback.
Validation
node --test tests/github-sheriff.test.mjsnode --check scripts/github/sheriff.mjsnode --test tests/test-suites.test.mjsgit diff --checkbun run test:corepbakaus/impeccable: PR Allow context roots to be declared in .impeccable/config.json (decoupled from package managers) #307 now plans onlyremove=stale.Note
Medium Risk
Changes automated PR labeling, warnings, and auto-close behavior for all open PRs; incorrect blocker or marker logic could wrongly warn/close or leave stale PRs unmanaged, mitigated by broad test coverage.
Overview
Sheriff stale warn/close timing now uses days waiting on contributor action (
waitingDays) from the latest contributor-action blocker (draft start, requested changes, unresolved threads,/sheriff wait, etc.), not total PR age—so fresh maintainer feedback on an old PR does not trigger an immediate stale warning.Warning and auto-close gating no longer treats the
stalelabel as proof a warning was posted. Only trusted marker comments (defaultgithub-actions/github-actions[bot]) count, and a warning must be newer than the current blocker before auto-close is allowed. Stale copy and projected close dates are anchored on the blocker timestamp pluscloseDays.Data loading paginates full issue comment history before evaluation (GraphQL
comments(last: 50)is only a seed), adds draft timeline events for when draft waiting started, and splits label vs draft timeline slices in the GraphQL query. Tests cover hydration, untrusted markers, draft transitions, and the #307-style scenario.Reviewed by Cursor Bugbot for commit 9ffb055. Bugbot is set up for automated code reviews on this repo. Configure here.