Public: anyone can read this; the crew can change it.
Access 5: a visitor with no account is someone the forge knows, and what they made comes with them when they sign up #18069
Parked 2h 27m ago
A visitor with no account now has a signed id, a role in the CAN table, and a way to bring what they made into an account. Three things the issue lists are not done: the same-origin tab forge's and the Apple app's POST /visitor/work calls, the existing anonymous spawn, and the "same may() table".
-
Reviews
No review yet.
-
Checks
stopped parked by the crew deploy 54c9594
-
History
- Test: the suspended-visitor socket test uses a name that is not reserved 54c9594
- Merge main into mason/18051-access-5-a-visitor-with-no-account-is-so e27a76e
- Spend 3: the same cost reads and planned stop/delete as MCP tools and a terminal screen (#18206) c30e6bb
- Games: host the spark profiler viewer and its uploads in the forge (#18096) beabbda
- Games: a day after a mod set is installed, the games page says whether it helped, with take-back one tap away (#18201) 2243020
- Games: installing the quality set ships Essential Commands' config with only /home, /spawn and /tpa on (#18199) 7b84b2c
- Merge main into mason/18051-access-5-a-visitor-with-no-account-is-so de80e79
- Connections on an account: verified identities the person controls, each with its own uses, and a lookup that answers only on opt-in (#18120) 314f4eb
- Merge main into mason/18051-access-5-a-visitor-with-no-account-is-so cc90944
- A granted app's two-page print comes out as one sheet, printed on both sides (#18194) e2e7eb4
- Traces 5c: the trace list and one trace read through MCP tools and a terminal screen compare (#18183) cc38920
- Access 5a: a visitor principal is minted only when a visitor creates something, signed, with a role in may() and per-visitor limits (#18174) e261ee9
- Games: the forge pins forge-velocity d0635dac1654 (cannot throw into a command) (#18203) 08c4b42
- Merge main into mason/18051-access-5-a-visitor-with-no-account-is-so e00d80a
- Spend 2: plan a Stop or Delete from the cost row, refused on a read-only account, audited (#18170) fecfd88
- Mail from the owner's AWS account: the forge sets up SES, its DNS records and the mail key in one confirmed step (#18119) bd73c12
- Games: a mod-set install refuses a Modrinth slug that now points at a different project than the lock holds (#18200) fa82fd9
- may test: an anonymous visitor may keep_work 3b6f260
- Merge main into mason/18051-access-5-a-visitor-with-no-account-is-so 7130508
- Access 3b: MCP, pages, the terminal, games and infrastructure ask may(), one door per pull (#18186) 5a3de44
21 earlier comments · 1 event
A visitor with no account now has a signed id, a role in the CAN table, and a way to bring what they made into an account. Three things the issue lists are not done: the same-origin tab forge's and the Apple app's POST /visitor/work calls, the existing anonymous spawn, and the "same may() table". I ran bun x tsc --noEmit, bun scripts/design-lint.ts, bun test test/mcp-size.test.ts and about 400 related tests, all green. I did not run the whole suite; the forge's check does that.
Threat note. The risk is account takeover and privacy: someone planting their things into a victim's account, or lifting a victim's device list.
- The id is signed under its own label (
visitor-principal), not the analytics one. Cookieforge_vp, shapev…;forge_visitorandc…ids are never accepted as one, and the two are never joined. - The id is minted only at
POST /visitor/work, never on a read. Do-Not-Track and Global Privacy Control mean no id is given. - Bringing needs a signed-in person, a same-origin form, the signed id, and a
confirmbound to account, session, device and chosen rows. The confirm comes from the page that account was shown. A forged, borrowed or missing one moves nothing, with or without a passkey on the account. - A bringing is one transaction with a receipt. It can be undone for a day, then it is theirs.
- Visitor events are not added to the reader-visible event list.
What changed
src/auth/visitor_principal.ts: mints and verifies the signed id and builds its cookie and confirmation token. It reusescookieValueand therefusesTrackingcheck.src/core/visitor_work.ts: keeps what a visitor made (apps from the tab forge, notes, game players) and does the bringing and the undo. Thevisitor_principal,visitor_itemandvisitor_carrytables are in migration20261204052000-visitor-principal.src/core/roles.ts: avisitorrole withreadandkeep_work.docs/ROLES.mdis regenerated.- Limits: three
visitor.*rows insettings/limits.ts: things per visitor (20), things per forge per day (1000), new ids per day (2000). Past one, the door answers 429. - Web:
/visitor/bring(list, bring, undo) andPOST /visitor/work, insrc/web/pages/visitor_bring.ts. After sign-in the front page says once that something waits. - Move-in:
/forges/move-inbrings the visitor'stab_appitems into the account that moves in. - Terminal: the palette entry "Brought in from a device" shows what was brought and the receipts.
uundoes the newest bringing still inside its day. - Docs:
docs/features/visitor-carry.md, and two threat bullets indocs/threats/automated-attacker.md. - Cookie roster:
test/cookie-flags.test.tsgained entries for the new cookie. - Tests:
test/visitor-carry.test.ts, 14 tests. They cover make as a visitor, bring, find it owned by the account, and a second visitor presenting the first's id without its signature being refused. They also cover forged, borrowed and missing confirms into a passkey account, a cross-site post, undo, limits, GPC/DNT, and the move-in hook.
What I chose not to do
- Existing anonymous spawn: its own claim link (
src/spawn/claim.ts) is untouched; moving it onto this model is a separate slice. - Callers of the door: the tab forge's and the Apple app's calls to
POST /visitor/work(#18043, forge-apple #52) are theirs to add. There is no API route or MCP tool, somcp-sizeis unaffected. - "Same
may()table":contract/can.ts'smay()is the evaluator for apps' contracts. The forge's own table isCAN, so the visitor role went there. - Account page: the account page and terminal
canscreen list every ability, so a member now also sees "Keep what you make before you have an account: no". - Per-client mint limit: there is no per-address limit on minting, since that would store an address-derived value. Minting is capped per forge per day, and each visitor is capped per kept item.
Try it. On the preview, curl -i -d 'kind=tab_app&ref=notes&label=Notes' -H 'origin: <preview url>' <preview>/visitor/work returns a forge_vp cookie. Open /visitor/bring signed out, then signed in, to choose and bring the item, then undo it. On the terminal, open the palette entry "Brought in from a device".
[
{"go": "/visitor/bring", "look": "signed out, in a browser holding forge_vp with a kept item", "expect": "the item is listed with Sign in and Sign up buttons"},
{"go": "/visitor/bring", "look": "signed in, same browser", "expect": "checkboxes and one button to bring the chosen things; after pressing it a receipt with Undo"},
{"go": "/", "look": "signed in with an unbrought item on the device", "expect": "one notice pointing at /visitor/bring"}
]
🤖 Generated with Claude Code
I merged main into the branch and pushed it (46c10cf33). Only src/generated/screens.ts conflicted. It's generated, so I took main's version and regenerated it with bun scripts/own-source.ts.
After the merge, bun x tsc --noEmit was clean and test/own-source.test.ts passed (3 tests). I did not run the wider test set. scripts/fast.ts found 4144 files affected, about 5 hours of tests, so I stopped it. The forge's check will run the full suite on this push.
No new behaviour, no new dependencies, and no page changes.
This push fixes the one failing check from #18069: the event-audience coverage test, which flagged visitor.brought and visitor.undone. Those two events are emitted when someone brings a device's work into their account or undoes it (src/web/pages/visitor_bring.ts). Nobody had classified them, so they would have defaulted to admin-only.
I classified both as the actor's own receipts in src/core/event_audience.ts. Only the person who brought or undid the items sees them in their feed. The commit carries No door: an event audience entry, not a page, action or route, because no page, action or API route changed.
I ran these before pushing:
- Event audience coverage test: passes (5/5).
- The other three checks the crew keeps failing: the dead-code, module-state and
duringjob-timing tests pass (test/unused-exports.test.ts,test/module-state.test.ts,test/job-slices.test.ts). bun x tsc --noEmit: clean.bun scripts/gate.ts --fix: it rewrapped nothing. It did print two "one implementation?" notes, onreceiptsOfand onvisitorRoutes. They aren't errors, and I left them alone because merging them would change code beyond this fix.
I did not run the full suite. The forge runs it on this push.
I chose not to touch anything else in the pull. To try it, sign in on a device that has anonymous work, open /visitor/bring, bring something in, and undo it. The receipt shows in your own activity and in nobody else's.
I merged main into this branch and pushed it. src/generated/marks.ts was the only conflict, and I regenerated it with bun scripts/own-source.ts instead of merging it by hand.
bun x tsc --noEmit is clean. test/own-source.test.ts and the visitors tests pass (17 tests). I did not run the full suite; the forge runs the whole check on the push.
bun scripts/gate.ts --fix ran and left nothing to commit. It still prints two "one implementation?" similarity notes, on receiptsOf and on visitorRoutes, which I left alone.
I merged main into the branch and pushed. The only conflict was docs/ROLES.md.
Both sides had rewritten the opening of that file, so I kept both. From main I kept the new "The words" table and the paragraph on principalOf. I merged my visitor-carry sentence (#18051) into that paragraph. Its old line said nothing is stored for a visitor, which contradicted what this branch does. It now reads "no account row exists for one, though they may keep what they make to bring it into an account when they sign up", and points to docs/features/visitor-carry.md.
bun x tsc --noEmit is clean, and the roles, own-source and visitors tests pass (29 tests). I did not run the full suite; the forge runs the whole check on the push. bun scripts/gate.ts --fix left nothing to commit. It still prints the "one implementation?" similarity note on visitorRoutes, which I left alone.
I merged main into the branch again and pushed. The only conflict was src/generated/marks.ts, same as the first time. I took main's copy and regenerated it with bun scripts/own-source.ts, so it reflects both sides.
bun x tsc --noEmit is clean. The own-source, visitors and roles tests pass (29 tests). I did not run the full suite; the forge runs the whole check on the push. bun scripts/gate.ts --fix left nothing to commit. It still prints the "one implementation?" similarity note on visitorRoutes, which I left alone.
This push fixes the failing check. docs/design/audit.md had no entry for /visitor/bring, the page this pull added, so the audit had 141 entries against 142 pages. I added the entry after /bring. test/design-audit.test.ts now passes (4 of 4), and I ran only that file, not the full suite or tsc.
I made no other changes. Every other change in the pull is as it was before this push, and no code changed here.
Review
[{"go":"/visitor/bring","look":"the page lists what this device made before an account","expect":"unchanged by this commit; only the design audit doc gained a line"}]
🤖 Generated with Claude Code
I merged main into the branch, fixed what the merge broke, and pushed. tsc --noEmit is clean. I ran five test files and they pass: own-source, design-audit, visitor-carry, may and roles. I did not run the wider set that scripts/fast.ts named. It covers 4,188 files and would take hours, so I left it to the forge's check.
src/generated/marks.ts: this was the conflicted file. I took main's version and regenerated it withbun scripts/own-source.ts, so it is not hand-merged.isAccountItself: main changed it to take the database as its first argument.src/web/pages/visitor_bring.tsandsrc/web/visitor_offer.tsnow passctx.app.db. Before this, the visitor-carry tests failed with 500s on/visitor/bring.forge.keep_work: main'smaytable only knew abilities from the old role list. I addedforge.keep_worktoACTIONSinsrc/core/may.tsand to the list indocs/features/may.md.
The gate (scripts/gate.ts) flagged two possible duplicates, receiptsOf against ownedRepos and visitorRoutes against forgesRoutes. I didn't act on them. It also noted over-long comment lines in three files, which its rewrap fix did not change.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. src/generated/screens.ts was the only conflict.
I took main's version of that file and regenerated it with bun scripts/own-source.ts, so it is not hand-merged. No other files conflicted, and I made no code changes beyond the merge.
tsc --noEmit is clean. I ran five test files and they pass: own-source, design-audit, visitor-carry, may and roles. I did not run the wider set that scripts/fast.ts names, which is too large for this sandbox, so the forge's check covers that.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. The only conflict was src/generated/screens.ts, the screen roster that bun scripts/own-source.ts generates.
- Resolution: I took
main's version of the file, then regenerated it withbun scripts/own-source.ts, so it now holds the screens from both sides. No conflict markers remain. - What ran:
bun x tsc --noEmitcame back clean, andtest/own-source.test.tspasses (3 tests, which is the test that fails when the roster is stale). - What didn't run: I did not run the full set of tests that
scripts/fast.tsnamed for this change. It named 4,197 test files, with an estimated run of about 346 minutes, so I stopped it. The forge's check runs the full suite on this push. - Gate: I did not run
bun scripts/gate.ts(--explainor--fix) after the merge. The merge itself changed nothing beyond the regenerated roster.
This push fixes the 10 failures the check reported. I re-ran the affected test files locally and they pass (tui-can, mcp-forge-admin, palette-roster, tui-app-templates, here-pages, attention, server-timing-sweep, reserved-names, who-can, visitor-carry). bun x tsc --noEmit is clean. I did not run the full suite; the forge runs that on push.
What was wrong and what changed
forge.keep_workleaked to accounts.forge.keep_workhad no entry in the ability table insrc/core/may.ts. It fell through to theaccount.managebranch, so every signed-in session was told it could keep work, while the roles table said guests can't. It now holds only when there is no account behind the request, as with a visitor. This fixes the terminal "What I can do" row and thewhoami_canresult./visitor/bringhad no timing. It never namedsessionandrenderinServer-Timing, which the sweep requires of every GET page. It now does, insrc/web/pages/visitor_bring.ts.visitorwasn't a reserved name./visitoris a top-level page, so I addedvisitortoSYSTEM_NAMESinsrc/core/reserved.tsso it can't be taken as a username.- Two test expectations were out of date. The palette roster now includes the new "Brought in from a device" entry, which is correct for this pull. The
whoami_canexpectation now includeskeep_work: false. I did not changetui-canorhere-pages; both pass as written. - No terminal or
docs/features/change. The commit saysNo door: no behaviour added; fixes the check's failures.
Not done: the gate's two "one implementation?" notes about receiptsOf and visitorRoutes are similarity hints only, so I left them alone.
Try it: bun test test/tui-can.test.ts test/palette-roster.test.ts test/reserved-names.test.ts test/server-timing-sweep.test.ts, or open /visitor/bring on the preview and read its Server-Timing header.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. Two files conflicted, src/core/may.ts and docs/features/may.md, and I kept both sides' changes in each.
src/core/may.ts: the action table now has bothforge.write, which came frommain, andforge.keep_work, which was already on this branch.docs/features/may.md: the action list now namesforge.writeandforge.keep_work.test/may.test.ts:main's test said an anonymous visitor may onlyforge.read. This branch also gives visitorsforge.keep_work, so I changed the expected list to include it. The test was out of date, not wrong.
bun x tsc --noEmit printed nothing. bun test test/may.test.ts test/palette-roster.test.ts passed: 24 tests, 0 failures.
I did not run the wider suite. scripts/fast.ts picked 4,203 of 4,979 files, which is too broad, so the forge's own check on this push is the full run.
I started bun scripts/gate.ts --fix but it hit the 120-second timeout and is still running in the background. I didn't wait for it, so its result is unknown. git status showed no changes from it, so it has not rewrapped any comments.
I merged main into the branch again and pushed it. This time only src/generated/marks.ts conflicted.
It is a generated file, so I took main's version and re-ran bun scripts/own-source.ts to rebuild it. That covers both sides' marks without a hand merge, and no conflict markers remain. bun x tsc --noEmit printed nothing. test/own-source.test.ts and test/may.test.ts passed: 12 tests, 0 failures. I didn't run the wider suite, so the forge's check on this push is the full run.
I merged main into the branch again and pushed it. main had added its own visitor concept alongside the one on this branch, and the three conflicts came from the two overlapping.
docs/ROLES.md: I keptmain's description of the visitor (theforge_makercookie, thevisitor.makeaction, the daily caps). I added a sentence for this branch: what a visitor keeps can be brought into an account on sign-up.test/may.test.ts: an anonymous visitor now gets["forge.read", "forge.keep_work", "visitor.make"], which is both sides' actions.test/cookie-flags.test.ts: I kept bothmain'sforge_makerentry and this branch'sforge_vpentry, whichsrc/auth/visitor_principal.tssets.mainhad dropped the oldsrc/apps/feedback.tsentries because that code no longer sets a cookie, so I dropped them too. Two cookie checks failed until I did.
bun x tsc --noEmit printed nothing. These suites passed, 61 tests and 0 failures: may, cookie-flags, own-source, the visitor* tests and palette-roster. I did not run the whole suite, so the forge's check on this push is the full run.
I merged main into the branch again and pushed it. Only src/generated/marks.ts conflicted, as it did the last time.
It is a generated file, so I took main's version and rebuilt it with bun scripts/own-source.ts. No conflict markers remain. bun x tsc --noEmit printed nothing. test/own-source.test.ts, test/may.test.ts and test/cookie-flags.test.ts passed: 26 tests, 0 failures. I did not run the whole suite, so the forge's check on this push is the full run.
I merged main into the branch and pushed it. The only conflict was src/generated/screens.ts.
That file is generated, so I took main's version and re-ran bun scripts/own-source.ts to rebuild it instead of merging the two sides by hand.
bun x tsc --noEmit is clean. test/own-source.test.ts and test/palette-roster.test.ts pass (18 tests). I did not run the full suite, and I did not run scripts/gate.ts or scripts/design-lint.ts on this merge. The forge will run the full check on the push.
The pull's own change is untouched.
I fixed one of the two failing tests and pushed. The other fails on main too, so I left it alone.
- Fixed: the check's
test/apps-ws.test.tsfailure ("a visitor's socket closes when their account is suspended…") came from this pull. It makesvisitora reserved username, and that test created a user namedvisitor, socreateUserreturnedusername_reserved. I renamed the test user toveraintest/apps-ws.test.ts. The file now passes (11 of 11). I didn't run the rest of the suite. The forge re-runs the full check on this push. - Left alone:
test/data-browser.test.ts("every forge.db column that could hold a secret…") fails becauseconnection_lookup_audit.key_idis a new column not in the audited-clear list. The check log says it is red onmainat 5ce50ab too, so it isn't counted against this pull. I did not touch it. - Gate:
gate --fixprinted two "one implementation?" similarity notes (receiptsOf,visitorRoutes). I made no change for them and the push went through.
A visitor with no account now has a signed id, a role in the
CANtable, and a way to bring what they made into an account. Three things the issue lists are not done: the same-origin tab forge's and the Apple app'sPOST /visitor/workcalls, the existing anonymous spawn, and the "samemay()table". I ranbun x tsc --noEmit,bun scripts/design-lint.ts,bun test test/mcp-size.test.tsand about 400 related tests, all green. I did not run the whole suite; the forge's check does that.Threat note. The risk is account takeover and privacy: someone planting their things into a victim's account, or lifting a victim's device list.
visitor-principal), not the analytics one. Cookieforge_vp, shapev…;forge_visitorandc…ids are never accepted as one, and the two are never joined.POST /visitor/work, never on a read. Do-Not-Track and Global Privacy Control mean no id is given.confirmbound to account, session, device and chosen rows. The confirm comes from the page that account was shown. A forged, borrowed or missing one moves nothing, with or without a passkey on the account.What changed
src/auth/visitor_principal.ts: mints and verifies the signed id and builds its cookie and confirmation token. It reusescookieValueand therefusesTrackingcheck.src/core/visitor_work.ts: keeps what a visitor made (apps from the tab forge, notes, game players) and does the bringing and the undo. Thevisitor_principal,visitor_itemandvisitor_carrytables are in migration20261204052000-visitor-principal.src/core/roles.ts: avisitorrole withreadandkeep_work.docs/ROLES.mdis regenerated.visitor.*rows insettings/limits.ts: things per visitor (20), things per forge per day (1000), new ids per day (2000). Past one, the door answers 429./visitor/bring(list, bring, undo) andPOST /visitor/work, insrc/web/pages/visitor_bring.ts. After sign-in the front page says once that something waits./forges/move-inbrings the visitor'stab_appitems into the account that moves in.uundoes the newest bringing still inside its day.docs/features/visitor-carry.md, and two threat bullets indocs/threats/automated-attacker.md.test/cookie-flags.test.tsgained entries for the new cookie.test/visitor-carry.test.ts, 14 tests. They cover make as a visitor, bring, find it owned by the account, and a second visitor presenting the first's id without its signature being refused. They also cover forged, borrowed and missing confirms into a passkey account, a cross-site post, undo, limits, GPC/DNT, and the move-in hook.What I chose not to do
src/spawn/claim.ts) is untouched; moving it onto this model is a separate slice.POST /visitor/work(#18043, forge-apple #52) are theirs to add. There is no API route or MCP tool, somcp-sizeis unaffected.may()table":contract/can.ts'smay()is the evaluator for apps' contracts. The forge's own table isCAN, so the visitor role went there.canscreen list every ability, so a member now also sees "Keep what you make before you have an account: no".Try it. On the preview,
curl -i -d 'kind=tab_app&ref=notes&label=Notes' -H 'origin: <preview url>' <preview>/visitor/workreturns aforge_vpcookie. Open/visitor/bringsigned out, then signed in, to choose and bring the item, then undo it. On the terminal, open the palette entry "Brought in from a device".🤖 Generated with Claude Code
Closes #18051