JuliusBrussee/caveman · error

/ : verified_at is in the future

Error message

%s %s/%s: verified_at is in the future

What it means

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.

Solutions

  1. Correct verified_at to the actual verification time in RFC3339 UTC.
  2. Sync system clock (ntp/systemd-timesyncd) if the machine's time is skewed.
  3. Use date -u to confirm current UTC time before stamping entries.
  4. Re-verify pricing if the timestamp was future because verification actually never happened.

Example fix

# before
verified_at: "2027-09-20T00:00:00Z"
# after
verified_at: "2026-09-20T00:00:00Z"
Defensive patterns

Strategy: validation

Validate before calling

t, _ := time.Parse(time.RFC3339, e.VerifiedAt)
if t.After(time.Now().UTC().Add(24 * time.Hour)) {
	return fmt.Errorf("verified_at is in the future")
}

Try / catch

if _, err := catalog.DecodeAndValidate(raw); err != nil {
	if strings.Contains(err.Error(), "in the future") {
		return fmt.Errorf("stamp with real verification time: %w", err)
	}
	return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/060408d89585bd72. Report an issue: GitHub.

Appendix: source

Thrown at shared/platform/catalog/catalog.go:336

	}
	seen := make(map[string]struct{}, len(decoded))
	for i, entry := range decoded {
		label := fmt.Sprintf("entry %d", i)
		if strings.TrimSpace(entry.Provider) == "" || strings.TrimSpace(entry.Model) == "" || strings.TrimSpace(entry.Region) == "" {
			return nil, fmt.Errorf("%s: provider, model, and region are required", label)
		}
		if entry.Currency != "USD" {
			return nil, fmt.Errorf("%s %s/%s: unsupported currency %q", label, entry.Provider, entry.Model, entry.Currency)
		}
		if !cost.ValidPrice(entry.Pricing) {
			return nil, fmt.Errorf("%s %s/%s: invalid pricing", label, entry.Provider, entry.Model)
		}
		verified, err := time.Parse(time.RFC3339, entry.VerifiedAt)
		if err != nil || verified.IsZero() {
			return nil, fmt.Errorf("%s %s/%s: verified_at must be RFC3339", label, entry.Provider, entry.Model)
		}
		if verified.After(time.Now().UTC().Add(24 * time.Hour)) {
			return nil, fmt.Errorf("%s %s/%s: verified_at is in the future", label, entry.Provider, entry.Model)
		}
		if entry.CapabilitiesVerifiedAt != "" {
			capVerified, err := time.Parse(time.RFC3339, entry.CapabilitiesVerifiedAt)
			if err != nil || capVerified.IsZero() {
				return nil, fmt.Errorf("%s %s/%s: capabilities_verified_at must be RFC3339", label, entry.Provider, entry.Model)
			}
			if capVerified.After(time.Now().UTC().Add(24 * time.Hour)) {
				return nil, fmt.Errorf("%s %s/%s: capabilities_verified_at is in the future", label, entry.Provider, entry.Model)
			}
		}
		if len(entry.Sources) == 0 {
			return nil, fmt.Errorf("%s %s/%s: at least one source is required", label, entry.Provider, entry.Model)
		}
		for _, rawURL := range entry.Sources {
			u, err := url.ParseRequestURI(rawURL)
			if err != nil || u.Scheme != "https" || u.Host == "" {
				return nil, fmt.Errorf("%s %s/%s: invalid HTTPS source %q", label, entry.Provider, entry.Model, rawURL)
			}

View on GitHub (pinned to 3ee70a1026)