[PR #389] [MERGED] feat(pixelforge): 0.5.0 — export the generated world into World Maps (#388) #947

Closed
opened 2026-10-20 17:32:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/389
Author: @kolacheee
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @kolacheee

Base: staging ← Head: feat/388-pixelforge-world-maps-export


📝 Commits (5)

  • ac38de4 feat(pixelforge): 0.5.0 — export the generated world into World Maps (#388)
  • b840a9b fix(pixelforge): adopt same-named authored locations; guard the accepted-but-invisible loop
  • e99365d chore(pixelforge): rebuild the 0.5.0 artifact with the adoption round
  • caf102b fix(pixelforge): world-identity export lifecycle — review round for #389
  • 4af808e fix(pixelforge): bound the export retry loop for every response sequence

📊 Changes

14 files changed (+1104 additions, -36 deletions)

View changed files

➕ artifacts/pixelforge-0.5.0.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 packages/pixelforge/client.js (+290 -3)
📝 packages/pixelforge/docs/brief-schema.md (+32 -9)
📝 packages/pixelforge/manifest.json (+3 -3)
📝 packages/pixelforge/src/00-prelude.js (+19 -0)
📝 packages/pixelforge/src/20-world.js (+6 -0)
📝 packages/pixelforge/src/50-spatial.js (+4 -0)
➕ packages/pixelforge/src/55-maps-export.js (+250 -0)
📝 packages/pixelforge/src/60-save.js (+7 -1)
📝 packages/pixelforge/test-brief.mjs (+474 -1)
📝 scripts/build-pixelforge-package.mjs (+1 -1)

📄 Description

Linked issue

Closes #388

Why this change

A Pixelforge game generates a whole settlement — zones, interiors, wilds — but the World Maps panel never learns any of it exists: generated places are invisible to travel, the map editor, and the GM's spatial context. World Maps 1.4.0 (Marinara-Engine#5144) shipped the missing additive write path, and 0.5.0 walks through it, un-deferring spec §8.

What changed

  • New src/55-maps-export.js: once the exterior binds to its starting location (the existing §50-spatial seed binding), every other compiled zone registers as a child of that location via POST /spatial-context/locations — interiors as building, wilds as place, zone flavor as the description. Location ids are seed-stable (pf.<fnv32(seed)>.<zoneId>), and the map definition itself is the idempotency ledger: ids already present are diffed out before posting, so re-runs (new sessions, rebuilds from the same brief) add nothing and merely re-bind. A root child that already carries a zone's name (hand edits, or a map created from the wizard's instructions) is adopted — bound instead of twinned, since the additive route could never merge duplicates later; a location bound to a different zone is never stolen. Stale/conflict 409s re-read and retry with the fresh revision, and both the 409 path and the accepted-but-never-visible path surrender after no-progress rounds so a live map-editing session (or a write-eating proxy) is never dueled. No hierarchical map, an older maps package without the route (404), or an archived parent all degrade quietly — the world plays on package state alone, exactly as before.
  • Bindings are the payoff: exported ids land in world.bindings (persisted by the existing save path), which is what makes Travel destinations and narrated drift teleport into generated zones. Bindings also self-heal from the definition when a save lost them.
  • 20-world.js stamps mapKind on zones (settlement/building/place); 00-prelude.js gains the postSpatialLocations REST helper; 50-spatial.js fire-and-forgets the export after refresh (all guards — done-key, in-flight, backoff, chat-switch generation — live inside the module).
  • Harness: 30 → 38 cases covering the idempotent diff + self-heal, adoption (incl. own-binding re-adoption after a save restore and never-steal), stale-CAS retry, conflict resolved by re-read, 404 quiet-skip (no bindings to absent locations), no-progress surrender + 60s backoff on both the 409 and accepted-but-invisible paths, and the chat-switch generation guard.
  • Spec §8 rewritten from "deferred" to the shipped behavior, with the deliberately-not-exported remainder (root population phrase, per-feature locations) noted.
  • Version 0.5.0; package rebuilt; catalog lanes regenerated.

Package and security impact

  • Affected package IDs: pixelforge
  • Engine compatibility impact: none — builtAgainst unchanged (2.4.3 @ bb551bf92). The consumed route belongs to the hierarchical-maps package (1.4.0); older maps installs 404 and Pixelforge skips quietly.
  • New or changed permissions/entrypoints: none. One new same-origin REST call (POST /api/chats/:chatId/spatial-context/locations) with the standard CSRF header; additive-only — it cannot edit or remove user-authored locations.
  • Restart, storage, update, or uninstall impact: none beyond the normal package update. Exported locations persist in the chat's map definition like hand-added ones; uninstalling Pixelforge leaves them as ordinary locations.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-run so far (treat as a to-do list to reconfirm):

  • node packages/pixelforge/test-brief.mjs — all 38 cases green, including the eight new export cases.
  • Live E2E on a playtest install (hierarchical-maps 1.4.0 + this build): fresh export created the three generated zones as children of the bound root with correct kinds and flavor descriptions and they appeared as travel destinations; a map that already named those places was ADOPTED (zero rows created, all three zones bound to the authored locations, verified across a save-restore round trip). Two live-found regressions from this loop are fixed in the second commit.
  • node scripts/validate-catalog.mjs and validate-package-locales.mjs — green; package rebuilt with node scripts/build-pixelforge-package.mjs (deterministic output, one-line version diff plus the new module in client.js).

Still needs a human pass:

  • Manually verify on a live install with hierarchical maps: create a Pixelforge game with a world map, let the brief generate, open the map panel — the generated interiors and wilds should appear as children of the starting location, and Travel to one should teleport the sprite world into that zone.
  • Manually verify the quiet-skip: a Pixelforge game without a hierarchical map should behave exactly as 0.4.1 (no console errors beyond the existing ones).

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

Package spec docs/brief-schema.md §8 updated in this PR; no engine-docs changes needed.

Summary by CodeRabbit

New Features

  • Added automatic World Maps export for generated zones.
  • Zones are organized under their bound exterior location with stable identifiers and descriptive classifications.
  • Exports support repeated updates, conflict recovery, stale-data cleanup, and unavailable-map handling.

Bug Fixes

  • Prevented incomplete worlds from being exported before generation finishes.
  • Improved recovery and consistency when saved worlds or locations change.

Release

  • Updated Pixelforge to version 0.5.0 with refreshed package metadata and artifacts.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/389 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/16/2026 **Status:** ✅ Merged **Merged:** 8/16/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/388-pixelforge-world-maps-export` --- ### 📝 Commits (5) - [`ac38de4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ac38de4f90a84a30eda9b50027be58c60485dfba) feat(pixelforge): 0.5.0 — export the generated world into World Maps (#388) - [`b840a9b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b840a9b8a3326479157ed2da0feb688f1a30b48e) fix(pixelforge): adopt same-named authored locations; guard the accepted-but-invisible loop - [`e99365d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e99365dd318fa6e0b91b52f20e455971b79afed3) chore(pixelforge): rebuild the 0.5.0 artifact with the adoption round - [`caf102b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/caf102b641c6619ed008c3d85070b116ae70dc76) fix(pixelforge): world-identity export lifecycle — review round for #389 - [`4af808e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4af808e6015e4028f9f8e60ec92e414a958160c3) fix(pixelforge): bound the export retry loop for every response sequence ### 📊 Changes **14 files changed** (+1104 additions, -36 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/pixelforge-0.5.0.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `packages/pixelforge/client.js` (+290 -3) 📝 `packages/pixelforge/docs/brief-schema.md` (+32 -9) 📝 `packages/pixelforge/manifest.json` (+3 -3) 📝 `packages/pixelforge/src/00-prelude.js` (+19 -0) 📝 `packages/pixelforge/src/20-world.js` (+6 -0) 📝 `packages/pixelforge/src/50-spatial.js` (+4 -0) ➕ `packages/pixelforge/src/55-maps-export.js` (+250 -0) 📝 `packages/pixelforge/src/60-save.js` (+7 -1) 📝 `packages/pixelforge/test-brief.mjs` (+474 -1) 📝 `scripts/build-pixelforge-package.mjs` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #388 ## Why this change A Pixelforge game generates a whole settlement — zones, interiors, wilds — but the World Maps panel never learns any of it exists: generated places are invisible to travel, the map editor, and the GM's spatial context. World Maps 1.4.0 (Marinara-Engine#5144) shipped the missing additive write path, and 0.5.0 walks through it, un-deferring spec §8. ## What changed - **New `src/55-maps-export.js`:** once the exterior binds to its starting location (the existing §50-spatial seed binding), every other compiled zone registers as a child of that location via `POST /spatial-context/locations` — interiors as `building`, wilds as `place`, zone flavor as the description. Location ids are seed-stable (`pf.<fnv32(seed)>.<zoneId>`), and the map definition itself is the idempotency ledger: ids already present are diffed out before posting, so re-runs (new sessions, rebuilds from the same brief) add nothing and merely re-bind. A root child that already carries a zone's name (hand edits, or a map created from the wizard's instructions) is **adopted** — bound instead of twinned, since the additive route could never merge duplicates later; a location bound to a different zone is never stolen. Stale/conflict 409s re-read and retry with the fresh revision, and both the 409 path and the accepted-but-never-visible path surrender after no-progress rounds so a live map-editing session (or a write-eating proxy) is never dueled. No hierarchical map, an older maps package without the route (404), or an archived parent all degrade quietly — the world plays on package state alone, exactly as before. - **Bindings are the payoff:** exported ids land in `world.bindings` (persisted by the existing save path), which is what makes Travel destinations and narrated drift teleport into generated zones. Bindings also self-heal from the definition when a save lost them. - `20-world.js` stamps `mapKind` on zones (settlement/building/place); `00-prelude.js` gains the `postSpatialLocations` REST helper; `50-spatial.js` fire-and-forgets the export after refresh (all guards — done-key, in-flight, backoff, chat-switch generation — live inside the module). - Harness: 30 → 38 cases covering the idempotent diff + self-heal, adoption (incl. own-binding re-adoption after a save restore and never-steal), stale-CAS retry, conflict resolved by re-read, 404 quiet-skip (no bindings to absent locations), no-progress surrender + 60s backoff on both the 409 and accepted-but-invisible paths, and the chat-switch generation guard. - Spec §8 rewritten from "deferred" to the shipped behavior, with the deliberately-not-exported remainder (root population phrase, per-feature locations) noted. - Version 0.5.0; package rebuilt; catalog lanes regenerated. ## Package and security impact - Affected package IDs: `pixelforge` - Engine compatibility impact: none — `builtAgainst` unchanged (2.4.3 @ bb551bf92). The consumed route belongs to the hierarchical-maps package (1.4.0); older maps installs 404 and Pixelforge skips quietly. - New or changed permissions/entrypoints: none. One new same-origin REST call (`POST /api/chats/:chatId/spatial-context/locations`) with the standard CSRF header; additive-only — it cannot edit or remove user-authored locations. - Restart, storage, update, or uninstall impact: none beyond the normal package update. Exported locations persist in the chat's map definition like hand-added ones; uninstalling Pixelforge leaves them as ordinary locations. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [x] Installed or updated the affected package through Marinara Engine - [x] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-run so far (treat as a to-do list to reconfirm): - `node packages/pixelforge/test-brief.mjs` — all 38 cases green, including the eight new export cases. - Live E2E on a playtest install (hierarchical-maps 1.4.0 + this build): fresh export created the three generated zones as children of the bound root with correct kinds and flavor descriptions and they appeared as travel destinations; a map that already named those places was ADOPTED (zero rows created, all three zones bound to the authored locations, verified across a save-restore round trip). Two live-found regressions from this loop are fixed in the second commit. - `node scripts/validate-catalog.mjs` and `validate-package-locales.mjs` — green; package rebuilt with `node scripts/build-pixelforge-package.mjs` (deterministic output, one-line version diff plus the new module in `client.js`). Still needs a human pass: - Manually verify on a live install with hierarchical maps: create a Pixelforge game with a world map, let the brief generate, open the map panel — the generated interiors and wilds should appear as children of the starting location, and Travel to one should teleport the sprite world into that zone. - Manually verify the quiet-skip: a Pixelforge game without a hierarchical map should behave exactly as 0.4.1 (no console errors beyond the existing ones). ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [x] Updated linked Marinara Engine documentation Package spec `docs/brief-schema.md` §8 updated in this PR; no engine-docs changes needed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## New Features * Added automatic World Maps export for generated zones. * Zones are organized under their bound exterior location with stable identifiers and descriptive classifications. * Exports support repeated updates, conflict recovery, stale-data cleanup, and unavailable-map handling. ## Bug Fixes * Prevented incomplete worlds from being exported before generation finishes. * Improved recovery and consistency when saved worlds or locations change. ## Release * Updated Pixelforge to version 0.5.0 with refreshed package metadata and artifacts. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-20 17:32:35 +07:00
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-Agents#947
No description provided.