{"record":{"id":"46102e446625be4e","repo":"JuliusBrussee/caveman","slug":"answer-key-runner-requires-expected-answer","errorCode":null,"errorMessage":"answer-key runner requires expected answer","messagePattern":"answer-key runner requires expected answer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/evals/quality.go","lineNumber":339,"sourceCode":"\treturn []byte(\"Use the context to answer the question.\\n\\nContext:\\n\" + string(context) + \"\\n\\nQuestion:\\n\" + strings.TrimSpace(question) + \"\\n\\nAnswer only.\")\n}\n\nfunc expectedAnswer(graders []Grader) string {\n\tfor _, g := range graders {\n\t\tif g.Type == \"exact_match\" {\n\t\t\treturn graderString(g)\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// AnswerKeyModel is an explicit offline smoke runner. It never calls a provider;\n// it returns the fixture's expected answer and labels usage as local.\ntype AnswerKeyModel struct{}\n\nfunc (AnswerKeyModel) Complete(_ context.Context, req ModelRequest) (ModelResponse, error) {\n\tif strings.TrimSpace(req.ExpectedAnswer) == \"\" {\n\t\treturn ModelResponse{}, fmt.Errorf(\"answer-key runner requires expected answer\")\n\t}\n\treturn ModelResponse{Output: []byte(req.ExpectedAnswer)}, nil\n}\n","sourceCodeStart":321,"sourceCodeEnd":343,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/evals/quality.go#L321-L343","documentation":"AnswerKeyModel.Complete is an offline smoke runner that returns the fixture's expected answer; it requires an exact_match grader supplying that expected answer. This error fires when a fixture routed to the answer-key runner has no exact_match grader, so there is nothing to return.","triggerScenarios":"Thrown at engine/evals/quality.go:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add an exact_match grader with the expected answer to the fixture's quality graders","Route the fixture to a real provider model instead of the answer-key runner"],"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"}