Repository navigation
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 changesMake local plugin authoring follow physical project and output paths while preserving declared entry identities. Example: With selected pointing to physical/nested, run openclaw plugins build --root selected/../source.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete wrong-project authoring bug that remains on current main. The prior findings are addressed, and no remaining introduced defect was found; required CI has not passed. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin authoring commands consume project paths and entry declarations, load plugin metadata, and produce manifests, scaffolds, diagnostics, browser assets, or archives. flowchart TD
A[Author supplied paths] --> B[Physical root resolution]
B --> C[Declared entry selection]
C --> D[Plugin metadata validation]
D --> E[Manifest publication]
D --> F[Archive packaging]
A --> G[Physical destination resolution]
G --> H[Scaffold or exclusive archive creation]
Technical reviewBest possible solution: Land the physical-root repair with declared entry identities and existing overwrite protections preserved once required CI passes. Do we have a high-confidence way to reproduce the issue? Paired built-CLI receipts reproduce the defect on the pinned base, and current main retains the responsible lexical root normalization; no target code was executed during this review. Is this the best way to solve the issue? The repair uses native traversal and the existing prefix resolver at path-selection boundaries while retaining metadata, publication, and packaging owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 97dd78cc2cbd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +50, Tests +145, Other 0. Total +195 across 10 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 HistoryReview history (4 earlier review cycles)
Reviewed November 15, 2026, 12:35 PM ET / 17:35 UTC (Revision 5). |
|
Preserved the original package/manifest error precedence before the missing-entry guard and added a recovery step to the new init refusal. The rebuilt CLI at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Restored actionable missing-root diagnostics for build, human/JSON validation and packaging, while preserving the lint warning control. The rebuilt CLI at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed the late ENOTDIR finding: entry paths below a regular file now reach the existing expected-error owner, just like missing entries. The rebuilt CLI at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Preserved declared file/directory entry aliases and sibling runtime mappings by restoring the existing entry-selection contract, while retaining physical project-root selection. The rebuilt CLI at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for the work here. We're closing this along with the other open PRs that apply the same change one call site at a time. This series changes symlink, physical-path and literal-path handling at each command separately; path resolution policy belongs in one shared owner and needs a maintainer decision. Please open one issue (or one PR at the shared owner) that covers the whole pattern, with a reproduction of real user-visible harm, instead of separate per-site PRs. Further per-site variants of this pattern will be closed. |
What Problem This Solves
Local plugin authoring lexically normalizes a path before consulting the filesystem. For
selected -> physical/nested,selected/../sourcenamesphysical/source, but build, validation and packaging can successfully operate on a different valid neighbouring project. Init and explicit archive output can likewise write to the wrong directory.User Impact
Build/check, validate, pack and runtime-lint use the project the supplied path actually names. Init and
pack --outuse the physical parent destination. Wrong-project metadata and wrong archive contents are prevented together. Existing no-force refusal, exclusive archive creation and publication cleanup remain enforced.Why This Change Was Made
Resolve existing project roots through native filesystem traversal while preserving package entry declarations. Reuse fs-safe prefix traversal for an init destination that does not exist yet; reject an unresolved
..rather than collapse it into an existing project. Resolve only the archive parent, keeping final-namewxprotection. Include the browser build/settings script and runtime-lint root consumer in this authoring repair.This completes existing path selection, without new options, defaults, dependencies, permission or config/schema/protocol/upgrade changes. It does not activate, publish or install a plugin. Source confinement, final overwrite refusal and ordinary paths remain covered.
Evidence
Product head:
a483ef8b3959f9b69db238350dee69ca9b4aa958; BASE:c0166c395cf81095f431808c9496cb6022ad4387.Immutable paired receipts, actual archives, full output, frozen collectors and independent review.
plugins build --check/validate --jsonon stale selected physical projectbuild/packthrough the same rootinit --directory/pack --outthrough a directory alias and parentopenclaw.mjs plugins build,validate,pack,init-> actual authoring/artifact owners -> filesystem metadata, scaffold files and independent tar readback. Browser builder (including a settings-only UI fixture) and runtime-lint sibling behavior also run in their existing focused tests. The --prepare-settings repository-discovery branch is source-reviewed only.python3 plugin-root-proof-v1.py CHECKOUT FRESH_OUTPUT NODE26 MODE(10 scenarios) andpython3 plugin-output-proof-v1.py CHECKOUT FRESH_OUTPUT NODE26 MODE(build control plus explicit archive output), withredon BASE andgreenon HEAD. Each collector is byte-identical across its pair and requires a clean matching-head normalcliStartupbuild. HEAD normal clean CLI build result is recorded with this exact product head in checks.json.package/openclaw.plugin.json. All 12 HEAD operations pass, including the explicit archive destination sibling. Both archive byte sets are inspectable outside the product branch. No path library or authoring owner is replaced by a test double.pnpm test src/cli/plugins-authoring-command.test.ts src/cli/plugins-authoring-validation.test.ts src/cli/plugins-control-ui-build.test.ts --maxWorkers=1 -t '^(?!.*builds and installs selected entries without changing sibling runtime pairs)':75 PASS, one explicitly filtered known BASE-timeout case, in41.234s. The file/directory alias declarations, sibling runtime mapping, physical project roots, browser build and expected entry errors are covered. The previously run complete selection recorded one120s install-test timeout independently reproduced on clean BASE; that unrelated case is not claimed passing or rerun. No BASE test assertion, source skip or timeout is changed. Current genuine typed lint, semantic types, format and staged line checks pass.python3 plugin-diagnostics-proof-v1.py CHECKOUT FRESH_OUTPUT NODE26 MODE(frozen SHA256bf91372e3d9ebae93a4f3dc7a7740b4cd2b3e4941de804c834febd0b9ccc576b) compares the first published revisiona83b8ad928070201c48afc12c67f51bf0ddc28fbto this repaired head, separately from the original current-main BASE above. The first revision masked three metadata errors with missing-entry errors. On the repaired head, malformed JSON with and without debug retains parser-detail policy, a missing manifest is reported before the absent default entry, and unreachable init shows the recovery step. Five actual normal-CLI checks pass; the no-force control preserves its sentinel, malformed source bytes remain unchanged, and the unreachable parent is not created. No old receipt is relabelled as this head.python3 plugin-missing-root-proof-v2.py CHECKOUT FRESH_OUTPUT NODE26 MODE, frozen SHA2562762205d5d63b14a6392bb8e544472b4682d0cae91684c30ecfa97217472ba9c, compares first repairf9aa12f0ac37b9f51740ed4abbbc4df09cc1ec76to this exact head. Four actual commands (build, human and JSONvalidate, andpack) previously lost the operator-facing root-not-found message. A shared expected-error helper now reports the missing root and an actionable--rootrecovery step for ENOENT/ENOTDIR; other native errors propagate. Packaging uses its existing validation entry before resolving the physical root.plugins lintretains its existing actionable scan-incomplete warning as the must-not-turn-fatal control. Missing roots remain absent and the fixture sentinel is unchanged. This is a separate diagnostic pair; the original BASE is unchanged.python3 plugin-entry-enotdir-proof-v1.py CHECKOUT FRESH_OUTPUT NODE26 MODE, frozen SHA256875e3cee4dd2e77dea5b65121bc2954a627e0053b9c9c2bf1b071fa512decf49, compares previous repaira5ea84b0e91db727c56c7cbcb2678d24b18e3c11to this head. With an existing project and--entry package.json/index.js, build plus human/JSON validation previously lost the expected entry-not-found diagnostic. Backend entry selection retains the original declaration resolver, so both nonexistent entries and entries beneath a regular file reach the existing expected-error owner. Three actual failures regain their precise entry message; valid build, ordinary missing-entry and valid JSON validation controls retain behavior. Independent package/source/manifest hashes are unchanged after the failing requests, and package.json remains a regular file. No metadata guard or entry-confinement rule is bypassed. This third diagnostic pair retains its own BASE revision.python3 plugin-entry-alias-proof-v1.py CHECKOUT FRESH_OUTPUT NODE26 MODE, frozen SHA256a7cfcb615b1bdd71f5733cfbfe04e39614375679338ab5585ef6943646a618e8, compares prior repair050f9f63f297c83d287024ea5e67b712bf75b548to this head. It starts with already-valid package declarations containing a file alias or directory alias plus a second extension and two runtime mappings. The prior revision rejects those existing declarations and appends the same physical plugin as a duplicate on build. This head validates the original stored package, builds and validates it again without changing either declared slot, runtime mappings, setup entry or source bytes; ordinary entries remain the control. Twelve actual CLI operations are recorded. Physical project-root selection and declared backend entry identity are separate: this PR does not introduce native traversal rules for package entry strings. The BASE lexical handling of entrymissing/../...is retained. An absolute entry spelled under the supplied root maps to the same relative declaration under the physical project root; unrelated paths still use the existing confinement guard. The browser core's pre-existing native-entry confinement is unchanged. The browser-copy script reads from the physical root but retains the original logical bundled slot for destination selection;--copyremains source-reviewed only.Production / test LOC
No proof assets or CHANGELOG changes on the product branch.