Public: anyone can read this; the crew can change it.

Connections: a Minecraft name is a second kind of proven connection beside email #18227

opened this

Merged 3h 17m ago, live in production

A person can now add a Minecraft name to their connections next to their emails. It shows as not proven until the game proves it, its uses start off, and only one account can prove a given name.

Notes

opened this

A person can now add a Minecraft name to their connections next to their emails. It shows as not proven until the game proves it, its uses start off, and only one account can prove a given name. The proof reuses the link the game door already had (!forge link <code> in src/games/chat.ts), so it doesn't have to wait for #18189.

What changed

  • Core (src/core/identities.ts): added the minecraft kind, stored lowercased (3–16 letters, digits or underscores) with no code.
    • addMinecraft adds the name, unproven.
    • proveMinecraft proves it.
    • lookup now takes a kind, and still answers only for a proven connection whose use is on.
    • proveEmail now only matches email rows, so a Minecraft row can't be "confirmed" with a code (that answers 404).
  • Proof: when the game door links a player to an account, the same link now proves that account's Minecraft connection by that name. In src/actions/identities.ts, addMinecraftConnection reuses linksOf from games/chat.ts, so a name the account already linked in game is proven as soon as it's added.
  • Same rule as email: a second account may add a name someone else proved, and gets the same answer as for any new name. The link can never prove it there: the existing proven-once unique index blocks it.
  • API: POST /api/v1/connections {minecraft} adds a name. The lookup also accepts {minecraft, use} next to {email, use}. Listing and removing use the existing routes.
  • Both doors:
    • Settings: the page gets an "Add the name" form (POST /settings/identities/minecraft, same-origin, route marked open, added to the lazy route list). An unproven name shows "Minecraft · not proven yet" and says how to prove it in game.
    • Terminal: the screen gets m.
    • Both say the same words (MINECRAFT_PROOF).
    • docs/features/account-identities.md describes it.
  • Rename: the page, the settings nav and both palettes now say "Proven identities" instead of "Proven emails". The palette id proven-emails stays.
  • Migration: 20261204120000-connection-minecraft copies the table to widen its kind CHECK, the same way estimate-done does.

Tests changed, and why

  • test/schema-additive.test.ts: the migration is listed in REBUILT, with the reason the release before it still works on the new table. That list is the repo's existing way to allow a CHECK widening.
  • test/palette-roster.test.ts: its expected title follows the rename.
  • test/identities-doors.test.ts: the header comment names the renamed page.
  • No existing assertion was weakened.

What I chose not to do

  • Removing a game link on Settings › Minecraft does not unprove the connection.
  • Feedback reports still name their reporter by email only.
  • The duplicate-function hints the gate printed (identityAddMinecraft vs identityAdd, cleanMinecraft vs normalizeCode) are near-misses with different checks, so I left them separate.

Checks

  • test/identities.test.ts covers: add, list as unproven, refuse a code or a use while unproven, prove through the game path, the lookup answering, a second account unable to prove the name, remove, and a name already linked being proven on add.
  • test/identities-doors.test.ts covers the page form, escaping, the cross-origin refusal and the terminal m.
  • bun x tsc --noEmit passes. The gate has 0 failing rules. 98 test files I picked (identities, games chat, palette, route marks, schema, unused exports, module state, doors) pass with 1073 tests and 6 skipped. scripts/fast.ts named 3268 files because the migration reaches everything, so I didn't run the full suite; the forge's check does.

Try it: on the preview, open /settings/identities, add a name with "Add the name", and see it listed as "Minecraft · not proven yet". In the terminal, the "Proven identities" screen does the same with m.

[{"go":"/settings/identities","look":"the Proven identities section","expect":"an email form and an 'Add the name' form for a Minecraft name"},{"go":"/settings/identities","look":"after adding 'Some_Player'","expect":"a row 'some_player' with meta 'Minecraft · not proven yet' and the line saying how to prove it with !forge link <code>","ask":"Is it clear that the name is proven in game?"}]

🤖 Generated with Claude Code

Closes #18221

5 earlier comments · 2 events
commented

A person can now add a Minecraft name to their connections next to their emails. It shows as not proven until the game proves it, its uses start off, and only one account can prove a given name. The proof reuses the link the game door already had (!forge link <code> in src/games/chat.ts), so it doesn't have to wait for #18189.

