{"record":{"id":"e3723009050051a2","repo":"JuliusBrussee/caveman","slug":"cachebench-replay-evidence-d-w","errorCode":null,"errorMessage":"cachebench: replay evidence %d: %w","messagePattern":"cachebench: replay evidence (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":263,"sourceCode":"// SummarizeReplayEvidence validates and aggregates replay records.\nfunc SummarizeReplayEvidence(records []ReplayEvidenceRecord) (ReplayEvidenceSummary, error) {\n\tif len(records) == 0 {\n\t\treturn ReplayEvidenceSummary{}, errors.New(\"cachebench: no replay evidence\")\n\t}\n\tsummary := ReplayEvidenceSummary{\n\t\tSchema: ReplaySummarySchema, Requests: len(records),\n\t\tTimingFaithful: true, InputBudgetClaimedProviderCounted: true,\n\t}\n\ttype accumulator struct {\n\t\tsummary   ProviderReplaySummary\n\t\tlatencies []int64\n\t}\n\tgroups := map[string]*accumulator{}\n\tseen := map[string]bool{}\n\tlatencies := make([]int64, 0, len(records))\n\tfor index, record := range records {\n\t\tif err := validateReplayEvidence(record); err != nil {\n\t\t\treturn ReplayEvidenceSummary{}, fmt.Errorf(\"cachebench: replay evidence %d: %w\", index, err)\n\t\t}\n\t\tif seen[record.RequestID] {\n\t\t\treturn ReplayEvidenceSummary{}, fmt.Errorf(\"cachebench: duplicate replay evidence request %q\", record.RequestID)\n\t\t}\n\t\tseen[record.RequestID] = true\n\t\tgroup := groups[record.Provider]\n\t\tif group == nil {\n\t\t\tgroup = &accumulator{summary: ProviderReplaySummary{Provider: record.Provider}}\n\t\t\tgroups[record.Provider] = group\n\t\t}\n\t\tgroup.summary.Requests++\n\t\tif record.Success {\n\t\t\tsummary.Successful++\n\t\t\tgroup.summary.Successful++\n\t\t\tif record.QualityPassed {\n\t\t\t\tsummary.QualityPassed++\n\t\t\t\tgroup.summary.QualityPassed++\n\t\t\t}","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay.go#L245-L281","documentation":"SummarizeReplayEvidence wraps a failed validateReplayEvidence call with the record's index. The underlying validation error (reported separately) explains which field of the replay evidence record was invalid.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow the wrapped validation error for the offending field","Fix or drop the cited evidence record before summarising"],"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"}