SIGN IN SIGN UP

fix(pricing): load-time overrides, neutral family fallback, lenient tiers

Three review findings on the catalog:

- The hand-tracked override tables (fast multipliers, Claude 200K
  premium) were stamped at trim time and baked into the snapshot and
  fetched cache, so a binary upgrade editing them was inert against an
  existing cache until the next successful fetch — which only `git-ai
  usage` triggers. They now apply when a catalog is LOADED (one choke
  point for the embedded snapshot and the disk cache), the trim output
  stays pure models.dev data, and the snapshot is regenerated
  accordingly. Application is idempotent over pre-split caches that
  carry baked values, and an edited table wins over them.

- The family-median fallback returned the median member's entry
  verbatim, leaking its hand-tracked fast multiplier and long-context
  tier onto uncataloged ids: an unknown opus id resolving to the
  6x-multiplier median would bill a fast-speed request at 6x and flip
  the emitted long-context splits. Family estimates now neutralize
  multipliers and tiers to the base rates. (Token-boundary matches
  still return entries verbatim — that is how date-suffixed spellings
  inherit their base model's data, and ccusage's fuzzy lookup behaves
  the same way.)

- One novel-shaped tier band (or tiers: null) made the whole model's
  cost object unparseable and silently dropped it from the fetched
  catalog. Tier bands now parse individually and leniently, so odd
  data degrades that model to its flat rates instead.

ModelPricing becomes Copy and pricing_for returns it by value so the
fallback can synthesize a neutralized entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
S
Sasha Varlamov committed
18c752993cb5bf22da6029c16c8bd6a200aeee7c
Parent: 24c2af1