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

The shared tier is sold beside the dedicated one, with a density number a test measured #17008

Merged opened this

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

Merged

/pricing now offers a Shared plan beside Small, Medium and Large, but the upgrade to dedicated is not built. A plan list an admin has stored won't gain the Shared row until they add it. The type check and the pricing, plans, terminal-pricing, dead-code and feature-index tests pass.

Notes

opened this

/pricing now offers a Shared plan beside Small, Medium and Large, but the upgrade to dedicated is not built. A plan list an admin has stored won't gain the Shared row until they add it. The type check and the pricing, plans, terminal-pricing, dead-code and feature-index tests pass. I did not run the full suite, so the forge's check will be its first run.

What changed

  • Page and terminal: the Shared row says in plain words that it runs on a machine shared by up to N forges, sleeps when idle and wakes in about a second. The price is on the page before checkout. The terminal's Get a forge screen shows the same sentence, and the how-to is docs/features/shared-tier.md.
  • Where the numbers come from: the forges-per-machine count and the price are computed in the new src/billing/density.ts from two recorded figures, never typed.
    • Awake memory: test/shared-density.test.ts measures an awake forge's resident memory over ten forges (about 3.3 MB each) and fails if it exceeds the recorded 8 MiB ceiling.
    • Active fraction: the same test works out the share of a day a forge is awake from 3 visits a day of 4 minutes and the forges.idle_minutes limit. It fails above the recorded 0.03.
    • Wake time: "wakes in about a second" is the existing test/front-wake.test.ts, which holds the p95 of 20 wakes under 1 s.
  • The result: 40 forges per machine and $1 a month, which becomes the cheapest price on the pricing page's first line. The count is limited by disk, not memory.
  • Checkout: the shared plan always runs on this forge's machine. Only the dedicated plans can go to a cloud machine, which is a one-line change in whereFor (src/spawn/making.ts).

Left out

  • Upgrade to dedicated: a shared forge's data is one directory, so the upgrade is a copy of the same files. No action performs that copy yet.
  • Active fraction: it is measured under a stated visit pattern, not real traffic.
  • Chosen, not measured: the 50 MiB of disk per forge, the 10× busiest-moment factor, the 1200 MiB kept free for one build and the 2× cover on the price. They are named PROMISE in the code and the how-to.
  • Plan I saw (#16696): I added nothing. Today the price is shown on /pricing before the order is placed.
  • Existing tests I changed: pricing-line, plans and pricing-size assumed Small was the cheapest paid plan and the second plan in the list, and that the page was under 14.3 KB. They now expect Shared. The size cap rose to 15.2 KB for the new row.
  • Allow-list: awakeFraction is only called by the test, so I added it to scripts/unused-exports-allow.json.
  • Gate: it flagged one duplicate-looking helper in test/shared-density.test.ts (made against a helper in forge-owns-its-state.test.ts). I left it.

Try: open /pricing and look at the Shared row, or open Get a forge in the terminal. Run bun test test/shared-density.test.ts.

[{"go":"/pricing","look":"the Shared row between Free and Small","expect":"it says it runs on a shared machine for up to 40 forges, sleeps and wakes in about a second, costs $1.00 / month, and mentions no GB of memory"}]

Closes #16857

Show 5 earlier items

7 earlier comments
commented

<!-- look-pages 84dc05bf9c1b --> Look pages for 84dc05b, from the gate:

  • look pages (inferred): this pull changes src/web/pages/pricing.ts, src/web/plans_row.ts; the forge pictures / (src/web/plans_row.ts), /docs (src/web/plans_row.ts), /explore (src/web/plans_row.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I pushed a fix for the plan-related failures: the tests had not caught up with three deliberate Shared-plan behaviours. The updated tests pass locally, tsc --noEmit is clean and gate.ts --fix reported nothing. I merged origin/main into the branch before testing.

What changed

  • Plan card count: the Shared plan's card on /pricing says "You can have up to N." in place of "Up to N forges." test/pricing-plans-agree.test.ts now expects that wording for Shared.
  • Buy link: Shared has no buy link of its own, since Small's link must not stand in for a $1 plan. The buy-link test on /pricing now skips Shared.
  • Home row: the signed-out home's plans row leaves Shared out on purpose; it is on /pricing only. test/plans-row.test.ts now checks that the row doesn't contain Shared and expects every other plan on the home.

Not fixed

  • observability-budget cold-home test: it is timing-based. It also fails on a checkout of origin/main here, 976 ms against a limit of 907, so my change doesn't cause it.
  • booting on an empty data directory stores invite: it took 10 s in the check, which looks like load. I didn't run it here, because that file (test/signup-fresh.test.ts) passes locally and I didn't reproduce the 10 s.
  • llms-budget and plan carries the template: both passed here after the merge, without further changes.

The next check run will show whether any of these still fail.

commented

<!-- look-pages 912db1d93359 --> Look pages for 912db1d, from the gate:

  • look pages (inferred): this pull changes src/web/pages/pricing.ts, src/web/plans_row.ts; the forge pictures / (src/web/plans_row.ts), /docs (src/web/plans_row.ts), /explore (src/web/plans_row.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I couldn't reproduce the failing /llms.txt budget check, so I merged current main into the branch and pushed. The check's verdict on that push is still to come.

The shared tier is now sold beside the dedicated one, with a density number a test measures (#16857). This push is only the merge commit fb164797b; the branch's own work from before is unchanged.

Checked locally on the merged tree:

  • Byte budget: test/llms-budget.test.ts passes for all three roles (anonymous, signed-in, admin), before and after the merge. The earlier failure was most likely main growing the manifest at the time, so I changed no ceiling.
  • Four named rules: test/unused-exports.test.ts passes, bun x tsc --noEmit is clean, the gate reports nothing to fix, and the branch's commits name #16857.
  • Both doors: the terminal side is changed in src/tui/screens/pricing.ts, covered by test/tui-pricing.test.ts and test/tui-plans.test.ts, and the how-to is docs/features/shared-tier.md.
  • Tests run: 54 across the density, pricing, plans-row, home-perf and budget suites, plus 16 across test/unused-exports.test.ts, test/mcp-limits.test.ts, test/pricing-size.test.ts and test/tui-plans.test.ts. All pass.

Left alone:

  • src/snapshot/stream.ts has an export (streamLag) that test/unused-exports.test.ts flags as no longer dead. It came from main, not this branch, so I left it.
  • Five files have comment lines over 100 columns, which the gate says the nightly rewrap handles on main.

Try it: run bun test test/llms-budget.test.ts test/shared-density.test.ts test/shared-pricing.test.ts, or open /pricing and the Shared plan card on the preview.

commented

The pull's code is unchanged. None of the four refusals you listed applied here, and I pushed one empty commit to meet the look-pages note.

Checks: both named tests pass (test/unused-exports.test.ts and test/job-slices.test.ts). bun x tsc --noEmit is clean. Locally, the pricing and plans tests I ran (21 files, 155 tests) pass. I didn't run the whole suite; the forge's check does that on the push.

  • Name the issue: the earlier commits already carry Direction: … (#16857), and the gate's name the issue rule reads ok.
  • Dead code: test/unused-exports.test.ts passes.
  • as never: the suites I ran, which cover this change, pass.
  • Untimed jobs: test/job-slices.test.ts passes.

Look pages: the gate inferred 31 pages from the src/web/plans_row.ts change. The new commit carries No look: and No door: lines, since the change only adds one plan row to the pricing list. The gate's comment-width note stays: the nightly rewrap handles it on main, and --fix rewrapped nothing in this pull.

Push: the first push was rejected because someone had merged main into the branch on the fork. I merged that in, rechecked, and pushed.

To try: open /pricing. Shared sits beside Small, Medium and Large. It has no buy link, and the home's row leaves it out.

commented

Still red on current main: /llms.txt stays under its byte budget for each role. Fix it and push.

commented

Both failing tests now pass locally on the pushed head, along with test/unused-exports.test.ts and a clean tsc --noEmit. I haven't run the rest of the suite; the forge's check does that on this push.

  • /llms.txt byte budget: the anonymous manifest measured 9,659 bytes with Shared's row. The ceiling was 9,660, so the origin's length in the check pushed it over. I raised the anonymous ceiling to 9,760 (the measured size plus about a percent, as the comment's convention says) and noted why next to the budget in test/llms-budget.test.ts.
  • Cold home timing: this was main, not the Shared change. The test failed here on the earlier head and passed on a fresh copy of main taken a little later. It passed here again once I merged the latest main into the branch. Nothing in this pull sits on the home's cold path: the home's plans row only filters out Shared.

The pull itself is unchanged: /pricing sells Shared beside Small, Medium and Large, with no buy link, and the home's row leaves it out.

commented

Left #16857 open: 1 unticked item remain (Checkout places a shared forge on a shared machine; upgrading to dedicated is a copy of the same files.).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs