Adds docs/tool-result-payloads.md covering PRs #27-#29: why every tool
result repeats its payload as JSON text (claude.ai ignores
structuredContent; client detection and structured-only were rejected),
why memory_list / memory_search return excerpts (named to avoid the
snippet.* tools), and why excerpts weight rare query terms rather than
using ts_headline (tested; it picked the same wrong passage).
Links it from the README design notes, adds two troubleshooting entries,
and marks the "same 9 fields as list/search" claims in the earlier
decision record and in memory.get's comment as superseded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the reasoning behind PR #19 next to the code, since none of it is
recoverable from the diff: why memory_get stopped returning the embedding
and tsvector, why memory_patch refuses ambiguous matches rather than
picking one, and why memory_append was dropped as redundant with patch.
Also records P3 (mechanising file->memory mirroring) as DECLINED with its
reasoning and, more usefully, the condition that would reopen it — the
mirror going stale again now that patching is cheap. The evidence we had
pointed at edit cost, which P2 fixed; if drift recurs the cause was
attention instead, and the answer is probably to remove the duplication
rather than build a drift detector for it.
Notes two traps for anyone extending this: content_tsv is a generated
column so full-text search cannot rot after a patch (only the embedding
needs recomputing), and the obvious "does search find the patched text"
acceptance check therefore passes on an implementation that skips
re-embedding entirely.
The brief previously lived outside the repo. Moved rather than copied —
two hand-maintained copies is the exact drift problem described in the
document.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>