{"record":{"id":"e10539b32fdfd3a6","repo":"JuliusBrussee/caveman","slug":"compressed-grading-w","errorCode":null,"errorMessage":"compressed grading: %w","messagePattern":"compressed grading: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/evals/quality.go","lineNumber":201,"sourceCode":"\t}\n\treport.CompressedUsage, err = fillUsage(counter, compressedPrompt, compressedResp, opts.RequireUsage)\n\tif err != nil {\n\t\treturn QualityReport{}, fmt.Errorf(\"compressed usage: %w\", err)\n\t}\n\n\tbaseSubject := Subject{Input: input, Output: baseline.Output, ContentType: contentType, PassedThrough: true}\n\tcompSubject := Subject{Input: input, Output: compressedResp.Output, Ratio: compressionRatio, ContentType: contentType, PassedThrough: passedThrough}\n\tgrader := opts.Grader\n\tif grader == nil {\n\t\tgrader = LocalGrader{}\n\t}\n\treport.BaselineFailures, err = gradeFailures(ctx, grader, graders, baseSubject)\n\tif err != nil {\n\t\treturn QualityReport{}, fmt.Errorf(\"baseline grading: %w\", err)\n\t}\n\treport.CompressedFailures, err = gradeFailures(ctx, grader, graders, compSubject)\n\tif err != nil {\n\t\treturn QualityReport{}, fmt.Errorf(\"compressed grading: %w\", err)\n\t}\n\treport.BaselinePassed = len(report.BaselineFailures) == 0\n\treport.CompressedPassed = len(report.CompressedFailures) == 0\n\tif report.BaselinePassed && report.CompressedPassed {\n\t\treport.Retention = 1\n\t}\n\treturn report, nil\n}\n\nfunc fillUsage(counter tokens.Counter, prompt []byte, resp ModelResponse, requireRunnerUsage bool) (ModelUsage, error) {\n\tusage := resp.Usage\n\tif usage.InputTokens > 0 && usage.OutputTokens > 0 {\n\t\tusage.Source = \"runner\"\n\t\treturn usage, nil\n\t}\n\tif requireRunnerUsage {\n\t\treturn ModelUsage{}, fmt.Errorf(\"runner did not return input/output token usage\")\n\t}","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/engine/evals/quality.go#L183-L219","documentation":"Wraps gradeFailures for the compressed subject in runQuality: the grader errored evaluating the compressed variant's answer. The baseline may have graded fine; this failure is about grading infrastructure, not answer quality.","triggerScenarios":"Thrown at engine/evals/quality.go:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped grader error","Retry the run for transient grader (model) failures","Check that the compressed output is well-formed for the grader to consume"],"exampleFix":null,"handlingStrategy":"try-catch","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"}