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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ Game Design issues each new game row an opaque canonical tenant UUID and keeps e

`GameTenantCreationRepository.createCandidate` is an owner-local transaction primitive, not a tenant-creation API. There is no creation RPC or authenticated creator authority in this slice, so normal creator-facing tenant creation remains unavailable. This boundary must not be used as an admin shortcut, an Account JOIN substitute, or proof that any Account association or runtime admission is enabled.

## Authored-world source evidence and World delivery

Game Design owns the persisted authored-world selector association. `tenantSlug` identifies its tenant selector; `worldSlug` is a separate tenant-scoped selector. Neither a matching slug nor a private numeric row key proves another owner's tenant association. An immutable source registration binds `targetNamespace`, stable `registrationRequestId`, canonical tenant UUID, `tenantSlug`, `worldSlug`, and `worldDisplayName`; its receipt additionally binds the allocated source `operationId`, request digest, exact Game Design row/key provenance, and evidence digest. Exact retries replay that receipt; changed input under the same identity conflicts rather than resolving another source.

`TenantIdentityService.ResolveAuthoredWorldSource` is a read-only lookup for the exact same-namespace Game Session or World Management mTLS peer. Its closed request contains `requestId`, `operationId`, `canonicalTenantId`, and `worldSlug`; IDs are canonical nonnil UUIDs. It returns the complete persisted v1 source receipt and echoes the read identity. Missing, ambiguous, malformed, unknown-field, wrong-peer, wrong-namespace, or mismatched evidence fails closed. `AuthoredWorldSourceDigest` defines separate `game-design-authored-world-source-request/v1` and `game-design-authored-world-source-receipt/v1` SHA-256 domains using the byte-length framing owned by `GameTenantCreationDigest`; consumers validate the complete tuple and digest, not just the selector.

Fresh `NEW_GAME_ROW` source registration commits its immutable delivery claim in the same Game Design transaction. The claim retains a stable World intake identity, complete source evidence, and expected intake digest. An acknowledgement must match the exact authenticated World receipt; retries preserve the original claim and committed result. A retry does not repair a missing historical delivery claim. Retained source associations require their separate audited owner evidence and do not enter this fresh-delivery path. Normal delivery is automatic rather than an operator association step; World owns the receiver and its private association under [authored-world source intake](../world-management-service/api-contracts.md#authored-world-source-intake).

Source registration and delivery are identity prerequisites only: they do not authorize creator mutations, attest a published release, create a Game Session catalog entry, or authorize runtime admission. The [implementation tracker](../../../project-management/implementation-tracking/game-authoring-publishing-and-activation.md#authored-world-source-foundation) records the bounded repository/readback implementation, missing automatic dispatcher and creator-facing wiring, and unexecuted PostgreSQL and runtime proof.

## Official Hosted Creator Mutation Gate

For official hosted deployments, every creator-intent content-bearing mutation enters the Game Design boundary only after the Account-owned currentness/evidence authority in [Account Service API Contracts](../account-service/api-contracts.md#account-owned-hosted-terms-and-creator-party) has been evaluated for the tenant's Creator Party, identified operator, and hosted-terms scope under [ADR 0180](../../decisions/adr-0180-account-owned-hosted-terms-acceptance-gate.md). This applies before the first persisted Draft and before later authoring/revision, asset, template, plugin, and publication writes. The acting account's current tenant authorization is a separate conjunct; Gateway/UI checks are advisory.
Expand Down Expand Up @@ -126,7 +136,7 @@ The Temporal owner-authorization seam is implemented at the receiver boundary: e

The only permitted peer is the verified Game Session workload identity `spiffe://firemud/ns/{namespace}/sa/game-session-service`, where `{namespace}` must exactly match Game Design's configured `FIREMUD_GRPC_WORKLOAD_NAMESPACE`. An empty or invalid configured namespace, absent verified peer identity, another service identity, or a peer from another namespace returns `PERMISSION_DENIED`. JWT claims and request metadata are not peer identity; workload authentication follows [Authentication and Authorization](../../system-architecture-authentication.md).

The shared `AuthTokenInterceptor` configuration exempts exactly the full RPC method names `TenantIdentityService/ResolveRuntimeTenantIdentity`, `TenantIdentityService/ResolveLegacyGameSessionTenantAssociation`, `TenantIdentityService/ResolvePublishedRealmEntryPolicy`, and `TenantIdentityService/ListPublishedRealmEntryPolicies` from bearer-token validation because these are workload-only methods under [ADR 0038](../../decisions/adr-0038-explicit-jwt-profiles-and-mtls-workload-identity.md). This is not public transport exposure: the gRPC listener still requires mTLS, and each handler requires the exact verified workload identity above. No other Game Design RPC is exempted.
The shared `AuthTokenInterceptor` configuration exempts only the explicitly listed full method names for workload-only reads under [ADR 0038](../../decisions/adr-0038-explicit-jwt-profiles-and-mtls-workload-identity.md): `TenantIdentityService/ResolveRuntimeTenantIdentity`, `TenantIdentityService/ResolveLegacyGameSessionTenantAssociation`, `TenantIdentityService/ResolvePublishedRealmEntryPolicy`, `TenantIdentityService/ListPublishedRealmEntryPolicies`, `TenantIdentityService/ResolveFreshTenantCreation`, and `TenantIdentityService/ResolveAuthoredWorldSource`. This is not public transport exposure: the gRPC listener still requires mTLS, and each handler enforces its own exact peer and namespace contract. The fresh-creation and authored-source reads have the distinct caller sets defined in their owner sections above; the runtime identity read permits only Game Session. No other Game Design RPC is exempted.

The request contains exactly two fields: `canonical_tenant_id` and `request_id`, each a canonical lower-case, nonnil UUID string. Unknown protobuf fields, noncanonical/nil IDs, or a missing ID return `INVALID_ARGUMENT`. The tenant UUID is only a selector: Game Design returns it only after an exact canonical-UUID lookup and owner-row provenance validation.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ This API contract is target-state canonical; implementation coverage is partial
- The current typed `ApplyWorldDesignMutation` owner-write boundary also has no method/workload or tenant authorization beyond shared JWT parsing: its gRPC handler forwards any authenticated bearer to the mutation service, whose current checks cover request shape and Draft state but not caller identity or tenant access. This is separate from the digest-read gap and the legacy REST generation-rule gap; the target authenticated Game Design caller and tenant authorization remain defined by the design-time contract below, and wrong-workload/cross-tenant denial is not implemented or proved.
- Required executable migration/proof gate: `./gradlew :world-management-service:test :game-logic-service:test :game-session-service:test :tcp-proxy-service:crossServiceTest`. This gate must update the bridge, callers, examples, and checked-in proof together and pass before the target examples below may be treated as current. This document does not claim that the gate exists or passes.

## Authored-world source intake

Fresh World content enters through authenticated [Game Design authored-source evidence](../game-design-service/api-contracts.md#authored-world-source-evidence-and-world-delivery), not inferred tenant ownership. The separate `WorldAuthoredSourceIntakeService` accepts only the verified same-namespace Game Design mTLS peer. `IntakeAuthoredWorldSource` binds the closed v1 tuple `{schemaVersion, targetNamespace, intakeRequestId, canonicalTenantId, worldSlug, sourceOperationId, expectedSourceEvidenceDigest}`. Workload identity authenticates the owner handoff; it does not supply creator or runtime authorization.

For an uncommitted intake, World obtains and validates the exact fresh Game Design source receipt before its local transaction. World then commits the complete source evidence, local canonical-UUID-to-private-key association, and immutable intake receipt together. It reads the exact result back after commit before reporting success. Existing exact retries replay the durable receipt without reallocating identity or resolving a replacement source; changed binding under the same request fails closed. Private numeric World keys remain internal. Retained or contradictory rows cannot use this fresh intake: they require a separate owner-approved, audited association with exact retained-row evidence, never Account's manifest or guessed numeric/slug equality.

`ReadAuthoredWorldSourceIntake` accepts the complete original intake binding plus a distinct nonnil `requestId` for the read. It returns only an exact committed receipt, echoes both identities and the full binding, and never allocates state or repeats the Game Design source read. The request digest uses the versioned `world-authored-source-intake-request/v1` byte-framed SHA-256 preimage; the receipt digest is an authenticated World attestation that also binds its private association and is not client-recomputable. Callers verify the response binding and recomputable request digest while treating the receipt digest as opaque owner evidence.

This identity receipt is neither publication attestation nor World lifecycle, Game Session catalog, Entity placement, or gameplay-admission proof. The receiver remains disabled by default; its [implementation tracker](../../../project-management/implementation-tracking/world-runtime-and-movement.md#authored-world-source-foundation) records wiring and proof limits. Enabling the handoff does not authorize canonical Draft writes or ACTIVE.

## gRPC APIs

- `GetRoom` – retrieves room data including exits and environmental effects through `RoomInstanceRef`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Official-hosted creator-content acceptance remains an unimplemented target gap;

The Game Design owner-local fresh-creation repository and exact Account/Game Session mTLS receipt read are implemented with immutable request/digest/tenant-source evidence. The canonical behavior is owned by [Game Design API contracts](../../architecture/microservices/game-design-service/api-contracts.md#canonical-tenant-identity-and-fresh-creation-readback). The bounded implementation and its focused proof are named in the [Capability Status](#capability-status) and [Validation and Proof](#validation-and-proof) entries below. These prove bounded storage and readback, not authenticated creator authorization, Account enrollment, runtime admission, or a playable environment. No creation RPC or activation is introduced, and broader capability ratings remain unchanged.

### Authored-world source foundation

The bounded source prerequisite implements owner-local immutable registration/readback, exact same-namespace Game Session/World source reads, and an atomic fresh-source delivery claim with exact World acknowledgement storage. Its canonical contract is [authored-world source evidence and World delivery](../../architecture/microservices/game-design-service/api-contracts.md#authored-world-source-evidence-and-world-delivery). Production anchors are `GameAuthoredWorldSourceRepository`, `GameAuthoredWorldSourceDeliveryRepository`, `TenantIdentityGrpcService`, V34.1, and V34.2. The target-native V34.2 delivery DDL preserves the prepared source migration's content without importing later publication migrations.

The clean-baseline Common/Game Design/World full check and boot-jar gate passes. Game Design's 333 unit cases execute after fixture repair; the unchanged Common 199 and World 187 passing unit results are reused from the preceding gate. All 44 Game Design and 27 World integration cases are skipped locally without Docker, including source registration/delivery, World intake, retained-key guards, and physical peer proof. Integration compilation and static checks are not PostgreSQL or live deployment proof. No automatic delivery dispatcher or authenticated creator-facing source-registration ingress is included; those remain owner implementation obligations. Genuine release publication, World materialization/ACTIVE, Game Session catalog association, Entity placement, and final Account settlement remain separate open handoffs.

### Script and plugin transition reconciliation

Game Design's script-patch and plugin transition implementation remains partial: design-time publication metadata and bounded local activation-preflight seams exist, but dedicated Game Logic ability-schema compatibility, tenant runtime readiness, exact instance pin/epoch propagation, rollout/rollback history, and end-to-end recovery proof remain absent or unproved. The ownership and lifecycle contracts for these gaps are recorded in [ADR 0103](../../architecture/decisions/adr-0103-single-authority-script-pins-with-exact-version-execution.md), [ADR 0106](../../architecture/decisions/adr-0106-epoch-fenced-script-rollback-without-routine-gameplay-pause.md), [ADR 0107](../../architecture/decisions/adr-0107-stage-aware-script-dead-letter-recovery.md), [ADR 0108](../../architecture/decisions/adr-0108-no-degraded-script-admission-without-authoritative-pin.md), [ADR 0109](../../architecture/decisions/adr-0109-game-session-owned-script-rollout-history.md), [ADR 0110](../../architecture/decisions/adr-0110-explicit-opt-in-schedule-continuity-across-script-transitions.md), [ADR 0111](../../architecture/decisions/adr-0111-unified-dsl-with-distinct-embedded-script-and-plugin-lifecycles.md), and [ADR 0119](../../architecture/decisions/adr-0119-epoch-fenced-per-instance-plugin-activation.md). This tracker records only current implementation and proof status.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ This tracker is the permanent reader-facing implementation record for world runt

The initial-admission implementation now includes the typed Game Session workload-only acquire RPC, a durable World hold, lifecycle-row termination serialization, scheduled fail-closed reconciliation, and a method-specific authenticated Game Session owner-read adapter. The opt-in run-owned local Compose coordinator now drives the hold from Game Session’s durable initial-bind intent and resolves it only through exact authenticated owner proof. Raw Game Session `RUNNING` and World `ACTIVE` runtime seeds have been removed; local World metadata seeding retains versioned template rooms `1021` and `2045` for the current transitional movement contract. The focused unit-test anchors in the capability table cover service-local seams; PostgreSQL race/restart and live Compose proof remain unclaimed. See the [World initial-bind contract](../../architecture/microservices/world-management-service/api-contracts.md#initial-admission-bind-hold-contract) and the [Game Session implementation status](../../architecture/microservices/game-session-service/api-contracts.md#initial-admission-bind).

### Authored-world source foundation

The bounded [World authored-source intake](../../architecture/microservices/world-management-service/api-contracts.md#authored-world-source-intake) implements an exact Game Design peer boundary, source verification before the owner transaction, persisted canonical tenant association and receipt, and authenticated exact retry/readback. V23.1 stores this association; V24 denies legacy numeric writes into canonical-associated/reserved tenant rows. The separate intake handler and file-backed mTLS client configuration remain default-off under `firemud.authored-world-source.enabled`; no deployment enablement or automatic Game Design dispatcher is included.

The Common/Game Design/World full check, schema generation, integration compilation, static analysis, and boot-jar gate passes. World's 187 unit cases execute in the initial gate and are reused unchanged in the corrected gate. All 27 World integration cases are skipped without Docker; no physical PostgreSQL, retained-row migration, real peer, fresh-image boot, or end-to-end delivery proof is claimed. This receipt does not establish canonical Draft-write authorization, release attestation, materialization/ACTIVE, Game Session association, Entity placement, or the Account commit/abort settlement boundary. Those handoffs and their serving-authority, capacity/readiness, and lifecycle-fence proofs remain open.

## Packet 4 Status and Proof Gaps

- `GR-2.1` / `AR-3.1`: [ADR 0122](../../architecture/decisions/adr-0122-stable-playable-state-namespaces-for-runtime-replacement.md) requires world runtime state to distinguish the durable playable-state namespace and `playableStateScope` from a disposable instance and to classify owner data before replacement. Current world instance and lifecycle evidence remains partial; no exhaustive S1/S2/S3 mapping or cleanup proof is claimed.
Expand Down
27 changes: 27 additions & 0 deletions protos/game-design/v1/tenant_identity_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ option java_multiple_files = true;

// Authenticated owner-local reads of persisted runtime and fresh-creation tenant evidence.
service TenantIdentityService {
// Exact same-namespace Game Session/World read of immutable authored source evidence.
rpc ResolveAuthoredWorldSource(ResolveAuthoredWorldSourceRequest)
returns (ResolveAuthoredWorldSourceResponse);
// Exact same-namespace Account/Game Session read of owner-created tenant evidence.
rpc ResolveFreshTenantCreation(ResolveFreshTenantCreationRequest)
returns (ResolveFreshTenantCreationResponse);
Expand Down Expand Up @@ -152,3 +155,27 @@ message ResolveFreshTenantCreationResponse {
string provenance_kind = 9;
string evidence_digest = 10;
}

message ResolveAuthoredWorldSourceRequest {
string request_id = 1;
string operation_id = 2;
string canonical_tenant_id = 3;
string world_slug = 4;
}

message ResolveAuthoredWorldSourceResponse {
int32 schema_version = 1;
string target_namespace = 2;
string request_id = 3;
string registration_request_id = 4;
string operation_id = 5;
string request_digest = 6;
string canonical_tenant_id = 7;
string tenant_slug = 8;
string world_slug = 9;
string world_display_name = 10;
int64 source_game_row_id = 11;
string source_game_tenant_key = 12;
string provenance_kind = 13;
string evidence_digest = 14;
}
Loading
Loading