mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1419] [Issue]: Long-Term Memory server: split the 1,635-line routes.ts by area #723
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#723
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 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1419
Originally assigned to: @Promansis on GitHub.
Summary
All 56 Long-Term Memory HTTP endpoints are registered in one 1,635-line
routes.ts, inside a single function. Their request schemas and helpers are about 470 lines at the top of the same file. Every server change to notes, drafts, imports, maintenance or settings therefore touches this one file, which makes reviews larger and parallel work conflict. This issue splits it into one file per area, as pure moves with no behaviour change.Affected package
long-term-memory1.4.38 (upstream/staging97c0486f8),packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes.ts:routeErrorandvaultNoteValidationError.createLongTermMemoryRoutes, which registers all 56 endpoints.GET /scope-targetsalone is about 120 lines inline (:746-868).tests/long-term-memory-routes.regression.ts(6,325 lines; needsMARINARA_ENGINE_ROOT).Expected behavior
routes.tsonly composes them.Actual behavior
The 56 endpoints by area:
/notes, plus/search,/scope-targetsand/local-characters/drafts, 4 under/rejected-suggestions/import/preview,/import/source-details,/import/lorebooks/preview,/import/source-notes/status,/rebuild,/integrity,/repair,/identity-repair/*,/fork-repair/*,/backup/*,/data,/debug-log*,/events,/last-injection/:chatId/settings,/settings/reset,/extraction-settingsSteps to reproduce
routes.ts.app.get,app.post,app.put,app.patchandapp.deletecalls insidecreateLongTermMemoryRoutes: there are 56.Environment
staging)upstream/staging97c0486f8)Logs, screenshots, or video
Not applicable.
Minimal fix
tests/long-term-memory-routes.regression.ts, collect the registered routes with anonRoutehook before the LTM routes are registered.routes.tsas the composer, soserver-entry.tsis unchanged, and add aroutes/folder:routes/notes.ts,routes/drafts.ts,routes/imports.ts,routes/maintenance.tsandroutes/settings.ts. Each exportsregister…Routes(app, runtime)and holds that area's handlers and request schemas.routes/shared.tsholdsrouteError,vaultNoteValidationError,rebuildAfterMutation(turned into a function that takesroot) and the schemas used by more than one area.Validation:
npm run checknode scripts/typecheck-packages.mjs long-term-memoryserver.mjschanges; patch bump)node scripts/validate-catalog.mjsMARINARA_ENGINE_ROOTset)Additional context
routeError,:425and:439; rebuild results,:489). The client shows these messages in toasts ("Saved, but recall is stale: …"). On a self-hosted install, they are the most useful detail for the person fixing the problem./scope-targetsbusiness logic into a service. That is a separate change.routes/.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: