mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1989] feat(long-term-memory): accept Slurp records through an opt-in intake service (SN-4) #1858
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#1858
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 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1989
Originally assigned to: @Promansis on GitHub.
What problem does this solve?
Slurp keeps durable facts about its Creators that chats never see: things the user wrote by hand in Slurp's continuity editor or promoted out of a DM thread ("Mina is training for a half marathon"), couples and friendships between Creators, and how a storyline ended. Long-Term Memory has had no write path for packages since SV-1, on purpose: an open write service let any package add memories with nobody owning them. This issue reopens one narrow path, for one named first-party Agent, behind a switch that is off by default.
Tracker: SN-4.
Proposed package or change
A new service,
long-term-memory:intake, accepts one record at a time from Slurp. It accepts nothing while the new Memory Settings switch "Other Agents can add memories" is off (the default), and nothing from a caller other thanslurp2.{ kind: "package_record", sourceId: "slurp2:<recordId>" }, and its text is appended as one line to a "From Slurp" section (from_slurp2) on each named character's note. A couple or friendship is one record with two character ids, so both characters' notes get the line. No model call, no Review (decided 2026-10-30).Long-Term Memory patch with a CHANGELOG entry. No Engine change, no
engine.minbump.Minimal fix
L =
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory, SH =packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema, C = the LTM clientfeatures/long-term-memory.withLtmVaultLock(root, ...)(persistence/vault-lock.ts; pattern atdrafts/draft-store.ts:106-115):hash = sha256(characterIds, text)with thesource-hash.tshelpers. If the source noteltmPackageSourceNoteId(caller, recordId)exists with that hash, return"unchanged".retractExtracted: true(persistence/storage.ts:1099-1160), which drops its old line.storage.createNote, :370): typesource, character-wide scope, modes roleplay and conversation, the provenance above,sourceHash: hash. Copy the input shape from the Advanced Memory import (services/advanced-memory*.ts, 1.5.20, the newest source-note writer).source: { sourceNoteId, sourceHash }(drafts.ts:40-42),risk: "low",reviewRequired: false,evidence: ["slurp2:<recordId>"], and one mutation per character id:append_section(drafts.ts:126) with keyfrom_slurp2on that character's note (listNotes({ characterIds })), orcreate_note(:120) for achar_note with that section when none exists. Store it withLongTermMemoryDraftStore.createDraft(drafts/draft-store.ts:109); apply loads the draft by id and runsassertFresh.applyLongTermMemoryDraft(storage, draftStore, draftId, { mutationIds: all })(drafts/reconciliation.ts:695). Verified: withoutautoApplyLowRiskOnlynothing gates onreviewRequired(:734), so no new flag. The projector writes the line as an{ owner: "source", sourceNoteId, sourceHash }contribution (draft-projector.ts:199, :383), which SN-5 keys on.retractExtracted: true. A note left with no sections follows the existing retraction path.requestHost("/api/slurp2/settings", "PATCH", { shareWithMemory: true })(Slurp GET/settingsatslp-settings-routes.ts:60, PATCH:148, prefix/api/slurp2atslp-server-entry.ts:170). Keys inen.jsonplus the locale rule (node scripts/validate-package-locales.mjs). No second offer file.docs/ARCHITECTURE.md§ Services for Other Packages (:206-249): the intake signature, the null meanings, idempotence, and that the caller is self-reported.packages/long-term-memory/CHANGELOG.md,## Unreleased): Slurp can add memories when you allow it in Memory Settings → Sharing. Off by default.Non-goals. The first three were cut on 2026-10-31 to keep the change small; each is a follow-up if wanted:
noodlecaller. Noodle has nothing to send today; adding it is one entry inLTM_INTAKE_CALLERS.social_postprovenance (D3), the echo filter (SN-5).Regression proof
New
tests/long-term-memory-intake.regression.ts(fakeregisterServiceas intests/long-term-memory-runtime.regression.ts:245-249, temp vault), six cases:submitreturnsnulland writes nothing.caller: "other-pkg":null, nothing written.submit({ caller: "slurp2", recordId: "fact:f1", characterIds: ["char-a"], text })adds afrom_slurp2section tochar-a's note (or creates the note) with oneowner: "source"contribution whosesourceNoteIdisltmPackageSourceNoteId("slurp2", "fact:f1"); the source note's provenance ispackage_record/slurp2:fact:f1. The colon in the id proves it is hashed, not slugged."unchanged"with the same note count. Changed text replaces the line, still one contribution.retractremoves the line; the note's other sections stay.Add the new key to the runtime regression's service assertions (
long-term-memory-runtime.regression.ts:306-325). The existingofferSlurpMemoriestest (#1859) gains thesettingparameter: the read offer writes onlyflavourFromAgents, the add offer onlyshareWithMemory.Why should this be optional?
The switch is off by default, and nothing arrives until Slurp sends something, which needs Slurp's own switch too. Turning either off stops new records.
Alternatives considered
slurp2:postsservice and extracts with a model (D3). Dropped 2026-10-29: Slurp's ledger is already extracted, so a pull adds a model pass and a cursor for nothing.calleris self-reported (Security), so a list keeps an honest but unknown package from writing memories under its own name or Slurp's.notes.ts:314), so each record gets a source note and the character note links to it through the section contribution.Security
The Engine doesn't tell a service who called it, so a package could claim to be
slurp2. This adds no new power: package server code runs in the Engine process withappand the database in its activation context (capability-module-runtime.service.ts:378, :396-399), so a package that wants to lie can already write the vault directly. The boundary is the official catalog, not the service. The upgrade path is the Engine issueissues/engine-service-caller-identity.md(registerService(key, service, { forCaller }), next free Capability API minor, 1.392 as of 2026-10-31); once it ships, intake ignores the self-reportedcaller. Theponytail:comment onLTM_INTAKE_CALLERSnames this.Additional context
Follows #1567 (recall) and #1805 (Sharing table). SN-5 (
issues/ltm-recall-exclude-package-records.md) usesltmPackageSourceNotePrefixand can land in the same release. Slurp's side isissues/slurp-send-creator-records.md.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
Local trace
Anchors (upstream/staging
655b7666d):server-entry.ts:31(registerServicesignature),:51(recall registration),:53-76(runtime,{ hostOnly: true }at :76).recall.ts:58-64(null rules to copy).primitives.ts:131-135(ltmIdentifierSchema),:177-179(provenance kind,sourceIdmax 120),:90(source_prefix).notes.ts:221-236(contributions),:314-336(provenance only on source notes).drafts.ts:40-42(source),:111(risk),:114(evidence),:120(create_note),:126(append_section),:332(reviewRequired).drafts/draft-store.ts:109(createDraft);persistence/vault-lock.ts(withLtmVaultLock);reconciliation.ts:695-716(apply),:734(the onlyreviewRequiredgate).section-contributions.tssourceContribution;draft-projector.ts:199, :383.storage.ts:370(createNote),:1096-1160(deleteNotesPermanently,retractExtracted).storage-read.ts:6-11(ltmPackageCallerSchema, lenient.optional().catch(undefined), not for input).settings.ts:36/94/118(longTermMemoryShareWithPackagesdefaults to true; the new switch defaults to false).MemorySettings.tsx:18(import),:352-363(sharingTurnedOn),:396-409(offer call),:903-930(Sharing group);slurp-memory-offer.ts(24 lines);MemoryVault.tsx:1276-1290,:2880-2884(if/ternary chains, sotscwon't flag a missing kind).docs/ARCHITECTURE.md:206-250§ Services for Other Packages.Verified 2026-10-31: applying a draft with
sourcewritesowner: "source"contributions;ltmIdentifierSchemarejects-,:and uppercase;applyLongTermMemoryDraftapplies areviewRequired: falsedraft with no flag whenautoApplyLowRiskOnlyis absent.For the worker to check: the
storage.createNoteinput for asourcenote (scope, modes,sourceHashfield name) as the Advanced Memory import creates them.Decided by the user: 2026-10-30, the switches offer each other, records skip Review, the echo filter is on LTM's side. 2026-10-31, minimal change: one record kind,
slurp2only, no Activity counts.Assumed, not yet confirmed: modes roleplay and conversation, character-wide; text capped at 1000 characters.