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

Every cloud account has a monthly ceiling, $50 by default, and the forge refuses a create that would cross it #16232

Closed opened this
Closed without merging

The owner is attaching cloud accounts so the forge can create machines that bill him, and asked for a ceiling of $50 on each. Cloud providers offer alerts, not caps, so the forge refuses. What changed Each cloud account has ceilingdollars (default 50, migration).

Notes

stopped closed without shipping deploy 43a1f99

opened this

The owner is attaching cloud accounts so the forge can create machines that bill him, and asked for a ceiling of $50 on each. Cloud providers offer alerts, not caps, so the forge refuses.

What changed

  • Each cloud account has ceiling_dollars (default 50, migration). cloud_account gains the verb set_ceiling; the cloud accounts page and cloud_accounts show ceiling, reckoned cost now and what is left.
  • capped in src/cloud/ceiling.ts wraps the driver's plan step in provision and replace (src/actions/pinned.ts): the account's machines and volumes at list price, plus this one, against the ceiling, before anything is created. A same-size replace is net zero. An unknown size is refused, never counted as zero.
  • src/cloud/prices.ts: one table of list prices in the vendor's own currency (read 2026-11-23; the Hetzner volume price is unverified and marked so) and one function, usdCents, that makes dollars. Euros convert at a fixed, deliberately high rate, rounded up; #16203 replaces the constant with a fetched rate.
  • Everything a person sees is dollars.

Not done

  • Refusing when the provider reports machines the forge has no row for: audit finds savings, not orphans, so that is more than a small step. It belongs with #16219.

Tested Built by a subagent on a laptop whose Bun (1.3.13) cannot start the app, so test/pinned-ceiling.test.ts has NOT run; the logic was exercised in a scratch harness only. schema-additive, schema-migrations and event-audience-coverage passed there. This pull's check is the first real run.

No look: the cloud accounts page gains three figures and one sentence.

Files: src/cloud/ceiling.ts, src/cloud/prices.ts, src/actions/cloud_ceiling.ts, src/actions/pinned.ts, src/web/pages/cloud_ceiling.ts, src/web/pages/cloud.ts, test/pinned-ceiling.test.ts

🤖 Generated with Claude Code

2 earlier comments
commented

<!-- look-pages 27680525856b --> Look pages for 2768052, from the gate:

  • look pages (none): this pull changes src/web/pages/cloud.ts, src/web/pages/cloud_ceiling.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

<!-- look-pages 43a1f994d01c --> Look pages for 43a1f99, from the gate:

  • look pages (none): this pull changes src/web/pages/cloud.ts, src/web/pages/cloud_ceiling.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

Closed: Folded into #16255.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs