Skip to main content

Refusal

Enum Refusal 

Source
pub enum Refusal {
    ChecksFailed {
        failed: Vec<String>,
        records: Vec<CheckRecord>,
    },
    Rejected {
        reason: String,
    },
    AuthorFailed {
        code: String,
        diagnostics: Option<String>,
    },
    PolicyViolation {
        reason: String,
    },
    SetupFailed {
        step: String,
        reason: String,
    },
    Interrupted,
    TimedOut {
        after_secs: u64,
    },
    NoChange,
    SelfApproval {
        actor: ActorId,
    },
}
Expand description

Why a gate refused.

ChecksFailed carries the check records rather than only the names. A run that fails is exactly when the evidence matters most, so the refusal itself holds it and a caller cannot record the outcome without it.

Variants§

§

ChecksFailed

One or more required checks failed. Named so the reason is legible.

Fields

§failed: Vec<String>
§records: Vec<CheckRecord>
§

Rejected

The reviewer rejected the change.

Fields

§reason: String
§

AuthorFailed

The authoring agent could not run, and left nothing behind.

Distinct from a rejection: nothing was judged. A vendor that hit a rate limit or an expired credential and a vendor that considered the task and declined it are the same empty diff, and only one of them is about the change. Its own words are carried so the difference is legible.

Fields

§code: String
§diagnostics: Option<String>
§

PolicyViolation

The change touched paths the project’s policy does not allow.

Fields

§reason: String
§

SetupFailed

The worktree could not be made ready to work in.

Nothing was judged and nothing was written: the environment was not there. Reporting it as a failed check would say the change was rejected, which is the confusion this variant exists to end.

Fields

§step: String
§reason: String
§

Interrupted

The operator stopped the run.

Not a judgement on the change at all — nobody finished looking at it.

§

TimedOut

The authoring agent outlived the ceiling and was killed.

Not a rejection and not a crash: nothing was judged, and the change was never finished. Reporting it as either would blame the work for the clock.

Fields

§after_secs: u64
§

NoChange

The authoring agent ran cleanly and changed nothing.

A legitimate answer to a task — the work was already done, or the agent judged that nothing was needed — and not one a reviewer can rule on: it would be handed an empty diff and asked what it thinks of it.

§

SelfApproval

The reviewer and the author are the same identity.

Fields

§actor: ActorId

Trait Implementations§

Source§

impl Debug for Refusal

Source§

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

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

impl Eq for Refusal

Source§

impl PartialEq for Refusal

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Refusal

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