Docs Index
ai accuracy benchmark.md

AI Accuracy Benchmark — Latest Run

Run mode: live
Headline provider: openai (gpt-5.4-mini)
Generated: 2026-06-12T05:24:57.355Z

Phase B scope (+ A/C follow-ups)

Provider x pair matrix

Provider Model Pair Mappings Top-1 accuracy 95% CI (Wilson) Hallucinations Cost (USD)
openai gpt-5.4-mini sfdc-to-ns-customers 61 95.1% [86.5%, 98.3%] 0 $0.0399
openai gpt-5.4-mini sfdc-to-bc-customers 11 100.0% [74.1%, 100.0%] 0 $0.0029
anthropic claude-haiku-4-5 sfdc-to-ns-customers 61 96.7% [88.8%, 99.1%] 0 $0.0662
anthropic claude-haiku-4-5 sfdc-to-bc-customers 11 100.0% [74.1%, 100.0%] 0 $0.0052

Total estimated cost across runs: $0.1142 (cap $5.00 for the whole invocation).

Headline run (canonical cell: openai x sfdc-to-ns-customers)

The top-level JSON fields (and the README ai_accuracy metric) mirror this cell; the matrix table above carries the rest.

Field Value
Run mode live
Provider openai
Model gpt-5.4-mini
Fixture scripts/golden/fixtures/sfdc-to-ns-customers.yaml
Target system NetSuite
Test cases 22
Total labeled mappings 61
Top-1 accuracy 95.1%
95% CI (Wilson) [86.5%, 98.3%]
Hallucination count 0
Manual edit rate 4.9%
Estimated cost (USD) $0.0399
Cost cap (USD) $5.00

Data-leakage guard

Every fixture is REQUIRED to exclude every (sourceField, targetField) pair that appears in src/services/ai/prompts/FieldMappingPrompts.ts COMMON_MAPPING_EXAMPLES. The few-shot examples ship in production prompts, so allowing them in the benchmark would let the model "cheat" against patterns it was just taught. The prompt may include broad target schema context, but it is REQUIRED to include substantial distractors and not embed only the fixture target answer-set as an allowed vocabulary. Per-pair posture:

Both exclusions and the per-pair posture are enforced by tests/unit/scripts/run-ai-accuracy-benchmark.dataLeakage.test.ts.

Runbook (operator)

# Rehearsal -- deterministic mock provider, $0 cost. Used by CI / drift tests.
npm run benchmark:ai -- --dry-run --matrix

# The script does NOT load .env -- export the keys into the shell first:
set -a; source .env; set +a

# Live full matrix -- requires BOTH OPENAI_API_KEY and ANTHROPIC_API_KEY.
# MAX_BENCHMARK_COST_USD caps the budget for the WHOLE invocation (default $5).
# Runner refuses to start if the pessimistic worst-case estimate summed over all
# cells exceeds the cap AND aborts mid-run on the iteration whose actual
# cumulative spend (across cells) would cross it.
MAX_BENCHMARK_COST_USD=5 npm run benchmark:ai -- --matrix

# Opt-in $0 providers (never part of the default matrix or the canonical headline):
#   openrouter -> pinned :free model, requires OPENROUTER_API_KEY
#   lmstudio   -> local server; model discovered from <base>/v1/models; base URL from
#                 LMSTUDIO_BASE_URL (unset under WSL resolves the Windows-host gateway)
npm run benchmark:ai -- --matrix --include-provider openrouter --include-provider lmstudio

# Single-cell variants (incompatible with --matrix):
npm run benchmark:ai                                                              # openai x SFDC->NS
npm run benchmark:ai -- --provider anthropic                                      # claude-haiku-4-5
npm run benchmark:ai -- --provider lmstudio                                       # local, $0
npm run benchmark:ai -- --fixture scripts/golden/fixtures/sfdc-to-bc-customers.yaml  # SFDC->BC

# After a live run, re-stamp the README templated value:
npm run metrics:generate && npm run metrics:sync-tokens
git add docs/review/ai-accuracy-benchmark.json docs/review/ai-accuracy-benchmark.md metrics.json README.md

Known limitations