Skip to main content

DecisionSummary

Struct DecisionSummary 

Source
pub struct DecisionSummary {
Show 23 fields pub id: String, pub timestamp: String, pub action: String, pub confidence: Option<f64>, pub project: Option<String>, pub tool: Option<String>, pub pid: u32, pub command: Option<String>, pub reasoning: Option<String>, pub user_action: Option<String>, pub override_reason: Option<String>, pub brain_decision_ms: Option<u64>, pub canonical: Option<bool>, pub cache_hit: Option<bool>, pub cost_usd: Option<f64>, pub model: Option<String>, pub outcome_kind: Option<String>, pub outcome_detail: Option<String>, pub suggested_at: Option<u64>, pub resolved_at: Option<u64>, pub why: String, pub decision_source: Option<String>, pub rule_name: Option<String>,
}
Expand description

A single past brain decision, projected for display.

The first six fields are the common shape used by BrainView::recent_decisions. The remaining fields support the Brain Review surface (BrainReviewView); they are Option-wrapped + #[serde(default)] so older BrainView callers can keep treating them as opaque.

Fields§

§id: String§timestamp: String§action: String§confidence: Option<f64>§project: Option<String>§tool: Option<String>§pid: u32

PID of the session this decision belongs to. Used by counterfactual analysis to pair decisions with their subsequent outcome from the same session.

§command: Option<String>

Tool input string when the decision was about a specific command.

§reasoning: Option<String>

Brain’s free-form rationale for the suggestion.

§user_action: Option<String>

What the user did with the suggestion — "accept", "reject", "deny_rule_override", etc.

§override_reason: Option<String>

Why the user overrode the brain (if applicable).

§brain_decision_ms: Option<u64>

Wall-clock latency of the brain decision in milliseconds.

§canonical: Option<bool>

Whether the operator has marked this decision as canonical (teaching material). None for records written before the field existed.

§cache_hit: Option<bool>

Cache hit flag — served from the few-shot store without an LLM call. None before instrumentation.

§cost_usd: Option<f64>

Cost in USD when this decision was made (context snapshot).

§model: Option<String>

Model that produced the suggestion.

§outcome_kind: Option<String>

Resolved outcome category, when known. "success" | "error" | "test_failed" | "skipped" etc. Mirrors the variants of the binary’s brain::decisions::DecisionOutcome enum, flattened to a string so the contract doesn’t pull the enum upward.

§outcome_detail: Option<String>

Free-form detail for failure outcomes (the failing command for test_failed, the error message for error).

§suggested_at: Option<u64>

Epoch seconds when the brain suggestion was first surfaced. Used by time-to-correct analysis. None for records pre-instrumentation or passive observations.

§resolved_at: Option<u64>

Epoch seconds when the user acted on the suggestion. None for passive observations or records still in flight.

§why: String

One-line, human-readable explanation of why the brain reached this decision (#372): source, confidence, rule/few-shot provenance. Rendered inline in the review detail panel. Empty for records that carry no derivable cause.

§decision_source: Option<String>

Where the decision originated (#372): "llm", "rule", "few_shot".

§rule_name: Option<String>

The auto-rule that fired, when this was a rule decision (#372).

Implementations§

Source§

impl DecisionSummary

Source

pub fn is_positive(&self) -> bool

Whether the user agreed with the brain (or the call was auto-executed). Mirrors brain::decisions::DecisionRecord::is_positive.

Source

pub fn is_negative(&self) -> bool

Whether the user disagreed with the brain. Mirrors brain::decisions::DecisionRecord::is_negative.

Trait Implementations§

Source§

impl Clone for DecisionSummary

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 DecisionSummary

Source§

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

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

impl<'de> Deserialize<'de> for DecisionSummary

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 DecisionSummary

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