fix(evaluation): canonicalize Unicode argument keys (#980)

This commit is contained in:
morluto
2026-10-07 23:19:49 +08:00
committed by GitHub
parent 98b2b027af
commit 0a4caf4a0a
4 changed files with 58 additions and 7 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
import { compareUnicodeCodePoints } from "../domain/unicodeCodePointOrder.js";
/** One REA MCP invocation observed in a Codex JSONL transcript. */
interface CodexMcpCall {
readonly id: string | null;
@@ -47,7 +49,7 @@ const canonicalValue = (value: unknown): unknown => {
if (object === undefined) return value;
return Object.fromEntries(
Object.entries(object)
.sort(([left], [right]) => left.localeCompare(right))
.sort(([left], [right]) => compareUnicodeCodePoints(left, right))
.map(([key, child]) => [key, canonicalValue(child)]),
);
};