Repository navigation
feat(evals): support suite-owned customMetadata in eval frontmatter - #546
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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
705b268 to
b7e4142
Compare
…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
left a comment
There was a problem hiding this comment.
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.
|
Thanks for the review! Yeah it's intentional - and it's not really a new failure mode either. It also shouldn't be reachable from main, since Happy to make it skip-and-warn instead if you think that's a better tradeoff though |
I agree with this as well. |
…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
mattrossman
left a comment
There was a problem hiding this comment.
Verified that area and journeyPhase came through in custom_metadata on a sample Luna run.
## 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
Current Behavior
Suites have no way to attach their own metadata to evals.
evalFrontmatterSchemakeeps only the keys it knows, so the CLI suite'sareaandjourneyPhasefrontmatter is dropped at parse time and never reachesresult.json, the exported results or Braintrust.Expected Behavior
This follows Matt's suggestion on #501.
Eval frontmatter accepts an optional
customMetadataobject. Core treats it as an opaque record and adds no suite-specific fields.stageis unchanged.A suite can own a schema for its fields by exporting a zod
customMetadataSchemafromevals/<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 havecustomMetadatapassed through unvalidated.customMetadatais recorded inresult.jsonand carried into exported results and Braintrust row metadata ascustom_metadata. The prompt's value wins, and the recorded result is the fallback.The
clisuite shipsevals/cli/custom-metadata.tswitharea(the 10 CLI areas) andjourneyPhase(the KPI 2 phases). Every CLI eval that's already tagged moves its tags undercustomMetadata: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.mdhas a short paragraph oncustomMetadataand the suite schema.A couple of things worth a look:
discoverEvalsis now async, because the suite schema is loaded with a dynamicimport()(cached per suite). Both callers alreadyawaited inmain.fetch-braintrust.tsis untouched because it only assembles benchmark rows today.Related Issue(s)
Part of CLI-2700