From e0c57f1822fd86b0d2c89efa053bd76c78d9f98a Mon Sep 17 00:00:00 2001 From: Joe Lepper Date: Mon, 26 Oct 2026 16:40:03 -0700 Subject: [PATCH] feat(scoring): export the deep-eval and category-score functions from the package root runDeepEval, computeHeuristicSpeed, parseCategoryEvalResponse, computeCategoryScore, aggregateDimension and parseJsonFromText, with the DeepEvalOptions and CalibrationParams types, are now exported from the package root. The change is additive: no behavior change, no rename, and no exports map, so existing deep imports keep working. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 ++ src/index.ts | 5 +++++ test/unit/scoring/root-exports.test.ts | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 test/unit/scoring/root-exports.test.ts diff --git a/README.md b/README.md index 6e8c8f6..ae59e40 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ Use the programmatic API when you want to integrate AXIS into an existing test r `run({ profile })` and `loadConfig(path, { profile })` select a named profile from the config, the same overlay `axis run --profile` applies. `loadConfig` returns the resolved `config` alongside the pre-merge `baseConfig`, for callers that need the suite layout as a whole rather than the active suite. +For per-category scoring without the full `scoreRunResult` pipeline, import `runDeepEval`, `computeCategoryScore` and `aggregateDimension` from `@netlify/axis`. Select your judge adapter, registered with `registerAdapter`, through `runDeepEval`’s `options.judging`. It makes one judge call per category with interactions; setting that category’s `options.weights` value to `0` skips the call. Skipped categories use AXIS’s defaults. Use `computeCategoryScore` for a category score or `aggregateDimension` for a single audit dimension. The package root also exports `computeHeuristicSpeed`, `parseCategoryEvalResponse`, `parseJsonFromText`, and the types `DeepEvalOptions` and `CalibrationParams`. These exports add no scoring behavior changes; existing deep imports keep working. + ## Roadmap Delivered: scenario runner, four-dimension scoring pipeline, baselines with regression detection, repeated runs with representative-run selection and noise-aware regression bands, MCP/skills wiring, custom adapter API, config profiles for running one repo's scenarios under several agent matrices, built-in adapters for Claude Code, Codex, and Gemini. diff --git a/src/index.ts b/src/index.ts index cfb25d5..0004c9a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,6 +22,11 @@ export type { AcpAdapterSpec } from "./adapters/base/acp-adapter.js"; export { scoreResults, scoreRunResult, buildScoredOutput } from "./scoring/index.js"; export { ScoringError } from "./scoring/errors.js"; export { buildSparseIndex } from "./scoring/sparse-index.js"; +export { runDeepEval, computeHeuristicSpeed, parseCategoryEvalResponse } from "./scoring/deep-eval.js"; +export type { DeepEvalOptions } from "./scoring/deep-eval.js"; +export { computeCategoryScore, aggregateDimension } from "./scoring/category-score.js"; +export type { CalibrationParams } from "./scoring/category-score.js"; +export { parseJsonFromText } from "./scoring/parse-json.js"; export { getPromptTemplates, interpolate } from "./scoring/prompt-templates.js"; export type { PromptTemplate, PromptVariable } from "./scoring/prompt-templates.js"; export { categorizeInteraction } from "./transcript/categorize.js"; diff --git a/test/unit/scoring/root-exports.test.ts b/test/unit/scoring/root-exports.test.ts new file mode 100644 index 0000000..826606c --- /dev/null +++ b/test/unit/scoring/root-exports.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "vitest"; +import * as axis from "../../../src/index.js"; +import { runDeepEval, computeHeuristicSpeed, parseCategoryEvalResponse } from "../../../src/scoring/deep-eval.js"; +import { computeCategoryScore, aggregateDimension } from "../../../src/scoring/category-score.js"; +import { parseJsonFromText } from "../../../src/scoring/parse-json.js"; + +describe("package root exports", () => { + it("re-exports the scoring internals that programmatic consumers import", () => { + const expected = { + runDeepEval, + computeHeuristicSpeed, + parseCategoryEvalResponse, + computeCategoryScore, + aggregateDimension, + parseJsonFromText, + }; + for (const [name, fn] of Object.entries(expected)) { + expect(axis[name as keyof typeof axis], name).toBe(fn); + } + }); +});