Skip to content

[Phase 1] Price claude-opus-5-5 in model-pricing.tsv and lock it with a regression test #1896

Closed

Description

@github-actions

Story

As a cost-observability maintainer,
I want add a date-versioned claude-opus-5-5 pricing row and a regression test that pins its rate,
so that deep-tier token-cost reports price Opus 5.5 calls correctly the moment the model is invoked, instead of falling through to no matching glob.

Acceptance Criteria

  1. A new TAB-separated row claude-opus-5-5* 2026-09-22 4.00 0.20 5.00 20.00 (columns: model_glob, effective_from, input, cache_read, cache_write, output) is appended to scripts/lib/model-pricing.tsv in the Anthropic Claude section.
  2. price_for claude-opus-5-5 2026-09-23 returns exactly 4.00 0.20 5.00 20.00 (verified via a new test in tests/model_pricing.bats).
  3. The new glob does not collide with or shadow the existing claude-opus-4-* row: price_for claude-opus-4-8 <2026 date> still returns 5.00 0.50 6.25 25.00.
  4. bats tests/model_pricing.bats passes and shellcheck is clean on any touched shell (no engine.sh change in this story).

Tasks / Subtasks

Dev Notes

  • model-pricing.tsv is DATA, not code: prices change only by APPENDING a new dated row for a glob — never mutate an existing row (header block in scripts/lib/model-pricing.tsv documents the deterministic most-specific-glob + effective_from<=T selection).
  • Column order is input, cache_read, cache_write, output (USD/MTok). cache_write here is the placeholder $5.00 from the idea; if the migration guide states a different 5-minute cache-write rate, use that value and note the source in the row comment.
  • The existing claude-opus-4-* glob (effective 2025-11-01) will NOT match claude-opus-5-5 (different major digit), so there is no shadowing — AC-3 exists to lock that in against future glob edits.
  • Test file scripts/lib is sourced by tests/model_pricing.bats via source scripts/lib/model-pricing.sh; follow the existing run price_for ... / [ "$output" = "..." ] pattern.
  • This story touches ONLY pricing data + its test — no engine.sh, so it is safe to land ahead of any model swap and carries zero runtime blast radius.

Project Structure Notes

Confined to scripts/lib/model-pricing.tsv and tests/model_pricing.bats — matches the repo's 'prices are reviewed data' pattern; no workflow or engine change.

References

  • scripts/lib/model-pricing.tsv#header-append-only-convention
  • scripts/lib/model-pricing.sh#price_for
  • tests/model_pricing.bats#sonnet-5-window-tests

Likely target surface

  • scripts/lib/model-pricing.tsv
  • tests/model_pricing.bats

Story prepared by the BMAD Scrum Master (Bob) for epic #1895. Status: ready-for-dev.

Activity

  1. don-petry commented on Sep 23, 2026

    @don-petry
    Collaborator

    Dev-Lead Implementation Plan

    Issue: #1896 — [Phase 1] Price claude-opus-5-5 in model-pricing.tsv and lock it with a regression test

    Scope

    Append a date-versioned claude-opus-5-5* pricing row (2026-09-22) to the authoritative Anthropic block of scripts/lib/model-pricing.tsv and lock it with regression tests, without touching engine.sh.

    Implementation Checklist

    • Append claude-opus-5-5* 2026-09-22 4.00 0.20 5.00 20.00 in the Anthropic Claude block of scripts/lib/model-pricing.tsv (append-only; never edit an existing row)

    Tests to Write

    • price_for claude-opus-5-5 2026-09-23 → 4.00 0.20 5.00 20.00 (mirrors the sonnet-5 window tests)
    • Guard: price_for claude-opus-4-8 <2026 date> → 5.00 0.50 6.25 25.00 (opus-4-* glob unaffected — no shadowing)

    Test Command

    bats tests/model_pricing.bats (plus full suite) and bash .dev-lead/scripts/dev-lead-lint.sh

  2. don-petry commented on Sep 23, 2026

    @don-petry
    Collaborator

    Dev-Lead: Progress (in progress — not yet durable)

    Provisional. Nothing is pushed yet; the automation posts the authoritative
    completion record (with PR number + head SHA) after the push. Treat the notes
    below as intent, not delivered results.

    Plan Execution (intended)

    • Appended the claude-opus-5-5* row (effective 2026-09-22) to the Anthropic Claude block of scripts/lib/model-pricing.tsv, immediately after the claude-opus-4-* row (append-only; no existing row edited).
    • Added two price_for regression tests: the opus-5.5 window (4.00 0.20 5.00 20.00) and a guard that the opus-4-* glob is unaffected by the new row.

    Notes on the data value

    • cache_write = 5.00 is exactly 1.25× the 4.00 base input, matching the file header's documented 5-minute cache-write convention, so no deviating-source comment was warranted on the row.

    Local check output (provisional — not the pushed run)

    tests/model_pricing.bats: 20/20 ok (18 pre-existing + 2 new)
    .dev-lead/scripts/dev-lead-lint.sh: all checks passed (shellcheck 155 files, agent frontmatter, CODEOWNERS)
    

    Files touched (this workspace, not yet pushed)

    • scripts/lib/model-pricing.tsv: +1 pricing row for claude-opus-5-5*.
    • tests/model_pricing.bats: +2 regression tests (opus-5.5 rate + opus-4-* no-shadow guard).

    Notes

    No engine.sh change; scope confined to pricing data + its test, matching the story's zero-runtime-blast-radius intent.

  3. don-petry commented on Sep 23, 2026

    @don-petry
    Collaborator

    Dev-Lead: Implementation Complete — PR #1904

    The implementation for issue #1896 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.

    Review happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.

  4. added a commit that references this issue on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions