feat(apollo-vertex): custom evaluator renderer registry for solution-tests#881
feat(apollo-vertex): custom evaluator renderer registry for solution-tests#881RobinMennens-UiPath wants to merge 2 commits into
Conversation
…tests
Verticals can register custom evaluator result renderers keyed by evaluator id
via `SolutionTestsConfig.evaluatorRenderers`, merged over the built-ins
(`resolveEvaluatorRenderer` precedence: vertical > built-in > generic). This is
the FE counterpart to the solution-test backend's custom evaluator builders.
Renderer-specific config is bound at registration, not threaded through the
runtime call site: `genericRenderer({ label })` captures a display label and
`makeRenderer(schema, Component, bound)` spreads bound props into the component,
so `EvaluatorRenderer`'s runtime signature never changes as renderers gain
params. Labels now live on the registry entries; the standalone EVALUATOR_LABELS
table is removed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EioRufJjChLWS7wQ2DsCLd
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
Pull request overview
Adds a configurable evaluator-renderer registry to the apps/apollo-vertex/registry/solution-tests feature so consuming verticals can register custom evaluator result components (keyed by evaluator id) via SolutionTestsConfig, without modifying the built-in registry.
Changes:
- Extends
SolutionTestsConfigwithevaluatorRenderersand defaults it inresolveConfig. - Introduces a renderer registration/resolution API (
makeRenderer,genericRenderer,resolveEvaluatorRenderer) with precedence vertical > built-in > generic fallback. - Moves built-in evaluator display labels into the built-in registry entries and removes the standalone
EVALUATOR_LABELSmap.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/apollo-vertex/registry/solution-tests/index.ts | Exports the new renderer helpers/types and built-in evaluator id constants for consumers. |
| apps/apollo-vertex/registry/solution-tests/evaluators/registry.tsx | Implements renderer creation/binding and resolution with vertical override support. |
| apps/apollo-vertex/registry/solution-tests/evaluators/generic-evaluator-result.tsx | Accepts a bound label prop (fallback to evaluator id) for the generic evaluator card. |
| apps/apollo-vertex/registry/solution-tests/evaluator-results-view.tsx | Pulls evaluatorRenderers from config context and passes them into renderer resolution. |
| apps/apollo-vertex/registry/solution-tests/constants.ts | Removes the EVALUATOR_LABELS mapping now embedded in the registry. |
| apps/apollo-vertex/registry/solution-tests/config.ts | Adds evaluatorRenderers to config types and applies a default {} in resolveConfig. |
| export function makeRenderer<TDetails, TExtra extends object>( | ||
| schema: z.ZodType<TDetails>, | ||
| Component: ComponentType<EvaluatorResultProps<TDetails>>, | ||
| ) { | ||
| Component: ComponentType<EvaluatorResultProps<TDetails> & TExtra>, | ||
| bound: TExtra, | ||
| ): EvaluatorRenderer { |
📊 Coverage + size by packagePer-package bundle size on this PR (no JS/TS source changes detected under
"Coverage" is each package's own |
Wrap the resolveEvaluatorRenderer call per biome (lineWidth 100) to fix the Format CI check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EioRufJjChLWS7wQ2DsCLd
What & why
Back-port of the solution-tests custom-evaluator work from the FINS vertical solution (UiPath/fins-vertical-solution#604). Adds a custom evaluator renderer registry so a consumer can register its own evaluator result components — keyed by evaluator id — through the existing
SolutionTestsConfig, without editing the registry component.This is the frontend counterpart to the solution-test backend, where a vertical registers custom evaluators (e.g. a custom LLM-as-a-judge with a tailored prompt but the same
{score, justification}output). The FE just needs to map that new evaluator id to a component — usually the existing generic card.Changes (
registry/solution-tests)config.ts—SolutionTestsConfig.evaluatorRenderers?: EvaluatorRenderers, defaulted inresolveConfig.evaluators/registry.tsx—resolveEvaluatorRenderer(id, verticalRenderers?)resolves vertical > built-in > generic fallback. Renderer-specific config is bound at registration, not threaded through the runtime call site:genericRenderer({ label })captures a display label;makeRenderer(schema, Component, bound)spreads bound props into the component. SoEvaluatorRenderer's runtime signature stays uniform as renderers gain params.evaluator-results-view.tsx— readsevaluatorRenderersfrom context and passes it to the resolver.evaluators/generic-evaluator-result.tsx— takes the displaylabelas a bound prop (label ?? evaluatorId).constants.ts— removed the standaloneEVALUATOR_LABELStable; built-in labels now live on their registry entries (single source of truth).index.ts— exportsmakeRenderer,genericRenderer,resolveEvaluatorRenderer,GENERIC_RENDERER, the evaluator-id constants, and the renderer types.Checks
tsc --noEmit,oxlint --type-aware, anddepcruise registryall pass (the 10 dep-cruiser warnings are pre-existing inshell/ai-chat, unrelated).🤖 Generated with Claude Code