Public: anyone can read this; the crew can change it.
A cloud account can be a sealed, expiring, read-only view for a client #17942
Merged 22h 39m ago, live in production
A client's cloud can now be attached as a sealed, expiring, read-only view. Today only Azure works, and the key is a Reader service principal.
-
Reviews
Changes requested — before the latest pushGood shape overall: sealed key with AAD, sweep on every door, audit before read, own tables, no API/MCP door. Changes needed, in one round:
- (first) An admin who is not named cannot delete the key:
endClientCloudKeyanswers not_found unless the admin is a member, yet the docs and the page say an admin deletes it early. The off switch must not depend on being named. Let an admin through (still 404 for everyone else) and add a test. readOnlylets a GET go to any host. Restrict GETs to login.microsoftonline.com and management.azure.com so a redirect or link in a response can never carry the bearer token elsewhere; test it.- Principle 1: the off-switch sentence is said twice on the view page, and a third paragraph explains what is not shown. Say it once.
- Every page load makes a live read of the client's cloud with no limit on one person reloading; consider a short per-view guard, or say in the pull why not.
ApprovedAll four earlier asks are met in the diff since 06f9bdce5. (1) Any admin can now delete any key (
endClientCloudKey), and the admin's list shows a delete button on views they are not named on. A stranger still gets 404, and a test covers both. (2)readOnlynow refuses any request that is not https to login.microsoftonline.com or management.azure.com, with tests for evil hosts, plain http and a lookalike suffix. (3) The extra off-switch paragraph is gone, so the sentence appears once on the page. (4) The 5-second reload guard is stored in the audit table with no module state, and a test covers it. Nothing new to block. Non-blocking: in the terminal an admin who is not named sees 'That view is gone' when opening a view, thoughxstill works; fine as it is. - (first) An admin who is not named cannot delete the key:
-
Checks
shipped production is serving it deploy a338207
-
History
- An admin not named still deletes a key; reads only reach Microsoft's two hosts; one reload guard; say the off switch once 9a11d30
- Say why the client clouds pages have no look 06f9bdc
- Name session and render on the client clouds list; list it in the router-wide page tests 1ecad4a
- Name the client cloud page in the page audit, the walk's skip list and the unfixtured pages 6d4d8c0
- Rewrap comments 2f20a02
- A cloud account can be a sealed, expiring, read-only view for a client d5a7c7c
- The /search page keeps to the repository repo:owner/name names in q, as /api/… (#17932) c310a25
- Talk: no conversation cap; archive old threads to backup storage and restore on open (#17930) f8f8b8f
- JSON for the home lanes, figures and slot graphs, with ETags (#17923) e16b19a
- A crew run's page says how its model was fed, so a packed SubQ run compares with its explored run and with Claude (#17925) 52b26cd
- Infrastructure reads Azure: subscriptions, resources and costs (#17924) 4ceb81b
- Merge pull request #17921 from sold/azure-reads 509de83
- Azure reads serve #17922 570fb17
- Feed each model the way it works: packed context for long-window models like SubQ, tools for the rest (#17918) 898c0b9
- A preview that does not start shows its last start lines and the cause on the pull page (#17904) 3b4cddd
- openapi.json describes what each route answers (#17917) d398aa1
- Infrastructure reads Azure: each subscription a project, its resources from Resource Graph eb2191e
- A release keeps the forge's log and each child forge's up and down history, so "was it down?" has an answer (#17913) 4c8a425
- A Talk answer that fails says which call failed and why, in the pane (#17900) f29a578
- Name and bound the largest heap retainer from production's own census (#17908) 5501eb1
7 earlier comments
A client's cloud can now be attached as a sealed, expiring, read-only view. Today only Azure works, and the key is a Reader service principal. The new tests, the five cross files, the hollow, doorless, own-source, route-marks, boot-lazy and unused-exports tests pass, and bun x tsc --noEmit and the design lint are clean. I did not run the full suite or the port-binding tests; the forge's check runs those.
What changed
- Attach. An admin pastes
TENANT_ID:CLIENT_ID:CLIENT_SECRETand a number of days, 1 to 90. The key is read once to check it, then sealed. Only the creator is named at first. - Looking. The named people open
/client-clouds/:idand read the cloud live: subscriptions, then each resource's kind, region, size and state. Nothing is kept from the read. - Naming. Any named person can name another, but only a signed-up person, never a crew member or an organization. An admin or whoever attached the key can delete it early; that button goes through
/-/confirm. - Expiry. The key is deleted at its expiry. Every way in sweeps first, and a new
client-keysduty sweeps every ten minutes. The view and its audit stay and say the key is deleted. - No write verbs. The reader's network,
readOnlyinsrc/cloud/client_read.ts, lets through only GETs, Azure's sign-in and its two read queries. Any other verb or path throws before it is sent. - Audit. Every look is recorded in the view's own table before the read, and the attach is the first row. The rows show on the page and in the terminal.
- Kept out. The view has its own tables, so it never touches
cloud_account,cloud_resource,cloud_project,secretorevent. That keeps it out of the owner's tree, costs, cost watch, feed, Talk and crew runs. The tests check this, including the key being absent from those tables. - The off switch. The page and the terminal both say the client's own expiring Reader principal is the real off switch.
- Doors.
- Web:
/client-clouds,/client-clouds/:id, plus grant and end posts. They are a new open head,client-clouds, which is also a reserved name. - Terminal: a "Clients' clouds" screen.
enterreads a view,nnames someone,xdeletes the key after typingdelete, andaattaches. It is offered only to a person who is an admin or is named. - Docs:
docs/features/client-clouds.md.
- Web:
- Reused.
net.fetchfromactions/cloud.ts,readAzure,seal/openfromkernel/secret.ts,confirmAction,promptScreenandlater.
Chosen not to do
- No API route and no MCP tool. A token is not a named person, so the crew, which only acts through tokens, has no way to ask.
- No Azure cost for the client's cloud, and no other providers.
- No new
Co-authored-bylines; the commits carry the usual attribution.
Try it
- Sign in as an admin and open
/client-clouds. - Attach an Azure Reader key for 7 days, then name a second person.
- Open the view as each: the page shows the off-switch line, who is named, and the looks.
- A third, unnamed person gets a 404.
- In the terminal, press Ctrl-K and type "Clients".
[
{"go": "/client-clouds", "look": "Attach form (admin) and the list of views you are named on", "expect": "Admin sees the form; a person named on none and not an admin gets 404"},
{"go": "/client-clouds/<id>", "look": "The off-switch paragraph, resources by subscription, Named, Every look", "expect": "Says the client's own expiring Reader principal is the real off switch; the key text appears nowhere"},
{"go": "/client-clouds/<id>", "look": "Delete the key now", "expect": "Goes to /-/confirm, then the view says the key is deleted and nothing is read"}
]<!-- look-pages 2f20a02da72c --> Look pages for 2f20a02, from the gate:
look pages (none): this pull changes src/web/pages/client_cloud.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
Fixed and pushed: the four failures all came from the new /client-clouds/:id page missing from lists that cover every page. After the changes, test/empty-notes.test.ts, test/design-audit.test.ts, test/pages-budget.test.ts, test/no-polling.test.ts and test/client-cloud.test.ts pass, and bun x tsc --noEmit is clean. I did not run the full suite; the forge's check does that on this push.
- Audit list: added the
/client-cloudsentry todocs/design/audit.md(test/design-audit.test.ts). - No-polling walk: named
/client-clouds/:idas not walked, with its reason, intest/no-polling.test.ts. The seed has no client cloud the signed-in person is named on. - Unfixtured pages: added
test/budgets/unfixtured/client-clouds-id.jsonwith the same reason (test/pages-budget.test.ts). - Empty note: the page's "Nothing found." line now uses
muted small, so it no longer counts as a page wording its own empty note (test/empty-notes.test.ts).
No test was wrong; each failure was the new page missing from a list.
What the pull adds is unchanged: a sealed, expiring, read-only Azure view for a client's cloud.
- It is open only to named people, and the key is deleted at its expiry.
- Every look is audited.
- The view is kept out of the owner's cloud tables, the feed, Talk and the crew.
- The page and the terminal both say the client's own expiring Reader principal is the real off switch.
To try it, sign in as an admin, open /client-clouds, attach a key, name a second person, and open the view. In the terminal, press Ctrl-K and type "Clients".
<!-- look-pages 6d4d8c016c57 --> Look pages for 6d4d8c0, from the gate:
look pages (none): this pull changes src/web/pages/client_cloud.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
A cloud account can now be a sealed, expiring, read-only view for a client. This push fixes the four failing router-wide tests, which didn't know about the new /client-clouds pages. Those tests, the client-cloud tests and tsc pass locally; I haven't seen the forge's check on this push yet.
- Page timing:
/client-cloudsanswered with onlyappinServer-Timing. It now namessessionandrenderlike the other pages, insrc/web/pages/client_cloud.ts. I fixed the page rather than adding it to the debt list. - Seed list:
/client-clouds/:idis added to the patterns the seed cannot fill intest/security-floor-routes.test.ts. It needs a client cloud the signed-in person is named on, and the seed has none. - Looks list:
/client-cloudsis added to the not-a-page list intest/forge-looks.test.ts, with the reason that it has no picture and a guest gets the not-found page. - Statement-count test: "the second look at home as the owner costs a bounded number of statements" passes locally. I made no change for it, so I don't know whether it failed on the forge for a different reason.
The gate printed similarity notes in src/web/pages/client_cloud.ts, test/client-cloud.test.ts and test/tui-client-clouds.test.ts. I left those alone.
To try it, sign in as an admin and open /client-clouds.
🤖 Generated with Claude Code
<!-- look-pages 1ecad4a7055d --> Look pages for 1ecad4a, from the gate:
look pages (none): this pull changes src/web/pages/client_cloud.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
I pushed one empty commit, 06f9bdce5, whose message carries the lines the look-pages gate asked for. I changed no code.
- Look pages: the commit says
No look: /client-clouds is private, a guest sees the not-found page and an admin's list is covered by test/client-cloud.test.ts. I chose "No look" over naming a nearest page because there is no public page close to it. If you want a picture, say which path to name. - Issue number: the same commit carries
Direction: … (#17937). - Dead-code and module-state tests:
test/unused-exports.test.tsandtest/module-state.test.tspass on this branch, so this pull adds no unused export and no module-level Map, Set or array that requests write to. as never: I didn't look for it. The earlier fix changed no test input.- Gate: the gate still prints similarity notes for
test/client-cloud.test.tsandtest/tui-client-clouds.test.ts, and I left them alone. I haven't seen the forge's check on this push yet.
🤖 Generated with Claude Code
I've addressed all four points and pushed 9a11d30ec. The client-cloud and TUI tests, forge-looks and tsc pass locally; the forge's check hasn't run on this push yet.
- Admin off switch:
endClientCloudKeynow lets any admin end any key, and anyone else not named still gets 404. A non-named admin can't open the view page, so the admin's/client-cloudslist now shows every view. On views they aren't named on, it shows a "Delete the key now" button and no link. A test covers an unnamed admin ending the key and a stranger getting 404. - GET hosts:
readOnlynow refuses any request that isn't https tologin.microsoftonline.comormanagement.azure.com. Tests cover a GET toevil.example, plain http, andmanagement.azure.com.evil.example. - Off-switch sentence: I removed the "Not in your cloud accounts…" paragraph from the view page, so the off-switch sentence appears there once.
- Reload guard: a person's live read of a view is skipped if they already made one in the last 5 seconds. The page then says "you looked a moment ago: wait 5 seconds between looks". The check uses the audit table, so no module-level state is added, and a test covers it. The first look after attaching a key isn't affected.
In the terminal screen, an admin who isn't named and opens a view sees "That view is gone", but x still deletes the key. I left that as it is.
The gate still prints its similarity notes for the two test helpers, and I left them. The commit carries the Direction: … (#17937) and No look: lines, and the unused-exports and module-state tests pass.
🤖 Generated with Claude Code
A client's cloud can now be attached as a sealed, expiring, read-only view. Today only Azure works, and the key is a Reader service principal. The new tests, the five cross files, the hollow, doorless, own-source, route-marks, boot-lazy and unused-exports tests pass, and
bun x tsc --noEmitand the design lint are clean. I did not run the full suite or the port-binding tests; the forge's check runs those.What changed
TENANT_ID:CLIENT_ID:CLIENT_SECRETand a number of days, 1 to 90. The key is read once to check it, then sealed. Only the creator is named at first./client-clouds/:idand read the cloud live: subscriptions, then each resource's kind, region, size and state. Nothing is kept from the read./-/confirm.client-keysduty sweeps every ten minutes. The view and its audit stay and say the key is deleted.readOnlyinsrc/cloud/client_read.ts, lets through only GETs, Azure's sign-in and its two read queries. Any other verb or path throws before it is sent.cloud_account,cloud_resource,cloud_project,secretorevent. That keeps it out of the owner's tree, costs, cost watch, feed, Talk and crew runs. The tests check this, including the key being absent from those tables./client-clouds,/client-clouds/:id, plus grant and end posts. They are a new open head,client-clouds, which is also a reserved name.enterreads a view,nnames someone,xdeletes the key after typingdelete, andaattaches. It is offered only to a person who is an admin or is named.docs/features/client-clouds.md.net.fetchfromactions/cloud.ts,readAzure,seal/openfromkernel/secret.ts,confirmAction,promptScreenandlater.Chosen not to do
Co-authored-bylines; the commits carry the usual attribution.Try it
/client-clouds.Closes #17937