Repository navigation
fix(queue): reconcile parked review items - #1111
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 8:52 PM ET / August 11, 2026, 00:52 UTC. ClawSweeper reviewWhat this changesThis PR adds signed, bounded reconciliation of exhausted parked exact-review records, resolving terminal targets and re-queuing eligible open targets while excluding command-context records. Merge readinessKeep open for normal maintainer review: current main handles terminal parked records but not fresh recovery of exhausted open records, and the PR supplies current-head Worker/DO proof. The exact PR commit could not be hydrated locally because the promisor remote DNS lookup failed, so the no-finding verdict is medium-confidence. Priority: P1 Review scores
Verification
How this fits togetherExact-review jobs are persisted in a Durable Object and dispatched to review workflows. After the existing retry ladder exhausts, this adds an operator-only path that either finalizes obsolete work or returns eligible work to pending review. flowchart LR
A[Review event] --> B[Durable exact-review queue]
B --> C[Automatic recovery ladder]
C --> D[Exhausted parked record]
D --> E[Signed reconciliation]
E --> F[Resolve terminal target]
E --> G[Fresh pending review]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the bounded, signed post-exhaustion recovery path, preserve command-context exclusion, and monitor recovery volume and repeated rejection reasons after deployment. Do we have a high-confidence way to reproduce the issue? Not applicable as a standalone issue report: the PR supplies an exact-head Worker/Durable Object runtime scenario for the claimed recovery behavior. Is this the best way to solve the issue? Yes: a signed, bounded path after the existing automatic ladder is a narrower solution than changing ordinary retry admission; current main only performs terminal cleanup for exhausted parked records. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 51ac499c741b. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (5 earlier review cycles)
|
891b014 to
0ded7ef
Compare
Ports the durable command-intake pipeline for the "@clawsweeper re-review" command from the abandoned Aug-8 WIP (snapshot 4cad8de on codex/fix-command-review-publication) onto current main. Commands are now durably recorded pre-acknowledgement (intake/watermark/receipt/revision tables, 16-item intake, 15s-15m bounded retries, 30-day receipts), verified against the live comment and head, fenced through verify/enqueue/effects stages, and superseded by full version identity - including equal-timestamp edits (review-caught P1). Acknowledgement and reaction effects are idempotent; router runs that throttle mid-command now recover instead of stranding the command (live instance: openclaw/openclaw#116562 was acked then lost when both router runs throttled). Superseded snapshot pieces were dropped, not ported: retry jitter (#1076/#1077), quota headroom (#1086), retry budgets (#1089), parked reconciliation (#1111), branch guard (#962); dashboard-monolith diffs were reworked around the #1116/#1124/#1132 splits. Proof: committed receipt at this exact head (docs/proof/durable-command-intake/), real Wrangler Worker + DO comparison with durable throttled recovery, GitHub confined to loopback API; full gate 7056 passed / 0 failed; strict check green. Verdict clean (Findings: None) on 9eb957e.
Summary
Command-context route diagnosis
Command-context review items can genuinely reach
parkedthrough real routes; this exclusion is not only defense-in-depth. The legacy command dispatcher emits aclawsweeper_itemwith a command status marker and optional status comment id insrc/repair/comment-router.ts. The legacy intake in.github/workflows/sweep.ymlturns that event into a signed queue enqueue. A permanent per-item repository-dispatch rejection reachesparkRecoverableExactReviewItem(..., "dispatch_rejected")indashboard/exact-review-queue.ts, without excluding command context. Claimed non-publication command reviews can likewise reachreview_retry_exhaustedthrough the normal completion retry ceiling.The command-specific exception is a terminal-finalization acknowledgement driver: dispatch failure keeps that driver pending with publication retry backoff rather than parking it. That separate branch does not apply to the initial command review exercised here.
Off-by-one diagnosis
Diagnosis: (c) rebase/integration drift, not intended admission semantics and not a reconcile counting bug.
The post-rebase integration commit
64ac9773bbaccidentally changedtest/dashboard-worker.test.ts:3345from six leased fixture rows to seven. The fixture helper marks every rowstate: "leased"attest/dashboard-worker.test.ts:28245. Lane stats countdispatchingItems.length + leasedItems.lengthas active atdashboard/exact-review-queue.ts:12070and calculateavailable_slotsascapacity - activeatdashboard/exact-review-queue.ts:12109. The test config sets the queue cap to 128 attest/dashboard-worker.test.ts:3355, so the accidental fixture produced128 - 7 = 121.This is independent of parked recovery: parked rows are collected separately and are not included in
active; the operator endpoints are not invoked by this test. The isolated Node 24 run at64ac9773bbreproduced121 !== 122. Commit0f5c8d3b71restored the mainline fixture to six leased rows, making128 - 6 = 122; the same isolated test then passed without changing the expectation or runtime admission semantics.pr-behavior-proof
Claim: after the unchanged three-rung parked recovery ladder genuinely exhausts, the real local Worker and Durable Object expose eligible parked rows through signed operator inventory; reconciliation resolves a terminal ordinary target and re-enqueues an open ordinary target as fresh pending work, while a real command-context target remains flagged and unchanged and both mutation routes refuse it.
Exercised surface: real
wrangler dev --localWorker,ExactReviewQueueDurable Object, signed enqueue/operator HTTP routes, persisted 5/10/20-minute recovery alarms with production jitter, built dead-letter operator CLI, Worker restart against the same disposable persistence, and a loopback GitHub behavioral stub.Scenario and environment: two ordinary issues and one realistic legacy command review enter through the signed Worker route. The command uses the pull-request/legacy-dispatch event shape with a command status marker, status comment id, and additional prompt. The GitHub stub returns the production-classified single-field HTTP 422 rejection until all three rows exhaust. Reconciliation then skips the flagged command row before inspection; direct signed resolve and fresh-recover requests also return one skipped mutation.
Local proof:
bash docs/proof/parked-review-reconcile/run-proof.shon the uncommitted final patch over0ded7ef34b7a62ee51daf67190ed4e0a68b9163bcompleted at2026-08-11T00:00:34.302Zwith all assertions true.PROOF_RC=0Fresh-PR container proof: pushed head
2f2d4fc8d5ec0b2a628f227c8c6c7bf228d3cf8d, Crabbox--fresh-pr openclaw/clawsweeper#1111,provider=local-container, leasecbx_3d30da7d1f76, image/typenode:24-bookworm. Corepack and checksum-verified jq 1.8.1 were installed into$HOME/.local/bin. The proof completed at2026-08-11T00:46:59.402Z.PROOF_RC=0Crabbox reported
exitCode=0,runStatus=succeeded, andleaseStopped=trueafter 44m34.718s of command time (44m45.231s end-to-end).Observable result: all three rows reached
parked_recovery_attempts: 3; inventory flagged the command row withexcluded_reason: "command_context"; the operator inspected only the two ordinary targets, resolved one terminal row, recovered one open row to pending, and counted the command row as skipped. Direct resolve and fresh-recover requests both refused the command row, which remained parked and unchanged.Artifact/trace: each harness run generated the exhaustion inventory, operator inventory, final inventory, command mutation refusal responses, proof summary, Worker/stub logs, and reconciliation transcript under its disposable checkout. The container summary binds the proof to source SHA
2f2d4fc8d5ec0b2a628f227c8c6c7bf228d3cf8d.Limits: GitHub was a loopback behavioral stub. No production GitHub repository, Worker, secret, comment, workflow, or queue was contacted or mutated. The proof covers the real Worker/DO state machine, signing, alarms, operator process, and persistence boundary, not GitHub's hosted implementation. It covers the initial command-review dispatch-rejection route, not the separate terminal-finalization acknowledgement retry path.
Validation
pnpm run build:all— passpnpm run test:no-build— pass: 3,291 tests; 3,282 passed, 0 failed, 9 skippedpnpm run lint— passpnpm run format:check— passpnpm run check:dashboard-queue-boundary— passpnpm run check:active-surface— passpnpm run check:limits— passpnpm run check— passorigin/main— clean, no accepted/actionable findingsOpenClaw Bay
OpenClaw Bay is unaffected. It remains public and observer-only and gains no recovery, DLQ, queue, workflow, GitHub, deploy, or rollback action.