Skip to content

fix: reuse command review status comment - #1675

Merged
steipete merged 15 commits into
mainfrom
codex/reuse-command-review-ack
Sep 24, 2026
Merged

steipete merged 15 commits into
mainfrom
codex/reuse-command-review-ack

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Command-triggered exact reviews currently display two adjacent ClawSweeper comments: the command acknowledgement is rewritten with progress, then the worker posts a separate temporary lease comment.

This change makes the existing command acknowledgement the single visible status and coordination comment. Queue-authorized command reviews rewrite it in place, attach the existing hidden review-lease markers, and return queue_only=true so the workflow does not create, expire, or release a second visible lease comment. Missing acknowledgements and non-command reviews retain the existing temporary-comment path.

Status mutations are fenced through the exact-review queue before lookup and immediately before their single-attempt GitHub PATCH. Terminal command states remain successful no-ops; failed, interrupted, and waiting states remain retryable. Command-triggered issues compute their source revision during admission, while ordinary issue sweeps retain the previous zero-comment-read path. The acknowledgement receives a bounded 64-minute setup lease and refreshes that clock when reservation begins, covering the 56-minute maximum review allowance without a two-hour stale marker.

OpenClaw Bay is unaffected because lifecycle and telemetry contracts do not change.

Behavior proof

  • Claim: a command review rewrites its acknowledgement through queued, in-progress, and terminal status without creating a second visible lease comment.
  • Surface: command-status writer, exact-review workflow reservation, and review-command coordination validation.
  • Scenario: resolved command acknowledgement uses queue-only coordination; missing acknowledgement falls back to the existing GitHub lease; retryable failure and terminal duplicate delivery remain covered; ordinary issue admission performs no new comment read.
  • Environment: Node 24 on aae7a5f6723efc99f7cca1d3bea0335b2bbe2852.
  • Observed result: 195 focused command-status, action-ledger, exact-review-admission, and workflow integration tests pass. The production workflow-shell proof passes on the exact head: the allowed path emits queue_only=true and the superseded path stops without an extra GitHub mutation.
  • Authority-chain trace: proof comment. The production status CLI reached a real GitHub PATCH for the setup lease after queue fences 200, 200, then reached a second authorized PATCH at reservation. The lease start and expiry advanced by 8,729 ms while retaining the 3,840,000 ms window. A competing run then received fences 200, 409; the GitHub timestamp and body SHA-256 both remained unchanged, proving rejection after lookup and before final comment I/O.
  • Artifacts: .artifacts/queue-only-proof-aae7/summary.json and .artifacts/authority-chain-proof-aae7/summary.json in the maintainer checkout.
  • Limits: the GitHub comment reads and PATCHes were real; queue outcomes were controlled locally. A short setup interval demonstrates replacement of the lease clock without waiting through its full bound. A live exact-review canary will verify the single visible comment after deployment.

Finding dispositions

  • The acknowledgement PATCH is queue-fenced before lookup and immediately before its single-attempt mutation. It carries the existing hidden lease markers so command and non-command reviewers share the established lease domain.
  • The exact-review queue remains the authority for resolved command reviews. Missing acknowledgements use the existing dedicated lease path.
  • Surviving fast acknowledgements are resolved by the exact trusted marker fallback; human marker copies are ignored.
  • Terminal command states cannot be overwritten by setup or failure paths.
  • Maintainer override: landing accepts that reusing an older acknowledgement may win lowest-comment-ID arbitration over a newer temporary lease.
  • Maintainer override: landing accepts that a nonterminal waiting/status rewrite may remove another owner's active marker. These two coordination risks are known and explicitly accepted for this simplification.

Validation

  • Focused current-head tests: 195 passed
  • Current-head production workflow-shell proof: passed; queue-only reservation refresh invoked once and the superseded path made zero GitHub mutations
  • Pre-rebase local full gate: 6,693 passed and 37 platform skips; one unrelated macOS harness case failed because Apple Bash 3.2 lacks mapfile
  • Staged correction review and final committed branch review through P2: clean after the two explicit maintainer overrides
  • Hosted Linux CI is the complete aggregate gate for the current head

@steipete
steipete requested a review from a team as a code owner September 24, 2026 10:02
@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 4:06 PM ET / 20:06 UTC (Revision 14).

ClawSweeper review

What this changes

Command-triggered exact reviews reuse their acknowledgement for progress and lease coordination, while reviews without a usable acknowledgement retain a temporary lease comment.

Merge readiness

✅ Ready for maintainer review

Keep open for landing review. Current main contains the preparatory compatibility work but still creates a separate review lease comment. This branch provides distinct activation work with current-head proof, and this review found no additional blocking defect.

