evaluators icon indicating copy to clipboard operation
evaluators copied to clipboard

feat(ts-sdk): Math Standards Alignment Evaluator

Open adnanrhussain opened this issue 6 months ago • 1 comments

Summary

Adds MathStandardsAlignmentEvaluator to the TypeScript SDK — evaluates whether assessment questions align to CCSS math standards by checking alignment at the learning-component level via the Learning Commons Knowledge Graph API.

Depends on PR #97 (ahussain/kg-client) which must merge first.

Three evaluation methods

Method Use case
evaluate(question, grade, statementCode) Single question × single standard (primitive)
evaluateQuestionBank(questions[], statementCodes[]) True M×N cross-product — coverage / gap analysis
evaluateByGrade(questions[], grade) Wraps question bank, fetches all CCSS math standards for a grade from KG

Key design decisions

  • Batched LLM calls: all learning components for a standard evaluated in a single structured-output call — O(M×N) not O(M×N×LC)
  • useCoarseFilter (default false): opt-in pre-filter that sends standard descriptions to a fast LLM call to skip clearly irrelevant pairs before full LC evaluation
  • grade is explicit on every call — validated as a supported grade level (K–12). High school standards (HSA, HSF, HSG, etc.) are evaluated with grade '9'/'10'/'11'/'12' since that is how the KG API indexes them.
  • Model, temperature, supported grades, and max question length all read from config.json / input_schema.json
  • platformApiKey doubles as partnerKey for telemetry when not set separately

Test plan

  • [x] 244 unit tests pass (npm test -- --run tests/unit)
  • [x] npx tsc --noEmit — 0 errors
  • [x] npm run lint — 0 errors
  • [x] Integration test validates alignment for full 3.MD.C.7 standard family with 0 coarse filter false negatives
  • [ ] Run integration: RUN_INTEGRATION_TESTS=true OPENAI_API_KEY=<key> PLATFORM_API_KEY=<key> npm test -- --run tests/integration/math-standards-alignment.integration.test.ts

🤖 Generated with Claude Code

adnanrhussain avatar Jun 03 '26 23:06 adnanrhussain

Codecov Report

:x: Patch coverage is 93.77990% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...escript/src/evaluators/math/standards-alignment.ts 92.97% 13 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Jun 03 '26 23:06 codecov[bot]