Skip to content

fix(review): unchanged issues are fully re-reviewed and re-labeled on every target-branch commit - #2039

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
holgergruenhagen:fix/issue-review-reuse-across-target-commits
Oct 18, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
holgergruenhagen:fix/issue-review-reuse-across-target-commits

Conversation

@holgergruenhagen

@holgergruenhagen holgergruenhagen commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1753

What Problem This Solves

Fixes: an issue with no new activity is fully re-reviewed by Codex, and its rating and reproduction labels change again, on the first scheduled pass after each new commit on the target repository's main branch.

User Impact

User impact: on busy target repositories, an untouched issue gets at most one full review per day from target-branch movement alone, instead of one per commit. Followers see fewer label changes without new evidence. Any change to the issue itself, its relations, comments or the latest release still triggers a full review. The hourly cadence and the per-pass review lease comment are unchanged.

Why This Change Was Made

Issue content digests include the target branch head (targetMainSha in itemContentDigest, src/clawsweeper-source-revision.ts:222). Since #1753 the hosted exact review finds its prior record, so scheduled passes on an unchanged issue reuse the verdict, but only while main has not moved. Every issue whose own comment edits keep it in the hourly activity bucket (src/scheduler-policy.ts:128) therefore gets a full model review on the first pass after each commit on main. ClawHub main moves several times a day.

When the content digest misses, this change digests the current issue content again against the target SHA recorded by the prior full review (main_sha). If that matches, only the target branch moved, and the keep-open verdict is reused for up to one day after the last full review (ISSUE_TARGET_DRIFT_REUSE_MS, src/scheduler-policy.ts:166). The carried report keeps the reviewed SHA, digest, last_full_review_at and the prior structural anchor. The window therefore does not slide, and the 14-day structural stage cannot extend it. The published review still names the commit it was reviewed against. PRs, explicit reviews and maintainer requests are unchanged.

Maintainer decision (2026-10-18 UTC): @vincentkoc approved the existing one-day target-only drift reuse bound, including the possible delay in detecting an unlinked main-only fix. Keep all existing invalidation rules, the original full-review timestamp and reviewed-target provenance. This resolves the owner-policy decision in the current ClawSweeper review.

Not in this PR: each pass still posts a fresh lease comment before the cache decision (src/clawsweeper-review-comment-leases.ts:259, needed for the lowest-comment-id election), which sends followers an email per pass even on a cache hit.

Documentation Impact

  • docs/review-cache.md (active): "Content Stage" now describes the target-drift reuse, its one-day bound and that the carried report keeps the reviewed SHA and structural anchor.
  • docs/scheduler.md: unchanged; cadence is not affected.
  • changelog.d/issue-target-drift-review-reuse.md: one-line fragment.

Evidence

Live problem, openclaw/clawhub#3921 (no human activity on the issue since 2026-10-06; durable comment openclaw/clawhub#3921 (comment) , 88 revisions 2026-10-06 to 10-15). Hosted runs on 2026-10-15 (UTC), counters from the public job logs:

Revision Run Reviewed against Cache Label changes
01:04 https://github.com/openclaw/clawsweeper/actions/runs/38663282316 6a58bbfafae4 (new) content_cache_hits=0 + needs-live-repro, 🦞 → 🐚, − source-repro
02:41, 04:37 38672205566, 38682315250 same content_cache_hits=1 —
05:37 https://github.com/openclaw/clawsweeper/actions/runs/38687437723 314a46360c68 (new) content_cache_hits=0 − needs-live-repro, 🐚 → 🦪
06:53 https://github.com/openclaw/clawsweeper/actions/runs/38694693292 4c78f5b0058f (new) content_cache_hits=0 + not-repro-on-main
08:44 https://github.com/openclaw/clawsweeper/actions/runs/38707437653 24f4d4218b22 (new) content_cache_hits=0 − not-repro-on-main
10:35, 12:46, 14:35 38721150131, 38736976772, 38752547002 same content_cache_hits=1 —

