Skip to content

fix(review): publish exact merge readiness state - #1059

Merged
steipete merged 16 commits into
mainfrom
fix/clawsweeper-review-state-120232
Sep 2, 2026
Merged

steipete merged 16 commits into
mainfrom
fix/clawsweeper-review-state-120232

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Related: openclaw/openclaw#120232

What Problem This Solves

Resolves contradictory review guidance: a PR could display required work while its automation markers reported readiness. Oversized reviews could abort the apply batch, including after successfully publishing a blocked fallback.

Why This Change Was Made

One readiness owner now supplies the visible checklist, versioned state, and repair-loop pass eligibility from structured next_step, typed findings, and existing proof/security policy. Historical reports retain their defined legacy interpretation. The rewrite removes the proposed English sentence classifier, fixture generator, full-comment golden snapshots, and generic competing-comment sweep.

Publication accepts only a trusted author, positive safe server ID, and exact submitted body; PATCH also requires the targeted ID. An unusable returned acknowledgement can recover through fresh scoped readback. A verified oversized fallback records its actual receipt as guarded-open, carries the mutation receipt through event output, releases the owned lease, respects the processed limit, and continues the batch. Re-sync compares timestamp instants so canonical ISO spelling cannot add the same review to history twice. It never claims a completed review or grants repair/close permission.

Identity-less fallbacks establish a server-ID barrier that only a complete review from a newer owned lease can clear. PR successors require matching exact-head v1 state and durable identity; issues use sha=na plus a valid source revision without a PR-only state marker. Older leases cannot regain authority through later client timestamps. Publication preserves contributor and other workers’ comments; existing explicitly guarded lease-acquisition cleanup remains separate.

User Impact

Maintainers receive consistent visible and machine-readable guidance, and one oversized review no longer prevents later selected items from being processed. This continues Vincent Koc’s original contribution with a simpler implementation.

Owner decisions retained: the additive v1 ready|blocked|needs-changes marker is supported only with matching item/head, valid review time, and owned positive lease identity. Unknown states/versions or incomplete identity fail closed. Additive metadata is permitted; incompatible changes require a new version, coordinated consumer support, and documented deprecation. The marker remains advisory. Lease-owned recovery is accepted; publication gains no general deletion authority.

OpenClaw Bay Impact

The existing review-publication path carries the verified guarded-open result through event proof and the action ledger. Bay’s observer contract and UI are unchanged. The proof below does not claim deployed Bay convergence.

Documentation Impact

Updated active docs/pr-review-comments.md: structured readiness, exact receipts, the 60 KiB fallback, batch continuation, causal identity, and owned cleanup. Durable review publication owns this contract; production state/publication code and the compact v1 fixture are its sources of truth. Reviewed at the frozen tree below; marker, receipt, or lifecycle changes must update it.

Evidence

  • Final head: d6e850d28eedd1b35585fb110965b2fa24efe5b7; tree: 8d3a69231aebdaa1b4963ec771a031509eb709f7.
  • pnpm run check passed on Node 24.18.1 / pnpm 11.10.0: 4,494 tests passed, seven skipped, zero failures/cancellations; the separate 13-test coverage gate also passed. This includes builds, formatting, lint, docs/static checks, and coverage gates.
  • Focused regressions cover exact receipts, causal PR/issue recovery, readiness, timestamp round trips, and event-proof/ledger semantics. Managed precommit Codex P0 review found no actionable findings.
  • Current-head hosted CI and ClawSweeper review remain the landing gates; previous-head checks are not evidence for this revision.

Real Behavior Proof

AWS Crabbox lease cbx_768de70d3fd1, run run_38b07d0b0821, executed the actual compiled apply CLI through its existing GitHub command seam against a stateful loopback service. Dependencies were installed from the frozen lockfile. The tested staged tree is byte-identical to the final commit tree above; source, runtime assets, and complete compiled-bundle digests were checked before and after execution.

Pinned baseline 2bd06139e0d0d404250d474a43e8f2adfa899f70 attempted a 196,209-byte comment, received the fixture's size rejection, exited unsuccessfully, and never published the second item. The candidate published a 689-byte blocked notice, recorded its real ID/URL/body digest, released its owned lease, and published the second item. The processed-limit-one control stopped after the blocked item and still released its lease. Across both candidate cases: three durable writes, three owned-lease deletions, unchanged contributor/status sentinels, no close/merge/dispatch, and zero unexpected transport operations. Both loops exited successfully and closed their servers.

The actual exported apply result reached the compiled event consumer as guarded-open with its mutation receipt; it never claimed a completed full review. Strict receipt rejection, separate causal recovery negatives, and ledger classification are focused test evidence, not additional native scenarios.

Artifact SHA-256: 1c7228483698c58c2e765088a6abf821ec301454162ef3c9b62f2e9720e1e607. Candidate proof JSON: 52839adbb86c8b89206bcd0670d211a4faa11fe5336013a118213275b05125d0. Proof script: 9baceae2240744ccdfbdad6ea4a57abaafe9d0f475bd51148300de28bfe4eba2. Evidence retains both baseline and candidate CLI logs, request traces, stored comments, reports, and validation outputs. The credential-free lease is retained temporarily for the separate lifecycle-inventory follow-up.

