Expand description
Plugin loading (the P2 load surface) — re-verification gate → build tools per form → disable per tool → three places cleaned on unload.
Criteria (notes/tool-socket-design.md, “Plugin package mechanism” acceptance):
- Post-install tampering is refused: re-verification [
PackageStatus::Tampered] ⇒ all tools of that plugin are disabled, reason = “…runplugin addagain to re-review” (VerifyReport::user_message); - Corruption does not skip the whole package: missing .wasm (registry reports Broken) or compile failure at load time ⇒ that tool is disabled, the rest of the same package work as usual;
- Unload cleans three places: the tool table (
LoadedPlugin::identity_keyshanded back to the caller for unregistering) / the ledger (crate::approval_ledger::ApprovalLedger::remove_prefix) / the registry (super::install::remove_plugin) — each has its own test; - The mcp form belongs to the plugin: server pins live in
PluginMcpServer(connections are made by the product layer, nothing written to connections.json); key assignment disambiguates collisions with numeric suffixes (assign_mcp_tool_keys).
The load surface does not touch the network and does not spawn: MCP only registers
pins, scripts only register argv pins — the execution surfaces hang separately
(crate::script_tool::ScriptTool / [super::wasm::WasmTool]).
Structs§
- Disabled
Tool - A disabled tool (post-install tampering / missing file / compile failure / not compiled in), with a reason the panel can report directly.
- Loaded
Plugin - A loaded plugin package: usable tools + disabled list + re-verification report + own server pins.
- McpKey
Assignment - Result of
assign_mcp_tool_keys. - Plugin
Loader - Plugin loader: shares one wasm runtime across plugins (feature
wasm). - Plugin
McpServer - Pin for a plugin-owned MCP server (nothing written to connections.json — it belongs to the plugin).
Functions§
- assign_
mcp_ tool_ keys - MCP server tool name list →
plugin.{plugin}.{segment}key assignment.