{"record":{"id":"81fd76d2c46a5f5e","repo":"JuliusBrussee/caveman","slug":"s-s-s-capabilities-verified-at-is-in-the-futur","errorCode":null,"errorMessage":"%s %s/%s: capabilities_verified_at is in the future","messagePattern":"(.+?) (.+?)/(.+?): capabilities_verified_at is in the future","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/catalog/catalog.go","lineNumber":344,"sourceCode":"\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)\n\t\t\tif err != nil || u.Scheme != \"https\" || u.Host == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %s/%s: invalid HTTPS source %q\", label, entry.Provider, entry.Model, rawURL)\n\t\t\t}\n\t\t}\n\t\tkey := entry.Provider + \"\\x00\" + entry.Model + \"\\x00\" + entry.Region\n\t\tif _, duplicate := seen[key]; duplicate {\n\t\t\treturn nil, fmt.Errorf(\"duplicate provider/model/region row %s/%s@%s\", entry.Provider, entry.Model, entry.Region)\n\t\t}\n\t\tseen[key] = struct{}{}\n\t}\n\treturn decoded, nil","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/platform/catalog/catalog.go#L326-L362","documentation":"DecodeAndValidate rejects a catalog entry whose capabilities_verified_at timestamp parses as a valid RFC3339 time but lies more than 24 hours in the future. This guards against misconfigured or fabricated entries claiming verification evidence that has not happened yet. It fails closed during catalog decode so untrustworthy provenance metadata never reaches consumers.","triggerScenarios":"Calling DecodeAndValidate (directly or via load/loadCurrentCatalog/snapshotDrift) on a catalog document where an entry has capabilities_verified_at set more than 24h beyond the current UTC time (e.g. year typos like 2206-01-15T00:00:00Z or UTC/local timezone confusion).","commonSituations":"Hand-editing catalog JSON/YAML and typing the wrong year; generating timestamps with a local clock set wrong or forgetting UTC conversion; CI tooling writing date fields with a millisecond-vs-seconds mistake producing far-future dates.","solutions":["Correct the capabilities_verified_at value in the catalog entry to the actual past verification date in RFC3339 UTC (e.g. 2026-09-20T00:00:00Z).","If the timestamp is generated, fix the generator to emit time.Now().UTC().Format(time.RFC3339) instead of a hand-rolled or wrongly-scaled value.","Re-run DecodeAndValidate/load to confirm the catalog passes.","If a test fixture needs a future date, cap it within the 24h allowance or construct it as time.Now().UTC().Add(time.Hour)."],"exampleFix":"// before\n\"capabilities_verified_at\": \"2206-01-15T00:00:00Z\"\n// after\n\"capabilities_verified_at\": \"2026-09-20T00:00:00Z\"","handlingStrategy":"validation","validationCode":"tv, err := time.Parse(time.RFC3339, entry.CapabilitiesVerifiedAt)\nif err != nil || tv.IsZero() || tv.After(time.Now().UTC().Add(24*time.Hour)) {\n    return fmt.Errorf(\"entry %s/%s: capabilities_verified_at not a sane past RFC3339 date\", entry.Provider, entry.Model)\n}","typeGuard":null,"tryCatchPattern":"decoded, err := catalog.DecodeAndValidate(raw, label)\nif err != nil {\n    var entryErr *catalog.EntryError // or strings.Contains check\n    if strings.Contains(err.Error(), \"capabilities_verified_at is in the future\") {\n        // fix the fixture/entry timestamp and retry\n    }\n    return fmt.Errorf(\"catalog rejected: %w\", err)\n}","preventionTips":["Always generate verification timestamps with time.Now().UTC().Format(time.RFC3339) instead of typing them.","Add a CI lint that parses every capabilities_verified_at and rejects future dates.","Keep clock sync (NTP) on machines that generate catalog entries."],"tags":["validation","catalog","timestamp"],"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"}