test(memory-ingest): fence regression test survives Windows tmpdirs

Wave polish on the #2699 absorption: the hand-built JSONL interpolated the
raw tmpdir into a JSON string — on Windows (D:\a\...) that's an invalid
escape, the user line was silently dropped, and the body started at
'## Assistant' (Windows Free Tests red). JSON.stringify the path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-31 22:20:31 +00:00
co-authored by Claude Fable 5
parent bd621cc023
commit 9f6ad83530
@@ -32,7 +32,10 @@ describe("regression: transcript frontmatter fence terminates its own line", ()
// colon-bearing line — exactly what the old glued fence swept into YAML.
const content =
`{"type":"user","message":{"role":"user","content":"before rule\\n\\n---\\n\\nnot: valid: yaml: here"},` +
`"timestamp":"2026-05-01T00:00:00Z","cwd":"${dir}"}\n` +
// JSON.stringify, not raw interpolation: a Windows tmpdir (D:\a\...)
// pasted into hand-built JSON is an invalid escape, the user line gets
// dropped, and the body starts at "## Assistant" (Windows CI red).
`"timestamp":"2026-05-01T00:00:00Z","cwd":${JSON.stringify(dir)}}\n` +
`{"type":"assistant","message":{"role":"assistant","content":"ok"},"timestamp":"2026-05-01T00:00:01Z"}\n`;
writeFileSync(file, content, "utf-8");