mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1463] [Issue]: Long-Term Memory server: move the 68 flat server files into area folders #743
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#743
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1463
Originally assigned to: @Promansis on GitHub.
Summary
The Long-Term Memory server has 68 source files in one flat folder;
routes/is its only subfolder. The files fall into clear areas (persistence, recall, extraction, identity, drafts, maintenance), but the folder doesn't show them, anddocs/ARCHITECTURE.mdhas no module map. This issue moves the files into one folder per area and adds that map. It is a pure move with no behavior change. (Tracker items ST-3 and ST-1, from the structural audit.)Affected package
long-term-memory1.4.53 (upstream/staging40ff75368).S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryS/exceptroutes/. The server files import each other through relative specifiers (./storage.js, and../../../../shared/...for the shared layer).tests/import server files by path, includingtests/long-term-memory-source-paths.mjs.scripts/build-feature-packages.mjs:92), the catalog validator (scripts/validate-catalog.mjs:248) and the CI path filters all treatSas a whole directory, so subfolders need no script change. Nothing inSresolves paths at runtime (import.meta,__dirname), and no client or shared file imports fromS.Expected behavior
docs/ARCHITECTURE.mdlists each folder, what it owns and its files.Actual behavior
68 files sit side by side in
S/. Finding 3 of the structural audit grouped them by name; the grouping below was checked against their importers at40ff75368:server-entry,runtime,package-runtime,routes,settings,default-config,service-error,ltm-utils(8)persistence/storage,mutation-transaction,atomic-json,paths,vault-lock,vault-snapshot,stored-note,index-state,index-quarantine,retention,backup-restore,restore-recovery,activity-index,section-contributions(14)recall/chunking,bm25,keyword-extract,keyword-index,hangul-lexical,graph,metadata-index,ranking,budget,prompt,prompt-text,retrieval,rebuild,embedding-adapter,generation-injection,usage(16)extraction/evidence-unit-compiler,evidence-unit-extraction,evidence-unit-validation,structured-summary-normalizer,source-extraction,source-processing,source-hash,dedup,candidate-reconciliation,scoped-targets,extraction-config(11)identity/subject-identity,subject-choice-review,subject-equality,identity-repair,note-fork-repair,chat-scope,scope-links(7)drafts/draft-projector,draft-review,draft-store,reconciliation,rejected-suggestions(5)maintenance/maintenance,note-transfer,legacy-adoption,legacy-source-quarantine,debug-log(5)sources/interop,source-identity(2)routes/(unchanged)drafts,imports,maintenance,notes,settings,shared(6)Two placements differ from the audit's sketch:
activity-indexandsection-contributionsgo inpersistence/, because only storage, mutation and retention code imports them.interop(Engine chat import) andsource-identity(used only byinterop) go insources/. That is where the planned conversation-transcript source will live, sointeropmoves once.Steps to reproduce
git ls-tree --name-only upstream/staging S/: 68 files and one folder.docs/ARCHITECTURE.mdnames individual modules in its sections but has no map from area to files.Minimal fix
git mveach file into its folder, as in the table above.../../../../shared/...imports, which gain one../;routes/*.ts;ltmSourcePaths.interopintests/long-term-memory-source-paths.mjsand each direct or${source}/…server import in the tests. Assertions stay unchanged.docs/ARCHITECTURE.md: one row per folder with its responsibility and files, plus the allowed direction of imports (persistence/is the bottom layer).server.mjsis minified, contains no source paths, and orders modules by import graph, so the rebuild is expected to be byte-identical.Not included
subject-identity.ts(2,735 lines) orstorage.ts(ST-2), orschema.ts(ST-4).interop.tsor any of the look-alike file names (audit finding 6).Regression proof
node scripts/typecheck-packages.mjs long-term-memorypasses, so every rewritten specifier resolves.cmpofserver.mjsandclient.jsagainstupstream/staging(or the patch-release path from step 4).git diff -M --summary upstream/staginglists 60 renames and no delete/add pairs. Only the 8 top-level files remain inS/.test-ltm.sh all, withMARINARA_AGENTS_ROOTandMARINARA_ENGINE_ROOTset) andtest-fast.sh, because every server file moves.npm run checkand the AGENTS.md baseline validators.Environment
upstream/staging40ff75368)Logs, screenshots, or video
None. Structural audit (2026-10-15, LTM 1.4.38), step 5 and finding 9, re-checked at
40ff75368on 2026-10-19.Additional context
routes.tssplit) shipped in #1419. The six-file import loop from step 4 was removed in #1416, so the move no longer stretches a loop across folders.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: