* feat(eval): add resolveEvalModel helper with fail-fast Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(eval): add createRunDir helper with path sanitization Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(eval): add markdown report helpers * refactor(eval): move language test cases under eval/outline-language * feat(eval): add outline-language types * feat(eval): add outline-language LLM judge * feat(eval): add outline-language reporter * feat(eval): add outline-language runner entry * chore(eval): add eval:outline-language pnpm script * refactor(eval): adopt shared createRunDir and drop gpt-4o fallbacks in whiteboard runner * refactor(eval): drop redundant non-null assertions after narrowing Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(eval): remove SCORER_MODEL_DEFAULT hardcoded gpt-4o fallback * chore(eval): delete tests/generation and clean up vitest/gitignore config * docs(eval): explain why outline-language runner pre-validates env vars Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(eval): escape pipe chars in markdown summary table cells LLM judge output may contain | which breaks GFM table rendering. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: 杨慎 <117187635+cosarah@users.noreply.github.com>
17 lines
691 B
TypeScript
17 lines
691 B
TypeScript
import { mkdirSync } from 'fs';
|
|
import { join } from 'path';
|
|
|
|
/**
|
|
* Build and create a run directory under `<baseDir>/<sanitized-model>/<timestamp>/`.
|
|
* The model string is sanitized by replacing `:` and `/` with `-` so it is
|
|
* safe to use as a directory name. Timestamp is ISO-8601 with colons and dots
|
|
* replaced by dashes, truncated to second precision.
|
|
*/
|
|
export function createRunDir(baseDir: string, model: string): string {
|
|
const sanitizedModel = model.replace(/[:/]/g, '-');
|
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
const runDir = join(baseDir, sanitizedModel, timestamp);
|
|
mkdirSync(runDir, { recursive: true });
|
|
return runDir;
|
|
}
|