Skip to content

feat(pricing): flag pinned rows in diff/show (provenance vs costing)#152

Merged
felixgeelhaar merged 1 commit into
mainfrom
feat/pricing-diff-show-pin-awareness
Jul 8, 2026
Merged

feat(pricing): flag pinned rows in diff/show (provenance vs costing)#152
felixgeelhaar merged 1 commit into
mainfrom
feat/pricing-diff-show-pin-awareness

Conversation

@felixgeelhaar

Copy link
Copy Markdown
Collaborator

Fast-follow to #151. pricing diff and pricing show render the raw snapshot for provenance, so a pinned (verified: true) row displays the source's value and diff lists it as drift — even though the cost engine ignores the source there and prices at the baseline. Unmarked, diff invites a reader to "correct" the baseline toward the stale source value, re-introducing exactly the regression pinning fixed.

Change (presentational only)

  • New pricing.PinnedSnapshotKeys() — catalog pin keys (Key{provider,"model*"}) translated into the normalized "<provider>/<model>" snapshot key space.
  • diff: pinned rows get [pinned: runtime keeps baseline] + a footer explaining the cost engine ignores the source here and warning against editing the baseline toward the drift without re-checking the vendor.
  • show: pinned rows get a [pinned] marker + a footer noting the printed value is provenance only.

No change to costing or the snapshot store.

Live output

~ deepseek/deepseek-chat input 0.14 → 0.28 (+100%), output 0.28 → 0.42 (+50%), cache_read 0.0028 → 0.028 (+900%)  [pinned: runtime keeps baseline]
~ mistral/mistral-small input 0.15 → 0.06 (-60%), output 0.6 → 0.18 (-70%)  [pinned: runtime keeps baseline]

[pinned] = verified catalog row; the cost engine ignores the source here and prices at the baseline. Do not "correct" the baseline toward this drift without re-checking the vendor.

New test TestPinnedSnapshotKeys (key translation + no-star + unpinned excluded). Full suite + lint green.

https://claude.ai/code/session_01QKTcmXFTKoTQr7mB3HCuHZ

Both commands render the RAW snapshot for provenance, so a pinned (verified)
row displays the source's value and diff lists it as drift — even though the
cost engine ignores the source there and prices at the baseline (#151). Left
unmarked, `diff` invites a reader to "correct" the baseline toward the stale
source value, re-introducing exactly the regression pinning fixed.

Add PinnedSnapshotKeys() (catalog pin keys translated into the normalized
"<provider>/<model>" snapshot key space) and use it to annotate both views:
- `diff`: a pinned modified/removed row gets "[pinned: runtime keeps baseline]"
  plus a footer explaining the cost engine ignores the source here and warning
  against editing the baseline toward the drift without re-checking the vendor.
- `show`: pinned rows get a "[pinned]" marker and a footer noting the printed
  value is provenance only and may differ from what costing uses.

Purely presentational — no change to costing or the snapshot store.

Claude-Session: https://claude.ai/code/session_01QKTcmXFTKoTQr7mB3HCuHZ
@felixgeelhaar felixgeelhaar merged commit bed453b into main Jul 8, 2026
10 checks passed
@felixgeelhaar felixgeelhaar deleted the feat/pricing-diff-show-pin-awareness branch July 8, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant