[PR #207] [MERGED] feat(maps): preserve portable lore links #855

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/207
Author: @thetopham
Created: 8/2/2026
Status: ✅ Merged
Merged: 8/2/2026
Merged by: @thetopham

Base: staging ← Head: feat/world-map-portable-lore


📝 Commits (6)

  • b44006c feat(maps): preserve portable lore links
  • d8dd7b9 Merge remote-tracking branch 'origin/staging' into feat/world-map-portable-lore-clean
  • eeccd52 test(maps): cover portable lore round trip
  • da122dc style(maps): remove trailing blank line
  • 6446d1d style(maps): restore component spacing
  • aa11415 fix(maps): address portable lore review

📊 Changes

15 files changed (+2480 additions, -295 deletions)

View changed files

➕ artifacts/hierarchical-maps-1.2.8.zip (+0 -0)
📝 catalog/catalog.json (+7 -7)
📝 catalog/v2/catalog.json (+7 -7)
📝 catalog/v3/catalog.json (+7 -7)
📝 packages/hierarchical-maps/client.js (+54 -54)
📝 packages/hierarchical-maps/manifest.json (+3 -3)
📝 packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/SpatialMapLibrary.tsx (+234 -88)
📝 packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/SpatialMapWorkspace.tsx (+523 -114)
➕ packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/components/PortableLoreImportDialog.tsx (+217 -0)
➕ packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/components/use-modal-keyboard-navigation.ts (+74 -0)
➕ packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/portable-lore.ts (+830 -0)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/hierarchical-maps-lifecycle.regression.ts (+11 -10)
➕ tests/map-lore-portability.regression.ts (+309 -0)
📝 tests/spatial-context.e2e.ts (+203 -4)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #181

Supersedes #206, which GitHub automatically marked merged when its stacked prerequisite #205 landed before the portable-lore commits were pushed.

Why this change

  • World Map JSON preserved local database lore-entry IDs without portable identity or remapping data, so moving a map to another installation broke its location lore links.
  • Missing links exposed opaque IDs instead of the original location, lorebook, and entry names needed for safe recovery.

What changed

  • Adds a versioned portable-lore bundle with map-only, linked-entry, and complete-lorebook export scopes.
  • Resolves imports by exact ID or unique full-content identity, never by name alone, and requires an explicit choice for ambiguous matches.
  • Restores lorebooks, nested folders, entry settings, and relationships before remapping the map, with rollback if import or map creation fails.
  • Keeps legacy v2/v3 map imports working and gives unresolved links descriptive relink, open, and detach actions.
  • Rebuilds World Maps 1.2.8 source-first, including the bundled client, manifest, artifact, and all catalog lanes.

Package and security impact

  • Affected package IDs: hierarchical-maps
  • Engine compatibility impact: none; uses existing lorebook and package APIs
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: ordinary package update; imported lorebooks remain independent of map deletion

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

Automated proof completed while reviewing:

  • Portable-lore regression covers export scopes, provenance, exact and content matches, ambiguous matches, the no-name-only rule, settings, folders, relationships, rollback, and remapping.
  • Exact World Maps 1.2.8 package lifecycle regression passes against Marinara Engine.
  • Catalog lane tests and catalog validation pass.
  • Focused desktop Chromium regression passes the full user cycle: export linked lore, delete the original lorebook, import as new IDs, save the remapped map, and confirm map deletion leaves the imported lorebook intact.

Manual verification notes

  • Manually verify map-only, linked-entry, and complete-lorebook export disclosures in the browser.
  • Manually verify exact-ID reuse, unique portable match reuse, separate-copy import, and ambiguous-match selection.
  • Manually verify chat maps, templates, and shared worlds rewrite location lore links before Save.
  • Manually verify existing v2/v3 files remain importable and truly missing entries retain descriptive recovery details.

Documentation impact

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

UI evidence

  • Automated browser coverage exercises the new export and restore dialogs plus the persisted remapping result. Manual visual review remains listed above.

Summary by CodeRabbit

  • New Features

    • Added portable lore export and import for maps, including linked entries, folders, settings, and complete lorebooks.
    • Added import previews with matching options, separate-copy or reuse choices, and rollback protection.
    • Added tools to resolve, relink, or detach unresolved lore references.
    • Added support for preserving lore relationships and metadata across map and artwork transfers.
  • Bug Fixes

    • Improved map import reliability and protection against duplicate or incomplete imports.
  • Chores

    • Updated the Hierarchical Maps package to version 1.2.8.

🔄 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/207 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 8/2/2026 **Status:** ✅ Merged **Merged:** 8/2/2026 **Merged by:** [@thetopham](https://github.com/thetopham) **Base:** `staging` ← **Head:** `feat/world-map-portable-lore` --- ### 📝 Commits (6) - [`b44006c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b44006cb0297e9ce699f062dca23d93685cf71ec) feat(maps): preserve portable lore links - [`d8dd7b9`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d8dd7b93dfd06d2644124f07c8ccd97dd1c039d7) Merge remote-tracking branch 'origin/staging' into feat/world-map-portable-lore-clean - [`eeccd52`](https://github.com/Pasta-Devs/Marinara-Agents/commit/eeccd52c00e4c7ac70f186585c39a42318c1b720) test(maps): cover portable lore round trip - [`da122dc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/da122dc3b8f4d1ddc7ef2893e978863e39a1755d) style(maps): remove trailing blank line - [`6446d1d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6446d1d164fec8786addfb7ad54aec372708114e) style(maps): restore component spacing - [`aa11415`](https://github.com/Pasta-Devs/Marinara-Agents/commit/aa11415d65407f990e4fbb335283a2fe8f5a68b7) fix(maps): address portable lore review ### 📊 Changes **15 files changed** (+2480 additions, -295 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/hierarchical-maps-1.2.8.zip` (+0 -0) 📝 `catalog/catalog.json` (+7 -7) 📝 `catalog/v2/catalog.json` (+7 -7) 📝 `catalog/v3/catalog.json` (+7 -7) 📝 `packages/hierarchical-maps/client.js` (+54 -54) 📝 `packages/hierarchical-maps/manifest.json` (+3 -3) 📝 `packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/SpatialMapLibrary.tsx` (+234 -88) 📝 `packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/SpatialMapWorkspace.tsx` (+523 -114) ➕ `packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/components/PortableLoreImportDialog.tsx` (+217 -0) ➕ `packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/components/use-modal-keyboard-navigation.ts` (+74 -0) ➕ `packages/hierarchical-maps/src/engine/packages/client/src/features/spatial-context/portable-lore.ts` (+830 -0) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/hierarchical-maps-lifecycle.regression.ts` (+11 -10) ➕ `tests/map-lore-portability.regression.ts` (+309 -0) 📝 `tests/spatial-context.e2e.ts` (+203 -4) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #181 Supersedes #206, which GitHub automatically marked merged when its stacked prerequisite #205 landed before the portable-lore commits were pushed. ## Why this change - World Map JSON preserved local database lore-entry IDs without portable identity or remapping data, so moving a map to another installation broke its location lore links. - Missing links exposed opaque IDs instead of the original location, lorebook, and entry names needed for safe recovery. ## What changed - Adds a versioned portable-lore bundle with map-only, linked-entry, and complete-lorebook export scopes. - Resolves imports by exact ID or unique full-content identity, never by name alone, and requires an explicit choice for ambiguous matches. - Restores lorebooks, nested folders, entry settings, and relationships before remapping the map, with rollback if import or map creation fails. - Keeps legacy v2/v3 map imports working and gives unresolved links descriptive relink, open, and detach actions. - Rebuilds World Maps 1.2.8 source-first, including the bundled client, manifest, artifact, and all catalog lanes. ## Package and security impact - Affected package IDs: `hierarchical-maps` - Engine compatibility impact: none; uses existing lorebook and package APIs - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: ordinary package update; imported lorebooks remain independent of map deletion ## 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` Automated proof completed while reviewing: - Portable-lore regression covers export scopes, provenance, exact and content matches, ambiguous matches, the no-name-only rule, settings, folders, relationships, rollback, and remapping. - Exact World Maps 1.2.8 package lifecycle regression passes against Marinara Engine. - Catalog lane tests and catalog validation pass. - Focused desktop Chromium regression passes the full user cycle: export linked lore, delete the original lorebook, import as new IDs, save the remapped map, and confirm map deletion leaves the imported lorebook intact. ### Manual verification notes - [ ] Manually verify map-only, linked-entry, and complete-lorebook export disclosures in the browser. - [ ] Manually verify exact-ID reuse, unique portable match reuse, separate-copy import, and ambiguous-match selection. - [ ] Manually verify chat maps, templates, and shared worlds rewrite location lore links before Save. - [ ] Manually verify existing v2/v3 files remain importable and truly missing entries retain descriptive recovery details. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence - Automated browser coverage exercises the new export and restore dialogs plus the persisted remapping result. Manual visual review remains listed above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added portable lore export and import for maps, including linked entries, folders, settings, and complete lorebooks. * Added import previews with matching options, separate-copy or reuse choices, and rollback protection. * Added tools to resolve, relink, or detach unresolved lore references. * Added support for preserving lore relationships and metadata across map and artwork transfers. * **Bug Fixes** * Improved map import reliability and protection against duplicate or incomplete imports. * **Chores** * Updated the Hierarchical Maps package to version 1.2.8. <!-- 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:31:39 +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#855
No description provided.