pub struct SkillTrustStore {
pub schema: u32,
pub entries: BTreeMap<String, TrustEntry>,
pub revoked: Vec<String>,
}Fields§
§schema: u32On-disk schema version. Absent in stores written before the field
existed, which are exactly the v1 stores — hence default = 1.
entries: BTreeMap<String, TrustEntry>§revoked: Vec<String>Kill-switch — content hashes that may NEVER load, regardless of the per-entry trust level.
Implementations§
Source§impl SkillTrustStore
impl SkillTrustStore
pub fn path(mur_home: &Path) -> PathBuf
pub fn load(mur_home: &Path) -> Result<Self, TrustStoreError>
pub fn save(&self, mur_home: &Path) -> Result<(), TrustStoreError>
pub fn insert(&mut self, hash: String, entry: TrustEntry)
pub fn lookup(&self, hash: &str) -> Option<&TrustEntry>
Sourcepub fn migrate_to_trust_hash<F>(&mut self, load_manifest: F) -> Option<usize>
pub fn migrate_to_trust_hash<F>(&mut self, load_manifest: F) -> Option<usize>
Re-key v1 hash-keyed entries into the trust hash domain (schema 1 → 2).
v1 keyed by content_sha256; the loader now looks up
content_hash_for_trust. Without this every already-installed skill
misses its entry and silently drops to Sandboxed — fail-closed, so no
privilege is gained, but every recorded trust level would be lost.
Re-keying needs the manifest, which the store does not hold, so each entry is recomputed from the skill still on disk. What that implies:
- Name-keyed entries are left alone.
registry-addkeys by skill name on purpose (the drift baseline). Only 64-hex keys are candidates. - An entry whose skill is no longer installed is kept as-is. It
cannot be recomputed, and dropping it would silently discard a
Trusteddecision the user made. A stale key is inert; a deleted one is not recoverable. - Already-correct keys are cheap no-ops — the recomputed hash equals the existing key and the entry is reinserted unchanged.
Returns None if the store was already current, or Some(n) with the
number of entries re-keyed. Some(0) still means the schema was bumped
and the store must be saved — otherwise a store with nothing to move
never records that it migrated and repeats the work on every start.