Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bc3faea
Merge commit 'f8ae1ad8d493cffdbb96a8a692f35e109582043b' into codex/un…
benhook1013 Oct 6, 2026
e34fe76
feat: reconstruct canonical World preparation from owner readbacks
benhook1013 Oct 6, 2026
c241ea4
Merge commit '514b91070cbda27bea85c77adb7815dfafc77e18' into codex/un…
benhook1013 Oct 6, 2026
067bfbb
Bind authenticated canonical preparation to actual World owner readback
benhook1013 Oct 6, 2026
b0d2d76
Merge commit 'e7517a874d55242e373a3e2083d709ee4e0242e7' into codex/un…
benhook1013 Oct 6, 2026
fb05da3
Correct preparation fixture APIs and apply canonical formatting
benhook1013 Oct 6, 2026
bad657c
Assign independent World operational region labels without retained b…
benhook1013 Oct 6, 2026
a38a40d
Merge branch 'codex/unit1b-world-operational-region-carrier' into cod…
benhook1013 Oct 6, 2026
75c620b
Document scoped World region assignment and preserve validated proof …
benhook1013 Oct 6, 2026
9541432
test(world): compose preparation mTLS with actual owner store proof
benhook1013 Oct 6, 2026
bc0c25a
Add denied canonical World initial actor placement storage and proof
benhook1013 Oct 7, 2026
463c357
Add denied same-snapshot World initial-location and region readback
benhook1013 Oct 7, 2026
0a6e9ad
Merge commit '2b5dbed435d6fe1632d149f8b42282b59e9b1a84' into codex/un…
benhook1013 Oct 7, 2026
1e715b9
Add protected canonical World activation delivery and store proof
benhook1013 Oct 7, 2026
9facaf5
Merge corrected canonical World activation source into delivery
benhook1013 Oct 7, 2026
b4e83b9
Define canonical initial-admission hold identity and shared vectors
benhook1013 Oct 7, 2026
a7f8f6f
Share closed placement carrier and retain canonical region readback
benhook1013 Oct 7, 2026
6a57653
Add protected canonical World player-location delivery
benhook1013 Oct 7, 2026
40b7b6e
Preserve canonical World admission hold foundation pending typed fina…
benhook1013 Oct 7, 2026
d975265
Prove and format canonical player-location transport
benhook1013 Oct 7, 2026
1c06242
Remove unused player-location test helper
benhook1013 Oct 7, 2026
f9f6346
Preserve typed hold delivery and retained migration proof definitions
benhook1013 Oct 7, 2026
6ebd4b3
Propagate observed pre-CAS activation loss proof correction
benhook1013 Oct 7, 2026
869af3d
Preserve published carrier prerequisites in local canonical hold prep…
benhook1013 Oct 7, 2026
66340f7
Preserve validated canonical hold foundation and explicit remaining g…
benhook1013 Oct 7, 2026
7902718
Prove canonical pending-hold fixtures and preserve honest validation …
benhook1013 Oct 7, 2026
5d44929
Merge published World delivery into preserved canonical hold preparation
benhook1013 Oct 7, 2026
8ea01b0
Preserve shared canonical owner proof and both initial-placement origins
benhook1013 Oct 7, 2026
2feadda
Compose canonical World hold terminal proof and typed placement consu…
benhook1013 Oct 7, 2026
1ef701d
Keep owner-proof codec null validation explicit
benhook1013 Oct 7, 2026
4ecc92b
style(world): apply canonical owner client formatting
benhook1013 Oct 7, 2026
a36b152
Merge commit 'a9f32559fd6235a1a345048e75be207d4fc9759c' into codex/un…
benhook1013 Oct 7, 2026
4243ed5
docs: distinguish database and mocked settlement proof
benhook1013 Oct 7, 2026
c05c9ff
merge: retain Account real-store reconciliation proof
benhook1013 Oct 7, 2026
0ace638
fix(world): preserve both canonical placement origins in SQL proof
benhook1013 Oct 7, 2026
59eb1d2
Merge commit 'd3ec30d5de9a9011b77eaa39649ef04cf1a2e1e2' into codex/un…
benhook1013 Oct 7, 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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ World templates follow the same stability rules as entity templates:

## Character Location Ownership

Target ownership (not current storage): World Management is the authoritative owner of character and NPC location for each game instance. The current implementation has live `room_instance` topology and a Game Session room-binding seam, but no authoritative character/NPC location or occupancy persistence.
World Management is the authoritative owner of character and NPC location for each game instance. The current implementation has live `room_instance` topology and an unregistered, default-denied canonical initial-character-placement storage primitive; it does not yet supply an authenticated gameplay location or occupancy surface.

