Repository navigation
Conversation
…l for two browsers
A first-person arena in 3D with the two forms, Psycho and Syber, changed with
Q. Two modes: Waves for one player, and the Duel for two players in two
browsers. It was built outside this repository; this ports it to the site's
rules. The owner chose the name, the place and the two modes on November 19.
The page
- psycho-syber/arena/: index.html, arena.css, game.js (one classic script),
link.js (the duel's invite and reply codes) and vendor/three.min.js, which
is three@0.160.0 as npm publishes it, with its licence. Nothing is loaded
from another origin.
- The stage sits under the site's header. While a game is on it covers the
whole screen; Pause and both end panels have "Leave the game", which brings
the page and its header back.
- Type is the site's own and nothing is set below 12px. The copy under the
stage follows Wording, names the four products and Lacuna Institute, and
keeps its limits and "not yet" lines.
- An earlier story mode and its codex are left out, by the owner's choice.
The Duel
- A direct WebRTC link between the two browsers, with no server of ours and
no third-party broker. The first player sends an invite link (#d=), the
second sends back a reply link (#r=). The reply is pasted into the page, or
opened in the same browser, where a BroadcastChannel hands it to the tab
that made the invite.
- One STUN server, stun.cloudflare.com, and no relay. Nothing is contacted
until "Make an invite" or "Answer the invite" is pressed.
- Two channels: an ordered, reliable one for rounds, hits and broken blocks,
and an unordered one that is never resent for positions.
- /privacy/ gains "Game duels", and the page has "What is sent".
The site
- scripts/stamp.mjs stamps this one page under psycho-syber/, so its links
carry no ?v= token by hand. scripts/site-chrome.mjs writes its header and
footer. sitemap.xml lists it. "The game" on /psycho-syber/ links to it.
- The header, the Menu, the homepage and llms.txt do not list it.
- CLAUDE.md has a section for it, and psycho-syber/README.md ("ARENA") has
the files, the messages the two browsers exchange and what is not yet done.
Checks
- CI runs node psycho-syber/test/arena.mjs: the codes pack and read back and
bad ones are refused, the page holds all 82 elements the script looks up,
no form, no other origin, one address in the scripts, storage keys under
psycho-syber.arena., the library's hash. The workflow also checks the
built files and the stamped link.
- psycho-syber/test/arena-browser.mjs, run by hand in headless Chrome: a wave
at 1440x900 and at 390x844 with touch, and two duels between two browser
contexts (reply pasted, reply opened as a link), each to five rounds, a
rematch and a closed tab. 40 checks, all passing; a third run with the
reply held for 60 seconds before it was pasted also passed.
- Not tested: two people, two networks, a phone, Firefox, Safari. No STUN
server answers in the sandbox, so every link opened on local addresses.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RWZfXGDEpYby5jSNdnoLM
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… read as a URL check CodeQL marked the test's search of the page's copy for the STUN server's name as "incomplete URL substring sanitization". The line checks that the page tells the visitor about the server; no address is being vetted. It now looks for the words of that sentence. All 26 checks pass. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RWZfXGDEpYby5jSNdnoLM
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 264eedc034
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if (G.state === 'pause' && G.mode === 'duel') { | ||
| update(dt); |
There was a problem hiding this comment.
Freeze the duel when its pause panel is open
When a player pauses during a duel, this branch keeps advancing the simulation while the panel says “Paused.” The opponent can still damage them or win the round, and a later round can automatically close the pause panel. Stop advancing the local duel while paused or make the UI clearly indicate that the duel continues.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8b8ba0b by the second of the two options. The duel keeps running: one browser cannot stop the other, and the first player's browser runs the rounds, so freezing it would stop both. The panel was what was wrong. In a duel it now reads "A duel does not pause. While this panel is open you stand still and your rival can still hit you. The next round closes it.", Resume reads "Back to the duel", Restart is hidden, and the note says that leaving ends the duel for both players. The page and CLAUDE.md say the same, and arena-browser.mjs checks it in both duels.
Generated by Claude Code
A review comment on the pull request: with the panel open in a duel the game kept running under the word "Paused.", so a player could be hit or lose the round while the page told them the game had stopped. The duel has to keep running. One browser cannot stop the other's game, and the lead's browser runs the rounds, so a frozen lead would stop both. What was wrong was the panel. In a duel it now reads: "A duel does not pause. While this panel is open you stand still and your rival can still hit you. The next round closes it." Resume reads "Back to the duel", Restart (which did nothing in a duel) is hidden, and the note says that leaving ends the duel for both players. Waves pauses as before. - Blasts and sparks keep moving under a duel's panel; they had stopped while new ones were still being added. - The page's Duel section and its Controls table say the same, and CLAUDE.md has the rule. - arena-browser.mjs checks it in both duels: the panel's words, no Restart, positions still going out after 2.5 seconds, and the way back. 44 checks, all passing. arena.mjs: 26 pass. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RWZfXGDEpYby5jSNdnoLM
Adds a second game to the site at
/psycho-syber/arena/: a first-person arena in 3D with the two forms, Psycho and Syber. Two modes: Waves for one player and the Duel for two players in two browsers. The game was built outside this repository; this ports it to the site's rules. The owner chose the name, the place and the two modes on November 19.Merging deploys to production, so this is opened for review and not merged.
What is in it
psycho-syber/arena/:index.html,arena.css,game.js(one classic script),link.js(the duel's invite and reply codes) andvendor/three.min.js, which isthree@0.160.0as npm publishes it, with its licence. Nothing loads from another origin.Leave the game, which brings the page and its header back.The Duel, and what it changes about the site
This is the first place on syberlabs.io where a visitor's browser connects to something other than syberlabs.io.
#d=), the second sends back a reply link (#r=). The reply is pasted into the page, or opened in the same browser, where aBroadcastChannelhands it to the tab that made the invite.stun.cloudflare.com, and no relay. Nothing is contacted untilMake an inviteorAnswer the inviteis pressed./privacy/gains a "Game duels" entry and its date moves to 19 November. The page has "What is sent".Changes outside the new folder
scripts/stamp.mjsstamps this one page underpsycho-syber/, so its links carry no hand-kept?v=token.scripts/site-chrome.mjswrites its header and footer;sitemap.xmllists it;scripts/shoot.mjsshoots it./psycho-syber/links to it from "The game". The header, the Menu, the homepage andllms.txtdo not list it. A button on the first game's title was tried and taken out: it pushed the title's words off a phone's screen.CLAUDE.mdhas a section for it.psycho-syber/README.md("ARENA") has the files, the messages the two browsers exchange and what is not yet done.Checks
Run locally, as the workflow runs them:
node --test 'server/test/**/*.test.js': 208 pass, 0 fail. Line rules: 6 pass.site-chrome --check,psycho-syber/test/run.mjsandexport-arena --checkpass.node psycho-syber/test/arena.mjs(new, in CI): 26 checks pass. The codes pack and read back and bad ones are refused; the page holds all 82 elements the script looks up; no form; no other origin; one address in the scripts; storage keys underpsycho-syber.arena.; the library's hash.pnpm build:site, every guard in "Prepare public site", the staff Function build, andscripts/qa.mjs: 50 pages, 0 errors, 0 warnings.psycho-syber/test/arena-browser.mjs(new, by hand, headless Chrome): a wave at 1440x900 and at 390x844 with touch, and two duels between two browser contexts (reply pasted, reply opened as a link), each to five rounds, then a rematch and a closed tab. 40 checks, all pass. A further run with the reply held for 60 seconds before it was pasted also passed.Not tested
For the owner to decide
Generated by Claude Code