Repository navigation
feat: add the corbits-eval CLI - #28
TheGreatAxios wants to merge 2 commits into
Conversation
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. Stacked on #27: only this pull request's own changes were checked. Waiting on a maintainer to approve: approve, request review. |
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Request changes
Adds the corbits-eval CLI. The bin, command discovery, and the four existing exit-code tests are wired. --format json is not machine-readable, and a file that is not a spec exits 1 instead of 2.
Findings
-
src/cli/run.ts:21—runEvaluation(spec)prints the human summary before the JSON body.bun src/cli/index.ts run e2e/fixtures/pass.ts --format jsonexits 0, but stdout starts withpass: 1/1 cases passed, soJSON.parsethrowsUnexpected identifier "pass". A gate failure (--jsonone2e/fixtures/fail.ts, exit 1) has the same prefix. The command never setsquiet: trueand does not look atc.format. README’s--format json/--jsoncontract is not somethingjqcan read. -
src/evalFile.ts:18—isSpeconly requires a stringnameplus the keysdataandtask.export const evaluation = { name: "bad", data: 1, task: "nope" }is accepted, thenbun src/cli/index.ts run <that file>exits 1 with{"code":"UNKNOWN","message":"cases.map is not a function..."}instead of exit 2 and “no evaluation spec”. A non-spec is reported as a failed gate. -
src/cli/run.ts:27— an emptydata: []exits 1 withcode: UNKNOWNandevaluation "empty" has no data. A scorer of"is it fine?"with nojudgeexits 1 withstring and ask checks need judge.invoke. README reserves exit 1 for a failed gate (EVAL_FAILED). These config errors never ran, but they take the same exit code.
package.json bin corbits-eval points at ./dist/cli/index.js. bun run build, bun run typecheck, and bun run test:e2e exited 0 (72 pass). Those e2e cases never assert stdout or a bad spec shape. The Node failure Bun is not defined is the existing scorer path, not this CLI branch.
JSON output sets quiet so the human summary does not prefix stdout. A module that is not a runnable spec is rejected at load time. Config errors that never start a run exit 2 instead of 1.
Review · Follow-upCommit
|
|
Superseded by the 0.2.0 release: #32 |
Summary
corbits-evalbin.corbits-eval run <file>loads an evaluation spec and callsrunEvaluation.EvalFailure, and 2 when the file is missing or has no spec.corbits-evalonly.Verification
bun run checkexited 0 (typecheck, lint, format, unit, and e2e: 72 passed).e9ed49dfound no defects.Stacked on #27.
Fixes CL-11497