Skip to content

Add support for classifier "scorers"#1553

Open
aswink wants to merge 5 commits intomainfrom
aswin/03-12-add_support_for_classifier_scorers_
Open

Add support for classifier "scorers"#1553
aswink wants to merge 5 commits intomainfrom
aswin/03-12-add_support_for_classifier_scorers_

Conversation

@aswink
Copy link
Contributor

@aswink aswink commented Mar 12, 2026

No description provided.

Copy link
Contributor Author

aswink commented Mar 12, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aswink aswink marked this pull request as ready for review March 12, 2026 23:06
Copy link
Member

Choose a reason for hiding this comment

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

This also needs a bunch more tests, but we can tackle that after this.

try {
const value = await rootSpan.traced(fn, {
name: spanName,
spanAttributes: { type: spanType, purpose: "scorer" },

Choose a reason for hiding this comment

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

should we make this purpose: "classifier" for classifier spans? We might need to introduce a new runInClassiferSpan helper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not totally sure of the implications of this, I think it would require a bunch of backend changes as well if we did. Could be a good idea, though, Alex Z (@CLowbrow) do you know?

Choose a reason for hiding this comment

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

More context from Ankur - this is a PITA to change because there is a bunch of places in the backend that rely on it. We can't do it. Relevant slack thread: https://braintrustdata.slack.com/archives/C083GCUTVDZ/p1773705541982479

@aswink aswink force-pushed the aswin/03-12-add_support_for_classifier_scorers_ branch 2 times, most recently from 662efe8 to 30ca11a Compare March 16, 2026 20:30
@aswink aswink force-pushed the aswin/03-12-add_support_for_classifier_scorers_ branch from 8afd421 to 1421ef7 Compare March 17, 2026 17:58
@AbhiPrasad
Copy link
Member

Abhijeet Prasad (AbhiPrasad) commented Mar 17, 2026

warning AI slop:

I ran this PR against my spec in https://github.com/braintrustdata/braintrust-spec/pull/2 (after cleaning up stuff like the confidence changes) and it codex gave me the two following things:

  • The TypeScript API contract is weaker than the spec. The spec models Evaluator as a union that requires either scores or classifiers at the type level (spec lines 23-31:23). The PR makes both optional in js/src/framework.ts and only enforces the rule at runtime. It also keeps scores required on EvalResult, so classifier-only runs likely still produce scores: {} even though the spec makes scores optional.
  • The SDK toolchain is not classifier-aware end to end. The execution path in js/src/framework.ts supports classifiers, but js/src/cli/functions/upload.ts, js/dev/server.ts, and js/src/cli/functions/infer-source.ts were only updated to tolerate missing scores; they still enumerate, bundle, and resolve only scorers. So classifier support is partial: local eval execution works, but upload/dev/source-inference surfaces are not fully wired up.

These seem like things we have to tackle.

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.

2 participants