Skip to content

Implement scoped direct-text JOIN delivery with fail-closed actor authority - #2898

Closed
benhook1013 wants to merge 169 commits into
codex/gameplay-runtime-identity-associationfrom
codex/unit-1a-join-player-stage-prep
Closed

benhook1013 wants to merge 169 commits into
codex/gameplay-runtime-identity-associationfrom
codex/unit-1a-join-player-stage-prep

Conversation

@benhook1013

@benhook1013 benhook1013 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Scope

Direct-text WORLDS, REALMS, JOIN, CHARS and PLAY delivery with caller-bound ordinal snapshots, exact JOIN retry identity, privacy-safe denials and localized typed output. Account authentication/membership, Entity namespace-qualified ownership, Game Design tenant identity and Game Session runtime association remain owned by prerequisites.

The published candidate is d8f5e7e491e05381fdeab9b1e1b4447e877d9792, with 79 unique paths. It is a true child of #2973 at 31a631a4c8d4d2efd529ec107553392902a6b585, behind #3010 → #2967 → #3028 → #2972 → #2973. The previous child and complete published parent remain ancestors; no history was rewritten. Two documentation conflicts were reconciled without dropping owned behavior, followed by a whitespace-only table correction.

Implemented boundary

  • Canonical Account UUIDs flow through direct-text caller contexts and authority checks. Legacy numeric or malformed Account carriers remain denied.
  • Discovery retains authenticated response-local selections. JOIN uses the exact retained scope and one request identity across retries; terminal and ambiguous transport outcomes remain distinct.
  • Catalog/grant freshness uses the injected authority clock. Private/mismatched targets and stale selections fail closed.
  • Production roster/PLAY remains closed without complete namespace-qualified actor and admission proof. Unsafe LOGOUT remains unavailable and nonmutating; parent legacy-positive LOGOUT expectations are not retained as authorized child behavior.

No legacy roster fallback, synthetic owner mapping, raw pointer seed, credential activation or weaker full-stack Smoke is introduced.

Retained review evidence

Earlier Hosted 1/1/0 on e42eca1bb (checkpoint) and CLI 4/2/1 (checkpoint) remain recorded. Owned corrections at 53db3bf21 and d68d34d1a are preserved. Existing results, routes and audited decisions remain in the controller; reconciliation is not new CodeRabbit coverage or a history reset.

Validation and remaining delivery proof

The reconciled parent/child candidate passed 384 focused Game Session unit cases across 11 suites, zero failures/errors/skips, plus integration-source compilation. Links, Markdown hygiene and Flyway version checks passed after the table-spacing correction. These are focused local checks, not PostgreSQL/Redis execution or a live player flow.

Earlier broader check evidence remains historical: 2,244 executed cases and 216 skipped on its prior head. Current required CI must be consumed after publication. Historical red Smoke demonstrates the unresolved PLAY authority path; reconciliation alone does not repair it.

Gameplay is completing the protected Account finalization, actual tenant binding commit, current region intake and canonical PLAY/LOOK consumer. Document's exact World lifecycle/placement and publication-settlement handoff remains separate. Fresh LOGIN → REALMS → explicit JOIN → PLAY → LOOK has not been proved. This PR is not merge-ready while required Smoke or the complete runtime proof remains unresolved. Workers do not merge or enable auto-merge.

FireMUD LOC impact

Compared 31a631a4c8d4 → d8f5e7e491e0 (PR merge-base → head).
PR scope: 79 changed files · 12,826 added textual lines / 1,218 deleted textual lines.

Section Base LOC Head LOC Δ LOC Change
Overall 734,382 745,037 +10,655 +1.5%
 Source 647,442 657,948 +10,506 +1.6%
  ↳ Code 283,868 287,203 +3,335 +1.2%
  ↳ Tests 363,574 370,745 +7,171 +2.0%
 Markdown 58,379 58,523 +144 +0.2%
 Design 61,098 61,247 +149 +0.2%
  ↳ Architecture 45,109 45,124 +15 +<0.1%
  ↳ Project management 5,254 5,388 +134 +2.6%
  ↳ Observability 2,147 2,147 0 0.0%
  ↳ Operator runbooks 579 579 0 0.0%
  ↳ gRPC API documentation 6,527 6,527 0 0.0%
  ↳ Product requirements and user journeys 926 926 0 0.0%
  ↳ Developer workflows 477 477 0 0.0%
  ↳ Other design 79 79 0 0.0%

