JuliusBrussee/caveman · error · CatalogError

: verified_at is older than 120 days

Error message

{label}: verified_at is older than 120 days

What it means

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.

Solutions

  1. Re-verify the row's pricing/capabilities against the provider's docs and update verified_at to today
  2. Automate a periodic re-verification (scheduled check) so rows never exceed 120 days
  3. If the provider data changed, update pricing/capabilities first, then set the fresh verified_at

Example fix

// before
verified_at: 2026-04-01T00:00:00Z
// after
verified_at: 2026-09-20T00:00:00Z
Defensive patterns

Strategy: validation

Validate before calling

from datetime import datetime, timedelta, timezone
va = datetime.fromisoformat(row["verified_at"].replace("Z", "+00:00"))
assert va >= datetime.now(timezone.utc) - timedelta(days=120), "re-verify this row"

Type guard

def is_freshly_verified(ts, now, max_age_days=120):
    return now - timedelta(days=max_age_days) <= ts <= now

Try / catch

try:
    validate_catalog(rows)
except CatalogError as e:
    if "older than 120 days" in str(e):
        flag_row_for_reverification(row)
    raise

Prevention

When it happens

Trigger: A row's verified_at is more than 120 days in the past — e.g. last touched in May and validated in September.

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

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/ab7cb461c8ac8357. Report an issue: GitHub.

Appendix: source

Thrown at shared/provider-catalog/validate_catalog.py:166

            raise CatalogError(f"{label}: pricing.{field} must be numeric or null")
        if not math.isfinite(value) or value < 0:
            raise CatalogError(f"{label}: pricing.{field} must be finite and nonnegative")
        if field == "batch_discount_fraction" and value > 1:
            raise CatalogError(f"{label}: pricing.batch_discount_fraction must be <= 1")

    if not isinstance(row["capabilities"], dict):
        raise CatalogError(f"{label}: capabilities must be an object")
    sources = row["sources"]
    if not isinstance(sources, list) or not sources:
        raise CatalogError(f"{label}: sources must be a non-empty list")
    if any(not isinstance(source, str) or not source.startswith("https://") for source in sources):
        raise CatalogError(f"{label}: every source must be HTTPS")

    verified_at = parsed_time(row["verified_at"], label)
    if verified_at > now:
        raise CatalogError(f"{label}: verified_at is in the future")
    if verified_at < now - timedelta(days=120):
        raise CatalogError(f"{label}: verified_at is older than 120 days")
    return identity[0], identity[1], identity[2]


def check_review_markers(text: str, label: str) -> None:
    """Refuse a catalog that still carries an unreviewed sync proposal.

    YAML comments are invisible to the parsed rows, so this reads the raw file:
    a rubber-stamped merge must not be able to advance price provenance while
    the line saying "nobody has confirmed this yet" is still in the file.
    """
    offending = [
        index + 1
        for index, line in enumerate(text.splitlines())
        if line.lstrip().startswith(REVIEW_MARKER)
    ]
    if offending:
        raise CatalogError(
            f"{label}: unreviewed sync proposal marker on line(s) "

View on GitHub (pinned to 3ee70a1026)