mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6850] [MERGED] feat(multiplayer): add optional shared sessions #7355
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6850
Author: @SpicyMarinara
Created: 9/29/2026
Status: ✅ Merged
Merged: 9/29/2026
Merged by: @SpicyMarinara
Base:
staging← Head:codex/6790-multiplayer📝 Commits (9)
3a38557docs: record multiplayer trust boundaries and transportbf561effeat(multiplayer): add optional shared sessions in all three modes8246622fix(multiplayer): harden recovery and preserve room companions0ec8664Merge staging ruleset updates into multiplayerd6c7169test(multiplayer): build guest assets for clean security checks0c2f594fix(multiplayer): enforce dormant gates and private room boundaries7958dcffix(multiplayer): ignore unrelated availability invalidations3247b58fix(multiplayer): retain successful sessions after status failures210015dMerge staging into optional multiplayer📊 Changes
121 files changed (+15716 additions, -1435 deletions)
View changed files
📝
.env.example(+4 -0)📝
CHANGELOG.md(+2 -0)📝
CONTRIBUTING.md(+2 -0)📝
README.md(+2 -0)📝
android/README.md(+4 -0)📝
docs/CONFIGURATION.md(+22 -0)📝
docs/FAQ.md(+6 -0)📝
docs/TROUBLESHOOTING.md(+12 -0)➕
docs/development/multiplayer.md(+183 -0)📝
e2e/game-experience-setup.e2e.ts(+79 -1)➕
e2e/multiplayer-controls.e2e.ts(+1007 -0)➕
e2e/multiplayer-guest-isolation.e2e.ts(+684 -0)📝
packages/client/package.json(+1 -1)➕
packages/client/scripts/build-multiplayer-guest.mjs(+38 -0)📝
packages/client/scripts/build.mjs(+2 -0)📝
packages/client/src/components/chat/ChatArea.tsx(+98 -62)📝
packages/client/src/components/chat/ChatModeSelectorModal.tsx(+30 -5)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+21 -1)📝
packages/client/src/components/chat/ChatSetupWizard.tsx(+12 -6)📝
packages/client/src/components/chat/ConversationAutonomousEffects.tsx(+5 -4)...and 80 more files
📄 Description
Linked issue
Closes #6790
Why this change
People can create a fresh shared Conversation, Roleplay or Game, each controlling their own reviewed persona, with host-approved AI characters or an AI GM. Game collects every required human action or explicit pass before one shared resolution.
What changed
MULTIPLAYER_ENABLED=trueat startup, separate Settings consent, then an explicit Host or Join. Restart never restores a network session. Either gate being off stops session scans, TLS checks and host/guest polling; only activation discovery and explicit Settings refresh remain. The host chooses the human and AI roster without a fixed count cap; bounded request/snapshot sizes and rate protections remain.Validation
Implementation and substantive local review are complete. Human verification boxes remain unchecked. Merged into
stagingas338e066ae97784db6ae9c5f956cba1caf54f8a30. All required GitHub checks and CodeRabbit passed on final integrated head210015d738dbf2a5e361a12a1396e9832771f822before merge. The complete hosted Node lane and platform/container jobs also passed. All review threads are resolved. Physical-device checks below remain explicitly unverified; browser emulation is not a claim of physical-device support.pnpm checkpasses locallyCONTRIBUTING.mdAutomated evidence
pnpm checkandpnpm version:checkpassed. Includes localization, formatting, lint, client/server/shared and e2e types, production builds and the isolated guest bundle.pnpm smoke:ui: 7/7;pnpm smoke:production: 3/3. Game parser/translation browser regressions: 5/5. Prompt, attachments, context-fit, generation-output, Game ruleset setup, parser attributes/inventory/dice and malformed-input runtime bounds passed. Parser differential checks matched 25,000 legacy cases.sha256:a2839e1effd784cef1f430641e0817f477853de6041feff0290fd8951bed9428. Verified environment/Settings gates, packaged guest assets, production shell/CSP and no automatic peer listener. Temporary containers removed; image not published.pnpm regression:securitypassed. The complete hosted Linux Node lane passed on final integrated head210015d73. All required checks, Windows/macOS/Linux builds, container runtime jobs and Android build/signing guard passed on this head; nightly-only full-browser jobs were intentionally skipped. The initial local Mac sweep had one unchangeddecision-sidecar-runtimeplatform expectation failure, independently reproduced on staging0cad58d3; the full local Node lane is not claimed green.f953711cais integrated in210015d73; only the changelog conflicted and both entries were retained. After integration,pnpm check, all 12 multiplayer suites, focused weapon/inventory/combat-grid/invented-item regressions, UI smoke (7/7), production smoke (3/3), and Docker build/runtime passed again. Independent read-only review found no Game integration defect. No version or storage-format changes.Review disposition
Hosted CodeRabbit findings were traced against current code. Fixes include central disabled polling, consent reset, setup-repair authority, sanitized/logged errors, TLS-free request gates, scheduler exception backoff, exact hidden-stat visibility keys, roster-only authorization, protected room metadata and awaited fixture cleanup. The old four-player constant and new roster-cap suggestions are obsolete after the maintainer requested no fixed caps; linked issue #6790 now reflects that updated requirement. A declined generation claim intentionally does not trigger failure backoff: it can be a harmless busy/Stop race, and failed provider generation already blocks autonomy until explicit recovery.
All eight hosted CodeQL findings are fixed; CodeQL passed on final integrated head
210015d73and the PR code-scanning API reported no open alerts. Fixes include: a real dedicated guest-document rate bucket and bounded forward scans in the promoted Game parser/widget helpers, with malformed-input regression proof.Hosted CodeRabbit completed on final integrated head
210015d73with no actionable comments in its latest review; all historical threads are resolved with fixes or documented dispositions. Local CodeRabbit reviews completed and substantive findings were addressed. The static-cache follow-up review reported no new findings. The later Host/Join recovery review reported one fixture-only finding: a synthetic test button can submit before status loads. Production Host and Join controls both require loaded, available, enabled status; successful status data is retained with infinite garbage-collection time during ordinary use. The only global cache clear is the explicit admin expunge/clear-all runtime reset, where a late session must not be resurrected. Unknown or disabled status therefore remains fail-closed; the suggestion to seed a session without known enablement was not adopted. Hosted finding 4136044408 is fixed by immediately retaining successful session results while enabled, with the 42-case recovery/disable proof above. The docstring-coverage advisory is not a repository merge gate; existing boundary documentation is retained without adding comments that merely repeat self-explanatory helpers. Suggestions not adopted: restoring a fixed roster cap (explicit maintainer requirement; byte/rate limits and recovery remain), process-lifetime guest asset caching (development rebuild/reload), reparsing normalized client character IDs, a redundant SSE adapter branch, narrowing chat invalidation despite roster/setup changes, deduplicating disjoint library/NPC IDs already maintained uniquely, and moving inert retry counters before terminal-state assignment (terminal sessions already stop all polling; no retry timer is created). This is not a claim of zero findings. Independent review also traced both directions of the peer boundary, key handling, admission/revocation, tool dispatch, plain-text host rendering and isolated guest rendering. No absolute security guarantee is asserted.Manual verification notes
Docs and release impact
Updated setup, FAQ, troubleshooting, architecture/security boundary, compatibility matrix, Android restriction and Unreleased changelog. Translation follow-up: #6854. No app version or storage-format change.
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue openedUI evidence
Desktop/mobile screenshot bundle and evidence index. Download the self-contained HTML to view the nine embedded PNGs. Covers light/dark Settings warnings, IP/provider disclosure, joining, Players and larger host/guest rosters; all data are disposable fixtures. No screenshot assets are committed to the repository.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.