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

The plans page says what each forge size is for, measured by the time to a first built change #16759

Merged opened this

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

Merged

Each plan can now carry a measured time from first ask to a built change, and the plans page states it. It states it only when a time is set. I can't time the stub journey from here, so no real number is in yet.

Notes

opened this

Each plan can now carry a measured time from first ask to a built change, and the plans page states it. It states it only when a time is set. I can't time the stub journey from here, so no real number is in yet. Today every plan reads exactly as before.

  • Where the time lives: a plan has an optional firstChangeSecs field (src/settings/plans.ts). It is validated as whole seconds, 0 to 86400. 0 or absent means not measured and is dropped. It also goes out through the public plans (publicPlans) and GET /api/v1/plans.
  • What the page says: planWords in src/billing/plan_words.ts adds "A first built change takes about N minutes." (or seconds under 90). The home, /pricing and the terminal all use planWords, so they say the same thing.
  • How an admin sets it: /admin/limits has a new "First change (s)" input per plan, saved with the rest of the form.
  • Tests: three new cases in test/plans-row.test.ts cover silence until measured, the words once set, the public view, and rejecting bad values.
  • What I left out: I haven't timed small, medium and large. Someone has to run the stub journey on each in production and enter the three numbers in the admin form. A size that can't run the crew at a usable speed gets no time. Its existing says line, which an admin can reword in the same form, is where to say what it's for.
  • Checks: tsc is clean and the plans, pricing and billing tests pass. "no file reads a width in script beyond what the list allows" fails with or without my change, so it isn't mine. I didn't run bun scripts/fast.ts to completion, because it listed nearly every test. I ran the related tests directly instead.
  • Try it: as an admin, open /admin/limits, set a plan's "First change (s)" to 240, then read "A first built change takes about 4 minutes." on the home or /pricing.

Closes #11562

Show 3 earlier items

7 earlier comments
commented

The measured time to a first built change can now be set from the terminal, and the MCP tool, API and docs list it. tsc, design-lint and the plans tests (plans-row, tui-plans, plans, tui-plan-row) pass. I didn't run the full suite.

  • Terminal: on the Plans screen, e then first <seconds> asks for a confirm, then applies. first 0 clears it. The secondary and hint lines now show "first change 240s" or "first change not measured". A new test in test/tui-plans.test.ts sets it to 240 and clears it with 0.
  • MCP, API and docs: the limits tool doc, getApiV1Plans and putApiV1AdminPlans now list firstChangeSecs. docs/features/plans.md says how an admin sets it and that nothing is said until it is set.
  • Parsing: parsePlan uses a new seconds() helper in the style of count(), and MAX_FIRST_CHANGE_SECS sits next to the other bounds in src/settings/plans.ts. In test/plans-row.test.ts the imports are merged at the top and the bare block is now plain top-level tests.
  • Label: the form label now reads "Seconds to a first change".

The "Releasing trevato/forge" hold is about production, so it didn't touch this change.

No Looks: line: the inferred /admin/limits picture is the right page.

commented

