resolve
Close out a prediction with what actually happened. The surprise value (auto-derived if you don't supply one) feeds calibration.
Signature
resolve({
prediction_id: number,
outcome: 'correct' | 'incorrect' | 'partial',
actual: string,
surprise?: number
}) → { prediction_id: number, outcome: string, surprise: number }
| Param | Type | Required | Description |
|---|---|---|---|
prediction_id | int | yes | Id of the prediction to resolve. |
outcome | enum | yes | correct, incorrect, or partial. |
actual | string | yes | What actually happened. |
surprise | number 0..1 | no | Override the derived value. |
Example
curl -X POST https://mneva.dev/v1/resolve \
-H "x-mneva-key: $MNEVA_KEY" \
-H "content-type: application/json" \
-d '{
"prediction_id": 1,
"outcome": "incorrect",
"actual": "deploy failed — missing env var"
}'
Response:
{ "prediction_id": 1, "outcome": "incorrect", "surprise": 0.9 }
The prediction was confidence 0.9 and the outcome was incorrect, so derived surprise is 0.9 — a confident wrong is the loudest possible miss. That fact now feeds every future assess and calibration in the prediction's domain.
A prediction can only be resolved once. Re-calling resolve with the same id returns 404 prediction X is already resolved.
Surprise — derived or supplied
If you don't pass surprise, Mneva derives it from outcome + confidence:
correct→1 − confidence(low surprise if you expected to be right)incorrect→confidence(high surprise if you were confidently wrong)partial→|0.5 − confidence|(modest mismatch)
The derived value is correct most of the time. Override it when you know the surprise was different from what the math implies — for instance, a prediction you'd given confidence 0.4 turned out to be incorrect in an unexpected way; the math says surprise 0.4, but the manner of being wrong might warrant a higher number to feed calibration.
The supplied value is clamped to [0, 1].