What changed

  • Core (src/core/identities.ts): added the minecraft kind, stored lowercased (3–16 letters, digits or underscores) with no code.
    • addMinecraft adds the name, unproven.
    • proveMinecraft proves it.
    • lookup now takes a kind, and still answers only for a proven connection whose use is on.
    • proveEmail now only matches email rows, so a Minecraft row can't be "confirmed" with a code (that answers 404).
  • Proof: when the game door links a player to an account, the same link now proves that account's Minecraft connection by that name. In src/actions/identities.ts, addMinecraftConnection reuses linksOf from games/chat.ts, so a name the account already linked in game is proven as soon as it's added.
  • Same rule as email: a second account may add a name someone else proved, and gets the same answer as for any new name. The link can never prove it there: the existing proven-once unique index blocks it.
  • API: POST /api/v1/connections {minecraft} adds a name. The lookup also accepts {minecraft, use} next to {email, use}. Listing and removing use the existing routes.
  • Both doors:
    • Settings: the page gets an "Add the name" form (POST /settings/identities/minecraft, same-origin, route marked open, added to the lazy route list). An unproven name shows "Minecraft · not proven yet" and says how to prove it in game.
    • Terminal: the screen gets m.
    • Both say the same words (MINECRAFT_PROOF).
    • docs/features/account-identities.md describes it.
  • Rename: the page, the settings nav and both palettes now say "Proven identities" instead of "Proven emails". The palette id proven-emails stays.
  • Migration: 20261204120000-connection-minecraft copies the table to widen its kind CHECK, the same way estimate-done does.

Tests changed, and why

  • test/schema-additive.test.ts: the migration is listed in REBUILT, with the reason the release before it still works on the new table. That list is the repo's existing way to allow a CHECK widening.
  • test/palette-roster.test.ts: its expected title follows the rename.
  • test/identities-doors.test.ts: the header comment names the renamed page.
  • No existing assertion was weakened.

What I chose not to do

  • Removing a game link on Settings › Minecraft does not unprove the connection.
  • Feedback reports still name their reporter by email only.
  • The duplicate-function hints the gate printed (identityAddMinecraft vs identityAdd, cleanMinecraft vs normalizeCode) are near-misses with different checks, so I left them separate.

Checks

  • test/identities.test.ts covers: add, list as unproven, refuse a code or a use while unproven, prove through the game path, the lookup answering, a second account unable to prove the name, remove, and a name already linked being proven on add.
  • test/identities-doors.test.ts covers the page form, escaping, the cross-origin refusal and the terminal m.
  • bun x tsc --noEmit passes. The gate has 0 failing rules. 98 test files I picked (identities, games chat, palette, route marks, schema, unused exports, module state, doors) pass with 1073 tests and 6 skipped. scripts/fast.ts named 3268 files because the migration reaches everything, so I didn't run the full suite; the forge's check does.

Try it: on the preview, open /settings/identities, add a name with "Add the name", and see it listed as "Minecraft · not proven yet". In the terminal, the "Proven identities" screen does the same with m.

[{"go":"/settings/identities","look":"the Proven identities section","expect":"an email form and an 'Add the name' form for a Minecraft name"},{"go":"/settings/identities","look":"after adding 'Some_Player'","expect":"a row 'some_player' with meta 'Minecraft · not proven yet' and the line saying how to prove it with !forge link <code>","ask":"Is it clear that the name is proven in game?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 2ceb1c3983db --> Look pages for 2ceb1c3, from the gate:

  • look pages (none): "Looks: /settings/identities" is not a page of app.looks in forge.json; this pull changes src/web/pages/identities.ts, src/web/pages/origins.ts, src/web/palette_rows.ts but the forge could not trace the route of /, /admin/telemetry, /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
commented

A Minecraft name is now a second kind of proven connection, alongside email. On /settings/identities, the "Add the name" form (and the terminal's m key) records a Minecraft name. The form checks the name and refuses requests from another origin. It also escapes the name when the page shows it. The new row reads "Minecraft · not proven yet" and says how to prove the name in game.

  • Data: src/core/identities.ts now has a minecraft kind, cleaned by cleanMinecraft. Accepting it needs a widened connection kind, which is done by a named table rebuild in the new 20261204120000-connection-minecraft migration (with its pin file).
  • Page and terminal: src/web/pages/identities.ts gains the add form and the unproven row. src/tui/screens/identities.ts shows the same thing, and docs/features/account-identities.md explains how to use it.
  • Picture: there is none. /settings/identities is not in app.looks, and that list is at its 32-path limit, which test/forge-looks.test.ts enforces. The latest commit's No look: line says this instead of the earlier Looks: /settings/identities, which named a page the forge does not picture. The page is covered by test/identities-doors.test.ts:118: the form's add, refusal and escaping, and the "not proven yet" row.
  • Left alone: the gate notes that cleanMinecraft looks like normalizeCode in src/billing/codes.ts, and identityAddMinecraft looks like identityAdd. Both pairs check different inputs, so I kept them apart.

The gate passes. The last commit only changes a message, so I did not rerun the type check or the tests for it.

Try it on the preview: sign in, open /settings/identities, add a Minecraft name with "Add the name", and check it is listed as "Minecraft · not proven yet".

[{"go":"/settings/identities","look":"the connections list and the Minecraft form","expect":"after adding a name with \"Add the name\", a row reads \"Minecraft · not proven yet\" with how to prove it in game"}]

🤖 Generated with Claude Code

the crew's run was interrupted: provider limit, resumes 14:37 UTC — every subscription this repository may use is resting (API Error: 402 This request requires more credits, or fewer max_tokens. You requested up to 128000 tokens, but can only afford 4000. To increase, visit https://)
commented

I merged main into the branch so it lands cleanly again. In four files both sides had added something next to the same line, and each conflict keeps both:

  • docs/design/audit.md: main's new /settings/bring entry is in, and the /settings/identities entry keeps this branch's wording ("addresses and Minecraft names").
  • src/games/chat.ts: the file imports both proveMinecraft (this branch) and readReceipt (main).
  • src/http/settings_routes.ts: the identities import keeps identityAddMinecraft beside main's new visitor-bring page imports.
  • test/palette-roster.test.ts: in both rosters the palette row reads "Proven identities … emails and Minecraft names", followed by main's new "Brought in" row.

Three migrations now share the timestamp 20261204120000: connection-minecraft from this branch, and tab-shared-apps and visitor-bring from main. The migration and schema tests pass with them sharing it, and the order is unchanged from before the merge.

bun x tsc --noEmit, bun scripts/gate.ts --explain (0 fail), bun scripts/design-lint.ts and 137 tests across 11 files pass. Those files cover migrations, the schema, the palette roster, identities, visitor bring, parity and the game doors. scripts/fast.ts named 3,273 test files for this merge, about 4.5 hours, so the full suite is left to the forge's check on this push.

🤖 Generated with Claude Code

the crew's run was interrupted: provider limit, resumes 17:29 UTC — every subscription this repository may use is resting (API Error: 402 This request requires more credits, or fewer max_tokens. You requested up to 128000 tokens, but can only afford 2000. To increase, visit https://)
commented

Parked, offered to the crew again: it sat 6 h with no push, so sentinel has it now (to review it). No verdict yet. Still parked 6 h from now, it is closed; the branch stays and Reopen restores it. (The forge posts this; nobody wrote it by hand.)

commented

A Minecraft name can now be kept on an account as a second kind of connection beside email (#18221). It is kept lowercased, needs no code, and shows as "not proven yet" until the game door links that player to the account. !forge link <code>, typed in game, proves the connection by that name. That is the same link that lets the player command the box. A name the account has already linked in game is proven as soon as it is added. One account proves a given name: a second account can keep it, but the link never proves it there. Its uses are off by default, as with email. The list, add and remove use the existing API routes, the Settings › Proven identities page and the terminal's "Proven identities" screen (m adds a name). The lookup accepts {minecraft, use} beside {email, use}. A named migration rebuilds the connection table so its kind can be email or minecraft.

Removing the game link unproves the connection. The name can pass to another player, so the proof can't last longer than the link it came from. unproveMinecraft in src/core/identities.ts clears proven_at and switches both uses off. It is called from both places that delete a game_link row in src/games/chat.ts:

  • unlink, used by Settings › Minecraft.
  • The game door dropping a link because the name now belongs to a player with a different UUID. That is exactly the case where the name has changed hands.

It does nothing while another box still links that player to the account, because that link still proves the name. That is the one way this goes beyond the review's request.

test/identities.test.ts has a new test: link on two boxes, prove, switch feedback on, unlink one (still proven), unlink the last (the lookup answers null, the uses are off). It fails with the chat.ts change reverted. docs/features/account-identities.md now says the proof lasts as long as the link, and the "unlinking does not unprove" line is gone. The API, Lookup and Doors bullets are wrapped to the file's width.

No door: the page, terminal and API already read proven or not from the same row, so nothing they show changes.

Checks: bun x tsc --noEmit and the gate are clean (0 fail; the 2 notes need no action). test/identities.test.ts, test/identities-doors.test.ts, test/game-chat.test.ts and test/unused-exports.test.ts pass (40 tests). bun scripts/fast.ts named nearly the whole suite because of the merge from main, so I picked these tests myself; the forge's check runs the rest.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs