Skip to content

Soften sheriff stale classification#360

Merged
pbakaus merged 1 commit into
mainfrom
codex/sheriff-blocked-not-waiting
Jul 9, 2026
Merged

Soften sheriff stale classification#360
pbakaus merged 1 commit into
mainfrom
codex/sheriff-blocked-not-waiting

Conversation

@pbakaus

@pbakaus pbakaus commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep CI failures and merge conflicts as factual blocker labels without starting the waiting on contributor stale clock by themselves.
  • Treat only maintainer-applied waiting on contributor labels as manual wait signals, so sheriff-applied labels can be cleared when rules change.
  • Update the stale warning copy and regression coverage for the less aggressive behavior.

Validation

  • node --test tests/github-sheriff.test.mjs
  • node --check scripts/github/sheriff.mjs
  • node --test tests/test-suites.test.mjs
  • git diff --check
  • bun run test:core
  • Live dry run against pbakaus/impeccable: PR Add native Cursor plugin via canonical harness paths #319 now plans add=blocked: ci,needs maintainer review remove=stale,waiting on contributor.

Note

Medium Risk
Changes automated PR labeling, stale warnings, and auto-close eligibility for open PRs; behavior is limited to the sheriff script but affects contributor-facing lifecycle.

Overview
The GitHub sheriff now distinguishes factual blockers (failing CI, merge conflicts) from contributor-action blockers (draft, review feedback, maintainer wait). CI and merge-conflict issues still get blocked:* labels and needs maintainer review, but they no longer set contributorActionRequired, so they do not add waiting on contributor, start the stale clock, or trigger warn/close.

Manual waiting on contributor only counts when a maintainer applied the label (latestMaintainerLabelEventAt), so sheriff- or bot-applied labels can be cleared when rules change. Stale warning text no longer asks contributors to fix CI or merge conflicts. Tests cover failing CI and conflict-only PRs (including stripping stale/waiting labels from bot-labeled PRs).

Reviewed by Cursor Bugbot for commit a8ad2cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying impeccable with  Cloudflare Pages  Cloudflare Pages

Latest commit: a8ad2cf
Status: ✅  Deploy successful!
Preview URL: https://236145c1.impeccable-2rv.pages.dev
Branch Preview URL: https://codex-sheriff-blocked-not-wa.impeccable-2rv.pages.dev

View logs

@pbakaus pbakaus marked this pull request as ready for review July 9, 2026 17:16
Copilot AI review requested due to automatic review settings July 9, 2026 17:16
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR softens how the GitHub sheriff treats stale pull requests. The main changes are:

  • Separates factual blockers like CI failures and merge conflicts from contributor-action blockers.
  • Keeps stale warnings and auto-close behavior limited to draft state, review feedback, and explicit maintainer wait signals.
  • Treats only maintainer-applied waiting on contributor labels as manual wait signals.
  • Updates stale warning text and tests for the softer behavior.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is localized to sheriff state classification and has focused tests for the updated CI and merge-conflict behavior. No functional or security issues were identified in the changed paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The Github sheriff verification suite was executed and its results show the sheriff suite passing, including regression checks for blocking checks and for merge-conflict warnings.
  • The node check step for the sheriff script completed with exit code 0.
  • The test suites registry smoke ran and reported all tests passing (3/3).
  • The git diff check step ran and exited with code 0, indicating no diff issues.
  • A combined validation transcript was produced that contains the full ordered transcript and exit codes for all executed commands.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
