| name | evals-context |
| description | Provides context about the NJUST_AI evals system structure in this monorepo. Use when tasks mention "evals", "evaluation", "eval runs", "eval exercises", or working with the evals infrastructure. Helps distinguish between the evals execution system (packages/evals, apps/web-evals) and the public website evals display page (apps/web-Njust-AI/src/app/evals). |
Evals Codebase Context
When to Use This Skill
Use this skill when the task involves:
- Modifying or debugging the evals execution infrastructure
- Adding new eval exercises or languages
- Working with the evals web interface (apps/web-evals)
- Modifying the public evals display page on njust-ai.local
- Understanding where evals code lives in this monorepo
When NOT to Use This Skill
Do NOT use this skill when:
- Working on unrelated parts of the codebase (extension, webview-ui, etc.)
- The task is purely about the VS Code extension's core functionality
- Working on the main website pages that don't involve evals
Key Disambiguation: Two "Evals" Locations
This monorepo has two distinct evals-related locations that can cause confusion:
| Component | Path | Purpose |
|---|
| Evals Execution System | packages/evals/ | Core eval infrastructure: CLI, DB schema, Docker configs |
| Evals Management UI | apps/web-evals/ | Next.js app for creating/monitoring eval runs (localhost:3446) |
| Website Evals Page | apps/web-Njust-AI/src/app/evals/ | Public njust-ai.local page displaying eval results |
| External Exercises Repo | NJUST_AI-Evals | Actual coding exercises (NOT in this monorepo) |
Directory Structure Reference
packages/evals/ - Core Evals Package
packages/evals/
โโโ ARCHITECTURE.md # Detailed architecture documentation
โโโ ADDING-EVALS.md # Guide for adding new exercises/languages
โโโ README.md # Setup and running instructions
โโโ docker-compose.yml # Container orchestration
โโโ Dockerfile.runner # Runner container definition
โโโ Dockerfile.web # Web app container
โโโ drizzle.config.ts # Database ORM config
โโโ src/
โ โโโ index.ts # Package exports
โ โโโ cli/ # CLI commands for running evals
โ โ โโโ runEvals.ts # Orchestrates complete eval runs
โ โ โโโ runTask.ts # Executes individual tasks in containers
โ โ โโโ runUnitTest.ts # Validates task completion via tests
โ โ โโโ redis.ts # Redis pub/sub integration
โ โโโ db/
โ โ โโโ schema.ts # Database schema (runs, tasks)
โ โ โโโ queries/ # Database query functions
โ โ โโโ migrations/ # SQL migrations
โ โโโ exercises/
โ โโโ index.ts # Exercise loading utilities
โโโ scripts/
โโโ setup.sh # Local macOS setup script
apps/web-evals/ - Evals Management Web App
apps/web-evals/
โโโ src/
โ โโโ app/
โ โ โโโ page.tsx # Home page (runs list)
โ โ โโโ runs/
โ โ โ โโโ new/ # Create new eval run
โ โ โ โโโ [id]/ # View specific run status
โ โ โโโ api/runs/ # SSE streaming endpoint
โ โโโ actions/ # Server actions
โ โ โโโ runs.ts # Run CRUD operations
โ โ โโโ tasks.ts # Task queries
โ โ โโโ exercises.ts # Exercise listing
โ โ โโโ heartbeat.ts # Controller health checks
โ โโโ hooks/ # React hooks (SSE, models, etc.)
โ โโโ lib/ # Utilities and schemas
apps/web-Njust-AI/src/app/evals/ - Public Website Evals Page
apps/web-Njust-AI/src/app/evals/
โโโ page.tsx # Fetches and displays public eval results
โโโ evals.tsx # Main evals display component
โโโ plot.tsx # Visualization component
โโโ types.ts # EvalRun type (extends packages/evals types)
This page displays eval results on the public njust-ai.local website. It imports types from @njust-ai/evals but does NOT run evals.
Architecture Overview
The evals system is a distributed evaluation platform that runs AI coding tasks in isolated VS Code environments:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Web App (apps/web-evals) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ PostgreSQL โโโโโโบ Controller Container โ
โ โ โ โ
โ โผ โผ โ
โ Redis โโโโโบ Runner Containers (1-25 parallel) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key components:
- Controller: Orchestrates eval runs, spawns runners, manages task queue (p-queue)
- Runner: Isolated Docker container with VS Code + NJUST_AI extension + language runtimes
- Redis: Pub/sub for real-time events (NOT task queuing)
- PostgreSQL: Stores runs, tasks, metrics
Common Tasks Quick Reference
Adding a New Eval Exercise
- Add exercise to NJUST_AI-Evals repo (external)
- See
packages/evals/ADDING-EVALS.md for structure
Modifying Eval CLI Behavior
Edit files in packages/evals/src/cli/:
Modifying the Evals Web Interface
Edit files in apps/web-evals/src/:
Modifying the Public Evals Display Page
Edit files in apps/web-Njust-AI/src/app/evals/:
Database Schema Changes
- Edit
packages/evals/src/db/schema.ts
- Generate migration:
cd packages/evals && pnpm drizzle-kit generate
- Apply migration:
pnpm drizzle-kit migrate
Running Evals Locally
pnpm evals
Ports (defaults):
- PostgreSQL: 5433
- Redis: 6380
- Web: 3446
Testing
cd packages/evals && npx vitest run
cd apps/web-evals && npx vitest run
Key Types/Exports from @njust-ai/evals
The package exports are defined in packages/evals/src/index.ts:
- Database queries:
getRuns, getTasks, getTaskMetrics, etc.
- Schema types:
Run, Task, TaskMetrics
- Used by both
apps/web-evals and apps/web-Njust-AI