SIGN IN SIGN UP

fix(token-usage): dedicated pricing_catalog attribute, indexed speed grouping

Two review findings on the wire layer:

- The pricing catalog id was written as a synthetic JSON object into
  custom_attributes — the slot every event type uses for the
  org-configured attribute map — precluding org attributes on cost
  events and colliding with a same-named user key. It now rides a
  dedicated attribute position (31), and custom_attributes stays
  reserved for the org map.

- Grouping reconciliation by COALESCE(speed, 0) over the plain bucket
  index sorted every session aggregate through a temp B-tree on each
  pass. v4 adds an expression index matching the GROUP BY exactly.

Also updates the mixed-speed worker test for the uniform
speed_inferred semantics from the extraction layer (an unmarked Claude
entry now reports its tier as unrecorded).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
S
Sasha Varlamov committed
eef4db88b9102db284ce5e1f3630f87549a2a153
Parent: 9276eeb