Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eb901b7
feat: retain local Game Session catalog and private target preparation
benhook1013 Nov 3, 2026
aabe1e1
Merge commit '3f72a18036abbe7442172978dcf544110d6e8e85' into codex/ga…
benhook1013 Nov 3, 2026
99fd736
test: boot Game Session fixtures with combined owner migrations
benhook1013 Nov 3, 2026
b10cd57
Merge commit 'c1bdab3276f154839f3c1b4b0b7d1340c7e72b29' into codex/ga…
benhook1013 Nov 3, 2026
909cf8a
Bind Game Session catalog view options with a retained owner epoch
benhook1013 Nov 3, 2026
354d5ae
Merge commit 'bcee42f70678d110b4a08dc20a023497a57ac311' into codex/ga…
benhook1013 Nov 3, 2026
683c4eb
Record qualified Game Session catalog receiving proof
benhook1013 Nov 3, 2026
c54154f
Replay committed private allocations after preparation expiry
benhook1013 Nov 3, 2026
9c309b9
Merge commit 'b0596691455c2c01c5eb365eb5d2f3b3804bcdfb' into codex/ga…
benhook1013 Nov 3, 2026
b4436c9
Record reconciled Game Session catalog and replay proof
benhook1013 Nov 3, 2026
746559d
Preserve historical launch rows across additive catalog migration
benhook1013 Nov 3, 2026
896da4f
Merge branch 'codex/gameplay-foreign-owner-catalogs-20261103' into co…
benhook1013 Nov 3, 2026
aed49f9
Preserve initial-admission history across private catalog columns
benhook1013 Nov 3, 2026
ad457f5
Merge commit 'dee73f297eeaadd43c359c06ffa575c65140515b' into codex/ga…
benhook1013 Nov 3, 2026
1120fc3
Merge commit '074a11edf81aebf8770fcde2cf38401abb3fe75e' into codex/ga…
benhook1013 Nov 3, 2026
41a6215
Merge commit '9925000940c917f2ca3f4873b36f74ad729c3d1f' into codex/ga…
benhook1013 Nov 3, 2026
54ae45b
Merge branch 'codex/gameplay-foreign-owner-catalogs-20261103' into co…
benhook1013 Nov 3, 2026
a43f927
Merge branch 'codex/gameplay-foreign-owner-catalogs-20261103' into co…
benhook1013 Nov 3, 2026
f93a8f1
Merge branch 'codex/gameplay-foreign-owner-catalogs-20261103' into co…
benhook1013 Nov 3, 2026
0860c52
Merge branch 'codex/gameplay-foreign-owner-catalogs-20261103' into co…
benhook1013 Nov 3, 2026
c581694
Merge branch 'codex/gameplay-foreign-owner-catalogs-20261103' into co…
benhook1013 Nov 3, 2026
9a62142
Reuse Game Session migration fixtures and clarify private catalog proof
benhook1013 Nov 3, 2026
4b8cd87
Merge commit '31ee0750c2f889730719a05120138da9ea3fbea7' into codex/ga…
benhook1013 Nov 3, 2026
5755763
Complete shared migration fixture consumers and mapped JDBC readiness
benhook1013 Nov 3, 2026
a2a37c4
Document whole-transaction private allocation retries and prove SQL g…
benhook1013 Nov 3, 2026
78b9bef
Consolidate remaining Game Session migration fixtures
benhook1013 Nov 3, 2026
97ac9b3
Explain unexpected stale allocation success in concurrency proof
benhook1013 Nov 3, 2026
4631a36
Reuse configured migrations in closed barrier owner proof
benhook1013 Nov 3, 2026
e29b15b
Allow later private preparation after retained catalog allocation
benhook1013 Nov 3, 2026
6ca4265
Correct lifecycle proof count and readable validation references
benhook1013 Nov 6, 2026
9b1aabf
Reuse shared private catalog columns in launch preparation tests
benhook1013 Nov 6, 2026
9563451
Reconcile runtime owner catalogs with merged develop parent
benhook1013 Nov 6, 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 @@ -94,12 +94,18 @@ The separate manually composed, unregistered `EntityRuntimeFamilyCatalogClient`

