Repository navigation
fix: keep completed manual reviews publishable after publisher failures - #1477
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 7, 2026, 2:47 PM ET / 18:47 UTC. ClawSweeper reviewWhat this changesThe PR queues selected manual reviews independently, preserves comment-and-record-only publication through retries, and connects publication completion to the correct review journey in Bay. Merge readiness⛔ Blocked before merge - 2 items remain The PR remains useful: current main lacks the guarded manual-publication path. Prior findings are addressed, the supplied runtime evidence supports the changed behavior, and no new blocking defect was found. The documented default-off rollout is an intentional boundary, not a request to activate production. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper turns GitHub review requests into durable queue work, then publishes review comments and canonical records. Publication receipts also feed lifecycle diagnostics and Bay’s observer-only status display. flowchart TD
A[Manual item selection] --> B{Admission enabled}
B -->|No| C[Refuse before review]
B -->|Yes| D[Durable review queue]
D --> E[Completed review bundle]
E --> F{Current publication owner}
F -->|Valid| G[Comment and canonical record]
G --> H[Lifecycle audit and Bay]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain scoped, owner-validated publication retries and activate admission only through the documented compatible-consumer rollout, preserving restrictions during rollback. Do we have a high-confidence way to reproduce the issue? Yes, at the source-path level: current main leaves explicit manual selections on the prior publication route, and the supplied controlled runtime evidence exercises publication interruption and recovery. A failing current-main execution was not run during this review. Is this the best way to solve the issue? Yes. Reusing the durable queue with persistent publication restrictions and current-owner checks addresses the failure without rerunning successful reviews; the documented staged rollout covers the intentional compatibility trade-off. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f633c1e10228. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Bind manual review publication to per-item durable queue ownership and preserve record/comment-only policy through retries and report consumers. Add source, lease, cache, and receipt guards with controlled runtime proof and regression coverage. Keep admission disabled for coordinated rollout.
Publish from the existing selected report bundle without importing producer diagnostics or widening sibling guards. Preserve operator-selected branches and exercise both workflow integrations in controlled proof. Keep the default-off rollout and compatible-consumer rollback boundary explicit.
Preserve sanitized coordinator transport failures through direct and apply-child publication, using existing state-contention retry budgets without GitHub inline retries or weakened ownership checks. Cover authorization rejection and temporary outages in focused tests and controlled runtime proof.
Keep the operator-selected branch when ordinary events coalesce while accepting fresh source facts and explicit changes from new manual requests. Exercise real dispatch backoff and preserve the guarded lease-cleanup assertion during authority outages.
45f99a7 to
027ed89
Compare
|
@clawsweeper re-review The final-head runtime proof, green CI, finding dispositions, and default-off landing/rollout boundary are current in the main PR body. Please review the current head and body; no production activation is requested. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Explicit manual reviews could finish successfully but lose publication when a shared batch publisher failed on an unrelated item. Rerunning that publisher also exceeded the scope of a request to finish one PR.
The motivating incident was OpenClaw PR 138814 in run 33944620270. That PR subsequently merged on a newer head. This change does not recover its historical report, rerun its batch, or mutate historical targets.
Why This Change Was Made
Explicit manual selections enter the existing durable exact-review queue before review, retaining
record_comment_onlypolicy through retries and canonical consumers. Publication requires the current producer lease/run/attempt or active batch owner/member, exact source provenance, and real comment acknowledgement. Uploaded reports, progress comments, and imported old records cannot replace completed receipts. Missing/ambiguous policy and stale ownership fail closed; retained receipts never refresh authority.The separately owner-approved lifecycle link stores only immutable producer fence/revision/claim-generation in existing projection JSON. Producer and publication counters are independent: producer revision 2 can complete through publication revision 1. Audit and Bay now share one resolver, while physical receipts and terminal telemetry remain on the publication fence. Matching is exact to revision and current claim generation; unrelated retained generations are not competing claims, and missing/conflicting lineage cannot complete a later journey. Canonical producer identity identifies its own row without guessing a legacy publication link from a key suffix. There are no new SQL tables/columns, receipt or lease renumbering, legacy adoption, or authority bypasses.
User Impact
After coordinated rollout, a completed selected review can retry publication without another review or unrelated batch effects. Explicit branch selection, requested timeout, and one-off instructions survive both admission and ordinary-event coalescing. Manual timeout resolution honors the request up to the unchanged 45-minute exact-review cap; nonmanual adaptive behavior is unchanged. Direct publication reads the existing selected-report bundle; imports, snapshots, and early refusal output stay within the chosen workspace. Producer diagnostics and bundles remain immutable. Restricted reports cannot later trigger labels, closes, promotion, routing, repair, or implementation automation; oversized restricted comments refuse automation-marker fallbacks.
Admission remains disabled by default. Landing does not authorize enabling
EXACT_REVIEW_MANUAL_PUBLICATION_ENABLED, manual deployment, release, or live limit changes. Deploy compatible queue/publisher/consumer code and let older policy-unaware jobs finish naturally before separately approving activation. Never pause the live sweep for this rollout. Restricted records outlive queue completion, so keep compatible consumers during rollback; reverting to policy-unaware consumers is unsafe.OpenClaw Bay Impact
Bay's data projection changes, but its public fields and UI controls do not. The authenticated lifecycle audit and public
/api/durable-lifecycle-baynow resolve the correct producer journey. The private lineage is never serialized publicly. Physical publication completion owns its one terminal telemetry event; deriving a producer card does not create another event. Bay remains public, observer-only, and unable to drive recovery or GitHub mutations. The proof exercises its public endpoint, not browser UI behavior.Documentation Impact
Updated scheduler, publication operations, state storage, review-comment, action-ledger, and live-dashboard contracts.
docs/proof/manual-review-publication/README.mdis now a concise active recipe instead of a collection of obsolete execution receipts. Queue/publication maintainers own these contracts; admission, policy, lineage, retry, ownership, and consumer changes are update triggers. The maintainer-authored changelog records the user-visible fixes.Finding Disposition and Scope
The latest prior ClawSweeper finding and Rank-up move are addressed: temporary authority-service failures, including child-process failures, retain sanitized
retryable_failure/state_contention, not GitHub throttle metadata or the shorter unknown-failure budget. Ownership/authentication rejection stays hard. Runtime outage cases cover initial authority validation, apply entry, mutation, and batch preparation with zero comment writes. A second authority read on mutation failure is existing guarded cleanup, not an inline retry. Existing retry budgets are unchanged. Selected-bundle and manual-branch findings from the earlier review are also fixed and exercised.Full-branch independent review also found the old per-dispatch timeout was lost at queue admission. That is fixed, together with the one-off instructions lost at the same handoff. Red regressions reproduced missing fields, coalescing overwrite, and wrong effective timeout. The actual admission and event-payload shell steps now exercise a 40-minute request and multiline instructions, with shorter requests and the unchanged maximum covered by executable workflow tests.
CI run 34146375828 exposed two obsolete timeout-expression assertions and a Bay test still expecting the removed maximum-revision query. Those expectations are corrected, with executable timeout cases retained. Inspecting the actual Bay query plan additionally exposed temporary projection sorting: a derived read index over existing repository/target/fence/revision fields now supports ordered streaming. Tests inspect the actual scoped and unscoped query plans, forbid temporary projection sorting and unrelated scans, and retain the 10,001-row history/read-only checks. The older v2 index remains for readers that explicitly select it during rollback; no stored record, table, column, receipt, or lease changes were needed. All 227 affected tests pass.
The CodeQL fixture error-response finding remains fixed with explicit JSON content type and
nosniff. Independent review additionally caught cross-generation publication ambiguity in the new resolver; a red regression reproduced the false pending state, and exact-generation lookup now passes both old-generation isolation and same-tuple conflict refusal.Production cleanup reuses the canonical payload builder, retains policy validation in its owning parser, removes an unreachable empty-tuple branch, and classifies failure reason once. It removes 18 existing production lines without golfing or dropping guards. The approved lineage repair necessarily adds code; the total PR delta is reported below rather than claiming an overall reduction.
Landing disposition: retain the documented fail-closed, default-off design for this requested landing, including the temporary interruption of explicit workflow-dispatch reviews. Compatible publishers and consumers must be in place before activation and remain in place throughout rollback. This is a code-landing decision, not authorization to enable admission or manually deploy; activation stays a separate operator-controlled action.
Evidence
0acff58cc5ed04fcc8a21f211164639c89871d4d; pinned integration base:330b8ee4e32dccf73f99b2d3e92203dbf70523c8.e7d8558c26955eaa5630f5668564b53d8bdc14347f08fde7a724be22d2a6ca9c, independently matched between the host and self-contained clean checkout, covering source, workflows/configuration, and compiler inputs.pnpm checkgate, sparse repair builds, and Windows launcher. CodeQL, both containment-smoke samples, and production automerge E2E are also green on this head.PS1warning obscured that diagnostic. After an explicit frozen install, a task-local wrapper disabled only implicit pre-run installation, and the maintenance test passed. The next full run hit an intermittent Telegram loopback fixture JSON/180-second timeout; that unchanged fixture passed its focused rerun in 51.94 seconds and passed in the successful exact-head CI. These supplemental runs are retained as failures, not claimed as green full gates. Both separate 13-test changed-coverage gates passed. Host runs also encountered Homebrew Bash's pipe-backed heredoc stall; no fixture credential allowlist was broadened.scripts/e2e/. The pre-cleanup integrated baseline was +848; the cleanup removes 18 lines, while the necessary lineage, indexed-reader, and option-preservation fixes add 128.Failures retained: the earlier combined runtime proof correctly failed on producer-2/publication-1 lifecycle linkage; the assertion was preserved and strengthened, not bypassed. Cross-generation and manual-option regressions were reproduced red before correction. The first indexed-reader runtime attempt stopped at an HTTP 503 during batch lease reclamation, before its Bay check; that failed run was retained. An unchanged-source retry in a fresh container passed the complete runtime scenarios below, then hit the separately reported full-gate environment failure. Historical proof at older heads is not substituted for these bytes.
Real Behavior Proof
Claim/surface: the actual built CLI, local Wrangler Worker, Durable Objects/SQLite, and R2 complete scoped publication after interruption without rerunning successful review work, admitting stale owners, touching siblings, or enabling downstream automation. Lifecycle audit and the public Bay endpoint report the exact current producer journey; a later producer stays pending until its own publication.
Environment: approved
local-containerprovider, leasecbx_0ad74d5fd061, imagenode@sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2; Node 24.20.0, pnpm 11.10.0, Wrangler 4.107.0, checksum-verified stock GitHub CLI 2.98.0, jq/tmux, four-CPU affinity. Fresh isolated HOME/state, no inherited application credentials, and synthetic provider endpoints behind loopback transport. This is not AWS or Testbox proof. Local-container runs have no hosted run URL.Executed entrypoint, with
MANUAL_PUBLICATION_*identifying the installed tools and actual lease/image/output directory:Observed runtime result: the runtime phase of
run_04368aa74cefexited 0. Its subsequent full-check phase hit the environment failure above, so the combined run exited 1, not zero. All seven explicit synthetic requests invoked review exactly once. Direct and batch publication, real lease expiry/replacement refusal, source/head drift, unknown acknowledgement recovery, artifact exhaustion without a fresh review, and repeated independently requested review passed. Stale-owner writes remained 14 → 14. All four authority-outage cases producedretryable_failure/state_contentionwith zero comment writes; only mutation-failure cleanup made the documented second guarded authority read. Forbidden requests and sibling requests were 0. Seven selected bundles and producer diagnostic inventories remained unchanged.Actual workflow admission and event-payload resolution preserved
release/proof, the requested 2,400,000ms timeout, and identical one-off instructions (SHA-256471c22bb862679f6128d45493758298a796037bf7f2f4b8fda152467e58f82f1) for synthetic items 71 and 72. Item 71 retained those options while an ordinary event refreshed source facts and advanced its producer to revision 2. The signed lifecycle audit and public Bay endpoint both showed that current journey completed through its publication; a later producer remained pending until its own publication. Synthetic PR 76 received comment 104 and canonical acceptance with original review time and exact fixture head/source. Runtime temporary state and Worker processes were removed. Supplemental validation evidence was collected, and the owned container was deleted.Artifact/trace: the source-controlled reproduction driver is
scripts/e2e/manual-review-publication.mjs. Retained local evidence is under.artifacts/deslop/indexed-runtime-retry/:summary.json,result.json,proof.json,trace.json,commands.json,manual-target-71.txt,manual-target-72.txt,current-head-pr-completion.json, runtime logs, and cleanup records. Supplemental full-gate and focused-rerun logs are retained under.artifacts/deslop/final-full-gate/and.artifacts/deslop/telegram-fixture-rerun/. The compact receipt below is copied from observed runtime results, not seeded fixture state:{ "head": "0acff58cc5ed04fcc8a21f211164639c89871d4d", "sourceSha256": "e7d8558c26955eaa5630f5668564b53d8bdc14347f08fde7a724be22d2a6ca9c", "run": "run_04368aa74cef", "runtimeExitCode": 0, "combinedRunExitCode": 1, "forbiddenRequests": 0, "siblingRequests": 0, "stalePublisherExit": 1, "staleWritesBefore": 14, "staleWritesAfter": 14, "requestReviewCounts": {"1071": 1, "1072": 1, "1073": 1, "1074": 1, "1075": 1, "1076": 1, "3072": 1}, "completedCurrentJourneys": [{"number": 71, "revision": 2}, {"number": 76, "revision": 1}, {"number": 72, "revision": 1}], "manualTimeoutMs": 2400000, "preservedProducerBundles": 7, "syntheticPrCanonicalAccepted": true, "cleanup": {"temporaryStateRemoved": true, "workerStopped": true, "ownedContainerDeleted": true} }Limits: GitHub/Actions HTTP responses and review text are synthetic; queue ownership, CLI execution, publication logic, and local Worker storage are real. This does not prove production GitHub permissions/throttling, Actions scheduling or artifact provenance, model quality, production Cloudflare durability, or browser UI behavior. GitHub comment acceptance and canonical publication remain separate services, not an atomic transaction. No historical batch or foreign target was mutated and no production admission setting changed.