Skip to content

fix: restore same-head PR review label sync - #399

Closed
clawsweeper[bot] wants to merge 1 commit into
mainfrom
clawsweeper/issue-openclaw-clawsweeper-394
Closed

clawsweeper[bot] wants to merge 1 commit into
mainfrom
clawsweeper/issue-openclaw-clawsweeper-394

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restore review-derived PR labels for complete reports whose pull_head_sha still matches the live PR head, even when ClawSweeper automation has advanced item.updatedAt or the durable review comment is older than the recency window.
  • Preserve the stale-head strip path from fix: prevent stale PR review labels from persisting #388 when the stored report head differs from the live PR head.
  • Add focused regression coverage for stale-strip followed by fresh same-head re-review, including proof/rating/status/merge-risk labels and durable comment refresh.

Fixes #394

Validation

  • pnpm check:changed

Notes

Reported by @yetval in #394. This does not require a CHANGELOG.md edit.

@clawsweeper clawsweeper Bot added clawsweeper Tracked by ClawSweeper automation clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge labels Jul 3, 2026
@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: passed. Reviewed July 3, 2026, 7:35 PM ET / 23:35 UTC.

Summary
The branch changes apply-decisions PR label freshness logic and adds apply-label-sync regression tests for fresh same-head re-review and later human activity.

Reproducibility: yes. The linked issue provides a live timeline, and current main source shows same-head complete PR label sync can be skipped when the freshness gate fails after bot activity.

Review metrics: 2 noteworthy metrics.

  • Files changed: 2 files affected. The PR stays scoped to the apply implementation and the narrow matching test file.
  • Regression cases: 2 tests added. One test covers same-head label restoration and one preserves the human-activity safety guard.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #394
Summary: This PR is the candidate fix for the canonical regression report; #388 is related history that introduced the stale-head strip and freshness gate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] This changes live GitHub label/comment automation in apply-decisions; a mistake could restore or suppress PR readiness labels incorrectly even if unit checks pass.
  • [P1] This read-only review did not execute pnpm check:changed; required CI should remain the validation gate before merge.

Maintainer options:

  1. Merge after required checks (recommended)
    Maintainers can accept the bounded automation risk once CI confirms the focused apply-label-sync regression tests.
  2. Request staged apply proof
    If maintainers want stronger confidence, ask for a mock-gh staged apply transcript that shows the restored labels and comment refresh together.

Next step before merge

  • [P2] No repair lane is needed because there are no concrete blocking findings; maintainers should proceed through normal review and CI gating.

Security
Cleared: Cleared: the diff does not change dependencies, secrets, permissions, or external code execution, and stays within existing GitHub label/comment sync code.

Review details

Best possible solution:

Land the narrow apply-path fix after required checks pass, keeping stale-head stripping and the no-human-activity guard intact.

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

Yes. The linked issue provides a live timeline, and current main source shows same-head complete PR label sync can be skipped when the freshness gate fails after bot activity.

Is this the best way to solve the issue?

Yes. The patch uses report/live head-SHA equality plus the existing non-automation activity check, which is the narrowest maintainable fix while preserving stale-head stripping.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The PR fixes a live ClawSweeper automation regression that can leave reviewed PRs without readiness labels after stale-strip and re-review.
  • add merge-risk: 🚨 automation: The diff changes apply-decisions behavior that mutates GitHub labels and durable review comments.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a ClawSweeper-generated autofix PR, so the external contributor real-behavior proof gate does not apply; the body reports pnpm check:changed.

Label justifications:

  • P1: The PR fixes a live ClawSweeper automation regression that can leave reviewed PRs without readiness labels after stale-strip and re-review.
  • merge-risk: 🚨 automation: The diff changes apply-decisions behavior that mutates GitHub labels and durable review comments.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a ClawSweeper-generated autofix PR, so the external contributor real-behavior proof gate does not apply; the body reports pnpm check:changed.
Evidence reviewed

What I checked:

Likely related people:

  • momothemage: Git blame and git log -S labelSyncFreshEnough tie the freshness gate and stale-head label strip behavior to the merged stale-label fix in fix: prevent stale PR review labels from persisting #388. (role: introduced stale-head freshness gate; confidence: high; commits: b1e238da6eed; files: src/clawsweeper.ts, test/apply-label-sync.test.ts)
  • RomneyDa: Git blame and PR metadata tie the surrounding PR label-sync and apply-label-sync test structure to earlier split policy and apply test work. (role: adjacent label-sync contributor; confidence: medium; commits: a811372b8fd0, e73fecd30a70; files: src/clawsweeper.ts, test/apply-label-sync.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

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.

@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. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 3, 2026
@yetval

yetval commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Update: the close-proposal guard from this PR is now folded into #396 (head 4c41d09), inside the existing labelSyncFreshEnough gate so both call sites keep a single decision point, with a RED-verified regression for the new branch and a close-proposal leg added to the real before/after runtime proof in the #396 body. #396 is now a strict superset of this change, so merging it subsumes this PR.

@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #396, merged in 279d3bd60f3b0460c6df3b3667e2d815c4443a36.

Current main contains the same-head label restoration plus the stronger close-proposal guard that this branch does not include. Its focused coverage proves all three relevant paths: bot-only timestamp churn restores labels, later human activity blocks restoration, and close proposals do not regain advisory labels.

Thanks for generating and validating the initial repair; #396 is the strict superset and is already green on main.

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

Labels

clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper Tracked by ClawSweeper automation 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: 🐚 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review labels are not restored after stale-strip and re-review: PR #388 gates fresh-head label sync behind comment-recency freshness

2 participants