Skip to content

fix(plugins): validate setup entries before loading - #117370

Merged
steipete merged 1 commit into
mainfrom
codex/goal100k-channel-discovery-owner-0801-2d45
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/goal100k-channel-discovery-owner-0801-2d45

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a lazy external channel setup entry could be replaced after metadata discovery with a hardlink or symlink outside its plugin root and still execute during status or setup discovery.

Most of this PR's original discovery consolidation is already on main through #131442 and #118689. This refreshed patch addresses the reproduced remaining setup-entry boundary only; it does not claim the historical 477-line deletion.

Why This Change Was Made

Setup loading now uses the existing preparePluginModule boundary validator and canonical hardlink policy before constructing the loader, then executes the validated path. The explicit read-only environment is passed to policy resolution. Module export shape, cache-generation ownership, manifest fallback and alias rebinding remain with their existing owners.

User Impact

A substituted setup entry is rejected before evaluation, while safe manifest metadata and a useful load diagnostic remain available. Bundled and verified immutable Nix roots retain their existing hardlink policy. Repeated status reads reuse the validated module within its cache generation. No new configuration, public SDK surface, dependency or persistent-store change is introduced.

Evidence

  • Both post-discovery hardlink and symlink fixtures executed an outside synthetic payload on pinned main; both are rejected after the repair, with the payload and heavy runtime markers absent and safe metadata retained.
  • All four focused owner/sibling suites passed, including 46 channel discovery cases, public-artifact boundaries, hardlink policy and generation-cache behavior.
  • Fresh full-candidate P2 review is clean. All 32 selected checks and all 16 normal build phases passed; final file and patch hashes match the reviewed/tested source.
  • This current repair adds 18 production code lines and 51 test code lines (55 physical), plus two documentation lines. The earlier PR's superseded deletions and old-head live/CI runs are not counted as proof for this refreshed candidate.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete
steipete marked this pull request as ready for review August 1, 2026 11:07
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 7:23 AM ET / 11:23 UTC.

ClawSweeper review

What this changes

Validate lightweight channel setup files before loading them, rejecting substituted links while preserving cached modules, safe metadata, and load diagnostics.

Merge readiness

✅ Ready for maintainer review

The refreshed repair remains necessary: current main and v2026.9.2 still omit validation at this lazy-loading boundary. No introduced correctness defect was found, and the earlier compatibility concern has an explicit disposition in merged related work.

Priority: P2
Reviewed head: d3c86797794e0fce1f21fc9c6479a5caf9be6b21

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair reuses established validation and includes meaningful regression coverage, with no blocking patch finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this PR from ordinary contributor proof gating. The refreshed body reports production-resolver substitution fixtures with rejected payload execution; inspected tests support that scenario, but were not rerun here. No unresolved introduced authority case requires an additional proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this PR from ordinary contributor proof gating. The refreshed body reports production-resolver substitution fixtures with rejected payload execution; inspected tests support that scenario, but were not rerun here. No unresolved introduced authority case requires an additional proof gate.
Evidence reviewed 7 items Introduced patch verified: The merge-base-to-head diff adds setup-file preparation, forwards the explicit environment to the existing hardlink policy, and loads the returned path. It does not include the historical discovery refactor or endpoint drift.
Current-main and release necessity: Both fetched main and the latest supplied release retain direct loading of record.setupSource without preparePluginModule at this boundary. The remaining repair is therefore neither already implemented nor shipped.
Existing validation and lifecycle owners: preparePluginModule checks the root boundary and file identity, keys validated boundaries by root and hardlink policy, and returns the canonical path. The module loader retains exports within its creating cache generation. The shared hardlink policy preserves bundled and immutable Nix-store exceptions.
Findings None None.
Security None None.

How this fits together

Read-only channel discovery combines configuration and plugin metadata for inventory, status, and setup consumers. When a consumer needs setup capabilities, it loads a lightweight plugin module without starting the full messaging runtime.

flowchart TD
  A[Channel configuration] --> C[Read-only discovery]
  B[Cached plugin metadata] --> C
  C --> D{Setup capabilities needed?}
  D -->|No| E[Metadata inventory]
  D -->|Yes| F[Validate setup file boundary]
  F -->|Accepted| G[Cached lightweight module]
  F -->|Rejected| H[Load diagnostic and eligible metadata]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +18, Tests +55, Docs +2. Total +75 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 21 3 +18
Tests 1 55 0 +55
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 78 3 +75

Review metrics

None.

Technical review

Best possible solution:

Use the existing file validator at first setup-module evaluation while retaining the accepted bundled/Nix exceptions, generation caching, and failure diagnostics.

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

Yes, source establishes the path: discover an external plugin, substitute its unloaded setup file, then request setup fallback. Current main loads that path without renewed boundary validation; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the existing validator closes the missing check without duplicating policy or changing plugin exports, selection, or cache ownership; the intentional rejection follows the accepted related compatibility decision.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this PR from ordinary contributor proof gating. The refreshed body reports production-resolver substitution fixtures with rejected payload execution; inspected tests support that scenario, but were not rerun here. No unresolved introduced authority case requires an additional proof gate.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded plugin-loading boundary repair with a concrete post-discovery file-substitution trigger.
  • 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 supplied MEMBER association exempts this PR from ordinary contributor proof gating. The refreshed body reports production-resolver substitution fixtures with rejected payload execution; inspected tests support that scenario, but were not rerun here. No unresolved introduced authority case requires an additional proof gate.

Evidence

What I checked:

  • Introduced patch verified: The merge-base-to-head diff adds setup-file preparation, forwards the explicit environment to the existing hardlink policy, and loads the returned path. It does not include the historical discovery refactor or endpoint drift. (src/channels/plugins/read-only.ts:361, d3c86797794e)
  • Current-main and release necessity: Both fetched main and the latest supplied release retain direct loading of record.setupSource without preparePluginModule at this boundary. The remaining repair is therefore neither already implemented nor shipped. (src/channels/plugins/read-only.ts:348, dc37e52a1034)
  • Existing validation and lifecycle owners: preparePluginModule checks the root boundary and file identity, keys validated boundaries by root and hardlink policy, and returns the canonical path. The module loader retains exports within its creating cache generation. The shared hardlink policy preserves bundled and immutable Nix-store exceptions. (src/plugins/plugin-module-loader-cache.ts:374, d3c86797794e)
  • Regression coverage reaches evaluation boundary: The two added cases discover a real temporary plugin before replacing its setup file with a hardlink or symlink, then invoke the production resolver and assert no hostile payload evaluation, no full-runtime evaluation, retained eligible metadata, and a load diagnostic. Existing surrounding coverage checks allowed setup loading, denied workspace plugins, and lifecycle reloads. These tests were inspected, not executed during this review. (src/channels/plugins/read-only.test.ts:1377, d3c86797794e)
  • Prior compatibility decision resolved: The supplied GitHub context verifies fix(plugins): reject external public-artifact hardlinks #118689 as merged and records explicit acceptance of rejecting mutable external public-artifact hardlinks, preserving bundled/Nix exceptions, and repairing or reinstalling affected packages. This resolves the earlier review's public-artifact policy question; the refreshed patch applies that existing invariant to a separate lazy setup path. (8d263b484422)
  • Review continuity and captured proof: The complete supplied body at sourceRevision e7a01c00e1e32b11bcbf60589dd9c1b7a16cae04e1904705425c622b858412c5 reports before/after substitution fixtures and focused owner/sibling validation for the refreshed candidate, expressly excluding old-head proof. Host-verified test-merge evidence contains only the three intended paths, addressing the earlier dirty-merge concern. No maintainer-notes directory exists in this checkout. (d3c86797794e)

Likely related people:

  • steipete: 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 (7 earlier review cycles)
  • reviewed 2026-08-01T11:13:02.125Z sha 43dd254 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T11:43:42.433Z sha 43dd254 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T13:05:01.608Z sha d493e3b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T13:14:55.846Z sha d493e3b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T13:30:32.002Z sha d493e3b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T08:51:48.760Z sha d493e3b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T15:17:51.077Z sha d493e3b :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 1, 2026
@steipete steipete self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 2, 2026
Reject post-discovery hardlink and symlink substitutions before setup-module evaluation. Reuse generation-bound validation with existing manifest fallback, bundled/Nix policy and export shape.
@steipete
steipete force-pushed the codex/goal100k-channel-discovery-owner-0801-2d45 branch from d493e3b to d3c8679 Compare September 6, 2026 11:10
@steipete steipete changed the title refactor(channels): streamline read-only plugin discovery fix(plugins): validate setup entries before loading Sep 6, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Sep 6, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 6, 2026
@steipete
steipete merged commit 81652c0 into main Sep 6, 2026
187 of 188 checks passed
@steipete
steipete deleted the codex/goal100k-channel-discovery-owner-0801-2d45 branch September 6, 2026 11:37
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Reject post-discovery hardlink and symlink substitutions before setup-module evaluation. Reuse generation-bound validation with existing manifest fallback, bundled/Nix policy and export shape.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: XL 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