Priority: P2
Reviewed head: aae7a5f6723efc99f7cca1d3bea0335b2bbe2852

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused coverage and current-head GitHub-boundary proof, with documented coordination tradeoffs for the changed workflow.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): On the current head, the production status CLI rewrote a real GitHub comment after controlled authorized queue responses; a superseded response left its timestamp and body hash unchanged. The workflow-shell proof observed queue_only=true. The merged compatibility reader accepts existing and command-owned lease markers, so no stored-comment migration is needed; a full live review canary remains unobserved.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): On the current head, the production status CLI rewrote a real GitHub comment after controlled authorized queue responses; a superseded response left its timestamp and body hash unchanged. The workflow-shell proof observed queue_only=true. The merged compatibility reader accepts existing and command-owned lease markers, so no stored-comment migration is needed; a full live review canary remains unobserved.
Evidence reviewed 8 items Current main still reserves a separate lease: The main-branch workflow updates command progress and then invokes the separate review-lease reservation.
Introduced queue-only reservation: The branch refreshes the resolved acknowledgement at reservation and emits queue_only=true; the temporary-comment path remains available when no acknowledgement was resolved.
Final comment mutation fence: The command-status writer checks queue authority after comment lookup and before its GitHub PATCH.
Findings None None.
Security None None.

How this fits together

A review command enters the exact-review queue, which authorizes a worker to review an issue or pull request. GitHub comments show progress and carry lease markers that coordinate the worker and final publication.

flowchart LR
A[Review command] --> B[Exact-review queue claim]
B --> C[Command status writer]
C --> D{Acknowledgement found?}
D -->|Yes| E[Reuse status comment]
D -->|No| F[Temporary lease comment]
E --> G[Review and publication]
F --> G
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test growth production +333 lines, tests +316 lines The production growth implements workflow fencing and lease refresh, with focused coverage for those paths.

Technical review

Best possible solution:

Land the shared status-comment path with the existing marker readers, then use a live command-review canary to confirm one visible comment and successful finalization.

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

Yes. Current-main workflow source shows a command progress update followed by a separate lease reservation; this read-only review did not execute that workflow.

Is this the best way to solve the issue?

Yes. Reusing the acknowledgement through the established lease-marker readers is a bounded fix, and the branch retains the temporary-comment fallback.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • 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 (terminal): On the current head, the production status CLI rewrote a real GitHub comment after controlled authorized queue responses; a superseded response left its timestamp and body hash unchanged. The workflow-shell proof observed queue_only=true. The merged compatibility reader accepts existing and command-owned lease markers, so no stored-comment migration is needed; a full live review canary remains unobserved.
  • 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: The PR improves review-command coordination with limited operator-facing impact.
  • merge-risk: 🚨 automation: The diff changes live queue and comment coordination; the PR body records the accepted arbitration tradeoffs.
  • 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 (terminal): On the current head, the production status CLI rewrote a real GitHub comment after controlled authorized queue responses; a superseded response left its timestamp and body hash unchanged. The workflow-shell proof observed queue_only=true. The merged compatibility reader accepts existing and command-owned lease markers, so no stored-comment migration is needed; a full live review canary remains unobserved.
  • proof: sufficient: Contributor real behavior proof is sufficient. On the current head, the production status CLI rewrote a real GitHub comment after controlled authorized queue responses; a superseded response left its timestamp and body hash unchanged. The workflow-shell proof observed queue_only=true. The merged compatibility reader accepts existing and command-owned lease markers, so no stored-comment migration is needed; a full live review canary remains unobserved.

Evidence

What I checked:

  • Current main still reserves a separate lease: The main-branch workflow updates command progress and then invokes the separate review-lease reservation. (.github/workflows/sweep.yml:976, 0dc9e1c0870c)
  • Introduced queue-only reservation: The branch refreshes the resolved acknowledgement at reservation and emits queue_only=true; the temporary-comment path remains available when no acknowledgement was resolved. (.github/workflows/sweep.yml:1074, aae7a5f6723e)
  • Final comment mutation fence: The command-status writer checks queue authority after comment lookup and before its GitHub PATCH. (src/repair/update-command-status.ts:152, aae7a5f6723e)
  • Existing lease compatibility: The current comment reader recognizes both ordinary and command-owned lease identities; the earlier compatibility PR is merged, while this PR activates acknowledgement reuse. (src/repair/comment-router-core.ts:1940, 0dc9e1c0870c)
  • Current-head behavior proof: The PR body and linked proof comment report a production status-CLI write to a real GitHub comment after authorized queue responses, a reservation-time lease refresh, and no comment mutation after a superseded response. The queue outcomes were controlled locally, and a live post-deployment canary remains outside this proof. (aae7a5f6723e)
  • Recorded coordination tradeoffs: The PR body explicitly records acceptance of older-acknowledgement lease election and possible removal of another owner's active marker. The completed prior review for this same head lists no findings or rank-up moves. (aae7a5f6723e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-24T14:34:15.946Z sha 73ac785 :: needs real behavior proof before merge. :: [P3] Update the command review lease documentation
  • reviewed 2026-09-24T16:18:11.213Z sha c759ec2 :: needs real behavior proof before merge. :: [P1] Honor a fresh queue claim over an obsolete comment owner | [P1] Fence duplicate cleanup before deleting acknowledgements
  • reviewed 2026-09-24T16:50:25.176Z sha 000b2d7 :: needs real behavior proof before merge. :: [P1] Fence duplicate deletion after comment lookup
  • reviewed 2026-09-24T17:39:39.343Z sha 13f5fa7 :: needs real behavior proof before merge. :: [P1] Preserve lease order when reusing an older acknowledgement | [P1] Keep active foreign leases on nonterminal status updates
  • reviewed 2026-09-24T19:12:28.751Z sha 53a0f23 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-24T19:25:46.669Z sha 53a0f23 :: blocked before merge. :: none
  • reviewed 2026-09-24T19:40:13.517Z sha 2620eeb :: blocked before merge. :: [P2] Start the reused lease clock when the review reservation begins
  • reviewed 2026-09-24T20:01:41.513Z sha aae7a5f :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. 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. labels Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

