Skip to content

PSYCHO SYBER: ARENA, a second game at /psycho-syber/arena/ with a duel for two browsers - #222

Merged
sykosyber merged 3 commits into
mainfrom
arena
Nov 19, 2026
Merged

sykosyber merged 3 commits into
mainfrom
arena

Conversation

@sykosyber

Copy link
Copy Markdown
Member

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) and vendor/three.min.js, which is three@0.160.0 as npm publishes it, with its licence. Nothing loads from another origin.
  • The stage sits under the site's header. A game covers the whole screen; Pause and both end panels have Leave the game, which brings the page and its header back.
  • The copy under the stage follows Wording, names the four products and Lacuna Institute, and keeps its limits.
  • An earlier story mode and its codex are left out, by the owner's choice.

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.

  • The two browsers open a direct WebRTC link. No server of ours and no third-party broker takes part. 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.
  • An invite and a reply contain the network addresses of the browser that made them. The panel says so beside each one.
  • /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.mjs stamps this one page under psycho-syber/, so its links carry no hand-kept ?v= token.
  • scripts/site-chrome.mjs writes its header and footer; sitemap.xml lists it; scripts/shoot.mjs shoots it.
  • /psycho-syber/ links to it from "The game". The header, the Menu, the homepage and llms.txt do 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.md has 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.mjs and export-arena --check pass.
  • 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 under psycho-syber.arena.; the library's hash.
  • pnpm build:site, every guard in "Prepare public site", the staff Function build, and scripts/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

  • No person has played this build. The browser runs are scripted.
  • No duel across two networks, on a phone, or in Firefox or Safari. No STUN server answers in the sandbox, so every link in the runs opened on local addresses. Whether a link opens between two home or mobile networks is the main open question, and with no relay some pairs of networks will not connect.
  • An invite is about 600 characters. It has not been sent through a message app.

For the owner to decide

  • Whether the header, the Menu or the homepage should list the game.
  • The picture keeps the earlier build's colours (rose for Psycho, teal for Syber) and the page uses the first game's social card.

Generated by Claude Code

…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T09:04:14.806634Z 264eedc PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread psycho-syber/test/arena.mjs Fixed
… 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread psycho-syber/arena/game.js Outdated
Comment on lines +1702 to +1703
} else if (G.state === 'pause' && G.mode === 'duel') {
update(dt);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@sykosyber
sykosyber merged commit 38f5ed2 into main Nov 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants