feat: add Runner, RunnerResult, Judge, and Evaluator#180
Open
mattrmc1 wants to merge 26 commits into
Open
Conversation
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
…b.com:launchdarkly/java-core into mmccarthy/AIC-2665/java-ai-sdk-v-1-0-aievals
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit faa4981. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from
mmccarthy/AIC-2664/ai-config-tracker-overhaul
to
main
June 25, 2026 16:05
…hy/AIC-2665/java-ai-sdk-v-1-0-aievals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds the AIEVALS types —
Runner,RunnerResult,Judge, andEvaluator— and wiresEvaluator.noop()into all config types. Callers can now implement aRunnerto wrap any model provider, construct aJudgeto evaluate AI outputs against a judge prompt with structured{score, reasoning}output, and coordinate multiple judges through anEvaluator.New types
Wraps a model provider SDK.
outputTypecarries a JSON-Schema-like map when structured output is needed. Single-arg overload delegates withoutputType = null.Immutable result of a
Runnerinvocation.parsedis defensively copied and returned as unmodifiable.Evaluates AI output by invoking a runner with a formatted evaluation prompt and parsing the structured response. Sampling gate runs first — below the rate, returns
sampled=falseimmediately. Creates a fresh tracker per evaluation viaconfig.createTracker(). Parsesscore(Number, [0.0, 1.0]) andreasoning(String, optional). Runner exceptions are caught and returned asJudgeResult(success=false)— judge failures are results, not exceptions. Does not calltrackJudgeResult.Coordinates sequential execution of judges. Missing judges skipped with a warning.
Evaluator.noop()returns a singleton whoseevaluateimmediately returns an empty list. For v1.0, all configs receiveEvaluator.noop().Config type changes
AIConfigbase class gains anEvaluatorfield andgetEvaluator()accessor.AICompletionConfigandAIAgentConfigconstructors accept anEvaluator.AIJudgeConfigalways wiresEvaluator.noop()internally — judges do not evaluate themselves.Test plan
./gradlew :lib:sdk:server-ai:testpassesJudgeTest— successful evaluation, score boundary validation (0 and 1), reasoning optional, runner exception handling (caught not rethrown), null/missing parsed output, score out of range, sampling rates (0 always skips, 1 always runs), message formatting, getter accessorsEvaluatorTest— noop returns empty list, noop singleton identity, single/multiple judge execution, missing judge skipped, evaluator does not calltrackJudgeResult, returned future is already completeRunnerResultTest— builder field assignment, immutability, defensive copy of parsed mapNote
Medium Risk
New public SDK surface and constructor wiring on config types; runtime behavior stays noop until real evaluators are wired, but Judge paths will invoke Runners and extra model calls when enabled later.
Overview
Introduces the AI evaluation stack for the server AI SDK: a
Runnerabstraction (plus immutableRunnerResult) for provider calls, aJudgethat runs judge prompts via a runner and parses structured{score, reasoning}with sampling and defensive failure handling, and anEvaluatorthat runs configured judges sequentially and returnsCompletableFuture<List<JudgeResult>>(missing judges are skipped with a warning;trackJudgeResultis left to callers).AIConfignow carries anEvaluatorexposed viagetEvaluator().AICompletionConfigandAIAgentConfigtake an evaluator in their package-private constructors;LDAIClientImplalways suppliesEvaluator.noop()for retrieved configs in this release.AIJudgeConfigpassesEvaluator.noop()through the base class because judges do not self-evaluate.Unit tests cover
Judge,Evaluator, andRunnerResultbehavior (sampling, parsing, immutability, noop paths).Reviewed by Cursor Bugbot for commit 25346b3. Bugbot is set up for automated code reviews on this repo. Configure here.