{"record":{"id":"cbc98e8a56a966cd","repo":"JuliusBrussee/caveman","slug":"label-verified-at-is-in-the-future","errorCode":null,"errorMessage":"{label}: verified_at is in the future","messagePattern":"(.+?): verified_at is in the future","errorType":"validation","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"shared/provider-catalog/validate_catalog.py","lineNumber":164,"sourceCode":"            continue\n        if isinstance(value, bool) or not isinstance(value, (int, float)):\n            raise CatalogError(f\"{label}: pricing.{field} must be numeric or null\")\n        if not math.isfinite(value) or value < 0:\n            raise CatalogError(f\"{label}: pricing.{field} must be finite and nonnegative\")\n        if field == \"batch_discount_fraction\" and value > 1:\n            raise CatalogError(f\"{label}: pricing.batch_discount_fraction must be <= 1\")\n\n    if not isinstance(row[\"capabilities\"], dict):\n        raise CatalogError(f\"{label}: capabilities must be an object\")\n    sources = row[\"sources\"]\n    if not isinstance(sources, list) or not sources:\n        raise CatalogError(f\"{label}: sources must be a non-empty list\")\n    if any(not isinstance(source, str) or not source.startswith(\"https://\") for source in sources):\n        raise CatalogError(f\"{label}: every source must be HTTPS\")\n\n    verified_at = parsed_time(row[\"verified_at\"], label)\n    if verified_at > now:\n        raise CatalogError(f\"{label}: verified_at is in the future\")\n    if verified_at < now - timedelta(days=120):\n        raise CatalogError(f\"{label}: verified_at is older than 120 days\")\n    return identity[0], identity[1], identity[2]\n\n\ndef check_review_markers(text: str, label: str) -> None:\n    \"\"\"Refuse a catalog that still carries an unreviewed sync proposal.\n\n    YAML comments are invisible to the parsed rows, so this reads the raw file:\n    a rubber-stamped merge must not be able to advance price provenance while\n    the line saying \"nobody has confirmed this yet\" is still in the file.\n    \"\"\"\n    offending = [\n        index + 1\n        for index, line in enumerate(text.splitlines())\n        if line.lstrip().startswith(REVIEW_MARKER)\n    ]\n    if offending:","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/provider-catalog/validate_catalog.py#L146-L182","documentation":"The row's verified_at timestamp is parsed with parsed_time and compared against the current time ('now' passed in by validate_catalog). If verified_at is later than now, the row claims verification from the future, which is impossible, so validation fails.","triggerScenarios":"verified_at set to a future date (typo in year, wrong timezone shifting the value ahead of now, or a clock-skewed generator).","commonSituations":"Typing 2027 instead of 2026; generating timestamps with a misconfigured system clock; mixing UTC-naive and UTC-aware datetimes so an offset pushes the value past now; test fixtures with far-future dates.","solutions":["Set verified_at to the actual date the data was verified (on or before now)","Check the generator's timezone/clock and ensure UTC-consistent timestamps","Fix the year/month typo in the timestamp","For tests, use a 'now' fixture aligned with validate_catalog's now parameter"],"exampleFix":"// before\nverified_at: 2027-01-15T00:00:00Z\n// after\nverified_at: 2026-09-15T00:00:00Z","handlingStrategy":"validation","validationCode":"from datetime import datetime, timezone\nva = datetime.fromisoformat(row[\"verified_at\"].replace(\"Z\", \"+00:00\"))\nassert va <= datetime.now(timezone.utc), \"verified_at is in the future\"","typeGuard":"def verified_at_is_past(ts, now):\n    return ts is not None and ts <= now","tryCatchPattern":"try:\n    validate_catalog(rows, now=now)\nexcept CatalogError as e:\n    if \"verified_at is in the future\" in str(e):\n        row[\"verified_at\"] = now.isoformat()\n    raise","preventionTips":["Generate timestamps from a UTC clock in one helper","Never hand-type dates; derive them from now()","Clamp timestamps to now at generation time"],"tags":["validation","timestamp","date","catalog"],"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"}