fix(migrate): reject external plugin paths during adoption - #110
fix(migrate): reject external plugin paths during adoption#110MertBasar0 wants to merge 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 10:23 PM ET / August 26, 2026, 02:23 UTC. ClawSweeper reviewWhat this changesMakes Merge readinessKeep open for a maintainer policy decision: the patch is focused and proven, but intentionally replaces an established warning-and-continue adoption path with a hard failure. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherOCM imports an existing OpenClaw home into a disposable environment before candidate runtimes use it. Plugin records are relocated during import; this change determines whether an external path is retained with a warning or aborts adoption. flowchart LR
A[Source OpenClaw home] --> B[Adopt import]
B --> C[Plugin path relocation]
C --> D{Path contained in target state?}
D -->|Yes| E[Publish adopted environment]
D -->|No| F[Abort migration]
F --> G[Remove partial environment]
E --> H[Candidate runtime]
Decision needed
Why: Source and real-command proof establish the implementation, but cannot decide whether replacing the existing warning-and-continue workflow with an operator-blocking failure is the intended product policy. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm the permanent adoption policy, then merge this narrow containment guard if fail-closed behavior is accepted; otherwise design an explicit compatible remediation path before changing the default. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main's regression test explicitly exercises successful import with a preserved external path, while the PR body supplies an after-fix real CLI run for the opposite behavior. Is this the best way to solve the issue? Unclear: failing before publishing the adopted environment is a narrow containment implementation, but maintainers must decide whether the deliberate compatibility break is the best permanent policy. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against cd8decaf04f2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Added the requested after-fix production-command proof from a safe temporary fixture. The targeted regression test passes; the real CLI run exits nonzero, removes the partial target environment, and leaves both the source SQLite database and external plugin marker byte-for-byte unchanged. The PR body now also calls out the remaining maintainer policy decision explicitly. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@Patrick-Erichsen The requested real-command proof and CI-equivalent local verification are now in the PR body. The remaining maintainer decision is the compatibility policy: this patch intentionally fails closed when an external path plugin cannot be contained, instead of preserving the current warning-and-continue behavior. Could you confirm that fail-closed adoption is the intended policy? |
What Problem This Solves
ocm adopt importcan retain absolutesourcePathorinstallPathvalues for path plugins outside the adopted environment. The import currently succeeds with a warning, so a candidate runtime can still receive a writable reference to source-owned state even though the environment is intended to be disposable.Why This Change Was Made
Containment is a safety boundary, not a compatibility warning. The import now fails before publishing relocated plugin records when any plugin path cannot be isolated inside the target state root. The existing migration transaction then removes the partially created environment.
User Impact
Adoption no longer produces a runnable environment with external plugin references. Operators must relocate or remove external path plugins before importing. Managed ClawHub and npm plugin records continue to relocate into the adopted state as before.
Verification
Targeted regression test
Real CLI behavior with a safe temporary fixture
The fixture contains a path plugin outside the source OpenClaw home. Paths are redacted below. The source database and external plugin marker were hashed before and after the production
ocmcommand.Additional CI-equivalent verification on commit
9695362:cargo fmt --checkpasses.cargo test --lockedpasses in a clean WSL-native Linux checkout.cargo +1.88.0 check --workspace --all-targets --lockedpasses.git diff --check upstream/main...HEADpasses.Maintainer Decision Requested
Please confirm that fail-closed adoption is the intended policy when a path plugin cannot be contained. This intentionally changes the previous warning-and-continue behavior: operators must relocate or remove the external path plugin before retrying adoption.
Related: #98
Related: openclaw/openclaw#129673