Skip to content

AI evaluation and golden-set harness

Duckbill™ gates material prompt, model, and taxonomy changes with a checked-in golden set. This is Stream B of Sprint 05 (MAIL-36, MAIL-57, MAIL-114). See ADR 0020.

Rules

Code

ModuleRole
packages/ai/src/eval-port.tsTyped classify/extract port and schema validation
packages/ai/src/fixture-classifier.tsDeterministic double for the harness
packages/application/src/ai-eval.tsRegression runner and report
tests/ai/golden/corpus.jsonChecked-in golden corpus
scripts/run-ai-eval.tsCLI used by npm run ai:eval

Metrics

The report includes schema validity, critical-field regressions (intent, attention, priority, deadlines, action items), high-impact false positives (newsletter/receipt/notification marked urgent or actionable; injection followed or secrets echoed), latency, and cost. The fixture classifier reports zero tokens and zero cost.

Running

npm test -- tests/ai/golden-set.test.ts
npm run ai:eval

The CLI prints a JSON report and exits non-zero on unexplained critical regression.

Classify, extract, persist, drafts, and security policy stay on their own issues.