{"record":{"id":"ee4c539bb44b80f1","repo":"JuliusBrussee/caveman","slug":"cachebench-observation-d-missing-provider-or-qua","errorCode":null,"errorMessage":"cachebench: observation %d missing provider or quality evidence provenance","messagePattern":"cachebench: observation (.+?) missing provider or quality evidence provenance","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/observed.go","lineNumber":204,"sourceCode":"\t\t\"provider counters prove reads and writes only for supplied records; evaluator binds but does not inspect retained response artifacts\",\n\t\t\"quality_passed is supplied by external task verifier; evaluator binds but does not inspect retained grader artifacts\",\n\t\t\"report does not prove omitted requests, tail completeness, production prevalence, invoice spend, or verified savings\",\n\t}\n\treturn report, nil\n}\n\nfunc validateObservationRecords(records []ObservationRecord) error {\n\tseen := make(map[string]bool, len(records))\n\tfor index, record := range records {\n\t\tif record.Schema != ObservationSchema && record.Schema != ObservationSchemaV2 {\n\t\t\treturn fmt.Errorf(\"cachebench: observation %d schema %q\", index, record.Schema)\n\t\t}\n\t\tif !validBoundedText(record.RequestID, 512, false) || seen[record.RequestID] {\n\t\t\treturn fmt.Errorf(\"cachebench: observation %d empty or duplicate request_id\", index)\n\t\t}\n\t\tseen[record.RequestID] = true\n\t\tif !validBoundedText(record.Provider, 64, false) || !validBoundedText(record.Epoch, 1024, false) || !validBoundedText(record.QualityVerifier, 256, false) || !validBoundedText(record.ProfileID, 256, true) || !validBoundedText(record.EngineReason, 1024, true) || !validEvidenceSHA256(record.ProviderEvidenceSHA256) || !validEvidenceSHA256(record.QualityEvidenceSHA256) {\n\t\t\treturn fmt.Errorf(\"cachebench: observation %d missing provider or quality evidence provenance\", index)\n\t\t}\n\t\tif record.RequestBodySHA256 != \"\" && !validSHA256(record.RequestBodySHA256) {\n\t\t\treturn fmt.Errorf(\"cachebench: observation %d has invalid request body digest\", index)\n\t\t}\n\t\toptimizerIDs := map[string]bool{}\n\t\tfor _, optimizerID := range record.OptimizerIDs {\n\t\t\tif !validBoundedText(optimizerID, 256, false) || optimizerIDs[optimizerID] {\n\t\t\t\treturn fmt.Errorf(\"cachebench: observation %d has invalid optimizer identity\", index)\n\t\t\t}\n\t\t\toptimizerIDs[optimizerID] = true\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validSHA256(value string) bool {\n\treturn len(value) == 64 && strings.Trim(value, \"0123456789abcdef\") == \"\"\n}","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/observed.go#L186-L222","documentation":"validateObservationRecords found a record missing provenance fields: provider, epoch, or quality verifier name failed the bounded-text check. Provenance is mandatory so reports can attribute evidence.","triggerScenarios":"Thrown at cacheengine/cachebench/observed.go:204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit provider, epoch, and quality_verifier on every observation record","Verify the capture pipeline forwards verifier identity"],"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"}