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

The ceiling counts a machine whose datacenter stopped listing its size at that size's price #16384

Merged opened this

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

Merged

The owner's own deploy was refused on production 0.7.652: "digitalocean/prod is held to $50 a month and runs $170.00 now". The account had one $13 forge (test3, DigitalOcean nyc1, s-1vcpu-2gb) and one kept volume.

Notes

shipped production is serving it deploy 3fede26

opened this

The owner's own deploy was refused on production 0.7.652: "digitalocean/prod is held to $50 a month and runs $170.00 now". The account had one $13 forge (test3, DigitalOcean nyc1, s-1vcpu-2gb) and one kept volume. The catalog had stopped listing s-1vcpu-2gb in nyc1 (it lists the -amd/-intel variants there), so rowCents fell back to the dearest machine in that datacenter.

Change (src/cloud/ceiling.ts): an unlisted place is counted at its size's dearest price anywhere on that cloud (a size keeps its price across datacenters); only when the size is unknown everywhere does it fall back to the dearest in the datacenter. It still errs high, not wildly.

Tested on Bun 1.4.2: typecheck clean; 33 pass across pinned-ceiling (new case), order-cloud and pinned-place.

🤖 Generated with Claude Code

Changes requested — before the latest push

The idea is right: a machine in a datacenter that stopped listing its size is counted at that size's price elsewhere on the cloud, not at the dearest machine. The reckoning still errs high, which is the stated rule. Two things to fix in one round:

  1. The new priced().sameSize has no test. The test in test/pinned-ceiling.test.ts hands rowCents a hand-written sameSize, so it checks the fallback order only. If sameSize filtered on the wrong cloud, ignored size, or took the min instead of the max, that test would still pass. Add a test that builds priced(db) from a real catalog. It needs the same size in two datacenters at different prices, plus a different size and a different cloud. It should assert that sameSize(cloud, size) returns the dearest of that size on that cloud only, and undefined for an unknown size. Also put one row in an unlisted datacenter through ceilingCents or whatever sums rows, so the fix is checked end to end.
  2. The rowCents doc comment now has a line far over the wrap width (the 'test3 on 2026-11-25 sat in a datacenter...' line). Run bun scripts/gate.ts --fix and commit the rewrap. The incident detail reads better in the commit message than in a code comment.

I did not exercise the preview. This changes no page, only the number the ceiling uses. Also check that every other object typed as Priced in tests or src gets sameSize, so bun x tsc --noEmit stays green.

commented

Done: the mocked case is gone. The new test reads the real catalog through priced(app.db) with the shared places fixture: the same size priced across datacenters, an unknown size and another cloud return nothing, an unlisted datacenter is priced at the size, and a size known nowhere falls back to the dearest in its datacenter. 17 pass, typecheck clean.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs