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

Game pages: the address a friend is given works from outside, and the last game words say what they mean #17672

opened this

Merged 10h 28m ago, live in production

The address a friend is given now comes from the box's machine records, with :port when needed. A private name is not offered for Copy, and the five leftover words are replaced. These tests passed locally: all game-, games, tui-games, unused-exports, cloud-says-doors and game-join.

Notes

opened this

The address a friend is given now comes from the box's machine records, with :port when needed. A private name is not offered for Copy, and the five leftover words are replaced. These tests passed locally: all game-*, games, tui-games, unused-exports, cloud-says-doors and game-join. tsc and bun scripts/design-lint.ts are clean and bun scripts/gate.ts --explain reports 0 fail. The forge's full check hasn't run yet.

What changed

  • Address: joinAddress(machine, port) in src/games/gist.ts takes the machine's host and address. It offers the first one that is public. It adds :port unless the port is 25565.
  • Port: the new proxyPort in src/games/sleep.ts reads the port the proxy publishes for 25565 from the compose file. I lifted it from ask.ts, which now calls it.
  • Public or private: a host counts as private when it is a private IP (reusing isPublicAddress from apps/egress.ts), has no dot, or ends in .ts.net, .lan, .local or .internal (a few more are in gist.ts). In that case the page and the terminal say a friend outside cannot join and to give the machine a public name on the Infra page. There is no Copy button for it.
  • No machine: a box with no machine says there is no address yet, on both doors.
  • Words (shared constants SAVE_WORDS and PREVIEW_WORDS):
    • "Plan it" is now "Preview it".
    • "Commit" is now "Save change".
    • "Keep it warm" is now "Keep it running".
    • "sync" is now "check-in".
    • The proxy's "try list" is now "list of servers new players land on first".

    The web page, the terminal, the MCP games tool and the box-change preview lines say the same, and docs/features/games.md has a "Words on the pages" section. Flash messages that said "Committed …" now say "Saved …".

  • Tests: test/game-join.test.ts builds real machine and box records (a public host on 25565, one on 25570, a tailnet name, and no machine) and checks the web page and the terminal. game-gist.test.ts covers the address cases, proxyPort, and that each word matches in the page source, the terminal source and the docs. I changed existing assertions in the game tests, TUI test and sleep test to the new words.

Left out

  • Agent-facing text, the sleep commit message and the policy name "warm" keep their old wording.
  • The TUI reads the port from the first visible box only, as it already did for the address.
  • When a box has no services reported yet, the terminal still shows its "nothing has reported" line instead of the join line.
  • I did not check the address on a real box; the lab has none.

Try it: open /games/<box> at 390 px.

  1. On a box with a machine, the address shows with Copy, and :port when the proxy isn't on 25565.
  2. On a box whose machine has only a tailnet name, a sentence replaces the address and there is no Copy.
  3. On a box with no machine, the page says there is no address yet.
  4. In the terminal Games screen, the head line says the same.
[
 {"go":"/games/plain","look":"How to join at 390 px, box with a public machine","expect":"the host in mono with a Copy button, no overflow"},
 {"go":"/games/ported","look":"How to join","expect":"the host followed by :25570"},
 {"go":"/games/tail","look":"How to join","expect":"a sentence saying a friend outside cannot use the private name and what to set; no Copy button"},
 {"go":"/games/bare","look":"How to join at 390 px, box with no machine","expect":"'There is no address to give yet' and no Copy"},
 {"go":"/games/plain/survival","look":"Environment form, Sleep block","expect":"'Save change' with its check-in line; 'Keep it running' or 'Let it sleep when empty'"}
]

🤖 Generated with Claude Code

Closes #17670

7 earlier comments · 2 events
commented

The address a friend is given now comes from the box's machine records, with :port when needed. A private name is not offered for Copy, and the five leftover words are replaced. These tests passed locally: all game-*, games, tui-games, unused-exports, cloud-says-doors and game-join. tsc and bun scripts/design-lint.ts are clean and bun scripts/gate.ts --explain reports 0 fail. The forge's full check hasn't run yet.

