Skip to content

fix(plugins): preserve manifest permissions when building plugins - #147393

Merged
vincentkoc merged 2 commits into
mainfrom
fix/f01-manifest-mode-e98e95c0
Sep 13, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/f01-manifest-mode-e98e95c0

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Building a plugin could replace openclaw.plugin.json with different permissions, including making a previously restricted manifest more permissive.

User Impact

Plugin builds preserve existing manifest and package-directory permissions. New manifests honor the process umask, builds through a symlink project root work, and publication or cleanup failures remain visible. No configuration changes or migration are required.

Why This Change Was Made

Use the existing atomic replacement owner already used for package.json, with explicit file and directory mode preservation. The regression tests cover rewrites, new files, isolated umasks, invalid and symlink roots, and injected write, rename, and cleanup failures. Authoring failure coverage verifies that the earlier package.json write succeeded without claiming whole-project rollback.

Evidence

  • Exact signed head: 42c71800e713343396a8cd9f9cd4e2ad100d5486.
  • Linux x86_64, Node 24.19.0, @openclaw/fs-safe 0.10.0: the original writer produced three expected failures among 52 tests; all ten controls passed. The repaired signed head passed both focused files, 52/52 tests, including all three repaired cases and ten controls.
  • The selected changed gate passed, including core and core-test typechecks, formatting, typed lint, boundary/ownership guards, and dead-export checks. A fresh canonical pnpm build passed in 3m 49.9s.
  • Each phase completed with joined child processes and unchanged tracked source, file modes, and index. The native six-file evidence archive was retrieved and validated. Build metadata records the native carrier commit; the verified source SHA and tree bind it to the signed head above.
  • Independent source review and exact-head automated review found no actionable issues. Production: +15/-8; tests: +281/-0.

Native macOS and Windows execution were not performed. The initial fresh-lease attempt stopped in proof-directory setup before any test child; the corrected setup completed on the same unchanged source.

Data-model compatibility

Response to the exact-head ClawSweeper compatibility item: migration is not applicable. At head 42c71800e713343396a8cd9f9cd4e2ad100d5486, the manifest fields, schema, filename, reader contracts, and serialization remain unchanged: the same input still produces ${JSON.stringify(manifest, null, 2)}\n. Only filesystem publication and permission handling change.

The accepted Linux 52/52 run includes exact serialized-byte assertions for an existing manifest rewritten with both unchanged and changed values (src/cli/plugins-control-ui-build.test.ts:53-78), exact new-file bytes under isolated umasks (:82-105), and preservation of the previous manifest after a later publication failure (src/cli/plugins-authoring-command.test.ts:794-865). No migration or source change is needed for this review item.

Punchcard-Session: ember-river-timber-wj

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 20:44
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 5:04 PM ET / 21:04 UTC (Revision 2).

ClawSweeper review

What this changes

Plugin builds now use the shared atomic file writer to preserve existing manifest and directory permissions, honor umask for new manifests, and retain publication-failure coverage.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful fix: current main and the latest release still replace manifest permissions. No actionable patch defects were found, and the updated compatibility explanation resolves the previous migration blocker.

Priority: P2
Reviewed head: 42c71800e713343396a8cd9f9cd4e2ad100d5486

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with meaningful regression coverage and no remaining actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported Linux tests exercise manifest publication and command-level failures; no new cross-principal authority contract requires additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported Linux tests exercise manifest publication and command-level failures; no new cross-principal authority contract requires additional final-effect proof.
Evidence reviewed 7 items Introduced change and compatibility: The pinned introduction diff changes filesystem publication only. The manifest filename, input object, JSON serialization, and trailing newline remain unchanged; it introduces no stored data-model or plugin API change.
Current main still needs the fix: Fetched main still creates a fresh temporary manifest using default creation permissions and renames it over the existing file, without preserving its mode.
Latest release comparison: The supplied latest release, v2026.9.4, contains the same temporary-write-and-rename implementation; the requested fix is not present there.
Findings None None.
Security None None.

How this fits together

The plugin authoring CLI derives metadata from a plugin entry and publishes package metadata and its manifest. The manifest then describes the plugin to OpenClaw’s discovery and loading system.

flowchart TD
  A[Plugin source and package metadata] --> B[Plugin build command]
  B --> C{Check only?}
  C -->|Yes| D[Report metadata freshness]
  C -->|No| E[Publish package metadata]
  E --> F[Atomic manifest writer]
  F --> G[Manifest with preserved permissions]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +7, Tests +281. Total +288 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 15 8 +7
Tests 2 281 0 +281
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 296 8 +288

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/cli/plugins-control-ui-build.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep manifest publication with the existing atomic replacement owner while preserving file modes, directory modes, serialized content, and visible failure outcomes.

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

Yes, from source: rebuilding a mode-0640 manifest under umask 0022 on current main replaces it with a newly created mode-0644 file. The PR reports a failing-before/passing-after Linux check; this review did not execute code.

Is this the best way to solve the issue?

Yes. Reusing the package writer’s atomic replacement owner is a focused repair, and unchanged serialization plus existing/new-file coverage resolves the previous migration concern.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs permission drift in the bounded plugin-authoring workflow without adding configuration or changing manifest contracts.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported Linux tests exercise manifest publication and command-level failures; no new cross-principal authority contract requires additional final-effect proof.

Evidence

What I checked:

  • Introduced change and compatibility: The pinned introduction diff changes filesystem publication only. The manifest filename, input object, JSON serialization, and trailing newline remain unchanged; it introduces no stored data-model or plugin API change. (src/cli/plugins-control-ui-build.ts:15, 42c71800e713)
  • Current main still needs the fix: Fetched main still creates a fresh temporary manifest using default creation permissions and renames it over the existing file, without preserving its mode. (src/cli/plugins-control-ui-build.ts:18, edde862d16b2)
  • Latest release comparison: The supplied latest release, v2026.9.4, contains the same temporary-write-and-rename implementation; the requested fix is not present there. (src/cli/plugins-control-ui-build.ts:18, 3a9d69db306c)
  • Existing publication owner and caller: The build command already uses the shared atomic writer for package.json, publishes the manifest afterward, and returns before either write in check mode. The changed manifest writer imports the same facade, whose implementation delegates to @openclaw/fs-safe/atomic; package.json pins version 0.10.0. This establishes the dependency contract relevant to this review. (src/cli/plugins-authoring-command.ts:331, 42c71800e713)
  • Verified dependency implementation: GitHub verified repository ownership and resolved v0.10.0 to ac371ee74846dcb4eaa69d4a3617214846ef92b6. Its atomic writer reads the existing mode, stages and renames the replacement, checks staged-file identity, and propagates requested cleanup errors. Descriptor helpers apply file modes and preserve an already matching directory mode. (src/replace-file.ts, ac371ee74846)
  • Regression coverage and review continuity: Inspected tests cover existing and new manifests, exact serialized bytes, isolated umasks, symlink roots, check-only immutability, and write/rename/cleanup failures. Command-level coverage explicitly preserves the earlier successful package publication when manifest publication fails. The captured PR body reports 52/52 Linux tests and explains why the previous compatibility request needs no migration; these reported runs were not repeated during this read-only review. (src/cli/plugins-control-ui-build.test.ts:50, 42c71800e713)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-13T20:50:46.312Z sha 42c7180 :: blocked before merge. :: none

@vincentkoc
vincentkoc merged commit cc04f6a into main Sep 13, 2026
229 checks passed
@vincentkoc
vincentkoc deleted the fix/f01-manifest-mode-e98e95c0 branch September 13, 2026 21:04
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to Alix-007/openclaw that referenced this pull request Sep 13, 2026
…1-prep

* commit '912ae8d96e5964dfdcdf419b79613fb941cdf0a8': (350 commits)
  fix: keep workspace preparation responsive during cleanup (openclaw#147358)
  docs: alphabetize donors and sponsors and add Red Hat logo (openclaw#147302)
  fix(plugins): retain update authority through doctor effects (openclaw#144316)
  refactor(qa): share Multipass mount retry lifecycle (openclaw#147084)
  fix(memory): emit one JSON result for command failures (openclaw#147366)
  improve(plugins): speed up cold metadata loading (openclaw#147411)
  fix(sessions): avoid duplicate work after waited child replies (openclaw#147394)
  fix(agents): retain outstanding child results in parent context (openclaw#112623)
  test: preserve native workflow loader selection (openclaw#147403)
  fix: reduce repeated work while polling session pull requests (openclaw#147373)
  test(qa): preserve task cancellation across process replacement (openclaw#147382)
  fix: prevent sidebar refresh storms during session activity (openclaw#147400)
  refactor: simplify skills CLI formatting (openclaw#147368)
  fix: prevent Git checkout certificate failures behind egress proxy (openclaw#147410)
  fix(qa): stop live threads after their process leader exits (openclaw#147386)
  refactor(release): share agent turn retry lifecycle (openclaw#147076)
  fix(ui): keep uploaded images aligned with their prompts (openclaw#147389)
  fix(fs): guard skill reads and bound worker bundle staging (openclaw#147336)
  fix(ci): restore Linux service ownership fixtures (openclaw#147398)
  fix(plugins): preserve manifest permissions when building plugins (openclaw#147393)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…enclaw#147393)

* test(plugins): cover manifest permission preservation

Punchcard-Session: ember-river-timber-wj

* fix(plugins): preserve manifest permissions when building plugins

Punchcard-Session: ember-river-timber-wj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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