Every miss is the first pass on a new main commit; every pass on an unchanged commit hits. Replaying all 29 revisions since #1753 was merged (2026-10-11 23:46) with the one-day rule: 7 full reviews become 3; on 2026-10-15, 4 become 1 (06:53). This replay assumes a changed "reviewed against" SHA means a full review, which the counters above confirm for 2026-10-15.

Tests (Node 24, node --test --test-concurrency=1 <file> after pnpm run build; wall time):

  • test/review-command-workflow.test.ts drives the real reviewCommand with the existing scheduled-cache harness. New content-target-drift uses the real itemContentDigest, a prior record reviewed against another target SHA and a 1-minute-old full review: content cache hit, no generation, the carried report keeps main_sha and review_structural_target_head_sha of the reviewed commit. New content-target-drift-expired (25 h old): full review. Without the fix, content-target-drift fails ("compatible unchanged input must use the cache"). Without the structural-anchor part, it fails on review_structural_target_head_sha. File: 61/62 pass, 72 s; the one failure, changed-pr-exact-fetch-failure, times out after 60 s the same way on unchanged main here (git 2.43.0).
  • test/review-content-cache.test.ts: new case with real digests (hit 1 ms before one day, miss at one day, miss when the issue also changed, miss without a drift digest, miss on explicit dispatch); 43/43, 0.9 s. Fails without the fix.
  • Other files using the changed code: scheduler-policy 24/24 (0.3 s), apply-live-state 38/38 (36 s), oversized-pr-admission 15/15, pr-proof-automation 34/34, primary-body 20/20, review-output-policy 30/30, review-preparation 11/11.
  • pnpm run check:static, build:all, lint: pass.
  • node scripts/run-node-tests.mjs unit (17 min, concurrency 4, under load): 4,908 tests, 4,889 pass, 9 fail, 10 skipped. All 9 are Git fetch/acquisition or process-supervision cases that time out after 30–60 s here (review-blob-hydration ×3, review-git-acquisition ×3, command "selects PATH Codex", pr-review-history "history prefetch", review-command-workflow changed-pr-exact-fetch-failure); none touches the changed code, and all 9 fail the same way on unchanged main in this environment (git 2.43.0). node scripts/run-node-tests.mjs repair (89 s): 896 tests, 888 pass, 2 fail (command-runner TERM-resistant reaping, target-fanout storage unavailable), both also failing on unchanged main here.
  • codex review --base origin/main: the first pass found that a drift carry could seed a structural record with the new target and let the 14-day structural stage outlive the one-day window; fixed (prior structural anchor kept) and covered by the harness test above. Second pass on the final commit: no actionable findings.

Maintainer Qualification

  • Policy decision approved by @vincentkoc on 2026-10-18 UTC: accept the existing 24-hour reuse window and its possible delay for unlinked main-only fixes. Issue-content changes, related-item changes, releases, explicit reviews and maintainer requests retain their existing invalidation rules.
  • Source remains at d4ba87441c365582c8ca1856e2aaf9d6aa156098; no contributor code was changed. The two touched production modules have no intervening changes on current main 385ed215fa2cfd04e53ab11d6cf814b8a3226b85 beyond this patch.
  • Fresh independent Codex review against the PR base: no actionable P0–P2 findings. Exact-head CI run https://github.com/openclaw/clawsweeper/actions/runs/38837144573 passed all test shards, coverage and the aggregate pnpm check gate.
  • Production change: +31 net lines, confined to the existing cache owner and its caller. This adds bounded issue-only reuse without a second cache or configuration surface.
  • OpenClaw Bay and dashboard contracts are unaffected: no observer fields, routes or controls change. Existing cache-hit counters report reuse.
  • Fresh AWS Crabbox validation on the unchanged head: Node 24.19.0, pnpm 12.4.1, pnpm run check:fast passed; node --test --test-concurrency=1 test/review-content-cache.test.ts test/review-command-workflow.test.ts test/scheduler-policy.test.ts passed 129/129 with no failures or skips. Lease cbx_e08cb2ce135e, run run_b88d80b277b60bb0ac7ebfad6b825285. This reruns regression tests; the original executed review-CLI proof below remains the real-behavior evidence for the unchanged patch.

