Skip to content

refactor(plugins): consolidate host-link repair orchestration - #188215

Merged
vincentkoc merged 3 commits into
mainfrom
refactor/plugin-host-link-reconciliation-20261030
Oct 30, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
refactor/plugin-host-link-reconciliation-20261030

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Update and Doctor paths separately compose host-link repairs, duplicating ordering and error policy around the same repair owner.

User Impact

No intended behavior change. Managed repairs still settle before registered repairs; update rollback and Doctor diagnostics keep their existing behavior.

Why This Change Was Made

Move the shared orchestration into the existing peer-link owner and remove two update-config wrappers. Keep pre-target and post-installer repair phases separate, along with selected-generation traversal, effect admission, fresh install records, and rollback settlement.

Production is reduced by 25 lines. Tests grow by 103 lines to cover actual filesystem ordering, sibling settlement on rejection, effect gates, and callback-versus-throw behavior.

Evidence

  • Independent source review and final full-owner local autoreview found no actionable defects.
  • Targeted formatting, diff checks, normal signed commit hooks, and added-line privacy checks passed.
  • The signed rebase onto the landed policy prerequisite preserves all nine changed file blobs exactly.
  • Pre-correction head 51b480b7a615870c8cc3fb9315b8dcba24877c2e observed 355 passing cases across 17 files, including all three changed suites: peer links (43), post-core convergence (13) and transactions (17), plus update (86), install npm specs (50), uninstall (76), convergence persistence (8), source checkout (6) and other authority/consent/deadline/load-path siblings. Owner/convergence/transaction/uninstall job, update/install job.
  • That run caught the transaction fixture replacing real module exports. The correction preserves real exports before overriding the same repair mock; independent hunk review is clean. Production inputs are unchanged. The retired update-config mock's exact baseline entry is also removed. Final-head CI passed at 91ca13cb3604a15bbfdb37341c166f91a8e19386.
  • Final-head logs observed 309 passing cases: peer links 43, transactions 17, post-core convergence 13, persistence 8, source checkout 6, Doctor host links 10, plugin update 86, npm install specs 50, uninstall 76. Owner/transaction/convergence, Doctor, update/install.
  • Standalone top-level install.test.ts, shipped CLI invocation and latest-stable upgrade are not claimed.
  • No local dependency-backed execution, public SDK/config/schema change, or live service mutation is claimed.

Based on the landed #188196; this PR contains only host-link orchestration.

@vincentkoc vincentkoc self-assigned this Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc
vincentkoc marked this pull request as ready for review October 30, 2026 09:21
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: L labels Oct 30, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates Doctor and update host-link repair orchestration in the existing peer-link owner and removes two update-config wrappers.

Example: Doctor repairs two managed npm packages and one registered plugin.

  • Before: Caller-owned orchestration waits for both managed repairs before repairing the registered plugin.
  • After: The shared peer-link owner performs the same ordered repairs and returns separate repair counts.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The consolidation is coherent and has no actionable finding; execution evidence remains at the in-process boundary, with current-head CI still pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; supplied evidence supports filesystem-level repair coverage without claiming shipped-entry-point execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Duplicated repair orchestration makes consistent Doctor and update behavior harder to maintain.
Reason: The maintainer-authored direction reduces production code and centralizes an existing responsibility without adding configuration or public contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides a useful consolidation, preserves the existing repair contracts, and has no actionable introduced findings.

Priority: P3
Reviewed head: 91ca13cb3604a15bbfdb37341c166f91a8e19386

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate a shipped Doctor/update invocation or a latest-stable upgrade; it covers in-process repair behavior.
Agent review details

How this fits together

Doctor and plugin updates supply selected package roots, install records, and mutation callbacks to the peer-link owner, which validates package ownership and repairs links to the running OpenClaw host.

flowchart TD
  A[Doctor] --> C[Peer-link repair orchestration]
  B[Plugin update phases] --> C
  C --> D[Managed npm repairs]
  D --> E[Registered install repairs]
  E --> F[Host links and repair counts]