This proves compiled behavior against a controlled service; it does not establish live GitHub permissions/eventual consistency, GitHub's size-limit implementation, downstream Clownfish integration, model inference, or deployed Bay convergence.

@vincentkoc vincentkoc self-assigned this Aug 7, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Aug 7, 2026
@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 5:09 PM ET / 21:09 UTC.

ClawSweeper review

What this changes

This PR adds an advisory exact-head readiness state to durable PR review comments and makes oversized-comment fallback publication a guarded-open, batch-continuing outcome.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for maintainer review: the member-authored branch is unmerged, and its exact readiness and guarded-publication behavior remains a distinct change rather than a demonstrated main-branch replacement.

Priority: P2
Reviewed head: d6e850d28eedd1b35585fb110965b2fa24efe5b7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A broad but coherently tested automation repair with strong controlled production-path proof and no discrete correctness finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The supplied PR-body evidence ties the changed publication owner and apply workflow to a compiled CLI run through the existing GitHub command seam: the baseline stops after a size rejection, while the candidate records a blocked receipt, releases its lease, and processes the next item. The evidence is controlled-service proof and does not claim live GitHub or Bay convergence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The supplied PR-body evidence ties the changed publication owner and apply workflow to a compiled CLI run through the existing GitHub command seam: the baseline stops after a size rejection, while the candidate records a blocked receipt, releases its lease, and processes the next item. The evidence is controlled-service proof and does not claim live GitHub or Bay convergence.
Evidence reviewed 7 items Readiness owner: The PR centralizes checklist-derived readiness and fails closed when identity, confidence, disposition, compatibility, or correctness inputs are unusable.
Bounded publication path: Oversized durable comments are replaced by a bounded blocked notice, receipt-verified, and surfaced as a typed publication outcome.
Apply continuation: A verified blocked-publication receipt is recorded as kept open with a mutation receipt instead of escaping the item loop.
Findings None None.
Security None None.

How this fits together

ClawSweeper converts structured review reports into durable GitHub comments, whose markers guide review presentation and repair-loop eligibility. Its apply workflow publishes those comments and records the resulting mutation and open/closed disposition in the action ledger.

flowchart LR
  A[Structured review report] --> B[Readiness calculation]
  B --> C[Durable review comment]
  C --> D[GitHub publication receipt]
  D --> E[Apply workflow]
  E --> F[Action ledger]
  B --> G[Repair-loop eligibility]
Loading

Before merge

  • Resolve merge risk (P1) - This changes machine-readable readiness and apply-event semantics; a defect in the shared readiness calculation could incorrectly influence later repair-loop routing despite the fail-closed checks.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test scope production +898, tests +1,647, docs +42 The sizeable implementation change is accompanied by substantially larger focused coverage for the new comment-state and publication contract.
Files affected 39 files The change spans rendering, publication, apply, ledger, and their contract tests, so shared automation behavior merits maintainer attention.

Merge-risk options

Maintainer options:

  1. Preserve the fail-closed readiness contract (recommended)
    Merge with the existing exact-head receipt, malformed-identity, and oversized-publication coverage as the guard against unsafe automation routing.

Technical review

Best possible solution:

Land the focused readiness and publication hardening only after the current-head automation checks complete, retaining the exact receipt and malformed-input regressions as the contract boundary.

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

Yes—source and the supplied current-head compiled-CLI trace define a high-confidence scenario: an oversized review must publish a bounded blocked receipt, release its lease, and allow the next selected item to continue.

Is this the best way to solve the issue?

Yes—the shared readiness calculation plus an exact receipt-verified fallback is the narrowest maintainable fix because presentation and automation no longer independently infer readiness.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ff071968ca4e.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied PR-body evidence ties the changed publication owner and apply workflow to a compiled CLI run through the existing GitHub command seam: the baseline stops after a size rejection, while the candidate records a blocked receipt, releases its lease, and processes the next item. The evidence is controlled-service proof and does not claim live GitHub or Bay convergence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The supplied PR-body evidence ties the changed publication owner and apply workflow to a compiled CLI run through the existing GitHub command seam: the baseline stops after a size rejection, while the candidate records a blocked receipt, releases its lease, and processes the next item. The evidence is controlled-service proof and does not claim live GitHub or Bay convergence.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded automation-reliability repair with no demonstrated user-facing outage.
  • merge-risk: 🚨 automation: The PR changes durable readiness markers, repair eligibility, publication receipts, and action-ledger classification.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The supplied PR-body evidence ties the changed publication owner and apply workflow to a compiled CLI run through the existing GitHub command seam: the baseline stops after a size rejection, while the candidate records a blocked receipt, releases its lease, and processes the next item. The evidence is controlled-service proof and does not claim live GitHub or Bay convergence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied PR-body evidence ties the changed publication owner and apply workflow to a compiled CLI run through the existing GitHub command seam: the baseline stops after a size rejection, while the candidate records a blocked receipt, releases its lease, and processes the next item. The evidence is controlled-service proof and does not claim live GitHub or Bay convergence.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Martin Cleary: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (31 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-09T14:33:47.214Z sha 85abed7 :: needs changes before merge. :: [P2] Record fallback publication as a terminal item skip
  • reviewed 2026-08-09T16:42:15.131Z sha 85abed7 :: needs changes before merge. :: [P2] Record fallback publication as a terminal item skip
  • reviewed 2026-08-09T18:04:09.026Z sha 85abed7 :: needs changes before merge. :: [P2] Record blocked fallback as a terminal item skip
  • reviewed 2026-08-09T19:11:19.041Z sha 85abed7 :: needs changes before merge. :: [P2] Record blocked fallback publication as an item skip
  • reviewed 2026-08-09T21:04:14.892Z sha 85abed7 :: needs changes before merge. :: [P2] Record blocked fallback publication as an item skip
  • reviewed 2026-08-09T22:50:47.119Z sha 85abed7 :: needs changes before merge. :: [P2] Record blocked fallback publication as an item skip
  • reviewed 2026-08-22T07:07:59.010Z sha 85abed7 :: found issues before merge. :: [P2] Record a published fallback as a terminal item skip
  • reviewed 2026-08-29T19:50:42.675Z sha 85abed7 :: needs changes before merge. :: [P2] Record a published fallback as a terminal item skip

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient Contributor real behavior proof is sufficient. labels Aug 7, 2026
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
@clawsweeper clawsweeper Bot removed the proof: sufficient Contributor real behavior proof is sufficient. label Aug 22, 2026
Use the existing structured next-step, findings, and proof policy for public
readiness. Remove the proposed sentence classifier, generated prose fixture,
and generic competing-comment cleanup.

Require exact trusted publication receipts. Record a bounded fallback as
verified guarded-open work, retain its receipt in event output, release the
owned lease, and continue the batch. Preserve valid issue recovery without
PR-only state and compare review timestamps by instant during re-sync.

Validated with the compiled apply CLI against a controlled GitHub transport,
a paired oversized baseline, processed-limit and owned-cleanup controls, and
pnpm run check on Node 24.

Co-authored-by: Vincent Koc <[email protected]>
@steipete
steipete marked this pull request as ready for review September 2, 2026 21:04
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added 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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer disposition for d6e850d28eedd1b35585fb110965b2fa24efe5b7: accepted. The current-head review found no actionable defects and considered the compiled behavior proof sufficient. Its remaining general automation-risk item is covered by the documented additive v1 contract, exact-head/owned-lease identity, verified publication receipts, and guarded-open continuation. The readiness marker remains advisory; fallback publication never grants repair or close authority.

The current-head CI gate, CodeQL, and production automerge E2E are green. The isolated Node 24 gate passed 4,494 tests with seven skips plus the separate 13-test coverage gate; the paired native proof reproduced the old batch abort and verified fallback receipt, continuation, processed-limit handling, and owned cleanup. Managed Codex P0 reviews of both the final staged tree and committed branch found no actionable findings.

Landing this rewrite with Vincent Koc’s original contribution and credit preserved. Native evidence and its controlled-service limitations are recorded in the PR body.

@steipete
steipete merged commit 35e637e into main Sep 2, 2026
23 of 29 checks passed
@steipete
steipete deleted the fix/clawsweeper-review-state-120232 branch September 2, 2026 21:14
saariuslystoned added a commit to saari-co/clawsweeper that referenced this pull request Oct 30, 2026
… PRs

The first revision published a fourth review-state value,
`awaiting-maintainer`. Released v0.3.3 readers accept only `ready`,
`blocked`, and `needs-changes` and return null for anything else, so the
causal selector would drop the new comment and could prefer an older one.
The retained contract from openclaw#1059
requires coordinated versioning for an incompatible change; this is not one.

`awaiting-maintainer` is now a presentation state only. The marker keeps the
`blocked` wire value and adds `hold=maintainer_decision`, an attribute v1
readers ignore and newer readers can use to tell the owner wait from other
blocks. The identity reader is back to the three-state contract and fails
closed on unknown states. The verdict line, readiness block, empty Before
merge checklist, status label, and `hold=maintainer_decision findings=0`
verdict are unchanged; the persisted comment format does not change.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
obviyus pushed a commit that referenced this pull request Nov 5, 2026
… PRs

The first revision published a fourth review-state value,
`awaiting-maintainer`. Released v0.3.3 readers accept only `ready`,
`blocked`, and `needs-changes` and return null for anything else, so the
causal selector would drop the new comment and could prefer an older one.
The retained contract from #1059
requires coordinated versioning for an incompatible change; this is not one.

`awaiting-maintainer` is now a presentation state only. The marker keeps the
`blocked` wire value and adds `hold=maintainer_decision`, an attribute v1
readers ignore and newer readers can use to tell the owner wait from other
blocks. The identity reader is back to the three-state contract and fails
closed on unknown states. The verdict line, readiness block, empty Before
merge checklist, status label, and `hold=maintainer_decision findings=0`
verdict are unchanged; the persisted comment format does not change.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. 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