Skip to content

fix(review): stop requiring routine PR rebases - #589

Closed
hxy91819 wants to merge 1 commit into
mainfrom
investigate/rebase-main-review-rule
Closed

hxy91819 wants to merge 1 commit into
mainfrom
investigate/rebase-main-review-rule

Conversation

@hxy91819

Copy link
Copy Markdown
Member

Summary

  • stop treating an ordinary behind branch as a contributor blocker or recommending a routine rebase
  • reserve rebase/resolve guidance for conflicts, unavailable merge trees, or concrete merge-result integration failures
  • add a non-blocking maintainer-facing Base freshness metric when the merge base is at least 7 days old
  • avoid daily review-cache churn by invalidating only when freshness state or merge-base identity changes

Motivation

High-throughput repositories can advance by thousands of commits per day. Commit-count drift alone therefore creates noisy, repeated contributor work without proving that a PR is unsafe to merge. This keeps contributor action tied to concrete integration evidence while retaining a simple signal for genuinely old branches.

Impact

Only PRs whose GitHub mergeable state is behind trigger the compare lookup. A stale result adds review context and a non-blocking metric for maintainers or merge automation; it does not lower the PR rating or add contributor next steps. Compare failures fail soft.

Validation

  • Node 24.15.0: build passed
  • Node 24.15.0: 49 focused review prompt/content-cache tests passed
  • formatting, TypeScript compilation, and lint passed as part of pnpm run check
  • full pnpm run check did not complete because Codex runner tests reached the real Codex API and received 401 Unauthorized
  • autoreview was attempted with the bundled helper, but the same Codex API 401 prevented a review result

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 2, 2026, 10:52 PM ET / August 3, 2026, 02:52 UTC.

ClawSweeper review

What this changes

The PR makes ordinary behind-base status non-blocking in review guidance, adds a seven-day maintainer-only base-freshness metric, and normalizes that metric in the review cache key.

Merge readiness

⛔ Blocked by patch quality or review findings - 7 items remain

Keep this maintainer-authored PR open. The policy is explicitly adopted, but the draft is dirty and its runtime implementation targets the former monolithic entrypoint instead of current main’s decomposed review runtime.

Priority: P1
Reviewed head: c0785de3001bd32587eb4d518f6fc6da818d9393

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The policy is adopted, but the conflicted patch is implemented against retired runtime structure and is not correct for current main.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is outside the external-contributor proof gate, but repository policy still calls for current runtime evidence after the required port.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is outside the external-contributor proof gate, but repository policy still calls for current runtime evidence after the required port.
Evidence reviewed 5 items Current main still has the old rebase guidance: The live prompt says a clean or mergeable PR with stale base drift should be described as needing a rebase or review refresh, so the adopted behind-only policy is not already implemented.
The PR writes runtime logic into a retired entrypoint: Current main reduces src/clawsweeper.ts to an entrypoint that delegates to src/clawsweeper-runtime.ts; this branch adds base-drift collection, cache, and metric logic to the prior monolith.
Current module owners now contain the relevant path: The content-cache identity is in src/clawsweeper-source-revision.ts, pull-request context hydration is in src/clawsweeper-item-context.ts, and review execution is coordinated through dedicated workflow modules.
Findings 1 actionable finding [P1] Port base-drift handling to active review modules
Security None None.

How this fits together

ClawSweeper hydrates GitHub pull-request state, derives a review context and cache identity, then gives Codex the context and publishes a maintainer-facing result. This PR changes how merge-base drift is classified and surfaced before review output is rendered.

flowchart LR
  A[GitHub pull request state] --> B[Review context hydration]
  B --> C[Base drift assessment]
  C --> D[Review cache identity]
  C --> E[Codex review prompt]
  D --> F[Reuse or fresh review]
  E --> F
  F --> G[Maintainer-facing result]
Loading

