[PR #1464] [MERGED] chore(long-term-memory): move server files into area folders (#1463) #1474

Closed
opened 2026-10-21 05:11:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1464
Author: @Promansis
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @Promansis

Base: staging ← Head: chore(long-term-memory)/server-folders


📝 Commits (1)

  • fe935d9 chore(long-term-memory): move server files into area folders (#1463)

📊 Changes

87 files changed (+546 additions, -487 deletions)

View changed files

📝 packages/long-term-memory/docs/ARCHITECTURE.md (+29 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-projector.ts (+14 -10)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-review.ts (+5 -5)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-store.ts (+9 -9)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts (+10 -10)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/rejected-suggestions.ts (+8 -8)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/candidate-reconciliation.ts (+5 -5)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/dedup.ts (+3 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-compiler.ts (+8 -8)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-extraction.ts (+12 -12)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-validation.ts (+6 -6)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts (+6 -6)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/scoped-targets.ts (+5 -5)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-extraction.ts (+15 -15)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-hash.ts (+3 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts (+11 -11)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/structured-summary-normalizer.ts (+2 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/chat-scope.ts (+3 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/identity-repair.ts (+16 -16)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/note-fork-repair.ts (+14 -14)

...and 67 more files

📄 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 #1463

Why this change

  • The Long-Term Memory server had 68 source files in one flat folder. The areas they belong to (persistence, recall, extraction, identity, drafts, maintenance) were visible only from file names, and docs/ARCHITECTURE.md had no map from area to files.
  • This move comes first because the planned LTM work (new sources, the recall service, and the subject-identity.ts, storage.ts and schema.ts splits) can then land inside these folders, instead of growing the flat folder and moving everything later.

What changed

Pure move, no behavior change. S = packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory.

S/
├── server-entry, runtime, package-runtime, routes, settings,
│   default-config, service-error, ltm-utils        # unchanged (8)
├── routes/        # unchanged (6)
├── persistence/   # storage, transactions, locks, index state, retention, backup and restore (14)
├── recall/        # chunking, indexes, ranking, budget, prompt, injection, usage (16)
├── extraction/    # evidence units, source processing and hashes, candidate reconciliation (11)
├── identity/      # subject identity, chat scope, identity and fork repair (7)
├── drafts/        # draft store, projection, review, applying drafts, rejected suggestions (5)
├── maintenance/   # integrity and repair, note transfer, legacy adoption, debug log (5)
└── sources/       # interop (Engine chats and summaries), source-identity (2)
  • 60 git mv renames, which git detects as renames (66–100 % similarity).
  • Only the relative import specifiers the move breaks were rewritten, by a script outside the repo: 365 in server files and 119 paths in 17 test files. Prettier then re-wrapped the lines that grew too long. No other line changed.
  • docs/ARCHITECTURE.md gains a "Server Modules" section with each folder, what it owns and its files. The Scope section now names the moved scope files with their folders.
  • Deviation from the issue: the issue planned to state an import direction with persistence/ as the bottom layer. The code doesn't follow that yet. storage.ts, backup-restore.ts, retention.ts and vault-snapshot.ts import from other areas, so the doc lists those imports instead of claiming a layering. Enforcing a direction needs code changes and a lint rule, both outside this issue.
  • No release. The rebuilt server.mjs and client.js are byte-identical to staging, because the bundle is minified and has no source paths. So there is no version bump, CHANGELOG entry, artifact or catalog change.

Package and security impact

  • Affected package IDs: long-term-memory (source and docs only; the published payload is unchanged)
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none (server-entry.ts stays at the top level, and the builder copies the folder recursively)
  • Restart, storage, update, or uninstall impact: none

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

Run by the agent on head fe935d9c9, with MARINARA_AGENTS_ROOT set to the worktree and MARINARA_ENGINE_ROOT set to the local Engine checkout:

  • node scripts/build-feature-packages.mjs long-term-memory before and after the move: server.mjs sha256 937b1f1d72586993… and client.js cf50dd6b33ff6149… both times, and git diff --exit-code stays clean.
  • node scripts/typecheck-packages.mjs long-term-memory: no syntax errors, undefined names or unresolved modules.
  • npm run check, git diff --check, node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-catalog.mjs and node scripts/tests/catalog-release-notes.regression.mjs all pass.
  • On the moved tree before the doc-only review fix: the full local LTM suite (every Engine-backed and UI regression in the LTM runner), plus branch-recall, candidate-reconciliation, delta-review, engine-fields, reconciliation-recall and source-pagination, all pass.
  • Every services/long-term-memory/… path string left in the repo resolves to a file.
  • Read-only review: a script compared every changed file with staging, treating path strings as placeholders. Only path strings and the Prettier re-wrapping differ, and all 381 relative specifiers and 103 test template paths resolve to the same module as before. Its one Low and one nit, both doc wording, are fixed.

Not done: installing through the Engine, since the payload is byte-identical.

Documentation impact

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

packages/long-term-memory/docs/ARCHITECTURE.md: new "Server Modules" section.

Merge danger

Door: two-way. Reverting the commit restores the flat layout, and the shipped package doesn't change either way.

Blast radius: branches. Every open LTM server branch conflicts on import paths and has to merge staging and update its imports to the new folders. No LTM server PR is open now.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated internal Long-Term Memory module organization and references. No end-user behavior changes are included.

🔄 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/1464 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `chore(long-term-memory)/server-folders` --- ### 📝 Commits (1) - [`fe935d9`](https://github.com/Pasta-Devs/Marinara-Agents/commit/fe935d9c9922302d29cbfc9d429b69080490bf6d) chore(long-term-memory): move server files into area folders (#1463) ### 📊 Changes **87 files changed** (+546 additions, -487 deletions) <details> <summary>View changed files</summary> 📝 `packages/long-term-memory/docs/ARCHITECTURE.md` (+29 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-projector.ts` (+14 -10) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-review.ts` (+5 -5) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/draft-store.ts` (+9 -9) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts` (+10 -10) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/rejected-suggestions.ts` (+8 -8) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/candidate-reconciliation.ts` (+5 -5) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/dedup.ts` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-compiler.ts` (+8 -8) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-extraction.ts` (+12 -12) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-validation.ts` (+6 -6) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts` (+6 -6) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/scoped-targets.ts` (+5 -5) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-extraction.ts` (+15 -15) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-hash.ts` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts` (+11 -11) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/structured-summary-normalizer.ts` (+2 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/chat-scope.ts` (+3 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/identity-repair.ts` (+16 -16) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/note-fork-repair.ts` (+14 -14) _...and 67 more files_ </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 #1463 ## Why this change - The Long-Term Memory server had 68 source files in one flat folder. The areas they belong to (persistence, recall, extraction, identity, drafts, maintenance) were visible only from file names, and `docs/ARCHITECTURE.md` had no map from area to files. - This move comes first because the planned LTM work (new sources, the recall service, and the `subject-identity.ts`, `storage.ts` and `schema.ts` splits) can then land inside these folders, instead of growing the flat folder and moving everything later. ## What changed Pure move, no behavior change. `S` = `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory`. ```text S/ ├── server-entry, runtime, package-runtime, routes, settings, │ default-config, service-error, ltm-utils # unchanged (8) ├── routes/ # unchanged (6) ├── persistence/ # storage, transactions, locks, index state, retention, backup and restore (14) ├── recall/ # chunking, indexes, ranking, budget, prompt, injection, usage (16) ├── extraction/ # evidence units, source processing and hashes, candidate reconciliation (11) ├── identity/ # subject identity, chat scope, identity and fork repair (7) ├── drafts/ # draft store, projection, review, applying drafts, rejected suggestions (5) ├── maintenance/ # integrity and repair, note transfer, legacy adoption, debug log (5) └── sources/ # interop (Engine chats and summaries), source-identity (2) ``` - 60 `git mv` renames, which git detects as renames (66–100 % similarity). - Only the relative import specifiers the move breaks were rewritten, by a script outside the repo: 365 in server files and 119 paths in 17 test files. Prettier then re-wrapped the lines that grew too long. No other line changed. - `docs/ARCHITECTURE.md` gains a "Server Modules" section with each folder, what it owns and its files. The Scope section now names the moved scope files with their folders. - **Deviation from the issue:** the issue planned to state an import direction with `persistence/` as the bottom layer. The code doesn't follow that yet. `storage.ts`, `backup-restore.ts`, `retention.ts` and `vault-snapshot.ts` import from other areas, so the doc lists those imports instead of claiming a layering. Enforcing a direction needs code changes and a lint rule, both outside this issue. - **No release.** The rebuilt `server.mjs` and `client.js` are byte-identical to `staging`, because the bundle is minified and has no source paths. So there is no version bump, CHANGELOG entry, artifact or catalog change. ## Package and security impact - Affected package IDs: `long-term-memory` (source and docs only; the published payload is unchanged) - Engine compatibility impact: none - New or changed permissions/entrypoints: none (`server-entry.ts` stays at the top level, and the builder copies the folder recursively) - Restart, storage, update, or uninstall impact: none ## 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 Run by the agent on head `fe935d9c9`, with `MARINARA_AGENTS_ROOT` set to the worktree and `MARINARA_ENGINE_ROOT` set to the local Engine checkout: - `node scripts/build-feature-packages.mjs long-term-memory` before and after the move: `server.mjs` sha256 `937b1f1d72586993…` and `client.js` `cf50dd6b33ff6149…` both times, and `git diff --exit-code` stays clean. - `node scripts/typecheck-packages.mjs long-term-memory`: no syntax errors, undefined names or unresolved modules. - `npm run check`, `git diff --check`, `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-catalog.mjs` and `node scripts/tests/catalog-release-notes.regression.mjs` all pass. - On the moved tree before the doc-only review fix: the full local LTM suite (every Engine-backed and UI regression in the LTM runner), plus `branch-recall`, `candidate-reconciliation`, `delta-review`, `engine-fields`, `reconciliation-recall` and `source-pagination`, all pass. - Every `services/long-term-memory/…` path string left in the repo resolves to a file. - Read-only review: a script compared every changed file with `staging`, treating path strings as placeholders. Only path strings and the Prettier re-wrapping differ, and all 381 relative specifiers and 103 test template paths resolve to the same module as before. Its one Low and one nit, both doc wording, are fixed. Not done: installing through the Engine, since the payload is byte-identical. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation `packages/long-term-memory/docs/ARCHITECTURE.md`: new "Server Modules" section. ## Merge danger **Door:** two-way. Reverting the commit restores the flat layout, and the shipped package doesn't change either way. **Blast radius:** branches. Every open LTM server branch conflicts on import paths and has to merge `staging` and update its imports to the new folders. No LTM server PR is open now. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated internal Long-Term Memory module organization and references. No end-user behavior changes are included. <!-- 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-21 05:11:53 +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#1474
No description provided.