How bytemonk-academy/jev-decision-lab works
jev-decision-lab is an interactive engineering lab comparing typed decision models, deterministic code, and general-purpose LLMs. Users submit labelled examples through Support Pipeline, Agent Firewall, or Model Router; a selected provider returns probability distributions, deterministic policy/gating produces a route or simulated action, and traces record cost, latency, confidence, and correctness. Calibration analyzes those records, while batch runs and CLI benchmarks evaluate datasets. The graph follows documented capabilities and indexed imports; unsampled modules are included where their role is documented, but uncertain internal calls are omitted.
Main entry points: index.ts Experiment dispatcher · run-batch/route.ts Batch-run API · providers.ts Provider registry · run/route.ts Single-run API
Components 23
Lab experience
- Next.js pages
app - Support comparison UI
components/SupportCompare.tsx - Calibration UI
components/CalibrationLab.tsx - Decision displays
components/DecisionBars.tsx
Decision workflows
- Single-run API
app/api/run/route.ts - Batch-run API
app/api/run-batch/route.ts - Labelled datasets
lib/datasets.ts - Experiment dispatcher
lib/experiments/index.ts - Support pipeline
lib/experiments/support.ts - Agent firewall
lib/experiments/firewall.ts - Model router
lib/experiments/router.ts - Deterministic policy
lib/policy-engine.ts
Provider adapters
- Provider registry
lib/providers.ts - Jev adapter
lib/jev.ts - LLM adapter
lib/llm.ts - Mock provider
lib/mock.ts
Measurement and results
- Metrics and calibration
lib/metrics.ts - JSON results store
lib/results-store.ts - Results API
app/api/results/route.ts - CLI benchmark
experiments/benchmark.ts - CLI shared helpers
experiments/_shared.ts
Other components
- Lab user
- Model services
Connections 37
- Lab user → Next.js pages: opens lab
README.md - Next.js pages → Support comparison UI: renders support
app/support/page.tsx - Next.js pages → Calibration UI: renders calibration
app/calibration/page.tsx - Support comparison UI → Single-run API: submits run
README.md - Calibration UI → Batch-run API: runs dataset
README.md - Single-run API → Labelled datasets: loads examples
app/api/run/route.ts - Single-run API → Experiment dispatcher: dispatches experiment
app/api/run/route.ts - Single-run API → Provider registry: resolves provider
app/api/run/route.ts - Single-run API → JSON results store: appends records
app/api/run/route.ts - Batch-run API → Labelled datasets: loads dataset
app/api/run-batch/route.ts - Batch-run API → Experiment dispatcher: runs examples
app/api/run-batch/route.ts - Batch-run API → Provider registry: resolves provider
app/api/run-batch/route.ts - Batch-run API → Metrics and calibration: summarizes records
app/api/run-batch/route.ts - Batch-run API → JSON results store: saves benchmark
app/api/run-batch/route.ts - Experiment dispatcher → Support pipeline: runs support
lib/experiments/index.ts - Experiment dispatcher → Agent firewall: runs firewall
lib/experiments/index.ts - Experiment dispatcher → Model router: runs router
lib/experiments/index.ts - Experiment dispatcher → Provider registry: gets providers
lib/experiments/index.ts - Support pipeline → Deterministic policy: evaluates policy
lib/experiments/support.ts - Support pipeline → Metrics and calibration: records outcomes
lib/experiments/support.ts - Model router → Deterministic policy: evaluates route
lib/experiments/router.ts - Model router → Metrics and calibration: records outcomes
lib/experiments/router.ts - Agent firewall → Deterministic policy: checks safeguards
lib/experiments/firewall.ts - Provider registry → Jev adapter: selects Jev
lib/providers.ts - Provider registry → LLM adapter: selects LLM
lib/providers.ts - Provider registry → Mock provider: selects mock
lib/providers.ts - Jev adapter → Model services: calls model APIs
lib/jev.ts - LLM adapter → Model services: calls chat APIs
lib/llm.ts - Support comparison UI → Decision displays: displays decisions
components/SupportCompare.tsx - Calibration UI → Metrics and calibration: analyzes records
components/CalibrationLab.tsx - Calibration UI → Results API: loads results
README.md - Results API → JSON results store: reads records
app/api/results/route.ts - Results API → Metrics and calibration: summarizes results
app/api/results/route.ts - CLI benchmark → Labelled datasets: benchmarks data
- CLI benchmark → Experiment dispatcher: runs experiments
- CLI benchmark → CLI shared helpers: uses helpers
- CLI benchmark → JSON results store: writes reports