JuliusBrussee/caveman · error · CatalogError

: pricing changed without a new verified_at snapshot…

Error message

{label}: pricing changed without a new verified_at snapshot version (checked catalog/{verified}.yaml)

What it means

Each catalog row is date-stamped by verified_at and must exactly match its immutable price snapshot file catalog/{verified}.yaml. The validator looks up a row in the snapshot with the same pricing_identity; if no snapshot row matches, it means pricing fields changed without minting a new snapshot for the new verified_at date, breaking the price-auditability invariant.

Solutions

  1. Bump the row's verified_at to today's date and generate a new catalog/{date}.yaml snapshot reflecting the new pricing
  2. Regenerate the snapshot via the sync tooling so pricing_identity matches
  3. If the price change was unintentional, revert the pricing fields to match the existing snapshot
  4. Verify the new snapshot file exists in CATALOG_DIR with the exact verified date as filename

Example fix

# before (current.yaml)
verified_at: 2026-09-01
monthly_input: 2.50   # changed, snapshot still says 2.25
# after
verified_at: 2026-09-20
monthly_input: 2.50
# plus a new catalog/2026-09-20.yaml snapshot containing the new price
Defensive patterns

Strategy: validation

Validate before calling

import yaml, datetime

def pricing_fields_match(current_row, snapshot_rows):
    key = lambda r: (r["provider"], r["model"], r["unit"], r["monthly_input"], r["monthly_output"])
    return any(key(s) == key(current_row) for s in snapshot_rows)

# before validating: bump verified_at and ensure catalog/{date}.yaml exists
# row["verified_at"] = datetime.date.today().isoformat()

Prevention

When it happens

Trigger: Running validate_catalog after editing a pricing field of a row in current.yaml while leaving verified_at unchanged; the pricing_identity of the current row matches no row in catalog/{verified}.yaml, so the raise fires naming the snapshot file that was checked.

Common situations: Hand-editing a price in current.yaml without regenerating the dated snapshot; a sync tool bumped prices but failed to bump verified_at; someone backdated verified_at to reuse an old snapshot file; a merge combined a price change from one branch with the old verified_at from another.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

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

    for index, row in enumerate(current):
        label = f"current.yaml row {index + 1}"
        identity = validate_row(row, label, check_time)
        if identity in seen:
            raise CatalogError(f"{label}: duplicate identity {'/'.join(identity)}")
        seen.add(identity)

        verified = parsed_time(row["verified_at"], label).date().isoformat()
        snapshot = snapshots.setdefault(
            verified,
            load_yaml(CATALOG_DIR / f"{verified}.yaml"),
        )
        identity = pricing_identity(row)
        matched = next(
            (snap_row for snap_row in snapshot if pricing_identity(snap_row) == identity),
            None,
        )
        if matched is None:
            raise CatalogError(
                f"{label}: pricing changed without a new verified_at snapshot version (checked catalog/{verified}.yaml)"
            )
        # sources is excluded from pricing_identity so a capability citation can
        # be added without minting a new price-dated snapshot, but a PRICING
        # citation must never be silently swapped or dropped while verified_at
        # stays put. Mirrors the Go isSubset check in catalog_test.go.
        snapshot_sources = set(matched.get("sources") or [])
        if not snapshot_sources.issubset(set(row["sources"])):
            raise CatalogError(
                f"{label}: dropped or replaced a source from its immutable snapshot "
                f"catalog/{verified}.yaml without a new verified_at "
                f"(snapshot had {sorted(snapshot_sources)}, current has {sorted(row['sources'])})"
            )


def main() -> int:
    try:
        validate_catalog()

View on GitHub (pinned to 3ee70a1026)