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
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ The response echoes the exact request scope and includes `CURRENT_AT_REVALIDATIO

The handler returns `PERMISSION_DENIED` for a caller that is not the exact verified workload peer, `INVALID_ARGUMENT` for malformed scope or request shape, and `FAILED_PRECONDITION` when current owner evidence is absent or contradictory. Account source unavailability maps to `UNAVAILABLE`; other read or evidence-production failures map to `INTERNAL`. No partial evidence is returned on failure.

### Canonical public-production NEW admission lease source

The local [AccountGameplayAdmissionLeaseService](../../../../protos/account/v1/account_gameplay_admission_lease.proto) carrier prepares the four purpose-specific `AcquireGameplayAdmissionLease`, `FinalizeGameplayAdmissionLease`, `ReadGameplayAdmissionLease` and `AbortGameplayAdmissionLease` methods selected by [canonical session admission](../../system-architecture-session-behavior.md#canonical-public-production-new-admission). The intended peer is the exact same-namespace Game Session workload. Acquisition carries a transient initial LOGIN GSA credential and typed expected candidate/target values; those values remain comparisons against independently resolved current owners. Finalize, Read and Abort carry the complete unchanged original canonical lease bytes. Abort's absent decision remains unknown, and its cleanup reference represents an outstanding obligation. The expected candidate’s `issuer_id` is the exact Account issuer string; the manual authenticated owner joins it to the independently verified token and current issuer source/checkpoint, rather than accepting an equal generation as issuer identity.

The shared codec preserves the existing 64 KiB lease and 15-second lifetime bounds, closed presence-aware fields, exact operation and binding-scope correlation, and the complete original ACK-receipt shape for a committed readback. Parsing that shape proves neither authentication nor physical commit or receipt durability. The local source now includes a concrete authenticated lease owner and a same-namespace certificate-guarded manual receiver/server factory; it remains unregistered. Focused Account-source and manual TLS proof cover acquisition and first fresh finalization/ACK with controlled reverse Game Session responses. Exact non-admitting read/abort and retained terminal lookup revalidate the current caller/global Account/token while preserving the original lease; tenant-source changes do not authorize new admission or erase the cleanup obligation. Retained PostgreSQL-version restrictions, token-retirement and orphan-cleanup delivery, actual Game Session authority and admitted `PLAY`/`LOOK` remain unqualified. Account must use the existing original physical-commit and independently durable receipt owners; wire evidence cannot reconstruct their in-process acknowledgement. Local source and proof status remain in [Account runtime and data](./runtime-and-data.md#implementation-status).

### Operator Authorization References

StartSession response recovery preserves the raw `firemud/account-response-envelope/aad/v1` grammar and authenticates the canonical authority-evidence bytes directly; no digest replaces those bytes. The authority bundle is bounded at 128 KiB, the complete canonical binding and exact response plaintext at 144 KiB each, and the AES-GCM envelope by that plaintext maximum plus its bounded header and tag. Repository and PostgreSQL storage allow at most 160 KiB. Forward migration [V126.3](../../../../services/account-service/src/main/resources/db/migration/V126.3__start_session_response_envelope_bounds.sql) replaces only the envelope-size guard and leaves retained ciphertext and the existing immutable/erasure rules intact.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Account owns platform identity, hosted Creator Party/operator and terms currentn

## Implementation Status

The caller verifier, lease owner and certificate-guarded four-method receiver remain manually composed and unregistered. Their [lease contract](./api-contracts.md#canonical-public-production-new-admission-lease-source) preserves immutable original attempts and ACKs, with full tenant-source guards for new acquisition and first finalization and the separate current-caller/global-Account/token guards for exact metadata and cleanup recovery. Current-token verification alone grants no admission. Proof still uses controlled reverse Game Session and protected-source inputs; genuine owner composition, token-retirement and cleanup delivery, and admitted binding remain unqualified. [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md#canonical-new-admission-components) owns the implementation and proof details.

The selected-recipient intake source prepares distinct Entity/Automation source reservations and finalized authorizations, retained source-writer exclusion, and exact terminal settlement. Expired preliminary recovery pages use a caller-held `(expiry epoch second, operation UUID)` keyset cursor that advances across every examined row, including invalid rows and candidates whose abort does not commit; a caller continues while a cursor is returned and starts a fresh sweep only after an empty page. Prepared final authorization and terminal migrations V1008–V1010 follow the actual V1006 activation-alignment and V1007 source-disclosure parent, including Saga V1000–V1002, while preserving prior protection/disposal guards. These components remain unregistered and unqualified; the [recipient-intake tracker](../../../project-management/implementation-tracking/player-access-and-session.md#selected-recipient-source-intake-preparation) owns current proof, qualification limits and remaining dependencies.

The additive [V1003 source-protection storage](../../../../services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql) provides passive original StartSession admission and activation protection relations and source-writer exclusions. It adds no registered producer or transport. Qualification and remaining composition gates are recorded in the [source-protection tracker](../../../project-management/implementation-tracking/player-access-and-session.md#original-startsession-source-protection-storage).
Expand Down
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

The local [canonical NEW admission lease contract](../../system-architecture-session-behavior.md#canonical-public-production-new-admission) now has generated transport carriers and a manually composed `AccountGameplayAdmissionLeaseClient` for Account’s four purpose-specific methods. Its narrow candidate uses the exact Account issuer string at the original string wire tag; shape validation supplies no issuer authority. The [Account API](../account-service/api-contracts.md#canonical-public-production-new-admission-lease-source) owns caller authentication, acquisition, original finalization and read/abort recovery. The prepared Account-only reverse-read proto and closed codec preserve separate current published-target and exact provisional-decision purposes, with their finite transport bounds; this prerequisite does not supply their genuine Game Session owner composition or register a source receiver. The Account receiver’s focused physical-COMMIT and durable-ACK proof uses explicitly controlled reverse responses. These local components do not acknowledge issuer/region obligations or admit a binding; the [Player Access tracker](../../../project-management/implementation-tracking/player-access-and-session.md#canonical-new-admission-components) records component proof and remaining composition.

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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ The service runtime model assumes replaceable workers, not authoritative in-proc

The sections below define the target-state runtime contract. Current implementation and proof status is:

- **Local NEW issuer identity:** canonical inventory retains Account's exact issuer string, and typed reads refuse retained UUID issuers rather than relabel them. This storage boundary does not establish issuer ownership, complete coverage, or admission; see [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md#canonical-new-admission-components) for migration proof and limits.

- **Local NEW account-member repair:** the unregistered owner prepares the original binding-local operation, performs one global account-member write and physical readback outside SQL, then accepts its exact acknowledgement in SQL. This supplies `ADD_OR_RETAIN` evidence only; the candidate remains provisional. Account-wide lifecycle writers, remaining index and region acknowledgements, and the guarded final admission CAS remain open. See [Session Behavior](../../system-architecture-session-behavior.md#global-account-active-binding-index) and [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md#canonical-new-admission-components).

- **Account-fence intent and CLOSED target preparation:** local sources persist account acquisition intent and cohort, tenant-to-gameplay-tag mapping, protected current observations, a one-key CLOSED installer/readback, and immutable per-target receipts. A receipt is historical AS-OF evidence; targets remain `REQUIRED`. Operational protected-incarnation authority, all-target `INSTALLED`, barrier `OPEN`, token release, final admitting CAS, and production admission remain unproved. See [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md#canonical-new-admission-components) for proof attribution and limits.

- **Current first-party receiving boundary:** Game Session's prepared receiver verifies the Gateway-signed context and rechecks the canonical target and retained private-handle evidence. When that first-party context is present, bare `LOGIN` and `PLAY` return `FIRST_PARTY_AUTHORITY_UNAVAILABLE` before legacy Account authentication, Entity resolution, or gameplay binding effects. Recovery from registry loss still requires the persisted compact JWS to remain valid; registry loss does not extend its expiry. The public Gateway cookie path is currently denied and its gameplay-route readiness is `OUT_OF_SERVICE`; no first-party wire success or admission is claimed. Account context production, shared replay fencing, and dedicated Gateway key qualification remain open.

- Canonical authored-world launch preparation is an evidence-only source boundary: it checks committed catalog/source evidence, performs authenticated Game Design resolve plus independent exact descriptor readback, persists the immutable preparation snapshot, and verifies committed readback. It is not wired into GameInstanceServiceImpl, game_instances, World activation, admission, or PLAY; validation of this new proof family is deferred.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Every coordination script belongs to a **script category** that constrains which
| Entity lock | `tick:{tenantRegionTag}:lock:<entityId>` | A lock-acquiring invocation touches at most one entity-lock key. Multi-entity commands use owning transactions or durable effect legs rather than multi-lock Lua. |
| Tick staging / pending | `tick:{tenantRegionTag}:pending` and related effect structures | Single-key or shard-local multi-key scripts that operate entirely within one `{tenantRegionTag}` slot. |
| Timers and retries | `timer:{tenantRegionTag}`, `retry:{tenantRegionTag}` | Shard-local scripts operating on keys that share the same `{tenantRegionTag}`; no cross-slot operations. |
| Gameplay session CAS / bindings | `session:game:{tenantGameplayTag}:<gameInstanceId>:<sessionId>` plus tenant-tagged `session:game:index:*:{tenantGameplayTag}:*` | Gameplay session CAS/update scripts may be shard-local multi-key scripts where all gameplay-session keys share `{tenantGameplayTag}`. They own gameplay binding and reconnect state only; they do not operate on Account auth-token registry keys, tick keys, or the global account index in the same invocation. |
| Gameplay session CAS / bindings | `session:game:{tenantGameplayTag}:<gameInstanceId>:<sessionId>`, tenant-tagged `session:game:index:*:{tenantGameplayTag}:*`, and `session:game:account-admission:{tenantGameplayTag}:<accountId>:<playableStateNamespaceId>` | Gameplay session CAS/update scripts may be shard-local multi-key scripts where all gameplay-session keys share `{tenantGameplayTag}`. The final binding CAS checks the exact account-qualified barrier in that slot. These scripts do not operate on Account auth-token registry keys, tick keys, or the untagged global account index/control key in the same invocation. |
| Cross-tenant gameplay-session account index | `session:game:index:account:<accountId>` | This global account index cannot share every tenant gameplay slot and is never included in a shard-local gameplay CAS/Lua invocation. Game Session updates it through a separate idempotent write after the owning gameplay-session mutation and reconciles it from authoritative session bindings. Account-wide revocation uses the index as a discovery projection but verifies and mutates each tenant-local binding through its owning shard-local contract; missing or stale index entries are repaired rather than treated as authorization truth. |
| Account auth-token registry | `session:auth:token:<tokenHash>` | Account-owned issued-token registry operations are single-key operations for the exact token hash. The exact-token registry record is mandatory validity and per-token-revocation authority: a cryptographically valid JWT without a matching permitted record is denied, and Lua must not invent validity from absence or from a generation alone. Durable issuer/account/tenant/membership authority generations advance in Account Service; Redis entries project/read through those durable generations for validation, while Lua may enforce the stored record state but never becomes the authority for generation advancement. This is not part of gameplay session CAS. |
| Gateway replay admission | `gateway:connect-token:{gateway-connect-token-replay-v1}:readiness`, `gateway:connect-token:{gateway-connect-token-replay-v1}:jti:<jti>`, and `gateway:connect-token:{gateway-connect-token-replay-v1}:deny:jti:<jti>` | The `gateway-connect-token-replay-consume/v1` descriptor is the only three-key descriptor in this category: it runs only on Coordination Redis and receives readiness/fence, replay, and deny keys in that order. The literal `{gateway-connect-token-replay-v1}` hash tag is required on all three keys so Redis Cluster executes the atomic operation in one slot; the readiness value carries `replayAdmissionFence`. The separate `gateway-connect-token-browser-revoke/v1` descriptor is a one-key deny-marker mutation using only `gateway:connect-token:{gateway-connect-token-replay-v1}:deny:jti:<jti>` with the same literal tag; it is not part of this three-key key order. The current generic Cache-bound writer's only untagged output is the replay marker; it has no deny-marker, readiness, or replay-fence writer. That old replay key is migration-only drift and is not a valid descriptor shape. |
Expand Down Expand Up @@ -208,6 +208,8 @@ Session scripts operate only on gameplay session keys that share one `{tenantGam
- `session:game:index:tenant:{tenantGameplayTag}`
- `session:game:index:realm-grant:{tenantGameplayTag}:<grantScopeId>` when the binding is private/playtest grant-gated, where `grantScopeId` is the exact canonical `grant/v1` scope ID for the complete Account-owned tuple

The final binding CAS additionally reads `session:game:account-admission:{tenantGameplayTag}:<accountId>:<playableStateNamespaceId>` as a checked key in the same gameplay slot; it never mutates that barrier. The separate one-key CLOSED installer owns its mutation, under the [account-admission barrier contract](./system-architecture-session-behavior.md#global-account-active-binding-index). The global account index remains excluded from this invocation.

`session:game:index:account-tenant:{tenantGameplayTag}:<accountId>` is the canonical tenant-scoped account index key. It must not be shortened to `session:game:index:account:<accountId>`; that is a separate cross-tenant discovery index and is never part of a shard-local Lua invocation.

The lifecycle-qualified realm-grant key is enabled only through the [canonical versioned `grant/v1` direct cutover and shared index-key builder](./system-architecture-redis.md#canonical-grant-authority-stream-scope-codec). Lua callers receive the fully built key and never normalize or concatenate selector fields independently. This Lua-local consequence requires an immutable Account v1 grant inventory and checkpoint: affected Account grant mutations and inventory changes remain fenced while Game Session rebuilds the complete expected key set from that exact inventory/checkpoint and reads back the rebuilt v1 key/index set before activation. During enumeration, build, exact readback, and activation, affected legacy grant producers and consumers, runtime/index readers, and every non-migration grant-index writer remain quiesced or fenced; only the migration operation may write unless an atomic switch of all writers is proven. Readers never dual-read or fall back to the legacy key; legacy entries remain non-authoritative until post-activation proof permits their removal. An incomplete rebuild, concurrent non-migration write, unexpected legacy entry, crash, or contradictory readback keeps the affected scope fenced and resumes the same migration operation. Focused proof reuses the codec's canonical round-trip, malformed-input, tuple-distinctness, and collision-resistance vectors and demonstrates that every session writer, reader, Lua caller, reconciler, and reset path receives the same helper-built key rather than introducing a second key grammar.
Expand Down
Loading
Loading