mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1553] [Issue]: Long-Term Memory server: split the 2,740-line subject identity file into four files #1545
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#1545
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 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1553
Originally assigned to: @Promansis on GitHub.
Summary
The Long-Term Memory server keeps all of subject identity in one file,
identity/subject-identity.ts, which is 2,740 lines long. Name text rules, the trusted subject catalog's lookup index and matchers, building and loading that catalog from the roster and stored notes, and resolving a batch's subjects all sit side by side, so a change to one of them means reading through the rest. This issue splits the file into four files, each importing only from the ones before it. It is a pure move with no behavior change.Affected package
long-term-memory1.4.78 (upstream/staging8602e266d).S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryS/identity/subject-identity.ts: 2,740 lines, 99 top-level statements.S/extraction/evidence-unit-extraction.ts,S/extraction/source-extraction.ts,S/extraction/source-processing.ts,S/identity/identity-repair.ts,S/identity/subject-choice-review.ts,S/routes/maintenance.ts,S/routes/notes.ts. Four regression files load it with a dynamicimport()of the module path: the routes, extraction-graph, local-characters and storage tests.Expected behavior
S/identity/, ordered so each imports only from the ones above it, which rules out a cycle between them.subject-identity.tskeeps its name and the resolution code, so importers of what stays need no change.docs/ARCHITECTURE.mdlists the three new files in itsidentity/row.Actual behavior
All of it is in one file:
identity/subject-names.ts(new)identity/subject-matching.ts(new)identity/subject-catalog.ts(new)identity/subject-identity.ts(kept)(The table is the proposed split; line counts are from a dry run on
8602e266d, after Prettier.)Steps to reproduce
wc -l S/identity/subject-identity.tsonupstream/staging: 2,740 lines.Minimal fix
subject-identity.ts, by symbol name and unchanged, into its part file, adds the imports each part needs, and runs Prettier on the touched files. A check compares every moved statement with the original: 98 of 99 verbatim on the dry run (ignoring an addedexport); the 99th,matchTrustedNameRelation, differs only by Prettier wrapping its now longer signature. The PR describes the script.subject-identity.ts, so each name has one import path.subject-names,subject-matchingandsubject-catalogto theidentity/row ofdocs/ARCHITECTURE.md.server.mjschanges only in module order and one extracreateHashimport fromnode:crypto(+42 bytes);client.jsis unchanged. Rebuild the package and ship it as a patch release.Regression proof
No behavior changes, so no new regression. The proof is the move check above, the import-cycle check (value cycles 0 before and after; the two existing type-only cycles do not involve these files), the strict package typecheck (the three new files are in its scope),
npm run check, and every Long-Term Memory regression suite unchanged and passing.Environment
long-term-memory1.4.78Logs, screenshots, or video
n/a
Additional context
Tracker item ST-2 (structural audit, step 4; also RT-6). The shared schema file was split the same way in #1536, and the server files were moved into area folders in #1463. Any open PR that edits
subject-identity.tsor one of the importers' import lines will conflict with this one: #1552 adds to the extraction-graph test, so this lands after it, with the script re-run on the then-currentstaging.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: