Repository navigation
fix(review): unchanged items are re-reviewed and re-rated every scheduled pass - #1753
Conversation
…uled pass The hosted exact-review step reads the item's prior canonical record from records/<slug>/items, but the event-review-apply job hydrated that record only after generation, for publication. Every scheduled pass therefore ran without a prior review: the structural cache stopped at missing_review, the content cache had no verdict to reuse, and Codex reviewed and re-rated unchanged items again. Hydrate only the selected item's record (no git state, no blobs) immediately before generation, with the same condition as the review step. Hydration failure keeps today's full-review fallback. The setup-state site inventory and the finalization-order test now name the post-review hydration explicitly. Docs: describe the prior-record dependency in docs/review-cache.md and replace the stale cadence paragraph in docs/scheduler.md, which still described the sync-marker exemption removed from the planner. Related: openclaw#1752
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR loads the selected item's canonical review record before hosted review generation so existing caches can reuse unchanged verdicts. Example: A scheduled pass revisits openclaw/clawhub issue 3921 with unchanged review inputs.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: current main still generates reviews without the saved record needed for cache reuse, and this PR provides a focused repair. No introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe hosted exact-review workflow supplies canonical Worker records and current GitHub evidence to the review CLI, which produces a report for subsequent publication. flowchart TD
A[Exact review queue] --> B[Claim and reserve lease]
B --> C[Hydrate selected canonical record]
C --> D[Review CLI and cache checks]
D --> E[Reuse verdict or run model]
E --> F[Finalize and publish report]
Technical reviewBest possible solution: Load the selected canonical record before generation while retaining existing cache validation, bounded hydration and full-review fallback. Do we have a high-confidence way to reproduce the issue? Yes at source level: main loads the canonical record after generation, while the review reads that record before cache probing and rejects its absence; no reproduction was executed during this read-only review. Is this the best way to solve the issue? The existing item-scoped hydrator is the appropriate owner for this prerequisite, and the patch restores the established cache contract without changing scheduler policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 530643f35556. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 11, 2026, 7:42 PM ET / 23:42 UTC (Revision 3). |
|
On the remaining proof item: hydrating an actual canonical record is not possible from outside the project.
That leaves two ways to close the item:
|
|
Merging on owner approval (@obviyus) with the current proof: the real hydrator and review command with a stub Worker, plus merged-main checks (5,817 tests, 0 failures). The real-record proof needs the Worker secret, so we confirm in production instead: after this lands, scheduled re-reviews of unchanged items should report |
Related: #1752
What Problem This Solves
Fixes: unchanged issues and PRs are fully re-reviewed by Codex on every scheduled pass, and their rating and reproduction labels change between passes, when the hosted exact-review job reviews them.
User Impact
User impact: scheduled passes on unchanged items reuse the previous verdict again instead of running a new model review, so ratings and reproduction labels stay stable for identical evidence. Items with new reporter or maintainer activity are still reviewed again. The hourly cadence and the per-pass review lease comment are unchanged.
Why This Change Was Made
The review step reads the item's prior canonical record from
records/<slug>/items/<number>.md. Inevent-review-apply, that record was hydrated only after generation, for publication. Every scheduled pass therefore started without a prior review, so the structural cache stopped atmissing_reviewand the content cache had no verdict to compare.This change hydrates only the selected item's record immediately before generation, with the review step's condition, no git state, and no blobs. The step is bounded to five minutes, so a stalled Worker cannot hold the review lease before generation starts. If hydration fails or times out, the step continues and the review falls back to today's full review.
The hourly cadence is not changed by this PR. Since #1007,
hasActivitySinceReview(src/scheduler-policy.ts:85) treats any update afterreviewed_at, including ClawSweeper's own comment, label, and lease writes, as activity and leaves suppression to the structural cache. Every pass still posts and deletes a lease comment, so followers still get a notification per pass. This PR only makes the cache able to reuse the verdict again.OpenClaw Bay Impact
No Bay change. The change only adds a read of one canonical record before generation; queue, lifecycle, publication, and dashboard data contracts are unchanged. Fewer model reviews and fewer label changes are expected in the observed activity.
Documentation Impact
docs/review-cache.md(active): new "Prior Record" section describing the dependency and the fallback.docs/scheduler.md(active): the "Review cadence" paragraph still described the sync-marker exemption thathasActivitySinceReviewno longer applies; replaced with the current rule and a pointer to the review cache.changelog.d/exact-review-prior-record.md: one-line fragment.Evidence
Root cause in hosted runs (public logs):
structural_cache_checks=1 structural_cache_hits=0 structural_cache_revalidations=0 content_cache_hits=0 hydrations=1, and the record was hydrated afterwards at 09:53:15 (focused tuples hydrated repo=openclaw-clawhub items=1 records=1).structural_cache_hits=0 structural_cache_revalidations=0 content_cache_hits=0 hydrations=1.source_revisionmarker is identical in 11 of them, and the reviewed target commit did not change.Tests:
test/review-reliability-workflow.test.tscase requires the prior-record hydration before generation (item-scoped, no git state or blobs, same condition as the review,continue-on-error,timeout-minutes≤ 5, Worker secret absent from the review step env). It fails onmainwiththe exact review must hydrate its prior record before generationand passes with this change. The existing "enters finalization before state hydration" case now targets the post-reviewdirect-setup-statestep by id, so its ordering guarantee for the full hydration is unchanged.test/review-structural-cache.test.tscase uses the real 3921 timestamps: without a recordmissing_review; the lease release alone isactivity_changed; the next pass's reservation yieldshit; a human comment after the pass yieldssource_changed.pnpm run check: static checks, build, lint, and changed coverage pass; 7,215 tests with 1 failure,test/repair/process-env.test.ts"Codex subprocess prevents pnpm deploy from installing target Git hooks", which fails the same way on an unchangedmaincheckout in the same environment (git 2.43.0). After adding the step timeout:check:static,lint,build, and the four affected test files (review-reliability-workflow,state-writer-workflow,review-structural-cache,sweep-workflow: 208 tests) pass.codex review --uncommittedbefore the commit andcodex review --base mainon the final commit: no actionable findings.Real Behavior Proof
clawsweeper reviewcommand with the hosted step's arguments (minus lease and sandbox flags), and the realscripts/hydrate-state.ts --skip-git-state --skip-state-blobs --records-item-number <n>.c23e34ad; GitHub reads through a shim that blocks every non-read call (0 blocked calls); the Worker is a local stub serving the record; the Codex model and the secret scanner are stubs (codex sandboxcheckout preflight runs for real).content_cache_hits=0; after:cache-hit content-unchanged skip-model, 0 model calls.Maintainer update (2026-10-12)
Merged current main into the contributor branch without rewriting contributor commits. The only conflict was the retired state-hydration test inventories; current main's per-site contract checks are retained. No overlap with Pash/Sarah changes.
Fresh main evidence, all at
530643f35556723ef86555ecf0c0bfd0010f601d:These traces confirm that main still hydrates after generation. They do not alone prove that all input fields were unchanged between passes. The original unchanged-item evidence and its limits remain above.
Canonical-record proof remains blocked on project access. The current public state repository has no records directory, the current public API exposes aggregates rather than canonical records, and the sampled 1770 run has no downloadable artifacts. The hydrator uses authenticated
GET /internal/state/records/{slug}/{section}/{id}and validates the returned content digest. No production credential or production workflow was used for this update.The cheapest next proof is a maintainer-provided export of one real canonical item record, with its revision and digest, consumed by the shipped review command in a read-only Crabbox run. Alternatively, authorize a maintainer to perform one item-scoped Worker hydration and the same read-only review. A proof override is a separate maintainer decision, not claimed here.
OpenClaw Bay is not affected: no public API, queue, lifecycle, publication, or dashboard contract changes. This is a two-way door: reverting removes the early read without a schema migration or stored-data conversion. The blast radius is exact-review cache eligibility and full-review fallback; lease notifications and scheduler cadence are unchanged.