Repository navigation
refactor: deepen review comment ownership - #1906
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 replaces review-comment state, publication, and lease factories with direct imports while preserving existing comment and CLI behavior. Example: Two workers contend for review leases with GitHub comment IDs 100 and 200.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this PR open: it completes a useful ownership cleanup absent from current main, and inspection found no actionable regression. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherReview and apply commands feed item revisions and comment bodies into the comment subsystem, which coordinates leases, verifies GitHub write receipts, and returns publication metadata. flowchart TD
A[Review and apply commands] --> B[Comment workflow]
B --> C[Lease owner]
B --> D[Publication owner]
C --> E[Comment state and trust checks]
D --> E
C --> F[GitHub execution]
D --> F
Technical reviewBest possible solution: Complete the direct-import cutover while retaining fresh revision reads, exact trusted receipts, and the existing label mutation owner. Do we have a high-confidence way to reproduce the issue? This is a refactor with no reported behavioral defect to reproduce; source inspection verifies the existing factory composition on main. Is this the best way to solve the issue? Direct imports remove duplicate composition while preserving the necessary live-read seam and shared mutation owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0fc6d572bc2a. 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 10, 2026, 12:03 PM ET / 16:03 UTC (Revision 3). |
|
@clawsweeper re-review |
99a7697 to
b41e576
Compare
|
🦞👀 Re-review progress:
|
b41e576 to
0fec6ab
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Current main-based head
Current head:
0fec6ab9a02dff84efc3be4bdcde8b1802ff8a5b. Rebased directly ontoorigin/mainat0fc6d572bc(the squash merge of #1905), usinggit rebase --onto origin/main 271e40eec00ed12dc45ee5e91a3ac3a45b84de74. The rebase applied cleanly, carries only this slice's one commit, and adds no adapters.Current-head validation and real behavior proof
Pueue 1723,
bash handoffs/clawsweeper-row3/rebase-main-1906-1907.sh, completed successfully; full output inspected withpueue log 1723 --full:pnpm run build:allfor the immutable baseline and this exact candidate head.pnpm run lintandpnpm run format:checkpassed.slice5-proof/passed 10/10 identical before/after cases, unchanged fixtures and assertions, against immutable baseline75d3a7d2a2339171d31ec1f158e9399f673091b7.Current build manifests, raw outputs, request traces and comparison summary:
handoffs/clawsweeper-row3/rebase-main-1906-proof/. The claim, exercised CLI scenarios, normalization and limits are the same as the original proof below; this replay supersedes its candidate SHA. Native macOS arm64 / Node 24.21.0, controlled executable gh / filesystem fixtures (plus loopback HTTP for the comment proof), no live GitHub/Worker mutation. No merge or deployment.What Problem This Solves
Row 3, slice 5: review-comment ownership currently depends on copies of policy, formatting, state, publication, and lease functions passed through several factories.
Based directly on
main; predecessor #1905 is already squash-merged.User Impact
No intended CLI, comment-byte, schema, or stored-format change. Fresh revision checks, lease election/cleanup, trusted publication receipts, and the existing apply label-batch owner remain intact.
Why This Change Was Made
createReviewCommentState,createReviewCommentPublication,createReviewCommentLeases, and the comment dependency contract. Their production operations use ordinary imports.readLiveReviewRevision: (item: Item) => string. Lease confirmation still performs the fresh read; it does not substitute the caller's snapshot. Slice 7 removes this adapter after context ownership moves.Diff against the stack base: 2,246 added / 2,582 removed = 336 net lines removed.
git diff -w --stat: 727 added / 1,063 removed, 1,790 changed lines across 12 files. This keeps the complete comment cutover and its behavior-fixture migration together.OpenClaw Bay Impact
None. This changes internal composition, not Bay data, publication schema, status, or display behavior.
Documentation Impact
Reviewed
docs/pr-review-comments.md: its durable receipt, fresh revision, and lease-election contract is unchanged. Added the changelog fragment and updated the Row-3 handoff plan. Nodocs/proof/**edits. The only forced executable proof migration isscripts/e2e/headless-command-lease.mjs: import the production lease selector directly instead of constructing a fake lease module; its assertions are unchanged.Original Behavior Proof (historical; current-head replay above)
Claim: the shipped CLI performs the same lease exchange and durable comment publication before and after the ownership cutover.
Environment: native macOS arm64, Node 24.21.0; freshly built CLI copied into isolated roots, executable gh fixture, real payload files, fixed clock/run identity, and a loopback HTTP queue-authority endpoint. No live GitHub/Worker mutation.
Before:
75d3a7d2a2339171d31ec1f158e9399f673091b7(the same runtime as the repaired stack base; the later base change migrates onlytest/context.test.ts). After:99a7697ad9c904323fc141d8114c5e705354573e.Pueue 1694 passed 10/10 identical before/after comparisons:
reserve-review-leaselive-proof-comment --detachCompared exit status, CLI output, ordered gh/HTTP calls, raw payload bytes and final comment state. Only random payload filenames are normalized. The drift case requires the fresh revision reread before supersession cleanup. Receipts, raw outputs, build manifests and fixtures are retained in
handoffs/clawsweeper-row3/slice5-proof/comparison-3/.Limits: controlled process/filesystem/HTTP proof, not production permissions, Codex generation, issue hydration, apply/close behavior or real distributed races. Report loading/retention is untouched; the corpus-memory gate is not triggered.
Original Evidence (historical)
codex review --base origin/mainon the committed head found no actionable regressions. Model-catalog refresh warnings did not prevent completion.