Skip to content

feat(network): publish crouch, reload, and emotes in snapshot v9 - #1266

Merged
rubenmarcus merged 33 commits into
stagingfrom
feat/rede-estados-3p-20261109
Nov 15, 2026
Merged

rubenmarcus merged 33 commits into
stagingfrom
feat/rede-estados-3p-20261109

Conversation

@rubenmarcus

@rubenmarcus rubenmarcus commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Snapshot v9 adds remote crouch, reload progress, and authoritative emote ID and phase in three bytes per entity. The client still offers v8 fallback and now requires each welcome or partida version to match the protocol selected by that transport.

Behavior

  • Remote human and bot reload or crouch state reaches the real third-person controller.
  • Mid-emote joins resume at the authoritative phase; movement, fire, death, respawn, model replacement, and stop clear the state.
  • Unknown future emote IDs are ignored for that entity instead of dropping the whole snapshot.
  • WebTransport failure renews the one-use ticket before WebSocket fallback, and stale transport callbacks cannot replace the active session.

Verification

  • client-snapshot-negotiation-check.mjs: 22/22 nominal cases.
  • ws-selection-check.mjs: nominal status GREEN; the rejected-selection mutant fails exactly N3 and N4 with subprotocolo_nao_negociado.
  • npm run eval:netcode: 235 assertions.
  • npm run eval:rede3p: 22 clauses and 12/12 causal mutant sets.
  • Local browser gate: 17/17 scenarios passed. PB3 opened the mobile guest pass with 15 levels, no horizontal scroll, no claim buttons, and a visible login action.

Release order

Backend PR corosolto/backend#212 is merged, but merge is not deployment. The production backend image must include that fix and be pinned to the final integrated client engine before this frontend is promoted. Validate protocol 9, serverSha, clientSha, and SIM_HASH on the node first, then release the matching client.

Assisted by AI under owner authorization. Commits are signed and carry an Agent: trailer.

Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
csbrasil Ignored Ignored Preview Nov 15, 2026 3:10am UTC

Request Review

@csbrasil-BOT
csbrasil-BOT changed the base branch from main to staging November 9, 2026 07:29
@csbrasil-BOT csbrasil-BOT added needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding needs-human-gameplay Change requires human gameplay/render/HUD review needs-staging Change requires integrated validation in staging target:staging PR targets the staging integration branch labels Nov 9, 2026
@csbrasil-BOT

csbrasil-BOT commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

csbrasil-bot classification

Note

@rubenmarcus opened a PR with 35 file(s) · +966 −255, targeting staging.

What changed

area files + − sample
🧪 harness 17 +561 −164 client-snapshot-negotiation-check.mjs, client-ticket-fallback-check.mjs, mp-paridade-check.mjs …
🎮 game 8 +156 −37 emote-catalog.js, emotes.js, game.js …
📦 other 5 +90 −13 package.json, eval-suites.test.mjs, netcodec-v8.test.mjs …
📚 docs 4 +157 −41 CHANGELOG.md, ARMAS-MATRIZ.md, EMOTES-BR.md …
🤖 CI 1 +2 −0 ci.yml

Labels

label reason
needs-human-gameplay changes gameplay, rendering, HUD, maps or characters: human approval required
needs-staging runtime/UI change: validate the integrated change in staging before merging
release-batch joins the next daily staging to main release batch
target:staging routed to the staging integration branch

@estraga-codigo estraga-codigo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Palhaço Mal

Palhaço Mal · code reviewer · 🤡

Change map

  • harness (12): client-snapshot-negotiation-check.mjs, mp-paridade-check.mjs, mp-proximo-check.mjs, netcode-check.mjs …
  • docs (7): AGENTS.md, CHANGELOG.md, ARMAS-MATRIZ.md, EMOTES-BR.md …
  • game (7): emote-catalog.js, emotes.js, game.js, glbchars.js …
  • other (3): package.json, netcodec-v8.test.mjs, netcodec-v9.test.mjs
  • CI (1): ci.yml

Note

Summary: The diff adds snapshot protocol v9 with remote crouch, reload, and emote state; introduces the lightweight emote catalog; updates client synchronization and negotiation; and extends the fast and CI checks with the new codec and third-person network evaluations. It also documents the v8 fallback and the paired backend/client rollout requirements.

1 major · 0 minor

Warning

Risk MEDIUM · score 6.5/10 ▓▓▓▓▓▓▓░░░
1 major finding(s). Resolve before merging.

Unresolved review threads block merging under the branch policy. Fix the finding or refute it with evidence.

🔴 Major findings (1)

  • Mutant gate never runs the nominal check — tools/eval/rede3p-mutants-check.mjs:19 (action: leis-da-casa)
    The gate spawns rede3p-check.mjs only with --mutante=... and asserts exit 1 plus the presence of the target clause in observed.failed. It never runs rede3p-check.mjs without a mutant, so a systematically red base check (broken harness, wrong rig, environment drift) makes every mutant 'detect' its clause and the gate still prints 'onze falhas causais detectadas'. This contradicts the sibling gate netcodec-mutants-check.mjs, which runs a nominal case first and requires exit 0 with an empty failure list.
    💡 Fix: Add a nominal run of rede3p-check.mjs without --mutante before the mutant loop; require exit 0, a present REDE3P_RESULT line and an empty failed array, and fail the gate otherwise.

    Suggested mutation: Break rede3p-check.mjs globally (for example make headY() return a constant) so every clause fails; each mutant still 'hits' its target clause and the mutant gate stays green.

Cross-module impact

graph RL
  main_js["main.js"] --> game_js["game.js"]
  fparms_js["fparms.js"] --> glbchars_js["glbchars.js"]
  game_js["game.js"] --> glbchars_js["glbchars.js"]
  loading3d_js["loading3d.js"] --> glbchars_js["glbchars.js"]
Loading
  • main.js (imports public/js/game.js)
  • fparms.js, game.js, loading3d.js, main.js (import public/js/glbchars.js)
  • main.js
  • fparms.js
  • loading3d.js

(Local public/js import graph, which may lag behind the PR head.)


Fix or refute each finding in its thread. Evidence settles the review.

— Every bug leaves a trace in the diff. I ask the questions. 🤡

Comment thread tools/eval/rede3p-mutants-check.mjs Resolved
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code

@estraga-codigo estraga-codigo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Palhaço Mal

Palhaço Mal · code reviewer · 🤡

Change map

  • harness (15): client-snapshot-negotiation-check.mjs, mp-paridade-check.mjs, mp-proximo-check.mjs, net-rate-frozen-check.mjs …
  • docs (7): AGENTS.md, CHANGELOG.md, ARMAS-MATRIZ.md, EMOTES-BR.md …
  • game (7): emote-catalog.js, emotes.js, game.js, glbchars.js …
  • other (3): package.json, netcodec-v8.test.mjs, netcodec-v9.test.mjs
  • CI (1): ci.yml

Note

Summary: This diff promotes the client snapshot protocol to v9 (crouch, public reload, emote id and phase per entity), extracts the emote catalog into public/js/data/emote-catalog.js, wires remote state application in public/js/netgame.js, adds the eval:rede3p gate and a CI step for it, and rewrites the snapshot-negotiation documentation.

1 major · 0 minor

Caution

Risk HIGH · score 6/10 ▓▓▓▓▓▓░░░░
1 major finding(s). Resolve before merging.

Unresolved review threads block merging under the branch policy. Fix the finding or refute it with evidence.

🔴 Major findings (1)

  • Mutant coverage for v9 negotiation was cut, not updated — package.json:339 (action: ci-portoes)
    The eval:client-snapshot-negotiation script now runs only --mutante=welcome-version, --mutante=partida-version and --mutante=attempt-guard; the mutants legacy-offer, ws-selection, legacy-wt-request, early-close-notify and callback-before-close were removed. The rewritten docs/visual-consistency/CLIENT-SNAPSHOT-NEGOTIATION.md still declares "O transporte recusa seleção ausente ou fora dessa lista", "Mensagens tardias não podem trocar meta/slot nem disparar callbacks na tentativa seguinte" and "onClose só notifica uma sessão já aceita", but no mutant now proves those clauses, so a regression in transport selection or attempt isolation would merge green. The removed mutants were exactly the ones that covered behaviour the document still treats as contract.
    💡 Fix: Restore the mutants that still map to documented clauses (--mutante=ws-selection, --mutante=early-close-notify, --mutante=callback-before-close) or delete the corresponding clauses from docs/visual-consistency/CLIENT-SNAPSHOT-NEGOTIATION.md. Keep the mutant set and the documented clauses in the same commit.

@@

  • "eval:client-snapshot-negotiation": "node tools/eval/client-snapshot-negotiation-check.mjs && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=welcome-version && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=partida-version && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=attempt-guard",
  • "eval:client-snapshot-negotiation": "node tools/eval/client-snapshot-negotiation-check.mjs && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=welcome-version && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=partida-version && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=attempt-guard && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=ws-selection && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=early-close-notify && node tools/eval/client-snapshot-negotiation-check.mjs --mutante=callback-before-close",
  > Suggested mutation: `Reintroduce by deleting the restored `--mutante=` entries from the `eval:client-snapshot-negotiation` script while leaving the documented clauses in the negotiation contract.`

