refactor(models): Phase 3 — retire old hand tables and shrink manifest apparatus (#4589)

## Summary

Retires the old hand-table authorities and transitional verification
scaffolding from the model-capability manifest arc. All production
routes now run exclusively through the generated interpreters introduced
in Phase 1 ([#3821](https://github.com/block/buzz/pull/3821)) and wired
in Phase 2 ([#3958](https://github.com/block/buzz/pull/3958)).

Stack: [#3821](https://github.com/block/buzz/pull/3821) →
[#3958](https://github.com/block/buzz/pull/3958) → this PR
Base: [#3603](https://github.com/block/buzz/pull/3603)

## What the manifest system is now

**Source of truth:** `scripts/model-capabilities.json`
**Generator:** `scripts/generate-model-capabilities.mjs` — emits Rust
and TS interpreters only (coverage JSON output removed)
**Generated interpreters:**
`crates/buzz-agent/src/generated_model_capabilities.rs` (+ normative
tests), `desktop/src/features/agents/ui/modelCapabilities.ts`
**Label registry:** `generate-databricks-model-names.py` →
`databricks_model_names.rs` / `databricksModelNames.ts`
**Permanent gates:** `scripts/normative-corpus.json` +
`scripts/run-corpus.mjs` (both-interpreter equivalence, 51 vectors),
`scripts/test-manifest-validator.mjs` (schema, 24 cases), regen-diff job
inside `ci.yml`
**One doc:** `scripts/MODEL_CAPABILITIES.md`

## Deleted

**Old hand-table authorities (production):**
- `getProviderEffortConfig_oldHandTable()` and all supporting helpers
from `desktop/src/features/agents/ui/buzzAgentConfig.ts`
- `normalize_effort_for_openai_route()`,
`_old_anthropic_thinking_config_for_databricks_v2()`, test-only
re-export wrappers from `crates/buzz-agent/src/config.rs`
- `strip_catalog_prefix()`, `anthropic_thinking_config()`,
`anthropic_model_supports_xhigh()`, `clamp_adaptive_effort()`,
`anthropic_efforts_for_model()`, `is_manual_budget_model()`,
`is_adaptive_thinking_model()`, `gpt5_token_matches()`,
`gpt5_base_matches()`, `openai_efforts_for_model()` from
`crates/buzz-agent/src/config.rs` — all superseded by generated
interpreter
- Old DBv2 body-level tests, `_OLD_DATABRICKS_V2_*` constants,
`model_name_segments()`, `_old_databricks_v2_route_for_model()`, all
Phase-2 behavioral differential test functions from
`crates/buzz-agent/src/llm.rs`

**Transitional scaffolding:**
- `scripts/run-differential.mjs` — old-vs-new JS differential harness
- `scripts/run-mutation-evidence.mjs` — one-time mutation evidence
runner
- `desktop/src/features/agents/ui/effortTable.fixture.json` — Phase-2
TS/Rust sync fixture
- `desktop/src/features/agents/ui/effortTable.fixture.test.mjs` —
fixture sync guard
- `.github/workflows/model-capability-regen-diff.yml` — standalone
workflow (steps folded into `ci.yml`)

**One-time evidence and generated snapshots:**
- `scripts/MUTATION_EVIDENCE.md`,
`scripts/MODEL_CAPABILITIES_SCHEMA.md`,
`scripts/MODELS_DEV_RECONCILIATION.md` — consolidated into
`scripts/MODEL_CAPABILITIES.md`
- `scripts/generated-model-capabilities-coverage.json` — full-table
snapshot (generator no longer emits it)
- `scripts/catalog-sample-fixture.json` — models.dev snapshot used only
by the deleted differential harness

## Verification

- `cargo test -p buzz-agent --lib` with `RUSTFLAGS="-D warnings"`:
**337/337** (clean — no dead_code warnings)
- `node --experimental-strip-types scripts/run-corpus.mjs`: **51/51**
- `node scripts/generate-model-capabilities.mjs` + regen diff: **clean
(exit 0)**
- `node --test scripts/test-manifest-validator.mjs`: **24/24**
- `just clippy`: zero warnings, zero errors

---------

Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
This commit is contained in:
Will Pfleger
2026-08-03 17:04:38 -04:00
committed by GitHub
parent ad9ae1dbb0
commit 899f55cc8d
17 changed files with 276 additions and 7185 deletions

View File

@@ -1,10 +1,8 @@
/**
* Source-of-truth constants for buzz-agent model-tuning configuration knobs.
*
* Phase 2b pass 2: getProviderEffortConfig() is now generated-backed (thin
* wrapper over resolveModelCapabilities()). The legacy hand-table implementation
* is preserved as getProviderEffortConfig_oldHandTable() for the differential
* harness only — nothing user-facing imports the _old shim. Phase 3 retires it.
* `getProviderEffortConfig()` is generated-backed (thin wrapper over
* `resolveModelCapabilities()`).
*/
import { canonicalizeProvider } from "../lib/formatAgentModelLabel.ts";
import { resolveModelCapabilities } from "./modelCapabilities.ts";
@@ -50,10 +48,6 @@ export type ThinkingEffortValue =
* thinking configuration entirely (i.e. "Inherit" is the natural default).
* This applies to Anthropic manual-budget models where the effort level maps
* to a budget_tokens count — there is no "default effort level" in the API.
*
* Mirrors the model-family tables in `crates/buzz-agent/src/config.rs`
* (`openai_efforts_for_model`, `is_manual_budget_model`,
* `is_adaptive_thinking_model`, `clamp_adaptive_effort`). Keep in sync.
*/
export type ProviderEffortConfig = {
validValues: ReadonlyArray<ThinkingEffortValue>;
@@ -61,8 +55,6 @@ export type ProviderEffortConfig = {
defaultValue: ThinkingEffortValue | null;
};
const ALL_VALUES = BUZZ_AGENT_THINKING_EFFORT_VALUES;
/**
* Returns the valid thinking-effort values and semantic default for the
* given provider and optional model string, resolved from the generated
@@ -91,237 +83,6 @@ export function getProviderEffortConfig(
};
}
/**
* Legacy hand-table implementation — differential harness shim only.
*
* Preserved for the run-differential.mjs old-vs-new comparison until Phase 3
* retires it. Nothing user-facing should import this name.
*
* @deprecated Use getProviderEffortConfig() (generated-backed) instead.
*/
export function getProviderEffortConfig_oldHandTable(
providerId: string,
model?: string,
): ProviderEffortConfig {
const provider = providerId.toLowerCase();
// Strip arbitrary endpoint-naming prefix before model-family matching.
// Find the first occurrence of a known family token and drop everything before it.
// e.g. "goose-claude-fable-5" → "claude-fable-5"
// "team-x-gpt-5.5" → "gpt-5.5"
// "databricks-claude-3" → "claude-3"
// "claude-opus-4-7" → "claude-opus-4-7" (no prefix to strip)
const rawModel = (model ?? "").trim().toLowerCase();
const FAMILY_TOKENS = ["claude-", "gpt-"] as const;
const firstFamilyIdx = Math.min(
...FAMILY_TOKENS.map((tok) => {
const idx = rawModel.indexOf(tok);
return idx === -1 ? Infinity : idx;
}),
);
const m =
firstFamilyIdx === Infinity ? rawModel : rawModel.slice(firstFamilyIdx);
if (provider === "anthropic") {
return anthropicConfig(m);
}
if (provider === "openai") {
return openaiConfig(m);
}
if (provider === "databricks_v2") {
// Route by model family: claude* → Anthropic tables, gpt-5* → OpenAI tables.
// Non-Claude concrete models (e.g. llama-3) go through MlflowChatCompletions,
// which applies normalize_effort_for_openai_route → clamps max to xhigh.
// Route them through openaiConfig to exclude max. Only blank/unknown model
// uses the all-7 fallback (can't know the route without a concrete model).
if (m.startsWith("claude-")) {
return anthropicConfig(m);
}
if (gpt5FamilyModel(m)) {
return openaiConfig(m);
}
if (m.length > 0) {
// Concrete non-Claude, non-GPT model → MLflow path clamps max → xhigh.
return openaiConfig(m);
}
// Blank model — route unknown, show all 7.
return { validValues: ALL_VALUES, defaultValue: "medium" };
}
if (provider === "databricks") {
// databricks v1 uses OpenAI Chat Completions wire format.
return openaiConfig(m);
}
if (provider === "openrouter") {
return { validValues: ALL_VALUES, defaultValue: "medium" };
}
// openai-compat, unknown, empty — all values, default medium.
return { validValues: ALL_VALUES, defaultValue: "medium" };
}
// ---------------------------------------------------------------------------
// Anthropic family tables
// ---------------------------------------------------------------------------
function anthropicConfig(m: string): ProviderEffortConfig {
// Manual-budget models: claude-3* and claude-opus-4-5.
// These use budget_tokens — there is no "default effort level" in the API.
if (m.startsWith("claude-3") || m === "claude-opus-4-5") {
return {
validValues: ["low", "medium", "high"],
defaultValue: null,
};
}
// Adaptive models that support xhigh: opus-4-7+, sonnet-5.x, fable-5, mythos-5.
// mirrors clamp_adaptive_effort supports_xhigh check.
if (
m.startsWith("claude-opus-4-7") ||
m.startsWith("claude-opus-4-8") ||
m.startsWith("claude-sonnet-5") ||
m.startsWith("claude-fable-5") ||
m.startsWith("claude-mythos-5")
) {
return {
validValues: ["low", "medium", "high", "xhigh", "max"],
defaultValue: "high",
};
}
// Adaptive models that do NOT support xhigh: opus-4-6, sonnet-4-6, mythos-preview.
if (
m.startsWith("claude-opus-4-6") ||
m.startsWith("claude-sonnet-4-6") ||
m.startsWith("claude-mythos-preview")
) {
return {
validValues: ["low", "medium", "high", "max"],
defaultValue: "high",
};
}
// Unknown Anthropic model — assume adaptive with full support.
return {
validValues: ["low", "medium", "high", "xhigh", "max"],
defaultValue: "high",
};
}
// ---------------------------------------------------------------------------
// OpenAI family tables — mirrors openai_efforts_for_model in config.rs
// ---------------------------------------------------------------------------
/**
* Returns true if `m` contains a GPT-5 family token at a word boundary
* (not immediately followed by a digit or letter). Mirrors
* `gpt5_token_matches` / `gpt5_base_matches` in config.rs.
*/
function gpt5TokenMatches(m: string, token: string): boolean {
let start = 0;
while (true) {
const idx = m.indexOf(token, start);
if (idx === -1) return false;
const afterIdx = idx + token.length;
const afterChar = afterIdx < m.length ? m[afterIdx] : "";
// Boundary: end-of-string or a `-` separator (not a digit or letter).
if (afterChar === "" || afterChar === "-") return true;
start = afterIdx;
}
}
/** Like gpt5TokenMatches but also rejects short -<1-3 digit> suffixes (e.g. -5, -10). */
function gpt5BaseMatches(m: string, token: string): boolean {
let start = 0;
while (true) {
const idx = m.indexOf(token, start);
if (idx === -1) return false;
const afterIdx = idx + token.length;
const suffix = m.slice(afterIdx);
if (suffix === "") return true;
if (!suffix.startsWith("-")) {
start = afterIdx;
continue;
}
// Has a `-` suffix — check if it looks like a 1-3 digit version number.
const dashRest = suffix.slice(1);
if (/^\d{1,3}(?:[^a-z\d]|$)/i.test(dashRest)) {
start = afterIdx;
continue;
}
return true;
}
}
/** Returns true if the model string belongs to any GPT-5 family. */
function gpt5FamilyModel(m: string): boolean {
return (
gpt5TokenMatches(m, "gpt-5-pro") ||
gpt5TokenMatches(m, "gpt5-pro") ||
gpt5TokenMatches(m, "gpt-5.6") ||
gpt5TokenMatches(m, "gpt5.6") ||
gpt5TokenMatches(m, "gpt-5-6") ||
gpt5TokenMatches(m, "gpt5-6") ||
gpt5TokenMatches(m, "gpt-5.5") ||
gpt5TokenMatches(m, "gpt5.5") ||
gpt5TokenMatches(m, "gpt-5.4") ||
gpt5TokenMatches(m, "gpt5.4") ||
gpt5TokenMatches(m, "gpt-5.1") ||
gpt5TokenMatches(m, "gpt5.1") ||
gpt5BaseMatches(m, "gpt-5") ||
gpt5BaseMatches(m, "gpt5")
);
}
function openaiConfig(m: string): ProviderEffortConfig {
// Check -pro before versioned suffixes (gpt-5-pro contains "gpt-5").
if (gpt5TokenMatches(m, "gpt-5-pro") || gpt5TokenMatches(m, "gpt5-pro")) {
return { validValues: ["high"], defaultValue: "high" };
}
if (
gpt5TokenMatches(m, "gpt-5.6") ||
gpt5TokenMatches(m, "gpt5.6") ||
gpt5TokenMatches(m, "gpt-5-6") ||
gpt5TokenMatches(m, "gpt5-6")
) {
return {
validValues: ["none", "low", "medium", "high", "xhigh", "max"],
defaultValue: "medium",
};
}
if (
gpt5TokenMatches(m, "gpt-5.5") ||
gpt5TokenMatches(m, "gpt5.5") ||
gpt5TokenMatches(m, "gpt-5-5") ||
gpt5TokenMatches(m, "gpt5-5") ||
gpt5TokenMatches(m, "gpt-5.4") ||
gpt5TokenMatches(m, "gpt5.4") ||
gpt5TokenMatches(m, "gpt-5-4") ||
gpt5TokenMatches(m, "gpt5-4")
) {
return {
validValues: ["none", "low", "medium", "high", "xhigh"],
defaultValue: "medium",
};
}
if (
gpt5TokenMatches(m, "gpt-5.1") ||
gpt5TokenMatches(m, "gpt5.1") ||
gpt5TokenMatches(m, "gpt-5-1") ||
gpt5TokenMatches(m, "gpt5-1")
) {
return {
validValues: ["none", "low", "medium", "high"],
defaultValue: "none",
};
}
if (gpt5BaseMatches(m, "gpt-5") || gpt5BaseMatches(m, "gpt5")) {
return {
validValues: ["minimal", "low", "medium", "high"],
defaultValue: "medium",
};
}
// Unknown OpenAI model — conservative fallback; max is enabled only for families whose table includes it.
return {
validValues: ["none", "minimal", "low", "medium", "high", "xhigh"],
defaultValue: "medium",
};
}
/**
* Returns true when the given runtime id is buzz-agent, which is the only
* runtime that supports the tier-1 model-tuning knobs above.
@@ -329,7 +90,3 @@ function openaiConfig(m: string): ProviderEffortConfig {
export function isBuzzAgentRuntime(runtimeId: string): boolean {
return runtimeId === "buzz-agent";
}
// ---------------------------------------------------------------------------
// Differential harness support
// ---------------------------------------------------------------------------

View File

@@ -1,261 +0,0 @@
[
{
"note": "Anthropic manual-budget: claude-3 family",
"provider": "anthropic",
"model": "claude-3-7-sonnet-20250219",
"validValues": ["low", "medium", "high"],
"defaultValue": null
},
{
"note": "Anthropic manual-budget: claude-opus-4-5",
"provider": "anthropic",
"model": "claude-opus-4-5",
"validValues": ["low", "medium", "high"],
"defaultValue": null
},
{
"note": "Anthropic adaptive xhigh-capable: claude-opus-4-7",
"provider": "anthropic",
"model": "claude-opus-4-7",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive xhigh-capable: claude-opus-4-8",
"provider": "anthropic",
"model": "claude-opus-4-8",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive xhigh-capable: claude-sonnet-5",
"provider": "anthropic",
"model": "claude-sonnet-5-20260101",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive xhigh-capable: claude-fable-5",
"provider": "anthropic",
"model": "claude-fable-5",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive xhigh-capable: claude-opus-5",
"provider": "anthropic",
"model": "claude-opus-5",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive xhigh-capable: claude-mythos-5",
"provider": "anthropic",
"model": "claude-mythos-5",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive no-xhigh: claude-opus-4-6",
"provider": "anthropic",
"model": "claude-opus-4-6",
"validValues": ["low", "medium", "high", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive no-xhigh: claude-sonnet-4-6",
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"validValues": ["low", "medium", "high", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic adaptive no-xhigh: claude-mythos-preview",
"provider": "anthropic",
"model": "claude-mythos-preview",
"validValues": ["low", "medium", "high", "max"],
"defaultValue": "high"
},
{
"note": "Anthropic unknown model: blank \u2014 assume full adaptive",
"provider": "anthropic",
"model": "",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "OpenAI gpt-5-pro: high only",
"provider": "openai",
"model": "gpt-5-pro",
"validValues": ["high"],
"defaultValue": "high"
},
{
"note": "OpenAI gpt-5.6: none/low/medium/high/xhigh/max",
"provider": "openai",
"model": "gpt-5.6",
"validValues": ["none", "low", "medium", "high", "xhigh", "max"],
"defaultValue": "medium"
},
{
"note": "OpenAI gpt-5.5: none/low/medium/high/xhigh",
"provider": "openai",
"model": "gpt-5.5",
"validValues": ["none", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "OpenAI gpt-5.4: same table as gpt-5.5",
"provider": "openai",
"model": "gpt-5.4",
"validValues": ["none", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "OpenAI gpt-5.1: none/low/medium/high",
"provider": "openai",
"model": "gpt-5.1",
"validValues": ["none", "low", "medium", "high"],
"defaultValue": "none"
},
{
"note": "OpenAI gpt-5 base: minimal/low/medium/high",
"provider": "openai",
"model": "gpt-5",
"validValues": ["minimal", "low", "medium", "high"],
"defaultValue": "medium"
},
{
"note": "OpenAI unknown model (gpt-4o): all-except-max",
"provider": "openai",
"model": "gpt-4o",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "OpenAI empty model: all-except-max",
"provider": "openai",
"model": "",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "DatabricksV2 claude route (claude-opus-4-7): xhigh-capable anthropic table",
"provider": "databricks_v2",
"model": "claude-opus-4-7",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "DatabricksV2 claude route with databricks- prefix stripped",
"provider": "databricks_v2",
"model": "databricks-claude-opus-4-7",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "DatabricksV2 gpt-5.6-sol route: OpenAI max-capable table",
"provider": "databricks_v2",
"model": "gpt-5.6-sol",
"validValues": ["none", "low", "medium", "high", "xhigh", "max"],
"defaultValue": "medium"
},
{
"note": "DatabricksV2 gpt-5-6-sol route: dashed OpenAI max-capable table",
"provider": "databricks_v2",
"model": "gpt-5-6-sol",
"validValues": ["none", "low", "medium", "high", "xhigh", "max"],
"defaultValue": "medium"
},
{
"note": "DatabricksV2 gpt-5.4 route: OpenAI gpt-5.5/5.4 table",
"provider": "databricks_v2",
"model": "gpt-5.4",
"validValues": ["none", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "DatabricksV2 gpt-5.1 with databricks- prefix: OpenAI gpt-5.1 table",
"provider": "databricks_v2",
"model": "databricks-gpt-5.1",
"validValues": ["none", "low", "medium", "high"],
"defaultValue": "none"
},
{
"note": "DatabricksV2 concrete non-claude non-gpt5 (llama-3): MLflow path, all-except-max",
"provider": "databricks_v2",
"model": "llama-3",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "DatabricksV2 blank model: route unknown, all-7",
"provider": "databricks_v2",
"model": "",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
"defaultValue": "medium"
},
{
"note": "databricks v1: routes like openai unknown, all-except-max",
"provider": "databricks",
"model": "",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "openai-compat: canonicalizes to openai, empty model → all-except-max with medium default",
"provider": "openai-compat",
"model": "",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "openai-compat/gpt-5-pro: canonicalizes to openai, gpt-5-pro → [high] only",
"provider": "openai-compat",
"model": "gpt-5-pro",
"validValues": ["high"],
"defaultValue": "high"
},
{
"note": "openrouter: all-7 with medium default",
"provider": "openrouter",
"model": "",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
"defaultValue": "medium"
},
{
"note": "empty provider: all-7 with medium default",
"provider": "",
"model": "",
"validValues": ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
"defaultValue": "medium"
},
{
"note": "databricks_v2 goose-claude-fable-5: strips goose- prefix, routes anthropic adaptive+xhigh, max valid",
"provider": "databricks_v2",
"model": "goose-claude-fable-5",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "databricks_v2 goose-gpt-5.5: strips goose- prefix, routes openai gpt-5.5 table (none+low-xhigh, no minimal)",
"provider": "databricks_v2",
"model": "goose-gpt-5.5",
"validValues": ["none", "low", "medium", "high", "xhigh"],
"defaultValue": "medium"
},
{
"note": "databricks_v2 goose-claude-sonnet-5: strips goose- prefix, routes anthropic adaptive+xhigh",
"provider": "databricks_v2",
"model": "goose-claude-sonnet-5",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
},
{
"note": "databricks_v2 arbitrary prefix team-x-claude-opus-4-7: strips to claude-opus-4-7, routes anthropic adaptive+xhigh, max valid",
"provider": "databricks_v2",
"model": "team-x-claude-opus-4-7",
"validValues": ["low", "medium", "high", "xhigh", "max"],
"defaultValue": "high"
}
]

View File

@@ -1,52 +0,0 @@
/**
* Effort-table sync guard: TS side.
*
* Loads the checked-in fixture and asserts that `getProviderEffortConfig`
* matches every entry. Drift between `buzzAgentConfig.ts` and the fixture
* (e.g. a new model family added to one side but not the other) fails CI.
* The companion Rust test in `crates/buzz-agent/src/config.rs` mirrors
* this check so both sides of the mirror must stay in sync.
*/
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { fileURLToPath } from "node:url";
import path from "node:path";
import { getProviderEffortConfig } from "./buzzAgentConfig.ts";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const fixture = JSON.parse(
readFileSync(path.join(__dirname, "effortTable.fixture.json"), "utf8"),
);
for (const entry of fixture) {
const {
note,
provider,
model,
validValues: expectedValidValues,
defaultValue: expectedDefault,
} = entry;
const label = note ?? `${provider}/${model}`;
test(`effort fixture: ${label}`, () => {
const { validValues, defaultValue } = getProviderEffortConfig(
provider,
model,
);
assert.deepEqual(
[...validValues],
expectedValidValues,
`validValues mismatch for "${label}"`,
);
assert.equal(
defaultValue,
expectedDefault,
`defaultValue mismatch for "${label}"`,
);
});
}