Repository navigation
refactor: keep private core operations with their consumers - #178465
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR moves private operations into their existing consumers and relocates meaningful tests to those owning boundaries. Example: Install an npm hook pack with --pin when it resolves to @acme/[email protected].
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open. The ownership cleanup is coherent, with no definite introduced defect found; GitHub still reports a merge conflict and an unattributed maintenance-test failure. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherAgent preparation, plugin installation, status reporting, backup recording, and icon delivery consume admitted configuration and owner-held runtime facts, then produce requests, persisted outcomes, or user-facing output. flowchart TD
A[CLI and Gateway requests] --> B[Existing consumer]
C[Configuration and runtime facts] --> B
B --> D[Private operation kept locally]
D --> E[Existing transport or state owner]
E --> F[Output and recorded outcome]
Technical reviewBest possible solution: Retain the consumer-owned implementation while preserving the existing contracts during conflict resolution. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor, so no product-bug reproduction applies; source comparison and supplied validation were assessed without running target code. Is this the best way to solve the issue? Moving one-consumer operations into existing owners is proportionate, and the reviewed cutover removes the replaced paths without adding competing state or public APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e4ac046c6446. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -272, Tests +269, Other -2. Total -5 across 48 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 20, 2026, 10:31 AM ET / 14:31 UTC. |
b60e027 to
3fe984c
Compare
|
Merged via squash.
|
What Problem This Solves
Several internal core APIs have one production consumer, but keep separate parameter/result frames, leaf modules, and helper-only tests. That makes ownership harder to follow without providing a reusable or public boundary.
User Impact
No user-visible change, migration, or required action. Public SDK/config/protocol contracts, authority checks, lazy-import boundaries, error handling, and output stay unchanged.
Why This Change Was Made
Move each private operation into its existing consumer across agent preparation, model catalog/image preparation, status, queue settings, ports, ClawHub icons/catalog, plugin-install commands, and backup outcome handling. Delete the orphaned leaves and move meaningful helper coverage to the public owner. Preserve lazy imports, authority checks, error handling, user-visible output, and public SDK/config/protocol contracts.
This is the 48-path core area slice of one reviewed 83-path single-consumer cleanup family, split under the campaign's area-sizing rule. Plugin and UI changes are deliberately excluded.
Best-effort tradeoffs accepted
None: this slice removes internal API/forwarding scaffolding, not defensive guards or supported behavior.
Net LOC
271 net production lines removed against the conflict-repair base. Tests, fixtures, test support, generated files, declarations, and ratchet data are excluded. The mock-export baseline only loses the two rows orphaned by these cuts.
Evidence
The complete source packet passed independent isolated review with no actionable P0–P2 findings. Focused owner/sibling runtime proof passed after repairing the moved tests' filesystem mocks and using the existing forked CLI installation owner (53 cases); no assertion, timeout, skip, or suppression was weakened. The fresh-main integration retains main's heartbeat assembly assertion cleanup and removes only the superseded bootstrap-helper cases, whose coverage is now at the actual bootstrap owner.
Targeted native core typecheck, typed lint, fresh-main context tests (2 cases), suppression check (14 cases), line/assertion/mock ratchets, formatting, and retired-module reference closure passed. Both fresh-main cycle checks found zero cycles. The conflict-integration test command took 144.8 seconds on the shared host, including cold cached-worker preparation; its two test bodies took 165 ms. The moved CLI owner command took 110.6 seconds and backup repair proof took 168.6 seconds on that host; these retain the real CLI/state-broker and filesystem boundaries rather than testing the removed private helpers. Hosted CI timing is pending.
Four existing port-suite cases are platform/bind skips on this Mac, not passing cross-platform proof. No live provider/channel or build result is claimed; exact-head PR CI is the broad gate. Tests/support are not counted as production deletion credit.
Conflict repair: main removed a redundant outer timeout around provider-usage loading. That change stays intact; the moved session-cost code retains its existing separate timeout and necessary import. Fresh targeted status/conflicted-graph native types, typed lint, both status suites (46 cases), suppression (14 cases), formatting, and both cycle checks passed. Runtime and Madge cycles are zero. Other hunks are patch-identical to the independently reviewed head.