Before merge

  • Port base-drift handling to active review modules (P1) - Current main makes src/clawsweeper.ts a thin entrypoint and moves the relevant context, cache, and review execution into dedicated modules. This added monolithic logic is not on the production path; resolving the dirty merge mechanically would discard it or leave the adopted policy inactive. Rebuild it in the current owners before merge.
  • Resolve merge risk (P1) - GitHub reports a dirty merge state; resolving it mechanically could discard the approved behavior or leave it in the retired entrypoint rather than the active review path.
  • Resolve merge risk (P1) - This changes automated review guidance and cache invalidation, so it needs refreshed runtime proof after the port, including clean-behind and real-conflict cases.
  • Complete next step (P2) - The P1 repair boundary is clear, but the current PR owner must port the implementation, refresh evidence, and obtain a review for the updated head.
  • Improve patch quality - Port the behavior and tests to the active review modules and resolve the real merge conflict.
  • Improve patch quality - Capture redacted runtime output proving clean-behind PRs are non-blocking while dirty or conflicting PRs still receive resolve guidance.
  • Improve patch quality - Request a fresh ClawSweeper review after updating the branch and PR body.

Findings

  • [P1] Port base-drift handling to active review modules — src/clawsweeper.ts:5302-5356
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Branch diff 4 files affected; +223, -9 The branch combines policy text, runtime collection, cache behavior, and focused tests.
Post-head architecture change 7 overlapping paths; +2,115, -30,847 Current main substantially rewrote the affected review architecture after this branch head, which explains the dirty merge and prevents a safe mechanical rebase.

Merge-risk options

Maintainer options:

  1. Port the policy to active modules (recommended)
    Rebuild base-drift collection, cache normalization, and the maintainer metric in current module owners, then prove clean-behind and conflict behavior on a refreshed branch.
  2. Pause the draft
    Keep the PR open only if the patch will be rebuilt against current main; the monolithic implementation should not be merged as-is.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Port the behind-only base-drift policy to the active review modules, retain rebase guidance only for conflicts or concrete merge-result failures, add focused regression tests, and attach redacted runtime proof for clean-behind and conflict cases.

Technical review

Best possible solution:

Port the adopted policy into the active context, source-revision, review-command, and presentation paths; retain rebase guidance only for real conflicts or demonstrated merge-result failures, then validate both branches against current main.

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

Yes, source-reproducible: current prompts/review-item.md still asks reviewers to recommend rebase or refresh for a clean behind-base branch, contrary to the maintainer-adopted policy. The dirty branch and its monolith-only implementation also establish the current integration failure without running a write-capable workflow.

Is this the best way to solve the issue?

No, not as submitted: the policy direction is adopted, but its implementation belongs in current main’s decomposed review modules rather than the former entrypoint. A narrow port is the maintainable path.

Full review comments:

  • [P1] Port base-drift handling to active review modules — src/clawsweeper.ts:5302-5356
    Current main makes src/clawsweeper.ts a thin entrypoint and moves the relevant context, cache, and review execution into dedicated modules. This added monolithic logic is not on the production path; resolving the dirty merge mechanically would discard it or leave the adopted policy inactive. Rebuild it in the current owners before merge.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The maintainer-adopted policy affects contributor-facing review guidance and review automation, but this draft cannot currently deliver it on main.
  • merge-risk: 🚨 automation: The patch changes automated review context, cache invalidation, and generated contributor guidance.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored PR is outside the external-contributor proof gate, but repository policy still calls for current runtime evidence after the required port.

Evidence

