Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ea703d2
feat: add durable owner-fenced initial admission foundation
benhook1013 Oct 2, 2026
630521d
Complete run-owned initial admission bootstrap and accepted review fixes
benhook1013 Oct 2, 2026
03034c3
Stack complete owner bootstrap above catalog identity foundation
benhook1013 Oct 2, 2026
7a4f92d
Supply explicit transport-test catalog without restoring raw bootstra…
benhook1013 Oct 2, 2026
d3a476c
Preserve owner bootstrap through catalog reconciliation and harden ab…
benhook1013 Oct 2, 2026
1ebf5f1
Merge corrected catalog foundation and preserve scoped test authority
benhook1013 Oct 2, 2026
fe48551
test(gameplay): prove bounded owner bootstrap retry and same-claim re…
benhook1013 Oct 2, 2026
7cb022e
Merge catalog CAS and projection fixes into owner bootstrap prerequisite
benhook1013 Oct 2, 2026
8c73460
fix(gameplay): order child migrations after catalog repair
benhook1013 Oct 2, 2026
6ffcbb6
Merge commit '32359f881cfe562688aadec7bbd3af736ff2d5cf' into codex/wo…
benhook1013 Oct 2, 2026
c0f3db8
fix(gameplay): strengthen initial-admission fixtures and proof records
benhook1013 Oct 2, 2026
b322698
Merge commit '87429a4ac9fc42dc9fdc588dc6309f5ffe5b5835' into codex/wo…
benhook1013 Oct 2, 2026
9c4fde8
fix: validate database-free harness and narrow fixture identity checks
benhook1013 Oct 2, 2026
d2297ea
Merge commit '082a83fca01571c270a9e896cab04ed24f19cbda' into codex/wo…
benhook1013 Oct 2, 2026
201363e
test: prove required query rows and portable bootstrap fixtures
benhook1013 Oct 2, 2026
4041a8e
Merge commit 'fc5821d83cdde81795e6fdbe0b4df6ce451e7747' into codex/wo…
benhook1013 Oct 2, 2026
c2209dd
Fix initial-bind diagnostics and prove actual termination lock conten…
benhook1013 Oct 2, 2026
2de214e
Merge remote-tracking branch 'origin/develop' into codex/world-initia…
benhook1013 Oct 2, 2026
cf83e13
Recognize archived addressed-thread metadata in Hosted completion proof
benhook1013 Oct 2, 2026
71631a7
Correct initial-admission tracker legacy seed status
benhook1013 Oct 2, 2026
deebe2c
Select World initial-bind production constructor during Spring startup
benhook1013 Oct 2, 2026
2ad31da
feat(review): support exact additional rounds
benhook1013 Oct 2, 2026
4c5e40e
fix(review): retain active Hosted allocation evidence
benhook1013 Oct 2, 2026
d3a786b
Merge pull request #2946 from benhook1013/codex/review-additional-rounds
benhook1013 Oct 2, 2026
d72bcdf
fix(world): repair initial admission smoke and CI setup
benhook1013 Oct 2, 2026
23c9b8d
Merge published controller improvements without losing World CI repairs
benhook1013 Oct 2, 2026
0716746
fix(world): bind lifecycle hold SQL parameters correctly
benhook1013 Oct 2, 2026
580c7c7
test(gameplay): bind TCP fixtures through durable pointer ownership
benhook1013 Oct 2, 2026
d80c32a
refactor(review): preserve controller corrections in a separate stack…
benhook1013 Oct 2, 2026
8eacc5e
Fix typed initial-admission ledger status assertion
benhook1013 Oct 2, 2026
5b8ab35
test: require retained initial admission row before status read
benhook1013 Oct 2, 2026
262f91e
Merge remote-tracking branch 'origin/develop' into codex/2939-safe-ci…
benhook1013 Oct 2, 2026
0bf4872
Merge remote-tracking branch 'origin/develop' into codex/2939-safe-ci…
benhook1013 Oct 2, 2026
4dea2fb
Merge remote-tracking branch 'origin/develop' into codex/2939-safe-ci…
benhook1013 Oct 3, 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 @@ -10,7 +10,7 @@ Target state makes Game Session the authoritative owner of region/tick coordinat

