[PR #1554] [MERGED] chore(long-term-memory): split the subject identity file into four files (#1553) #1560

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

📋 Pull Request Information

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

Base: staging ← Head: chore(long-term-memory)/subject-identity-split


📝 Commits (2)

  • 6267483 chore(long-term-memory): split the subject identity file into four files (#1553)
  • 111949f chore(long-term-memory): release 1.4.80 with the subject identity split

📊 Changes

27 files changed (+1633 additions, -1547 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.80.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+4 -0)
📝 packages/long-term-memory/docs/ARCHITECTURE.md (+1 -1)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+40 -40)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-extraction.ts (+2 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-extraction.ts (+3 -6)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/identity-repair.ts (+2 -5)
➕ packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-catalog.ts (+647 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-choice-review.ts (+2 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-identity.ts (+32 -1433)
➕ packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-matching.ts (+479 -0)
➕ packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-names.ts (+365 -0)

...and 7 more files

📄 Description

Pull request

Linked issue

Closes #1553

Why this change

  • The Long-Term Memory server kept all of subject identity in one 2,740-line file: name text rules, the trusted subject catalog's index and matchers, building and loading that catalog, and resolving a batch's subjects. A change to one of them meant reading through the rest. Splitting it into four files, each importing only from the ones before it, makes each part readable on its own and rules out a cycle between them. This is a pure move with no behaviour change.

What changed

  • identity/subject-identity.ts is split into subject-names.ts (name text rules; reads no note and no catalog), subject-matching.ts (the catalog's types, lookup index and matchers), subject-catalog.ts (building and loading the trusted catalog from the roster and stored notes, the prompt catalog, checking stored notes against it) and the kept subject-identity.ts (resolution: preparing a context and resolving a batch's subject names, unit subjects and link targets). Importers of what stays keep their specifier.
  • The move was made by a script kept outside the repository: it takes each top-level statement of subject-identity.ts by symbol name, writes it unchanged into its part, adds the imports each part needs, rewrites the import of each moved name in the seven server importers and the four regression files that load the module (one specifier per target file, no re-export shim, so each name has one import path), and runs Prettier on the touched files.
  • A second script compared every moved statement with the unsplit file: 98 of 99 verbatim, ignoring an added export. The 99th, matchTrustedNameRelation, differs only by Prettier wrapping its now longer signature; it is identical once whitespace and commas are ignored. A third found no unresolved import and no value cycle.
  • 36 names that were private to the file are used by another part, so they are now exported from it. None is re-exported from a package entry point, so the package surface does not change.
  • docs/ARCHITECTURE.md lists the three new files in its identity/ row; the changelog notes the internal change.
  • Release: long-term-memory 1.4.80 on staging c68ea189e, with the CHANGELOG entry, version, manifest, rebuilt server.mjs, artifact and catalog entries. client.js does not change.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none; the built server.mjs grows by 42 bytes (module order and a second createHash import from node:crypto), and client.js is byte-identical

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

  • On the move commit (base c68ea189e): the move check and the import-cycle check above (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, the package build, the missing-tsc typecheck regression and every Long-Term Memory regression suite pass.
  • On the release head: the package rebuild leaves the tree clean, the catalog, locale and release-notes checks and the typecheck pass, and the extraction-graph, local-characters, routes and storage suites (the four regression files whose imports changed) pass. Hosted CI runs the full suite list on this head.

Documentation impact

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

UI evidence (if applicable)

  • Not applicable; no UI change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Release

    • Updated Long-Term Memory to version 1.4.80.
  • Documentation

    • Added documentation describing the organization of subject-name and memory-matching components.
    • Recorded the internal restructuring of memory subject matching; functionality remains unchanged.
  • Maintenance

    • Refreshed package metadata and release artifacts for the new version.
    • Updated checksums and artifact size information to match the latest build.

🔄 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/1554 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `chore(long-term-memory)/subject-identity-split` --- ### 📝 Commits (2) - [`6267483`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6267483dabe3b651c7f3b757eaa2711973230f78) chore(long-term-memory): split the subject identity file into four files (#1553) - [`111949f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/111949f600a77cb6b99fb3bb6500725beffa4766) chore(long-term-memory): release 1.4.80 with the subject identity split ### 📊 Changes **27 files changed** (+1633 additions, -1547 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.80.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+4 -0) 📝 `packages/long-term-memory/docs/ARCHITECTURE.md` (+1 -1) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+40 -40) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/evidence-unit-extraction.ts` (+2 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-extraction.ts` (+3 -6) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/identity-repair.ts` (+2 -5) ➕ `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-catalog.ts` (+647 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-choice-review.ts` (+2 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-identity.ts` (+32 -1433) ➕ `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-matching.ts` (+479 -0) ➕ `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/subject-names.ts` (+365 -0) _...and 7 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #1553 ## Why this change - The Long-Term Memory server kept all of subject identity in one 2,740-line file: name text rules, the trusted subject catalog's index and matchers, building and loading that catalog, and resolving a batch's subjects. A change to one of them meant reading through the rest. Splitting it into four files, each importing only from the ones before it, makes each part readable on its own and rules out a cycle between them. This is a pure move with no behaviour change. ## What changed - `identity/subject-identity.ts` is split into `subject-names.ts` (name text rules; reads no note and no catalog), `subject-matching.ts` (the catalog's types, lookup index and matchers), `subject-catalog.ts` (building and loading the trusted catalog from the roster and stored notes, the prompt catalog, checking stored notes against it) and the kept `subject-identity.ts` (resolution: preparing a context and resolving a batch's subject names, unit subjects and link targets). Importers of what stays keep their specifier. - The move was made by a script kept outside the repository: it takes each top-level statement of `subject-identity.ts` by symbol name, writes it unchanged into its part, adds the imports each part needs, rewrites the import of each moved name in the seven server importers and the four regression files that load the module (one specifier per target file, no re-export shim, so each name has one import path), and runs Prettier on the touched files. - A second script compared every moved statement with the unsplit file: 98 of 99 verbatim, ignoring an added `export`. The 99th, `matchTrustedNameRelation`, differs only by Prettier wrapping its now longer signature; it is identical once whitespace and commas are ignored. A third found no unresolved import and no value cycle. - 36 names that were private to the file are used by another part, so they are now exported from it. None is re-exported from a package entry point, so the package surface does not change. - `docs/ARCHITECTURE.md` lists the three new files in its `identity/` row; the changelog notes the internal change. - **Release:** `long-term-memory` 1.4.80 on staging c68ea189e, with the CHANGELOG entry, version, manifest, rebuilt `server.mjs`, artifact and catalog entries. `client.js` does not change. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none; the built `server.mjs` grows by 42 bytes (module order and a second `createHash` import from `node:crypto`), and `client.js` is byte-identical ## 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 - On the move commit (base c68ea189e): the move check and the import-cycle check above (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`, the package build, the missing-tsc typecheck regression and every Long-Term Memory regression suite pass. - On the release head: the package rebuild leaves the tree clean, the catalog, locale and release-notes checks and the typecheck pass, and the extraction-graph, local-characters, routes and storage suites (the four regression files whose imports changed) pass. Hosted CI runs the full suite list on this head. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - Not applicable; no UI change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Release** * Updated Long-Term Memory to version 1.4.80. * **Documentation** * Added documentation describing the organization of subject-name and memory-matching components. * Recorded the internal restructuring of memory subject matching; functionality remains unchanged. * **Maintenance** * Refreshed package metadata and release artifacts for the new version. * Updated checksums and artifact size information to match the latest build. <!-- 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-23 04:03:09 +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#1560
No description provided.