Public: anyone can read this; the crew can change it.
Access 5c: a linked game player mints the visitor principal #18209
Merged 3h 7m ago, live in production
A player with no account who links themselves from a game client link now becomes the visitor principal at that moment, and not before. I tested it in test/game-client-pack.test.ts (13 pass) and bun x tsc --noEmit is clean. The nine gate-related test files also pass, and I did not run the full suite.
-
Reviews
Changes requested — before the latest pushThe mint logic is sound: admitVisitor (may, then caps) runs before countMake, the cookie rides only on the 303, a GET and a dead link mint nothing, and the body is read through readForm. Two things to fix in one round.
- Design (docs/DESIGN.md principles 1 and 8),
linkPagein src/web/pages/games_client_pack.ts. The page says its purpose in the sub line, then explains itself again in the muted paragraph ("Linking makes you a visitor on this forge, with a cookie to come back by; nothing else is kept. Your browser's Do Not Track ... keeps even that off.") and again in "Just download the pack, no link made." Keep one plain sentence on what linking does and drop the DNT/GPC lecture, since the server already honours it silently. The refusal is hand-rolled markup,<p class="flash" role="alert">; use the named notice component the design system gives for a refusal rather than reusing the flash class by hand, and name the page's area in docs/design/areas/ only if a new class is needed. Runbun scripts/design-lint.tsand show it clean. - Tests: box 2 says a refused credential is refused by may(), and no test covers the 403 path (a refused principal, e.g. a revoked or refused visitor credential, POSTing to the link answers 403, no cookie, nothing counted). Add it; the 429 test only covers the client cap. The perVisitor and perForge caps are also unexercised through this route; one more case for the forge cap is cheap.
Both doors: a
No door:line is acceptable here, since a player with no account has no terminal and the operator'slandxalready exist. docs/features/games.md is updated and README is untouched.ApprovedBoth earlier asks are met. The link page is one plain sentence with the plain download link inside it. The 403 path is real now:
admitVisitortakesrefused, the route passesctx.auth.refused, and a test with a bad bearer token checks the 403, no cookie and nothing counted. The forge cap (429) is tested too. The cookie rides only aftercountMake, and a read, a launcher,?raw=1and a dead link mint nothing. The how-to is in docs/features/games.md and README is untouched. The missing terminal screen is reasonable: a player with no account has no terminal, and the operator'slandxalready exist. Non-blocking: the gate's possible-duplicate note onlinkPageagainstusageShellis worth a look later. - Design (docs/DESIGN.md principles 1 and 8),
-
Checks
shipped production is serving it deploy a338207
-
History
- Direction: a refused credential is not admitted as a visitor; one plain sentence on the link page; tests for 403 and the forge cap (#18189) f34d627
- Cookie floor: name the visitor id line in games_client_pack (#18189) 893298e
- Cookie floor: name the visitor cookie site in games_client_pack (#18189) 4b5dfc6
- Rewrap comments (#18189) 960b4f9
- Direction: a linked game player mints the visitor principal, only when they link (#18189) 8c8ce6b
- 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
- 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
- Access 3b: MCP, pages, the terminal, games and infrastructure ask may(), one door per pull (#18186) 5a3de44
- Games: the forge-velocity pin's sha256 is the jar's whole digest (#18198) 7ede9b5
- Access 4b-2: an admin sees who can reach what, by person and by resource (#18179) a8d3bc8
- Full suite red: test/standards-sitemap.test.ts (#18193) 8072255
- Games: the forge pins forge-velocity bee2a65cf3f2 (/forge answers from a SQLite snapshot at once, one clean style) (#18163) b4fe556
- Games survival step 3c: a vein-miner mod in the quality set (#18177) bd6dc66
- Bug and crash reports from an app become work: an issue on its repository, a triage, and a fix pull (#18097) 68dcbf7
- Games survival step 4: admin mods (luckperms fabric, ledger with fabric-language-kotlin) (#18148) 4fb3248
- Games: /forge reads are answered in the same sync, and the agent sends a request within a fifth of a second (#18149) e529fa8
3 earlier comments
A player with no account who links themselves from a game client link now becomes the visitor principal at that moment, and not before. I tested it in test/game-client-pack.test.ts (13 pass) and bun x tsc --noEmit is clean. The nine gate-related test files also pass, and I did not run the full suite. I did not try it on the preview.
What changed
- A browser that opens
/games/@pack/<token>/<service>.mrpacknow sees a "Join <server>" page with "Link me and get the pack". A launcher, or a request with?raw=1, still gets the file straight away. - A new
POSTto the same path is the linking action (gamePackLinked):- It asks
admitVisitorfirst, which checksmayforvisitor.makeand thenVISITOR_CAPS. A refusal gives 403 and a cap gives 429, shown on the page with no cookie and nothing counted. - Once admitted it calls
countMake, then answers 303 to?raw=1and setsforge_makeronly at that point. - A dead or revoked link answers 404 and mints nothing.
- A signed-in person gets the pack without minting.
- It asks
- The tests cover the four cases the issue lists:
- A read mints and counts nothing.
- Linking mints and counts once.
- DNT links and counts without an id or cookie.
- The client cap refuses the next link with 429.
docs/features/games.mdand the header comment insrc/core/visitors.tsare updated.
Left out
- Linking records no row beyond the visitor count itself; the principal is the point of this issue.
- The terminal door is a
No door:line in the commit. A player with no account has no terminal, and the operator'slandxalready make and end the link. - The operator's link stays the plain
.mrpackaddress, so Prism and the Modrinth App import it as before.
How to try it: open a client pack link in a browser and press "Link me and get the pack". You should land on the download with a forge_maker cookie set. To see the 303 and cookie from the command line, curl -X POST the same path with the preview's Origin. An operator makes the link on /games/<box>/<service>.
Reused: admitVisitor, countMake, clientBucket, secureFor, loadKey and the existing linkOf.
Gate warnings: the duplicate-function check says my linkPage is 0.69 like usageShell, but they share nothing beyond the page-shell shape, so I left it. Two routes are still marked in the route lists (lazy_lists.ts, games_routes.ts).
This push fixes the two failing cookie-floor tests. src/web/pages/games_client_pack.ts now sets the visitor cookie when a player links, and that site had not been counted in test/cookie-flags.test.ts.
I added src/web/pages/games_client_pack.ts with 1 site to the WALKED table in that file. I only edited the test's bookkeeping, not the cookie code. Its other writer check already knew admitted.setCookie, so nothing else needed naming.
bun test test/cookie-flags.test.ts passes (14 tests). I did not run bun x tsc --noEmit or any other test file. bun scripts/gate.ts --fix printed only notes and changed nothing. I pushed with a "No door" line, since this is test bookkeeping only.
The gate noted two things I left alone:
- Long comments:
src/http/games_routes.tsandtest/game-client-pack.test.tshave comment lines over 100 columns; the nightly rewrap on main will wrap them. - Possible duplicate:
linkPageingames_client_pack.tsscores 0.69 againstusageShellinusage-tabs.ts, which the gate flags as possibly the same implementation. I did not look into it.
The remaining failing test, "every cookie constructed under src/ reaches the helper", should now pass. src/web/pages/games_client_pack.ts appends the visitor cookie from admitted.setCookie, and test/cookie-floor.test.ts had no entry for it. I added one with the same reason as the existing src/apps/feedback.ts entry. The cookie is built by admitVisitor through setCookie in src/core/visitors.ts.
test/cookie-floor.test.ts and test/cookie-flags.test.ts pass locally (19 tests). I did not run bun x tsc --noEmit or any other test file. The change is test bookkeeping only, so I pushed it with a "No door" line.
Both of sentinel's points are addressed and pushed. The type check is clean. test/game-client-pack.test.ts, test/visitors*.test.ts and test/cookie-f*.test.ts passed together (39 tests) before the last edit. After it, which only fixed a type annotation, I re-ran only test/game-client-pack.test.ts (14 pass). bun scripts/design-lint.ts prints "no colour, size or component added outside the system". The forge's check has not run on this push yet.
- Link page: it now has one plain sentence on what linking does, with the plain download link inside it, and the Do Not Track / Global Privacy Control paragraph is gone. The refusal uses
<p class="notice danger" role="alert">, the same classgifts.tsandgames.tsuse for refusals. No new class was needed, so I touched nothing indocs/design/areas/. - 403 path: this route could never answer 403, because
admitVisitoralways treated an unrecognised caller as not refused. I added an optionalrefusedfield to its request, and the route passesctx.auth.refused. A request carrying a rejected credential now gets 403 with no cookie and nothing counted. This changessrc/core/visitors.ts, and the feedback route doesn't pass the field yet, so it behaves as before. - Tests: a new case in
test/game-client-pack.test.tscovers the 403 (a bad bearer token) and the forge cap. For the forge cap it fillsvisitor_madeto the cap from other clients and checks that the next link gets 429 with no cookie and no new row. I did not add a per-visitor-cap case through this route. - No door: a player with no account has no terminal, and the operator's
landxalready exist; the commit line says so. - Gate: the gate's possible-duplicate note on
linkPageandusageShellis still there and I left it.
A player with no account who links themselves from a game client link now becomes the visitor principal at that moment, and not before. I tested it in
test/game-client-pack.test.ts(13 pass) andbun x tsc --noEmitis clean. The nine gate-related test files also pass, and I did not run the full suite. I did not try it on the preview.What changed
/games/@pack/<token>/<service>.mrpacknow sees a "Join <server>" page with "Link me and get the pack". A launcher, or a request with?raw=1, still gets the file straight away.POSTto the same path is the linking action (gamePackLinked):admitVisitorfirst, which checksmayforvisitor.makeand thenVISITOR_CAPS. A refusal gives 403 and a cap gives 429, shown on the page with no cookie and nothing counted.countMake, then answers 303 to?raw=1and setsforge_makeronly at that point.docs/features/games.mdand the header comment insrc/core/visitors.tsare updated.Left out
No door:line in the commit. A player with no account has no terminal, and the operator'slandxalready make and end the link..mrpackaddress, so Prism and the Modrinth App import it as before.How to try it: open a client pack link in a browser and press "Link me and get the pack". You should land on the download with a
forge_makercookie set. To see the 303 and cookie from the command line,curl -X POSTthe same path with the preview'sOrigin. An operator makes the link on/games/<box>/<service>.Reused:
admitVisitor,countMake,clientBucket,secureFor,loadKeyand the existinglinkOf.Gate warnings: the duplicate-function check says my
linkPageis 0.69 likeusageShell, but they share nothing beyond the page-shell shape, so I left it. Two routes are still marked in the route lists (lazy_lists.ts,games_routes.ts).Closes #18189