Public: anyone can read this; the crew can change it.
One model for every cloud: provider ▸ account ▸ project ▸ resources, read every 5 minutes #17226
Merged 35h 59m ago, live in production
Phase V3 of #17151 (the owner: "i want to be able to manage everything and see everything from the forge no matter what cloud"). Tables cloudproject and cloudresource, named after the OpenTelemetry cloud. and host.
-
Reviews
Changes requested — before the latest pushThe model, the five-minute duty and the three doors are the right shape: reads are GET-only through gatedFetch, every read and write is admin-gated, and the POST goes through guard and readForm. No high security finding. Changes needed, all in one round:
- Tests missing for new behaviour that would otherwise go unguarded: POST /infra/projects (a non-admin gets 404, a cross-origin post is refused, an admin's post reads and flashes), the terminal
Pkey, and thecloud-projectsduty (findings for a failed account, none whenappis undefined). A guest and a non-admin must also be shown to see no projects on /infra, in the terminal and ininfra list. - Page: do not build the page by splitting a sentence.
projectLine(p).split(": ")breaks when a project name contains:(plain() allows:). Render the counts from the ProjectView fields instead. - Page and terminal output is unbounded: every resource of every project becomes a row, and every stray is named on one terminal line. A large account makes a heavy page. Show the forge's things as a count and name the strays, with a bounded list like the MCP tool's five.
- Design (principles 1, 7, 8): the Projects block has no one-sentence purpose, and each row packs kind, region, size, price and provenance into one dot-separated meta line. Give the block one plain sentence under the h2, and move the ownership fact to a
dlrow per project. Saynot made by the forgeand drop the▸glyph from titles on the page. The pull also needs aLooks: /infraline (the gate could not infer a page) and areviewblock of steps. - Clean: the
infraPagedoc comment was left stacked above the newprojectsRegioncomment, so infraPage lost its own. Put it back. docs/features/infra.md ends with a stray blank line. - One way to do the thing: src/cloud/watch.ts already reads the same DigitalOcean and Hetzner lists, and projects.ts now reads them a second time on a second schedule. Say in the pull why, or have the watch read from the kept
cloud_resourcerows. Also, an address counts asforgefrom a label alone, and anyone who can label at the provider can set that label. Say so in the doc, or judge addresses by their machine.
Changes requested — before the latest pushNeither of my two earlier asks is met; both are in the head unchanged. Fix these first.
- The
infraPagedoc comment ("The whole page: ...") still sits aboveprojectsRegion's comment, so two doc blocks are stacked on the wrong function. Move it back ontoinfraPage. - The Projects row still builds its meta with
projectLine(p).split(": ").slice(1).join(": "). This parses a sentence built for the MCP/terminal. A project or account name containing:breaks the row, and the row is one dense line, not adlrow (principles 1 and 7). Render made-by-forge count, found count, cost and read time from theProjectViewfields. The resource rows under each project are also still uncapped; a large account renders every resource on the first paint. Cap them and name the rest, as the MCP list does.
The security side held up: the read is an admin's only, GETs only, via
gatedFetch, andPOST /infra/projectsgoes throughreadFormwith the admin check. Thecloud_resource.made_bypurge coverage is right, and the terminal and MCP doors and the how-to are present.ApprovedApproved. I could not diff against c95d42e (not in my clone), so I read the current change whole. The last commit answers the earlier design ask: a project's row is now a
dlof its own fields (Made by the forge, Found, A month, Read) with at most ten resources beneath, and a test covers it, including a project name containing ': '.Security:
projectsViewandreadProjectsNowcheck admin, andPOST /infra/projectsgoes throughguardandreadForm(ctx, "admin"), so it has the same-origin check. All provider calls are GETs throughgatedFetch, and the keys come from the sealed store. Provider text goes throughplain. SQL is parameterised. There is no new dependency and no secret in the diff. Egress hosts are the existing DigitalOcean and Hetzner ones.Both doors are there: /infra Projects, terminal Infra with
P, MCPinfra listwith a boundedprojectsandsays. The how-to is in docs/features/infra.md, not README. Tests cover the reads, the failure path, and each door.Non-blocking: the terminal's project row names every found resource, so one account with many strays makes a very long line. Cap it with the
projectLineapproach. Non-blocking: docs/features/infra.md ends with a stray blank line. - Tests missing for new behaviour that would otherwise go unguarded: POST /infra/projects (a non-admin gets 404, a cross-origin post is refused, an admin's post reads and flashes), the terminal
-
Checks
shipped production is serving it deploy ba55044
-
History
- Cloud projects: each project's row is a dl of its own fields with at most ten resources beneath; infraPage keeps its doc comment ef60e5b
- Cloud projects: check again (fork-flows passed 11/11 alone) 6f6d8d5
- Cloud projects: cloud_resource.made_by is covered for account purge as not a user d776b8d
- One model for every cloud: provider, account, project, resource, read every 5 minutes, grouped on /infra a481201
- An open edge-kept finding is assigned to the owner on production, so no builder is handed it (#17349) a244ed0
- Talk workspace W3: Test what I touched, Commit and Open pull (#17307) 24db731
- anonymous-deep: whether the loop is behind is said by each test, never read from the process's own lag (#17350) 9b843ee
- The bundle's boot is held by counted work: the imports it resolves on the way to /readyz, against the source boot's (#17347) 57790fd
- Revert #17320: the bundle boot's CPU share doesn't separate bundle from source on Linux (#17346) 2e737a7
- A spawn whose first proof answered still settles it, so the new home is asked… (#17331) 8485415
- Full-suite report files every tally echo under the budget note's file (failed… (#17333) 466ceda
- The crew falls back to the capped key when every plan's window is full, and Settings → Crew shows and steers it (#17168) 4cad6ca
- The bundle's boot is held to a share of the source boot's CPU, measured in the same run, not a wall-clock bound (#17320) 252f7b6
- server.ts imports page, studio, render and API modules on the first request to their prefix (#17313) 9f6e1c4
- The test budget is CPU time: a test starved on a loaded box is not red, one that spends its seconds is (#17310) 3814902
- Advisory integrations: notify on a new exploited advisory (#17326) 31c05ee
- A workspace's dev checkout is synced with the forge's own git, never the operator's environment (#17318) 9a612d3
- fork-flows: the test's forks do not follow, so the background fast-forward cannot move them between two reads (#17328) fe88e40
- sweepSoon starts its sweep on the next turn of the loop, so "sweeping a check… (#17327) 1c9fc4c
- Move the accessors out of looks/service.ts (keepLook, lookUrl, memoryPressure) so it leaves the boot's static closure (#17277) 3bdad32
3 earlier comments
<!-- look-pages 3b16a8356af0 --> Look pages for 3b16a83, from the gate:
look pages (none): this pull changes src/web/pages/infra.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 2e5985c9dd6a --> Look pages for 2e5985c, from the gate:
look pages (none): this pull changes src/web/pages/infra.ts but the forge could not trace the route of /, /docs, /explore and 29 more (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 c95d42e6f918 --> Look pages for c95d42e, from the gate:
look pages (none): this pull changes src/web/pages/infra.ts but the forge could not trace the route of /, /docs, /explore and 29 more (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 ef60e5b0b8e9 --> Look pages for ef60e5b, from the gate:
look pages (none): this pull changes src/web/pages/infra.ts but the forge could not trace the route of /, /docs, /explore and 29 more (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
Phase V3 of #17151 (the owner: "i want to be able to manage everything and see everything from the forge no matter what cloud").
infra listprojects (bounded, with says).preflight: green (173 files).
🤖 Generated with Claude Code