Skip to main content

MissionState

Struct MissionState 

Source
pub struct MissionState {
Show 20 fields pub mission: Mission, pub feature_base_shas: BTreeMap<String, String>, pub runs: BTreeMap<String, WorkerRun>, pub totals: TokenUsage, pub total_cost_usd: f64, pub pending_user_messages: Vec<String>, pub recent_decisions: Vec<String>, pub config: MissionConfig, pub latest_plan_revision: u32, pub pending_revision: Option<PendingRevision>, pub pending_grant_request: Option<PendingGrantRequest>, pub pending_questions: Vec<PendingQuestion>, pub question_count: u32, pub last_seq: u64, pub escalated_milestones: u32, pub local_executor_milestones: u32, pub workspace_provider: Option<String>, pub workspace_pin: Option<WorkspacePin>, pub workspace_lifecycle: Option<WorkspaceLifecycle>, pub resolved_divergence_units: BTreeSet<String>,
}

Fields§

§mission: Mission§feature_base_shas: BTreeMap<String, String>

Sequential feature baselines pinned before worker execution. Empty in older logs; reconstructed from feature.progress rather than trusted from the cached state file.

§runs: BTreeMap<String, WorkerRun>

All runs keyed by run id (BTreeMap for deterministic serialization).

§totals: TokenUsage§total_cost_usd: f64§pending_user_messages: Vec<String>

Queued user messages not yet consumed by the orchestrator.

§recent_decisions: Vec<String>

Recent orchestrator decision summaries (newest last; capped by reducer).

§config: MissionConfig

Per-role config overrides applied mid-mission via config.changed.

§latest_plan_revision: u32

Latest revision number observed in the durable log. 0 means the original approved plan is still the only plan of record.

§pending_revision: Option<PendingRevision>

A proposed revised plan awaiting human approve/reject. The mission status does not change while this is set; the run loop parks on this gate and the repo stays busy until consent arrives.

§pending_grant_request: Option<PendingGrantRequest>

A capability denial (today: a validator command outside its allow-set) awaiting an operator approve/deny decision. Like pending_revision, the run loop parks on this gate; approving extends command_grants and respawns, denying (or a timeout) fails the feature closed.

§pending_questions: Vec<PendingQuestion>

The pending-decision projection (ticket structured-human-question-events): open structured human questions, folded from question.opened, in open order; question.answered / question.cleared remove their entry. Rendered by the dashboard and Slack in the SAME “your move” area as the parked grant (distinct kind, shared chrome — the D-X channel unification). Unlike pending_grant_request the run loop never gates on this list; empty on pre-field logs and omitted from the wire then.

§question_count: u32

Total question.opened events folded — the per-mission monotonic counter the engine mints the next question id (q-<n+1>) from. Restart-safe by construction (derived from the log, never reset by answers or clears), so an id is never reused after a process restart. 0 on pre-field logs and omitted from the wire then.

§last_seq: u64

Seq of the last event folded in.

§escalated_milestones: u32

Count of tier.escalated events folded (executor bumped from local to frontier after repeated failed local validations).

§local_executor_milestones: u32

Count of milestones whose milestone.started folded while the executor tier was ExecutorTier::Local — the denominator for MissionState::escalation_rate.

§workspace_provider: Option<String>

Kind of the workspace provider that last provisioned this mission’s workspace, folded from workspace.provisioned (design D-B/D-E). None in logs predating the provider seam.

§workspace_pin: Option<WorkspacePin>

The workspace provider identity pinned at plan approval, folded from workspace.provider.pinned (design D-B). None in logs predating the pin event (missions approved before pinning existed).

§workspace_lifecycle: Option<WorkspaceLifecycle>

The last known workspace lifecycle transition (state + ts), folded from workspace.teardown events carrying a state (ticket workspace-idle-hibernate). None in logs predating the state field — v1 keep-only teardowns carried no outcome.

§resolved_divergence_units: BTreeSet<String>

Dispatch-pool units with a recorded resolution, folded from divergence.resolved (ticket divergence-first-class-event, KRZ-304). The engine emits at most one resolution per unit — the FIRST operator judgement stands — and this set is how the unblock path knows, across a process restart, that a unit’s judgement already landed. Derived at fold time (state.json is only a cache of the fold); empty on pre-pool logs and omitted from the wire then.

Implementations§

Source§

impl MissionState

Source

pub fn escalation_rate(&self) -> f64

Share of local-tier milestones that were escalated to Frontier. 0.0 when no milestone has ever started under the Local tier (no divide-by-zero).

Source

pub fn executor_tier(&self) -> ExecutorTier

Which inference tier the Worker executes this mission on, derived from the current Worker RoleConfig.backend rather than stored: ExecutorTier::Local when the Worker backend is BackendKind::Local (applied at seed time by crate::config::apply_executor_routing or by any later config.changed), else ExecutorTier::Frontier. A configured dispatch pool (worker_candidates) is always Frontier: pool candidates are never local-backed (validation rejects local entries), so a stray local worker.backend alongside a pool must not classify the mission’s spend as $0-marginal.

Trait Implementations§

Source§

impl Clone for MissionState

Source§

fn clone(&self) -> MissionState

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 MissionState

Source§

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

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

impl<'de> Deserialize<'de> for MissionState

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 Serialize for MissionState

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

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

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