What I checked:

  • Current main still has the old rebase guidance: The live prompt says a clean or mergeable PR with stale base drift should be described as needing a rebase or review refresh, so the adopted behind-only policy is not already implemented. (prompts/review-item.md:272, fd51157a1080)
  • The PR writes runtime logic into a retired entrypoint: Current main reduces src/clawsweeper.ts to an entrypoint that delegates to src/clawsweeper-runtime.ts; this branch adds base-drift collection, cache, and metric logic to the prior monolith. (src/clawsweeper.ts:1, fd51157a1080)
  • Current module owners now contain the relevant path: The content-cache identity is in src/clawsweeper-source-revision.ts, pull-request context hydration is in src/clawsweeper-item-context.ts, and review execution is coordinated through dedicated workflow modules. (src/clawsweeper-source-revision.ts:250, fd51157a1080)
  • The architectural move has concrete provenance: Commit dccfa528f0387431807818ba43823310b5e08f51 decomposed the ClawSweeper entrypoint into focused subsystems after this branch was created, and the post-head comparison adds the active context, command-workflow, and source-revision modules while removing the old monolith. (src/clawsweeper-review-command-workflow.ts:1, dccfa528f038)
  • Maintainer direction supports the feature: The July 23, 2026 maintainer-relayed comment adopted the policy and requested that the branch be rebased because the review prompt and cache had shifted; GitHub now reports the branch as dirty.

Likely related people:

  • steipete: The current review-runtime decomposition and its follow-up refactors were authored by Peter Steinberger, and the PR discussion records the adopted product direction from @steipete. (role: recent architecture contributor; confidence: high; commits: dccfa528f038, 922ebc673e12, 1c9cb5dc6dd2; files: src/clawsweeper.ts, src/clawsweeper-item-context.ts, src/clawsweeper-review-command-workflow.ts)
  • PollyBot13: The duplicate-check cache-key repair is adjacent to this PR’s cache-normalization rationale and touched the current content-cache test surface. (role: adjacent cache contributor; confidence: medium; commits: 12af8b7d0e0c; files: src/review-checks-digest.ts, test/review-content-cache.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.

History

Review history (24 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-01T21:23:27.645Z sha c0785de :: found issues before merge. :: [P1] Rebuild this logic in the decomposed review runtime
  • reviewed 2026-08-01T22:38:41.854Z sha c0785de :: needs changes before merge. :: [P1] Port base-drift behavior to the decomposed review runtime
  • reviewed 2026-08-02T08:54:27.666Z sha c0785de :: found issues before merge. :: [P1] Rebuild base-drift behavior in the decomposed review runtime
  • reviewed 2026-08-02T12:47:41.240Z sha c0785de :: found issues before merge. :: [P1] Port base-drift behavior to the decomposed review runtime
  • reviewed 2026-08-02T15:25:40.827Z sha c0785de :: needs changes before merge. :: [P1] Rebuild base-drift handling in active review modules
  • reviewed 2026-08-02T17:35:37.312Z sha c0785de :: found issues before merge. :: [P1] Port base-drift handling to the active review runtime
  • reviewed 2026-08-02T21:04:39.403Z sha c0785de :: found issues before merge. :: [P1] Port base-drift handling to the active review modules
  • reviewed 2026-08-03T01:08:30.973Z sha c0785de :: needs changes before merge. :: [P1] Port base-drift handling to the active review modules

@steipete

Copy link
Copy Markdown
Contributor

Maintainer decision (relayed from @steipete): policy adopted. Behind-only branches stop being a contributor blocker; rebase/resolve guidance is reserved for conflicts, unavailable merge trees, and concrete merge-result integration failures, with the non-blocking base-freshness note at 7+ days as proposed. Please move this out of draft and rebase onto current main — the review prompt and cache have shifted since Jul 15. Happy to land it once CI is green.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 30, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 30, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 Urgent regression or broken agent/channel workflow affecting real users now. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Aug 1, 2026
@vincentkoc
vincentkoc force-pushed the investigate/rebase-main-review-rule branch from c0785de to 2f7f26c Compare August 4, 2026 01:17
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closing during maintainer cleanup: whether routine PR rebases should stop being required is a policy decision, and a draft PR is the wrong vehicle for it — the change would sit here unmergeable until someone rules, which is what has happened since June. If you want to pursue it, the fastest route is a short issue laying out the tradeoff (stale-branch review risk vs contributor friction) so the maintainers can decide; the implementation is small once the policy is settled. Thanks for the nudge on the friction — it is a real cost. 🦞

@steipete steipete closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants