Depth-floor finding from the #14210 (slice-3) review.
#14210 adds resolveTurnDocumentForRead and routes the two MemoryService read paths (MemoryService.mjs:1931 content, :2028 episodicContext). But two turn-document consumers OUTSIDE MemoryService read the Chroma document directly, bypassing the resolver:
ai/daemons/orchestrator/services/DreamService.mjs:422-425 — if (rawMemories?.documents?.length > 0) { turnDocuments = rawMemories.documents; … }
ai/services/graph/GoldenPathSynthesizer.mjs:907,1006 — recent.documents?.[idx] / recent.documents.join("\n\n")
Why it's not broken yet (and why this is a slice-4 precondition, not a #14210 blocker): #14210 is INERT — the write path still stores the document (MemoryService.mjs:498 document: combinedText), so resolveTurnDocumentForRead's if (stored) return stored branch always wins and the reconstruct branch is dormant. The direct readers still see stored documents.
The risk: the moment slice-4 (the migration / write-path-drop) actually drops stored turn documents, these two consumers get null/empty documents for de-duped turns → the Dream pipeline's golden-path synthesis silently degrades (null turnDocuments / empty frontierText).
The work: route both through resolveTurnDocumentForRead({documents, metadata}) (they already fetch ids; they must also include: ['metadatas'] so the reconstruct has the split fields), with unit coverage for the dropped-document case. Must land before slice-4 drops any document.
Refs #14193 (epic), #14210 (slice-3, surfaced it), #14207 (slice-2). Self-assigned. Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).
Depth-floor finding from the #14210 (slice-3) review.
#14210 adds
resolveTurnDocumentForReadand routes the two MemoryService read paths (MemoryService.mjs:1931content, :2028episodicContext). But two turn-document consumers OUTSIDE MemoryService read the Chroma document directly, bypassing the resolver:ai/daemons/orchestrator/services/DreamService.mjs:422-425—if (rawMemories?.documents?.length > 0) { turnDocuments = rawMemories.documents; … }ai/services/graph/GoldenPathSynthesizer.mjs:907,1006—recent.documents?.[idx]/recent.documents.join("\n\n")Why it's not broken yet (and why this is a slice-4 precondition, not a #14210 blocker): #14210 is INERT — the write path still stores the document (
MemoryService.mjs:498 document: combinedText), soresolveTurnDocumentForRead'sif (stored) return storedbranch always wins and the reconstruct branch is dormant. The direct readers still see stored documents.The risk: the moment slice-4 (the migration / write-path-drop) actually drops stored turn documents, these two consumers get
null/empty documents for de-duped turns → the Dream pipeline's golden-path synthesis silently degrades (nullturnDocuments/ emptyfrontierText).The work: route both through
resolveTurnDocumentForRead({documents, metadata})(they already fetch ids; they must alsoinclude: ['metadatas']so the reconstruct has the split fields), with unit coverage for the dropped-document case. Must land before slice-4 drops any document.Refs #14193 (epic), #14210 (slice-3, surfaced it), #14207 (slice-2). Self-assigned. Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).