{"record":{"id":"6b3a454914e78bc2","repo":"JuliusBrussee/caveman","slug":"s-s-s-verified-at-must-be-rfc3339","errorCode":null,"errorMessage":"%s %s/%s: verified_at must be RFC3339","messagePattern":"(.+?) (.+?)/(.+?): verified_at must be RFC3339","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/catalog/catalog.go","lineNumber":333,"sourceCode":"\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)\n\t\t\t}\n\t\t\tif capVerified.After(time.Now().UTC().Add(24 * time.Hour)) {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: capabilities_verified_at is in the future\", label, entry.Provider, entry.Model)\n\t\t\t}\n\t\t}\n\t\tif len(entry.Sources) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: at least one source is required\", label, entry.Provider, entry.Model)\n\t\t}\n\t\tfor _, rawURL := range entry.Sources {\n\t\t\tu, err := url.ParseRequestURI(rawURL)","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/platform/catalog/catalog.go#L315-L351","documentation":"verified_at must parse as RFC3339 and not be the zero time; otherwise the row is rejected. The timestamp proves when pricing was last verified, so an unparseable or absent value breaks the freshness contract.","triggerScenarios":"DecodeAndValidate sees verified_at that is empty, missing, zero, or not RFC3339 (e.g. '2024-01-01', 'yesterday', '2024-13-45T99:00:00Z').","commonSituations":"A date pasted without time/zone ('2024-01-01'), a Unix epoch integer instead of an RFC3339 string, or a field renamed from an older catalog schema.","solutions":["Format verified_at as RFC3339 with timezone, e.g. '2026-09-20T00:00:00Z'.","Generate it programmatically: time.Now().UTC().Format(time.RFC3339) or date -u +%Y-%m-%dT%H:%M:%SZ.","Ensure the field is a quoted string in YAML so '2026-09-20T...' is not mangled by the parser.","Fix the generator/scraper that emits non-RFC3339 timestamps."],"exampleFix":"# before\nverified_at: 2026-09-20\n# after\nverified_at: \"2026-09-20T00:00:00Z\"","handlingStrategy":"validation","validationCode":"if _, err := time.Parse(time.RFC3339, e.VerifiedAt); err != nil {\n\treturn fmt.Errorf(\"verified_at must be RFC3339: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := catalog.DecodeAndValidate(raw); err != nil {\n\tif strings.Contains(err.Error(), \"must be RFC3339\") {\n\t\treturn fmt.Errorf(\"reformat timestamp: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Generate timestamps with time.Now().UTC().Format(time.RFC3339) or date -u +%Y-%m-%dT%H:%M:%SZ","Quote timestamp values in YAML","Add a CI lint that parses every timestamp field as RFC3339"],"tags":["catalog","timestamp","rfc3339"],"backgroundTag":"invalid-date-format","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"}