Skip to main content

SetupReport

Struct SetupReport 

Source
pub struct SetupReport {
    pub login: StepResult<LoginInfo>,
    pub claim: StepResult<ClaimInfo>,
    pub claim_attempts: Vec<TierAttempt>,
    pub models: StepResult<ModelsInfo>,
    pub status: StepResult<StatusResponse>,
    pub auth_expired: bool,
}
Expand description

Display-friendly summary of each step’s outcome. Returned by run so the caller can render however it wants (plain stdout, TUI body scrollback, future JSON output for scripting).

Fields§

§login: StepResult<LoginInfo>§claim: StepResult<ClaimInfo>§claim_attempts: Vec<TierAttempt>

Per-tier cascade history. Populated by step_claim with one entry per tier actually attempted (in cascade order Max → Pro → Lite). Empty when the cascade never ran (e.g. login failed upstream — claim is Skipped(CASCADE_FROM_UPSTREAM_FAIL)) or when a legacy test fixture wants the old single-row claim summary. render walks this to emit one row per tier so refused / errored intermediate tiers are visible, not hidden behind a single “claim failed” summary.

§models: StepResult<ModelsInfo>§status: StepResult<StatusResponse>§auth_expired: bool

True when any API call rejected the stored bearer token (401/403). is_logged_in() only checks “does auth.toml exist” and get_valid_token only refreshes when the recorded expires_in says so — neither catches a server-side revocation or a refresh-token that the broker no longer accepts. Shells (TUI /codingplan, CLI atomcode codingplan) read this flag to drive an inline re-OAuth + retry instead of leaving the user staring at a “claim failed — run atomcode login again” line when /login would have fixed it in one step.

Implementations§

Source§

impl SetupReport

Source

pub fn render(&self) -> String

Render as a multi-line plain-text block for stdout / TUI body. Shared by the CLI subcommand and the /codingplan slash command so the visual contract stays consistent.

Source

pub fn should_persist_config(&self) -> bool

True iff every persist-relevant step (login + claim + models) either succeeded outright or was skipped non-fatally (server reported duplicate=true, model list already current, etc.). Callers use this to decide whether to persist config changes to disk.

claim MUST be in the predicate: when claim returns Err (e.g. backend 500 like the AtomGit claim-v2 transaction- rollback bug), run() short-circuits and parks models as Skipped(CASCADE_FROM_UPSTREAM_FAIL) so the report stays focused on the actual failure. Without the claim check the gate flipped to true on every claim-failure path — triggering save_and_reload to rewrite config.toml unconditionally. That clobbered any manual edits the user made between TUI startup and /codingplan, and read as “claim failed but it still wrote models to my config”.

Trait Implementations§

Source§

impl Clone for SetupReport

Source§

fn clone(&self) -> SetupReport

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 SetupReport

Source§

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

Formats the value using the given formatter. Read more

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> 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