Repository navigation
refactor: replace PR reference and comment policy factories - #1895
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 PR-reference and comment-policy factories with direct imports and explicit repository arguments. Example: Parse openclaw/clawhub#400 while reviewing openclaw/openclaw.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR provides a focused factory-removal refactor absent from current main, with no actionable correctness or security findings. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherRepository-scoped references and saved review records enter these modules, which produce coverage inputs, durable comment markers, and stale-review label updates for the publication workflow. flowchart LR
A[Saved review and GitHub context] --> B[Reference and identity functions]
B --> C[Coverage and promotion]
B --> D[Comment rendering and state]
D --> E[Publication workflow]
E --> F[GitHub comments and labels]
Technical reviewBest possible solution: Retain the direct-import refactor while preserving the existing repository, identity, publication, and label-mutation contracts. Do we have a high-confidence way to reproduce the issue? This PR claims behavior preservation rather than fixing a reported runtime bug; no target code was executed during this read-only review. Is this the best way to solve the issue? Direct imports provide a narrower ownership structure, and inspected consumers supply the former production dependency or explicit repository argument. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 62a58f973bae. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 9:42 AM ET / 13:42 UTC (Revision 2). |
3b385b7 to
5a28605
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Summary
createPullRequestReferenceParser,createReviewCommentIdentity, andcreateReviewCommentAutomation; use ordinary imports for the existing production policy/parsing/rendering operations.This completes Row 3 slice 3b (PR references + comment identity/automation), rebased onto
a46cadd7e21d25afa6ad8e6d006cceb853575e46after #1894 merged. Conflict resolution preserves the directgithubCountexport, preserves the removal of thegithubContext.githubCountreturn property, and completes the identity-factory removal without adapters or duplicate helpers.Net 48 lines removed (563 added / 611 removed across 17 files). Head:
5a28605337e710c11a578fa05b7d899134a90e9f.No repository paths/links/context implementation, decision-packet reader, repair/dashboard report reader, stored schema, or frozen
docs/proofchange. The two promotion/coverage files receive only direct-import/callsite changes, coordinated with the reader owner.pr-behavior-proof
Claim: rendered automation/version markers still round-trip through the durable parser with identical trust/identity rules; stale-head publication still removes only owned stale labels and preserves the durable review flow; duplicate-close reference handling never promotes foreign Markdown link labels to same-repository PR authority.
Surface and fixture: production report/comment renderers and durable parsers, plus built
apply-decisionsusing temporary report trees and executable mock-GitHub transport. Existing publication tests exercise real filesystem payloads and observable publication receipts. New repository-order regression parses the same input for OpenClaw, ClawHub, then OpenClaw and verifies there is no retained selection.Environment and commands: Node 24.21.0, pnpm; all checks through pueue task 1522 on the rebased head.
pnpm run build:all;node --test test/review-comment-publication.test.ts test/review-comment-rendering.test.ts test/pr-proof-automation.test.ts test/apply-pr-duplicate-ref-proof.test.ts; selectedapply-label-sync.test.tsscenarioscloseout receipts ignore spoofed markers after posting the owned receiptandapply-decisions clears stale PR review labels when live head changed;pnpm run lint;pnpm run format:check.Observed on the rebased head: build:all passed; all 105 focused tests and both selected receipt/stale-head apply scenarios passed; lint and format:check passed. The real compiled apply path synchronized the stale review without closing the item; the foreign-reference scenario remained open and did not request coverage proof. The stale-head fixture reports unavailable check-runs from its intentionally limited mock transport while still completing its expected comment-only synchronization.
Artifacts:
pueue log 1522 --fullcontains the complete successful rebased-head run (exit 0). Historical pre-rebase evidence: pueue 1482, 1484, 1486; Codex reviews 1487 and 1495 found no actionable defects on the previous head. The prior unusedrepoUrlForfinding is fixed; those historical reviews are not asserted as reviews of the rebased head.Limits: local controlled transport and public rendered/parsed behavior, not a deployed Worker or production GitHub mutation. No full suite. OpenClaw Bay is unaffected: no telemetry shape, status feed, record format, dashboard reader, or UI changes.
Do not merge as part of this cleanup task.