{"record":{"id":"1fe0b410a21a8b8b","repo":"JuliusBrussee/caveman","slug":"cachebench-session-q-row-d-w","errorCode":null,"errorMessage":"cachebench: session %q row %d: %w","messagePattern":"cachebench: session %q row (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/corpus.go","lineNumber":550,"sourceCode":"\tsummary := CorpusSummary{\n\t\tName: corpus.Metadata.Name, License: corpus.Metadata.License, Revision: corpus.Metadata.Revision,\n\t\tSHA256: corpus.SHA256, Sessions: len(sessions), Requests: len(corpus.Rows), Sources: map[string]int{},\n\t\tRetainedBytes: corpus.Bytes,\n\t\tTokenBasis:    counter.Name() + \" estimate over canonical message JSON\",\n\t}\n\tif summary.RetainedBytes == 0 {\n\t\tsummary.RetainedBytes = corpusRetainedBytes(corpus.Rows)\n\t}\n\tturns := make([]int, 0, len(sessions))\n\tfor _, id := range order {\n\t\tsession := sessions[id]\n\t\tturns = append(turns, len(session.Rows))\n\t\tsummary.Sources[corpusSource(id)]++\n\t\tvar previous []PrefixSegment\n\t\tfor index, row := range session.Rows {\n\t\t\tprefix, err := corpusPrefix(row.Input, counter)\n\t\t\tif err != nil {\n\t\t\t\treturn CorpusSummary{}, fmt.Errorf(\"cachebench: session %q row %d: %w\", id, index, err)\n\t\t\t}\n\t\t\teligible := prefixTokens(prefix)\n\t\t\tsummary.EstimatedInputTokens += int64(eligible)\n\t\t\tif index > 0 {\n\t\t\t\treused := commonPrefixTokens(previous, prefix)\n\t\t\t\tsummary.EstimatedReusableTokens += int64(reused)\n\t\t\t\tif reused > 0 {\n\t\t\t\t\tsummary.OpportunityRequestHitRate++\n\t\t\t\t}\n\t\t\t\tif len(prefix) > len(previous) && samePrefix(previous, prefix) {\n\t\t\t\t\tsummary.StrictPrefixExtensions++\n\t\t\t\t} else {\n\t\t\t\t\tsummary.MutatedOrCompactedTransitions++\n\t\t\t\t}\n\t\t\t}\n\t\t\tprevious = prefix\n\t\t}\n\t}","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/corpus.go#L532-L568","documentation":"A per-row failure while summarising or expanding a corpus session (the wrapped error carries the cause, e.g. request building or validation); the session id and row index pinpoint the offending request.","triggerScenarios":"Thrown at cacheengine/cachebench/corpus.go:550 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow the wrapped error for the underlying cause","Fix or remove the cited row within the named session"],"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"}