Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2f2572a
Define non-admitting canonical Entity roster wire contract
benhook1013 Oct 8, 2026
14c03d5
Stack canonical roster wire on published Game Design source foundation
benhook1013 Oct 8, 2026
57953d2
Bind canonical roster selection to immutable snapshot evidence
benhook1013 Oct 8, 2026
b9be392
Bind preseeded roster reads to trusted player context and policy
benhook1013 Oct 8, 2026
a6efc8f
Keep roster selection readback non-authorizing
benhook1013 Oct 8, 2026
32924d7
Define roster selection as original persisted Entity assignment evidence
benhook1013 Oct 8, 2026
777964c
Merge commit '010cbd7668ba96357985e632c66f4d2d9452edb2' into codex/ga…
benhook1013 Oct 8, 2026
bd66aef
Merge commit 'db7a85455' into codex/gameplay-entity-roster-wire-20261009
benhook1013 Oct 8, 2026
582f75d
Merge commit 'd7b0417c0442172bb46fdf6754674c89e90e28d0' into codex/ga…
benhook1013 Oct 8, 2026
d964949
Merge commit '6fd9b420daedbe3a24461d087a1e2a8224ee2cb4' into codex/ga…
benhook1013 Oct 9, 2026
e892ef7
Merge commit '24e291cc1a9020859782e17b151ceb780d3a6d4f' into codex/ga…
benhook1013 Oct 9, 2026
f06fc01
Merge commit '04e403da9d07a0cae264b534e5c13f032f0b18fd' into codex/ga…
benhook1013 Oct 9, 2026
348c0a1
Merge commit '3d88652c1b16b655bb4bd2d7c4f311fc5e830c43' into codex/ga…
benhook1013 Oct 9, 2026
ce134c3
Merge commit '58643bc90764bbd1b32735bc7f7c4369b12f06e6' into codex/ga…
benhook1013 Oct 9, 2026
8328b0a
Merge commit 'e764f85eb' into codex/gameplay-entity-roster-wire-20261009
benhook1013 Oct 9, 2026
7bc6496
Merge commit '74b43902bf3efe6c9e0af046ee3baa1c29d8eec0' into codex/ga…
benhook1013 Oct 9, 2026
121ec90
Merge commit '7af572b66' into codex/gameplay-entity-roster-wire-20261009
benhook1013 Oct 9, 2026
1e27696
Merge commit '1149fda52' into codex/gameplay-entity-roster-wire-20261009
benhook1013 Oct 9, 2026
bea0741
Reconcile Entity roster wire stage with current policy source parent
benhook1013 Oct 11, 2026
efdf1bd
Merge commit '902ba9c58407208949e6362352b578c52a1371d6' into codex/ga…
benhook1013 Oct 11, 2026
9116443
Merge commit '785d084ab0686d44dd3639eb503a5b7267809b78' into codex/ga…
benhook1013 Oct 11, 2026
209b8af
Merge commit '8f3be450e35832343104a5aff6418ba30298c3e6' into codex/ga…
benhook1013 Oct 11, 2026
f6ed212
Merge commit 'e60415bed7' into codex/gameplay-entity-roster-wire-2026…
benhook1013 Oct 11, 2026
de32fef
Merge branch 'codex/gameplay-game-design-policy-source-20261009' into…
benhook1013 Oct 11, 2026
872737c
Merge commit 'a4515e6e6a02100d7d975d5fe776e3cc730bbe62' into codex/ga…
benhook1013 Oct 11, 2026
b4f44f8
Merge commit '90678b8a10071c47f1b2074746fe8f23e207572d' into codex/ga…
benhook1013 Oct 11, 2026
e32040c
Merge commit '1d364053851bcb308ef364ad7d0dad57e11534de' into codex/ga…
benhook1013 Oct 11, 2026
3ae8b07
Merge commit '0081ff62b13a4b32e2478c5a0092b8767da5f2bc' into codex/ga…
benhook1013 Oct 11, 2026
b67be6e
Merge commit '8b61c83db9fd0ea40ec6b315cd1357e0c7509306' into codex/ga…
benhook1013 Oct 11, 2026
3e3e423
Merge commit '252df26ef6bbf995d594ee8dccb8c4f8f8963d89' into codex/ga…
benhook1013 Oct 11, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The authoritative REST schema source lives in [../../../../services/entity-manag

## Implementation Status

The separate `CanonicalGameplayRosterService` proto is a wire contract only; it has no handler or activation in the current stage. Its two methods define pre-admission, non-admitting reads restricted to `PRESEEDED_ONLY`; any other policy value is non-authorizing and returns `FAILED_PRECONDITION`. `ListPreseededRoster` may successfully return zero actors and binds the exact target to its snapshot UUID and digest. `ReadSelectedPreseededAssignment` requires that same typed snapshot reference, echoes the exact request/account/selected-character/target/snapshot bindings, and returns `FAILED_PRECONDITION` if the snapshot is stale or the selected actor is absent from it. It also returns the original non-nil assignment operation UUID and immutable intent digest from the unique matching committed `ASSIGNED` `PRESEEDED_ONLY` `PLAYER` receipt. Entity resolves that receipt only for the exact account, selected actor, complete expected target, current owner counters, and published owner-proof digest; zero or multiple matches disclose no reference, and readback must match the same receipt. The response is persisted owner evidence, not a newly minted identity, an admission grant, or proof that Account eligibility remains current. Both methods require a server-derived typed `PlayerExecutionContext`, the exact same-namespace Game Session mTLS caller allowlist, and equality between context and request/target fields. Context `playable_state_scope` is exactly the text `SHARED` or `ISOLATED` matching the target enum, never numeric enum text. The initial roster read has no selected actor and requires no admitted-character or current-binding proof; the selection read requires `context.character_id` to equal `selected_character_uuid`. The context is unsigned scope data, not a credential, and does not authorize an additional Account lookup solely for the read. Malformed input is `INVALID_ARGUMENT`; authorization failures are `UNAUTHENTICATED` or `PERMISSION_DENIED` as applicable; unavailable dependencies are `UNAVAILABLE`. Failures use non-OK gRPC status with no partial response, not response-level `ErrorDetail`. These semantics do not authorize the legacy numeric `ListCharactersByAccount` RPC for canonical gameplay.

The `ReadSelectedPreseededAssignment` `intent_digest` is the lowercase hexadecimal SHA-256 of Entity's immutable assignment-intent preimage. Entity serializes these UTF-8 string values in this exact order: domain `firemud.entity.preseeded-actor-assignment.v4`; original `assignmentUuid`; `canonicalAccountUuid`; core `actorKind`; core `displayName`; target `canonicalTenantUuid`; `realmUuid`; `worldSlug`; `realmSlug`; `gameInstanceId`; base-10 `catalogRevision`; `canonicalVersionUuid`; `frozenPolicyDigest`; `playableStateNamespaceId`; `publishedReleaseBundleRef`; `playableStateScope`; and `entryPolicy`. UUIDs use canonical `UUID.toString()` form, counters use base-10 decimal text, and scope/policy values use their canonical enum names. Each value is encoded as UTF-8 and prefixed by its byte length as a four-byte big-endian integer; SHA-256 covers the concatenated length-prefixed values. The digest is the original persisted operation-intent digest, not a digest of current owner evidence or current Account state.

The live crafting REST surface is runtime-reachable but is not a tenant-authorized gameplay or design-time boundary: `POST /crafting/recipes` accepts a caller-supplied `tenantId` in `CraftingRecipeDto`, and `GET /crafting/recipes/{id}` accepts only a globally-shaped recipe id. The ping-only authoritative OpenAPI document declares root `security: []`; the crafting handlers and schemas are omitted from that contract. The deployed Entity HTTP interceptor currently requires only an `AUTHENTICATED` bearer (crafting is not in the public-route list), while the controllers do not apply `SessionContext` tenant authorization and the service/repository do not bind either operation to the authenticated caller. The create path can therefore persist a caller-selected tenant (and an existing DTO id can update by id), while the read path performs an ID-only recipe lookup. `CraftingControllerTest` and `CraftingServiceImplTest` cover request/recipe validation and happy-path persistence only; they do not prove unauthenticated denial, tenant-qualified lookup/update, or cross-tenant item ownership. The handlers must remain unsupported/fenced or gain the target caller-bound authorization before they can be treated as a supported route.

The live `CharacterController`, `InventoryController`, `EquipmentController`, and `FriendController` REST handlers are also legacy direct adapters. They remain runtime-reachable behind baseline bearer authentication and their implemented tenant-access checks.
Expand Down Expand Up @@ -39,10 +43,11 @@ curl http://localhost:8080/ping
## gRPC

- `Ping(PingRequest) returns (PingResponse)` – connectivity check defined in `entity_management_service.proto`.
- `CanonicalGameplayRosterService.ListPreseededRoster` and `ReadSelectedPreseededAssignment` – separate target wire contract for the `PRESEEDED_ONLY` pre-admission roster branch. Both carry `shared.v1.PlayerExecutionContext`; its scope string is exactly `SHARED` or `ISOLATED` matching the target enum, never numeric enum text. The first binds the authenticated account/session/request and prospective tenant/realm/namespace/scope/instance target, while the second additionally binds `context.character_id` to the selected UUID and exact roster snapshot. The selection response echoes discovery bindings only; it mints no assignment receipt or admission proof, which remain with the owning downstream write/readback. The exact same-namespace Game Session workload mTLS identity is allowlisted. These reads are not actor admission or a session-binding shortcut, and their proto has no handler or activation yet.
- `CreateCharacter(CreateCharacterRequest) returns (CreateCharacterResponse)` – Entity-owned allocation and persistence of a primary controllable actor after the caller has passed Account membership/grant/realm admission. The target request carries the resolved `{accountId, tenantId, worldSlug, realmSlug}`, stable `playableStateNamespaceId`, the `playableStateScope` supplied only as authoritative realm-snapshot/attestation evidence, active `gameInstanceId`, explicit `entryPolicy=PLAYER_CREATED`, exact published descriptor identity/version, player creation input, and proof of the catalog/admission-pointer snapshot. Entity rejects a missing or mismatched policy before allocation or replay, and cross-checks the policy against the canonical snapshot and the applicable descriptor identity/version. It also carries caller-stable `createCharacterRequestId` and canonical `mutationDigest`; Entity recomputes the digest over the immutable trusted target, `entryPolicy`, exact descriptor/version, and creation input. The durable operation guard key is `{tenantId, playableStateNamespaceId, accountId, createCharacterRequestId}`. Within one local transaction, Entity admits and locks that guard plus digest, serializes the `PLAYER_CREATED` zero-roster boundary on `{tenantId, playableStateNamespaceId, accountId}`, and rereads the roster against the unchanged policy and descriptor/version before allocation. Only a still-empty roster may allocate; concurrent distinct request identities cannot both cross a stale zero-roster observation. Entity then atomically persists the allocated `{accountId, tenantId, playableStateNamespaceId, characterId}` association and replayable response. The same guard and digest exact-replay the original response; the same guard with a different digest returns `IDEMPOTENCY_CONFLICT` before allocation. Callers cannot choose or derive `playableStateScope`; Entity must reject caller-derived evidence and validate the exact immutable namespace/scope pair. A scope change under one namespace is rejected and never creates a second or split actor record. Entity allocates `characterId` only after the operation guard, validates the namespace/scope and active-instance fence, and never derives identity from account/name/hash or delegates character ownership to Account. Durable persistence/keying remains `{tenantId, playableStateNamespaceId, characterId}`; `playableStateScope` remains separately validated immutable routing/authorization evidence, `gameInstanceId` is only the replaceable active-runtime fence, and neither is a durable character-identity dimension. Entity Management does not expose a direct player REST route. The current request path and enforcement do not yet prove this complete target boundary, so it remains an implementation/proof gap rather than a claim about live enforcement.
- `UpdateEntity(UpdateEntityRequest) returns (UpdateEntityResponse)` – updates mutable character state for the requested `{tenantId, playableStateNamespaceId, gameInstanceId, playableStateScope, characterId}` target. `playableStateScope` must be the authoritative realm-snapshot/attestation result; callers cannot choose or derive it, and Entity validates the exact immutable namespace/scope pair before mutation. A caller-selected or changed scope, missing/mismatched namespace or scope, stale snapshot, caller-asserted instance, or global `characterId` is rejected rather than updating or splitting records. Target state also requires a fresh, server-resolved active-instance authorization fence for that exact namespace/scope and instance, checked atomically immediately before mutation. The current request path does not yet carry and prove the complete fresh fence, so it remains an implementation/proof gap and must not be treated as target enforcement.
- `QueryInventory(QueryInventoryRequest) returns (QueryInventoryResponse)` – the current response is an unpaged repeated `InventoryItem items[]` projection. The live handler emits `item_id`, `item_name`, `item_description`, and `quantity`, and conditionally emits `container_instance_id`, `item_instance_id`, and `visible_ref` when those values are present. This projection does not establish complete instance-aware identity or stack/concurrency safety: rich pagination, complete holder-local stack uniqueness, find-then-create concurrency, and explicit-family duplicate handling remain target/proof gaps documented in [Runtime and Data](./runtime-and-data.md#implementation-status).
- `ListCharactersByAccount` (target-state policy/descriptor/template/namespace fields) – returns only persisted actors valid for the trusted account selector and resolved `{tenantId, playableStateNamespaceId, playableStateScope}` target. Entity validates the account-to-character association before returning any roster or visibility result; an account identifier is ownership evidence, not controller identity. The target response includes exactly one published v1 entry policy (`PLAYER_CREATED`, `PRESEEDED_ONLY`, or `AUTO_PROVISIONED`) plus only its policy-applicable versioned identity: a descriptor identity/version for `PLAYER_CREATED`, a template identity/version for `AUTO_PROVISIONED`, and neither descriptor nor template fields for `PRESEEDED_ONLY`; it echoes the resolved namespace/scope. It also returns one immutable roster snapshot identity and digest for the exact target, policy/version, and ordered roster; an exact unchanged snapshot reuses both values, while a roster or policy/version change advances the identity or digest. Callers bind that snapshot for selection and retry and reject a changed snapshot rather than silently selecting a different actor. `gameInstanceId` is a fresh active-runtime fence, not durable lookup identity. Zero, one, and many results are explicit: policy determines the zero-result next action, one may be selected automatically, and many require explicit selection. A roster is discovery evidence, not admission authority. The current proto surface has none of the target policy, descriptor/template, namespace, or roster-snapshot fields and does not prove this boundary.
- `ListCharactersByAccount` (broader target-state policy/descriptor/template/namespace behavior) – the eventual policy-aware roster contract returns only persisted actors valid for the trusted account selector and resolved `{tenantId, playableStateNamespaceId, playableStateScope}` target. Entity validates account-to-character ownership; account identity is ownership evidence, not controller identity. The target response includes the exact published v1 entry policy and only its applicable versioned identity: descriptor/version for `PLAYER_CREATED`, template/version for `AUTO_PROVISIONED`, neither for `PRESEEDED_ONLY`; it echoes namespace/scope and returns an immutable roster snapshot identity/digest for the exact target, policy/version, and ordered roster. `gameInstanceId` is a fresh active-runtime fence, not durable lookup identity. Zero, one, and many results follow policy-specific next actions; a roster is discovery evidence, not admission authority. The separate `CanonicalGameplayRosterService` wire above currently specifies only the `PRESEEDED_ONLY` branch. `PLAYER_CREATED` and `AUTO_PROVISIONED` remain later-owned target branches, and the legacy numeric `ListCharactersByAccount` method is not trusted for canonical gameplay. Current handlers do not prove these target contracts.
- `AutoProvisionCharacter` (target-state) – after explicit entry, idempotently provisions at most one actor from the published realm template using the trusted `{tenantId, accountId, playableStateNamespaceId}` as the at-most-one uniqueness tuple. The request carries explicit `entryPolicy=AUTO_PROVISIONED`, the unchanged discovered-entry object and `discoveredEntryDigest`, the applicable exact template identity/version, a caller-stable `autoProvisionRequestId` that is stable and unique only within that exact `{tenantId, accountId, playableStateNamespaceId}` target scope, canonical `mutationDigest`, and an explicit absent-creation-input marker following ADR 0140's fixed-position presence encoding. Entity rejects a missing or mismatched policy before allocation or replay, and cross-checks it against the canonical snapshot and applicable template identity/version. Entity recomputes the mutation digest over the immutable trusted target, `entryPolicy`, exact template identity/version, and absent-input marker, and durably guards the operation by `{tenantId, accountId, playableStateNamespaceId, autoProvisionRequestId}` separately from the at-most-one-actor constraint; these operation-guard and actor-uniqueness constraints remain distinct. An actor-uniqueness race between distinct request IDs has one winner; each loser transactionally rereads and validates the exact target, policy, template provenance, and digest, durably stores its own guard result, and returns/replays the same actor only on exact match. A loser with mismatched provenance or digest stores a terminal `IDEMPOTENCY_CONFLICT` outcome and never replaces or allocates another actor. `playableStateScope` is only server-validated routing/authorization-fence evidence and is not an alternate key; `gameInstanceId` is the replaceable active-runtime fence. The same target-scoped guard with the same digest exact-replays the persisted actor, including under concurrent delivery; the same scoped guard with a changed digest-bound intent returns `IDEMPOTENCY_CONFLICT` before allocation. A different tenant, account, or namespace selects a different target-scoped guard and must not conflict solely because the text request ID is reused; no global request registry is implied. The current surface and proof are not implemented.
- `QueryActorState` – returns gameplay-attested actor resources and active conditions for a scoped character.
- `ApplyActorCondition` – **target-state request:** applies a gameplay-attested active condition or transient action state for a scoped character. The canonical target request carries a dedicated operation-unique `effectId`, separate source provenance, optional expiry, and the exact release-pinned typed effect declaration/reference and digest resolved by the server-side gameplay path; caller-defined effect JSON is not mutation authority. The target mutation persists the frozen definition/release and its server-resolved typed applied-effect snapshot and digest, never a caller-supplied payload. The current request still accepts transitional `effectPayloadJson`, so this typed-plan/no-caller-payload boundary is not live enforcement yet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ For script transitions, the live boundary includes the exact `scriptPinEpoch` an

Game Session communicates with other platform services exclusively via gRPC for gameplay-domain work. Player-delegated calls carry the typed unsigned `PlayerExecutionContext` defined in the authentication architecture, including the required gameplay scope for admission. Downstream services authenticate the concrete mTLS caller, enforce an exact RPC caller allowlist, validate context/request equality and domain scope, and reject client-supplied identity metadata. Routine gameplay calls do not use signed per-action attestations or a generic replay cache; mutations retain their owning command/effect/request idempotency.

The Entity `CanonicalGameplayRosterService` calls for `PRESEEDED_ONLY` are pre-admission discovery reads, not already-admitted player actions. Game Session supplies a server-derived `PlayerExecutionContext` containing authenticated account, session, request, and the prospective tenant/realm/namespace/scope/instance target, and calls under the exact same-namespace Game Session mTLS identity allowlisted for each method. Entity requires exact context/request/target equality; context `playable_state_scope` is the exact text `SHARED` or `ISOLATED` matching the target enum, never numeric enum text. The initial roster request has no selected actor or admitted-character/current-binding requirement; for `ReadSelectedPreseededAssignment`, `context.character_id` equals `selected_character_uuid`. Its response echoes discovery bindings and returns the original assignment operation UUID and immutable intent digest from Entity's unique matching committed receipt. Game Session binds and reuses that original reference for later owner revalidation; it does not mint an assignment identity or treat the reference as admission proof or current Account eligibility. The unsigned context is scope data, not a credential, and these reads add no Account lookup solely for authorization. This wire currently has no handler or activation, and its policy does not authorize other roster branches or actor admission.

For target gameplay forwarding, `PlayerExecutionContext` carries the server-resolved `{tenantId, playableStateNamespaceId, playableStateScope, gameInstanceId}` binding and, for region-scoped work, its `{regionId, regionEpoch}` fence as one context. Game Session forwards the namespace and scope unchanged and validates exact context/request equality on every downstream response or mutation result; it never accepts a caller-selected namespace or substitutes a current one after admission. The current context/forwarding wire is narrower in places and does not yet carry or prove this complete namespace-plus-fence tuple, so that path remains an implementation/proof gap and must fail closed on missing authority.

It also communicates game lifecycle changes to other microservices over gRPC so they can react to game instances starting, stopping, or changing runtime configuration.
Expand Down
Loading
Loading