fix(domain): refuse lone UTF-16 surrogates instead of replacing them (L1)

serde_json already refuses a lone surrogate escape; the U+FFFD pre-pass
is gone and parse_json classifies the refusal (strict escape scan, on
failure only) so callers name it: closed kind lone_surrogate from
operation inputs, sheet.check, draft.restore and archive.import.
Oracles untouched: the two L1 cases and the Zod verdict now assert that
TypeScript kept the surrogate and Rust refuses the text.
This commit is contained in:
bchanot committed 2026-10-14 21:49:28 +02:00
1 parent 36316cf67f
commit 20d03cf7fd
9 files changed
+275 -75

No files matched your search

@@ -320,7 +320,7 @@ interface Case {
archived?: string | null
output?: Json
error?: { kind: string; found?: number | null }
/** The TS result keeps a lone surrogate; the Rust one reads U+FFFD (decision L1). */
/** The TS result keeps a lone surrogate; Rust refuses the text (`lone_surrogate`, L1). */
l1?: true
/** The outcome depends on the sheet integrity rules (fork A's validate.rs). */
needsRules?: true