GPT-5 finding
Admin backfill script uses Array.prototype.toSorted — Node compatibility risk
- apps/web/scripts/backfill-benchmark-flag.ts
Array.prototype.toSorted is only available in newer Node.js versions (generally Node 20+). Running this script on older LTS environments (e.g., Node 18) will throw "toSorted is not a function" at runtime, preventing the admin backfill from executing.
Recommendation
Replace `toSorted` with a compatible pattern: `Array.from(byKey.values()).sort((a, b) => ...)`. If non-mutating behavior is desired, copy first: `[...byKey.values()].sort(...)`. Alternatively, enforce Node >= 20 in `engines` and CI for scripts.