Skip to content

fix(pricing): an unedited copy of the template can no longer price a run at $0 - #73

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/pricing-template-cannot-be-used
Sep 23, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/pricing-template-cannot-be-used

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Fixes #28.

docs/pricing.example.json shipped 0.0 for every price. The file's own note says 0 is the claim that tokens are free, so a copy used unedited priced every call at nothing, and --max-cost-usd let any run through.

What changed

  • The template: prices are now null and as_of is the placeholder YYYY-MM-DD. The loader refuses that placeholder with a message saying what to fill in, so an unedited copy cannot price a run at all.
  • The loader (config.py):
    • An entry with both prices at exactly 0 is refused unless it carries "free": true, because that is also what a half-filled template looks like.
    • "free": true alongside a nonzero price is refused as contradictory.
    • One price at 0 is still an ordinary price.
  • README and PLAN say the copy is refused until it is filled in.

Checked

  • The new tests failed on main and pass now:
    • the template is refused, and the message names the placeholder;
    • a filled-in copy loads;
    • 0/0 is refused;
    • 0/0 with free: true loads and costs 0;
    • one side at 0 prices normally.
  • plumbline run tiny.jsonl --adapter mock --pricing docs/pricing.example.json exits 1 with the placeholder message, before any call.
  • ruff, mypy --strict, and the full pytest suite pass, and the prose checks are clean.

🤖 Generated with Claude Code

…run at $0

docs/pricing.example.json shipped 0.0 prices, and its own note says 0 is
the claim that tokens are free. A copy used as it came priced every call
at nothing, so --max-cost-usd let any run through.

The template's prices are now null and its as_of is the placeholder
YYYY-MM-DD, which the loader refuses with a message saying what to fill
in. Separately, any entry that prices both input and output at exactly 0
is refused unless it says "free": true, since that is also what a
half-filled template looks like; "free": true with a nonzero price is
refused as contradictory.

The test that asserted the template loads as shipped now asserts it is
refused, and a second one asserts it loads once filled in.

Fixes #28.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@TMHSDigital
TMHSDigital merged commit 3700f62 into main Sep 23, 2026
17 checks passed
@TMHSDigital
TMHSDigital deleted the fix/pricing-template-cannot-be-used branch September 23, 2026 17:42
TMHSDigital added a commit that referenced this pull request Sep 23, 2026
…err (#74)

The deploy after #73 failed before publishing: the smoke test waited 20s
for Chrome to print its DevTools address on stderr, and on that runner it
printed nothing at all. The same test passed on the pull request, so this
was the start-up, not the site.

The test now picks a free port itself and polls Chrome's /json/version
until it answers, up to a minute per attempt, and starts a fresh Chrome
up to three times if one stalls or exits, printing what happened. It
also passes --disable-dev-shm-usage, the usual guard for a small /dev/shm
on CI machines.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.

The shipped pricing template prices every call at $0 and turns off the spend guard

1 participant