Repository navigation
feat(review): make re-review command intake durable - #1143
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 2:08 PM ET / 18:08 UTC. ClawSweeper reviewWhat this changesThis PR stores each eligible re-review comment version in the Durable Object queue before acknowledgement or Actions dispatch, then verifies and processes it idempotently. Merge readinessKeep open: current main still has the pre-durable re-review intake path, while this PR adds receipt-first intake and resolves the prior same-timestamp edit race. Likely related people: Peter Steinberger (high confidence) and Martin Cleary (medium confidence). Priority: P1 Review scores
Verification
How this fits togetherGitHub comment webhooks and scheduled router scans feed ClawSweeper’s exact-review queue. The queue verifies the live comment and PR head, then launches review work and converges the visible acknowledgement. flowchart LR
A[GitHub re-review comment] --> B[Webhook or router intake]
B --> C[Durable command receipt]
C --> D[Live comment and PR-head verification]
D --> E[Exact review queue]
E --> F[Acknowledgement and reaction]
E --> G[Review automation]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Deploy the Worker and router change together, then confirm the first production re-review creates one durable receipt and retains scheduled routing as recovery. Do we have a high-confidence way to reproduce the issue? Yes. The supplied real Worker/DO comparison reproduces the throttled baseline failure, and the relevant current-main paths are unchanged from that baseline. Is this the best way to solve the issue? Yes. Recording an immutable command version before any acknowledgement removes the dispatch-rate-limit loss window while preserving the router as a recovery producer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 04cd80977237. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
@clawsweeper re-review All three actionable findings from the first review are resolved on the current head. The PR body now contains the finding disposition, refreshed full-gate results, and successful exact-current-head real Worker/DO proof. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: feat(review): make re-review command intake durable This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
…sede proven-stale tuple rows (#1152) Root-causes and fixes the tuple_protocol_invalid dead-letter class (30 rows), closing the DLQ's last unexplained residue. Fingerprint archaeology: the dominant 21-row class hashed to a generic invalid_direct_publication_plan opacity bucket - 19 rows are debris of the mixed-case slug bug already fixed in #1100 (steipete/CodexBar targets), two lost their pre-#1091 detail and stay honestly unclassified. The live 4-row class is "conflicting direct publication retry": guarded apply refreshes current_item_*/apply_checked_at after canonical acceptance, so publication retries see byte-conflicts against their own accepted plan (hit both pre- and post-#1143 items, including re_review command results - NOT a protocol-v2 command bug). Live fix: an actively owned batch resumes from its terminal canonical receipt instead of conflicting with itself; strict direct-publication conflict and fence checks preserved. Stale tuple rows now pass through the #1148 six-way evidence-gated supersede (newer-head completed record required); current-head rows stay recoverable so they republish after this fix; workflow_cancelled remains excluded. Proof: red reproduced the HTTP 400 conflict and the supersede exclusion; green 176/176 focused scenarios; full gate 3396/0; Crabbox local-container receipt at this head (docs/proof/tuple-protocol-rootcause/). Verdict clean (Findings: None, Security: None) on 5b67ae2.
What this fixes
An eligible
@clawsweeper re-reviewcommand currently becomes durable only after a GitHub Actions comment-router run claims it. The hosted webhook first creates an optimistic acknowledgement and then dispatches that run. When the target GitHub App bucket is throttled, both the exact router run and its five-minute fallback can fail before the action ledger owns the command.That happened in production on August 12: openclaw/openclaw#116562's command received only “Command router queued”; the exact router run and the scheduled fallback both failed on installation rate limiting, and no sweep run for that item existed at investigation time.
This PR moves only re-review command intake ahead of acknowledgement and Actions dispatch. The Worker records an immutable comment-version identity in the ExactReviewQueue Durable Object, verifies the live source comment and PR head, enqueues once, and then converges the acknowledgement and reaction. The scheduled comment router remains a recovery producer, but it posts into the same receipt instead of creating a second dispatch path.
Snapshot and supersession analysis
The source was abandoned WIP snapshot
4cad8dea21(codex/fix-command-review-publication), based 58 commits behind main with 59 changed files. It was treated as design evidence, not applied as a patch.Kept and rewritten:
Dropped as already landed or structurally superseded:
branch_is_usable/branch-authority work from fix(queue): resolve scheduled target branches #962;The old 1,400-line
dashboard/exact-review-queue.tssplice was not ported. The command tables and state transitions live in a new strict module, with narrow hooks into the current decision, lifecycle, Worker, and queue owners.Migration and behavior
The new SQLite tables are created idempotently during ExactReviewQueue initialization. No backfill is required: existing GitHub comments remain discoverable through the scheduled router, and new exact versions receive durable receipts on first observation. Detailed terminal receipts expire with resolved dead letters; per-comment watermarks remain to prevent an old version from restarting after compaction.
The processing fence is deliberately three-stage: verify, enqueue, effects. A crash after enqueue reuses the delivery receipt without rebinding authority; a crash during acknowledgement/reaction retries only idempotent effects.
OpenClaw Bay is unaffected. This changes no Bay field, data contract, control, or action surface; Bay remains observer-only.
Review finding disposition
The first ClawSweeper review identified three actionable findings; all are resolved on the current head:
CLAWSWEEPER_WEBHOOK_SECRET, exactly matching the Worker endpoint. The unsupported distinct-secret preference was removed from code and workflow environments.Focused regressions cover the signing source, a contributor-forged exact marker, and a trusted exact receipt on page two. The forged human comment remains untouched.
The second and final allowed ClawSweeper review identified one late P1 finding: same-timestamp edited comment bodies could both pass a timestamp-only currentness check. The final correction lets same-timestamp contenders reach live verification, atomically promotes only the full version identity whose digest matches GitHub, supersedes sibling intakes, and rechecks that identity before enqueue and acknowledgement effects. Its regression advances the older receipt beyond verification before the edited version wins.
Proof
Claim: throttling before Actions dispatch can no longer lose or duplicate an eligible re-review command.
Exercised surface: real
wrangler dev --localWorker boots, signed webhook HTTP, loopbackGITHUB_API_URL, ExactReviewQueue DO SQLite, alarm retry, and full Wrangler process-tree shutdown.Scenario: the pinned-main Worker and candidate received the same signed PR command. The loopback GitHub API accepted acknowledgement writes but throttled baseline repository dispatch and candidate source verification.
Observed result:
Crabbox proof was renewed after every code head. The committed receipt records final code head
ee949363f5c4cf755a431020b738f1bf06ae49b5on AWS leasecbx_6b30d164d7dc, runrun_7cfa46ca99f9. A second successful comparison exercised the exact final receipt head9eb957ea6ae034d8aba003c47664b6bac2864e6e:provider=aws, leasecbx_72a05adbf287, runrun_d2eb04c505d7,comparison_pass=true, exit 0,leaseStopped=true. Receipt:docs/proof/durable-command-intake/receipt.md.Provider note:
crabbox config showresolvesprovider=awsfor this repository and host. The applicable Crabbox workflow forbids silently overriding that resolved backend when the user did not request one. This host is macOS; the repository's local-container-only sentence is explicitly scoped to a Windows host. The proof therefore preserves the resolved AWS backend while running realwrangler dev --localWorkers with isolated persistence.Limits: the GitHub API was synthetic loopback; no live credentials or production mutations were used. Executor completion and final public review publication were not exercised by this proof.
Validation
pnpm run check: 7,056 passed, 13 skipped; coverage 81.34% lines, 73.93% branches, 87.25% functionspnpm run check:dashboard-strict