fix(review): publish exact merge readiness state - #1059
Conversation
|
Codex review: needs changes before merge. Reviewed August 29, 2026, 3:50 PM ET / 19:50 UTC. ClawSweeper reviewWhat this changesAdds an exact-head readiness marker and hardens ClawSweeper’s durable review-comment publication, recovery ordering, and lease ownership. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the prior P2 apply-batch blocker remains on the unchanged head, and this MEMBER-authored PR is not eligible for automated cleanup. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper renders a durable GitHub review comment from a report, then its apply lane publishes that comment and continues through selected repository items. The new readiness state is consumed by review presentation and repair/automerge gating. flowchart LR
A[Review report] --> B[Readiness normalization]
B --> C[Durable comment rendering]
C --> D[GitHub publication]
D --> E[Apply decision batch]
E --> F[Later selected items]
D --> G[Blocked fallback comment]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Publish the blocked fallback, record this item as a terminal publication skip, release its lease, and continue processing later selected records. Do we have a high-confidence way to reproduce the issue? Yes, by source: make a rendered durable comment exceed 60 KiB during an apply batch with a later selected item; the verified fallback throws through the command wrapper before that item is processed. Is this the best way to solve the issue? No: the fallback must remain fail-closed for its own item, but the apply workflow should persist a terminal skip and continue the batch rather than rethrowing it. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0a46047ef6a6. LabelsLabel justifications:
EvidenceAcceptance criteria:
What 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 (30 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Punchcard-Session: amber-timber-river-t1
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
Punchcard-Session: brisk-workshop-valley-n7
81ac7ee to
85abed7
Compare
Related: openclaw/openclaw#120232
What Problem This Solves
Resolves a problem where a durable ClawSweeper review could expose contradictory
merge guidance: visible risks, findings, proof gaps, or required actions remained
in the review body while machine-readable automation state reported the exact
head as ready.
Publication recovery could also leave an older ready verdict authoritative after
a fail-closed fallback, adopt an unverified comment mutation, or clean up
competing bot comments before the active lease owner had established the
canonical durable review.
Why This Change Was Made
ClawSweeper now derives visible before-merge guidance and machine-readable state
from one normalized readiness result. Every valid generated review contains one
versioned exact-head state marker:
<!-- clawsweeper-review-state:<ready|blocked|needs-changes> item=<n> sha=<40hex> v=1 -->The existing
clawsweeper-review-versionmarker remains the durable identity.Repair routing uses the structured
work_candidatefield; independent guidanceis accepted as ready only when it is one bounded gate-only sentence. Missing,
negative, multi-sentence, targeted-validation, unrelated-CI, or otherwise
non-routine guidance fails closed.
Durable publication verifies the exact mutation identity and body. Oversized or
malformed output publishes a bounded blocked fallback, preserves its causal veto
over older ready comments, and requires a complete v1 review from a newer lease
before ready state can supersede it. After the fallback is patched, canonical
selection keeps using monotonic lease identity rather than client timestamps, so
an older lease with a later clock value cannot retake authority. Generic
publication no longer owns competing-comment deletion; the active lease
lifecycle owns cleanup after durable publication is verified.
This is one owner-boundary repair across readiness normalization, durable review
identity, publication, and lease cleanup. It does not change config, persistence,
SQLite, the dashboard status contract, or OpenClaw product behavior.
User Impact
Maintainers and downstream consumers such as Clownfish can distinguish
ready,blocked, andneeds-changesfor one exact item and head withoutparsing human prose. A visible blocker cannot coexist with hidden ready state,
and stale workers cannot erase or overwrite the fail-closed publication barrier.
There is no end-user OpenClaw behavior change.
Compatibility And Automation Decisions
v1 marker commitment
Owner decision: adopt the v1 marker as a supported additive producer
contract.
state,item,sha, andv=1fields onlywhen the paired durable review identity has the same exact head, a valid
review time, a non-sentinel lease owner, and a positive lease comment ID.
required v1 field or paired identity is missing or invalid.
coordinated consumer support, and a documented deprecation path before v1 is
removed.
policy gates; it is never standalone merge authority.
publication recovery and cleanup
Owner decision: accept the lease-owned recovery model.
newer lease publishes a complete v1 durable review.
are tie-breakers only after causal lease identity agrees.
canonical publication is verified.
path.
These decisions resolve the previous compatibility and automation merge-risk
questions and the applicable Rank-up move to record the v1 evolution policy.
Evidence
Exact range and LOC
36179dceb26fbeca33d8a863746b4cf83e325e0985abed7ee41f940699832c2b1374493d5d0e677d9bb9602e06c348b58d0112703212d8eb7cedbff97187d2c27f2689adffa09efe746557a4892f7c3218bbd1999db6cf3c63a966bbe7dc0592ad7664e0a6aa0a133cdb2c4801a51c3c14e783cf9ecad5d516249915fix(review): preserve causal fallback authority+3023/-553src/**)The positive production delta implements the versioned readiness contract,
verified publication identity, fail-closed causal barrier, and lease-owned
cleanup boundary. The branch removes duplicate presentation and generic cleanup
paths, and its test/tooling coverage is larger than the production change.
Focused validation and review
9f99287118f93a22bbd067f1c9834cd83761becd13ab97db5c1568f296e1ce8765b6795bdbad7a436f4bca32c3a21ffab0c8fd10c65ede0721c2a70e23b49df99d921092d2be9435d887e3c7536772655932a1166186496b8ef2b359c479e005df1c095253bdf6a236baa6c0291ed79e8c202e1c418da913433af0d1204d48deba647e9c85ecc6561e83d2281a4422ea0c062ee5babd9229b6536f6b7d8042fegit diff --checkpassed.are not treated as current evidence.
Prior finding and Rank-up disposition
work_candidateis authoritative for repair routing, while only an explicitallowlist of gate-only sentences can remain ready. Table-driven regressions
cover routine gates, imperative remediation, negative CI, targeted
validation, unrelated CI, missing guidance, findings, proof gaps, and
security routing.
must contain one supported v1 state marker paired with one durable version
marker for the same exact head, plus a valid timestamp, lease owner, and
positive lease comment ID. Missing state, unsupported state, malformed or
mismatched head, and sentinel ownership all remain fail-closed.
resolved. Canonical selection now ranks complete reviews by monotonic lease
comment ID before timestamp tie-breakers. Regression and live GitHub-client
proof cover an older lease carrying a later timestamp.
Risk entries now preserve bullet and continuation prose before routine/action
classification; the regression remains blocked and visible.
v1 marker commitment.
publication recovery and cleanup.
to change
src/clawsweeper-change-detection.ts.Real Behavior Proof
Local isolated producer and lifecycle proof
Claim: Durable review rendering emits one exact-head readiness state
consistent with visible guidance, fails closed for unresolved structured or
prose guidance, preserves security/proof/typed-finding blockers, verifies
publication identity, enforces the causal fallback barrier, and exposes a
producer-generated v1 fixture.
Exercised surface: Compiled readiness normalization, review rendering,
automation markers, repair/proof/security routing, durable publication, lease
lifecycle, prompt contract, and fixture generator.
Scenario or fixture:
queue_fix_prroutes repair without reason-text parsing;unrelated-CI guidance fail closed;
needs-changes, while blocked queue/security states emit norepair marker;
Command and environment: Docker-backed Crabbox
local-container, leasecbx_dedbbf57f57a, Colima Linux arm64,node:24-bookworm, Nodev24.18.1,pnpm
11.10.0, 3 CPUs, 6 GiB memory, 30-minute TTL, bridge networking. The runinstalled from the frozen lockfile, built all three TypeScript projects, ran
the 110 focused tests, regenerated the v1 fixture, and compared exact bytes.
Observable result: 110/110 focused tests passed. Every asserted readiness,
publication, routing, security, prompt, and lifecycle observation is true. The
source manifest, head, tree, base, and frozen range match the values above.
Artifact or trace:
.crabbox/runs/cbx_dedbbf57f57a/cbx_dedbbf57f57a-artifacts.tgz93ffb0eaed22b818013654b2e03ff8765769f89896a8ee5fe6e89882765bc562.artifacts/clawsweeper-1059-85abed7e-local-container-proof.jsone9af38b7ad835ea012758f38188bf19e039e8a3762c9bdfc6bad3fb68ccc30ce16d30dbb61acbe2a7ad7d73b5d476e3624b39e8f1f3226a02d66f8bd004c079961f78f9b6772a907288a4d68474bbdc94c6fb665e811edfe8cf17fc774218e89Lease and release: Crabbox reported
leaseStopped: true; the local-containerlease list is empty and the container ID is absent.
Limits: This proves the producer and durable lifecycle in isolated Linux.
It does not replace hosted CI or downstream Clownfish integration proof.
Production GitHub-client proof
Claim: The compiled production GitHub client preserves exact identity and
causal recovery semantics against real GitHub comment create, read, patch, and
delete operations.
Exercised surface:
createGitHubRuntime,createGitHubExecution,createReviewCommentIdentity,createReviewCommentAutomation,createReviewCommentState, andcreateReviewCommentPublication.Scenario: Nonce-tagged disposable comments on this PR exercised offset
timestamp canonicalization and parser round-trip, same-head bounded fallback
reuse, wrong-head and conflicting-timestamp rejection, identity-less fallback
POST, older/stale ready vetoes, stale overwrite rejection, rejection of an
incomplete higher-lease successor, valid fresh-lease PATCH recovery, rejection
of a later timestamp from an older lease, server readback, and cleanup.
Observable result: Every production-client observation is true. The bounded
fallbacks were 1,231 and 807 bytes, wrong-head/oversized metadata was absent,
the incomplete successor left the fallback unchanged, the complete fresh review
won despite the older lease's later timestamp, and every disposable comment
deletion was verified by a follow-up 404.
Artifact or trace:
814408a1061953c1c98f99b4a033220979315a18026c00fa3c79d1f16b25fd8b80ca83116882c38a0ed61336e0a11798b4457f9088e7d87dcb57c4a945a03a25062592001b5718f66c210ebfb9b245f8041a3b2de089e3754ecdc9fe9889fdbaclawsweeper-production-client-proofcomments.Limits: This was a narrow production API proof against disposable comments
on #1059. It did not alter the
durable ClawSweeper review comment, labels,
branch, checks, readiness, or merge state.
OpenClaw Bay impact
OpenClaw Bay is unaffected:
dashboard/**changes;/api/statussurface;the Bay status contract;
to Bay.
Release Notes
No
CHANGELOG.mdentry is included. ClawSweeper's normal repair workflow keepsrelease-note context in the PR body and commit history; changelog changes are
release-owned.