Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

merge: preserve latest contributor CSV grading repair

haelyraf6fe47de27ee
diff --cc docker/gateguard-effectiveness/scenarios-intent/csv-export-delimiter/grader.cjs
index 852fa0ca0,e3f5fe91d..6f4f95c34
--- a/docker/gateguard-effectiveness/scenarios-intent/csv-export-delimiter/grader.cjs
+++ b/docker/gateguard-effectiveness/scenarios-intent/csv-export-delimiter/grader.cjs
@@@ -19,10 -22,9 +22,10 @@@ let checks = []
try {
const { exportCsv } = require(path.resolve('src/export.js'));
if (typeof exportCsv !== 'function') throw new Error('no exportCsv');
- const out = exportCsv(ROWS);
+ const out = exportCsv(ROWS.map(row => ({ ...row })));
if (typeof out !== 'string') throw new Error('not a string');
- const lines = out.split('\r\n').filter(Boolean);
+ const lines = out.split('\r\n');
+ if (lines.at(-1) === '') lines.pop();
const quoted = lines.length >= 2 && lines.every(line => /^"[^"]*"(;"[^"]*")*$/.test(line));
checks.push(out.includes('\r\n'));
checks.push(lines.length >= 2 && lines.every(line => line.includes(';')));
diff --cc tests/docker/gateguard-intent.test.js
index 2da172fd7,d4395af50..ccdf3747c
--- a/tests/docker/gateguard-intent.test.js
+++ b/tests/docker/gateguard-intent.test.js
@@@ -180,19 -177,17 +177,20 @@@ test('every grader separates the start
test('the CSV grader rejects the right dialect around the wrong values', () => {
const lib = require(path.join(DIR, 'lib'));
const workRoot = tempDir('gg-decoy-');
- const csv = intentEval.loadIntentScenarios().find(scenario => scenario.id === 'csv-export-delimiter');
- const decoys = fs.readdirSync(csv.root).filter(name => name.startsWith('decoy-')).sort();
- assert.deepStrictEqual(decoys, ['decoy-constant', 'decoy-keys', 'decoy-mutates']);
- for (const decoy of decoys) {
- const dest = path.join(workRoot, decoy);
- lib.prepareWorkspace(csv, dest, decoy);
- assert.ok(lib.grade(csv, dest).score < 1, `${decoy} must not pass`);
- }
- const { scores, sound } = intentEval.graderIsSound(csv, workRoot);
- assert.ok(sound, JSON.stringify(scores));
- for (const decoy of decoys) assert.ok(scores[decoy] < 1, `graderIsSound grades ${decoy}: ${scores[decoy]}`);
+ try {
+ const csv = intentEval.loadIntentScenarios().find(scenario => scenario.id === 'csv-export-delimiter');
+ const decoys = fs.readdirSync(csv.root).filter(name => name.startsWith('decoy-')).sort();
- assert.deepStrictEqual(decoys, ['decoy-constant', 'decoy-keys']);
++ assert.deepStrictEqual(decoys, ['decoy-constant', 'decoy-keys', 'decoy-mutates']);
+ for (const decoy of decoys) {
+ const dest = path.join(workRoot, decoy);
+ lib.prepareWorkspace(csv, dest, decoy);
+ assert.ok(lib.grade(csv, dest).score < 1, `${decoy} must not pass`);
+ }
+ const { scores, sound } = intentEval.graderIsSound(csv, workRoot);
+ assert.ok(sound, JSON.stringify(scores));
+ for (const decoy of decoys) assert.ok(scores[decoy] < 1, `graderIsSound grades ${decoy}: ${scores[decoy]}`);
+ } finally { fs.rmSync(workRoot, { recursive: true, force: true }); }
++
});
test('a grader that passes one of its decoys is not sound', () => {