Skip to content

chore(pricing): sync pricing.json with published rates - #31

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
automated/pricing-refresh
Closed

chore(pricing): sync pricing.json with published rates#31
github-actions[bot] wants to merge 1 commit into
mainfrom
automated/pricing-refresh

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Automated daily sync from the Anthropic pricing page. Review the rate changes before merging.

@github-actions
github-actions Bot force-pushed the automated/pricing-refresh branch from f6b03cd to 8866cad Compare August 7, 2026 07:40
@github-actions github-actions Bot added the core The engine (packages/core) label Aug 7, 2026
krayong added a commit that referenced this pull request Aug 7, 2026
Fixes the bug behind #31, which is pure regression: its whole diff was
the deletion of `fast_mult`, with no rate change at all.

## The bug

The published fast-mode table now bills one shared lane for several
models by naming them in a single cell:

```
["Claude Opus 5 / Claude Opus 4.8", "$10 / MTok", "$50 / MTok"]
```

`buildFastInput` keyed the map on the raw cell text, so the lookups for
`"Claude Opus 5"` and `"Claude Opus 4.8"` never matched. `fast_mult` was
therefore never derived, and `mergeRows` replaced each row wholesale and
dropped the field.

Downstream, `fast_mult` defaults to `1` (`pricing.ts:56`) and gates the
speed multiplier (`pricing.ts:188`), so fast-mode messages on Opus 5 and
4.8 priced at ×1 instead of ×2 — reporting half their true cost.

## Changes

- **`buildFastInput` splits the cell** and keys each model name
separately.
- **`mergeRows` carries an established `fast_mult` forward** when a
model has dropped off the fast table. Opus 4.7 has, and transcripts
recorded while that lane was offered still need ×6 to price correctly. A
model still listed is re-derived normally, and deleting the field by
hand still sticks.
- **The refresh workflow now writes a minor changeset** next to
`pricing.json`. That file ships inside the published `ccsidekick`
package, so CI's changeset gate failed on every automated pricing PR. A
fixed filename keeps re-runs idempotent, since the branch is recreated
from `main` each run.

## Why the tests were green while production drifted

The fixture pinned the *old* single-name table shape, so it tested the
parser against a page that no longer exists. It now mirrors the live
slash-combined row.

## Verification

- `refresh-pricing.test.ts`: 8 pass. Both new tests were confirmed
failing first (`Expected: 2, Received: undefined`).
- `bun run test`: 1076 pass, 0 fail. The existing ×6 assertion for Opus
4.7 still passes, because the carry-forward leaves `pricing.json`
byte-identical.
- `refresh-pricing.ts --check` against the live page: **in sync**, with
`pricing.json` unchanged — confirming #31's diff was entirely spurious.
- The changeset gate was simulated in a scratch worktree by committing a
`pricing.json` edit plus the generated changeset: `changeset status
--since=origin/main` exits 0.
- `typecheck`, `lint`, `format:check` clean.

## Follow-up

#31 should be closed rather than merged.

🦇 Generated by
[Penny-One](https://batman.fandom.com/wiki/Alfred_Pennyworth) at
[Batcave](https://batman.fandom.com/wiki/Batcave)

Co-authored-by: Penny-One (Batcave) <noreply@anthropic.com>
@krayong krayong closed this Aug 7, 2026
@krayong
krayong deleted the automated/pricing-refresh branch August 7, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core The engine (packages/core)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant