Repository navigation
feat(review): prepare queue lease identity cutover - #1939
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds queue-based review identity readers and publication fences while retaining existing comment leases and review writers. Example: Publish a queue-format review for openclaw/openclaw item 74 from run 1074, attempt 1.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the staged queue-identity preparation is useful, preserves legacy publication safeguards, and has no actionable finding. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe exact-review queue coordinates review producers and publishers; report readers carry producer identity into durable comments, and apply guards validate ownership, source freshness, and activity before GitHub effects. flowchart LR
A[Review producer] --> B[Exact review queue]
A --> C[Review report]
B --> D[Publication authority]
C --> E[Apply CLI]
D --> E
E --> F[GitHub effects]
Technical reviewBest possible solution: Land the dual-reader preparation, then perform the separately scoped writer cutover after compatible publishers are deployed. Do we have a high-confidence way to reproduce the issue? Current main source shows the public lease POST path; the supplied current-head CLI receipt demonstrates queue-format publication without those POSTs. Is this the best way to solve the issue? Deploying dual readers before changing writers preserves legacy compatibility and extends the existing publication authority without introducing a competing lock owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a2ba29f3aedb. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 11, 2026, 10:20 PM ET / October 12, 2026, 02:20 UTC (Revision 3). |
Result
Add dual lease-identity readers and publication fences before the public review-lease cutover. This is stage 1. Current review writers and contributor-visible status do not change. Stage 2 will remove the per-review public lease comment after these readers are deployed.
Problem
An automatic review creates a public “review started” lease comment and later removes it. The POST notifies subscribers. Both writes move item activity and need a released-lease freshness receipt. The reported example is openclaw/openclaw#132955 (comment).
The comment ID also orders same-source review generations. It is not only a mutex ID. Reusing an acknowledgement ID, setting the ID to zero, or putting a queue revision in
lease_comment_idwould lose that ordering check.Approved design and rollout
review_queue_*fields. Durable review-version markers usev=2,lease_kind=queueandqueue_*attributes. Queue reports keep a nonemptyreview_lease_ownerand omitreview_lease_comment_id; old exact-event readers therefore reject them as incomplete, not as tuple-less backlog.queueIdentity. Batch publication returns the review producer tuple, not the batch publisher tuple. Existing response fields and stored rows do not change.Deploy these readers first. Before stage 2, drain old non-queue writers and ensure all hosted publishers obtain queue authority. Hosted non-queue writers must then fail closed. Keep dual readers during rollback while queue-format reports remain. Do not delete another run's lease to force cutover. No database schema or storage migration is needed. No production deployment or stored-row mutation was done here.
Editing an acknowledgement alone is not a lock: the lowest-ID election needs distinct comment IDs. GitHub documents that comment creation triggers notifications (https://docs.github.com/en/rest/issues/comments#create-an-issue-comment). Its edit documentation does not establish a general notification-free guarantee. This design does not depend on one.
Reader and writer map
clawsweeper-review-comment-leases.tsreviewStartLeaseOwnerparses the owner. Queue heartbeat rejects stale owners before public work.clawsweeper-command-operations.ts,sweep.ymlclawsweeper-review-command-workflow.ts, review preparation/lease helpers/claimrejects another run and mismatched/expired lease ID or revision, then rechecks after admission. Heartbeat checks item, lease, revision, generation, run, attempt and source head. Completion and publication retain separate fences.What contributors see
Stage 2 must prove the reaction and PR acknowledgement progress write with the lease comment absent. That visible cutover is not claimed by this reader-only PR.
Real-behavior proof
Frozen head:
fc2005a658870e2ce4ef49b617ad30b397f4f70d; the runtime receipt reportsdirty: false. The candidate was formatted once before verification; the recorded proof-change patch hash ise448c09687c2dbbcf1850ecd31eb4ca0b9992ebeb1ae545fb5763050cb18f673. Verification does not rewrite source.Surface: the shipped
apply-decisionsCLI, including its real GitHub retry path, plus the Durable Object implementation with repository SQLite test storage. The successful fixture starts with a valid version-only legacy manual review and a queue-format close proposal. External GitHub/model processes are controlled services; no product function is replaced in the CLI path.Command/environment: Crabbox 0.74.0, Docker-backed
local-container,node:24-bookworm, 4 CPUs, Node v24.21.0. Runscripts/e2e/queue-review-proof.sh /inputs/latest-stable.tarthroughcrabbox run --provider local-container --local-container-image node:24-bookworm --local-container-cpus 4 --no-hydrate --timing-json, with the pinned v0.3.0 git archive mounted read-only at/inputs/latest-stable.tarand artifact downloads enabled. Current dependencies use pnpm 12.4.1; stable dependencies use pinned pnpm 10.33.2 and its frozen lockfile.Image:
sha256:3d27e5c11e5786e309ec3e03f93ae536eb36e6e5eb3714d5eb3300a36157add0.Lease/run:
cbx_30a5d10cf053/run_ab2ec1248604105726eb48701ddc36d1.closed; zero public lease POSTsresult.json,apply-requests.jsonlnegative_apply_cases.competing-run,queue-requests.jsonnegative_apply_cases.stale-generation,queue-requests.jsonnegative_apply_cases.retry-revocation,retry-trace.jsonresult.jsonresult.json,apply-requests.jsonlresult.jsonupgrade-result.json, identical original/final manifestsCompact final-effect observations:
{"head":"fc2005a658870e2ce4ef49b617ad30b397f4f70d","dirty":false,"successful_apply":"closed","lease_posts":0,"competing_run":{"exit":1,"requests":0,"effects":0,"fence":409},"stale_generation":{"exit":1,"requests":0,"effects":0,"fence":409},"retry_revocation":{"exit":1,"requests":1,"first_request_status":503,"effects":0,"last_fence":409}}The retained, redacted artifacts are under
.artifacts/quiet-review-stage1-boundaries/. SHA-256: result0510d8ece9e0eeda185b7edf618412ef35b74802333bc17283d949b979388724; queue trace0dd319bc520a24795c229e2305db1f4dddae1cc7d3efec2b7dd760b7f66d30a1; retry trace2fed222b8c14b2cecb472ba058a2a822a000ba1ec39ced54f0f471a760bdedb9; upgrade resultb4f137b4a79c5cecb4a537418db60bb6f4bf3c2b33c12ed5e1107b4617014299. The original and final storage manifests both hash toe67b5cc9bbcb1983a2f5b802a4a655163b99477f2db8c13812d7f3531aa59b28.Stable-data compatibility boundary
Latest stable is v0.3.0, commit
a3469c99f6a8362d57771f750262f6f9c798d649; archive SHA-2563920599d1230004ac8e89780edfc2a9fb86d63c199a18be7be36104b1b65da82. That release predates both typedreview_recorddata and causal v1 version/state markers. It cannot honestly generate a v1 causal marker.The actual stable report, durable comment JSON and durable body remain byte-identical after the current reader and read-only apply. Current apply reports
review_record: missing record; fresh review required, rather than rewriting or applying unverified old data. This restriction already exists on the unchanged base insrc/review-record.tsandsrc/clawsweeper-apply-close-decision.ts; this PR does not add a historical schema migration. Modern stored v1 causal markers are separately exercised by the successful legacy-manual-to-queue CLI case.The symlinked macOS temporary-directory case also passed with
TMPDIR=/tmpafter the scratch path was canonicalized. Only that affected native upgrade validation was rerun for the path repair.Limits: controlled services are not live GitHub, production authentication, model quality or hosted-workflow proof. Reaction/progress write steps are deliberately not changed or claimed in stage 1. No live target item or Worker was changed. Bay's data contract is unchanged.
Validation and review disposition
pnpm run check:fast: passed.trash dist && pnpm run build:all, the lead-requested isolated ETag run passed 27/27. No ETag code was changed. A loaded combined authority run also hit a process-start timeout; the isolated file passed. These local results are not presented as a green full-suite run; required CI was green on the prior implementation head and runs again for this proof-only commit.