Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix(benchmarks): apply the complete advertised fix set per candidate

momoyeyua2fb7933dd98
diff --git a/benchmarks/repair-rounds/repairs.mjs b/benchmarks/repair-rounds/repairs.mjs
index 99cfc97e..61f9421a 100644
--- a/benchmarks/repair-rounds/repairs.mjs
+++ b/benchmarks/repair-rounds/repairs.mjs
@@ -116,11 +116,17 @@ const RULES = [
&& diagnostic.subject?.path
&& diagnostic.supportedFixes?.some((fix) => /set \S+ to verified node id "/.test(fix)),
apply(diagnostic, doc) {
- const fix = diagnostic.supportedFixes.find((entry) => /set \S+ to verified node id "/.test(entry));
- const target = fix.match(/set (\S+) to verified node id "([^"]+)"/);
- return setByPointer(doc, target[1], target[2])
- ? { detail: `set ${target[1]} to "${target[2]}"` }
- : null;
+ const fixes = (diagnostic.supportedFixes || [])
+ .map((entry) => entry.match(/set (\S+) to verified node id "([^"]+)"/))
+ .filter(Boolean);
+ const candidate = fixes.filter((fix) => fix[2] === fixes[0]?.[2]);
+ if (!candidate.length || candidate.some((fix) => getByPointer(doc, fix[1]) === undefined)) return null;
+ const applied = [];
+ for (const fix of candidate) {
+ if (!setByPointer(doc, fix[1], fix[2])) return null;
+ applied.push(fix[1]);
+ }
+ return { detail: `set ${applied.join(', ')} to "${candidate[0][2]}"` };
},
},
{