Repository navigation
fix(publication): stop retrying reviews superseded by newer results - #1249
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 9:39 PM ET / August 31, 2026, 01:39 UTC. ClawSweeper reviewWhat this changesThis PR marks an exact-review publication as superseded only when apply verifies a strictly newer durable review tuple for the same revision, avoiding retries of an obsolete artifact. Merge readinessKeep open for maintainer review: current main does not contain this introduced terminal-publication behavior, and this MEMBER-authored PR has a focused, fail-closed implementation with no actionable correctness finding. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s apply lane compares a queued review artifact with the durable GitHub review comment before publishing it. The repair publisher then turns the verified apply result into a queue completion, retry, or failure outcome. flowchart LR
A[Exact review artifact] --> B[Apply review guard]
B --> C[Durable review comment]
C --> D{Verified newer tuple?}
D -->|yes| E[Superseded completion]
D -->|no| F[Existing retry or apply path]
E --> G[Queue lifecycle completion]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the structured durable-tuple signal while retaining the existing retry or failure path for every tuple that is equal, incomplete, unsafe, mixed, or otherwise unproven. Do we have a high-confidence way to reproduce the issue? Yes: the current focused regression defines a same-revision artifact with lease 9100 and a durable review with lease 9200, then carries the real apply result into the built publisher. I did not execute it because this review is read-only. Is this the best way to solve the issue? Yes: carrying an explicit verification result avoids using diagnostic reason text as terminal authority, while the verifier preserves retries for every ambiguous tuple shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9f343df8bfd7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Refresh against main, retain structured tuple evidence, reject unsafe or mixed results, and replace the fake apply CLI fixture with producer-to-publisher regression coverage. Co-authored-by: Vincent Koc <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review The PR body now records current-head AWS Crabbox proof through the real compiled apply and publisher commands, before/after behavior, invalid controls, zero attempted GitHub mutations, full check results, and the prior finding disposition. Please review the current head and body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Landed as c377cfc. The merged tree is identical to the reviewed candidate, and Vincent's authorship is preserved. The overlapping proposal #1250 is closed as superseded. The controlled real-command replay passed again on merged The full check passed with 4,145 passing tests and 8 skipped. Current-head CI passed at https://github.com/openclaw/clawsweeper/actions/runs/33348039463, and the fresh hosted review and its publication passed at https://github.com/openclaw/clawsweeper/actions/runs/33348117326. The review found no actionable defects; the terminal-outcome risk is covered by the complete-tuple guard and negative-case matrix. The naturally scheduled merged-main batch https://github.com/openclaw/clawsweeper/actions/runs/33348684758 exercised the new terminal path on openclaw/clawhub#3543 and openclaw/clawhub#3554. Both logged A separate pre-merge publication failure, https://github.com/openclaw/clawsweeper/actions/runs/33348262322, returned The other observed merged-main batch, https://github.com/openclaw/clawsweeper/actions/runs/33348522578, completed with a successful workflow conclusion and |
An exact-review artifact can be obsolete even when its source revision has not changed: a newer review lease has already published the authoritative durable comment. Apply correctly refuses to overwrite it, but the publisher treats that refusal as an unapplied failure, wasting confirmation retries and potentially dead-lettering work that should simply finish.
This change carries a structured
newerReviewTupleVerifiedresult from the apply guard to the publisher. It requires a trusted durable review, non-placeholder lease owners, the same source revision, positive safe-integer lease comment IDs, and a strictly newer live lease. Exactly one verified stale result completes assuperseded/remote_newer_tuple, before mutation planning, state publication, or any fresh review.This is the structured alternative to #1250. Human-readable reason text remains diagnostic. Equal, unsafe, missing-owner, mixed, and otherwise unproven results cannot authorize terminal supersession; legacy tupleless artifacts and guarded-open behavior retain their existing paths. There is no new retry policy.
The maintainer refresh incorporates current main, adds safe-integer and mixed-result controls, and replaces the fake apply-CLI publisher test with a regression that passes the real apply result through the real publisher. Scheduler documentation now describes the existing selected-comment publication path correctly. Contributor credit is retained.
Behavior proof
Candidate head:
f88abbfbdbbf9ab4f31d89dd309e257227d18617. Baseline:9f343df8bfd7e852a7e10601a6a9ea7345af6f60.Provider: AWS Crabbox; lease
cbx_066739d7d833; imageami-0461d919be7deb53c; Nodev24.18.1, pnpm11.10.0. The fresh checkout had no instance role (IMDS credential endpoint 404), no Tailscale, and no production credentials.The controlled scenario supplies an issue artifact with lease 9100 and a trusted durable review on the same source revision with lease 9200. The compiled
dist/repair/publish-event-result.jsinvokes the realapply-artifactsandapply-decisionsCLI processes, using isolated item/closed/report/snapshot paths, selected item 74490,--skip-dashboard, and comment-only mode. Only GitHub transport is substituted; requests and attempted writes are captured.The standalone process replay used these commands in separate baseline and candidate directories:
The temporary driver derives its issue/report and GitHub transport fixture from the maintained apply CAS regression and launches the built publisher directly; it does not substitute the apply CLI. The same fixture runs against baseline and candidate, with equal-lease and unknown-owner controls. The maintained regression additionally introduces the newer comment after apply preflight, checks unsafe IDs, and drives the resulting artifact through the built publisher. Reproduce that cross-module regression with:
pnpm run build:all node --test --test-name-pattern='issue apply CAS and publisher' test/apply-label-sync.test.ts node --test test/repair/event-apply-proof.test.ts test/repair/exact-review-batch-cli.test.tsAll six process runs recorded zero GitHub mutation calls. Proof run:
run_0cbe78a7941a; artifacts:stale-publisher-before.json,stale-publisher-after.json, API call traces, publisher logs, batch JSON, and GitHub outputs. The exact candidate tree is9e896984ffded8a6aac49f927ecb325ea543af8d. The baseline used an archive of the stated main SHA; the candidate proof ran before commit and its source tree is carried unchanged into the candidate head.Proof limits: the CLI, record handling, apply guard, structured result, and publisher completion execute production code. GitHub transport is controlled and no real repository is mutated. This does not claim that every pending publication belongs to this bug class or that all legacy backlog will drain. The terminal batch-completion contract is separately covered by its existing compiled CLI regression.
Validation and review disposition
pnpm run checkpassed: 4,145 passing, 8 skipped (4,153 total tests).The prior review's request for a producer-to-publisher proof is addressed by exercising both real CLI stages, with the invalid controls preserved. The workflow's existing superseded completion and lease release remain the owners of terminal queue cleanup. Historical live-verification timeout output on the older head is superseded by this current runtime proof and checks.
OpenClaw Bay needs no change: this uses the existing
supersededterminal outcome andremote_newer_tuplereason, with no observer schema, route, or browser action changes. Bay remains observer-only.