[GH-ISSUE #5144] No runtime API to add World Maps locations — Experiences cannot register their generated places #2843

Closed
opened 2026-10-21 05:56:42 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5144

Originally assigned to: @kolacheee on GitHub.

The problem

Pixelforge 0.4.0 generates a world — a settlement, interiors, wilds — from the player's preferences. None of those places can be registered with World Maps, because there is no runtime write API for locations. The only mid-play definition write today is the GM's [spatial_discover:] directive (one place, GM-initiated); the editor PUT is a full-replace UI flow. Pixelforge's World Brief spec had to mark its World Maps export "deferred" for exactly this reason, and its map bindings work only because the package binds zones to whatever locations already exist.

Try it yourself

Create a Pixelforge game with the sci-fi theme and let generation finish: the compiled world has four zones, but Map shows only whatever the create-time map generation produced — the generated places (the bar, operations, the flats) are not locations, so travel and GM spatial context cannot reference them.

The ask

An additive location-add/update route, e.g. POST /api/chats/:chatId/spatial-context/locations with { expectedRevision, locations: [...] }. Research notes for whoever implements:

  • It must live in the hierarchical-maps package (the engine core has no definition parser, and packages have no server-side getService to call each other — an HTTP route is the contract Experience authors code against).
  • Everything needed already exists: per-location validation (spatialLocationSchema), whole-definition invariants (validateSpatialContextDefinition — parent existence, cycles, ≤500 locations), revision CAS with 409 like the editor PUT, and the definition_repair snapshot tail.
  • Accept optional caller-supplied ids (Experiences want deterministic references) with server-side loc_<nanoid> allocation as the default, like spatial_discover.
  • A revision bump 409s any queued owner move into needs_review — by design; an add route accepts that.
  • The client map UI caches its GET for 30s; the route should emit a spatial_definition_updated capability event so the World Maps bundle and Experience surfaces can invalidate immediately (no such event exists today because the editor is the only writer).
Originally created by @kolacheee on GitHub (Aug 16, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5144 Originally assigned to: @kolacheee on GitHub. ### The problem Pixelforge 0.4.0 generates a world — a settlement, interiors, wilds — from the player's preferences. None of those places can be registered with World Maps, because there is no runtime write API for locations. The only mid-play definition write today is the GM's `[spatial_discover:]` directive (one place, GM-initiated); the editor PUT is a full-replace UI flow. Pixelforge's World Brief spec had to mark its World Maps export "deferred" for exactly this reason, and its map bindings work only because the package binds zones to whatever locations already exist. ### Try it yourself Create a Pixelforge game with the sci-fi theme and let generation finish: the compiled world has four zones, but **Map** shows only whatever the create-time map generation produced — the generated places (the bar, operations, the flats) are not locations, so travel and GM spatial context cannot reference them. ### The ask An additive location-add/update route, e.g. `POST /api/chats/:chatId/spatial-context/locations` with `{ expectedRevision, locations: [...] }`. Research notes for whoever implements: - It must live in the **hierarchical-maps package** (the engine core has no definition parser, and packages have no server-side `getService` to call each other — an HTTP route is the contract Experience authors code against). - Everything needed already exists: per-location validation (`spatialLocationSchema`), whole-definition invariants (`validateSpatialContextDefinition` — parent existence, cycles, ≤500 locations), revision CAS with 409 like the editor PUT, and the `definition_repair` snapshot tail. - Accept optional caller-supplied ids (Experiences want deterministic references) with server-side `loc_<nanoid>` allocation as the default, like `spatial_discover`. - A revision bump 409s any queued owner move into `needs_review` — by design; an add route accepts that. - The client map UI caches its GET for 30s; the route should emit a `spatial_definition_updated` capability event so the World Maps bundle and Experience surfaces can invalidate immediately (no such event exists today because the editor is the only writer).
Author
Owner

@kolacheee commented on GitHub (Aug 16, 2026):

Ownership: @kolacheee (agent-assisted). Implementation is up as Marinara-Agents draft PR Pasta-Devs/Marinara-Agents#387 (World Maps 1.4.0) — the route lives in the hierarchical-maps package per this issue's research notes (the engine core has no definition parser and packages cannot call each other server-side). Live-verified against engine staging: batch adds with in-batch subtrees, revision CAS, duplicate-id and missing-parent contracts all behave as specced. The spatial_definition_updated client event remains deferred as noted (no server→client push channel exists outside generation; the response returns the full refreshed context instead). Next consumer: Pixelforge 0.5.x un-defers its World Brief §8 export onto this route.

<!-- gh-comment-id:5308447078 --> @kolacheee commented on GitHub (Aug 16, 2026): Ownership: @kolacheee (agent-assisted). Implementation is up as Marinara-Agents draft PR Pasta-Devs/Marinara-Agents#387 (World Maps 1.4.0) — the route lives in the hierarchical-maps package per this issue's research notes (the engine core has no definition parser and packages cannot call each other server-side). Live-verified against engine staging: batch adds with in-batch subtrees, revision CAS, duplicate-id and missing-parent contracts all behave as specced. The `spatial_definition_updated` client event remains deferred as noted (no server→client push channel exists outside generation; the response returns the full refreshed context instead). Next consumer: Pixelforge 0.5.x un-defers its World Brief §8 export onto this route.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2843
No description provided.