scripts/github/sheriff.mjs Updates sheriff blocker classification so only contributor-action blockers drive stale warnings and closures while factual CI and merge-conflict labels remain applied.
tests/github-sheriff.test.mjs Adds tests for CI and merge-conflict blockers no longer starting the contributor stale clock.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
  participant Sheriff as GitHub sheriff
  participant PR as Pull request data
  participant Plan as Evaluation plan

  Sheriff->>PR: Read status, mergeability, reviews, threads, labels
  Sheriff->>Plan: Add factual blockers for CI/conflicts
  Sheriff->>Plan: Add contributor blockers for draft/review/manual maintainer wait
  Plan->>Plan: "contributorActionRequired = any contributor blocker"
  alt contributor action required
    Plan->>Plan: Add waiting/stale labels and warn/close when eligible
  else only factual blockers or ready state
    Plan->>Plan: Add needs maintainer review or ready to merge
    Plan->>Plan: Do not warn or auto-close
  end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
  participant Sheriff as GitHub sheriff
  participant PR as Pull request data
  participant Plan as Evaluation plan

  Sheriff->>PR: Read status, mergeability, reviews, threads, labels
  Sheriff->>Plan: Add factual blockers for CI/conflicts
  Sheriff->>Plan: Add contributor blockers for draft/review/manual maintainer wait
  Plan->>Plan: "contributorActionRequired = any contributor blocker"
  alt contributor action required
    Plan->>Plan: Add waiting/stale labels and warn/close when eligible
  else only factual blockers or ready state
    Plan->>Plan: Add needs maintainer review or ready to merge
    Plan->>Plan: Do not warn or auto-close
  end
Loading

Reviews (1): Last reviewed commit: "Soften sheriff stale classification" | Re-trigger Greptile

@pbakaus pbakaus merged commit fb6d3e9 into main Jul 9, 2026
12 checks passed
@pbakaus pbakaus deleted the codex/sheriff-blocked-not-waiting branch July 9, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the GitHub “sheriff” PR triage logic to be less aggressive about staleness by separating “factual blockers” (CI failures, merge conflicts) from “contributor-action blockers”, so stalled PR automation only applies when a contributor is actually expected to respond.

Changes:

  • Stop treating failing CI and merge conflicts as contributor-action blockers (so they don’t start the waiting on contributor stale clock).
  • Only treat waiting on contributor as a manual wait signal when the label was applied by a maintainer.
  • Update stale warning text and extend regression tests for the softened behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/github-sheriff.test.mjs Updates and adds regression tests for the new blocker/stale classification behavior.
scripts/github/sheriff.mjs Refactors blocker classification, changes the waiting on contributor label provenance logic, and updates stale warning copy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +625 to +630
function latestMaintainerLabelEventAt(events, label, type, maintainers) {
return latestDate(events
.filter((event) => event.type === type && event.label === label)
.filter((event) => maintainers.has(normalizeLogin(event.actorLogin)))
.map((event) => event.createdAt));
}

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a8ad2cf. Configure here.

);
if (labels.has('waiting on contributor') && waitingLabelAt && !isAfter(latestContributorAt, waitingLabelAt)) {
blockers.push({ kind: 'manual-waiting', at: waitingLabelAt });
addContributorBlocker({ kind: 'manual-waiting', at: waitingLabelAt });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hydration skips maintainer label backfill

Medium Severity

Evaluation now treats waiting on contributor as a contributor blocker only when a maintainer LabeledEvent exists, but hydrateMissingWaitingLabelEvents still skips issue-event backfill whenever any labeled event is present—including sheriff bot events. A maintainer-applied wait can be cleared incorrectly when the GraphQL timeline only captured bot labeling.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a8ad2cf. Configure here.

mp3wizard added a commit to mp3wizard/impeccable that referenced this pull request Jul 10, 2026
New upstream features: OpenAI plugin submission bundle (pbakaus#363), init flow captures positioning/conversion/proof context (pbakaus#315), Node 22 CLI install fix (pbakaus#361), sheriff stale-classification softening (pbakaus#360), docs UI polish (pbakaus#358), mechanical pre-scan for typeset/layout (pbakaus#345), native-project routing for audit/adapt (pbakaus#357)
Security findings: 0 secrets, 0 dependency CVEs, 0 Semgrep findings; mcps-audit 1360 findings all reviewed as heuristic false positives (execSync/delete/join JS idioms); skill-audit all 65 files LOW/MEDIUM, no HIGH/CRITICAL
Security fixes: none required this cycle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants