Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Target state makes Game Session the authoritative owner of region/tick coordinat

## Implementation Status

Closed created-receipt wire checks and mandatory bounded production server registration are present. Created selection persistence, Entity client and owner-retirement composition remain separate implementation work. The transport foundation does not enable the created owner or establish player admission.

The initial-LOGIN PostgreSQL journal and exact original-attempt cleanup owner are unregistered source preparation, with no new Game Session endpoint or legacy LOGIN handler composition. Their unregistered Account client authenticates the exact same-namespace Account mTLS peer and validates the explicit initial delegation profile, signature, original request/context, token hash, claim/projection equality and bounded nonsecret evidence. Its one transient invocation permits at most one transport reload/retry under the unchanged deadline. It also uses the original-request retirement contract. The result retains compact private-token bytes only in process; validation supplies neither current registry authority nor live context installation. Journal snapshots and typed closure fixtures supply no authenticated caller custody or physical Redis closure; the separate Redis adapter remains outside runtime composition. See the [canonical coordination contract](../../system-architecture-jwt-and-token-contracts.md#game-session-original-attempt-coordination) and [implementation tracker](../../../project-management/implementation-tracking/player-access-and-session.md#initial-private-gameplay-login-issuance-source-intake).

The source-first owner stage consumes the closed Game Design creation/source receipt, four immutable launch snapshots and policy seal through the trusted fixed capability parser. `RunOwnedCanonicalLaunchPreparationOwner` exposes canonical fresh-association, catalog and `STARTING` creation with independent owner readback only through an explicit preparation call; it has no scheduler. The published `RunOwnedInitialAdmissionFixtureCoordinator` bootstrap and existing `GameInstanceServiceImpl` behavior remain until coherent canonical adoption, so this source-first path is not evidence that the current scheduled runtime allocates that canonical launch. Game Design source keys and Game Session's allocated private tenant/runtime keys remain separate. The published numeric fixture path has not been removed by this source-only split. This explicit canonical path establishes no canonical World materialization/activation, canonical first-`OPEN`, or canonical admission result.
Expand Down Expand Up @@ -102,6 +104,12 @@ Entity reserves a local admission nonce before its owner RPC, binds its snapshot

Entity durably records that authenticated response before confirming delivery. Confirmation is bound to the same request and receipt. A confirmation repeated after qualified compact-receipt cleanup is only a no-op and cannot create acknowledgement or release authority. Required inventory, finite receipt retention, pending-transfer protection and owner-local cleanup belong to [Game Session runtime/data](./runtime-and-data.md#canonical-roster-selection-and-reference-ownership); Entity's local atomic observation and outbox rules belong to [sealed roster retention](../entity-management-service/runtime-and-data.md#sealed-canonical-roster-retention). Both transfer handlers retain the existing unregistered original-reference owner dependency and do not enable admission or production activation.

#### Player-created original roster consequences

Game Session consumes Entity's distinct [player-created roster and selected-character contract](../entity-management-service/api-contracts.md#player-created-roster-and-selected-character) only after independently resolving the current published `PLAYER_CREATED` source and matching the complete route, policy, descriptor and source identity. It retains the exact typed created-roster and selected-character receipts on the original operation, preserves the original menu and ordinal/frozen actor choice, and revalidates the current route around owner reads. Original-operation reservation, returned-roster qualification and selected-reference qualification require independent current published-source observations, including their Game Design, World and published-policy evidence. An earlier observation cannot be cached across those authority boundaries to remove their freshness checks. These receipts provide no membership, session-binding or gameplay-admission authority. The two created roster and selected-character client RPCs use a finite twenty-second outer deadline so the nested five-second current-source and ten-second original-owner calls retain their bounded budgets under the inherited gRPC context. Request and response validation outside those calls remains part of the caller operation; this deadline is not a production latency guarantee. The existing preseeded route remains a separate strict branch; a Common parser validates values without establishing authenticated custody.

The created reference response retains the complete selected payload within its 194 MiB purpose envelope, and retirement-observation requests retain it within the 195 MiB created-ACK envelope with bounded confirmation overhead. Recovery retains only the exact typed created-roster receipt within its existing recovery purpose bound. These purpose-specific limits preserve complete owner bytes and the existing preseeded bounds. The shared server transport retains the framework 4 MiB deframing default. The existing `spring.grpc.server.max-inbound-message-size` setting may explicitly select a different positive finite ceiling no larger than the closed policy maximum for the created-retirement confirmation envelope; the policy maximum does not automatically enlarge the deployment limit. A deployment using the default rejects larger requests even on the two eligible created-retirement methods. Mandatory request marshalling at the canonical server-registration boundary checks the raw uncompressed request length before invoking any protobuf parser: only the exact generated acknowledgement and confirmation method descriptors receive their existing purpose bounds; every other method, including future or unlisted methods, retains the 4 MiB default or a smaller owning bound. Caller metadata cannot select a larger budget. Missing or duplicate admission configuration and unwrapped service registration fail closed. Semantic policy bounds, response bounds and workload authentication remain independent checks. When explicitly configured above the default, the shared transport can buffer more than 4 MiB before method admission rejects a request; method admission does not establish a 4 MiB network-memory ceiling. Before live created-owner activation, that larger configured mode requires production resource, concurrent-request memory and latency qualification. Controlled large-payload proof does not establish production capacity or select a per-connection concurrency budget. The corresponding local storage consequences belong to [Runtime and Data](./runtime-and-data.md#canonical-roster-selection-and-reference-ownership).

#### Canonical gameplay roster owner read

The internal `CanonicalGameplayRosterOwnerReadService.GetCanonicalGameplayRosterOwnerRead` method is an Entity-only point-in-time source read. It requires the exact same-namespace Entity Management mTLS workload and no authenticated caller context; the request retains its exact caller-observed pointer-version and World-epoch preconditions. The route-reader composition is disabled unless `firemud.canonical-gameplay-roster-owner-read.enabled=true`; the bearer-check allowlist does not enable its source beans. The read returns source evidence only and does not create actors, bind sessions, or activate `PLAY` or `LOOK`.
Expand Down
15 changes: 13 additions & 2 deletions dev-tools/tests/test_telnet_session_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,13 +1031,24 @@ def handler(connection):
session.connect()
session.send_command("SAY \u00ff")
session.send_command(f"LOGIN demo@example.com {secret}")
wait_for(
records = wait_for(
session.store,
lambda rows: any(
row.get("text") == "LOGIN demo@example.com [REDACTED]"
row.get("direction") == "inbound"
and row.get("event") == "received"
and row.get("text") == "LOGIN demo@example.com [REDACTED]\r\n"
for row in rows
),
)
self.assertTrue(
any(
row.get("direction") == "outbound"
and row.get("event") == "command"
and row.get("text") == "LOGIN demo@example.com [REDACTED]"
for row in records
),
"the local command marker must not satisfy the inbound echo wait",
)
session.close("iac_escape_complete")
server.close_and_check()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ message CanonicalGameplayRosterRecoveryResponse {
string target_fence_uuid = 5;
// Exact locally retained original receipt, if capture won before nonce closure. Absence is
// positive fenced no-capture evidence only in this authenticated closed-admission response.
// PRESEEDED_ONLY; mutually exclusive with the distinct PLAYER_CREATED receipt.
bytes canonical_roster_receipt = 6;
bytes canonical_player_created_roster_receipt = 7;
}
65 changes: 60 additions & 5 deletions protos/entity-management/v1/entity_management_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package entity_management.v1;
import "shared/v1/errors.proto";
import "shared/v1/instance_refs.proto";
import "shared/v1/player_execution_context.proto";
import "entity-management/v1/entity_character_create_service.proto";

option java_package = "net.firedevops.firemud.entitymanagement.v1";
option java_multiple_files = true;
Expand Down Expand Up @@ -37,11 +38,12 @@ service EntityManagementService {
returns (ValidateEntityUpgradeMappingsResponse);
}

// Canonical gameplay roster discovery is a pre-admission, non-admitting boundary. Both methods
// are restricted to PRESEEDED_ONLY; other policy values are non-authorizing and fail with
// FAILED_PRECONDITION. This wire contract does not authorize the legacy numeric
// ListCharactersByAccount RPC for canonical gameplay. A valid ListPreseededRoster response may
// contain zero actors; that is a successful lookup. These RPCs use canonical non-OK gRPC statuses
// Canonical gameplay roster discovery is a pre-admission, non-admitting boundary. The two
// preseeded methods below remain restricted to PRESEEDED_ONLY; other policy values are
// non-authorizing and fail with FAILED_PRECONDITION. The PLAYER_CREATED methods are a separate
// source-bound read contract and do not authenticate their unsigned context or authorize the
// legacy numeric ListCharactersByAccount RPC for canonical gameplay. A valid ListPreseededRoster
// response may contain zero actors; that is a successful lookup. These RPCs use canonical non-OK gRPC statuses
// rather than in-response errors: malformed requests are INVALID_ARGUMENT, stale snapshots or
// selections not present in the bound snapshot are FAILED_PRECONDITION, unauthorized callers are
// UNAUTHENTICATED or PERMISSION_DENIED as applicable, and unavailable dependencies are
Expand All @@ -67,6 +69,59 @@ service CanonicalGameplayRosterService {
// selected_character_uuid. The target policy must be PRESEEDED_ONLY.
rpc ReadSelectedPreseededAssignment(CanonicalGameplayRosterSelectedAssignmentRequest)
returns (CanonicalGameplayRosterSelectedAssignmentResponse);

// Reads the source-bound persisted PLAYER_CREATED roster. The unsigned execution context is
// equality evidence only; peer authentication remains a server responsibility.
rpc ListPlayerCreatedRoster(CanonicalPlayerCreatedRosterRequest)
returns (CanonicalPlayerCreatedRosterResponse);
// Reads the exact selected actor from the original source-bound snapshot and returns the
// persisted creation terminal. This carrier does not authenticate that terminal.
rpc ReadSelectedPlayerCreatedCharacter(CanonicalSelectedPlayerCreatedCharacterRequest)
returns (CanonicalSelectedPlayerCreatedCharacterResponse);
}

message CanonicalPlayerCreatedRosterSourceIdentity {
uint32 schema_version = 1;
string descriptor_uuid = 2;
string descriptor_revision_uuid = 3;
string descriptor_digest = 4;
string authored_binding_uuid = 5;
string authored_binding_digest = 6;
}

message CanonicalPlayerCreatedRosterRequest {
string request_uuid = 1;
string canonical_account_uuid = 2;
CanonicalGameplayRosterTarget expected_target = 3;
shared.v1.PlayerExecutionContext player_execution_context = 4;
CanonicalPlayerCreatedRosterSourceIdentity expected_source = 5;
}

message CanonicalPlayerCreatedRosterResponse {
CanonicalGameplayRosterResponse roster = 1;
CanonicalPlayerCreatedRosterSourceIdentity source_identity = 2;
}

message CanonicalSelectedPlayerCreatedCharacterRequest {
string request_uuid = 1;
string canonical_account_uuid = 2;
string selected_character_uuid = 3;
CanonicalGameplayRosterTarget expected_target = 4;
CanonicalGameplayRosterSnapshotReference expected_snapshot = 5;
shared.v1.PlayerExecutionContext player_execution_context = 6;
CanonicalPlayerCreatedRosterSourceIdentity expected_source = 7;
}

message CanonicalSelectedPlayerCreatedCharacterResponse {
string request_uuid = 1;
string canonical_account_uuid = 2;
string selected_character_uuid = 3;
CanonicalGameplayRosterTarget target = 4;
CanonicalGameplayRosterSnapshotReference snapshot = 5;
CanonicalPlayerCreatedRosterSourceIdentity source_identity = 6;
string creation_operation_uuid = 7;
string mutation_digest = 8;
EntityCharacterCreateTerminal terminal = 9;
}

message CanonicalGameplayRosterRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ message GetCanonicalGameplayRosterReferenceRequest {
string session_uuid = 4;
string target_namespace = 5;
bytes canonical_target = 6;
// Canonical CanonicalPlayerCreatedRosterSourceIdentity bytes, required only for PLAYER_CREATED.
bytes canonical_player_created_source_identity = 7;
}

enum CanonicalGameplayRosterReferenceState {
Expand All @@ -116,6 +118,7 @@ message GetCanonicalGameplayRosterReferenceResponse {
CanonicalGameplayRosterReferenceState state = 3;
// Canonical Entity snapshot response bytes, present only after receipt binding. Recording a
// receipt does not release its retained selection/session/recovery/restore dependencies.
// PRESEEDED_ONLY receipt; mutually exclusive with the PLAYER_CREATED carrier below.
bytes canonical_roster_receipt = 4;
CanonicalGameplayRosterSelectionInput selection_input = 5;
string selected_character_uuid = 6;
Expand All @@ -130,6 +133,10 @@ message GetCanonicalGameplayRosterReferenceResponse {
string retirement_proof_digest = 15;
// Owner-local recovery fence: normal reads/writes cannot restart this original operation.
string recovery_uuid = 16;
// Canonical typed PLAYER_CREATED roster and selected original creation terminal receipts.
// PRESEEDED_ONLY roster/assignment fields must be absent for this distinct policy branch.
bytes canonical_player_created_roster_receipt = 17;
bytes canonical_selected_player_created_character_receipt = 18;
}

// Original selection input is frozen before any Entity roster read. A later ordinal choice is a
Expand Down
2 changes: 2 additions & 0 deletions services/common-platform-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ dependencies {
testFixturesApi(platform(libs.spring.boot.dependencies))
testFixturesApi("tools.jackson.core:jackson-databind")
testFixturesApi(libs.grpc.stub)
testFixturesApi(libs.protobuf.java)
testFixturesCompileOnly(libs.spotbugs.annotations)
}
Loading
Loading