From 5aae3ce11793c1e96fa0d67cc4bdef5616ccc714 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 14 Mar 2026 12:37:38 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20never=20clean=20up=20observability=20art?= =?UTF-8?q?ifacts=20=E2=80=94=20partial=20file=20persists=20after=20finali?= =?UTF-8?q?ze?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removing the _partial-e2e.json deletion from finalize(). These are small files on a local disk and their persistence is the whole point of observability. Co-Authored-By: Claude Opus 4.6 --- test/helpers/eval-store.ts | 3 --- test/helpers/observability.test.ts | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/helpers/eval-store.ts b/test/helpers/eval-store.ts index e42b5ba2a8a6113e551fa80b733387a33cc50b43..b4479951cf846892a0f4b21e4bea19ca44a47d0d 100644 --- a/test/helpers/eval-store.ts +++ b/test/helpers/eval-store.ts @@ -444,9 +444,6 @@ export class EvalCollector { tests: this.tests, }; - // Delete partial file now that we're writing the final - try { fs.unlinkSync(path.join(this.evalDir, '_partial-e2e.json')); } catch { /* may not exist */ } - // Write eval file fs.mkdirSync(this.evalDir, { recursive: true }); const dateStr = timestamp.replace(/[:.]/g, '').replace('T', '-').slice(0, 15); diff --git a/test/helpers/observability.test.ts b/test/helpers/observability.test.ts index cb793b5f1ebfe0b6cd71525c4f24c043765e29bc..67b588fb7df42cfcf0a5d67d100849952c742ed9 100644 --- a/test/helpers/observability.test.ts +++ b/test/helpers/observability.test.ts @@ -153,7 +153,7 @@ describe('eval-store observability', () => { expect(partial.tests[1].last_tool_call).toBe('Bash(ls)'); }); - test('7: finalize() deletes partial file', async () => { + test('7: finalize() preserves partial file alongside final', async () => { const evalDir = path.join(tmpDir, 'evals'); const collector = new EvalCollector('e2e', evalDir); @@ -167,9 +167,10 @@ describe('eval-store observability', () => { await collector.finalize(); - expect(fs.existsSync(partialPath)).toBe(false); + // Partial file preserved for observability — never cleaned up + expect(fs.existsSync(partialPath)).toBe(true); - // Final eval file should exist + // Final eval file should also exist const files = fs.readdirSync(evalDir).filter(f => f.endsWith('.json') && !f.startsWith('_')); expect(files.length).toBeGreaterThanOrEqual(1); });