{"record":{"id":"e92f6408813b2397","repo":"JuliusBrussee/caveman","slug":"cachebench-no-observation-records","errorCode":null,"errorMessage":"cachebench: no observation records","messagePattern":"cachebench: no observation records","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/observed.go","lineNumber":142,"sourceCode":"\t\tvar trailing any\n\t\tif err := decoder.Decode(&trailing); err != io.EOF {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: trailing JSON\", line)\n\t\t}\n\t\tif record.Schema != ObservationSchema {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: schema %q\", line, record.Schema)\n\t\t}\n\t\tif strings.TrimSpace(record.RequestID) == \"\" || seen[record.RequestID] {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: observation line %d: empty or duplicate request_id\", line)\n\t\t}\n\t\tseen[record.RequestID] = true\n\t\trecord.Usage = append(json.RawMessage(nil), record.Usage...)\n\t\trecords = append(records, record)\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"cachebench: read observations: %w\", err)\n\t}\n\tif len(records) == 0 {\n\t\treturn nil, errors.New(\"cachebench: no observation records\")\n\t}\n\tif err := validateObservationRecords(records); err != nil {\n\t\treturn nil, err\n\t}\n\treturn records, nil\n}\n\n// EvaluateObserved evaluates supplied observations without completeness claim.\nfunc EvaluateObserved(records []ObservationRecord, target Target) (Report, error) {\n\tif err := validateTarget(target); err != nil {\n\t\treturn Report{}, err\n\t}\n\tif len(records) == 0 {\n\t\treturn Report{}, errors.New(\"cachebench: no observation records\")\n\t}\n\tif err := validateObservationRecords(records); err != nil {\n\t\treturn Report{}, err\n\t}","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/observed.go#L124-L160","documentation":"Raised in ReadObservationJSONLWithLimits when the stream contained zero valid observation records (empty input or all lines filtered/errored before append). Evidence-based evaluation requires at least one record, so an empty population is a hard error rather than a trivially-passing report.","triggerScenarios":"Thrown at cacheengine/cachebench/observed.go:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the observation JSONL file is non-empty and matches ObservationSchema","Check that request_id values are present and not duplicates (duplicates abort earlier)","Regenerate observations from a replay run before evaluating"],"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"}