What changed

  • Address: joinAddress(machine, port) in src/games/gist.ts takes the machine's host and address. It offers the first one that is public. It adds :port unless the port is 25565.
  • Port: the new proxyPort in src/games/sleep.ts reads the port the proxy publishes for 25565 from the compose file. I lifted it from ask.ts, which now calls it.
  • Public or private: a host counts as private when it is a private IP (reusing isPublicAddress from apps/egress.ts), has no dot, or ends in .ts.net, .lan, .local or .internal (a few more are in gist.ts). In that case the page and the terminal say a friend outside cannot join and to give the machine a public name on the Infra page. There is no Copy button for it.
  • No machine: a box with no machine says there is no address yet, on both doors.
  • Words (shared constants SAVE_WORDS and PREVIEW_WORDS):
    • "Plan it" is now "Preview it".
    • "Commit" is now "Save change".
    • "Keep it warm" is now "Keep it running".
    • "sync" is now "check-in".
    • The proxy's "try list" is now "list of servers new players land on first".

    The web page, the terminal, the MCP games tool and the box-change preview lines say the same, and docs/features/games.md has a "Words on the pages" section. Flash messages that said "Committed …" now say "Saved …".

  • Tests: test/game-join.test.ts builds real machine and box records (a public host on 25565, one on 25570, a tailnet name, and no machine) and checks the web page and the terminal. game-gist.test.ts covers the address cases, proxyPort, and that each word matches in the page source, the terminal source and the docs. I changed existing assertions in the game tests, TUI test and sleep test to the new words.

Left out

  • Agent-facing text, the sleep commit message and the policy name "warm" keep their old wording.
  • The TUI reads the port from the first visible box only, as it already did for the address.
  • When a box has no services reported yet, the terminal still shows its "nothing has reported" line instead of the join line.
  • I did not check the address on a real box; the lab has none.

Try it: open /games/<box> at 390 px.

  1. On a box with a machine, the address shows with Copy, and :port when the proxy isn't on 25565.
  2. On a box whose machine has only a tailnet name, a sentence replaces the address and there is no Copy.
  3. On a box with no machine, the page says there is no address yet.
  4. In the terminal Games screen, the head line says the same.
[
 {"go":"/games/plain","look":"How to join at 390 px, box with a public machine","expect":"the host in mono with a Copy button, no overflow"},
 {"go":"/games/ported","look":"How to join","expect":"the host followed by :25570"},
 {"go":"/games/tail","look":"How to join","expect":"a sentence saying a friend outside cannot use the private name and what to set; no Copy button"},
 {"go":"/games/bare","look":"How to join at 390 px, box with no machine","expect":"'There is no address to give yet' and no Copy"},
 {"go":"/games/plain/survival","look":"Environment form, Sleep block","expect":"'Save change' with its check-in line; 'Keep it running' or 'Let it sleep when empty'"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 9fa45b3c8253 --> Look pages for 9fa45b3, from the gate:

  • look pages (none): this pull changes src/web/pages/games.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
the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

The address a friend is given now works from outside, and the last game words say what they mean. I found nothing to change for the four check items, so this turn pushed no new commits.

The branch was already pushed; git push reported everything up to date.

  • Both doors: the gate's both doors rule passes. The terminal screens (src/tui/screens/games.ts, game_mods.ts) share the same words and join address as the page.
  • Tests build real input: there is no as never in test/game-join.test.ts or test/game-gist.test.ts.
  • Issue named: all three commits carry (#17670), and the gate's name the issue rule passes.
  • Dead exports: test/unused-exports.test.ts passes. It lists four dead exports (pinCrawlLag, setCrawlClock, useWatchProbeByDefault, useReachByDefault), none of which this pull touches.

bun x tsc --noEmit is clean. The five game test files (53 tests, including test/game-join.test.ts) pass. bun scripts/gate.ts --fix had nothing to rewrap in this change. I did not run the full suite; the forge runs it on the push.

Two gate notes remain as notes, not failures:

  • Duplicate function: terminal in test/game-join.test.ts scores 0.70 against shown in test/planner-declined.test.ts. I left it, since the two helpers do different jobs and sharing one would couple unrelated tests.
  • Looks: the gate could not trace a page for src/web/pages/games.ts, so it left the choice to the reviewer. The nearest page is /games/<box>.

In the sandbox, api.modrinth.com was denied during the game tests. They still passed.

What changed:

  • The address a friend is given carries the proxy's port when it is not 25565.
  • A box with no machine says there is no address yet.
  • A private name is never offered as an address.
  • The save, preview and no-address words are shared between the page, the terminal and the MCP games tool.

Left out: no new egress host and no schema change.

To try: open /games/<box> at 390 px, on a box with a machine and on one with none.

[{"go":"/games/<box> with a machine","look":"the join address","expect":"host, with :port only when the proxy is not on 25565"},{"go":"/games/<box> with no machine","look":"the address line","expect":"says there is no address yet and why"}]

🤖 Generated with Claude Code

commented

Both of sentinel's blocking points are fixed, and so is the non-blocking port issue. tsc is clean and the join, gist and terminal-games tests pass; I did not run the full suite.

  • Box 3, the leftover word: the terminal now says "Saving…" where it said "Committing…" (src/tui/screens/games.ts:506). I also changed the same word in the z (sleep or keep running) note, which you didn't flag.
  • Box 4, the test: I removed the source-grep test in test/game-gist.test.ts; the docs-words check stays. The new test in test/game-join.test.ts renders the service page and the terminal screen as the box's owner. It asserts that both show SAVE_WORDS and that the page has the Save change button. The terminal's env prompt cut those words off at its narrow width ("Saved…"), so they now sit on the env tab itself. A source check also asserts the word "Committing" is gone from the terminal screen.
  • Box 4, Keep it running: I did not render-test it against the terminal. That label only shows when a service is on the sleep policy, and the test boxes don't have one. The SAVE_WORDS comparison covers the "same words on both sides" point.
  • Port per box: the terminal now reads each box's proxy port from its own compose file, so a second box on another port gets the right address. The join line still shows the first box's address, as the page does.

Two gate notes remain notes: the duplicate-function score for the terminal test helper, and the look page the gate could not infer.

🤖 Generated with Claude Code

commented

<!-- look-pages a9fddc8bf78a --> Look pages for a9fddc8, from the gate:

  • look pages (none): this pull changes src/web/pages/games.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
commented

I changed no code this round. I added one commit that carries the No look: line, and the other three refusals needed nothing. tsc is clean, and the join, gist and terminal-games tests pass (27 tests). bun scripts/gate.ts --fix rewrapped nothing, so there is nothing more to commit. I didn't run the whole suite or the forge's own check.

  • Look pages: the look pages (none) note named src/web/pages/games.ts. /games/<box> is not one of the app.looks pages, and it only renders on a box that has a machine. So the commit says No look: with that reason, and the earlier Try: commit holds the 390 px steps for both box states.
  • Both doors: the terminal already shows what the page shows, from the earlier Direction commit. The gate's both doors rule reads ok.
  • as never: none in this pull's test diff.
  • Name the issue: every commit line carries (#17670), and the gate's name the issue rule reads ok.
  • Dead exports: test/unused-exports.test.ts passes. The stale entries it prints are in src/http/crawl.ts and src/spawn/, which this pull doesn't touch.

Disagree: the gate also noted that terminal in test/game-join.test.ts looks 0.70 like shown in test/planner-declined.test.ts. I left both alone. They are test helpers for different screens, and the gate marks the note as informational.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

The address a friend is given on /games/<box> now works from outside the home network. joinAddress takes the machine's public host or address. It adds :port when the proxy's compose file publishes 25565 on a different port. It never offers a private name (a Tailscale name, a LAN address or localhost) for Copy. Instead the page says why that name won't work and what to set. A box with no machine says it has no address yet. The terminal shows the same words.

The last game words now say what they mean:

  • Environment form: says "Save change" and "Saved …" on the page and in the terminal, where it used to say "Commit".
  • Settings form: on /games/<box>/<service> the button now says Save and restart where it said "Commit and restart" (src/web/pages/games.ts:1124).
  • No diagnosis yet: that line now says the agent sends one "with every check-in", on the page and in the terminal.
  • Docs: docs/features/game-settings.md names Save and restart and says the box applies a change on its "next check-in".

What to look at:

  • Tests: test/game-join.test.ts renders four kinds of box on the page and in the terminal: a public name on 25565, a public name on another port, a private name, and no machine. A new test in test/game-gist.test.ts fails if "Commit and restart" or "next sync" comes back in the settings page or its doc. It also fails if the page or terminal stops saying "every check-in".
  • Checks run: the gate passes, the type check is clean, the design lint passes, and all 432 game and repository-rule tests pass.
  • Not run: I did not run the full suite here, because the list of affected tests comes to about 30 minutes and the forge runs the full check on this push. During the game tests the sandbox refused some calls to api.modrinth.com; all of those tests still passed.

What I left out: I did not change "sync" in operator-facing comments and docs (for example agent.sh and game-box.md). A player reads only the page, the terminal and game-settings.md.

[
  {"go": "/games/<box>", "look": "the address row at 390 px", "expect": "a public name, with :port when the proxy is not on 25565, beside Copy; a box with no machine says there is no address yet"},
  {"go": "/games/<box>/<service>#settings", "look": "the settings form after Preview", "expect": "the primary button says Save and restart, beside Cancel"},
  {"go": "/games/<box>", "look": "the diagnosis block on a box that has sent none", "expect": "its agent sends one with every check-in"}
]

🤖 Generated with Claude Code

commented

The address a friend is given on /games/<box> now works from outside the home network. joinAddress takes the machine's public host or address. It adds :port when the proxy's compose file publishes 25565 on a different port. It never offers a private name (a Tailscale name, a LAN address or localhost) for Copy. Instead the page says why that name won't work and what to set. A box with no machine says it has no address yet. The terminal shows the same words.

The last game words now say what they mean:

  • Environment form: says "Save change" and "Saved …" on the page and in the terminal, where it used to say "Commit".
  • Settings form: on /games/<box>/<service> the button now says Save and restart where it said "Commit and restart".
  • No diagnosis yet: that line now says the agent sends one "with every check-in", on the page and in the terminal.
  • Docs: docs/features/game-settings.md names Save and restart and says the box applies a change on its "next check-in".

What to look at:

  • Tests: test/game-join.test.ts renders four kinds of box on the page and in the terminal: a public name on 25565, a public name on another port, a private name, and no machine. A test in test/game-gist.test.ts fails if "Commit and restart" or "next sync" comes back in the settings page or its doc. It also fails if the page or terminal stops saying "every check-in".
  • Merge with main: src/tui/screens/games.ts conflicted only in its imports. The merge keeps main's switch from onSync to watchBox and adds this branch's address and save words.
  • Test changed after the merge: main brought a new line in test/game-door.test.ts that expected "The box brings it up on its next sync." The game chat now says "check-in", so the test was out of date and now expects "on its next check-in."
  • Checks run: after the merge the gate passes, the type check is clean, and the game and repository-rule tests pass (404 of 405 before the game-door fix, then that file's 11 of 11). The design lint passed before the merge and was not run again.
  • Not run: I did not run the full suite here, because the list of affected tests comes to about 30 minutes and the forge runs the full check on this push. During the game tests the sandbox refused some calls to api.modrinth.com; no test failed because of it.

What I left out: I did not change "sync" in operator-facing comments and docs (for example agent.sh and game-box.md). A player reads only the page, the terminal and game-settings.md.

[
  {"go": "/games/<box>", "look": "the address row at 390 px", "expect": "a public name, with :port when the proxy is not on 25565, beside Copy; a box with no machine says there is no address yet"},
  {"go": "/games/<box>/<service>#settings", "look": "the settings form after Preview", "expect": "the primary button says Save and restart, beside Cancel"},
  {"go": "/games/<box>", "look": "the diagnosis block on a box that has sent none", "expect": "its agent sends one with every check-in"}
]

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs