Skip to content

W-22203426: feat: move eval normalizer, formatter, YAML translator, and runner into library#276

Open
andresrivas-sf wants to merge 3 commits intomainfrom
afr/W-22203426/eval-refactor-to-library
Open

W-22203426: feat: move eval normalizer, formatter, YAML translator, and runner into library#276
andresrivas-sf wants to merge 3 commits intomainfrom
afr/W-22203426/eval-refactor-to-library

Conversation

@andresrivas-sf
Copy link
Copy Markdown
Contributor

Summary

@W-22203426@

  • Moves evalNormalizer, evalFormatter, yamlSpecTranslator from plugin-agent into this shared library so any consumer can use them without depending on the CLI plugin
  • Adds a new agentEvalRunner module that encapsulates resolveAgent, executeBatches, and buildResultSummary (API execution logic previously embedded in the run-eval command)
  • Exports all four modules from the package index.ts
  • Adds comprehensive unit tests: 279 tests across evalNormalizer, evalFormatter, yamlSpecTranslator, and agentEvalRunner

Test plan

  • yarn compile passes in agents repo
  • yarn test passes in agents repo (all new test files: evalNormalizer, evalFormatter, yamlSpecTranslator, agentEvalRunner)
  • No regressions in existing agents tests
  • After merging and bumping version, companion PR in plugin-agent resolves correctly

🤖 Generated with Claude Code

…nd runner into library

Extracts evalNormalizer, evalFormatter, yamlSpecTranslator, and the new
agentEvalRunner module from plugin-agent into the @salesforce/agents library
so any consumer can use them directly without depending on the CLI plugin.
All four modules are exported from the package index.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
andresrivas-sf and others added 2 commits May 5, 2026 14:12
- Export EvalOutput, EvalResult, TestError, TestResult from evalFormatter so
  callers get proper types without casting
- Rewrite buildResultSummary using the exported types, eliminating all
  Record<string,unknown> casts
- Type AgentEvalRunResult.tests[].evaluations and .outputs as EvalResult[]/EvalOutput[]
- Improve resolveAgent error messages to include actionable suggestions
- Fix evalCounter to only increment when an id is auto-generated
- Replace as-any stub cast with as-unknown StreamPromise in tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant