Jenny Chim Claude Opus 4.7 (1M context) commited on
Commit
819e7c9
·
1 Parent(s): fe5af86

Sort eval-detail filenames by codepoint for parity

Browse files

`parity_outputs.build_aggregate_eval_summaries` on the Python side
iterates inputs sorted by `eval_summary_id` (default string compare =
codepoint order). The TS dump was using filesystem iteration order,
so `foo_25.json` vs `foo.json` could land in either order. Plain
`.sort()` (no compareFn) matches Python's codepoint sort.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/dump-adapter-outputs.mts +11 -3
scripts/dump-adapter-outputs.mts CHANGED
@@ -223,9 +223,17 @@ dumped.push({
223
  ),
224
  })
225
 
226
- const evalDetails: Array<Record<string, any>> = listJSONFiles(evalsDir).map((file) =>
227
- readJSON<Record<string, any>>(join(evalsDir, file))
228
- )
 
 
 
 
 
 
 
 
229
 
230
  dumped.push({
231
  surface: "eval_summaries",
 
223
  ),
224
  })
225
 
226
+ // Sort eval-detail filenames by codepoint so iteration order matches
227
+ // Python's default string comparison on the parity side (which sorts
228
+ // `parity_outputs.build_aggregate_eval_summaries` inputs by
229
+ // `eval_summary_id`). `localeCompare` treats `_` as collation-ignorable
230
+ // at primary level, putting `foo_25.json` before `foo.json` — Python's
231
+ // codepoint sort orders them the other way. Plain `.sort()` (no
232
+ // compareFn) does the same codepoint comparison Python does.
233
+ const evalDetails: Array<Record<string, any>> = listJSONFiles(evalsDir)
234
+ .slice()
235
+ .sort()
236
+ .map((file) => readJSON<Record<string, any>>(join(evalsDir, file)))
237
 
238
  dumped.push({
239
  surface: "eval_summaries",