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: u32PID 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: StringOne-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
impl DecisionSummary
Sourcepub fn is_positive(&self) -> bool
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.
Sourcepub fn is_negative(&self) -> bool
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
impl Clone for DecisionSummary
Source§impl Debug for DecisionSummary
impl Debug for DecisionSummary
Source§impl<'de> Deserialize<'de> for DecisionSummary
impl<'de> Deserialize<'de> for DecisionSummary
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DecisionSummary
impl RefUnwindSafe for DecisionSummary
impl Send for DecisionSummary
impl Sync for DecisionSummary
impl Unpin for DecisionSummary
impl UnsafeUnpin for DecisionSummary
impl UnwindSafe for DecisionSummary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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