MCPcopy Create free account
hub / github.com/SethGammon/Citadel / resolveEdit

Function resolveEdit

scripts/noop-ablate.js:78–90  ·  view source on GitHub ↗

* Build the ablation edit for a candidate: { lineNo, action, trimmed_line }. * Priority: explicit --action override, else the judge verdict, else default * 'delete' (test whether the whole line is inert).

(candidate, verdicts)

Source from the content-addressed store, hash-verified

76 * 'delete' (test whether the whole line is inert).
77 */
78function resolveEdit(candidate, verdicts) {
79 if (actionOverride === 'delete') return { ...candidate, action: 'delete' };
80 if (actionOverride === 'trim') return { ...candidate, action: 'trim' };
81
82 const v = verdicts.find(m => m.skill === candidate.skill && m.lineNo === candidate.lineNo);
83 const verdict = v && v.verdict ? v.verdict : null;
84 if (verdict) {
85 if (verdict.verdict === 'keep') return { ...candidate, action: 'keep' };
86 if (verdict.verdict === 'trim') return { ...candidate, action: 'trim', trimmed_line: verdict.trimmed_line };
87 if (verdict.verdict === 'delete') return { ...candidate, action: 'delete' };
88 }
89 return { ...candidate, action: 'delete' }; // default hypothesis
90}
91
92// ── Ablation edits ────────────────────────────────────────────────────────────
93

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected