Repository navigation
fix(plugins): validate setup entries before loading - #117370
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 7:23 AM ET / 11:23 UTC. ClawSweeper reviewWhat this changesValidate 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 Review scores
Verification
How this fits togetherRead-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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +18, Tests +55, Docs +2. Total +75 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
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.
d493e3b to
d3c8679
Compare
|
Merged via squash.
|
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.
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
preparePluginModuleboundary 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