Skip to content

feat(policy): auto-close stalled unproven and abandoned PRs; raise apply caps to 20 - #403

Merged
steipete merged 2 commits into
mainfrom
claude/magical-kilby-f78f2d
Jul 4, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/magical-kilby-f78f2d

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What

Two new PR-only close reasons plus apply throughput, from the 2026-07-04 backlog analysis.

  1. stalled_unproven_pr — external D/F-rated pull requests whose requested real-behavior proof stayed missing, mock_only, or insufficient, with the PR at least 14 days old and the head idle for 14 days. Apply re-verifies live state before closing: a dated proof request (needs-proof label timeline event or proof-nudge comment) must have been visible for at least 14 days — the durable review comment is edited in place and deliberately does not count as the dated ask; draft PRs are excluded (they route to abandoned_pr); proof: sufficient / proof: override labels block; and any human engagement (assignee, requested reviewer/team, maintainer comment, review, or inline comment) blocks.
  2. abandoned_pr — external pull requests idle for 30 days whose live head is still stalled: a draft, labeled status: ⏳ waiting on author, or failing checks (combined status failure/error or a check run concluding failure/timed_out). High-quality proven work (S/A/B overall rating with sufficient or overridden proof) is protected because it belongs in repair/adopt paths, not auto-close.

Both inactivity clocks take the newest of the head committer date and status/check-run timestamps, so pushing an old commit still registers as fresh activity and blocks the close. Missing live data always keeps the PR open.
3. Apply throughput: close limit and checkpoint size raised from 5 to 20 (workflow_dispatch defaults, scheduled fallbacks, and the hard token-lifetime cap). Continuation dispatches already pass these through env, so chains keep the new values.

Both reasons follow the existing conservative contract: review proposes, apply re-checks live GitHub state immediately before mutation, and exemption labels, protected labels, maintainer authorship, same-author pairs, and snapshot drift all still block. REVIEW_POLICY_VERSION is bumped to 2026-07-04-policy-v23, so existing keep-open reports go policy-stale and re-review under the new anchors. New docs: docs/stalled-pr-close-policies.md.

Why

Backlog funnel analysis of openclaw/openclaw (2026-07-04):

  • 6,842 open items (3,592 issues / 3,451 PRs); ~99% have reviews, and 95% of reviews are keep_open — review policy, not apply throughput, is the backlog bottleneck.
  • 1,411 open PRs (41%) have failing CI on their latest commit; 678 of those are idle over 30 days.
  • 1,130 open PRs are D/F-rated with missing/mock-only/insufficient proof; 837 have been idle over 14 days.
  • Of externally-closed items ClawSweeper had kept open, a 100-item sample shows 37% were PRs humans later closed unmerged.
  • 27% of historical close proposals were overtaken externally before apply reached them, hence the cap raise.

Estimated immediate candidates: ~837 proof-expiry plus ~500-600 abandoned PRs, with only ~45 A/B-rated-with-proof PRs in the union needing the built-in exemptions.

Proof

  • pnpm run check green locally (build, lint, unit + repair tests, changed-surface and full coverage ratchets, format check).
  • Codex autoreview (gpt-5.5, structured) ran three rounds: two P1 findings — missing proof-request verification, and committer-date-only inactivity — were fixed with the dated-ask gate and the push-safe activity clock; final round reports "patch is correct", no actionable findings.
  • New unit tests: decision gates (PR-only, maintainer authorship, exemption labels, proof-status and rating-tier requirements, S/A/B+proof protection), apply age gates, and all proof-request dating branches (no ask, aged label event, fresh label event, aged nudge, edited-review-comment-only).
  • New e2e apply tests against the mock gh harness: dry-run closes for both reasons, plus kept-open outcomes for recent head activity, a too-fresh proof request, draft routing, a healthy live PR, and a maintainer comment.

@steipete
steipete requested a review from a team as a code owner July 4, 2026 07:23
@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper review: did not complete due to Codex infrastructure failure. Reviewed July 4, 2026, 3:27 AM ET / 07:27 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Not assessed.
Failure reason: codex execution failed.

This is a ClawSweeper/Codex infrastructure failure, not a PR readiness or patch-quality verdict.
Keep any merge decision on the normal maintainer review path until ClawSweeper can complete a fresh review.

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

Do we have a high-confidence way to reproduce the issue?

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 4db0631ce933.

Evidence reviewed

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: No stderr captured.
  • codex stdout: {"type":"thread.started","thread_id":"019f2c06-c879-7b72-87ef-015d6d597c5c"}.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete force-pushed the claude/magical-kilby-f78f2d branch from c28dfb4 to a6ea05c Compare July 4, 2026 07:26

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c28dfb43dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/clawsweeper.ts
Comment on lines +3432 to +3433
observe(record.started_at);
observe(record.completed_at);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Count queued check runs as head activity

When the latest head has a newly queued check run, GitHub exposes a recent created_at while started_at/completed_at can still be null, so this path misses the only timestamp for that CI activity. In that scenario, a PR that is otherwise waiting-on-author/failing or unproven can keep an old headActivityAtMs and be closed even though check activity happened within the 14/30-day inactivity window; include the check run created_at in the observed activity clock.

Useful? React with 👍 / 👎.

Comment thread src/clawsweeper.ts
Comment on lines +3483 to +3484
if (!body.includes(PROOF_NUDGE_MARKER_PREFIX)) continue;
observe(record.created_at);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Trust only bot proof-nudge comments

This treats any comment containing the proof-nudge marker as a dated proof request, but comments can be authored or edited by non-ClawSweeper users while retaining an old created_at. A stale user comment that copies <!-- clawsweeper-proof-nudge would satisfy the 14-day proof-request gate and allow stalled_unproven_pr closure without an actual bot proof nudge; reuse the existing proof-nudge marker author validation before observing the timestamp.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit f4bc900 into main Jul 4, 2026
9 checks passed
@steipete
steipete deleted the claude/magical-kilby-f78f2d branch July 4, 2026 07:36
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…ply caps to 20 (openclaw#403)

* feat(policy): auto-close stalled unproven and abandoned PRs

* feat(apply): raise close limit and checkpoint size to 20
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.

1 participant