Files
ECC/scripts
Andres Tuul 39416e3cdd fix(lib): correct stale model rates in the shared cost estimator and skill
`scripts/lib/cost-estimate.js` carries a second, independent copy of the
rate table that `scripts/hooks/cost-tracker.js` had, with the same defect:
every `opus` model priced at $15/$75, which are Claude 3 Opus era rates.
Opus 4.5 and later bill at $5/$25, so every current-generation Opus
estimate was exactly 3x real spend. Two more errors in the same table:
`haiku` was $0.80/$4.00, which is Claude 3.5 Haiku rather than Haiku 4.5's
$1/$5; and Fable and Mythos had no bucket at all, so they fell through to
`sonnet` and were understated 3.3x.

Legacy buckets are added rather than overwriting, so correcting the current
generation does not reprice the old one. `opusLegacy` keeps $15/$75 for the
three models that really billed it (Claude 3 Opus, Opus 4.0, Opus 4.1) and
`haikuLegacy` keeps $0.80/$4.00 for Claude 3.5 Haiku. The matching regexes
are the ones already used by the cost tracker, so the two tables now agree
on which model is legacy. Opus 4.0's snapshot is `claude-opus-4-20250514`
with no minor segment, which is why the bare `opus-4-<date>` form is
matched separately: an `opus-4-0` substring alone misses it.

`skills/cost-aware-llm-pipeline/SKILL.md` and its zh-CN and ja-JP
translations published the same stale numbers as prose. The Relative Cost
column is derived from the rates, so it is corrected with them: against a
corrected Haiku 4.5 baseline the multiples are now exact, which is why the
approximation markers are dropped.

`RATE_TABLE` keeps its existing keys and shape, so the export stays
backward compatible.

Tests: the existing test pinned the stale values and was updated to pin the
correct ones. Coverage is added for each legacy spelling (alias, dated
snapshot, Vertex `@` form, Bedrock prefix), for the current Opus line, and
for the Fable and Mythos bucket.
2026-08-06 22:36:24 +03:00
..