From 1d506359d75262a4697469ea7558c9337d2ba7a6 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Thu, 3 Sep 2026 13:50:20 -0700 Subject: [PATCH] context test: JSON-quote the snapshot identity, as the verb does Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Vau2X53xGTjjTCXWMVBoNY --- crates/context/src/critique_storage.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/context/src/critique_storage.rs b/crates/context/src/critique_storage.rs index 3b4bb4ea7..95ef0f4ea 100644 --- a/crates/context/src/critique_storage.rs +++ b/crates/context/src/critique_storage.rs @@ -755,7 +755,13 @@ mod tests_660 { // The identity exactly as the verb resolves it for this target from this // cwd, so the test holds on every platform's path semantics. let identity = resolve_target_identity("App.tsx", &cwd).unwrap(); - let body = format!("---\ntarget_identity: \"{}\"\nslug: app-tsx\n---\n# Critique\n", identity); + // Frontmatter values are JSON scalars (`parse_frontmatter` reads them + // with serde_json), so the identity is JSON-quoted: a Windows path's + // backslashes must be escaped or the value fails to parse. + let body = format!( + "---\ntarget_identity: {}\nslug: app-tsx\n---\n# Critique\n", + serde_json::to_string(&identity).unwrap() + ); std::fs::write(jsp::join(&[&dir, name]), &body).unwrap(); // Wrong target identity: refused (exit 2), snapshot untouched.