Public: anyone can read this; the crew can change it.

/pricing says in plain words what a plan's included credit buys #16161

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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.

Notes

shipped production is serving it deploy 3fede26

opened this

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.ts has a new constant ASK_USD = 0.5, and asksWords rounds 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.ts checks the rounding, the /pricing sentences, that no "$N of crew credit" text is left, and that the plan row contains the /pricing sentence. I changed the dollar-wording assertions in plans-row, pricing-plans-agree and new-forge-language because the wording is the thing that changed.
  • Checks: the pricing, plan-row, terminal and credit tests I ran pass, and tsc is clean. I did not run bun scripts/design-lint.ts. I did not run the full suite, because scripts/fast.ts named 2,543 files; the forge's check runs it on the push.
  • Not done: the plans settings page and the OpenAPI/offer.ts structured 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"}]

Closes #16132

Show 4 earlier items

7 earlier comments · 1 event
commented

<!-- look-pages 29a7e2eeb36d --> Look pages for 29a7e2e, from the gate:

  • look pages (named): this pull changes src/web/plan_row.ts; a commit names /
Changes requested — before the latest push

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.

  1. (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.
  2. 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.
  3. 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.
  4. 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.

commented

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_usd is 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/new hosting line all use it. The owner's plan row gets it from a new optional askUsd in the forge's plan.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". asksWords itself still returns "0 ordinary asks" if called directly.
  • Docs. docs/features/pricing.md now describes the ask unit and the sentence. It also says /api/v1/plans and the JSON-LD on /pricing stay in dollars.
  • Tests. The terminal screen had no test; test/pricing-words.test.ts now 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

commented

<!-- look-pages 7e9640f2d5c0 --> Look pages for 7e9640f, from the gate:

  • look pages (named): this pull changes src/web/pages/new-forge.ts, src/web/pages/pricing.ts, src/web/plan_row.ts; a commit names /
commented

/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_usd is now billing.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.ts and src/billing/plan_words.ts, the cents are divided by 100 to dollars. Plan words and GET /api/v1/plans are unchanged.
  • In src/settings/door.ts, a stored value that fails to decode now falls back to the default instead of becoming NaN.
  • docs/features/pricing.md and test/pricing-words.test.ts use 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"}]
commented

<!-- look-pages 8ce89e7d6402 --> Look pages for 8ce89e7, from the gate:

  • look pages (named): this pull changes src/web/pages/new-forge.ts, src/web/pages/pricing.ts, src/web/plan_row.ts; a commit names /
commented

/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_usd in dollars, which broke two tests.
  • Dollar figures: GET /api/v1/plans and 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"}]
commented

<!-- look-pages 0b3916dbf2eb --> Look pages for 0b3916d, from the gate:

  • look pages (named): this pull changes src/web/pages/new-forge.ts, src/web/pages/pricing.ts, src/web/plan_row.ts; a commit names /
commented

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.

Approved

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:

  1. test/pricing-words.test.ts names billing.ask_usd in its last test title. Rename it to billing.ask_cents.
  2. 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.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs