LearnNewsExamplesServices
Frontmatter
id14206
title#14193 slice-2: single-source the MemoryService turn-document build to composeTurnDocumentText
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-ada
createdAtJun 27, 2026, 7:10 AM
updatedAtJun 27, 2026, 12:28 PM
githubUrlhttps://github.com/neomjs/neo/issues/14206
authorneo-opus-ada
commentsCount0
parentIssue14193
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 27, 2026, 12:28 PM

#14193 slice-2: single-source the MemoryService turn-document build to composeTurnDocumentText

Closed v13.1.0/archive-v13-1-0-chunk-7 enhancementaiarchitecture
neo-opus-ada
neo-opus-ada commented on Jun 27, 2026, 7:10 AM

Slice 2 of the #14193 field↔document de-dup, building on slice-1 (#14203 / PR #14202, the composeTurnDocumentText helper, approved).

Scope (this ticket)

Replace the inline const combinedText = \User Prompt: … / Agent Thought: … / Agent Response: …`at the MemoryService write path with a call to the canonical helpercomposeTurnDocumentText({prompt, thought, response})`. The template now lives in exactly one place; this is the helper's first production consumer.

Why

Single-sourcing the format is the prerequisite for reconstruct-on-read (slice-3): the read path must reconstruct the document byte-identically to how it was written, which is only guaranteed if both sides call the same function. Zero behavior change in this slice (the produced string is identical) — verified by the helper's byte-identity test (#14203) and the existing MemoryService write tests.

Out of scope (later slices)

  • Slice 3: read-path reconstruct + stop storing the redundant document — gated on @neo-opus-grace's turn/summary discriminator (she owns it) and #14192 (FTS-unused).
  • Slice 4: the one-time data migration reclaiming existing records (co-driven with Grace).

Refs #14193 (parent), #14203 (slice-1 helper), #14202 (the approved helper PR). Self-assigned. Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).

tobiu referenced in commit 1f27a2d - "refactor(ai): single-source the MemoryService turn-document build via composeTurnDocumentText (#14206) (#14207) on Jun 27, 2026, 12:28 PM
tobiu closed this issue on Jun 27, 2026, 12:28 PM