Real Behavior Proof

  • Claim: for an issue whose content is unchanged and whose target branch moved since the last full review, the real review command reuses the verdict without a model run within one day and runs the model after one day or when the issue changed.
  • Surface: the real clawsweeper review command with the hosted scheduled step's arguments (minus lease and sandbox flags), prior record at records/openclaw-clawhub/items/3921.md (where the pre-generation hydration from fix(review): unchanged items are re-reviewed and re-rated every scheduled pass #1753 places it).
  • Scenario: live Official steipete/peekaboo skill teaches Peekaboo 3 commands removed in 4.0 and shadows the newer bundled skill when installed clawhub#3921 ; prior record from a review against clawhub 6a58bbfafae4; target main then set to 24f4d4218b22 (current clawhub main).
  • Environment: local Linux, Node 24, blobless clone of openclaw/clawhub whose origin is a local bare repository (objects via alternates, tags mirrored) so the target head can be set per run; GitHub reads through a shim that blocks every non-read call (0 blocked calls); Codex model and secret scanner are stubs (the codex sandbox checkout preflight runs for real); publication-owned record fields reconstructed from the live durable comment.
  • Result (2026-10-15 UTC):
Run (start) Build Target Prior full review Result
16:45:44 main ced5921da1 same 1 h cache hit, 0 model calls
16:45:54 this branch same 1 h cache hit, 0 model calls
16:46:03 main ced5921da1 new 1 h miss, 1 model call
16:46:12 this branch new 1 h cache-hit content-unchanged skip-model, 0 model calls; report keeps main_sha: 6a58bbfa… and last_full_review_at
16:46:23 this branch new the 16:46:12 carried report cache hit, 0 model calls; reviewed SHA and last_full_review_at unchanged, so the window does not slide
16:46:33 this branch new 25 h miss, 1 model call
16:46:50 this branch new 1 h, different content digest miss, 1 model call
  • Limits: the GitHub Actions job, lease and publication were not run; the scanner, Codex model and Worker were stubbed as in the proof for fix(review): unchanged items are re-reviewed and re-rated every scheduled pass #1753; runs were minutes apart. Without a lease the local structural stage is coordination_disabled and the prior record has no structural anchor, so keeping the anchor is covered by the harness test only. The live effect on 3921 can only be observed after merge.

… every target-branch commit

Issue content digests include the target branch head, so on busy target repositories every new commit on main turned the hourly activity pass of an untouched issue into a full Codex review with fresh labels. When only the target branch moved since the last full review, reuse the keep-open verdict for up to one day; any change to the issue, its relations or the latest release still misses.
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Reuse unchanged keep-open issue verdicts across target-branch changes for one day after their last full review.

Example: An unchanged issue was fully reviewed one hour ago against target commit 6a58bbfafae4, and target main advances to 24f4d4218b22.

  • Before: The scheduled pass runs another model review because the target SHA changes the content digest.
  • After: The scheduled pass carries the verdict while retaining its original reviewed SHA and full-review timestamp; reuse expires after 24 hours.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, approved change with sufficient shipped-command proof, meaningful regression coverage, successful exact-head checks and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied Linux/Node 24 shipped review-CLI output exercises the changed cache owner with target-only drift, repeated carry without timestamp advancement, expiry and changed-content fallback; scanner, model and Worker are stubbed, hosted publication is outside the demonstrated scope, and structural-anchor retention has separate workflow regression coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Untouched issues repeatedly receive new model reviews and changing labels whenever a busy target branch advances.
Reason: The maintainer explicitly approved the one-day freshness tradeoff, and the implementation reduces repeated inference while retaining reviewed-target provenance and existing invalidation rules.

Merge readiness

✅ Ready for maintainer review

This PR remains useful and has no actionable findings; the maintainer-approved 24-hour bound resolves the previous review’s product-policy blocker.

Priority: P2
Reviewed head: d4ba87441c365582c8ca1856e2aaf9d6aa156098

Before merge

None.

Findings

None.

Agent review details

How this fits together

The review workflow compares current GitHub context and target state with a prior canonical report, then emits either a carried keep-open report or a fresh model decision for publication.

