Repository navigation
refactor: remove source revision and close policy factories - #1894
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 source-revision and close-policy factories with direct imports and requires an explicit repository for close validation. Example: Validate an implemented-on-main close for a PR in openclaw/clawsweeper.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it provides a coherent refactor absent from current main, and inspection found no actionable correctness defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGitHub item context enters source-identity hashing and close-policy validation; their digests and eligibility results feed review publication and guarded apply operations. flowchart TD
A[GitHub item context] --> B[Source revision functions]
B --> C[Review report]
C --> D[Close policy validation]
D --> E[Apply freshness and lease guards]
E --> F[GitHub publication and closure]
Technical reviewBest possible solution: Retain the direct-import cutover with explicit repository identity and unchanged digest, provenance, and protected-label behavior. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a bug report; source inspection confirms the factories remain on current main, and no target code was executed. Is this the best way to solve the issue? Direct imports are appropriate for these fixed production helpers, and inspected callers already supply repository identity without needing the removed fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9dc7f06f6fa5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Review metrics
LabelsLabel 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 Reviewed October 10, 2026, 9:21 AM ET / 13:21 UTC. |
Summary
createSourceRevisionToolsandcreateCloseDecisionWorkflow; import their production operations directly instead of constructing policy dependency bags.ForTestwrappers and migrate all test/proof-script callers.Row 3 slice 3a (source revisions + close policy), independently based on
origin/main. Slice 3b removes PR-reference and comment identity/automation factories in a separate PR. Net 111 lines removed (756 added / 867 removed); 1,623 changed lines, retaining the coherent source/close cutover under the campaign's approximately-1.5k guidance.pr-behavior-proof
Claim: source-bound apply still accepts an owned completed review lease, rejects changed issue source, and rechecks exact-publication state after batched labels and immediately before closure; rendered close decisions retain repository-specific and protected-label safety.
Surface and fixtures: built
apply-decisionsentry point, temporary report trees, executable mockghtransport, and real report/marker rendering and parsing. No production GitHub writes.Commands/environment: Node 24.21.0; pnpm; checks queued through pueue.
build:all; 128 focused tests across review-close-policy, close-reasons, review-content-cache, review-comment-noise, scheduled-review-noop, and apply-close-decision; three selected apply-label-sync scenarios (exact issue apply accepts,exact publication rechecks after batched labels,issue apply rejects a stable live source revision).Observed: 128/128 focused tests and 3/3 entry-point scenarios passed. The compiled apply scenario synced the durable review and completed the permitted close; the changed-source scenario remained open without closing. Source/cache tests retain full-body sensitivity, bot-only stability, human-activity sensitivity, and canonical revision parity. Close-policy rendering retains ClawHub/ClawSweeper provenance checks, protected labels, and deterministic close comments.
Supporting checks:
build:all,lint, andformat:checkpassed. Codex review againstorigin/mainreported no actionable defects on committed headb59da07828c7e14ed976d8b87153a924d5883d39. Its earlier findings (read-only bot-set contracts, moved githubCount type reference, and two proof-script imports) are all fixed. Logs: pueue 1466 (build + focused/entry-point proof), 1479 (lint passed; formatting-only issue then fixed), 1480 (format passed), 1467 (repaired review), 1481 (committed-head review, no actionable defects).Limits: controlled local CLI/transport and rendered/parsed behavior, not deployed Worker auth, production GitHub mutation, or a live review. No full suite. OpenClaw Bay is unaffected: no published status shape, telemetry, dashboard reader, stored schema, or UI change.
docs/proofremains untouched.Do not merge as part of this cleanup task.