{"record":{"id":"dcb7f549a73d9f6b","repo":"JuliusBrussee/caveman","slug":"s-provider-model-and-region-are-required","errorCode":null,"errorMessage":"%s: provider, model, and region are required","messagePattern":"(.+?): provider, model, and region are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/catalog/catalog.go","lineNumber":323,"sourceCode":"\tvar decoded []Entry\n\tif err := dec.Decode(&decoded); err != nil {\n\t\treturn nil, err\n\t}\n\tvar trailing any\n\tif err := dec.Decode(&trailing); err != io.EOF {\n\t\tif err == nil {\n\t\t\treturn nil, fmt.Errorf(\"multiple YAML documents are not allowed\")\n\t\t}\n\t\treturn nil, err\n\t}\n\tif len(decoded) == 0 {\n\t\treturn nil, fmt.Errorf(\"catalog is empty\")\n\t}\n\tseen := make(map[string]struct{}, len(decoded))\n\tfor i, entry := range decoded {\n\t\tlabel := fmt.Sprintf(\"entry %d\", i)\n\t\tif strings.TrimSpace(entry.Provider) == \"\" || strings.TrimSpace(entry.Model) == \"\" || strings.TrimSpace(entry.Region) == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"%s: provider, model, and region are required\", label)\n\t\t}\n\t\tif entry.Currency != \"USD\" {\n\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: unsupported currency %q\", label, entry.Provider, entry.Model, entry.Currency)\n\t\t}\n\t\tif !cost.ValidPrice(entry.Pricing) {\n\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: invalid pricing\", label, entry.Provider, entry.Model)\n\t\t}\n\t\tverified, err := time.Parse(time.RFC3339, entry.VerifiedAt)\n\t\tif err != nil || verified.IsZero() {\n\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: verified_at must be RFC3339\", label, entry.Provider, entry.Model)\n\t\t}\n\t\tif verified.After(time.Now().UTC().Add(24 * time.Hour)) {\n\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: verified_at is in the future\", label, entry.Provider, entry.Model)\n\t\t}\n\t\tif entry.CapabilitiesVerifiedAt != \"\" {\n\t\t\tcapVerified, err := time.Parse(time.RFC3339, entry.CapabilitiesVerifiedAt)\n\t\t\tif err != nil || capVerified.IsZero() {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: capabilities_verified_at must be RFC3339\", label, entry.Provider, entry.Model)","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/platform/catalog/catalog.go#L305-L341","documentation":"Every catalog entry must have non-blank provider, model, and region fields; DecodeAndValidate labels the failing row ('entry N') and rejects it. Blank/whitespace-only values would create ambiguous routing rows.","triggerScenarios":"DecodeAndValidate (via load/loadCurrentCatalog/snapshotDrift) encounters an entry where provider, model, or region is missing, empty, or only whitespace (e.g. 'provider: \"\"' or 'provider: \"   \"').","commonSituations":"Hand-added YAML rows missing a field, template placeholders left unrendered ('provider: ${PROVIDER}'), or rows copied from a schema where the field was renamed.","solutions":["Set non-empty values for provider, model, and region on the entry number reported.","Trim whitespace — a value of only spaces is treated as missing.","Check for unrendered template placeholders and run the template step.","Run the catalog test suite before committing the file."],"exampleFix":"# before\n- provider: \"\"\n  model: claude-sonnet\n  region: us\n# after\n- provider: anthropic\n  model: claude-sonnet\n  region: us","handlingStrategy":"validation","validationCode":"for i, e := range entries {\n\tif strings.TrimSpace(e.Provider) == \"\" || strings.TrimSpace(e.Model) == \"\" || strings.TrimSpace(e.Region) == \"\" {\n\t\treturn fmt.Errorf(\"entry %d missing provider/model/region\", i)\n\t}\n}","typeGuard":null,"tryCatchPattern":"if _, err := catalog.DecodeAndValidate(raw); err != nil {\n\tif strings.Contains(err.Error(), \"required\") {\n\t\treturn fmt.Errorf(\"fix blank row: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Lint YAML rows for required keys in CI","Render templates fully and grep for leftover ${PLACEHOLDER}s","Copy rows from an existing valid entry as a baseline"],"tags":["yaml","catalog","required-fields"],"backgroundTag":"empty-required-field","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}