flowchart TD
  A[Scheduled issue review] --> B[Load canonical report]
  B --> C[Collect current context]
  C --> D[Compare content and target drift]
  D --> E[Carry bounded verdict]
  D --> F[Run model review]
  E --> G[Publish report]
  F --> G
Loading

Technical review

Best possible solution:

Land the approved bounded reuse through the existing cache owner while preserving original review provenance and all existing invalidation safeguards.

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

Current-main source shows that target-main movement changes issue digests and defeats reuse; supplied before/after CLI output exercises that path, while this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is a focused implementation of the approved tradeoff using existing digest and cache owners, with no parallel cache or configuration surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 385ed215fa2c.

Provenance checked

  • Issue target-main invalidation changes intended behavior with a stated reason (perf(review): reuse prior verdict when reviewable content is unchanged #410: Include target main because a main-only fix can change an issue verdict without discussion activity.)
  • Content-carry structural anchor keeps the original intent (445d823: The extracted workflow carries verified structural input provenance; this PR retains the reviewed target’s anchor when carrying a verdict across target drift.)
  • Keep-open-only reuse and changed PR content keeps the original intent (refactor(review): let Codex judge changed PR content #1328: Retain structural and exact-content reuse while leaving changed PR content to model review instead of semantic equivalence heuristics.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 56a9443 adds docs/review-cache.md:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 56a94433f14d; files: docs/review-cache.md)
  • Yuval Dinodia: Raw commit cc87bcb adds src/scheduler-policy.ts:146 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cc87bcb5d294; files: src/scheduler-policy.ts)
  • Peter Steinberger: Raw commit ba95477 adds docs/review-cache.md:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ba954778d8bb; files: docs/review-cache.md)
  • Holger Gruenhagen: Raw commit 69e22d8 adds docs/review-cache.md:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 69e22d843857; files: docs/review-cache.md)

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Repeated reviews consume model capacity and churn public issue labels; the approved change limits reuse to a bounded period.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-16T02:02:57.410Z sha d4ba874 :: blocked before merge. :: none

Reviewed October 18, 2026, 12:15 PM ET / 16:15 UTC (Revision 2).

@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

The main PR body now records maintainer approval of the 24-hour target-only drift policy and fresh qualification of unchanged head d4ba87441c365582c8ca1856e2aaf9d6aa156098: 129/129 focused tests, check:fast and independent Codex review passed. Please verify the current head and updated body.

@vincentkoc
vincentkoc requested a review from obviyus October 18, 2026 16:11
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 18, 2026
@vincentkoc
vincentkoc merged commit ac1ad31 into openclaw:main Oct 18, 2026
50 checks passed
obviyus pushed a commit that referenced this pull request Nov 5, 2026
…mment (#2086)

* fix(review): keep background re-review start status in the durable comment

Since #2039, unchanged items are re-reviewed on every target-branch commit.
Each run posted a new temporary "ClawSweeper status: review started" comment,
and GitHub notifies every subscriber of a new comment, so busy target
repositories sent a notification per commit even when the review did not
change (openclaw/Peekaboo#1114).

Queue-owned background re-reviews of an already-reviewed item now carry the
started lease by editing the durable review comment, preserving the prior
review text and restoring it byte-for-byte on owned cleanup. First reviews,
explicit requests, commands and uncoordinated callers keep the separate
placeholder, legacy placeholders stay recoverable, and sweep failure cleanup
also expires in-place leases discovered by owner.

* fix(review): keep in-place background leases safe for apply and contenders

Address ClawSweeper review findings on the in-place background lease:
- keep the adopted apply mutation lock through completed-review publication
  and the following mutation guards;
- let separate POST leases outrank in-place leases and fence the loser, so an
  older durable comment id cannot retroactively win the election;
- read the durable comment losslessly before acquisition, cleanup and CLI
  release so escapes and controls survive the round trip;
- fall back to the separate placeholder when the review plus status and lease
  would exceed the 61,440-byte durable review limit.

Adds an integrated loopback proof covering both contender orders, publication
through the close guard, lossless cleanup and a legacy-state upgrade.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. 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.

2 participants