Skip to content

feat(evals): support suite-owned customMetadata in eval frontmatter - #546

Merged
Coly010 merged 2 commits into
mainfrom
columferry/cli-2700-suite-custom-metadata
Nov 26, 2026
Merged

Coly010 merged 2 commits into
mainfrom
columferry/cli-2700-suite-custom-metadata

Conversation

@Coly010

@Coly010 Coly010 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • 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:

    customMetadata:
      area: local-stacks
      journeyPhase: design

    Both fields are optional here, because six local-stack evals aren't tagged yet. feat(cli): tag cli evals with area and journey phase #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 awaited in main.
  2. fetch-braintrust.ts is untouched because it only assembles benchmark rows today.

Related Issue(s)

Part of CLI-2700

@Coly010
Coly010 requested review from a team as code owners November 24, 2026 11:07
@Coly010
Coly010 requested review from Prashansa-K and removed request for a team November 24, 2026 11:07
@vercel

vercel Bot commented Nov 24, 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:22pm UTC

Request Review

Add an optional `customMetadata` object to eval frontmatter. A suite can
validate it by exporting `customMetadataSchema` from
`evals/<suite>/custom-metadata.ts`, checked at eval discovery and when
reading prompts for export. The value is recorded in result.json and
carried into exported results and Braintrust row metadata as
`custom_metadata`.

The cli suite ships a schema for `area` and `journeyPhase`, and every
tagged cli eval moves its top-level tags under `customMetadata`.

Refs CLI-2700
@Coly010
Coly010 changed the base branch from columferry/cli-2700-tag-the-six-existing-cli-evals-with-area to main November 24, 2026 11:33
@Coly010
Coly010 force-pushed the columferry/cli-2700-suite-custom-metadata branch from 705b268 to b7e4142 Compare November 24, 2026 11:33
…ync with prompts

- reject a custom-metadata.ts that does not export customMetadataSchema
- let prompt customMetadata win in export and Braintrust upload, including when it was removed
- validate every CLI prompt against the suite schema in the CLI test suite
- assert tags through parseEvalMarkdown in eval seed tests and normalise README sections

@Prashansa-K Prashansa-K left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look good to me.
I had one question though - export now fails hard on an invalid prompt, is that intentional?

readPrompt in apps/framework/lib/result-files.ts now calls validateCustomMetadata, which throws when a prompt's customMetadata doesn't satisfy the suite schema. export-results and upload-braintrust call readPrompt for each eval id inside a loop over all result files, with no try/catch. So one invalid prompt throws out of the loop and aborts the whole run. Results for every other eval, including ones with valid prompts, aren't exported or uploaded.
Failing loudly on bad metadata seems reasonable to me. I just wanted to confirm that this is intentional.

@Coly010

Coly010 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

Yeah it's intentional - and it's not really a new failure mode either. readPrompt already threw on invalid frontmatter before this (parseEvalMarkdown throws on a bad stage etc.), so one broken prompt could already abort the export. This just applies the same rule to customMetadata

It also shouldn't be reachable from main, since evals/cli/custom-metadata.test.ts validates every CLI prompt against the schema in CI, and discoverEvals rejects it at run time. I'd rather it fail loudly than export results with the metadata quietly dropped and end up with wrong slices in the dashboards

Happy to make it skip-and-warn instead if you think that's a better tradeoff though

@Prashansa-K

Copy link
Copy Markdown
Contributor

I'd rather it fail loudly than export results with the metadata quietly dropped and end up with wrong slices in the dashboards

I agree with this as well.
We can go ahead as it is. No further changes required from my side.

francis-codex added a commit to francis-codex/evals that referenced this pull request Nov 25, 2026
…on eval

Adds 10 Supabase database linter checks to platform-lite (security:
policy_exists_rls_disabled, rls_enabled_no_policy, security_definer_view,
function_search_path_mutable, materialized_view_in_api; performance:
unindexed_foreign_keys, auth_rls_initplan, no_primary_key,
multiple_permissive_policies, duplicate_index). The performance advisor
now returns real lints instead of an empty list. rls_disabled_in_public
remediation is now the docs URL, matching the hosted API.

New regression eval investigate-database-001-large-advisor-backlog seeds
a Mockamaster-shaped project: 547 findings in 11 issues, 8 at warning or
worse, and 3 critical issues that all trace to public.payments having RLS
disabled. It checks get_issues was called, its output stayed under 100k
chars without harness truncation, and the agent ranked enabling RLS on
public.payments first.

The experiment pins supabase/mcp at a0137116 (supabase#546 head) so it runs
without a local MCP checkout. Drop the pin once get_issues ships.

Refs supabase/mcp#546, supabase/mcp#574
francis-codex added a commit to francis-codex/evals that referenced this pull request Nov 25, 2026
francis-codex added a commit to francis-codex/evals that referenced this pull request Nov 25, 2026

@mattrossman mattrossman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified that area and journeyPhase came through in custom_metadata on a sample Luna run.

CleanShot 2026-11-25 at 2 56 35 PM@2x

@Coly010
Coly010 merged commit 4f2c8c2 into main Nov 26, 2026
14 checks passed
Coly010 added a commit that referenced this pull request Nov 26, 2026
## 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](#501 (comment)).

## Related Issue(s)

Fixes CLI-2700
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.

3 participants