1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! `PluginError` — typed error enum for the homecore-plugins crate.
use thiserror::Error;
/// Errors produced by the HOMECORE plugin system.
#[derive(Debug, Error)]
pub enum PluginError {
/// The plugin manifest JSON is missing required fields or is malformed.
#[error("invalid manifest: {0}")]
InvalidManifest(String),
/// A plugin with this ID is already loaded in the registry.
#[error("plugin already loaded: {0}")]
AlreadyLoaded(String),
/// No plugin with this ID is loaded in the registry.
#[error("plugin not found: {0}")]
NotFound(String),
/// The plugin runtime failed to spawn or execute the plugin.
#[error("runtime error: {0}")]
RuntimeError(String),
/// Plugin discovery or filesystem layout is invalid.
#[error("plugin discovery failed: {0}")]
Discovery(String),
/// A configured manifest, module, or ABI payload exceeds its limit.
#[error("plugin resource limit exceeded: {0}")]
ResourceLimit(String),
/// The plugin's `setup` hook returned an error.
#[error("plugin setup failed: {0}")]
SetupFailed(String),
/// The plugin failed signature/integrity verification (ADR-162 P4):
/// hash mismatch, bad signature, untrusted publisher, or unsigned
/// module under a non-dev trust policy.
#[error("plugin signature rejected: {0}")]
SignatureRejected(String),
/// A plugin attempted a host call (e.g. `hc_state_set`) on an entity
/// it did not declare in `homecore_permissions` (ADR-162 P5 authority
/// isolation).
#[error("plugin permission denied: {0}")]
PermissionDenied(String),
/// The plugin's `unload` hook returned an error.
#[error("plugin unload failed: {0}")]
UnloadFailed(String),
/// IO error (manifest file not found, WASM binary missing, etc.).
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}