Rows are hierarchical and overlapping views; do not add them together.
LOC means cloc code lines; blank and comment-only lines are excluded.

…it-1a-join-player-stage-prep

# Conflicts:
#	services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/service/impl/GameSessionGrpcService.java
#	services/game-session-service/src/test/java/unit/net/firedevops/firemud/gamesession/command/text/GameplayWorldCatalogTest.java
…oin-player-stage-prep

# Conflicts:
#	services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/command/text/GameplayWorldCatalog.java
#	services/game-session-service/src/test/java/unit/net/firedevops/firemud/gamesession/service/impl/GameSessionGrpcServiceTest.java
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Summary

Summary

  • Added direct-text REALMS and JOIN dispatch in Game Session. REALMS issues Account-backed connect scopes. JOIN calls Account’s public-production membership writer and reuses a caller-bound request ID for retries.
  • Added Redis-backed, caller-bound lobby snapshots for WORLDS, REALMS, and JOIN. Numeric selectors use response-bound snapshots. Realm state is scoped by tenant and world.
  • Updated text PLAY to validate membership identity, lifecycle, version, authority generation, freshness, entitlement, and public-join policy before returning JOIN_REQUIRED.
  • Disabled legacy runtime-instance-keyed character roster requests. CHARS remains unavailable. PLAY fails closed when playable-state namespace authority is missing.
  • Changed LOGOUT to return LOGOUT_UNAVAILABLE before side effects. Reconnect handling suppresses retained private transcript replay and renders fresh LOOK output.
  • Updated Spring Cloud Gateway trusted TCP Proxy identity handling, Game Session output contracts, English and French messages, and authentication, routing, protocol, Redis-reset, and implementation-tracking docs.

Contract and deployment notes

  • WorldsViewOutput.WorldEntry and RealmBrowseViewOutput.RealmEntry no longer expose gameInstanceId.
  • WorldsCommandHandler and PlayCommandHandler now require Account and connect-scope store dependencies. LogoutCommandHandler now accepts only SessionContextService.
  • Game Session uses Redis for production lobby state. The Redis key family is reset-sensitive and non-preservable. Scoped reset requires authoritative session inventory or conservative full-family invalidation.
  • No schema or migration change is reported.
  • Account’s membership writer and Game Session direct-text JOIN are implemented locally. Gateway exposure and first-party browser Join & Play remain unavailable.

Validation and gaps

  • The supplied objectives report 261 focused unit cases passed on changes committed as d12f9a3ff. Later selected checks reused those results; they were not freshly rerun. Docker-backed tests were skipped locally.
  • Live Telnet JOIN/PLAY, exact Entity realm/namespace/revision readback, unknown JOIN-outcome recovery, positive logout/replay fencing, and atomic final binding remain incomplete or unproven. Connect-token issuance-baseline reread and fresh replay validation also remain unproved.
  • Two GameSessionGrpcServiceTest cases reportedly failed during parent reconciliation. The report attributes the failures to inherited error mapping. Owner adjudication and green inherited proof remain open.
  • Required Validation, Smoke, Security, CodeQL, and License evidence against final develop has not been established. Supplied current review findings and severity counts are unavailable.

Walkthrough

The pull request adds direct-text realm browsing and Account-backed public-production membership joining. It adds snapshot-bound discovery and fresh PLAY authority checks. Authenticated LOGOUT now fails closed, reconnect omits retained transcript replay, and the Gateway validates trusted TCP Proxy connection identity.

Changes

Player access and session behavior

Layer / File(s) Summary
Catalog snapshots and scope storage
services/game-session-service/.../GameplayWorldCatalog.java, services/game-session-service/.../DirectTextConnectScopeSessionStore.java
World and realm discovery bind numeric selectors to fingerprinted, tenant-qualified targets. Redis-backed storage retains expiring snapshots, connect scopes, and JOIN request IDs.
Direct-text REALMS and JOIN dispatch
services/game-session-service/.../AccountClient.java, services/game-session-service/.../WorldsCommandHandler.java, services/game-session-service/.../WorldsTextCommandDispatchHandler.java, services/game-session-service/.../TextCommand*.java
REALMS issues caller- and target-bound Account scopes. JOIN reuses the retained scope and request ID. AccountClient retries eligible transport failures only while the scope remains valid.
PLAY admission and authority validation
services/game-session-service/.../PlayCommandHandler.java, services/game-session-service/.../AccountAuthorityEvidence.java, services/game-session-service/.../AuthorityEvaluationFreshness.java
PLAY validates identity, lifecycle, version, generation, and freshness. Public JOIN_REQUIRED requires eligible missing or inactive membership and fresh entitlement and policy evidence.
Logout, reconnect, and proxy identity
services/game-session-service/.../LogoutCommandHandler.java, services/game-session-service/.../GameSessionWebSocketHandler.java, services/spring-cloud-gateway/.../GameplayWebSocketBridgeHandler.java
LOGOUT returns LOGOUT_UNAVAILABLE before terminal changes. Reconnect renders fresh state without retained private replay. Trusted proxy handshakes require and forward a proxy connection ID.
Contracts and validation
design/architecture/..., design/project-management/implementation-tracking/..., services/game-session-service/src/test/...
Architecture and tracking documents distinguish local text JOIN support from unavailable browser Join & Play and incomplete end-to-end proof. Tests cover updated route, authority, storage, rendering, and reconnect contracts.
Project workflow observations
design/project-management/ai-observations.md
New entries record workflow observations about migration checks, review evidence, hosted execution, process waits, and validation.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TextClient
  participant WorldsTextCommandDispatchHandler
  participant WorldsCommandHandler
  participant DirectTextConnectScopeSessionStore
  participant AccountClient
  participant Account
  TextClient->>WorldsTextCommandDispatchHandler: REALMS world selector
  WorldsTextCommandDispatchHandler->>WorldsCommandHandler: Browse realms for transport session
  WorldsCommandHandler->>AccountClient: Issue scope for selected realm
  AccountClient->>Account: IssueDirectTextConnectScope
  WorldsCommandHandler->>DirectTextConnectScopeSessionStore: Store realm snapshot and scope
  TextClient->>WorldsTextCommandDispatchHandler: JOIN world selector
  WorldsTextCommandDispatchHandler->>WorldsCommandHandler: Join public-production membership
  WorldsCommandHandler->>DirectTextConnectScopeSessionStore: Resolve scope and request ID
  WorldsCommandHandler->>AccountClient: Submit JOIN with retained scope
  AccountClient->>Account: JoinPublicProductionMembership
  Account-->>WorldsTextCommandDispatchHandler: JOIN outcome
  WorldsTextCommandDispatchHandler-->>TextClient: Membership result
Loading

Merge Risk: 🟡 Moderate · up to e42ec

Direct-text JOIN and fresh PLAY authority checks are substantial access-control changes. Remaining concerns include rejection of valid authority evidence under small clock skew, transport error codes shown to players on JOIN failures, and unverified integration and CI results. Resolve or explicitly accept these before merging.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to e42ec

The change strengthens admission checks and prevents retained private output from being replayed without sufficient authority. However, concurrent state replacement, session cleanup, and compatibility during deployment remain incompletely established. No introduced authorization bypass was established in the inspected paths.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The sensitive outcomes are membership changes for the authenticated account in the scoped tenant and continuity of downstream session identity. The inspected JOIN writer validates account, tenant, realm, instance, namespace, and state-scope agreement; stable transport identity relies on the trusted proxy boundary rather than arbitrary public headers.

Security Findings and Attack Paths

  • observed — The suppressed bridge authorization-bypass candidate has substantial source counterevidence: untrusted session requests carrying proxy identity headers are rejected, gateway-owned headers are canonicalized, and trusted admission requires dedicated-listener and peer-authentication checks. This does not prove deployed configuration or every replay path safe.

Trust Boundaries and Controls

  • observed — Account scope issuance compares the requested target with current public-production authority and checks account eligibility and tenant entitlement. JOIN intent conflicts are rejected, membership processing is serialized with account and operation locks, and terminal replay re-evaluates policy rather than blindly returning an earlier success.

Resilience and Maintainability Implications

  • observed — The inspected direct LOGOUT path bypasses authentication normalization and returns its denial before bootstrap, activity recording, locale persistence, prompt processing, or retained-output handling. Disconnect handling remains a separate lifecycle operation; complete lobby cleanup reachability is still unproven.
🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 3.32% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 572 functions across 50 files. (26 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: scoped direct-text JOIN delivery with fail-closed authority checks.
Description check ✅ Passed The description explains the scope, implemented behavior, validation evidence, remaining risks, and merge-readiness status. It does not use the template’s exact section headings, list the validation c…
Full details: Docstring Coverage

Explanation

Docstring coverage is 3.32% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 572 functions across 50 files. (26 skipped: 22 unsupported, 4 over the file limit.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…nto codex/gameplay-owner-qualified-entry

# Conflicts:
#	design/project-management/implementation-tracking/player-access-and-session.md
@benhook1013

Copy link
Copy Markdown
Owner Author

Consolidated into the existing Account and Player drafts. Audited d8f5e7e491e05381fdeab9b1e1b4447e877d9792 over configured base c1c54a4574fd83cc800bf997a8f69c5bd7104387, including the 79-path unique slice after integrated parent 31a631a4c8d4d2efd529ec107553392902a6b585. All 22 existing review threads were resolved when source and receiving comparisons were verified.

  • Account Consolidate Account identity and email completion groundwork #3438 4c13856f999d503bc5c399f48aa717c1f661d04b over b98f1aa9134808b0fe6b936e5b3e1c164876c3a7 contains bc5538d5987a700d2d14c69bf8633a523dbbc649, covering exact invalid JOIN scope refusals on both Account paths.
  • Player Consolidate Player transport diagnostics and renewal groundwork #3440 acece6523585b6c9dbee7951f56d8bf078d1bfaf over cd5eb174772c5146a0b383d7f55e1204e348987d includes the hidden-realm response and grant privacy, stable public selectors and REALMS slugs, protected stale-selection recovery and scoped JOIN help. The final patch preserves persisted ordinary pointer representation and refuses protected, unknown or unqualified representation before the numeric roster and later effects. This is the narrow current replacement for the donor’s broad legacy bridge shutdown. The protected route keeps the canonical owner path. The historical numeric reconciliation outcome remains a retained storage value under the current design.
  • Focused proof actually executed includes 154 PLAY and 66 catalog privacy cases with enabled local static and formatting checks, a separate 193-case protected-selection rerun plus one Redis case with enabled static and formatting checks, and all 3,835 Game Session unit cases against the final roster-guard production patch. The latter includes exact representation readback and parameterized refusal of missing, canonical-open and unknown representations. No failures, errors or skips in those test receipts. Optional physical readback assertions for profiles 1 and 3 are included in the Player draft, with their native PostgreSQL rerun still queued. The first aggregate stopped at a missing test-only import after the passing unit run. The published patch includes the import correction.
  • The retained parent Prove canonical LOGIN, JOIN, PLAY and LOOK over Telnet and WebSocket #3481 already proved fresh Telnet and WebSocket LOGIN → WORLDS → REALMS → JOIN → PLAY → LOOK with the normal hosted smoke. That receipt covers the parent run-owned demo, and the current receiving draft has its own CI and native proof. No production activation or broader roster rollout was introduced.

The old branch remains because open #2848 targets it. The exact source is also available via refs/pull/2898/head.

@benhook1013
benhook1013 deleted the codex/unit-1a-join-player-stage-prep branch November 30, 2026 06:57
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.

1 participant