JuliusBrussee/caveman · error
cachebench: observation
Error message
cachebench: observation %d has invalid optimizer identity
What it means
validateObservationRecords found invalid optimizer attribution: profile id/attribution text or optimizer id entries failed the bounded-text checks. These fields tie cache savings to specific optimizers and must be well-formed.
Solutions
- Ensure the engine result's profile and optimizer ids are propagated unmodified
- Sanitize optimizer identifiers at capture time
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cacheengine/cachebench/observed.go:212 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/1a88345a345a568d.
Report an issue: GitHub.
Appendix: source
Thrown at cacheengine/cachebench/observed.go:212
seen := make(map[string]bool, len(records))
for index, record := range records {
if record.Schema != ObservationSchema && record.Schema != ObservationSchemaV2 {
return fmt.Errorf("cachebench: observation %d schema %q", index, record.Schema)
}
if !validBoundedText(record.RequestID, 512, false) || seen[record.RequestID] {
return fmt.Errorf("cachebench: observation %d empty or duplicate request_id", index)
}
seen[record.RequestID] = true
if !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) {
return fmt.Errorf("cachebench: observation %d missing provider or quality evidence provenance", index)
}
if record.RequestBodySHA256 != "" && !validSHA256(record.RequestBodySHA256) {
return fmt.Errorf("cachebench: observation %d has invalid request body digest", index)
}
optimizerIDs := map[string]bool{}
for _, optimizerID := range record.OptimizerIDs {
if !validBoundedText(optimizerID, 256, false) || optimizerIDs[optimizerID] {
return fmt.Errorf("cachebench: observation %d has invalid optimizer identity", index)
}
optimizerIDs[optimizerID] = true
}
}
return nil
}
func validSHA256(value string) bool {
return len(value) == 64 && strings.Trim(value, "0123456789abcdef") == ""
}
func validEvidenceSHA256(value string) bool {
return validSHA256(value) && value != bodyDigest(nil)
}
func evaluateObservedProvider(provider string, records []ObservationRecord, target Target) ProviderReport {
report := ProviderReport{Provider: provider, Model: "observed", Rolling: true, EvaluatedRequests: len(records)}
qualityPasses := 0View on GitHub (pinned to 766dce6b13)