Game Session has a manually composed, unregistered Automation runtime-family catalog client that requires file-backed mTLS, pins the exact same-namespace Automation peer, applies finite size/deadline bounds, and validates complete request/snapshot/catalog evidence. Its [Automation API owner contract](../automation-scripting-service/api-contracts.md#owner-local-runtime-family-catalog-read) and [classification/retention owner contract](../automation-scripting-service/runtime-and-data.md#owner-local-runtime-family-catalog) remain authoritative. A successful source read does not resolve blocking families or non-SQL gaps, enroll Automation, establish FRESH completeness/materialization, authorize an actor, or enable runtime admission, CLOSED aggregation or activation; unavailable evidence is never empty-source or initialized-state proof.

Game Session's own [owner-local runtime-family catalog](./runtime-and-data.md#owner-local-runtime-family-catalog) is instead a manually composed LOCAL SQL capture/independent committed-readback boundary, with a closed typed value and local codec, not a remote client or self-RPC. Its fixed workload namespace and exact retained request/snapshot/epoch/bytes/digests supply as-of Game Session source evidence only; unresolved SQL families and explicit non-SQL gaps remain blocking. It adds no transport, registration, preparation wiring, runtime allocation, manifest, global owner set, pointer mutation or admission authority. The linked data owner defines census, installation-marker, drift, retention and finite-bound rules; [Realm Routing and Playable State](../../../project-management/implementation-tracking/realm-routing-and-playable-state.md) owns the source/proof status and remaining FRESH obligations.

### Initial `FRESH` playtest lifecycle source preparation

[ADR 0137](../../decisions/adr-0137-isolated-playtest-state-modes-and-reset.md) owns playtest initialization modes and isolated lifecycle identity; [ADR 0138](../../decisions/adr-0138-expiring-playtest-grants-with-bounded-active-revocation.md) owns explicit expiry and grant consequences. The local, unregistered `GameSessionInitialPlaytestLifecycleRepository.prepare` boundary supports only an initial `FRESH` preparation. Its exact request binds a stable `requestId`, `targetNamespace`, `tenantId`, `worldSlug`, `realmSlug`, and explicit future `forkExpiresAt`, plus `sourceCatalogRealmId`, `sourceCatalogRequestId`, `sourceCatalogRevision` fixed at `1`, `sourceIntakeOperationId`, `canonicalVersionId`, `publishedReleaseBundleRef`, and `publishedReleaseBundleDigest`. Game Session locks and validates the retained canonical public-production catalog and its complete published policy evidence against the same tenant/world, distinct target realm, source-intake operation, canonical version, and published release bundle; fixture-only source records are excluded. The target must also be an exact visible, non-public, `ISOLATED` realm policy in that complete immutable Human-published policy set. The retained preparation binds its policy identity, canonical bytes, digest and source revision; a public build or catalog alone cannot authorize an arbitrary private target.

A new request allocates a fresh non-nil `playtestLifecycleId` and `playableStateNamespaceId` internally and fixes the initial `playtestStateGeneration` at `1`; none is supplied by the request. The canonical original-request preimage and digest are retained: an exact `requestId` retry returns that original allocation, while changed request content conflicts rather than reallocating or extending expiry. The explicit `forkExpiresAt` is stored with the preparation and checked against the database clock for a new allocation. The preparation remains `PREPARING`; an exact lifecycle read returns `INCOMPLETE` before expiry or `EXPIRED` at/after expiry, and every returned snapshot has `admissionAllowed=false`. The internal `GameSessionCurrentPrivatePlaytestRepository` selects one preparation by explicit expected head revision and expected current lifecycle. A new selection retains an immutable request receipt and advances the scoped head once; historical exact replay returns the original selection rather than choosing a newer preparation. Both selection and current reads qualify the exact retained preparation/private policy; this head is not a player-visible catalog or admission pointer.

A retained non-public catalog projection does not disqualify a new preparation for the same authored selectors; a public-production catalog remains a target conflict. A new preparation/current selection neither changes the durable catalog realm identity and selector nor evolves an immutable catalog row into another lifecycle. The [realm-routing tracker](../../../project-management/implementation-tracking/realm-routing-and-playable-state.md#initial-fresh-lifecycle-preparation) records the separate later-lifecycle catalog and materialization boundary.

The internal `GameSessionPrivateFreshTargetRepository` can preallocate a private realm identity in the existing canonical realm catalog from one exact retained, unexpired FRESH preparation. Its writable serializable owner transaction locks and requalifies the preparation and original complete Human policy/source, allocates a distinct realm UUID internally, and binds the immutable catalog request/outcome to that preparation’s namespace, lifecycle, generation, policy and build. Exact retry requalifies the retained evidence and preserves the original identity and bytes even after preparation expiry; it creates no new row or admission authority. Concurrent serializable attempts can return PostgreSQL `40001` because an advisory-lock wait cannot refresh the transaction snapshot. The calling owner must roll back and retry its entire transaction in a fresh serializable transaction with the same immutable request and retained preparation; a statement retry or replacement request identity is invalid. An unresolved outcome remains unresolved until exact committed readback, rather than being treated as proof that no other attempt committed. Expiry refuses new allocation and remains checked at commit; changed intent conflicts. The private projection remains non-visible, non-public, `ISOLATED`, revision `1` and `PREPARING`; it is excluded from public collection reads. SQL guards preserve the original public path and recheck the preparation deadline at commit. This identity is an input for later actual owner materialization, not a completed private target, runtime allocation, CLOSED admission pointer, owner manifest, activation or admission.

The standalone, unregistered `CurrentPrivatePlaytestLifecycleReadService` exposes that internal current source only to the exact same-namespace Account workload, without propagated player context. Its bounded closed frame correlates the original read and exact namespace/tenant/world/realm, then returns explicit absence or the immutable selection, lifecycle, expiry, source/build and private-policy provenance as observed by Game Session. Account consumes these as-of facts through its peer-qualified client; they confer no grant or actor authority and protect no later cross-owner commit. `PREPARING` remains invisible to player discovery under ADR 0137.

This preparation is not a World lifecycle transition or admission decision. World continues to own the runtime lifecycle state and epoch; that epoch is not allocation authority for the new playtest lifecycle or playable-state namespace. The local boundary does not authenticate or qualify an actor, produce owner manifests, complete preparation, support seeded/snapshot initialization or reset, publish lifecycle changes, register a runtime caller, create a pointer, or admit gameplay. No delivery or successful playtest availability is implied by a stored `PREPARING` row.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ The sections below define the target-state runtime contract. Current implementat
- The unregistered created-owner consumer includes V1017/V1020 but omits the separate canonical UUID runtime and creation-protection storage; created-receipt fields supply neither prerequisite. The [owning tracker](../../../project-management/implementation-tracking/player-access-and-session.md#player-created-roster-consumer-preparation) records controlled initial receipt/replay and separate retention-component proof, with current guarded post-issuance supersession through retirement still unrun. Production custody, Account settlement, production PKI, registration, activation and gameplay admission remain unproved.
- The current Flyway history also contains the Java/nontransactional `V8__remote_followup_target_instance_effect_identity` migration (`CREATE INDEX CONCURRENTLY`, `canExecuteInTransaction() = false`). This is outside the SQL migration input used by shared jOOQ generation and is not yet inventoried or proved as a narrow exception to the SQL-only persistence lineage.

## Owner-local runtime-family catalog

Game Session's runtime-family catalog is a manually composed **LOCAL SQL** source boundary, not a remote-owner wrapper or self-RPC. `GameSessionRuntimeFamilyCatalogRepository.capture` binds one non-nil read-request UUID and the exact configured workload namespace to a retained snapshot UUID, positive owner catalog epoch, complete catalog bytes and SHA-256 digests. Workload namespace is deployment configuration, not a playable-state namespace, tenant selector or caller authority. Composition must use a transaction-aware jOOQ data source and transaction manager bound to the same durable primary. `capture` commits the snapshot in its own writable transaction and then performs independent committed readback; `readExact` reconstructs only that exact retained request in a separate read-only transaction. Both refuse ambient SQL transactions or synchronizations, wrong namespaces, missing evidence, changed requests, drift and invalid bytes. Post-commit readback failure can leave the immutable original snapshot retained; it supplies no success and grants no deletion or resampling authority. There is no Spring registration, endpoint, invented workload peer, or player/operator credential in this local call.

The catalog seals the actual current Game Session PostgreSQL schema, not a historical union of `CREATE TABLE` statements, a prefix exclusion or a static expected-table response. Every installed table, including empty tables, requires an explicit family disposition; named mixed components additionally bind their actual columns. Sorted definition digests cover tables, columns, constraints, indexes, triggers, routines, sequences, views, types, policies and rules, alongside the actual configured Flyway history. View and materialized-view facts bind both the query definition and relation options, including security-invoker, security-barrier and materialized-view storage settings; changing options invalidates the current seal even when the query text is unchanged. Unknown or removed relations/components refuse capture; changed schema definitions, routines, classification or prior/later migration facts invalidate the sealed epoch and previously retained reads. A new epoch requires an explicit monotonic owner installation against the complete current classified schema, not automatic resampling during a read.

Flyway writes each installing migration's own history row only after its migration transaction. The seal therefore binds distinct stable V1057, V1058 and V1059 installation markers and the actual installed definitions; it excludes only those three installing history rows without inventing or claiming their eventual checksums. After installation, capture/readback additionally require exactly one successful SQL row for each version with its exact installing script in the configured history table. All other prior and later history facts remain part of the seal. Each forward installer seals the next monotonic owner epoch only after all routine replacements: V1058 binds view options, and V1059 narrows the initial-preparation public-target conflict while preserving retained private projections. Earlier migrations and all retained epoch, snapshot and history bytes remain immutable. Requests retained under an older epoch conflict with the current epoch rather than being rewritten or resampled. Other installation and retention obligations remain with the [database migration owner](../../system-architecture-database-migrations.md); the configured history table, rather than an assumed `flyway_schema_history` alias, is itself explicitly classified as retained control evidence.

Gameplay commands and remote work whose namespace partition or replacement class is unresolved remain `UNKNOWN` and blocking, never implicitly S3. Durable tick/effect recovery, selected-work manifests, remote outcomes, script-pin authority/history and region/timeline provenance remain separate blocking evidence rather than cloned gameplay payload or a FRESH manifest. Input history and reconnect context retain their distinct audit/privacy consequences. `game_manifest` remains unsupported unqualified legacy lineage, not a build or FRESH source. Catalog/pointer, original operator/LOGIN/roster/binding/account/issuer authority, installed Saga control, and their original request, nonce, fence, replay, retirement and hold guards retain their owning consequences. Classification grants neither cleanup authority nor permission to discard uncertain work. The actual V1054–V1056 private preparation and canonical catalog branch are included as retained control/provenance; `PREPARING` is not a private runtime, CLOSED pointer or readiness result.

Known non-SQL blockers remain explicit: current-pin projections; issuer/account-index custody; legacy queue/cluster scope; region timeline/lease state; session/controller/replay state; and incomplete volatile-stage recovery. They do not enumerate all physical Redis keys or fabricate SQL session, queue, lease or index rows. The [Redis owner](../../system-architecture-redis.md), [session owner](../../system-architecture-session-behavior.md), [replacement contract](../../decisions/adr-0122-stable-playable-state-namespaces-for-runtime-replacement.md) and [retention contract](../../decisions/adr-0163-service-owned-retention-classes-with-cross-service-safety.md) continue to own those obligations.

The purpose-specific GCR1/GCE1 local codec retains exact original catalog bytes and rejects incomplete, duplicate, unknown, contradictory, unordered, malformed or oversized values. The catalog bound is 2 MiB with at most 512 families, 16,384 schema facts and 32 non-SQL gaps; all six known gap identifiers remain mandatory, without claiming a complete Redis inventory. Request/evidence frame bounds are 1,024 and 2,101,248 bytes respectively. The immutable epoch and request snapshots have no TTL or cleanup API. These are as-of Game Session owner facts, not protection through a later commit, an owner-enrollment/required-owner set, cross-owner currentness, a FRESH manifest, materialization, runtime allocation, private authorization, pointer mutation, activation or admission. These source facts do not establish completed FRESH capability; detailed proof, status and remaining gaps stay in [Realm Routing and Playable State](../../../project-management/implementation-tracking/realm-routing-and-playable-state.md).

## Runtime Details

- Redis and PostgreSQL hold the meaningful gameplay-session, tick-coordination, and control-plane state needed for takeover.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ Shared migration artifacts use a collision-free versioning convention relative t

### Sealed Runtime-Family Catalog Epochs

The owner-local catalogs for [World](./microservices/world-management-service/api-contracts.md#owner-local-runtime-family-catalog-read), [Entity](./microservices/entity-management-service/api-contracts.md#owner-local-runtime-family-catalog-read), [Automation](./microservices/automation-scripting-service/api-contracts.md#owner-local-runtime-family-catalog-read), and [Social](./microservices/social-groups-service/api-contracts.md#owner-local-runtime-family-catalog-read) seal installed PostgreSQL definitions, classifications and counted Flyway history. Every subsequent owner or adopted shared migration that changes these inputs requires an explicit next owner epoch in its reviewed forward migration batch. End that batch with the owner-local catalog installation and seal after the other definitions are installed; an ordinary new Flyway history row can itself change the catalog even when payload tables are untouched.
The owner-local catalogs for [World](./microservices/world-management-service/api-contracts.md#owner-local-runtime-family-catalog-read), [Entity](./microservices/entity-management-service/api-contracts.md#owner-local-runtime-family-catalog-read), [Automation](./microservices/automation-scripting-service/api-contracts.md#owner-local-runtime-family-catalog-read), [Social](./microservices/social-groups-service/api-contracts.md#owner-local-runtime-family-catalog-read), and [Game Session](./microservices/game-session-service/runtime-and-data.md#owner-local-runtime-family-catalog) seal installed PostgreSQL definitions, classifications and counted Flyway history. Every subsequent owner or adopted shared migration that changes these inputs requires an explicit next owner epoch in its reviewed forward migration batch. End that batch with the owner-local catalog installation and seal after the other definitions are installed; an ordinary new Flyway history row can itself change the catalog even when payload tables are untouched.

Keep the census function, catalog-installation history exclusions and successful-installation predicate aligned. A catalog installer's own Flyway row is recorded after its SQL runs, so its exact successful installation must be independently qualified as in World V1047; sealing a snapshot before that row appears without the corresponding owner binding is insufficient. Preserve every prior epoch, snapshot, applied migration and checksum. Never edit history or reseal an old epoch to make a failed read pass.

For an intentional drop or rename of a classified relation, the reviewed forward migration must update the owner-local classification in the same transaction as the DDL. Temporarily remove only the classification immutability trigger needed for that change, replace the affected classification rows, and restore that trigger before sealing the next epoch. Preserve historical snapshots and epochs. The [Game Session catalog owner](./microservices/game-session-service/runtime-and-data.md#owner-local-runtime-family-catalog) provides the concrete census and exact post-SQL installation-marker contract. A new payload table or counted history row also needs the next seal, even when no classification row is removed. Prove fresh bootstrap, upgrade from retained installed history, refusal before the new seal and exact new-epoch readback on disposable PostgreSQL.

PostgreSQL upgrades can change rendered routine, view, constraint, trigger, type or sequence definitions. If the upgraded engine changes sealed bytes, reads remain failed closed until a reviewed forward catalog installation explicitly seals the next epoch against that installed engine and migration history. Prove the upgrade and new-epoch readback on disposable PostgreSQL with retained rows before relying on the new catalog, then reacquire dependent snapshots under their owning contracts. Unavailable or contradictory evidence is not an empty catalog or permission to auto-repair history.

### Objective Compatibility Gates
Expand Down
Loading
Loading