Expand description
HOMECORE-PLUGINS — WASM integration plugin system.
Implements ADR-128
P1 scaffold: manifest parsing, the HomeCorePlugin async trait, the
PluginRuntime abstraction, and the PluginRegistry.
§What’s here (P1)
manifest—PluginManifest: superset of HAmanifest.json; serde round-trip + required-field validation.plugin—HomeCorePluginasync trait,PluginIdnewtype.runtime—PluginRuntimetrait +InProcessRuntime(native Rust, first-party plugins compiled into the binary).registry—PluginRegistry<R>: load / unload / list plugins.error—PluginErrortyped error enum.
§Runtime scope
WasmtimeRuntime(--features wasmtime) provides the Cranelift sandbox.- Native Rust plugins are compiled into the server; arbitrary native dynamic libraries are not loaded.
- The host ABI is deliberately narrow and resource-bounded.
§Now enforced (ADR-162)
- Ed25519 signature + SHA-256 integrity verification (P4) — see
verify: the plugin load path hashes the real.wasmbytes, checks the manifestwasm_module_hash, verifieswasm_module_sigagainstpublisher_key, and enforces averify::PluginPolicyallowlist. - Permission / authority isolation (P5) — see
permissions: a plugin’shc_state_setwrites are gated against the entity domains/ globs it declared inhomecore_permissions.
§Feature flags
| Feature | Default | Description |
|---|---|---|
wasmtime | off | Wasmtime Cranelift JIT runtime (P2) |
Re-exports§
pub use error::PluginError;pub use discovery::discover_plugins;pub use discovery::DiscoveredPlugin;pub use discovery::DiscoveryLimits;pub use host_abi::ConfigEntryJson;pub use host_abi::StateChangedEventJson;pub use manifest::IotClass;pub use manifest::IntegrationType;pub use manifest::PluginManifest;pub use permissions::PermissionSet;pub use plugin::HomeCorePlugin;pub use plugin::PluginId;pub use registry::PluginRegistry;pub use runtime::InProcessRuntime;pub use runtime::LoadedPlugin;pub use runtime::PluginRuntime;pub use verify::verify_module;pub use verify::PluginPolicy;
Modules§
- discovery
- Secure filesystem discovery for packaged WASM plugins.
- error
PluginError— typed error enum for the homecore-plugins crate.- host_
abi - Host ABI — the public on-the-wire memory format between the HOMECORE host and every WASM plugin.
- manifest
- Plugin manifest — superset of HA’s
manifest.json. - permissions
- Plugin authority / capability isolation (ADR-162, P5).
- plugin
HomeCorePlugintrait +PluginIdnewtype.- registry
PluginRegistry— load, unload, and list HOMECORE plugins.- runtime
PluginRuntimetrait +InProcessRuntime(P1).- verify
- Plugin signature & integrity verification (ADR-162, P4).