### Cross-module impact

```mermaid
graph RL
  main_js["main.js"] --> game_js["game.js"]
  fparms_js["fparms.js"] --> glbchars_js["glbchars.js"]
  game_js["game.js"] --> glbchars_js["glbchars.js"]
  loading3d_js["loading3d.js"] --> glbchars_js["glbchars.js"]
  • main.js
  • fparms.js
  • loading3d.js
  • game.js
  • main.js
  • fparms.js

(Local public/js import graph, which may lag behind the PR head.)


Fix or refute each finding in its thread. Evidence settles the review.

— A green check still needs evidence. 🤡

Comment thread package.json Resolved
Exercite seis mutantes de negociação e quatro controles de ticket no gate existente. Fixe o nó da emissão à sessão e recuse replay de nonce na régua.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
@rubenmarcus rubenmarcus added the estragacodigo-resolved Maintainer confirmed that estraga-codigo findings are resolved label Nov 14, 2026
Agent: codex
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
@rubenmarcus

Copy link
Copy Markdown
Member Author

Staging advanced after the exact-head review, so I resolved the new merge conflict in 0188524df. The only textual conflict was additive in CHANGELOG.md; both the protocol-v9 entry and the Creepypasta pass entry remain.

Focused proof on the combined tree:

  • eval:rede3p: nominal green and 12 causal mutants detected.
  • eval:netcodecbin: direct codec contract green, 26/26 clauses. Local Node 26 injected children still hit the known DEP0205 stderr rule; CI Node 24 remains the oracle.
  • Final adversarial review of merge commit 0188524df: no findings.

AI assistance is recorded in the merge commit Agent: codex trailer.

@csbrasil-BOT csbrasil-BOT added needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding and removed estragacodigo-resolved Maintainer confirmed that estraga-codigo findings are resolved labels Nov 14, 2026
Agent: codex
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
@rubenmarcus

Copy link
Copy Markdown
Member Author

Integrated the current staging head and resolved the suite manifest by preserving eval:rede3p, eval:pesos-braco-perna, and eval:rigmaos.

Focused verification:

  • node --test tests/eval-suites.test.mjs: 63/63
  • npm run eval:netcodecbin: binary codec contract and mutants green
  • npm run eval:rede3p: snapshot v9 behavior and causal mutants green

Adversarial review of exact head de8476247 found no remaining issues. The normal push was attempted but an existing repository pre-push lock remained occupied. The final transport used the repository-supported PREPUSH=0 path after the exact focused proofs above were green. CI remains authoritative.

Agent: codex

@rubenmarcus rubenmarcus removed the needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding label Nov 14, 2026
@rubenmarcus
rubenmarcus dismissed estraga-codigo’s stale review November 14, 2026 21:59

Both findings are resolved on exact head de84762. The required pr-fast gate is green, and the focused snapshot negotiation suite applies partida-version and detects exactly N9, N10, N17, N18, and N21.

@csbrasil-BOT csbrasil-BOT added the needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding label Nov 14, 2026
@rubenmarcus rubenmarcus removed needs-human-gameplay Change requires human gameplay/render/HUD review needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding labels Nov 14, 2026
@csbrasil-BOT csbrasil-BOT added needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding needs-human-gameplay Change requires human gameplay/render/HUD review labels Nov 14, 2026
@rubenmarcus rubenmarcus removed needs-human-gameplay Change requires human gameplay/render/HUD review needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding labels Nov 14, 2026
@csbrasil-BOT csbrasil-BOT added needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding needs-human-gameplay Change requires human gameplay/render/HUD review labels Nov 14, 2026
@rubenmarcus rubenmarcus added the estragacodigo-resolved Maintainer confirmed that estraga-codigo findings are resolved label Nov 14, 2026
@csbrasil-BOT csbrasil-BOT removed the estragacodigo-resolved Maintainer confirmed that estraga-codigo findings are resolved label Nov 14, 2026
Agent: codex
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: codex
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: codex
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Preserve the HTTPS smoke fixture alongside the release-gate hardening merged into staging.

Agent: codex
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>

@estraga-codigo estraga-codigo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Palhaço Mal

Palhaço Mal · code reviewer · 🤡

Change map

  • harness (17): client-snapshot-negotiation-check.mjs, client-ticket-fallback-check.mjs, mp-paridade-check.mjs, mp-proximo-check.mjs …
  • game (8): emote-catalog.js, emotes.js, game.js, glbchars.js …
  • other (5): package.json, eval-suites.test.mjs, netcodec-v8.test.mjs, netcodec-v9.test.mjs …
  • docs (4): CHANGELOG.md, ARMAS-MATRIZ.md, EMOTES-BR.md, CLIENT-SNAPSHOT-NEGOTIATION.md
  • CI (1): ci.yml

Note

Summary: The diff adds snapshot protocol v9, v9 remote-player state, WebTransport-to-WebSocket ticket renewal, codec and negotiation tests, and a new CI quality gate. The new eval:rede3p package script references two harness files that are absent from the supplied repository files.

2 major · 0 minor

Caution

Risk HIGH · score 5.8/10 ▓▓▓▓▓▓░░░░
2 major finding(s). Resolve before merging.

Unresolved review threads block merging under the branch policy. Fix the finding or refute it with evidence.

🔴 Major findings (2)

  • eval:rede3p references missing harness files — package.json:341 (action: ci-portoes)
    The eval:rede3p script runs tools/eval/rede3p-mutants-check.mjs and tools/eval/rede3p-mutants-proof.mjs, but neither file is included in the supplied repository file list or diff. The new CI step invokes eval:rede3p, so the quality gate fails when Node cannot load the first missing module, blocking every merge through that workflow.
    💡 Fix: Add both referenced harness files to the change, or update eval:rede3p to invoke harness files that are actually present and provide the required nominal and mutation checks. Run npm run eval:rede3p locally before enabling it in .github/workflows/ci.yml.

    Suggested mutation: Remove either tools/eval/rede3p-mutants-check.mjsortools/eval/rede3p-mutants-proof.mjs; the CI gate fails when resolving the corresponding module.

  • netcodec mutation harness references undeclared modules — tools/eval/netcodec-mutants-check.mjs:5 (action: leis-da-casa)
    The new implementation uses fs, os, and path but does not import them. The first use of fs.readFileSync therefore raises ReferenceError: fs is not defined before the nominal test run, so the mutation gate cannot execute or validate any codec mutation. This blocks the eval:netcodec quality gate rather than measuring the intended behavior.
    💡 Fix: Import fs from node:fs, os from node:os, and path from node:path before executing the harness.

--- a/tools/eval/netcodec-mutants-check.mjs
+++ b/tools/eval/netcodec-mutants-check.mjs
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';

  > Suggested mutation: `Remove the `node:fs`, `node:os`, and `node:path` imports while leaving the harness body unchanged; the script then fails at `fs.readFileSync`.`

### Cross-module impact

```mermaid
graph RL
  main_js["main.js"] --> game_js["game.js"]
  fparms_js["fparms.js"] --> glbchars_js["glbchars.js"]
  game_js["game.js"] --> glbchars_js["glbchars.js"]
  loading3d_js["loading3d.js"] --> glbchars_js["glbchars.js"]
  • main.js multiplayer clients

(Local public/js import graph, which may lag behind the PR head.)


Fix or refute each finding in its thread. Evidence settles the review.

— A green check still needs evidence. 🤡

Comment thread package.json Resolved
Comment thread tools/eval/netcodec-mutants-check.mjs Resolved
@rubenmarcus
rubenmarcus dismissed estraga-codigo’s stale review November 15, 2026 03:40

Both exact-head findings were refuted with repository and executable evidence: the files and imports are present, the focused gates pass, all threads are resolved, and CI is green.

@rubenmarcus

Copy link
Copy Markdown
Member Author

Snapshot v9 is ready on f1f52d060.
Exact-head CI is green, including smoke-cf; the HTTPS/WSS fixture now reaches and passes the reconnection assertion.
Focused proof also passes: 22 REDE3P clauses, all 12 causal mutants, and all 6 netcodec mutants.
Production backend health is compatible: server 7a5a28291808b1ffaa0b20159373ad9d0f8888b5, client de847624741e90de856c098943d158d549fa8b3c, protocol 1-9, sim hash b21ad13ffdc7da2a.
All review threads are resolved; the exact-head review was dismissed only after both findings were disproved by the checked-in files and passing gates.

@rubenmarcus rubenmarcus added estragacodigo-resolved Maintainer confirmed that estraga-codigo findings are resolved and removed needs-estragacodigo-resolution PR has an unresolved estraga-codigo finding labels Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

estragacodigo-resolved Maintainer confirmed that estraga-codigo findings are resolved needs-human-gameplay Change requires human gameplay/render/HUD review needs-staging Change requires integrated validation in staging release-batch Change waits for the next staging-to-main release batch target:staging PR targets the staging integration branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants