Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ jobs:
--require-suite integration.net.firedevops.firemud.gamedesign.repository.GameTenantCreationRepositoryIntegrationTest \
--require-case 'integration.net.firedevops.firemud.gamedesign.repository.GameTenantCreationRepositoryIntegrationTest#createCandidateExactRetryReturnsCommittedReceiptWithoutSecondGameWrite()' \
--require-case 'integration.net.firedevops.firemud.gamedesign.repository.GameTenantCreationRepositoryIntegrationTest#concurrentDuplicateCreationRequestsConvergeOnOneUuidAndReceipt()' \
--require-case 'integration.net.firedevops.firemud.gamedesign.repository.GameTenantCreationRepositoryIntegrationTest#runtimeIdentityLookupReadsOnlyExactNewAndRetainedGameDesignRows()' \
game-design-service

- name: Verify Account fresh UUID pair and snapshot PostgreSQL proof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ For REST endpoints, the authoritative request/response schema source is [openapi

Game Design is the canonical issuer of opaque UUID `tenantId` values and the owner of stable `tenantSlug` selectors under [Multi-Tenancy](../../system-architecture-multi-tenancy.md#canonical-identity-and-retained-key-bridge). A retained Game Design game row may receive a UUID with exact owner-local provenance naming its row and former `game.tenant_id`; that binding is immutable and read back exactly. A newly created tenant receives a fresh persisted UUID rather than a numeric-key conversion. Selector assignment is explicit and unique; a game name, row key, former tenant string, or guessed slug is not a selector. Resolving a selector requires the current authoritative binding and does not authorize the caller by itself.

The fresh-tenant Account handoff is distinct from both retained-key reads below. Game Design must durably bind the exact creation request to its issued UUID and return authenticated operation-bound creation/readback evidence to Account under the [canonical identity contract](../../system-architecture-multi-tenancy.md#canonical-identity-and-retained-key-bridge). The smoke seeder and a legacy-manifest read do not supply this handoff. The selected owner-local operation/readback contract is specified below; its source/RPC boundary has earlier unit-level evidence, while the #2915 Account-consumer extension remains in progress and has no passing database proof. No production creation caller or Account handoff is enabled.
The fresh-tenant Account handoff is distinct from both retained-key reads below. Game Design must durably bind the exact creation request to its issued UUID and return authenticated operation-bound creation/readback evidence to Account under the [canonical identity contract](../../system-architecture-multi-tenancy.md#canonical-identity-and-retained-key-bridge). The smoke seeder and a legacy-manifest read do not supply this handoff. The owner-local operation/readback contract is specified below; executed database component proof and the remaining product-caller and live handoff gates are recorded in [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md). No production creation caller or Account handoff is enabled.

The separate `TenantIdentityService.ResolveLegacyGameTenantIdentity` read is limited to the verified Account workload peer. It accepts only an exact former Game Design tenant key and returns the persisted UUID, source key, source game row, and provenance kind together. A missing source returns `NOT_FOUND`; malformed input, missing peer, changed provenance, and ambiguous owner data fail closed before returning content. This read does **not** attest that an Account-retained numeric tenant key has the same identity as a numerically similar Game Design key. The separate `ResolveLegacyAccountTenantAssociation` read returns that cross-owner association only when a signed, owner-approved migration manifest has been applied and its exact source tuple still reads back. It is limited to the verified, same-namespace `account-tenant-migrator` workload identity; ordinary Account and other service peers are denied. It returns the immutable operation, approval, signature, digest, and retained-source evidence with the mapping, and denies absent or contradictory rows. Account's own retained-row verification and mapping readback are still required before it may use the UUID, and neither read itself grants membership admission. The [multi-tenancy identity bridge](../../system-architecture-multi-tenancy.md#canonical-identity-and-retained-key-bridge) owns the target contract; [Game Design operations](./operations.md#legacy-tenant-association-migration) records the controlled migration sequence and current proof limits.

**Implementation status:** Current Game Design data does not include a stable tenant slug or a proved cross-owner Account legacy-key association, and no current player-facing selector resolution is claimed. The selected fresh-tenant source/RPC boundary has earlier unit-level evidence, but the #2915 Account-consumer extension has no passing database proof: its strict seven-case producer/readback suite executed with all seven failing after Flyway because the expected `game` and creation-operation relations were not found. The test-datasource correction described below is not yet validated. The owner-local UUID source/read remains a bounded prerequisite; neither it nor the candidate handoff makes the Account runtime membership snapshot RPC safe to enable. Hosted PostgreSQL, live caller/consumer, retained-row migration, mounted-certificate acceptance, and Account/Game Session proof remain separate gates.
**Implementation status:** Current Game Design data does not include a stable tenant slug or a proved deployed cross-owner Account legacy-key association, and no current player-facing selector resolution is claimed. The fresh-creation and Account-association components have executed PostgreSQL proof, separately scoped in [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md); that does not prove a live product caller or deployed handoff. The Game Session tenant-source read and consumer remain a candidate, not catalog enrollment or admission. Retained-row migration, mounted-certificate acceptance, full Account/Game Session authority and live caller/consumer proof remain separate gates; the membership RPC and credential paths remain disabled.

### Runtime tenant identity read for Game Session

`TenantIdentityService.ResolveRuntimeTenantIdentity` supplies Game Design's persisted tenant identity to Game Session, which remains the [sole runtime realm-catalog and admission-pointer resolver/persister](../game-session-service/api-contracts.md#world-lifecycle-and-admission-boundary). This read neither creates a tenant nor allocates or changes a realm, namespace, catalog or pointer. It does not replace Account's creation-operation readback or the approved retained Account association.

The request carries canonical non-nil UUIDs `canonical_tenant_id` and `request_id`. The closed version-1 response carries `schema_version`, `target_namespace`, the exact `request_id` and `canonical_tenant_id`, positive `source_game_row_id`, exact `source_game_tenant_key` and `provenance_kind` (`NEW_GAME_ROW` or `RETAINED_GAME_V30`). The source key and row are private Game Design provenance, not selectors or assertions about any Account or Game Session numeric key. The repository uniquely reads the actual canonical-UUID row and verifies its provenance against that same row and source key; missing, ambiguous, changed or contradictory identity fails closed without mutation.

Only the verified peer `spiffe://firemud/ns/{configured_namespace}/sa/game-session-service` may read this method. The exact peer check precedes data access, and any bearer bypass is limited to this method; a JWT service claim, another workload or another namespace cannot substitute. Existing Account-only creation and migration method guards are unchanged. The Game Session consumer requires file-backed workload mTLS, validates the closed evidence and exact namespace/request/tenant echoes, and rejects aliases or incomplete evidence before using it. This proves owner identity provenance only, not a membership grant, Account authority, World lifecycle, selected-target readiness or admission. Runtime catalog intake must separately persist and read back the association at Game Session's owner boundary; missing provenance and unmapped retained runtime rows remain denied rather than deriving UUIDs from numeric IDs.

**Runtime tenant-read proof:** Exact #2920 `728a0dd09982506e801e21f6154bec420548984a` [CI 36812079812](https://github.com/benhook1013/FireMUD/actions/runs/36812079812) executed and passed all eight creation/runtime-source PostgreSQL cases without skips, including exact fresh/retained lookup after real migration and no-mutation readback. This is owner database proof, not a deployed Game Session client, retained Game Session association, authored-world enrollment or catalog activation; remaining proof belongs to [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md).

### Fresh tenant creation operation and Account readback

**Selected target contract; local source/RPC unit proof complete, database proof pending.** This owner-local prerequisite binds a fresh Game Design-issued UUID to a stable creation request and exposes only authenticated readback to Account. It is not a tenant-creation API, product caller, selector-registration path, Account enrollment, membership grant, or runtime activation. The internal producer candidate is not a protected product creator; it must not change smoke-seeder behavior or bypass the official-hosted creator gate in [ADR 0180](../../decisions/adr-0180-account-owned-hosted-terms-acceptance-gate.md). Any official-hosted creator-intent mutation remains subject to that gate and its current missing implementation/proof.
This owner-local prerequisite binds a fresh Game Design-issued UUID to a stable creation request and exposes only authenticated readback to Account. It is not a tenant-creation API, product caller, selector-registration path, membership grant, or runtime activation. The internal producer candidate is not a protected product creator; it must not change smoke-seeder behavior or bypass the official-hosted creator gate in [ADR 0180](../../decisions/adr-0180-account-owned-hosted-terms-acceptance-gate.md). Any official-hosted creator-intent mutation remains subject to that gate and its current missing implementation/proof.

The owner transaction claims a unique `(target_namespace, creation_request_id)` using a canonical non-nil UUID request identity, computes `request_digest`, creates the row through the existing Game Design repository UUID issuer, and commits one immutable `game_tenant_creation_operations` record with the source row/key and receipt evidence. Migration V32 introduces this storage; the evidence schema version is `1`. There is no committed `PENDING` operation: the game row and complete operation evidence commit atomically. An exact retry returns the same persisted receipt; reuse of the same namespace/request UUID with changed input or source key conflicts without mutation. The operation record retains the immutable creation inputs needed to recompute the request digest; later edits to mutable game name/description do not rewrite creation identity.

Expand All @@ -28,7 +38,7 @@ The receipt digest uses the same framing and encoding rules, with ordered preima

The candidate read-only method is `TenantIdentityService.ResolveFreshTenantCreation`. Its request carries a canonical non-nil `creation_request_id` and mandatory canonical `expected_request_digest`. The response carries exactly `schema_version=1`, `target_namespace`, `creation_request_id`, `operation_id`, `request_digest`, `canonical_tenant_id`, `source_game_row_id`, `source_game_tenant_key`, `provenance_kind=NEW_GAME_ROW`, and `evidence_digest` (the receipt digest). The receiver requires the verified mTLS peer `spiffe://firemud/ns/{target_namespace}/sa/account-service` for the same configured namespace; the bearer/JWT bypass, if needed for this method, is scoped only to this exact RPC and does not relax the peer guard or authorize another method/caller. Missing, ambiguous, changed, or digest-mismatched operation evidence fails closed using standard shared gRPC status errors; no new error enum is introduced.

The focused proof boundary is an owner database producer/readback test that verifies atomic row+operation commit, exact retry, changed-input/source conflict with no second row or mutation, persisted digest recomputation, immutable operation/source/receipt readback, plus RPC positive exact-Account-peer and negative wrong/missing-peer tests. The earlier local Game Design run executed 291 unit cases and discovered 28 integration cases, all skipped without Docker; those results predate the #2915 Account-consumer extension and do not prove its database path. On exact #2915 head `6299ea128e174a5a3f55f3478929f5db71d4eb2f`, [CI run 36791561008](https://github.com/benhook1013/FireMUD/actions/runs/36791561008) executed all seven strict creation-operation database cases and all seven failed after Flyway because the test connection did not select the migrated schema; the concurrent blocking predicate also failed. The diagnosed PostgreSQL JDBC URL issue is that appending `?currentSchema=` to the original `?loggerLevel=OFF` query leaves `currentSchema` unset. The proposed helper fix uses the original URL plus `setSchema` and asserts `current_schema()`, but corrected database proof has not yet run. Account and Game Session strict suites passed in that run, but they are not proof of the failed producer/readback or Account consumer. Account must separately persist its UUID-keyed identity association before membership work, as required by [Multi-Tenancy](../../system-architecture-multi-tenancy.md#canonical-identity-and-retained-key-bridge); this owner proof creates no numeric alias.
The focused proof boundary is an owner database producer/readback test that verifies atomic row+operation commit, exact retry, changed-input/source conflict with no second row or mutation, persisted digest recomputation, immutable operation/source/receipt readback, plus RPC positive exact-Account-peer and negative wrong/missing-peer tests. [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md) owns exact-head execution evidence and incident history. Account must separately persist its UUID-keyed identity association before membership work, as required by [Multi-Tenancy](../../system-architecture-multi-tenancy.md#canonical-identity-and-retained-key-bridge); this owner proof creates no numeric alias. Neither unit tests nor database component execution substitutes for live workload authentication, a protected product creator, or a complete runtime admission handoff.

## Official Hosted Creator Mutation Gate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The sections below define the target-state runtime contract. Current implementat

- The Account membership client rejects noncanonical, nil or numeric Account/tenant selectors before stub/channel use and preserves exact UUID request echoes. This is boundary validation, not Account authorization. The current numeric session/catalog carriers still lack the proved canonical UUID handoff required by the [Identifier Glossary](../../system-architecture-identifier-glossary.md#identifier-format-conventions); numeric stringification cannot satisfy that handoff. The complete signed-context parser, Account runtime RPC and credential producer remain denied; component and runtime proof are tracked in [Player Access](../../../project-management/implementation-tracking/player-access-and-session.md).

- The unwired `GameDesignRuntimeTenantIdentityClient` consumes the separate [Game Design tenant-source read](../game-design-service/api-contracts.md#runtime-tenant-identity-read-for-game-session), requiring file-backed workload mTLS and exact namespace, request and canonical UUID echoes before returning typed provenance. That source read proves neither a retained Game Session numeric-key association nor catalog enrollment, a realm/namespace, a runtime target or admission. Game Session remains the sole persister of its resolved catalog and pointer; canonical UUID intake and propagation into those current numeric carriers remain required before the denied first-party paths can activate.

- The current effective-settings HTTP read is admitted by the service-wide `PRIVILEGED` role requirement, whose shared classifier accepts any global privileged role or any tenant-scoped `tenantAdmin`/`moderator` claim. `EffectiveSettingsController` then trusts query tenant/game selectors and session ids: it can synthesize a requested tenant scope without binding it to the caller's scoped role, or resolve a persisted session without checking that its tenant is authorized by the caller. The current controller/integration tests do not prove denial of a tenant-A caller reading tenant-B settings.
- **Target effective-settings boundary:** keep this as a read-only operator surface but make authorization route-aware. Bind a tenant-scoped role to the exact target tenant and require persisted session tenant ownership/equality; allow a global `platformAdmin` branch to select a tenant only with current operator authorization, target-tenant generation, and `privileged_control`. Reject ambiguous/missing target authority, tenant/session mismatches, and unavailable owner/session evidence before invoking any resolver. The negative proof must cover scoped cross-tenant synthetic and persisted-session reads and the global branch without privileged control.
- Script pin/epoch rollout remains partial: the authoritative `{scriptPatchVersion, scriptPinEpoch, controlPlaneRequestId}` owner read, CAS-backed pin transition, and instance-bound Automation admission epoch validation are live. Local instance-scoped Automation admission, duplicate replay, durable tick staging/replay, and final Game Session execution now compare the complete tuple; the live ledger is still limited to current atomic request/result rows, and bounded rollout-history readback plus complete source/target remote command identity and final-effect fencing remain gaps. See the [canonical runtime-execution owner](../../system-architecture-scripting-runtime-execution.md#normative-target-contract) and the [Game Session runtime and tick coordination tracker](../../../project-management/implementation-tracking/game-session-runtime-and-tick-coordination.md#active-gaps).
Expand Down
Loading
Loading