mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-21 20:28:24 +08:00
fix: never clean up observability artifacts — partial file persists after finalize
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 <noreply@anthropic.com>
This commit is contained in:
@@ -444,9 +444,6 @@ export class EvalCollector {
|
|||||||
tests: this.tests,
|
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
|
// Write eval file
|
||||||
fs.mkdirSync(this.evalDir, { recursive: true });
|
fs.mkdirSync(this.evalDir, { recursive: true });
|
||||||
const dateStr = timestamp.replace(/[:.]/g, '').replace('T', '-').slice(0, 15);
|
const dateStr = timestamp.replace(/[:.]/g, '').replace('T', '-').slice(0, 15);
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ describe('eval-store observability', () => {
|
|||||||
expect(partial.tests[1].last_tool_call).toBe('Bash(ls)');
|
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 evalDir = path.join(tmpDir, 'evals');
|
||||||
const collector = new EvalCollector('e2e', evalDir);
|
const collector = new EvalCollector('e2e', evalDir);
|
||||||
|
|
||||||
@@ -167,9 +167,10 @@ describe('eval-store observability', () => {
|
|||||||
|
|
||||||
await collector.finalize();
|
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('_'));
|
const files = fs.readdirSync(evalDir).filter(f => f.endsWith('.json') && !f.startsWith('_'));
|
||||||
expect(files.length).toBeGreaterThanOrEqual(1);
|
expect(files.length).toBeGreaterThanOrEqual(1);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user