Repository navigation
Schema: Run leaves the Eval body; per-run facets, status and metrics; Card.run_results; evalhub.eval/2.0 - #36
Merged
Merged
Conversation
…rd.run_results; evalhub.eval/2.0 An Eval's runs were embedded in the record body: adding one run meant posting a whole new version, a run could carry no measurements (`deny_unknown_fields`, no `ext`), conditions existed once per Eval, and `Run.outcome` was a verdict in a type whose doc says grading belongs to the Card. This is the type change of #24, stage 1 of 9: the shapes only, no behaviour. New `run` module: `Run { run_id, status, error?, skip_reason?, started_at?, ended_at?, six facets, calls?, artifacts[], attachments[], metrics{}, ext, meta? }`, `RunStatus { ok, error, skipped }`, `RunError { kind, message?, log? }`. A run has no verdict; its facets default to the header's; `metrics` is what was measured from the run itself; `meta` is never interpreted. `Eval` is now the header alone (`evalhub.eval/2.0`, `schemas/eval-2.json`). Removing a key is a major bump, so the 1.0 types move to `eval::v1`, keep generating `schemas/eval.json` unchanged, and stay accepted by 0.2.0 only (the versioning section in `lib.rs` names 0.2.0 and 0.3.0). `RecordKind::schema_ids()` and `schema_for(id)` expose the accepted ids; `schema_id()` / `schema()` keep returning the current one, so the query path table and every exhaustive match are untouched. `Card.run_results[] { eval, run_id, metric, value?, label?, by?, from? }` is a new optional key, so `evalhub.card/1.1`, one document, `schema` accepting 1.0 and 1.1. The used set (`attrs.runs`, else every live run at posting time) is documented on `Card` and on `attrs.runs`. `ErrorCode` gains the thirteen run codes (enum and doc only; the checks arrive in stages 2, 4, 5 and 7). `SCHEMA_NAMES` gains `eval-2` and `run`. Fixtures: `eval-run-set.json` is a header, the old file stays as `eval-run-set-v1.json` for the compatibility tests, `run.json` and `card-run-results.json` are new, `card-complete.json` loses `attrs.runs`. The server OpenAPI snapshot and the web client's `ErrorCode` union are regenerated in this commit. Not here: validation, hashes, store tables, endpoints. `validate.rs`, the query docs and the Eval page still speak of `runs` in the body; stages 2, 3 and 8 own those. Verified: cargo fmt --check; cargo clippy --workspace --all-targets -D warnings; cargo test -p evalhub-schema (20 passed), -p evalhub-core (34), -p evalhub-query (15), -p evalhub-store (63, Docker), -p evalhub-server (60, Docker); cargo doc --no-deps -p evalhub-schema (0 warnings); just semver-check reports evalhub-schema needs the 0.2 bump (5 major lints: Eval.runs / Run / Outcome removed, Card.run_results and ErrorCode variants added), which is the expected result; the bump is stage 9. Refs #27 Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 1 of 9 of #24 (Runs as first-class rows). The type change only: no validation, hashes, tables or endpoints. All five crates are green on this tree, so the branch is mergeable on its own; the version bump is stage 9 (#35).
What changed
runmodule (new):Run { run_id, status, error?, skip_reason?, started_at?, ended_at?, model?, task?, harness?, generation?, trial?, env?, calls?, artifacts[], attachments[], metrics{}, ext, meta? },RunStatus { ok, error, skipped },RunError { kind, message?, log? }.deny_unknown_fieldsonRunandRunError. The facets reusefacet;attachments[]reusescommon::Attachment;metricsisBTreeMap<String, f64>;metais uninterpreted JSON. The module doc carries therun_idrule (URL segment, no/, ≤ 200 bytes), theerror.kindslug rule andunrecorded.Evalis the header (evalhub.eval/2.0,schemas/eval-2.json):runsand the oldRun/Outcomeare gone from it. The module doc is rewritten: header plus runs, runs belong to the record and not to a version,run_setno longer requires runs and anyeval_kindmay have them, conditions are per run with the header's facets as defaults, tasks and runs are not separate types, a run has no verdict.eval::v1(new): the 1.0Eval/Run/Outcome, accepted by 0.2.0 only and removed in 0.3.0 (doc note, not#[deprecated], so-D warningsstays clean on the internal uses stages 2 and 6 need). It still generatesschemas/eval.json, which is byte-identical tomain.EVAL_SCHEMA = evalhub.eval/2.0,CARD_SCHEMA = evalhub.card/1.1.RecordKind::schema_ids()lists the accepted ids,schema_for(id)returns the document for one of them;schema_id()/schema()are unchanged in shape, so the query path table and every exhaustive match are untouched. Theschemaconstraint onCardis anenumof 1.0 and 1.1. The versioning section inlib.rsnames 0.2.0 as the release that acceptsevalhub.eval/1.0and 0.3.0 as the one that removes it.Card.run_results[]{ eval, run_id, metric, value?, label?, by?, from? }, default empty. The used set is documented onCardand onattrs.runsincommon.ErrorCode:runs_moved,run_status_detail,run_id_invalid,run_id_mismatch,run_result_value_or_label,run_results_eval_unknown,run_unknown,run_not_in_used_set,too_many_run_results,run_deleted(409),batch_duplicate_run_id,batch_too_large(413),body_too_large(413).metric_id_invalidnow also coversrun_results[].metricand a run'smetricskey.schemas/card.json,schemas/error.jsonregenerated;schemas/eval-2.json,schemas/run.jsonnew;SCHEMA_NAMESgainseval-2andrun; the server OpenAPI snapshot andweb/src/lib/api/schema.d.ts(ErrorCodeunion) regenerated.eval-run-set.jsonis a 2.0 header; the old file is kept aseval-run-set-v1.jsonfor the compatibility tests of stages 2, 4 and 7;run.jsonandcard-run-results.json(withrun_resultsand auses_evalcarryingattrs.runs) are new;card-complete.jsonlosesattrs.runs, has norun_results, and declares 1.1 (1.0 stays covered byevalhub-core'svalid-card.jsonand a test that postsrun_resultsunder 1.0). Inevalhub-core,valid-eval.jsonandeval-run-refs.jsonare schema-valid 2.0 headers; the run-pointer material of the latter returns with the run fixtures in stage 2.Verified
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p evalhub-schemacargo test -p evalhub-corecargo test -p evalhub-querycargo t 8000 est -p evalhub-store(Docker)cargo test -p evalhub-server(Docker).snap.newcargo doc --no-deps -p evalhub-schemarunandeval::v1presentjust semver-checkevalhub-schema: 5 major lints (Eval.runs/Run/Outcomeremoved,Card.run_resultsandErrorCodevariants added), the expected 0.1 → 0.2;core/query: no update requiredcorepack pnpm check(web)Not run:
just e2e,cargo deny check(no dependency added),deploy/fly/smoke.sh(targets the hosted service; read and still posts a valid 2.0 header).Deliberately not covered
Validation rules, hashes, store tables, endpoints (stages 2–7).
validate.rs, the query grammar / typecheck docs and the web Eval page still describerunsin the body; stages 2, 3 and 8 own those lines.Refs #27