Public: anyone can read this; the crew can change it.
An invite carries a bundle: the owner picks Use, Host or Build, each with a line saying what it allows #18473
Merged 3h 14m ago, live in production
An invite now carries a bundle, Use, Host or Build, chosen when the owner mints it. The new test/invite-bundles.test.ts and the existing invite, MCP-invite and TUI-invite tests pass (78), and tsc is clean.
-
Reviews
Changes requested — before the latest pushThe core is sound: the migration is additive and pinned, an old invite reads as Use, the bundle, machine and caps are validated at the boundary (422 on API and MCP), and the grants are written once in src/core/bundles.ts. I found no injection, authorization or escaping problem. Two things block it.
- Both doors (fix first). The mint is changed on the page, the API and MCP, but the terminal still can only mint a Use invite (
m). A bundle choice is something a person can do on the page and must be doable in src/tui/ too: let the invite screen pick Use, Host or Build, and for Host choose from hostMachines and set the two caps, with the same refusal words from BUNDLE_WORDS. A 'No door' line does not fit here, because the owner can do this on the page. The docs line 'The terminal's m mints a Use invite' then changes to say how to pick in the terminal. - Design (docs/DESIGN.md). The mint form on /admin/limits hand-rolls a
<fieldset class="small">of radios with inline<strong>and<em>, plus three always-visible Host fields (machine, containers, memory) that matter only when Host is picked. Use the named form components and rows the page already has. Show the Host fields only when they apply, which works without JavaScript if Host is its own step or the fields are labelled 'Host only'. Also, each listed invite repeats the bundle's whole sentence in the meta line. Principle 1: nothing explains itself twice. List the bundle's label (plus the machine and caps for Host) and keep the sentence only on the form.
Smaller:
- src/core/bundles.ts:
roleandgrantsare read by nothing yet, so this is data with no reader. Keep it only if a test pins each bundle's grants to validmay()actions. Otherwise leave it for the issue that applies them. - src/http/api/admin.ts and src/http/mcp/tools/mint_invite.ts: the nested ternaries are mis-indented. Map the refusal to words in one helper in actions/invites.ts, so the three doors do not each repeat the chain.
- Tests: add one for MCP
mint_invitewith bundle host, and one for the API with a good Host mint. Today the API is tested only for a bad bundle.
Boxes: 1, 2, 3, 4 and 5 are met by this head. Box 2 is ticked on the data and the one-module rule. The form's markup is the design finding above.
ApprovedEvery earlier ask is met in the later commits. (1) Both doors: the terminal's
mnow asks for the days, then the bundle. Host goes on to a machine from hostMachines, then the two caps, and refusals use the same words as the page. The docs line says so. (2) Design: the form usesselectFieldanddisclosure('Host only'), which works without JavaScript. The list shows the label, plus machine and caps for Host, and the full sentence stays on the form. (3)roleandgrantsare now pinned by a test that each grant is amay()action. (4)mintRefusalis one helper shared by the page, API, MCP and terminal. (5) Tests were added for an API Host mint (201), MCP Host (good and stranger machine) and the terminal's Build and Host-without-machine paths. I found no new security problem: input is validated at the boundary, nothing is built from user text, and the output is escaped. Non-blocking: with no machine on offer, Host is left out of the select, with a hint saying why, instead of being a disabled option. That is acceptable. - Both doors (fix first). The mint is changed on the page, the API and MCP, but the terminal still can only mint a Use invite (
-
Checks
shipped production is serving it deploy 5a6b787
-
History
- Bundle choice in the terminal; form and list follow the design system (#18453) 6e468c4
- Invite tests carry the bundle column and event field (#18453) 2f90992
- Pin the invite-bundle migration (#18453) bbb61a8
- An invite carries a bundle: Use, Host or Build, each with its line f57fdb2
- A pull whose own commits took their change back closes with nothing landed; i… (#18448) 8af1f6c
- Full suite red: test/tab-browser.test.ts (#18443) e725a06
- talk-layout.test.ts shares one Chromium for the file instead of starting one… (#18441) 5dd19f3
- Full suite red: test/talk-layout.test.ts (#18439) 284205b
- Games config page: an ro token is told its scope, not a missing grant, and th… (#18437) 00bfa70
- Full suite red: test/talk-follow.test.ts (#18435) 171c1ec
- Games: what a page draws for an ro token matches what its POST allows (#18433) db29dfc
- Access 3, games: mayOnGame answers alone for the box, server and game-door checks (#18429) a73dcca
- Access 3, terminal: the palette offers a screen by its `asks` through may(); the entries' own gates go (#18431) 55693b7
- Access 3, web pages: the two known partings are decided, then each page's own isAdmin and sign-in check is deleted and may() alone decides (#18430) d4ae8b7
- Access 3, terminal, games and infrastructure: the entries' own gates are deleted once may() has been asked beside them and agrees (#18428) be10e7a
- An imported session's page has a red Delete that asks for its title typed (#18423) 22c9252
- Access 3, terminal and games: SSH screens and game grants ask may() in shadow (#18412) fea5438
- A person deletes one of their imported sessions from its page, by typing its name (#18371) 3d2fa7b
- An imported session is deleted through the API by its owner who sends its exact title (#18390) 2c0a8b8
- Access 3, MCP: the scope floor is read from the disagreement count, then deleted (#18418) e374d6c
5 earlier comments
An invite now carries a bundle, Use, Host or Build, chosen when the owner mints it. The new test/invite-bundles.test.ts and the existing invite, MCP-invite and TUI-invite tests pass (78), and tsc is clean. I did not run the full suite or the dead-code, duplicate-import, page-budget and module-state checks the issue lists; scripts/fast.ts called the change too broad to name tests, and the forge's check runs the rest on this push.
What changed
src/core/bundles.ts(new): holds the three bundles in one place. Each has a label, one plain line of what it allows, the role it lets the person in as, and its grants as plainmay()action names. It holds no check and applies nothing.- Migration
20261206100000-invite-bundle: adds four nullable columns,bundle,host_machine,host_containersandhost_memory_mb, and is pinned. A nullbundlereads as Use, so old invites still list as Use. mint: takes a bundle, defaulting to Use, and puts it in theinvite.mintedevent.- Host: needs a machine from the offered list plus positive container and memory caps. The offered list is the running, non-game machines on
/infra, read throughinfraOf. That is my reading of "machines this forge can offer"; say if you meant something else. - Refusals: an unknown bundle, a machine not on the list, a bad cap or Host with no machine is refused. The API and MCP answer 422; the page flashes the reason.
- Mint form on
/admin/limits: shows each bundle as a radio with its line. With no machine to offer, Host is disabled and the form says why; otherwise the machine select and cap fields appear. - Listing: each invite shows its bundle line and, for Host, its machine and caps.
- API and MCP:
POST /api/v1/admin/invitesandmint_inviteacceptbundle,machine,containersandmemoryMb. - Docs:
docs/features/invite-bundle.mdis the how-to.
What I left out
- No grants are applied; that is the next issue.
- The terminal's
mstill mints a Use invite. The commit says "No door" for it. - Host's caps are stored only; nothing enforces them yet.
Tests
- Each bundle mints and lists with its line.
- Host with no machine is refused and the page says why.
- A stranger machine or a bad cap is refused.
- The API answers 422.
- An old invite reads as Use.
- I changed two existing tests because they were out of date.
test/invites-action.test.tsexpected the exactinvite.mintedpayload, which now also carriesbundle.test/invites-core.test.tsbuilds its schema by hand, so it now runs the new migration.
For the reviewer
bundles.ts#positiveresemblesflow/valve.ts#parseLevel(0.64, flagged by the gate). Their bounds differ, so I kept both.- I added no dependency.
Try it
Open /admin/limits as an admin, pick Use or Build, and make a link; the "Invite links made" list shows the bundle line. Or POST /api/v1/admin/invites {"bundle":"root"} for a 422.
Looks: /admin/limits
[{"go":"/admin/limits","look":"Invite links: three bundle choices, each with its line; Host disabled with a reason when no machine is offered","expect":"Use is selected; Build makes a link; the list below names the bundle"}]
🤖 Generated with Claude Code
The terminal can now pick a bundle, the mint form follows the design system, and the three doors share one refusal helper. I pushed this to the same branch. These pass: tsc, the design lint, and the invite, TUI, MCP, page-budget, dead-code, duplicate-import and module-state tests. I did not run the full suite; the forge's check does that on push.
- Terminal:
mon Invite links asks for the days, then the bundle (Use, Host or Build). Host goes on to a machine picked fromhostMachines, then the two caps. With no machine it says why, in the sameBUNDLE_WORDSthe page uses. The docs line now says how to pick in the terminal. - Mint form on
/admin/limits: the hand-rolled radios are now aselectFieldfor the bundle, with each line in its option. Host's machine and caps sit in adisclosurelabelled "Host only", so they work without JavaScript. The one deviation from the issue: with no machine on offer, Host is left out of the select and the field's hint says why, instead of showing a disabled option. - Invite list: each invite shows its bundle label, plus the machine and caps for Host. The full sentence stays on the form only.
- Refusal words:
mintRefusalinsrc/actions/invites.tsnow words the refusal for the page, API, MCP and terminal, replacing the nested ternaries. roleandgrantsinsrc/core/bundles.ts: I kept them, as you allowed, and added a test that every grant is an actionmay()answers. Nothing reads them yet; the next issue applies them.- New tests:
- an API Host mint that succeeds (201) with its machine and caps;
- MCP
mint_invitewith Host, good and with a stranger machine; - the terminal picking Build, and Host with no machine.
- I also changed three existing terminal tests, because
mnow has one more step (the bundle picker).
- Gate: it still prints two "one implementation?" notes:
mintRefusal(0.61, againstverifiedSentence) andpositive(0.64, againstparseLevel). The first words different errors and the second has different bounds, so I kept both.
Looks: /admin/limits
[{"go":"/admin/limits","look":"Invite links: a select 'what it allows' with Use, Host, Build and each line; a closed 'Host only' disclosure when a machine is offered","expect":"Without a machine Host is absent and the hint says why; the list below shows only the bundle label"}]
🤖 Generated with Claude Code
Neither failure comes from this pull, so I changed nothing and pushed nothing.
each page of tools/list stays under 40 KB…: the failing assertion namesplan.issues.owner (91 bytes), a property description from the planning tool, which this pull does not touch. The check log says the same test is red on main at 840ab71 too ("not counted against this pull"). On this branch alone,test/mcp-size.test.tspasses (12 of 12), including with thebundle,machine,containersandmemoryMbfields I added tomint_invite. The failure comes from main's own tool list, so it needs a fix there.a page the printer says it cannot take is refused with a sentence…(test/print_raster.test.ts): this one the check did count against the pull, but I couldn't reproduce it. It passes here on this branch (4 of 4). The test drives a loopback printer stub for raster refusal and has no connection to invites, so I read it as a flake under shard load. The check re-ran it alone and it still failed, so I can't rule out a race in the test itself. A person should look if it fails again.
A fresh check run, with no change from me, should show whether the printer test fails again. Main also has newer commits (840ab712e and others), so the next merge starts from there.
The only new item is the gate's look-pages note. It is informational and asks for no change: it names /admin/limits, and the Looks: /admin/limits line and the review block are already there.
I met the four listed checks before my last push. These all passed on this branch: the dead-code test (test/unused-exports.test.ts), the duplicate-import test (test/dup-imports.test.ts), the page-budget test (test/page-budget.test.ts) and the module-state test (test/module-state.test.ts).
Nothing new is open on my side, so I changed nothing and pushed nothing. The two failures from the last check run are not caused by this pull; the details are in my earlier message:
test/mcp-size.test.tsis red on main too, over a description on the planning tool.test/print_raster.test.tspasses here and has nothing to do with invites. I read it as a flake under shard load, but I can't rule out a race in the test.
An invite now carries a bundle, Use, Host or Build, chosen when the owner mints it. The new
test/invite-bundles.test.tsand the existing invite, MCP-invite and TUI-invite tests pass (78), andtscis clean. I did not run the full suite or the dead-code, duplicate-import, page-budget and module-state checks the issue lists;scripts/fast.tscalled the change too broad to name tests, and the forge's check runs the rest on this push.What changed
src/core/bundles.ts(new): holds the three bundles in one place. Each has a label, one plain line of what it allows, the role it lets the person in as, and its grants as plainmay()action names. It holds no check and applies nothing.20261206100000-invite-bundle: adds four nullable columns,bundle,host_machine,host_containersandhost_memory_mb, and is pinned. A nullbundlereads as Use, so old invites still list as Use.mint: takes a bundle, defaulting to Use, and puts it in theinvite.mintedevent./infra, read throughinfraOf. That is my reading of "machines this forge can offer"; say if you meant something else./admin/limits: shows each bundle as a radio with its line. With no machine to offer, Host is disabled and the form says why; otherwise the machine select and cap fields appear.POST /api/v1/admin/invitesandmint_inviteacceptbundle,machine,containersandmemoryMb.docs/features/invite-bundle.mdis the how-to.What I left out
mstill mints a Use invite. The commit says "No door" for it.Tests
test/invites-action.test.tsexpected the exactinvite.mintedpayload, which now also carriesbundle.test/invites-core.test.tsbuilds its schema by hand, so it now runs the new migration.For the reviewer
bundles.ts#positiveresemblesflow/valve.ts#parseLevel(0.64, flagged by the gate). Their bounds differ, so I kept both.Try it Open
/admin/limitsas an admin, pick Use or Build, and make a link; the "Invite links made" list shows the bundle line. OrPOST /api/v1/admin/invites {"bundle":"root"}for a 422.Looks: /admin/limits
🤖 Generated with Claude Code
Closes #18453