Loading

Technical review

Best possible solution:

Keep the shared orchestration in the existing peer-link owner while preserving caller-owned selection, diagnostics, authority checks, and rollback settlement.

Do we have a high-confidence way to reproduce the issue?

This behavior-preserving refactor addresses duplicated orchestration rather than a reported runtime failure; inspection confirms the duplicate caller paths.

Is this the best way to solve the issue?

The change uses the existing repair owner, removes superseded wrappers, and keeps the distinct update phases and error policies intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 68fbe4ac429c.

Provenance checked

  • Registered repair wrappers and canonical-path ownership keeps the original intent (6ee406b: Repair stale nested OpenClaw hosts through the canonical registered-install owner while preserving developer-owned paths.)
  • Mutation callbacks and refusal propagation keeps the original intent (3ca2b4e: Retain initiating update authority through Doctor and plugin effects instead of converting refusal into filesystem warnings.)
  • Convergence-local failure policy keeps the original intent (f760a05: Keep private preparation with its consumers; convergence retains its sticky refusal and diagnostic policy.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change and current main: The pinned introduced diff moves orchestration into plugin-peer-link.ts, migrates all four callers, and removes both obsolete wrappers; comparison with fetched main shows the same underlying implementation context. (src/plugins/plugin-peer-link.ts:498, 91ca13cb3604)
  • Ordering and mutation ownership: The shared operation joins managed repairs before propagating rejection or starting registered repairs; existing registered-path checks and final mutation callbacks remain in their original owners. (src/plugins/plugin-peer-link.ts:512, 91ca13cb3604)
  • Original repair contract: The original repair work established canonical registered-install ownership and protected developer-owned paths; this PR preserves those checks and caller-specific error policies. Discussion: fix(plugins): repair stale host packages after OpenClaw upgrades #118304. (src/plugins/plugin-peer-link.ts:412, 6ee406b1bfbf)
  • Distinct behavioral coverage: The owner suite exercises real filesystem ordering, sibling settlement after rejection, refusal before mutation, and manifest-read callback versus throw behavior; convergence retains selected-generation and warning-policy coverage. (src/plugins/plugin-peer-link.test.ts:269, 91ca13cb3604)
  • Earlier test execution: Both linked test jobs completed successfully on 51b480b; these are earlier-head results. Raw log inspection was blocked by the artifact host allowlist, so individual case totals were not independently verified. (51b480b7a615)
  • Current-head gates: GitHub reports the reviewed head mergeable, with the aggregate CI gate pending; dependency and security-sensitive review statuses are successful, and neither check-run page reported a failed conclusion. (91ca13cb3604)

Likely related people:

  • Peter Steinberger: Raw commit b4031b2 adds src/plugins/plugin-peer-link.ts:363 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b4031b2954c7; files: src/plugins/plugin-peer-link.ts)
  • Vincent Koc: Raw commit 3ca2b4e adds src/plugins/plugin-peer-link.ts:272 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ca2b4e370a9; files: src/plugins/plugin-peer-link.ts)

PR surface

Source -25, Tests +103, Other -1. Total +77 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 99 124 -25
Tests 3 207 104 +103
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 10 306 229 +77

Review metrics

Metric Value Why it matters
Production versus test LOC Production +99/-124; tests +207/-104 Production shrinks by 25 lines; the 103-line net test increase protects ordering, settlement, authority forwarding, and error-policy boundaries.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal consolidation 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: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T09:36:54.818Z sha e3156ec :: needs maintainer review before merge. :: none

Reviewed October 30, 2026, 5:48 AM ET / 09:48 UTC (Revision 2).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit d00678f into main Oct 30, 2026
140 checks passed
@vincentkoc
vincentkoc deleted the refactor/plugin-host-link-reconciliation-20261030 branch October 30, 2026 13:43
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…aw#188215)

* refactor(plugins): consolidate host-link repair orchestration

* test(plugins): preserve real peer-link exports

* test(plugins): prune retired repair mock baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant