Repository navigation
fix(review): suppress fresh exact hot-intake duplicates - #992
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:56 AM ET / 05:56 UTC. ClawSweeper reviewWhat this changesThe branch prevents scheduled hot intake from immediately selecting a pull request that already has a fresh, completed review of the exact same observable state. Merge readinessThis PR is still necessary and appears to implement the intended narrow hot-intake suppression on its current rebased head. The guard runs only for scheduled hot intake, skips only a fresh completed review whose head, source content, structural pull state, activity cursor, and safe update state still match, and leaves unknown or changed state eligible. No discrete correctness or security finding was identified; it is ready for normal maintainer review once the current required checks are terminal. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s hot-intake planner polls recently active GitHub items, ranks eligible review candidates, and hands the selected items to scheduled review workers. This patch compares a persisted completed-review snapshot with current pull-request state before the item enters hot-intake selection. flowchart LR
A[Recent GitHub pull requests] --> B[Hot-intake planner]
C[Completed review record] --> D[Exact snapshot comparison]
A --> D
D --> E{Fresh and unchanged?}
E -->|Yes| F[Omit scheduled duplicate]
E -->|No or unknown| B
B --> G[Selected review workers]
H[Explicit re-review route] --> G
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrow exact-snapshot guard after required checks are terminal, while retaining its fail-open behavior and documenting the bounded one-cycle defer window as the intended scheduling tradeoff. Do we have a high-confidence way to reproduce the issue? Yes: the built CLI scenario in the branch exercises Is this the best way to solve the issue? Yes: applying a short-lived exact-snapshot guard at the scheduled planner boundary is the narrowest maintainable solution because it preserves explicit re-review routes, normal cadence outside the freshness window, ordering, and fail-open handling of uncertain state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8fd1140e7aa9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
8f83919 to
c29ef92
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c29ef92 to
54e6e47
Compare
* fix(review): suppress fresh exact hot-intake duplicates * test(review): locate hot intake assertions with scheduler * fix(review): fence hot intake exact snapshots
Summary
Prevent the scheduled hot-intake planner from immediately starting a second review for a freshly completed exact review of the same OpenClaw PR state.
Problem
OpenClaw PR #117063 showed multiple recent ClawSweeper review-start comments despite one observed merge-related event. The hot scheduler could select a PR again immediately after an exact review because it did not confirm that the persisted review still matched the live PR head, relevant source/body state, structural pull state, and review activity.
Implementation
updated_at; unknown or changed state fails open and remains eligible.test/scheduler-policy.test.ts; retain the CLI integration scenario intest/command.test.ts.8fd1140e7aa97790513afaab43eba4dd1085f85a, preserving its planner refactor and source-revision helpers while applying the exact-snapshot guard at the current planner boundary.Validation
pnpm run build— passed.node --test --test-name-pattern "CSW-088" test/scheduler-policy.test.ts test/command.test.ts— 2 passed.pnpm run lint— passed.pnpm exec oxfmt --check src/clawsweeper.ts src/scheduler-policy.ts test/command.test.ts test/scheduler-policy.test.ts— passed.git diff --check origin/main...HEAD— passed.pnpm run format:checkreports 541 repository-wide formatter findings already present on rebased main/refactor: modularize ClawSweeper and make autofix fast and merge-safe #993; no unrelated reformat is included here.Real Behavior Proof
clawsweeper plan --hot-intakeCLI, exercised through the #117063-shaped integration fixture intest/command.test.ts.item_updated_at, source revision, structural pull-state digest, and review-activity cursor. The same controlled run then changes the body during snapshot reads, changes ordinary comment activity, and invokes the explicit item route.54e6e4786cfa90be3a51e307e49ad9488a7a3247; Docker-backed Crabbox Linuxlocal-container, imagemcr.microsoft.com/playwright:v1.60.0-noble, leasecbx_40c99cfc0573; Nodev24.15.0, Corepack pnpm11.10.0;corepack pnpm install --frozen-lockfile,corepack pnpm run build, thennode --test --test-name-pattern 'CSW-088 scheduled hot planning suppresses #117063' test/command.test.ts.CSW_088_REBASED_PROOF=PASS.cbx_40c99cfc0573, providerlocal-container, synced 645 files / 24.1 MiB; command phases install 8.262s, build 1.562s, proof 2.821s; total 19.734s.Codex Review Closeout
codex review --uncommitted— no staged, unstaged, or untracked changes after the clean rebase.codex review --base origin/main— clean: “No actionable correctness issues were identified in the diff.”Accepted Residual Risks
The maintainer accepted these bounded external-snapshot and scheduling limits for this narrow PR; no further probe, routing, capacity, or selection change is included:
These cases do not create a stale review effect, completion, or data loss; the next hot cycle remains eligible.
Links