pub struct Decision {
pub orders: Vec<Order>,
pub reasoning: String,
pub cost: Option<DecisionCost>,
}Expand description
What the agent returns.
Fields§
§orders: Vec<Order>§reasoning: StringFree-text rationale, captured into the trajectory for auditability.
cost: Option<DecisionCost>Optional self-reported compute/token spend for producing this decision.
The engine accumulates it into the run’s cost, which drives the
cost-normalized leaderboard columns (return_per_cost / dsr_per_cost =
skill-per-dollar-of-compute). None = not reported, so existing agents
need no change and the cost columns stay None (back-compat).
Implementations§
Source§impl Decision
impl Decision
Sourcepub fn validate_for(
&self,
observation: &MarketObservation,
) -> Result<(), String>
pub fn validate_for( &self, observation: &MarketObservation, ) -> Result<(), String>
Validate the semantic part of the closed wire contract against the observation this decision answers. Deserialization enforces the object shape; this method closes the gaps JSON Schema cannot express cheaply at the transport boundary: point-in-time symbol membership, one target per symbol, finite bounded weights/confidence, and nonnegative finite spend.
action is deliberately not inferred from the target sign. It is an
audit label: selling a long can leave a positive target, and buying to
cover can leave a negative one. The signed target remains authoritative.