`EnqueueAutomationCommandIfAbsent` and `ScheduleRemoteFollowup` currently fail closed at their authenticated internal receiving boundary with `FAILED_PRECONDITION` / `automation_admission_receiver_fence_unavailable`, before command, coordinator, follow-up, or queue mutation. The retained lower-level admission implementation does not prove the cross-service Automation admission-epoch fence required by [ADR 0106](../../decisions/adr-0106-epoch-fenced-script-rollback-without-routine-gameplay-pause.md). A separate receiver-fence successor must durably serialize installation against receiving admission, preserve exact retry outcomes, and prove that a handoff whose intent committed before an Automation pause cannot create live work under the displaced admission epoch afterward. This gate preserves ordinary gameplay APIs and does not claim the successor implemented.

Realm-catalog identity status: Game Session pointer rows persist a separately advancing positive `catalogRevision` and stable UUID `realmId`/`playableStateNamespaceId`; new audit rows retain those values, and player-facing discovery and runtime pointer projections fail closed when identity is incomplete or a tenant catalog is ambiguous. The control-plane `SetAdmissionPointer` and `ExecutePreparedVersionCutover` paths currently fail closed pending catalog-revision and durable-identity preconditions. The existing configuration-driven startup pointer initializer and GS/WMS raw seed behavior remain legacy bootstrap inputs; they do not establish World-owner lifecycle proof or an owner-validated initial bind. The [Game Session runtime tracker](../../../project-management/implementation-tracking/game-session-runtime-and-tick-coordination.md) records execution evidence and remaining proof gaps.
Realm-catalog identity status: Game Session pointer and audit rows persist a separately advancing positive `catalogRevision` and stable UUID `realmId`/`playableStateNamespaceId`; player-facing catalog and runtime pointer projections fail closed when identity is incomplete or a tenant catalog is ambiguous. The control-plane `SetAdmissionPointer` and `ExecutePreparedVersionCutover` paths remain closed pending catalog-revision and durable-identity preconditions. The configuration-driven pointer initializer validates seed shape but does not write authority rows while World-owned lifecycle proof is unavailable; raw seed inputs do not establish that proof or an owner-validated initial bind. Current implementation and proof gaps are tracked in the [Game Session runtime tracker](../../../project-management/implementation-tracking/game-session-runtime-and-tick-coordination.md).

This document mixes live and target-state control-plane surfaces. Current live behavior is narrower:

Expand Down Expand Up @@ -48,6 +48,14 @@ After World proves the target `ACTIVE`, it acquires one durable, opaque cutover

Lost responses reconcile through the exact hold identity and authoritative World/Game Session reads. Game Session may request an abort only when owner evidence proves that its pointer transaction did not commit and the prior pointer remains authoritative; contradictory or unavailable evidence remains `RECONCILIATION_REQUIRED` and cannot be treated as a failed cutover or permit termination. The hold's World-owned `expiresAt` is diagnostic/repair input only and never auto-releases it. The current Game Session wire, durable transaction, and focused proof do not yet carry or prove this hold binding; see the [World cutover hold contract](../world-management-service/api-contracts.md#replacement-cutover-hold-contract).

### Initial admission bind

The first admission-pointer bind for a realm is a separate owner transaction from replacement cutover. Game Session owns a durable attempt ledger with one stable request identity and canonical digest, plus the terminal outcome `COMMITTED` or `ABORTED`. Its initial pointer transaction must prove that no pointer exists for the exact `{tenantId, realmId}` and atomically bind the World-issued initial-bind hold identity/fence, the same request identity/digest, `{tenantId, realmId, playableStateNamespaceId, playableStateScope}`, target `gameInstanceId`/`versionId` and exact `ACTIVE` lifecycle epoch, and `catalogRevision` with the new pointer and matching append-only audit event. The durable `COMMITTED` attempt outcome commits in that same transaction. This owner-side no-prior-pointer check is not replaced by a bootstrap snapshot, startup configuration, public raw-pointer RPC, or external operator write bypass.

