Skip to main content

WarningCode

Enum WarningCode 

Source
#[non_exhaustive]
pub enum WarningCode { CommunityFilterNoop, PprNoSubstrate, NoReranker, AuthoredAdjacencyEmpty, BelowConfidenceFloor, WarningsTruncated, PprSizeGateSkipped, }
Expand description

Closed enum of every warning the retrieve pipeline can emit.

New variants require (a) a sibling warnings/<snake_case>.txt message body, (b) a docs/warnings/<snake_case>.md remediation markdown with an ## Agent fallback section, and (c) a line in the WarningCode::remediation_ref match arm. The xtask lint-warnings binary asserts all three at CI time; a missing body or doc is a hard CI failure.

#[non_exhaustive] so adding a variant is an additive wire change - existing callers match with a catch-all and keep compiling.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CommunityFilterNoop

community_filter: true was accepted but the commit has no authored edges AND no vector index was available, so the expander had no substrate to operate on.

§

PprNoSubstrate

graph_mode = "ppr" was accepted but the commit has no authored edges AND no vector index was available, so the PPR walk degraded to the identity pass (input order unchanged).

§

NoReranker

rerank was requested but no reranker provider could be opened (bad spec, missing credentials, unreachable endpoint); results carry their fusion scores unchanged.

§

AuthoredAdjacencyEmpty

graph_expand was accepted but the commit has no authored edges so the walk added no neighbours. Distinct from WarningCode::CommunityFilterNoop: graph_expand ignores the vector-derived KNN substrate, so vectors alone do not suppress this warning.

§

BelowConfidenceFloor

Every candidate scored below the configured confidence floor, so the items[] array is empty by gate rather than by a retrieval failure. Reserved for callers using the (future) min_confidence knob; wired through now so the warning code is part of the stable v1 surface.

§

WarningsTruncated

Synthetic: more than WARNINGS_CAP warnings were generated; the tail was dropped to bound the response size. Never emit this manually - it is produced exclusively by cap_warnings.

§

PprSizeGateSkipped

Gap 02 #17: graph_mode = "ppr" was requested but the graph exceeds crate::ppr::PPR_DEFAULT_MAX_NODES and the caller did not opt in via ppr_opt_in = true. PPR is skipped and the pipeline falls back to the decay-BFS expansion to prevent unbounded query latency.

Implementations§

Source§

impl WarningCode

Source

pub const fn as_str(self) -> &'static str

Canonical wire name. Stable across versions; downstream dashboards and agent routing tables key on these strings.

Source

pub const fn knob(self) -> &'static str

Canonical agent-facing knob name this warning is about. Stable across versions. Agents read warning.knob to decide which knob to drop or substitute on the fallback call.

Source

pub const fn message(self) -> &'static str

Compile-time-constant message body for this code.

Sourced via include_str! from crates/mnem-core/src/retrieve/warnings/<code>.txt. Never varies with user input; this is the sole anti-prompt-injection guarantee.

Source

pub const fn remediation_ref(self) -> &'static str

Path (relative to repo root) of the remediation markdown for this code. xtask lint-warnings asserts the file exists at CI time; agents dereference the ref to get the full ## Agent fallback section.

Source

pub const fn all() -> &'static [Self]

Complete ordered list of every variant. Used by xtask lint-warnings to walk the catalog; the exhaustive match in a unit test pins the list to the enum definition.

Trait Implementations§

Source§

impl Clone for WarningCode

Source§

fn clone(&self) -> WarningCode

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 Copy for WarningCode

Source§

impl Debug for WarningCode

Source§

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

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

impl<'de> Deserialize<'de> for WarningCode

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 WarningCode

Source§

impl Hash for WarningCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for WarningCode

Source§

fn eq(&self, other: &WarningCode) -> 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 WarningCode

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 WarningCode

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> 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<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> 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> 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<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