Skip to content

feat: add TypeScript SDK demo app scaffold and Math Standards Alignment evaluator#132

Open
adnanrhussain wants to merge 6 commits into
mainfrom
worktree-ahussain+ts_sdk_demo_app
Open

feat: add TypeScript SDK demo app scaffold and Math Standards Alignment evaluator#132
adnanrhussain wants to merge 6 commits into
mainfrom
worktree-ahussain+ts_sdk_demo_app

Conversation

@adnanrhussain

Copy link
Copy Markdown
Contributor

What

A minimal web app under demos/typescript/ demonstrating the published @learning-commons/evaluators SDK, covering the Math Standards Alignment evaluator end-to-end.

Flow: pick a grade (K–12) and jurisdiction → searchable multi-select of that grade/jurisdiction's math standards → enter a word problem → Evaluate → view the raw alignment JSON.

Design

  • Stack: React (Vite) frontend + small Express backend. The SDK is Node-only (top-level node:* imports on the eval path), so all SDK calls run server-side; the browser never sees the API keys.
  • Three endpoints: GET /api/jurisdictions (from the SDK's Jurisdiction enum), GET /api/standards (Knowledge Graph lookup), POST /api/evaluate (MathStandardsAlignmentEvaluator.evaluateItems).
  • Spec-driven artifacts included: spec.md, plan.md, tasks.md.

Notes / SDK gaps surfaced

  • No public standards-listing helper. The published SDK doesn't export KnowledgeGraphClient, so server/kg.ts calls the KG REST API directly to populate the standards picker. A future SDK release should export a getStandardsByGrade-style helper.
  • Peer-dependency range too loose. The SDK declares ai >=6.0.0, but it's actually built against ai@7 (@ai-sdk/provider spec v4). Installing ai@6 + @ai-sdk/anthropic@4 yields a runtime "Unsupported model version" error. The demo pins ai@^7; the SDK's peer should be tightened to ai >=7.

Verification

  • tsc --noEmit clean; vite build clean.
  • Standards lookup verified live against the KG; evaluate path verified through the model layer.
  • Includes fixes from a self code-review (standards-fetch race guard, KG pagination guard, non-JSON response handling, missing-UUID guard).

Draft pending a final real-key end-to-end evaluation run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a minimal TypeScript demo app under demos/typescript/ that exercises the published @learning-commons/evaluators SDK end-to-end for the Math Standards Alignment evaluator, using a Vite/React frontend and an Express backend to keep API keys server-side.

Changes:

  • Introduces a Vite + React UI for selecting grade/jurisdiction/standards, entering a word problem, and viewing raw evaluator JSON output.
  • Adds an Express API server with endpoints for jurisdictions, standards lookup (via Knowledge Graph REST), and evaluation via MathStandardsAlignmentEvaluator.
  • Includes spec/plan/tasks docs and a README for setup and local running.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
demos/typescript/vite.config.ts Adds Vite dev-server proxy for /api to the Express backend.
demos/typescript/tsconfig.json Adds demo-local TypeScript config for client + server code.
demos/typescript/tasks.md Tracks implementation tasks and verification notes for the demo.
demos/typescript/src/main.tsx React entrypoint mounting the demo app.
demos/typescript/src/App.tsx Main UI and client-side API calls for the demo flow.
demos/typescript/src/App.css Minimal styling for the demo UI.
demos/typescript/spec.md Defines the demo requirements and API behavior.
demos/typescript/server/kg.ts Implements Knowledge Graph REST helpers for listing standards.
demos/typescript/server/index.ts Implements Express endpoints and evaluator invocation.
demos/typescript/README.md Documents setup, required keys, and how to run locally.
demos/typescript/plan.md Documents demo structure and key design decisions.
demos/typescript/package.json Adds demo package manifest and scripts (dev/typecheck).
demos/typescript/package-lock.json Locks demo dependencies for reproducible installs.
demos/typescript/index.html Vite HTML shell for the React app.
demos/typescript/.gitignore Ignores build output, deps, and .env for the demo.
demos/typescript/.env.example Documents required environment variables for the backend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread demos/typescript/server/index.ts Outdated
Comment thread demos/typescript/server/kg.ts
Comment thread demos/typescript/src/App.tsx Outdated
Comment thread demos/typescript/server/index.ts Outdated
@adnanrhussain adnanrhussain changed the title Add TypeScript SDK demo app (Math Standards Alignment) feat: add TypeScript SDK demo app for Math Standards Alignment Jul 16, 2026
@adnanrhussain
adnanrhussain requested a review from Copilot July 16, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.

Comment thread demos/typescript/src/api.ts
Comment thread demos/typescript/server/math-standards-alignment.ts
@adnanrhussain
adnanrhussain force-pushed the worktree-ahussain+ts_sdk_demo_app branch from 304e3de to cdbd4c6 Compare July 16, 2026 19:46
@adnanrhussain
adnanrhussain marked this pull request as ready for review July 16, 2026 19:54
@adnanrhussain adnanrhussain changed the title feat: add TypeScript SDK demo app for Math Standards Alignment feat: add TypeScript SDK demo app scaffold and Math Standards Alignment evaluator Jul 16, 2026
@adnanrhussain
adnanrhussain requested review from a team and czi-fsisenda July 16, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants