From 468c5eb55fda675eac91b30ffa1010024a675ea3 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 01:28:19 -0700 Subject: [PATCH] fix: normalize StandardEvalResult to legacy format before local save P1 from Codex review: gstack eval push copied standard-format JSON verbatim to ~/.gstack-dev/evals/, but eval:summary and eval:trend expect legacy fields (branch, total_tests, tests). Now uses normalizeToLegacy() before writing locally. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/cli-eval.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cli-eval.ts b/lib/cli-eval.ts index 41331345..6c52dde5 100644 --- a/lib/cli-eval.ts +++ b/lib/cli-eval.ts @@ -310,7 +310,7 @@ async function cmdPush(args: string[]): Promise { process.exit(1); } - const { validateEvalResult } = await import('./eval-format'); + const { validateEvalResult, normalizeToLegacy } = await import('./eval-format'); const validation = validateEvalResult(data); if (!validation.valid) { console.error('Validation errors:'); @@ -318,12 +318,13 @@ async function cmdPush(args: string[]): Promise { process.exit(1); } - // Copy to local eval dir + // Normalize to legacy format for local tooling (eval:summary, eval:trend, eval:compare) + const legacyData = normalizeToLegacy(data as any); const basename = path.basename(resolved); const localPath = path.join(EVAL_DIR, basename); fs.mkdirSync(EVAL_DIR, { recursive: true }); - fs.copyFileSync(resolved, localPath); - console.log(`Saved to ${localPath}`); + fs.writeFileSync(localPath, JSON.stringify(legacyData, null, 2) + '\n'); + console.log(`Saved to ${localPath} (normalized to legacy format)`); // Push to team store (non-fatal) try {