Skip to main content

McpPackagePin

Struct McpPackagePin 

Source
pub struct McpPackagePin {
    pub runner: String,
    pub name: String,
    pub version: String,
    pub install_dir: String,
    pub lockfile_sha256: String,
    pub signatures_missing: Option<u32>,
    pub provenance: Option<String>,
}
Expand description

A package MUR installed itself, and the fingerprint that proves the installed tree hasn’t changed.

lockfile_sha256 hashes the install’s package-lock.json, which already records an integrity hash for every package in the dependency tree — so one small file covers the whole tree, and startup verification stays cheap no matter how large node_modules grows.

The lockfile pins what was installed. Editing a file inside node_modules afterwards would not change it; catching that needs a full tree hash, which is deliberately not done here — see the module docs on mur-core::cmd::agent_mcp_vendor for where that line is drawn.

Fields§

§runner: String

Package ecosystem — npm today.

§name: String

Package name, including any @scope/ prefix.

§version: String

Exact installed version.

§install_dir: String

Directory MUR installed into, absolute.

§lockfile_sha256: String

SHA-256 (lowercase hex) of <install_dir>/package-lock.json.

§signatures_missing: Option<u32>

How many packages in the installed tree published no registry signature, as reported by npm audit signatures at vendor time.

None — the audit did not run (npm too old, or offline). Some(0) — every package in the tree carried a verified signature. Some(n)n packages are unsigned; the rest verified.

A signature that verifies proves the bytes came from the registry, which the content hash cannot: it would faithfully pin a poisoned cache. An invalid signature is not recorded here because it blocks the vendor outright — that is an integrity failure, not a property to note.

§provenance: Option<String>

SLSA predicate type of the package’s build provenance, when it publishes one — e.g. https://slsa.dev/provenance/v1. None means no attestation was published (still the common case).

Provenance ties a release back to a source repository and CI run, and is the only signal here that can catch a malicious publish: a content hash pins whatever was released, faithfully preserving a poisoned version rather than detecting it. Recorded and shown, never required — ecosystem coverage is far too thin to gate on.

Implementations§

Source§

impl McpPackagePin

Source

pub fn lockfile_name(&self) -> &'static str

Name of the lockfile whose hash is lockfile_sha256.

npm writes package-lock.json itself; for PyPI, MUR generates one with uv pip compile --generate-hashes, which records a sha256 for every package in the resolved tree — the same property that lets one small file stand in for the whole install.

Source

pub fn lockfile_path(&self) -> PathBuf

Absolute path of the lockfile this pin covers.

The startup check, inspect, and the deep audit all resolve it through here, so a newly supported ecosystem cannot end up verified against the wrong file in one of them and silently pass.

Trait Implementations§

Source§

impl Clone for McpPackagePin

Source§

fn clone(&self) -> McpPackagePin

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for McpPackagePin

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for McpPackagePin

Source§

fn default() -> McpPackagePin

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for McpPackagePin

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for McpPackagePin

Source§

impl PartialEq for McpPackagePin

Source§

fn eq(&self, other: &McpPackagePin) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for McpPackagePin

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for McpPackagePin

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more