file: string,
args: string[],
options: { encoding: "utf8"; maxBuffer: number },
) => string = (file, args, options) => execFileSync(file, args, options),
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@steipete
steipete force-pushed the codex/reuse-command-review-ack branch from 53a0f23 to 2620eeb Compare September 24, 2026 19:34
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. labels Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 24, 2026
@steipete
steipete merged commit f06c3bf into main Sep 24, 2026
25 of 28 checks passed
@steipete
steipete deleted the codex/reuse-command-review-ack branch September 24, 2026 20:13
steipete added a commit that referenced this pull request Oct 14, 2026
…tion

Follow-ups to #1981, each of which left a command request unanswered:

- A deferred publisher's source-drift requeue keeps the request's
  verification while the publisher still holds the request's newest
  publication and no other command reached the item since. The admitted
  item carries a queue-owned `held-publication-requeue:` delivery prefix
  that the load-time verification rule honors; `/enqueue` rejects caller
  delivery ids with either continuation prefix. Any other orphan requeue
  still drops it.
- The batch publisher builds its requeue with the shared
  `enqueue source-drift` CLI, so both publishers send one delivery id per
  review generation (`publisher-source-drift:<producer run>:<attempt>`).
- Command-bearing recovery is no longer shed by backpressure or a GitHub
  throttle window.
- An artifact refresh leaves a queued command intact. A different, older
  producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits
  the finalized command.

The `--refuse-terminal-state` report is intended behavior (#1675) and is
unchanged.
steipete added a commit that referenced this pull request Oct 14, 2026
…tion

Follow-ups to #1981, each of which left a command request unanswered:

- A deferred publisher's source-drift requeue keeps the request's
  verification while the publisher still holds the request's newest
  publication and no other command reached the item since. The admitted
  item carries a queue-owned `held-publication-requeue:` delivery prefix
  that the load-time verification rule honors; `/enqueue` rejects caller
  delivery ids with either continuation prefix. Any other orphan requeue
  still drops it.
- The batch publisher builds its requeue with the shared
  `enqueue source-drift` CLI, so both publishers send one delivery id per
  review generation (`publisher-source-drift:<producer run>:<attempt>`).
- Command-bearing recovery is no longer shed by backpressure or a GitHub
  throttle window.
- An artifact refresh leaves a queued command intact. A different, older
  producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits
  the finalized command.

The `--refuse-terminal-state` report is intended behavior (#1675) and is
unchanged.
steipete added a commit that referenced this pull request Oct 14, 2026
…tion

Follow-ups to #1981, each of which left a command request unanswered:

- A deferred publisher's source-drift requeue keeps the request's
  verification while the publisher still holds the request's newest
  publication and no other command reached the item since. The admitted
  item carries a queue-owned `held-publication-requeue:` delivery prefix
  that the load-time verification rule honors; `/enqueue` rejects caller
  delivery ids with either continuation prefix. Any other orphan requeue
  still drops it.
- The batch publisher builds its requeue with the shared
  `enqueue source-drift` CLI, so both publishers send one delivery id per
  review generation (`publisher-source-drift:<producer run>:<attempt>`).
- Command-bearing recovery is no longer shed by backpressure or a GitHub
  throttle window.
- An artifact refresh leaves a queued command intact. A different, older
  producer command is answered as superseded instead of overwriting it.
- An organic successor of a pending terminal finalizer no longer inherits
  the finalized command.

The `--refuse-terminal-state` report is intended behavior (#1675) and is
unchanged.
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