Skip to main content

BoundGraphError

Enum BoundGraphError 

Source
#[non_exhaustive]
pub enum BoundGraphError { GrantViolation { step: StepId, requested: Box<GrantAtom>, permitted: Box<GrantSet>, }, BudgetExceeded { step: StepId, unit: &'static str, used: u64, reserved: u64, }, EvidenceRejected { step: StepId, reason: String, }, DisjointnessUnproven { left: Box<GrantAtom>, right: Box<GrantAtom>, }, SandboxError { step: StepId, detail: String, }, ProviderError { provider: String, detail: String, retryable: bool, }, LedgerChainBroken { seq: u64, expected: Digest, found: Digest, }, Canonical(CanonicalError), ContextOverBudget(ContextOverBudget), }
Expand description

Anything that can go wrong inside the governed span.

Variants are grouped by what a caller would do about them, which is what recover matches on.

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

GrantViolation

A step requested authority it does not have. Law I.

Most of these are caught at compile time (US-0403); this is the runtime case, where a template resolved to something outside its envelope.

Fields

§step: StepId

The step that overreached.

§requested: Box<GrantAtom>

The atom it asked for.

§permitted: Box<GrantSet>

What it was actually permitted.

§

BudgetExceeded

A step ran out of budget. Law II, economically.

Catchable by recover, which is the point: degrade to a cheaper model, return a partial result, or escalate to a human.

Fields

§step: StepId

The step that overran.

§unit: &'static str

Which budget: tokens, usd, wall, or calls.

§used: u64

What it consumed.

§reserved: u64

What it was allowed.

§

EvidenceRejected

A commit was refused because evidence did not permit it. Law III.

Fields

§step: StepId

The step that was refused.

§reason: String

The verdict’s reason, or why evidence was missing.

§

DisjointnessUnproven

Two parallel branches could not be proved not to interfere.

Conservative by default: unprovable is a refusal, never an assumption.

Fields

§left: Box<GrantAtom>

One side of the offending pair.

§right: Box<GrantAtom>

The other side.

§

SandboxError

The sandbox could not run a tool, or the tool failed inside it.

Fields

§step: StepId

The step whose tool failed.

§detail: String

What went wrong.

§

ProviderError

A model provider failed.

Fields

§provider: String

Which provider.

§detail: String

What went wrong.

§retryable: bool

Whether failing over or retrying could succeed.

§

LedgerChainBroken

The ledger’s hash chain does not verify — tampering or corruption.

Fields

§seq: u64

The entry whose link failed.

§expected: Digest

The digest the chain required.

§found: Digest

The digest actually recorded.

§

Canonical(CanonicalError)

A value could not be canonically encoded or decoded.

§

ContextOverBudget(ContextOverBudget)

An admission produced a context over its own ceiling.

Implementations§

Source§

impl BoundGraphError

Source

pub fn grant_violation( step: StepId, requested: GrantAtom, permitted: GrantSet, ) -> Self

A step asked for authority beyond its grant.

Source

pub fn disjointness_unproven(left: GrantAtom, right: GrantAtom) -> Self

Two branches could not be proved disjoint.

Source

pub fn step(&self) -> Option<StepId>

Which step this failure belongs to, where that is meaningful.

Whole-graph failures such as DisjointnessUnproven have no single step and return None.

Source

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

A stable machine-readable class, for recover and the Python bindings.

Stable across releases: these strings are API.

Source

pub fn is_retryable(&self) -> bool

Whether retrying or failing over could plausibly succeed.

A grant violation never becomes permitted by retrying; a rate-limited provider might.

Trait Implementations§

Source§

impl Debug for BoundGraphError

Source§

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

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

impl Display for BoundGraphError

Source§

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

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

impl Error for BoundGraphError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CanonicalError> for BoundGraphError

Source§

fn from(source: CanonicalError) -> Self

Converts to this type from the input type.
Source§

impl From<ContextOverBudget> for BoundGraphError

Source§

fn from(source: ContextOverBudget) -> Self

Converts to this type from the input type.

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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