Skip to content

refactor: keep private core operations with their consumers - #178465

Merged
steipete merged 1 commit into
mainfrom
deslop/z25-60-core-private-owners-20261015
Oct 20, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z25-60-core-private-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 20, 2026 14:12
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling labels Oct 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T14:43:01.019323Z 3fe984c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This 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].

  • Before: A separate CLI helper constructs the pinned install record and notice.
  • After: The installation command constructs the same record and notice directly.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source review supports the mechanical cleanup and preserved contracts; supplied harness evidence is limited, and conflict resolution plus CI attribution remain outstanding.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor-proof gate; supplied evidence describes focused owner tests, including CLI and filesystem boundaries, without claiming live provider or channel proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction aligns with the repository's single-owner guidance and removes private forwarding machinery while retaining supported behavior.

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
Reviewed head: b60e02753a92345488b8421aafce47db8e8f8bd9

Before merge

  • Complete next step - Resolve GitHub's reported merge conflict, establish whether the unlimited-maintenance assertion failure is caused by this diff or inherited, and validate the affected resulting head.

Findings

None.

Agent review details

How this fits together

Agent 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 667e3b9 adds src/agents/embedded-agent-runner/run/attempt-decision-prefilter.ts:177 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 667e3b920e78; files: src/agents/embedded-agent-runner/run/attempt-decision-prefilter.ts)
  • Mert Başar: Raw commit 2f1f8be adds src/agents/embedded-agent-runner/run/attempt-decision-prefilter.ts:171 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2f1f8beed7a3; files: src/agents/embedded-agent-runner/run/attempt-decision-prefilter.ts)
  • Vincent Koc: Raw commit 8383bb2 adds src/agents/embedded-agent-runner/run/attempt-decision-prefilter.ts:172 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8383bb2ef90a; files: src/agents/embedded-agent-runner/run/attempt-decision-prefilter.ts)

PR surface

Source -272, Tests +269, Other -2. Total -5 across 48 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 27 886 1158 -272
Tests 20 996 727 +269
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 2 -2
Total 48 1882 1887 -5

Review metrics

Metric Value Why it matters
Production versus test LOC Production +886/-1158; tests +996/-727; baseline -2. The production reduction is 272 lines; test growth mostly moves preserved contracts from removed helpers to their consumers.

Labels

Label changes:

  • add P3: This is internal ownership cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal ownership cleanup with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 20, 2026, 10:31 AM ET / 14:31 UTC.

@steipete
steipete force-pushed the deslop/z25-60-core-private-owners-20261015 branch from b60e027 to 3fe984c Compare October 20, 2026 14:40
@steipete
steipete merged commit 76480f6 into main Oct 20, 2026
138 checks passed
@steipete
steipete deleted the deslop/z25-60-core-private-owners-20261015 branch October 20, 2026 15:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant