[PR #3724] [MERGED] fix: preserve Hierarchical Maps chat selections on upgrade #6072

Closed
opened 2026-10-23 04:06:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3724
Author: @thetopham
Created: 7/16/2026
Status: ✅ Merged
Merged: 7/17/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/3723-hierarchical-maps-activation


📝 Commits (2)

  • c0e9d85 test: reproduce maps activation migration
  • 3c2004a fix: preserve hierarchical maps chat selections

📊 Changes

4 files changed (+305 additions, -27 deletions)

View changed files

📝 packages/server/src/services/capability-packages/legacy-capability-chat-migration.ts (+42 -11)
📝 packages/server/src/services/capability-packages/legacy-capability-migration.ts (+27 -6)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+34 -1)
📝 scripts/regressions/capability-package-lifecycle.regression.ts (+202 -9)

📄 Description

Linked issue

Closes #3723

Why this change

  • Marinara Engine v2.3.2's one-time legacy capability migration unconditionally adds Hierarchical Maps to every existing roleplay, game, and legacy visual-novel chat. That overwrites per-chat opt-in state and can unexpectedly activate the tracker after an update.

What changed

  • Stopped the legacy capability migration from adding Hierarchical Maps to chats that never selected it.
  • Added a durable one-time correction marker that distinguishes fresh installs, direct upgrades to the fixed release, and installations that already completed the faulty v2.3.2 migration.
  • For affected installations only, remove the Maps selection when a chat has neither a persisted spatial definition with locations nor any spatial snapshot. Preserve enableAgents, timestamps, other selected agents, and every chat with actual map data.
  • Added pure, orchestration-order, marker-classification, storage-backed, preservation, and idempotence regression coverage.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated validation performed:

  • pnpm regression:issues passes after pnpm build:shared refreshed the previously stale shared build.
  • Focused capability lifecycle regression passes independently.
  • Shared/server lint passes.
  • Client ESLint passes with the unrelated untracked dist.before-game-setup-import-20260716/ backup explicitly ignored.
  • pnpm build passes.
  • pnpm check reaches client ESLint but cannot pass unchanged while that preserved backup directory is inside the client workspace; ESLint reports errors from its minified build assets.

Manual verification notes

  • Restarted the local marinara.service after the completed build.
  • Verified /api/health reports ok and the exact hashed JavaScript bundle referenced by packages/client/dist/index.html returns HTTP 200.
  • Audited aggregate live saved state without reading chat content: all five chats selecting Maps have persisted map data; the correction removed zero live selections.
  • Browser click-through remains for a human contributor.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Not applicable; this is a server-side startup migration fix.


🔄 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-Engine/pull/3724 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 7/16/2026 **Status:** ✅ Merged **Merged:** 7/17/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/3723-hierarchical-maps-activation` --- ### 📝 Commits (2) - [`c0e9d85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c0e9d85be3a287590ce56ca39a7c33389df82c1f) test: reproduce maps activation migration - [`3c2004a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3c2004ae21ebac026ba6ac66b10800ca76deb48d) fix: preserve hierarchical maps chat selections ### 📊 Changes **4 files changed** (+305 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/capability-packages/legacy-capability-chat-migration.ts` (+42 -11) 📝 `packages/server/src/services/capability-packages/legacy-capability-migration.ts` (+27 -6) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+34 -1) 📝 `scripts/regressions/capability-package-lifecycle.regression.ts` (+202 -9) </details> ### 📄 Description ## Linked issue Closes #3723 ## Why this change - Marinara Engine v2.3.2's one-time legacy capability migration unconditionally adds Hierarchical Maps to every existing roleplay, game, and legacy visual-novel chat. That overwrites per-chat opt-in state and can unexpectedly activate the tracker after an update. ## What changed - Stopped the legacy capability migration from adding Hierarchical Maps to chats that never selected it. - Added a durable one-time correction marker that distinguishes fresh installs, direct upgrades to the fixed release, and installations that already completed the faulty v2.3.2 migration. - For affected installations only, remove the Maps selection when a chat has neither a persisted spatial definition with locations nor any spatial snapshot. Preserve `enableAgents`, timestamps, other selected agents, and every chat with actual map data. - Added pure, orchestration-order, marker-classification, storage-backed, preservation, and idempotence regression coverage. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated validation performed: - `pnpm regression:issues` passes after `pnpm build:shared` refreshed the previously stale shared build. - Focused capability lifecycle regression passes independently. - Shared/server lint passes. - Client ESLint passes with the unrelated untracked `dist.before-game-setup-import-20260716/` backup explicitly ignored. - `pnpm build` passes. - `pnpm check` reaches client ESLint but cannot pass unchanged while that preserved backup directory is inside the client workspace; ESLint reports errors from its minified build assets. ### Manual verification notes - Restarted the local `marinara.service` after the completed build. - Verified `/api/health` reports `ok` and the exact hashed JavaScript bundle referenced by `packages/client/dist/index.html` returns HTTP 200. - Audited aggregate live saved state without reading chat content: all five chats selecting Maps have persisted map data; the correction removed zero live selections. - Browser click-through remains for a human contributor. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Not applicable; this is a server-side startup migration fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:06:51 +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-Engine#6072
No description provided.