Skip to content

fix(repair): refresh stale automerge verdicts - #699

Merged
hxy91819 merged 1 commit into
mainfrom
feature/automerge-verdict-source-drift
Jul 19, 2026
Merged

hxy91819 merged 1 commit into
mainfrom
feature/automerge-verdict-source-drift

Conversation

@hxy91819

Copy link
Copy Markdown
Member

Summary

  • bind completed-review reuse to the verdict source revision as well as the exact PR head
  • double-read source comments so coordination detects comment drift during its read window
  • dispatch a fresh exact-head review for stale, malformed, or unknown source revisions while preserving truly legacy markers
  • add a deterministic real Git/fake GitHub/router E2E that reproduces the production source-drift skip and then reaches merge with a fresh verdict

Evidence

  • failing-first: the E2E against pre-fix origin/main replays the source-stale verdict and fails a source-stale exact-head verdict must not be replayed
  • focused unit tests: 130 passed
  • pnpm run check
  • local autoreview: 0 findings
  • staged gitleaks: 0 leaks
  • local-container E2E: tiny and openclaw-shaped fixtures both passed and merged

Production context

The completed-verdict replay for openclaw/openclaw#108974 was skipped because its trusted verdict source revision no longer matched the current source revision, even though the exact head was unchanged. This keeps the execution-side source guard intact and prevents coordination from selecting an unusable verdict.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@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 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 6:07 AM ET / 10:07 UTC.

Summary
The branch binds completed exact-head automerge verdict reuse to a matching source revision, retries on source/comment drift, and adds unit plus deterministic automerge E2E coverage.

Reproducibility: yes. from source and the supplied deterministic E2E path: a completed verdict for the same head with a differing source revision was previously eligible for reuse. The PR adds a fixture that exercises this path, although this review did not execute it in the read-only environment.

Review metrics: 2 noteworthy metrics.

  • Patch scope: 6 files affected; 167 additions, 9 deletions. The change stays within repair-router coordination and its focused tests/E2E fixture rather than broadening into unrelated workflow or dependency changes.
  • Coverage additions: 2 unit test files and 1 automerge E2E scenario changed. The new stale-source path is covered at both decision and router-flow levels.

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:

  • Confirm the in-progress production automerge flow check exercises stable-source reuse as well as the new stale-source refresh path.

Risk before merge

  • [P1] This changes the coordination boundary that prevents duplicate or unusable automerge reviews; before merge, the in-progress production automerge-flow check should confirm that fresh dispatch and completed-verdict reuse still converge correctly under live workflow timing.

Maintainer options:

  1. Confirm end-to-end automerge convergence (recommended)
    Let the production automerge-flow check complete and confirm that a stale verdict is refreshed without causing repeated dispatches for a stable source revision.
  2. Accept the coordination behavior
    Merge after maintainer review if the remaining check evidence is sufficient to accept the bounded risk of altered review-dispatch timing.

Next step before merge

  • No discrete repair remains from this review; normal maintainer review and the in-progress production automation checks are the appropriate next step.

Security
Cleared: The supplied diff changes TypeScript repair coordination and tests only; it does not add dependencies, workflow permissions, package lifecycle behavior, secret handling, or third-party execution paths.

Review details

Best possible solution:

Land the narrow source-revision guard if the production automerge-flow validation confirms that valid current-source verdicts are reused and stale-source verdicts trigger one fresh exact-head review.

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

Yes, from source and the supplied deterministic E2E path: a completed verdict for the same head with a differing source revision was previously eligible for reuse. The PR adds a fixture that exercises this path, although this review did not execute it in the read-only environment.

Is this the best way to solve the issue?

Yes. Comparing the completed verdict’s durable source revision with the current stable source snapshot is a narrow way to preserve valid reuse while rejecting stale or malformed verdicts without adding user-facing configuration.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a bounded repair to automerge review coordination that can block or delay normal repository automation, without evidence of an emergency user-facing outage.
  • add merge-risk: 🚨 automation: The patch changes when ClawSweeper reuses or dispatches automerge reviews, so workflow convergence remains a merge-relevant behavior to validate beyond static review.
  • 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: The PR author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the body nevertheless provides specific local E2E and check results for maintainer verification.

Label justifications:

  • P2: This is a bounded repair to automerge review coordination that can block or delay normal repository automation, without evidence of an emergency user-facing outage.
  • merge-risk: 🚨 automation: The patch changes when ClawSweeper reuses or dispatches automerge reviews, so workflow convergence remains a merge-relevant behavior to validate beyond static review.
  • 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: The PR author is a repository MEMBER, so the external-contributor real-behavior-proof gate does not apply; the body nevertheless provides specific local E2E and check results for maintainer verification.
Evidence reviewed

What I checked:

  • Focused coordination change: The coordination decision now retries when the source revision changes during its read window and dispatches a fresh review when a completed verdict has a malformed or stale source revision, while retaining the legacy path for truly absent revisions. (src/repair/review-dispatch-coordination.ts:39, 75f50b2d8f6e)
  • Router captures a stable read window: The router reads comments before and after the PR refresh, derives source revisions for both snapshots, and passes the completed verdict source revision into coordination rather than reusing only by head SHA. (src/repair/comment-router.ts:3000, 75f50b2d8f6e)
  • Regression coverage: The branch adds coordination tests for stale, malformed, and drifting source revisions, plus a deterministic automerge E2E scenario that asserts a source-stale exact-head verdict is not replayed and a fresh verdict can proceed. (test/e2e/automerge/run.mjs:316, 75f50b2d8f6e)
  • Contributor-provided runtime context: The PR body ties the change to a production replay skip involving fix(gmail): prevent duplicate watch renewals during stalls openclaw#108974 and reports focused tests, a real-Git/fake-GitHub E2E, and pnpm run check; the supplied context shows the relevant CI workflows are still running. (75f50b2d8f6e)

Likely related people:

  • hxy91819: Authored the current focused repair commit affecting automerge review dispatch coordination; broader current-main ownership could not be established from the supplied review material. (role: current repair-area contributor; confidence: low; commits: 75f50b2d8f6e; files: src/repair/comment-router.ts, src/repair/review-dispatch-coordination.ts, test/e2e/automerge/run.mjs)
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.

@hxy91819
hxy91819 merged commit 0cbbd95 into main Jul 19, 2026
16 of 17 checks passed
@hxy91819
hxy91819 deleted the feature/automerge-verdict-source-drift branch July 19, 2026 10:17
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Bind completed verdict reuse to stable source snapshots so stale or unverifiable verdicts dispatch a fresh exact-head review.
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. P2 Normal priority bug or improvement with limited blast radius. 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.

1 participant