An exact retry or post-restart recovery reuses the same attempt and hold identities and reconciles the durable attempt, pointer, and audit. Game Session may record `ABORTED` only as a durable terminal outcome that prevents any later commit for that same attempt. World may accept that exact, authenticated owner-readback outcome bound to the same hold and tuple as abort proof; pointer absence, `NOT_FOUND`, `PENDING`, unavailable reads, mismatched tuple/audit, or contradictory evidence is not proof. World finalization requires an authenticated exact Game Session owner readback of the same hold and request identity/digest, tuple, committed pointer, matching audit, and `COMMITTED` outcome. Ambiguous results remain termination-fenced while automatic reconciliation retries; elapsed time does not release the World hold. See the World-owned [initial admission bind hold contract](../world-management-service/api-contracts.md#initial-admission-bind-hold-contract).

The local run-owned Compose fixture path now reaches this owner transaction through a scheduled Game Session coordinator, explicitly disabled by default. It accepts only a read-only capability file bound to the claimed run and Compose project, one stable operation ID, the fixed demo/production fixture, and the exact development Game Session workload leaf and CA fingerprints; host input supplies no runtime ID, lifecycle epoch, catalog revision, pointer, or World hold identity. Game Session resolves and validates the published Game Design launch descriptor, durably reserves the matching launch identity, and drives World prepare/activate with exact epoch readback so a restart resumes the same launch. The coordinator persists the initial-bind intent before requesting the World hold, then uses the owner-local pointer/audit/outcome transaction and World’s authenticated owner-proof reconciliation; bounded retries reuse the same operation identity, and ambiguous evidence keeps the World termination fence closed. This path is a local Compose fixture bootstrap, not the accepted Account `JOIN` transaction or a production activation path; realm identity and admission-pointer authority remain defined by the [Multi-Tenancy contract](../../system-architecture-multi-tenancy.md#realm-catalog-and-admission-pointer-contract), and explicit join remains owned by [ADR 0025](../../decisions/adr-0025-explicit-open-enrollment-membership.md). See the [run-owned player-flow smoke boundary](../../system-architecture-testing.md#player-flow-smoke-and-reset-boundaries). Cross-service database race/restart proof remains outstanding; implementation and proof state are tracked in the [Game Session runtime tracker](../../../project-management/implementation-tracking/game-session-runtime-and-tick-coordination.md) and [validation workflow](../../../developer-workflows/validation-and-runtime-proof.md). The existing cutover transaction and [replacement hold contract](../world-management-service/api-contracts.md#replacement-cutover-hold-contract) remain distinct; the canonical initial-bind contract is owned by [World](../world-management-service/api-contracts.md#initial-admission-bind-hold-contract).

## Session Front-End and Lease-Owner Routing

Game Session deliberately separates socket ownership from region execution ownership:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,24 @@ Game Session must bind `cutoverHoldId`, `cutoverHoldFence`, the exact `playableS

The authoritative `expiresAt` is a diagnostic and repair trigger only. Expiry never auto-releases an unresolved hold, and no operator bypass or numeric TTL policy is implied. The current service lacks the hold table/state, coordinated acquire/finalize RPC or wire fields, owner-read reconciliation, termination predicate, and focused runtime proof; this documentation-only parcel does not add or claim those artifacts, which remain required target implementation and proof work.

## Initial Admission Bind Hold Contract

World Management owns a separate durable one-shot hold for the first admission-pointer bind of an already active realm runtime. It closes the race between proving the target `ACTIVE` and Game Session committing the realm's first admission pointer. It is not a replacement cutover hold, does not add a `world_instance` lifecycle state, and does not make the initial bind a distributed transaction. The normal termination request identity, frozen owner set and registry revision, idempotent cleanup acknowledgements, and final lifecycle compare-and-set remain required after the hold is safely resolved.

One initial-bind execution records one stable control-plane request identity and canonical request digest, one opaque hold identity and equality-only World fence, and the exact `{tenantId, realmId, playableStateNamespaceId, playableStateScope}` binding, the initial no-prior-pointer condition, target `gameInstanceId` and `versionId`, exact target `ACTIVE` lifecycle epoch, and `catalogRevision`. The canonical digest binds the immutable request and realm-target tuple. Exact acquire, read, finalize, abort-proof, and reconciliation retries reuse that identity and fence; a conflicting request cannot silently reuse or replace the hold. The initial-bind condition is distinct from replacement's expected prior pointer/version and does not authorize replacing an existing pointer.

World acquires the hold in its own database transaction by serializing on the target lifecycle row, checking the exact `ACTIVE` state and epoch, and rejecting a conflicting nonterminal hold. It does not make remote Game Session or catalog reads inside that transaction. Every termination compare-and-set for the target instance, whether initiated by ordinary shutdown or another lifecycle path, must honor absence of a nonterminal initial-bind or replacement hold under the same database serialization. While either hold is nonterminal, termination remains pending and retryable and cannot advance the lifecycle epoch. Once the initial hold is finalized or safely aborted, the existing termination and all-owner cleanup contract continues unchanged.

Game Session owns the initial-bind attempt outcome and the admission pointer. It may create the first pointer only when its local transaction proves that no pointer previously existed for the exact `{tenantId, realmId}` and binds the same hold identity/fence, request identity/digest, namespace/scope, target instance/`versionId`, `ACTIVE` epoch, and `catalogRevision`. That transaction atomically commits the pointer, its matching append-only audit event, and the durable attempt outcome `COMMITTED`. Startup configuration, an admission snapshot, a public raw-pointer RPC, or an external operator write bypass is not lifecycle authority and cannot substitute for this owner transaction.

World finalizes only after an authenticated exact Game Session owner readback proves the same hold and request identity/digest, complete realm-target tuple, no-prior-pointer transition, committed pointer, matching audit event, and durable `COMMITTED` outcome. Definitive abort requires an authenticated exact readback of the durable `ABORTED` outcome bound to that same hold and tuple, with storage semantics that prevent any later commit for that attempt; World may then safely abort the hold. Pointer absence, a snapshot, `NOT_FOUND`, `PENDING`, an unavailable read, a tuple or audit mismatch, or contradictory evidence is not abort proof and never releases the hold. Any ambiguous or mismatched result leaves termination fenced and is reconciled automatically from the durable World hold and Game Session attempt record after retries, response loss, or process restart. Timeouts are repair triggers only; no hold is auto-released by elapsed time.

Current implementation includes the typed `AcquireInitialAdmissionBindHold` RPC restricted to the authenticated Game Session workload, the separate durable World hold record, lifecycle-row serialization that blocks termination while the hold is unresolved, scheduled fail-closed reconciliation, and a method-specific authenticated Game Session owner-read adapter. The run-owned local Compose fixture coordinator now reaches this hold after Game Session records its durable initial-bind intent; the World-owned reconciler resolves it only from authenticated exact owner proof. This remains an opt-in fixture path, not a change to the hold contract or a production activation path. PostgreSQL race/restart proof remains outstanding, and unavailable or mismatched owner evidence continues to fence termination. See the [Game Session initial-admission implementation status](../game-session-service/api-contracts.md#initial-admission-bind), [World Runtime and Movement tracker](../../../project-management/implementation-tracking/world-runtime-and-movement.md) for implementation anchors and current proof state, and the [validation and runtime proof workflow](../../../developer-workflows/validation-and-runtime-proof.md) for check selection. The replacement hold contract above remains separate.

Overdue hold diagnostics are observational. World Management emits `world_initial_admission_bind_overdue_observations_total`, a counter whose unit is one nonterminal hold observation in a bounded reconciliation scan at or after its authoritative `diagnosticExpiresAt`; a repeated scan of the same hold increments it again, so it is not a unique-hold count. Its only label is `error_code`, limited to `none`, `GS_OWNER_READ_UNAVAILABLE`, `GS_OWNER_READ_FAILED`, `GS_OWNER_PROOF_MISSING`, `GS_OWNER_NOT_FOUND`, `GS_OWNER_PENDING`, `GS_OWNER_UNAVAILABLE`, `GS_OWNER_ERROR`, `GS_OWNER_PROOF_MISMATCH`, `GS_OWNER_TERMINAL_PROOF_INCOMPLETE`, `WORLD_LIFECYCLE_PROOF_MISMATCH`, or `other`. Unknown persisted codes map to `other`. The counter never carries tenant, hold, realm, or runtime identifiers; scoped structured reconciliation logs retain the exact `holdId`, `tenantId`, and `gameInstanceId` for diagnosis. The `InitialAdmissionBindHoldOverdueObservations` alert is a diagnostic signal only. Neither its firing nor its absence authorizes readiness, termination, or hold release.

Operator procedure: use the scoped World reconciliation log fields to identify the exact hold, then inspect that World hold and the corresponding authenticated Game Session owner-read evidence against the complete bound identity in this contract. If owner transport or workload identity is unavailable, repair that dependency and retry through the existing scheduled reconciler using the same hold identity. Only exact authenticated `COMMITTED` or definitive `ABORTED` owner proof may resolve the hold. Never edit either database directly, release a hold because its diagnostic age elapsed, fabricate an abort, or use a raw pointer as proof; unavailable or mismatched evidence continues to fence termination.

## Instance Termination Contract

World Management owns the authoritative lifecycle row and monotonic epoch for `gameInstanceId` rows. The lifecycle state, owner registry, cleanup acknowledgements, and Temporal boundary are owned by [ADR 0123](../../decisions/adr-0123-database-authoritative-temporal-coordinated-world-lifecycle.md); this section records the World API consequence. Teardown is cross-service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ After target activation, the World local transaction locks source and target lif

Game Session binds the hold identity/fence, exact lifecycle proofs, and the applicable canonical private/playtest lifecycle proof tuple, including that exact namespace/scope proof tuple, into its local pointer/audit/prepared-execution/source-cleanup/drain-fence transaction. World finalizes the hold only after authoritative post-swap Game Session readback proves that exact namespace/scope-and-lifecycle-proof-bound transaction committed. Abort requires owner evidence that the pointer transaction did not commit and the prior pointer remains authoritative; contradictory or unavailable evidence keeps the hold unresolved and termination-blocking. `expiresAt` only triggers diagnostics or repair and never auto-releases an unresolved hold. The current implementation has no hold record, coordinated wire/RPC surface, termination predicate, or focused proof; those remain target implementation gaps.

### Initial admission bind hold ownership

The initial realm bind uses a separate World-owned hold because it has no source pointer or source runtime to preserve. Its durable record binds one stable request identity and canonical digest, opaque hold identity and equality-only fence, exact `{tenantId, realmId, playableStateNamespaceId, playableStateScope}`, initial no-prior-pointer condition, target `gameInstanceId`/`versionId` and exact `ACTIVE` epoch, and `catalogRevision`. It is separate from the replacement hold and from the lifecycle state machine. The hold acquire transaction serializes on the target `world_instance` lifecycle row, verifies the exact `ACTIVE` epoch, and rejects a conflicting nonterminal hold; it performs no remote reads while the World transaction is open.

The World termination compare-and-set checks that neither an initial-bind nor replacement hold is nonterminal under the same lifecycle-row serialization. A held instance cannot enter `TERMINATING` or advance its lifecycle epoch. Resolving the hold does not weaken ordinary termination: the stable cleanup request, frozen owner/registry snapshot, owner acknowledgements, and final `TERMINATED` compare-and-set remain in force. Game Session must atomically commit the first pointer, matching append-only audit, and terminal attempt outcome in its own database; World then uses authenticated exact owner readback to finalize or to accept only a durable `ABORTED` outcome bound to the same hold/tuple that prevents a later commit for that attempt. Missing, pending, unavailable, mismatched, or contradictory evidence leaves the hold nonterminal. Durable records and the automatic reconciliation path recover the exact identity/fence after response loss or restart; timeout or expiry only triggers repair and never auto-releases the hold. The full normative contract is in [Initial Admission Bind Hold Contract](./api-contracts.md#initial-admission-bind-hold-contract).

World now persists the initial-bind hold separately and includes it in the lifecycle-row termination check. Its scheduled reconciler uses the method-specific authenticated Game Session owner-proof reader; unavailable, ambiguous, or mismatched evidence keeps the hold nonterminal and termination-blocking. PostgreSQL-backed race/restart and live Compose proof remain unclaimed. See the [World API contract](./api-contracts.md#initial-admission-bind-hold-contract) and [World Runtime and Movement tracker](../../../project-management/implementation-tracking/world-runtime-and-movement.md) for the canonical contract and current proof status.

### Runtime configuration and events

- `generation_rule_template`, or equivalent version-scoped tables, stores publish-affecting procedural-generation inputs keyed by `(tenantId, versionId)` for Draft/Published design data.
Expand Down
Loading
Loading