mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-22 04:38:24 +08:00
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) <noreply@anthropic.com>
This commit is contained in:
@@ -310,7 +310,7 @@ async function cmdPush(args: string[]): Promise<void> {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { validateEvalResult } = await import('./eval-format');
|
const { validateEvalResult, normalizeToLegacy } = await import('./eval-format');
|
||||||
const validation = validateEvalResult(data);
|
const validation = validateEvalResult(data);
|
||||||
if (!validation.valid) {
|
if (!validation.valid) {
|
||||||
console.error('Validation errors:');
|
console.error('Validation errors:');
|
||||||
@@ -318,12 +318,13 @@ async function cmdPush(args: string[]): Promise<void> {
|
|||||||
process.exit(1);
|
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 basename = path.basename(resolved);
|
||||||
const localPath = path.join(EVAL_DIR, basename);
|
const localPath = path.join(EVAL_DIR, basename);
|
||||||
fs.mkdirSync(EVAL_DIR, { recursive: true });
|
fs.mkdirSync(EVAL_DIR, { recursive: true });
|
||||||
fs.copyFileSync(resolved, localPath);
|
fs.writeFileSync(localPath, JSON.stringify(legacyData, null, 2) + '\n');
|
||||||
console.log(`Saved to ${localPath}`);
|
console.log(`Saved to ${localPath} (normalized to legacy format)`);
|
||||||
|
|
||||||
// Push to team store (non-fatal)
|
// Push to team store (non-fatal)
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user