{"record":{"id":"414efd931e97feba","repo":"JuliusBrussee/caveman","slug":"native-runtime-decode-decision-w","errorCode":null,"errorMessage":"native runtime: decode decision: %w","messagePattern":"native runtime: decode decision: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/nativeruntime/explain.go","lineNumber":55,"sourceCode":"\tobject, err := store.FindTaskDecision(decisionID)\n\tif err != nil {\n\t\treturn DecisionExplanation{}, err\n\t}\n\tvar record struct {\n\t\tSchema               string         `json:\"schema\"`\n\t\tDecisionID           string         `json:\"decision_id\"`\n\t\tTimestampMS          int64          `json:\"timestamp_ms\"`\n\t\tAction               string         `json:\"action\"`\n\t\tReason               string         `json:\"reason\"`\n\t\tInputBasis           map[string]any `json:\"input_basis\"`\n\t\tAlternativesRejected []string       `json:\"alternatives_rejected\"`\n\t\tTaskStateBefore      string         `json:\"task_state_before\"`\n\t\tTaskStateAfter       string         `json:\"task_state_after\"`\n\t\tCurrentness          string         `json:\"currentness\"`\n\t\tRecoveryRef          string         `json:\"recovery_ref\"`\n\t}\n\tif err := json.Unmarshal(object.Data, &record); err != nil {\n\t\treturn DecisionExplanation{}, fmt.Errorf(\"native runtime: decode decision: %w\", err)\n\t}\n\tif record.Schema != \"caveman.native.decision.v1\" || record.DecisionID != decisionID || record.Action == \"\" || record.Reason == \"\" {\n\t\treturn DecisionExplanation{}, errors.New(\"native runtime: invalid decision record\")\n\t}\n\treturn DecisionExplanation{\n\t\tSchema:               WhySchema,\n\t\tDecisionID:           record.DecisionID,\n\t\tSessionID:            object.SessionID,\n\t\tTimestampMS:          record.TimestampMS,\n\t\tAction:               record.Action,\n\t\tReason:               record.Reason,\n\t\tInputBasis:           record.InputBasis,\n\t\tAlternativesRejected: record.AlternativesRejected,\n\t\tTaskStateBefore:      record.TaskStateBefore,\n\t\tTaskStateAfter:       record.TaskStateAfter,\n\t\tCurrentness:          record.Currentness,\n\t\tRecoveryRef:          record.RecoveryRef,\n\t}, nil","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/proxy/internal/nativeruntime/explain.go#L37-L73","documentation":"ExplainDecision could not JSON-decode the persisted decision record from the task store into the expected schema fields, typically because the stored record is corrupt, truncated, or was written by an incompatible schema version.","triggerScenarios":"Thrown at proxy/internal/nativeruntime/explain.go:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the stored decision record for corruption or truncation","Regenerate the decision via the runtime and retry the explanation","Check for a schema migration mismatch between writer and reader"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}