- Target owner tables such as `character_location` and `npc_location` would live in this service’s schema and be written only by World Management logic as part of movement, instancing, and world-creation flows invoked by Game Session; those tables and the write family are absent from the current schema, migrations, and runtime implementation.
- V46 adds World-local `character_location` and an immutable initial-placement operation/result journal. The primitive binds the complete canonical actor/namespace/instance scope, exact Entity assignment, committed initial-admission hold and current ACTIVE lifecycle to V42's typed authored ROOM and runtime mapping. It requires fresh held authority on every attempt, including retries; the default verifier denies. Authenticated Entity/Account/Game Session producer composition, registration, movement, NPC location and occupancy delivery remain open.
- Initial-placement identity omits only the lifecycle read's correlation UUID; the original complete proof bytes remain retained. Exact retry returns the original result only after current authority, lifecycle and matching location-row readback; missing placement is denial, not permission to reconstruct it. The current stored hold proves only `NO_PRIOR_POINTER`; `EXPECT_CLOSED` remains denied until the tagged hold and canonical never-OPEN pointer evidence are implemented. Cleanup and complete owner-registry coverage remain activation gates; this primitive defines no retention horizon.
- Once implemented, other services, including Entity Management and Game Session, will treat those tables as read-only and rely on World Management gRPC APIs or cached projections. Current room reads and the Game Session binding do not establish that target authority.
- Target rule: derived caches or denormalized views of location must be refreshed from World Management rather than persisting independent authoritative location fields.

Expand All @@ -55,7 +56,7 @@ Target ownership: World Management is the fact owner for targeting predicates ov

Movement, drops, pickups, and room presence are cross-service by design:

- Target: World Management is authoritative for occupancy/location and room-scoped persistent ambient state keyed by runtime `RoomInstanceRef`; current `room_instance` topology and ambient rows do not include the absent character/NPC location or occupancy write family. Weather is an explicit exception while its target aggregate remains unresolved: the owner must choose and accept a region-scoped or room-scoped selector before any Weather identity or mutation can be defined. Weather mutation admission and reconciliation remain fenced and non-mutating until that selector is accepted, including writes represented by `world_event` and `region_instance.weather`. Initial Weather scheduling during world creation and generic `WEATHER_CHANGE` event scheduling/application follow the same rule: while the selector is unresolved they are explicitly deferred and non-mutating, so no Weather event row is inserted or processed and `region_instance.weather` is not changed.
- Target: World Management is authoritative for occupancy/location and room-scoped persistent ambient state keyed by runtime `RoomInstanceRef`; the initial-placement primitive above is not the complete movement, NPC or occupancy write family. Weather is an explicit exception while its target aggregate remains unresolved: the owner must choose and accept a region-scoped or room-scoped selector before any Weather identity or mutation can be defined. Weather mutation admission and reconciliation remain fenced and non-mutating until that selector is accepted, including writes represented by `world_event` and `region_instance.weather`. Initial Weather scheduling during world creation and generic `WEATHER_CHANGE` event scheduling/application follow the same rule: while the selector is unresolved they are explicitly deferred and non-mutating, so no Weather event row is inserted or processed and `region_instance.weather` is not changed.
- Entity Management is authoritative for containment and item instances, including synthetic room-ground containers keyed by the same `RoomInstanceRef`.
- All spatial effects must carry the target `RoomInstanceRef` and a canonical tick root `EffectId`; correctness-sensitive mutations also carry exact epoch and relevant owner-state preconditions.
- `DROP` and `PICKUP` use the canonical Game Session barrier/attestation sequence before the Entity-local holder commit; World Management owns only the World fact validation and attestation issuance. The binding and handoff rules are defined in [Transaction Strategies](../../system-architecture-transactions.md#drop-pickup-targeting-and-actor-fence-critical-section) and [ADR 0054](../../decisions/adr-0054-split-spatial-authority-with-causal-read-composition.md). The current proto/request and focused proof do not yet demonstrate this validation path.
Expand Down Expand Up @@ -104,11 +105,12 @@ When changing Redis usage or adding prefixes here, follow the [Redis Design Chec
- `zone_instance`, `room_instance`, and `room_instance_exit` are now live as runtime topology storage keyed by `(tenantId, gameInstanceId, ...)`, so the main named follow-through work has moved from topology rows to later runtime world-state families.

- `region_instance`, `zone_instance`, `room_instance`, and `room_instance_exit` materialize topology for a running game instance based on the chosen version and any runtime procedural generation.
- The preparation candidate adds a nullable `region_instance.operational_region_id` assignment and immutable scoped ownership checks. Fresh repository inserts and the canonical SQL materializer allocate it independently of the canonical topology UUID; retained rows remain unassigned. The [World preparation contract](./api-contracts.md#canonical-instance-activation-and-lifecycle-readback) owns the label-to-Game-Session registration handoff. This column is not Game Session's operational epoch/fence or proof that registration, player placement or activation has executed; the [World tracker](../../../project-management/implementation-tracking/world-runtime-and-movement.md#current-status) records those gates.
- `instance` is the live legacy temporary-zone-copy table used for instanced gameplay. Its rows are tenant-scoped zone children (`zone_id`, `owner_account_id`, `created_at`, `expires_at`) and are not keyed by the modern `gameInstanceId`; its current `expires_at` job deletes rows directly. This is implementation drift, not the ADR 0123 `world_instance` lifecycle, and `expires_at` does not authorize a transition of the parent game instance. For replacement classification, the family is explicitly `S3` and **excluded from replacement mapping/cutover**: it is not copied into a target instance, and a replacement report must state that exclusion rather than claiming exhaustive mapping for this legacy family. Target cleanup either migrates the temporary content into a complete `world_instance` with its own `gameInstanceId` and fenced `InstanceTermination`, or retains a separate zone-scoped idempotent cleanup contract that cannot terminate the parent.
- `world_instance_status`, or equivalent lifecycle state, tracks the ADR 0123 transitions `PREPARING -> ACTIVE`, `PREPARING -> FAILED_PRE_ACTIVATION`, `PREPARING -> TERMINATING`, `FAILED_PRE_ACTIVATION -> TERMINATING`, `ACTIVE -> TERMINATING`, and `TERMINATING -> TERMINATED`.
- `FAILED_PRE_ACTIVATION` is terminal for admission by that `gameInstanceId`, not proof that cleanup completed; separate owner-scoped cleanup progress may continue. Recovery is modeled as provisioning a new `gameInstanceId` and rerunning world creation.
- `world_instance_lifecycle_lock`, or equivalent fenced token, enforces single-writer lifecycle transitions per `(tenantId, gameInstanceId)`.
- Target-only: `character_location` and `npc_location` would record current rooms and instance occupancy. These tables are absent from the current schema and runtime; live `room_instance` rows describe topology, while the Game Session room binding is not authoritative World location.
- V46's `character_location` records only canonical initial placement, with its separate immutable operation/result journal; the default-denied primitive and remaining gates are described under [Character Location Ownership](#character-location-ownership). `npc_location`, movement and authoritative occupancy delivery remain absent. Live `room_instance` rows describe topology, while the Game Session room binding is not authoritative World location.

### Replacement cutover hold ownership

Expand Down Expand Up @@ -153,13 +155,16 @@ The exhaustive S1/S2/S3 rules, unknown-state fail-closed behavior, namespace mod
- current `world_instance` lifecycle rows (lifecycle/provisioning state, not replacement payload);
- `region_instance`, `zone_instance`, `room_instance`, `room_instance_exit`;
- legacy `instance` rows (explicit replacement mapping `EXCLUDED`; cleanup is the separate zone-scoped legacy-instance operation, not parent `InstanceTermination`);
- Target-only/absent in the current initial slice: `character_location`, `npc_location`, and occupancy rows;
- Candidate instance-scoped `character_location`; complete registry and cleanup proof remain open before activation;
- Target-only/absent in the current initial slice: `npc_location` and occupancy delivery;
- ambient runtime state such as weather, door state, hazard state, instanced events, and instance-scoped schedules;
- `world_event` rows tied to a specific `gameInstanceId`.
- Target-only/absent in current persistence: `population_schedule_instance` rows keyed by `gameInstanceId`;
- Target-only/absent in current persistence: runtime-instance `generation_run` rows, which are diagnostic or provenance only if later recorded.

Local consequence: the current World-owned runtime persistence includes `world_instance` lifecycle rows, `region_instance`, `zone_instance`, `room_instance`, `room_instance_exit`, and `world_event`; ambient behavior is only partial in the current slice because `region_instance.weather` and the Weather event storage exist, while new Weather scheduling and retained Weather application are now fail-closed. The target Weather path remains fenced and non-mutating until its selector and typed effect contract are accepted; door/hazard state, instanced-event state, and instance-scoped schedules are target-only or absent. Target-only/absent `population_schedule_instance` is classified `S3` when implemented, and target-only/absent runtime-instance `generation_run` remains diagnostic/provenance only if later recorded, never replacement payload; the legacy `instance` family is likewise explicitly `S3` but excluded from replacement mapping, and its separate cleanup operation is not lifecycle cleanup. The target-only location/occupancy families would also be `S3` when implemented, and no World-owned initial-slice family is mandatory `S2`. World Management must not silently copy room ambient state, occupancy, scheduled world events, generated instance topology, `population_schedule_instance` rows, runtime-instance `generation_run` rows, or legacy `instance` rows into the target instance. Any new family must be registered with its owner, classification, mapping/application contract where applicable, cleanup operation, and freshness evidence before launch or cutover can use it. The live first validation cut remains shallow: it checks a cutover-eligible source lifecycle and retained topology, but does not prove the complete ADR 0122 preflight.
The new initial-placement operation/result journal requires its own explicit registry/classification and replay-retention disposition before activation. The location family's `S3` classification does not establish permission to discard immutable operation evidence.

Local consequence: the current World-owned runtime persistence includes `world_instance` lifecycle rows, `region_instance`, `zone_instance`, `room_instance`, `room_instance_exit`, and `world_event`; the candidate additionally includes default-denied initial-character-placement storage and its operation/result journal. Ambient behavior is only partial in the current slice because `region_instance.weather` and the Weather event storage exist, while new Weather scheduling and retained Weather application are now fail-closed. The target Weather path remains fenced and non-mutating until its selector and typed effect contract are accepted; door/hazard state, instanced-event state, and instance-scoped schedules are target-only or absent. Target-only/absent `population_schedule_instance` is classified `S3` when implemented, and target-only/absent runtime-instance `generation_run` remains diagnostic/provenance only if later recorded, never replacement payload; the legacy `instance` family is likewise explicitly `S3` but excluded from replacement mapping, and its separate cleanup operation is not lifecycle cleanup. Location/occupancy remains instance-scoped `S3`, and no World-owned initial-slice family is mandatory `S2`. World Management must not silently copy room ambient state, occupancy, scheduled world events, generated instance topology, `population_schedule_instance` rows, runtime-instance `generation_run` rows, or legacy `instance` rows into the target instance. Any new family must be registered with its owner, classification, mapping/application contract where applicable, cleanup operation, and freshness evidence before launch or cutover can use it. The live first validation cut remains shallow: it checks a cutover-eligible source lifecycle and retained topology, but does not prove the complete ADR 0122 preflight.

## Digest Input Manifest

Expand Down
8 changes: 8 additions & 0 deletions design/project-management/ai-observations.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,11 @@ Entry format:
- `2026-10-07`: Do not feed truncated command captures into a mechanical patch
- Context: a source-stage preservation attempt read a large CI workflow through a bounded command capture. The truncation notice entered the proposed patch; `apply_patch` rejected it before modifying the isolated worktree.
- Outcome: use the bounded actual diff for tracked files, check captures for truncation before constructing a patch, and read complete content only for small new files. The retry preserved the source stage without changing the concurrently prepared carrier.

- `2026-10-07`: Active work in temporary directories may not survive an execution-environment replacement
- Context: an environment replacement removed Document's `/tmp` worktrees, uncommitted activation transport, validation logs and active process handles while published refs and saved session captures survived. Its cause remains unknown; a default-shell launch also began failing until an explicit `/bin/bash` was selected.
- Outcome: all in-scope patches were recovered from their successful captured edits into durable `/home/ben/src` worktrees, locally checkpointed and freshly validated before normal publication. Historical cached outputs were kept distinct from fresh execution. Use durable active worktrees and make a local preservation commit before a substantial wait; do not count a vanished process or historical log as current-candidate proof.

- `2026-10-07`: Integration source sets and raw XML do not establish database proof by themselves
- Context: source CI 37569958133 executed 131 named cases without skips, but three Account terminal-reconciliation cases use mocked repositories/clients and a synthetic transaction manager. Document initially described the combined count as PostgreSQL proof.
- Outcome: inspecting the actual test boundary corrected the split to 128 PostgreSQL cases plus three non-database component cases. PR bodies and controller evidence were corrected; genuine two-owner settlement remains open. Classify the executed fixture's real storage and transport boundary before assigning database or authenticated-owner proof, regardless of its source-set or artifact name.
Loading
Loading