<!-- look-pages 66013a50fd7a --> Look pages for 66013a5, from the gate:

  • look pages (inferred): this pull changes src/web/settings/plans.ts; the forge pictures /admin/limits (src/web/settings/plans.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The gate's note is the same inference as before, and it is correct: /admin/limits is the page this pull changes. It asks for nothing, so I changed nothing and pushed nothing.

The branch at 66013a50f already has the requested changes. I left out a Looks: or No look: line because the inferred page is the right one.

commented

This pull does not deliver #11562 yet. No plan has a measured time, so the plans page reads exactly as it does on main. It adds a place for that time, the measured seconds to a first built change, on each plan. Once an admin sets it, the plans page says "A first built change takes about N minutes."; until then it says nothing. Measuring small, medium and large in production is #16770, and #11562 now waits for it. That needs the throttle and the owner's go to spend production time. I could not measure from my sandbox, and I did not put guessed numbers in the defaults.

The time can be set from every door, and a value outside 0 to 86400 whole seconds is refused:

  • Page: on /admin/limits, the Plans form has a "Seconds to a first change" field. A hint beside it reads "0 or blank: not measured, and the plans page says nothing." A blank field clears the time.
  • Terminal: on the Plans screen, e then first <seconds>. The confirm reads first change not measured → 240s or first change 240s → not measured.
  • API: PUT /api/v1/admin/plans takes firstChangeSecs, and GET /api/v1/plans includes it only once it is set.
  • MCP: the limits tool takes firstChangeSecs on each plan.
  • Docs: docs/features/plans.md says how an admin sets it and that nothing is said until then.

Cleanup: forge counts and seconds are now parsed by one whole-number helper in src/settings/plans.ts.

Tests:

  • test/plans.test.ts: the form sets 240 and a blank clears it; PUT /api/v1/admin/plans and the MCP limits tool set it, and a negative value is refused.
  • test/tui-plans.test.ts: the terminal edit and the plain-words confirm.
  • test/plans-row.test.ts: the words appear only once a time is measured.

Type check, design lint and those three files pass; the forge runs the full suite on push.

The desk's "production is rolling" hold is about releasing production, so it did not touch this pull.

[
  {"go": "/admin/limits", "look": "the Plans form, small plan", "expect": "a 'Seconds to a first change' field showing 0, with the visible hint '0 or blank: not measured, and the plans page says nothing.'"},
  {"go": "/admin/limits", "look": "set small's Seconds to a first change to 240 and save", "expect": "'Plans saved.'; the plans page's small line then reads 'A first built change takes about 4 minutes.'"},
  {"go": "/admin/limits", "look": "clear the field and save", "expect": "the plans page no longer mentions a first built change for small", "ask": "Is the hint clear enough that 0 or blank means not measured?"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 7897efde2bc3 --> Look pages for 7897efd, from the gate:

  • look pages (inferred): this pull changes src/web/settings/plans.ts; the forge pictures /admin/limits (src/web/settings/plans.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Plans can now record how long it takes to get a first built change. The plans words show that time only when a plan has one measured: "A first built change takes about 4 minutes." A plan with no time set shows nothing.

  • Data: src/settings/plans.ts holds an optional whole number of seconds per plan, read by one parser. A blank field clears it.
  • Wording: src/billing/plan_words.ts turns the seconds into the sentence.
  • Where it's set: the admin plans form on /admin/limits has a "First change (s)" field with a hint under it. The same setting is on the terminal plans screen (with a plain confirm), the MCP limits tool, and PUT /api/v1/admin/plans. GET /api/v1/plans returns it, and docs/features/plans.md explains it.
  • Tests: test/plans.test.ts, test/plans-row.test.ts and test/tui-plans.test.ts cover the form, the API and MCP, the terminal, and the sentence appearing only when a time is measured.

The last commit is empty apart from a Looks: /admin/limits line. It confirms the look page the gate guessed: /admin/limits is the page in app.looks that this pull changes. The public pricing page shows the sentence too, but it isn't in app.looks. With the line in place, the gate now reports "look pages (named)" for this pull.

Not done: the forge doesn't measure the time itself. An admin enters it.

[{"go":"/admin/limits","look":"the plans form","expect":"each plan row has a First change (s) field with a hint"},
 {"go":"/admin/limits","look":"set a plan's First change (s) to 240 and save","expect":"the value is kept; clearing the field removes it"},
 {"go":"/pricing","look":"the plan you set","expect":"'A first built change takes about 4 minutes.'; plans with no time show no such sentence"}]

🤖 Generated with Claude Code

commented

<!-- look-pages de6f552783b1 --> Look pages for de6f552, from the gate:

  • look pages (named): this pull changes src/web/settings/plans.ts; a commit names /admin/limits
commented

Plans can now record how long it takes to get a first built change. The plans words show that time only when a plan has one measured: "A first built change takes about 4 minutes." A plan with no time set shows nothing.

  • Data: src/settings/plans.ts holds an optional whole number of seconds per plan, read by one parser. A blank field clears it.
  • Wording: src/billing/plan_words.ts turns the seconds into the sentence.
  • Where it's set: the admin plans form on /admin/limits has a "First change (s)" field with a hint under it. The same setting is on the terminal plans screen (with a plain confirm), the MCP limits tool, and PUT /api/v1/admin/plans. GET /api/v1/plans returns it, and docs/features/plans.md explains it.
  • Tests: test/plans.test.ts, test/plans-row.test.ts and test/tui-plans.test.ts cover the form, the API and MCP, the terminal, and the sentence appearing only when a time is measured.

A Looks: /admin/limits line in a commit names the look page for this pull. /admin/limits is the page in app.looks that this pull changes. The public pricing page shows the sentence too, but it isn't in app.looks.

Not done: the forge doesn't measure the time itself. An admin enters it.

[{"go":"/admin/limits","look":"the plans form","expect":"each plan row has a First change (s) field with a hint"},
 {"go":"/admin/limits","look":"set a plan's First change (s) to 240 and save","expect":"the value is kept; clearing the field removes it"},
 {"go":"/pricing","look":"the plan you set","expect":"'A first built change takes about 4 minutes.'; plans with no time show no such sentence"}]

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs