Skip to main content

HaltScope

Enum HaltScope 

Source
pub enum HaltScope {
    Tenant,
    Agent {
        name: String,
    },
    Revision {
        digest: Digest,
    },
    Subject {
        id: String,
    },
}
Expand description

What an emergency stop covers.

A plane hosts many agents, and agent 12 of 28 is misbehaving at three in the morning is the ordinary incident — a switch that can only stop all 28 is not an emergency stop for it. So a halt names its scope. Every standing halt is checked together and a run is refused if any matches, so a broad stop and a narrow one coexist and lifting the narrow one leaves the broad one standing.

Revision names exact reviewed bytes, so a fix published as a new version runs while the broken revision stays stopped — prefer it when a deploy is the incident. Agent covers every revision of a declared name. Tenant is the power switch.

Subject is keyed on the other axis, and it is the one to reach for when the incident is not the workload but the authority: a credential somebody has withdrawn, a service account that turned out to be shared, a person who has left. The three scopes above ask what is running; this one asks who it is running for: any principal on the delegation chain bound at admission and carried on every run’s IdentityBound record — the person at its root, each workload it was delegated through, and the one acting. Authority flows down the chain, so withdrawing any link withdraws everything below it. A run with no chain of its own is covered by none of them — there is nothing to key on, and inventing a match would stop work for a reason nobody could look up.

A name is a string the manifest’s author typed, and a halt is still keyed on one because it is a refusal: a name-keyed refusal at worst stops work somebody did not mean to stop, which an operator sees at once and lifts — the opposite of a name-keyed grant, which context.agent.name is therefore never used for.

Variants§

§

Tenant

Everything this tenant would start. The power switch.

§

Agent

Every revision of one declared agent, by metadata.name.

Fields

§name: String
§

Revision

One exact reviewed revision, by manifest digest.

The form that is precise about which revision is stopped, so a fix published as a new version is not stopped with it.

Fields

§digest: Digest
§

Subject

Everything acting for one principal, wherever it stands on the run’s delegation chain.

The authority axis rather than the workload axis. Ordered last so that it wins the message when several scopes cover one run: an operator who withdrew a credential and whoever is refused are looking for different sentences, and “the tenant is halted” sends the second one to the wrong incident.

Fields

Implementations§

Source§

impl HaltScope

Source

pub const FORMS: [&'static str; 4]

Every form parse accepts, written the way an operator types it.

One list, because a scope an operator cannot learn the spelling of is a control they cannot reach — and the CLI’s help, its refusal and the operator API all have to say the same thing this parser accepts. Held to the list rather than to the variant count: a count agrees with itself while a form is missing.

Source

pub fn agent(name: impl Into<String>) -> Self

Every revision of one declared agent.

Source

pub const fn revision(digest: Digest) -> Self

One exact reviewed revision.

Source

pub fn subject(id: impl Into<String>) -> Self

Everything acting for one principal on a run’s delegation chain.

Source

pub fn key(&self) -> String

The durable key, and the form an operator types on the command line.

Round-trips through parse. One column rather than a discriminant beside a value, because a scope stored in two columns is a scope two backends can disagree about the emptiness rules of.

Source

pub fn forms() -> String

The forms, joined for a refusal a person reads.

Source

pub fn parse(key: &str) -> Option<Self>

Read back a stored key.

None for anything this build does not understand — a scope written by a newer version, say. A caller reading standing halts must treat that as corruption rather than skipping the row: a halt this instance cannot read is one it must not run through.

Source

pub fn withdraws_from(&self, chain: &Delegation) -> Option<&str>

The principal this halt withdraws, if it is anywhere on chain.

The one scope that reaches work already running. The others stop admission, because cutting a saga mid-flight leaves reversals unrun; here the incident is the authority, and a run carrying on under a withdrawn credential is the harm. It pauses: the run stops at its next step boundary, its mutations stand, and lifting the halt continues it.

Source

pub fn withdrawn_subject(&self) -> Option<&str>

The principal this halt names, when it names one.

Source

pub fn covers( &self, agent: Option<&AgentIdentity>, chain: Option<&Delegation>, ) -> bool

Whether this halt stops a run governed by agent and acting under chain.

Both, because the scopes ask different questions. Three of them ask what is running and one asks who it runs for, so a caller that passed only the agent would silently never match a withdrawn authority — the worst failure available here, since it is a refusal that does not happen and therefore leaves no trace at all.

A run with neither — a skill registered directly on the plane, with no manifest and no chain — is stopped only by Tenant. There is nothing narrower to key it on, and inventing a match would stop work for a reason nobody could look up.

Trait Implementations§

Source§

impl Clone for HaltScope

Source§

fn clone(&self) -> Self

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 HaltScope

Source§

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

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

impl Display for HaltScope

Source§

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

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

impl Eq for HaltScope

Source§

impl Hash for HaltScope

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 Ord for HaltScope

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for HaltScope

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for HaltScope

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for HaltScope

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> 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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
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

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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> ToSmolStr for T
where T: Display + ?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

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