Repository navigation
feat(cli): tag cli evals with area and journey phase - #501
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
jgoux
left a comment
There was a problem hiding this comment.
Thanks for this. The six local-stack evals are tagged as described, and all 26 evals/cli prompts now carry enum-valid area/journeyPhase values. No other suite sets these keys, so nothing else starts failing validation. The fields reach eval-results.json and Braintrust metadata, and the core and framework tests for this change pass, as does pnpm -r typecheck.
There's one small inline consistency note; it doesn't block merging. One FYI: fetch-braintrust.ts only assembles benchmark-suite rows today, so its new area/journey_phase mapping won't show up for CLI evals until that fetcher covers the cli suite.
On your two questions: a closed area enum fits how topic works, and widening it when a second suite needs areas seems fine. A separate journeyPhase field next to stage makes sense because the two sets don't line up.
|
Continuing the convo from Slack, I'd prefer supporting suite-specific metadata instead of adding individual fields to the shared framework. Perhaps an optional customMetadata:
area: local-stacks
journeyPhase: designEach suite could optionally own a schema under |
Tag the six original local-stack evals with `customMetadata.area` and `customMetadata.journeyPhase`. Every cli eval now carries both, so the cli suite schema makes them required. Fixes CLI-2700
2b50f80 to
a45edf4
Compare
…rry/cli-2700-tag-the-six-existing-cli-evals-with-area # Conflicts: # apps/framework/lib/custom-metadata.test.ts # evals/cli/custom-metadata.ts
…546) ## Current Behavior Suites have no way to attach their own metadata to evals. `evalFrontmatterSchema` keeps only the keys it knows, so the CLI suite's `area` and `journeyPhase` frontmatter is dropped at parse time and never reaches `result.json`, the exported results or Braintrust. ## Expected Behavior This follows Matt's suggestion on [#501](#501 (comment)). - Eval frontmatter accepts an optional `customMetadata` object. Core treats it as an opaque record and adds no suite-specific fields. `stage` is unchanged. - A suite can own a schema for its fields by exporting a zod `customMetadataSchema` from `evals/<suite>/custom-metadata.ts`. The framework validates against it at eval discovery (`discoverEvals`) and when reading prompts for export (`readPrompt`), so a bad value fails before any run. Suites without the file have `customMetadata` passed through unvalidated. - `customMetadata` is recorded in `result.json` and carried into exported results and Braintrust row metadata as `custom_metadata`. The prompt's value wins, and the recorded result is the fallback. - The `cli` suite ships `evals/cli/custom-metadata.ts` with `area` (the 10 CLI areas) and `journeyPhase` (the KPI 2 phases). Every CLI eval that's already tagged moves its tags under `customMetadata`: ```yaml customMetadata: area: local-stacks journeyPhase: design ``` Both fields are optional here, because six local-stack evals aren't tagged yet. #501, stacked on this PR, tags them and makes both fields required. - `CONTRIBUTING.md` has a short paragraph on `customMetadata` and the suite schema. A couple of things worth a look: 1. `discoverEvals` is now async, because the suite schema is loaded with a dynamic `import()` (cached per suite). Both callers already `await`ed in `main`. 2. `fetch-braintrust.ts` is untouched because it only assembles benchmark rows today. ## Related Issue(s) Part of CLI-2700
983a340
into
columferry/cli-2700-suite-custom-metadata
Current Behavior
Every
clieval carriescustomMetadata.areaandcustomMetadata.journeyPhaseexcept the six original local-stack evals, so the CLI suite schema has to leave both fields optional.Expected Behavior
area: local-stacks. The fourbuild-*evals arejourneyPhase: designand the tworesolve-*evals arejourneyPhase: resolve. Each README gets a short "Area and journey phase" section to match the newer evals.clieval is tagged,evals/cli/custom-metadata.tsmakes both fields required. The real-prompts test asserts every CLI prompt carriescustomMetadata.Stacked on #546, which adds suite-owned
customMetadata. The framework changes that used to be in this PR moved there, as discussed here.Related Issue(s)
Fixes CLI-2700