{"record":{"id":"060408d89585bd72","repo":"JuliusBrussee/caveman","slug":"s-s-s-verified-at-is-in-the-future","errorCode":null,"errorMessage":"%s %s/%s: verified_at is in the future","messagePattern":"(.+?) (.+?)/(.+?): verified_at is in the future","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/catalog/catalog.go","lineNumber":336,"sourceCode":"\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)\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}","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/platform/catalog/catalog.go#L318-L354","documentation":"verified_at may not be more than 24 hours in the future relative to UTC now; DecodeAndValidate rejects such rows to stop clock-skewed or forged 'verified just now' claims from bypassing freshness checks.","triggerScenarios":"DecodeAndValidate encounters verified_at greater than time.Now().UTC()+24h — e.g. a typo'd year (2027), a machine with a wrong clock generating timestamps, or UTC/local confusion pushing the stamp ahead.","commonSituations":"Hand-editing the date and hitting the wrong key, a CI machine with a drifted clock, or generating timestamps with a future-dated fixture file.","solutions":["Correct verified_at to the actual verification time in RFC3339 UTC.","Sync system clock (ntp/systemd-timesyncd) if the machine's time is skewed.","Use date -u to confirm current UTC time before stamping entries.","Re-verify pricing if the timestamp was future because verification actually never happened."],"exampleFix":"# before\nverified_at: \"2027-09-20T00:00:00Z\"\n# after\nverified_at: \"2026-09-20T00:00:00Z\"","handlingStrategy":"validation","validationCode":"t, _ := time.Parse(time.RFC3339, e.VerifiedAt)\nif t.After(time.Now().UTC().Add(24 * time.Hour)) {\n\treturn fmt.Errorf(\"verified_at is in the future\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := catalog.DecodeAndValidate(raw); err != nil {\n\tif strings.Contains(err.Error(), \"in the future\") {\n\t\treturn fmt.Errorf(\"stamp with real verification time: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Keep build machines NTP-synced","Never hand-type dates; generate them at verification time","Diff generated catalogs and reject future-dated timestamps in CI"],"tags":["catalog","timestamp","clock-skew"],"backgroundTag":"value-out-of-range","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"}