Skip to content

feat(cli): tag cli evals with area and journey phase - #501

Merged
Coly010 merged 2 commits into
columferry/cli-2700-suite-custom-metadatafrom
columferry/cli-2700-tag-the-six-existing-cli-evals-with-area
Nov 26, 2026
Merged

Coly010 merged 2 commits into
columferry/cli-2700-suite-custom-metadatafrom
columferry/cli-2700-tag-the-six-existing-cli-evals-with-area

Conversation

@Coly010

@Coly010 Coly010 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Current Behavior

Every cli eval carries customMetadata.area and customMetadata.journeyPhase except the six original local-stack evals, so the CLI suite schema has to leave both fields optional.

Expected Behavior

  • The six local-stack evals are tagged area: local-stacks. The four build-* evals are journeyPhase: design and the two resolve-* evals are journeyPhase: resolve. Each README gets a short "Area and journey phase" section to match the newer evals.
  • Now that every cli eval is tagged, evals/cli/custom-metadata.ts makes both fields required. The real-prompts test asserts every CLI prompt carries customMetadata.

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

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Nov 24, 2026 12:26pm UTC

Request Review

@jgoux jgoux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mattrossman

mattrossman commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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 object in frontmatter:

customMetadata:
  area: local-stacks
  journeyPhase: design

Each suite could optionally own a schema under evals/<suite>/ to validate its fields. I'd keep stage unchanged and put both area and journeyPhase here for now. We can split that out of this PR as you suggest.

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
@Coly010
Coly010 force-pushed the columferry/cli-2700-tag-the-six-existing-cli-evals-with-area branch from 2b50f80 to a45edf4 Compare November 24, 2026 11:33
@Coly010
Coly010 changed the base branch from main to columferry/cli-2700-suite-custom-metadata November 24, 2026 11:33
…rry/cli-2700-tag-the-six-existing-cli-evals-with-area

# Conflicts:
#	apps/framework/lib/custom-metadata.test.ts
#	evals/cli/custom-metadata.ts
Coly010 added a commit that referenced this pull request Nov 26, 2026
…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
@Coly010
Coly010 merged commit 983a340 into columferry/cli-2700-suite-custom-metadata Nov 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants