{"record":{"id":"ab7cb461c8ac8357","repo":"JuliusBrussee/caveman","slug":"label-verified-at-is-older-than-120-days","errorCode":null,"errorMessage":"{label}: verified_at is older than 120 days","messagePattern":"(.+?): verified_at is older than 120 days","errorType":"validation","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"shared/provider-catalog/validate_catalog.py","lineNumber":166,"sourceCode":"            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:\n        raise CatalogError(\n            f\"{label}: unreviewed sync proposal marker on line(s) \"","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/provider-catalog/validate_catalog.py#L148-L184","documentation":"Catalog entries must be re-verified regularly: verified_at may not be more than 120 days (timedelta(days=120)) before 'now'. Older timestamps mean the pricing/capability data may be stale, so validate_row rejects the row.","triggerScenarios":"A row's verified_at is more than 120 days in the past — e.g. last touched in May and validated in September.","commonSituations":"A long-lived catalog row never re-reviewed; a provider whose pricing hasn't changed so nobody re-verified it; CI running the validator after a period of project inactivity.","solutions":["Re-verify the row's pricing/capabilities against the provider's docs and update verified_at to today","Automate a periodic re-verification (scheduled check) so rows never exceed 120 days","If the provider data changed, update pricing/capabilities first, then set the fresh verified_at"],"exampleFix":"// before\nverified_at: 2026-04-01T00:00:00Z\n// after\nverified_at: 2026-09-20T00:00:00Z","handlingStrategy":"validation","validationCode":"from datetime import datetime, timedelta, timezone\nva = datetime.fromisoformat(row[\"verified_at\"].replace(\"Z\", \"+00:00\"))\nassert va >= datetime.now(timezone.utc) - timedelta(days=120), \"re-verify this row\"","typeGuard":"def is_freshly_verified(ts, now, max_age_days=120):\n    return now - timedelta(days=max_age_days) <= ts <= now","tryCatchPattern":"try:\n    validate_catalog(rows)\nexcept CatalogError as e:\n    if \"older than 120 days\" in str(e):\n        flag_row_for_reverification(row)\n    raise","preventionTips":["Schedule periodic re-verification of catalog rows","Alert before the 120-day window expires","Re-check provider pricing whenever the catalog is touched"],"tags":["validation","timestamp","staleness","catalog"],"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"}