decision
Select the action with highest expected utility for a binary forecast.
Contract
Utilities are finite and share a scale. The result uses a zero-based action index. Exact ties retain the first action; the library does not choose an organization’s utility function.
Fields
| Field | Type | Required |
|---|---|---|
actions | array of Action | Yes |
op | "decision" | Yes |
probability | Probability | Yes |
This operation needs no existing question or forecast. Use --memory for a calculation-only session.
Request
Send this object on one line. It is expanded below for readability.
{
"version": 1,
"id": "example",
"command": {
"op": "decision",
"actions": [
{
"if_yes": 10.0,
"if_no": -10.0
},
{
"if_yes": 0.0,
"if_no": 0.0
}
],
"probability": 0.8
}
}
Response
This response is generated by executing the example against the current binary. Commit timestamps, when present, are shown as <runtime UTC seconds>; the actual protocol returns integer UTC seconds.
{
"version": 1,
"id": "example",
"result": {
"action_index": 0,
"expected_utility": 6.0
}
}
Verification
The documentation gate executes the setup and request, then checks the following result fields against independently specified expectations:
JSON pointer within result | Expected |
|---|---|
/action_index | 0 |
/expected_utility | 6.0 |
Float comparisons use a 1e-12 tolerance. Request schema validation and cross-record validation still apply. See errors and recovery for failure handling.