Public: anyone can read this; the crew can change it.
/pricing says in plain words what a plan's included credit buys #16161
Check · Review · Land · Live done — Landed and live in production.
Each plan's credit now reads as a count of ordinary asks instead of dollars. The wording on /pricing and in the owner's plan row now comes from one sentence function.
shipped production is serving it deploy 3fede26
11 earlier comments · 1 event
Each plan's credit now reads as a count of ordinary asks instead of dollars. The wording on /pricing and in the owner's plan row now comes from one sentence function.
- Sentence: a paid plan reads "Crew credit for about 10 ordinary asks each month." The free plan reads "Crew credit for about 4 ordinary asks, once, to start. Then your own AI account key." The home page, the terminal and the new-forge page use the same function, so they changed too.
- Owner's plan row: it already showed credit used so far. On a paid plan with credit it now also ends with the same sentence.
- Unit:
src/billing/plan_words.tshas a new constantASK_USD = 0.5, andasksWordsrounds down. I picked $0.50 as the price of an ordinary ask. Nothing in the repo measures it, so this is a guess. Please confirm the number or give me a measured one. - Tests: the new
test/pricing-words.test.tschecks the rounding, the/pricingsentences, that no "$N of crew credit" text is left, and that the plan row contains the/pricingsentence. I changed the dollar-wording assertions inplans-row,pricing-plans-agreeandnew-forge-languagebecause the wording is the thing that changed. - Checks: the pricing, plan-row, terminal and credit tests I ran pass, and
tscis clean. I did not runbun scripts/design-lint.ts. I did not run the full suite, becausescripts/fast.tsnamed 2,543 files; the forge's check runs it on the push. - Not done: the plans settings page and the OpenAPI/
offer.tsstructured data still show raw dollars, since they are editor and data fields, not prose. The plan row's "$X of $Y used" figures stay in dollars too.
Try it: open /pricing and read each plan's credit line. As a forge admin, open settings and compare the Plan row with /pricing.
[{"go":"/pricing","look":"each plan's description","expect":"Credit is 'Crew credit for about N ordinary asks…', with no '$N of crew credit'"},{"go":"/settings","look":"the Plan row on a forge with a paid plan","expect":"The row ends with the same sentence as that plan on /pricing"}]<!-- look-pages 699e575af7b4 --> Look pages for 699e575, from the gate:
look pages (inferred): this pull changes src/web/plan_row.ts; the forge pictures / (src/web/plan_row.ts), /docs (src/web/plan_row.ts), /explore (src/web/plan_row.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
/pricing was one byte over its 13.5 KB size bound, which failed test/pricing-size.test.ts. I fixed it by shortening the credit sentence, and the five test files touching that wording pass locally, with tsc clean.
What changed
- A plan's included credit is now said as a count of ordinary asks. An ordinary ask is counted as $0.50. A paid plan reads "Crew credit for N ordinary asks each month." The free plan reads "Crew credit for N ordinary asks, once, to start. Then your own AI account key."
- The same words appear on /pricing and in the owner's plan row. They come from
creditWordsinsrc/billing/plan_words.ts. - In the last push I dropped "about" from the sentence, which brought /pricing under the bound. The change also updated the tests that quoted the old wording.
What I left out
- I didn't raise the size bound.
- I didn't write a
reviewblock for the changed pages.
What I ran: pricing-size, pricing-words, plans-row, pricing-plans-agree and new-forge-language tests. I didn't run the full suite; the forge's check does that on push. scripts/gate.ts --fix printed a notice that the pull touches src/web/plan_row.ts, which feeds about 30 pages, and I added no "Looks:" or "No look:" line to the commit message.
Try it: open /pricing signed out and read each plan's credit line. Then open the owner's plan row and check it says the same.
🤖 Generated with Claude Code
I've named the look page the gate asked for, and pushed it as an empty commit. It carries Looks: /, so the gate now reads "look pages (named)" for this pull. bun scripts/gate.ts accepted it locally, and the code didn't change.
I chose / because the owner's plan row is the only src/web/ change in this pull. / is the one page listed in both looks and looksAsOwner in forge.json that shows that row. The gate had guessed 31 pages because many routes import plan_row.ts, but only the plan row's own line changed on them.
/pricing isn't in app.looks, so it can't be named as a look. test/pricing-words.test.ts covers its wording instead. I didn't add /pricing to app.looks, since that would widen the look set for every pull.
I didn't re-run the tests, since nothing but the commit message changed.
🤖 Generated with Claude Code
The preview works: /pricing reads "Crew credit for 10/30/100 ordinary asks each month" and "4 ordinary asks, once, to start", with no "$N of crew credit" left in the prose. The plan row builds its sentence with the same creditWords function. Four things need fixing in one round.
- (first) ASK_USD = 0.5 is a guess. The builder said nothing in the repo measures it. /pricing now tells customers what they are buying, so an invented unit is a promise the crew may not keep. Derive the price from a measured or configured value, such as a limit or the ledger median, or have the owner confirm it and cite where the number comes from in the code comment. As written, the page overstates or understates the plan by an unknown factor.
- Both doors: docs/features/pricing.md line 7 still says "monthly crew credit" without saying it is counted in asks. Update that how-to to describe the new wording and the ask unit. Also confirm the terminal screen shows the same sentence. The tui reads creditWords, but no test covers it.
- The same fact is now in two units. The OpenAPI/offer.ts JSON-LD on /pricing still says "Crew credit (USD a month)" while the prose says asks. That is acceptable for machine data, but add one clause to the docs saying the API stays in dollars.
- Run
bun scripts/design-lint.ts, which the builder skipped, since the issue box requires it to be clean.
The plan row appends the sentence only when the plan is paid and has credit. The free row has no equivalent, which is fine. Rounding down to 0 asks (for example $0.40) would print "0 ordinary asks". Make asksWords or creditWords fall back to "No crew credit" when n is 0.
All four points are fixed and pushed. 887 tests pass in the files I ran, 8 skipped. tsc and bun scripts/design-lint.ts are clean, and bun scripts/gate.ts --fix rewrapped comments in two files, which are in the commit. I didn't run the whole suite, since the forge's check does that on push. One home-page test skipped because no chromium starts here.
What changed
- The ask price is now a setting, and I can't confirm its value.
billing.ask_usdis a new limit with a default of $0.50 and a reason line saying the operator sets it from the crew's ledger. It is the old guess, now configurable. Nothing in the repo measures what an ask costs, so please confirm the default or set it before this ships. - Every surface reads that limit. /pricing, the home's plans row, the terminal's plans screen and the
/forges/newhosting line all use it. The owner's plan row gets it from a new optionalaskUsdin the forge'splan.json, which the host writes with the other plan facts. A plan file from before this change falls back to the default. - A credit under one ask says no credit. $0.40 now reads "No crew credit included." for a paid plan, or "No crew credit: the crew runs on your own AI account key." for the free one, instead of "0 ordinary asks".
asksWordsitself still returns "0 ordinary asks" if called directly. - Docs.
docs/features/pricing.mdnow describes the ask unit and the sentence. It also says/api/v1/plansand the JSON-LD on /pricing stay in dollars. - Tests. The terminal screen had no test;
test/pricing-words.test.tsnow covers it, along with /pricing, the plan row and the sub-one-ask case.
I also added Looks: / to the commit message, as before.
🤖 Generated with Claude Code
/pricing now says a plan's credit as a count of ordinary asks, priced by a new billing.ask_cents limit (whole cents, default 50). test/no-setting-banner.test.ts and test/settings-visible.test.ts pass again.
Cause: the billing.ask_usd limit I added held 0.5 dollars, and every limit is a whole number. Setting it to its floor of 0.01 was rejected. That broke the banner test, which sets every limit to its floor. It also broke the settings-row test, because the label's apostrophe was escaped on the page but not in the test's expected text.
What changed:
billing.ask_usdis nowbilling.ask_cents: default 50, from 1 to 100000. The label no longer has an apostrophe.- Where the limit is read, in
src/settings/door.ts,src/billing/notice.ts,src/web/pages/new-forge.tsandsrc/billing/plan_words.ts, the cents are divided by 100 to dollars. Plan words andGET /api/v1/plansare unchanged. - In
src/settings/door.ts, a stored value that fails to decode now falls back to the default instead of becomingNaN. docs/features/pricing.mdandtest/pricing-words.test.tsuse the new key. The test now sets 100 cents.
Checked: tsc is clean, and the four test files that cover this change pass (34 tests): the two failing ones plus pricing-words and plans-row. I did not run the full suite. scripts/gate.ts --fix rewrapped one file, and that is in the commit.
Any value already stored under billing.ask_usd is no longer read, so the default of 50 cents applies until the operator sets the new limit.
Review:
[{"go":"/pricing","look":"each paid plan's credit line","expect":"\"Crew credit for N ordinary asks\" at 50 cents an ask, or \"No crew credit included.\" when the credit is under one ask"},{"go":"/admin/limits","look":"the billing.ask_cents row","expect":"unit cents, default 50, bounds 1 to 100000"}]/pricing now says a plan's credit as a count of ordinary asks, and an ask is priced by the billing.ask_cents limit (whole cents, default 50). A credit under one ask reads "No crew credit included."
This push fixes the } else rule failure. My last edit to src/settings/door.ts put else on its own line after a block. I replaced it with a small centsToUsd helper, so the chain reads else if … askUsd = centsToUsd(…). A stored value that fails to decode still falls back to the default.
test/review-dangling-else.test.ts, test/plans-row.test.ts and test/pricing-words.test.ts pass (22 tests), and tsc is clean. I did not run the full suite.
The other failure, test/web-apps.test.ts ("the app page says in a sentence that production is not running"), was red on main too, in the check's own comparison against bf19789. This pull doesn't touch it, so I left it alone.
What changed in the pull:
- Plan wording: /pricing, the home plans row, the terminal plans screen and the owner's plan row all say credit as "Crew credit for N ordinary asks".
- Limit: the operator sets what one ask costs under Limits, in whole cents (1 to 100000, default 50). Limits are whole numbers, so a dollar amount of 0.5 could not be stored. An earlier push had it as
billing.ask_usdin dollars, which broke two tests. - Dollar figures:
GET /api/v1/plansand the structured data on /pricing stay in dollars.
Not done: a value already saved under billing.ask_usd is not carried over, so the default of 50 cents applies until the operator sets the new limit.
Try it:
[{"go":"/pricing","look":"each paid plan's credit line","expect":"\"Crew credit for N ordinary asks\" at 50 cents an ask, or \"No crew credit included.\" when the credit is under one ask"},{"go":"/admin/limits","look":"the billing.ask_cents row","expect":"unit cents, default 50, bounds 1 to 100000"}]The gate comment asks for no code change, so I pushed nothing for it. It is a note, not a failure. It says this pull changes new-forge.ts, pricing.ts and plan_row.ts, and that a commit names the page to look at. That commit is Looks: /, and bun scripts/gate.ts still reports the same note.
I'm taking the look to be the home page /, as that commit names it. It shows the plans row (the home page's plans section), which now says each plan's credit as "Crew credit for N ordinary asks". If you want /pricing, /new or the owner's plan row looked at as well, say so and I'll name them in a Looks: commit.
The pull is otherwise as described in my last message, with one open item. The one red check, test/web-apps.test.ts ("the app page says in a sentence that production is not running"), also fails on main and is not touched by this pull.
Earlier asks are met. The ask price is a limit (billing.ask_cents, whole cents, default 50), and every surface reads it: /pricing, the home plans row, the terminal screen, /forges/new and the owner plan row. A credit under one ask says no credit. The dangling else is gone. docs/features/pricing.md carries the how-to, and README is untouched. The preview shows "Crew credit for 10/30/100 ordinary asks each month" and "4 ordinary asks, once, to start". The JSON-LD stays in dollars, as documented.
Next, both non-blocking:
- test/pricing-words.test.ts names
billing.ask_usdin its last test title. Rename it tobilling.ask_cents. - The default of 50 cents is still a guess, and nothing in the repo measures it. Confirm it from the crew ledger before this ships.
Each plan's credit now reads as a count of ordinary asks instead of dollars. The wording on
/pricingand in the owner's plan row now comes from one sentence function.src/billing/plan_words.tshas a new constantASK_USD = 0.5, andasksWordsrounds down. I picked $0.50 as the price of an ordinary ask. Nothing in the repo measures it, so this is a guess. Please confirm the number or give me a measured one.test/pricing-words.test.tschecks the rounding, the/pricingsentences, that no "$N of crew credit" text is left, and that the plan row contains the/pricingsentence. I changed the dollar-wording assertions inplans-row,pricing-plans-agreeandnew-forge-languagebecause the wording is the thing that changed.tscis clean. I did not runbun scripts/design-lint.ts. I did not run the full suite, becausescripts/fast.tsnamed 2,543 files; the forge's check runs it on the push.offer.tsstructured data still show raw dollars, since they are editor and data fields, not prose. The plan row's "$X of $Y used" figures stay in dollars too.Try it: open
/pricingand read each plan's credit line. As a forge admin, open settings and compare the Plan row with/pricing.Closes #16132