[GH-ISSUE #2010] feat(slurp2): tell Long-Term Memory about your Creators (SN-4) #1872

Closed
opened 2026-11-07 16:37:16 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/2010

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Slurp knows things about its Creators that the user decided are true: facts written by hand in the continuity editor, facts promoted out of a DM thread, couples and friendships between Creators, and how a storyline ended. None of it reaches Engine chats. A character who is dating another Creator on Slurp has never heard of them in a roleplay. Since SN-3, Slurp reads Long-Term Memory, but nothing flows the other way.

Tracker: SN-4.

Proposed package or change

When the user allows it, Slurp tells Long-Term Memory about one record at a time, as it happens, through long-term-memory:intake. A record is { recordId, characterIds, text }: a fact about one Creator, a couple or bond between two, or how a storyline ended. No sweep, no backfill. Records go straight into memory without Review (decided 2026-10-30).

  • An edit sends the record again, and Long-Term Memory replaces the old line.
  • A fact that is retracted, or edited so it no longer qualifies, is retracted in Long-Term Memory.
  • Slurp's recall also passes excludeFrom: ["slurp2"], so its own records don't come back as memories (SN-5).

slurp2 only, a patch release (0.4.x, decided 2026-10-31) with a CHANGELOG entry and a new setting, off by default.

Minimal fix

P = packages/slurp2/src/engine/packages/server/src/slp, C = packages/slurp2/src/engine/packages/client/src/slp.

+P/data/creators/slp-ltm-intake.ts
+  slurpLtmShareable(fact): realityScope in canon|slurp|campaign && audienceScope in creator_private|creator_public|cross_platform
+                           && status in confirmed|active && !expiresAt && !threadId
+                           && factType in interest|relationship|preference|circumstance
+  sendSlurpRecord(db, { recordId, accountIds, text })   # fire and forget, never throws
+  retractSlurpRecord(db, recordId)
+    gate: settings.shareWithMemory; each account's source is a character (persona-sourced Creators skipped)
+    service = getCapabilityService("long-term-memory:intake")    (import as slp-ltm-recall.ts:10 does)
+    no service / null / throw -> debug log, nothing else
 P/features/creators/slp-continuity-routes.ts
   :114 POST facts (hand-written)  -> send when slurpLtmShareable
   :182 PATCH facts/:id            -> send again when shareable, else retract
   :200 POST :target/:id/retract   -> retract (facts only)
   :226 POST facts/:id/promote     -> send the new fact
 P/data/projects/slp-creator-ties-storage.ts:46  mutateSlurpCreatorTies
   after the write: send the couples and bonds that changed
 P/data/projects/slp-projects-storage-1.ts:476   after.status === "complete" && before.status !== "complete"
   -> send the storyline's ending
 P/data/creators/slp-ltm-recall.ts:74-83   (the recall call)
+  excludeFrom: ["slurp2"]
 P/modules/settings/slp-settings.ts:308-309, :573-574 + C/features/settings/slp-settings-contract.ts:131-132, slp-settings-defaults.ts:50-51
+  shareWithMemory: z.boolean()                   default false
 C/features/settings/SlpEngineLinkPanel.tsx:116-147
+  toggle under the memory choice; turning it on runs the offer below
 C/features/settings/slp-ltm-sharing-offer.ts:7-24
-  offerLtmSharing reads and saves longTermMemoryShareWithPackages
+  offerLtmSharing({ setting, read, confirm, save }) takes the LTM setting key, so the same offer serves
+    longTermMemoryShareWithPackages (existing) and longTermMemoryAcceptFromPackages (new)
  • Record ids and text. Names are the Creators' display names. Long-Term Memory hashes recordId into the note id and keeps slurp2:<recordId> as provenance (max 120 characters), so any short string works.
    • Facts: fact:<id>, text subject: text, or text alone. A fact's text is already at most 500 characters (LTM accepts 1-1000).
    • Couples: couple:<sorted member ids>, both character ids. "A and B are together." After a breakup: "A and B were together until ."
    • Bonds: bond:<kind>:<sorted ids>, both character ids. "A and B are friends" (roommates, coworkers, exes, family). When a bond ends, its ending is added.
    • Storylines: storyline:<projectId>, the Creator's id. The project title and the ending stage's outcome text (slurpStageOutcomes, modules/projects/slp-project-storyline.ts:274).
  • Never sent: plans, promises and anything with expiresAt; boundary and business facts; beat: facts; thread- and fan-private records, requests, proposals and events; records in conversation, roleplay or game reality; rivalries and collabs; couples with the player's persona; life moments.
  • Timing. Every send runs after the Slurp write commits and is not awaited. An error from Long-Term Memory never fails the Slurp action.
  • UI. In the Engine link panel, under "What your other Agents know": toggle "Tell Long-Term Memory about your Creators", off. Detail: "Facts you write or promote, couples and friendships between Creators, and how storylines end become memories, so chats know them too. Nothing from fans or DM threads is shared." Turning it on while Long-Term Memory's "Other Agents can add memories" is off asks once ("Long-Term Memory also needs to allow this. Turn it on?") and writes that setting through PUT /long-term-memory/settings, as the read offer does today (SlpEngineLinkPanel.tsx:24-33). New keys in C/locales/en.json, plus de, ko and pl per the locale rule.
  • CHANGELOG (packages/slurp2/CHANGELOG.md, next patch): Slurp can tell Long-Term Memory what is true about your Creators, so chats know it too. Off by default, and Slurp's own facts no longer come back as memories.

Non-goals: backfill; a share button in the promote dialog; persona-sourced Creators; showing send status in Slurp; retracting when a Creator account is deleted.

Regression proof

New tests/slurp2-ltm-intake.regression.ts (repo-root tests/), with a fake long-term-memory:intake service in the capability registry (as tests/slurp2-ltm-recall.regression.ts fakes recall), five cases:

  1. With shareWithMemory off, nothing is called.
  2. A hand-written creator_public interest fact sends one submit with caller: "slurp2", recordId: "fact:<id>" and the Creator's character id; a thread_private fact sends nothing.
  3. An edit sends again with the new text; an edit to thread_private retracts; the retract route retracts.
  4. A couple moving to together sends one record with both character ids.
  5. When the service is missing or throws, the Slurp route still returns success.

Update tests/slurp2-ltm-recall.regression.ts for excludeFrom: ["slurp2"]. The existing offer test gains the setting key: the read offer still writes only longTermMemoryShareWithPackages, the add offer only longTermMemoryAcceptFromPackages.

Why should this be optional?

Slurp's new switch is off by default, and so is Long-Term Memory's "Other Agents can add memories". Turning on either one offers to turn on the other, so the user agrees once and in one place. Nothing from fans or DM threads is ever sent.

Alternatives considered

  • LTM pulls a slurp2:posts service and extracts (D3). Dropped 2026-10-29: posts are Slurp's own repetition problem, and the ledger is already extracted.
  • Send every ledger fact. Plans expire, and thread facts are about fans, who have no Engine identity.
  • A sweep on a timer. Every qualifying change already passes through the write points above.

Additional context

Follows #1841 (SN-3, Slurp reads recall). Needs the two LTM issues above released, because an older LTM has no intake service. Slurp then sends nothing: the service is missing, which is the same as off.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.

Local trace

Anchors:

  • promoteSlurpContinuityFact (data/continuity/slp-continuity-storage.ts:489-523): new active fact with source: "user", contribution: "manual"; SLURP_PROMOTION_TARGETS are the three Creator-wide audiences (:431).
  • Fact routes: slp-continuity-routes.ts:99/114 (create, realityScope: "slurp"), :182 (edit), :200 (retract; no hard delete), :219/226 (promote).
  • Read rules: modules/continuity/slp-continuity-rules.ts:29-49.
  • Ties: one settings document, slurp2.creator-ties, { ties, deals, couples, bonds }, written only by mutateSlurpCreatorTies (slp-creator-ties-storage.ts:15, 46-68).
  • Couple stages: modules/projects/slp-creator-couples.ts, "together" at :400/:413/:672/:706, breakup at :536. Player couples are in slp-player-couple.ts.
  • SlurpBond (modules/projects/slp-creator-bonds.ts:57-72): origin, endedAt, ending.
  • Project completion is detected at slp-projects-storage-1.ts:450, 476.
  • Recall call slp-ltm-recall.ts:74-83 (getCapabilityService import at :10); test tests/slurp2-ltm-recall.regression.ts.
  • LTM's side of the offer (offerSlurpMemories) reads GET /api/slurp2/settings and PATCHes { shareWithMemory: true }, so the new setting must be in the GET body and accepted by PATCH (slp-settings-routes.ts:60, :148).

For the worker to check: the SlurpCouple shape (id, members, display-name lookup); whether slp-projects-storage-1.ts has the settings reader in scope; where a completed project's ending outcome text is read.

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, patch release; one record kind { recordId, characterIds, text }.

Originally created by @Promansis on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/2010 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Slurp knows things about its Creators that the user decided are true: facts written by hand in the continuity editor, facts promoted out of a DM thread, couples and friendships between Creators, and how a storyline ended. None of it reaches Engine chats. A character who is dating another Creator on Slurp has never heard of them in a roleplay. Since SN-3, Slurp reads Long-Term Memory, but nothing flows the other way. Tracker: SN-4. ## Proposed package or change When the user allows it, Slurp tells Long-Term Memory about one record at a time, as it happens, through `long-term-memory:intake`. A record is `{ recordId, characterIds, text }`: a fact about one Creator, a couple or bond between two, or how a storyline ended. No sweep, no backfill. Records go straight into memory without Review (decided 2026-10-30). - An edit sends the record again, and Long-Term Memory replaces the old line. - A fact that is retracted, or edited so it no longer qualifies, is retracted in Long-Term Memory. - Slurp's recall also passes `excludeFrom: ["slurp2"]`, so its own records don't come back as memories (SN-5). `slurp2` only, a patch release (0.4.x, decided 2026-10-31) with a CHANGELOG entry and a new setting, off by default. ### Minimal fix P = `packages/slurp2/src/engine/packages/server/src/slp`, C = `packages/slurp2/src/engine/packages/client/src/slp`. ```diff +P/data/creators/slp-ltm-intake.ts + slurpLtmShareable(fact): realityScope in canon|slurp|campaign && audienceScope in creator_private|creator_public|cross_platform + && status in confirmed|active && !expiresAt && !threadId + && factType in interest|relationship|preference|circumstance + sendSlurpRecord(db, { recordId, accountIds, text }) # fire and forget, never throws + retractSlurpRecord(db, recordId) + gate: settings.shareWithMemory; each account's source is a character (persona-sourced Creators skipped) + service = getCapabilityService("long-term-memory:intake") (import as slp-ltm-recall.ts:10 does) + no service / null / throw -> debug log, nothing else P/features/creators/slp-continuity-routes.ts :114 POST facts (hand-written) -> send when slurpLtmShareable :182 PATCH facts/:id -> send again when shareable, else retract :200 POST :target/:id/retract -> retract (facts only) :226 POST facts/:id/promote -> send the new fact P/data/projects/slp-creator-ties-storage.ts:46 mutateSlurpCreatorTies after the write: send the couples and bonds that changed P/data/projects/slp-projects-storage-1.ts:476 after.status === "complete" && before.status !== "complete" -> send the storyline's ending P/data/creators/slp-ltm-recall.ts:74-83 (the recall call) + excludeFrom: ["slurp2"] P/modules/settings/slp-settings.ts:308-309, :573-574 + C/features/settings/slp-settings-contract.ts:131-132, slp-settings-defaults.ts:50-51 + shareWithMemory: z.boolean() default false C/features/settings/SlpEngineLinkPanel.tsx:116-147 + toggle under the memory choice; turning it on runs the offer below C/features/settings/slp-ltm-sharing-offer.ts:7-24 - offerLtmSharing reads and saves longTermMemoryShareWithPackages + offerLtmSharing({ setting, read, confirm, save }) takes the LTM setting key, so the same offer serves + longTermMemoryShareWithPackages (existing) and longTermMemoryAcceptFromPackages (new) ``` - **Record ids and text.** Names are the Creators' display names. Long-Term Memory hashes `recordId` into the note id and keeps `slurp2:<recordId>` as provenance (max 120 characters), so any short string works. - Facts: `fact:<id>`, text `subject: text`, or `text` alone. A fact's text is already at most 500 characters (LTM accepts 1-1000). - Couples: `couple:<sorted member ids>`, both character ids. "A and B are together." After a breakup: "A and B were together until <month year>." - Bonds: `bond:<kind>:<sorted ids>`, both character ids. "A and B are friends" (roommates, coworkers, exes, family). When a bond ends, its `ending` is added. - Storylines: `storyline:<projectId>`, the Creator's id. The project title and the ending stage's outcome text (`slurpStageOutcomes`, `modules/projects/slp-project-storyline.ts:274`). - **Never sent:** plans, promises and anything with `expiresAt`; boundary and business facts; `beat:` facts; thread- and fan-private records, requests, proposals and events; records in conversation, roleplay or game reality; rivalries and collabs; couples with the player's persona; life moments. - **Timing.** Every send runs after the Slurp write commits and is not awaited. An error from Long-Term Memory never fails the Slurp action. - **UI.** In the Engine link panel, under "What your other Agents know": toggle "Tell Long-Term Memory about your Creators", off. Detail: "Facts you write or promote, couples and friendships between Creators, and how storylines end become memories, so chats know them too. Nothing from fans or DM threads is shared." Turning it on while Long-Term Memory's "Other Agents can add memories" is off asks once ("Long-Term Memory also needs to allow this. Turn it on?") and writes that setting through `PUT /long-term-memory/settings`, as the read offer does today (`SlpEngineLinkPanel.tsx:24-33`). New keys in `C/locales/en.json`, plus `de`, `ko` and `pl` per the locale rule. - **CHANGELOG** (`packages/slurp2/CHANGELOG.md`, next patch): Slurp can tell Long-Term Memory what is true about your Creators, so chats know it too. Off by default, and Slurp's own facts no longer come back as memories. Non-goals: backfill; a share button in the promote dialog; persona-sourced Creators; showing send status in Slurp; retracting when a Creator account is deleted. ### Regression proof New `tests/slurp2-ltm-intake.regression.ts` (repo-root `tests/`), with a fake `long-term-memory:intake` service in the capability registry (as `tests/slurp2-ltm-recall.regression.ts` fakes recall), five cases: 1. With `shareWithMemory` off, nothing is called. 2. A hand-written `creator_public` interest fact sends one `submit` with `caller: "slurp2"`, `recordId: "fact:<id>"` and the Creator's character id; a `thread_private` fact sends nothing. 3. An edit sends again with the new text; an edit to `thread_private` retracts; the retract route retracts. 4. A couple moving to `together` sends one record with both character ids. 5. When the service is missing or throws, the Slurp route still returns success. Update `tests/slurp2-ltm-recall.regression.ts` for `excludeFrom: ["slurp2"]`. The existing offer test gains the setting key: the read offer still writes only `longTermMemoryShareWithPackages`, the add offer only `longTermMemoryAcceptFromPackages`. ## Why should this be optional? Slurp's new switch is off by default, and so is Long-Term Memory's "Other Agents can add memories". Turning on either one offers to turn on the other, so the user agrees once and in one place. Nothing from fans or DM threads is ever sent. ## Alternatives considered - **LTM pulls a `slurp2:posts` service and extracts (D3).** Dropped 2026-10-29: posts are Slurp's own repetition problem, and the ledger is already extracted. - **Send every ledger fact.** Plans expire, and thread facts are about fans, who have no Engine identity. - **A sweep on a timer.** Every qualifying change already passes through the write points above. ## Additional context Follows #1841 (SN-3, Slurp reads recall). Needs the two LTM issues above released, because an older LTM has no intake service. Slurp then sends nothing: the service is missing, which is the same as off. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details. ## Local trace Anchors: - `promoteSlurpContinuityFact` (`data/continuity/slp-continuity-storage.ts:489-523`): new `active` fact with `source: "user"`, `contribution: "manual"`; `SLURP_PROMOTION_TARGETS` are the three Creator-wide audiences (:431). - Fact routes: `slp-continuity-routes.ts:99/114` (create, `realityScope: "slurp"`), `:182` (edit), `:200` (retract; no hard delete), `:219/226` (promote). - Read rules: `modules/continuity/slp-continuity-rules.ts:29-49`. - Ties: one settings document, `slurp2.creator-ties`, `{ ties, deals, couples, bonds }`, written only by `mutateSlurpCreatorTies` (`slp-creator-ties-storage.ts:15, 46-68`). - Couple stages: `modules/projects/slp-creator-couples.ts`, "together" at :400/:413/:672/:706, breakup at :536. Player couples are in `slp-player-couple.ts`. - `SlurpBond` (`modules/projects/slp-creator-bonds.ts:57-72`): `origin`, `endedAt`, `ending`. - Project completion is detected at `slp-projects-storage-1.ts:450, 476`. - Recall call `slp-ltm-recall.ts:74-83` (`getCapabilityService` import at :10); test `tests/slurp2-ltm-recall.regression.ts`. - LTM's side of the offer (`offerSlurpMemories`) reads GET `/api/slurp2/settings` and PATCHes `{ shareWithMemory: true }`, so the new setting must be in the GET body and accepted by PATCH (`slp-settings-routes.ts:60, :148`). For the worker to check: the `SlurpCouple` shape (id, members, display-name lookup); whether `slp-projects-storage-1.ts` has the settings reader in scope; where a completed project's ending outcome text is read. 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, patch release; one record kind `{ recordId, characterIds, text }`.
bsakaguchi 2026-11-07 16:37:16 +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#1872
No description provided.