{"record":{"id":"d515d079832f6128","repo":"JuliusBrussee/caveman","slug":"cachebench-provider-population-exceeds-1024","errorCode":null,"errorMessage":"cachebench: provider population exceeds 1024","messagePattern":"cachebench: provider population exceeds 1024","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/observed.go","lineNumber":167,"sourceCode":"\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}\n\tgroups := map[string][]ObservationRecord{}\n\tfor _, record := range records {\n\t\tprovider := strings.ToLower(strings.TrimSpace(record.Provider))\n\t\tgroups[provider] = append(groups[provider], record)\n\t}\n\tif len(groups) > 1024 {\n\t\treturn Report{}, errors.New(\"cachebench: provider population exceeds 1024\")\n\t}\n\tproviders := make([]string, 0, len(groups))\n\tfor provider := range groups {\n\t\tproviders = append(providers, provider)\n\t}\n\tsort.Strings(providers)\n\tscenario := Scenario{Name: \"provider-observed-agent-trace\", Turns: len(records)}\n\treport := baseReport(BasisObserved, scenario, target, QualityTask)\n\treport.Scenario.TokenBasis = \"provider-reported cache counters over caller-declared eligible input tokens\"\n\tfor _, provider := range providers {\n\t\treport.Providers = append(report.Providers, evaluateObservedProvider(provider, groups[provider], target))\n\t}\n\treport.Overall = aggregateProviders(report.Providers, target)\n\tif report.Overall.GatePassed {\n\t\treport.Status = \"pass\"\n\t}\n\treport.EvidenceLimitations = []string{\n\t\t\"population completeness is not proven unless EvaluateObservedAgainstTrace is used\",","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/observed.go#L149-L185","documentation":"Raised in EvaluateObserved during grouping: more than 1024 distinct (normalized, lowercased/trimmed) provider values appeared in the records. This cap guards against unbounded provider partitions — usually a symptom of garbage or per-row-unique provider strings rather than a genuine provider set.","triggerScenarios":"Thrown at cacheengine/cachebench/observed.go:167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Normalize provider strings at capture time (trim, lowercase, canonical casing) so variants collapse to one key","Filter or fix records with corrupted provider fields (random ids, model names in the provider field)","If genuinely needed, split evaluation into batches under the 1024-provider cap"],"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"}