Public: anyone can read this; the crew can change it.
New forge never refreshes the Places catalog, so a cloud stays unpickable unt… #16576
Check · Review · Land · Live — Its check is running.
GET /forges/new and GET /pricing now read the Places catalog again when it is stale, so a cloud no longer waits for someone to open Places. The new test passes with the change and fails without it. It also passes alongside places-api, new-forge-places and order-cloud.
working checking now deploy 9f253ba
Check running · Check of 9f253bachecked against main at 85dd524fast tier: running · full gate runs on land
Website spec: 25 findings (report only)
- /board http://127.0.0.1:34173/board answered 303 — https://specification.website/
- /notes http://127.0.0.1:34173/notes answered 303 — https://specification.website/
- /review http://127.0.0.1:34173/review answered 303 — https://specification.website/
- /system http://127.0.0.1:34173/system answered 303 — https://specification.website/
- /admin/limits http://127.0.0.1:34173/admin/limits answered 404 — https://specification.website/
- /maintenance http://127.0.0.1:34173/maintenance answered 303 — https://specification.website/
- /talk http://127.0.0.1:34173/talk answered 303 — https://specification.website/
- /flow http://127.0.0.1:34173/flow answered 303 — https://specification.website/
- /resilience http://127.0.0.1:34173/resilience answered 303 — https://specification.website/
- /boards?help http://127.0.0.1:34173/boards?help answered 303 — https://specification.website/
- /settings/crew http://127.0.0.1:34173/settings/crew answered 303 — https://specification.website/
- /settings/crew?help http://127.0.0.1:34173/settings/crew?help answered 303 — https://specification.website/
- /settings/captain http://127.0.0.1:34173/settings/captain answered 303 — https://specification.website/
- /settings/security/controls http://127.0.0.1:34173/settings/security/controls answered 303 — https://specification.website/
- /settings/grants http://127.0.0.1:34173/settings/grants answered 303 — https://specification.website/
- /preview-admin/sample expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/drop http://127.0.0.1:34173/preview-admin/sample/drop answered 303 — https://specification.website/
- /preview-admin/sample/data-move http://127.0.0.1:34173/preview-admin/sample/data-move answered 303 — https://specification.website/
- /preview-admin/sample/cut-over http://127.0.0.1:34173/preview-admin/sample/cut-over answered 303 — https://specification.website/
- /preview-admin/sample/next?pick expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/bets expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/waves expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/space the first focusable element is not a skip link (an in-page #target link) — skip-link
- /looks/missing http://127.0.0.1:34173/looks/missing answered 404 — https://specification.website/
- /looks/failed http://127.0.0.1:34173/looks/failed answered 500 — https://specification.website/
Look
9 pages beside main · 0 new to this pull
/apps
In the dark
at 9f253ba ·
/changelog
In the dark
at 9f253ba ·
/docs
In the dark
at 9f253ba ·
/explore
In the dark
at 9f253ba ·
/looks/failed
In the dark
at 9f253ba ·
/looks/missing
In the dark
at 9f253ba ·
/notes
In the dark
at 9f253ba ·
/review
In the dark
at 9f253ba ·
/security
In the dark
at 9f253ba ·
9 earlier comments
GET /forges/new and GET /pricing now read the Places catalog again when it is stale, so a cloud no longer waits for someone to open Places.
The new test passes with the change and fails without it. It also passes alongside places-api, new-forge-places and order-cloud. tsc, gate.ts --fix and design-lint are clean. I did not run the full suite, since the forge runs it on push.
- What it does:
refreshForPage(app)insrc/actions/places_refresh.tscalls the existingrefreshIfDue. It does nothing when the catalog is fresh or was tried withinRETRY_MS. When a read is due, the page waits for it for at mostPAGE_WAIT_MS(2 s). A slower provider read carries on in the background and the next view sees it. - Audit: the read names no user in the audit, the same as a paid order's read.
- Where it's called:
newForgePagecalls it beforereadsFor.pricingPagecalls it first thing, so it is nowasync;server.tsandorder-cloud.test.tsalready handled that. - Test:
test/new-forge-refresh.test.tshas an admin with a Hetzner account and a stale, empty catalog. The firstGET /forges/newoffers Nuremberg instead of "Nowhere can be ordered". A second visit makes no provider calls. - Reused:
refreshIfDue,isStaleandrunningfromplaces_refresh.ts,readPlacesandseedHetzner's fixtures in the test. I didn't runscripts/similar.ts, because the new function is a three-line wrapper overrefreshIfDue. - Not done:
- No forge timer. A timer would also cover a forge nobody visits, but the duties may run on the engine's worker thread and I didn't want to move provider fetches there. It would be a separate change if wanted.
- No change for
/pricingvisitors. The page doesn't read the catalog itself today, so the refresh there only keeps the catalog warm. Say if you'd rather I drop it. - No
reviewblock. The page markup is unchanged.
- To try: as an admin with a write-allowed cloud account and a catalog read more than 6 h ago, open
/forges/new. The cloud is offered on that first load.
<!-- look-pages a29754531029 --> Look pages for a297545, from the gate:
look pages (none): this pull changes src/web/pages/new-forge.ts, src/web/pages/pricing.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
<!-- look-pages d1d4b8731956 --> Look pages for d1d4b87, from the gate:
look pages (none): this pull changes src/web/pages/new-forge.ts, src/web/pages/pricing.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
<!-- look-pages 6196e57aa061 --> Look pages for 6196e57, from the gate:
look pages (none): "Looks: /forges/new" is not a page of app.looks in forge.json; this pull changes src/web/pages/new-forge.ts, src/web/pages/pricing.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
A stale Places catalog is now read again before /forges/new renders, and in the terminal's New forge. The SQL-statement budget check was failing because /pricing also did this refresh, which put it over its budget. I removed the refresh from /pricing.
After this change test/page-budget.test.ts and test/new-forge-refresh.test.ts pass, and bun x tsc --noEmit is clean. I ran no other tests.
- What changed:
/pricing: the page is back to how it was onmain. It did the refresh check on every visit, which added three SQL statements (13 against a budget of 10). Before this change it only had its first-page numbers onmain, not a refresh.isStale: it now reads the read and try times only when a listed cloud account exists./forges/newwent from 14 to 12 statements, still inside its budget of 14.
- Doc and comment:
docs/features/places-read-on-visit.mdand therefreshForPagecomment no longer name Pricing. - Not done: I didn't raise the
/pricingbudget. Even with the cheaper check, the refresh would still cost it one statement, and the issue is about New forge, not Pricing. Refreshing on Pricing visits would be a separate decision. - To try it: as an admin with a cloud account whose catalog is older than six hours, open
/forges/newand the cloud's place is offered. The same happens in the terminal's New forge once it has re-read the catalog.
That background task was the broad fast.ts test run. I started it by mistake, then killed it, and it is no longer running. I didn't restart it.
I ran the targeted tests instead and they pass. That was the TUI new-forge, places and pricing tests plus test/new-forge-refresh.test.ts (54 pass), and the feature and docs tests (194 pass). The work is pushed, and the pull description in my last message still stands.
This feedback is on a297545, an older commit, and the branch already answers it. The latest commit, efe111b, carries the line "No look: the page's markup is unchanged; only when the Places catalog is read moved, so no look page shows a difference". The earlier "Looks: /forges/new" line didn't count because /forges/new isn't one of the pages in forge.json's looks.
I made no new change and pushed nothing. The gate's note that it couldn't trace the route of /settings/security/controls is its own, not something from this diff. It will keep saying so until a reviewer decides, and that decision is the reviewer's.
Nothing else is outstanding. The pull's behavior, test and docs are as described in my last description.
This pull's check has now failed three times (31s, 13m, 23m) while main's full check passes. Before the next push, read the failing test in the latest check run, fix the cause in this change, and run that test locally until it passes. No requeues or skipped tests; one push, one green check.
This pull makes GET /forges/new read the Places catalog again when it is stale, so a cloud no longer stays unpickable until someone opens Places. It also makes the same read in the terminal's New forge screen, which fills in its place list once the read finishes. Pricing no longer reads the catalog on a visit, which an earlier push of this pull had made it do; that cost it SQL statements, and the change that dropped it is described under "the fix" below. The last check failed on two tests, both caused by this change. I ran them locally until they passed before pushing.
What failed and why
timers-named: the page's 2 s wait used a baresetTimeoutinsrc/actions/places_refresh.ts. It now runs insideduring("places-page-wait", …), like every other server timer.new-forge-pick-150: the page ran one more SQL statement than its budget of 20, because the "is the catalog stale?" check listed the cloud accounts a second time. I did not touch the test, which was right.
The fix
refreshForPageinsrc/actions/places_refresh.tsskips the check for 10 s (LOOK_MS) after it finds the catalog fresh. A busy page spends no statement on it per visit, and a stale catalog is still read on the first visit that finds it so.- When a read is due,
refreshForPagestarts the refresh directly instead of askingrefreshIfDueto check staleness a second time. - A cloud account added within 10 s of a fresh check waits up to 10 s for its first catalog read.
Checks run
tscandgate.ts --fixare clean.new-forge*,pricing*,tui-newforge*,timers-named,places-apiandorder-cloudpass: 138 tests, 0 fail. Theplaces-apiandorder-cloudrun was before the final edit; those two files were not rerun after it.scripts/fast.tsnamed 3603 files for this diff, so I ran the covering files above instead. The full suite runs on the forge's check.
How to try it: open /forges/new as an admin with a cloud account whose catalog is stale. The place is offered on the first visit, and a second visit makes no provider call.
🤖 Generated with Claude Code
The 8:18 PM push still failed its check (23m, 4th red in a row) while main's full check is green. Before any next push: post here the exact failing test, the error, and why it fails only on this branch. Then reproduce and fix it locally and push once. If it isn't green after that, close this pull and reopen a narrower one for #16543.
GET /forges/new and GET /pricing now read the Places catalog again when it is stale, so a cloud no longer waits for someone to open Places.
The new test passes with the change and fails without it. It also passes alongside
places-api,new-forge-placesandorder-cloud.tsc,gate.ts --fixanddesign-lintare clean. I did not run the full suite, since the forge runs it on push.refreshForPage(app)insrc/actions/places_refresh.tscalls the existingrefreshIfDue. It does nothing when the catalog is fresh or was tried withinRETRY_MS. When a read is due, the page waits for it for at mostPAGE_WAIT_MS(2 s). A slower provider read carries on in the background and the next view sees it.newForgePagecalls it beforereadsFor.pricingPagecalls it first thing, so it is nowasync;server.tsandorder-cloud.test.tsalready handled that.test/new-forge-refresh.test.tshas an admin with a Hetzner account and a stale, empty catalog. The firstGET /forges/newoffers Nuremberg instead of "Nowhere can be ordered". A second visit makes no provider calls.refreshIfDue,isStaleandrunningfromplaces_refresh.ts,readPlacesandseedHetzner's fixtures in the test. I didn't runscripts/similar.ts, because the new function is a three-line wrapper overrefreshIfDue./pricingvisitors. The page doesn't read the catalog itself today, so the refresh there only keeps the catalog warm. Say if you'd rather I drop it.reviewblock. The page markup is unchanged./forges/new. The cloud is offered on that first load.Closes #16543