import { useEffect, useState } from "react";
import {
Activity,
BadgeCheck,
BarChart3,
ChevronRight,
CircleAlert,
ClipboardList,
Database,
FlaskConical,
Play,
Server,
TerminalSquare,
} from "lucide-react";
const API_BASE = import.meta.env.VITE_API_BASE_URL ?? "http://127.0.0.1:7860";
const ARCHETYPES = ["array", "graph", "dp"];
const DIFFICULTIES = [1, 2, 3];
const pipelineSteps = [
"Create a seeded adversarial episode from the OpenEnv backend.",
"Collect solver completions and send them to the Docker Oracle sandbox.",
"Score correctness, hidden-test robustness, and anti-gaming signals.",
"Apply GRPO reward shaping to improve the Solver policy.",
"Track artifacts and compare baseline vs. trained behavior.",
];
function classNames(...values) {
return values.filter(Boolean).join(" ");
}
function formatPercent(value) {
if (value == null || Number.isNaN(value)) return "n/a";
return `${(value * 100).toFixed(1)}%`;
}
function formatReward(value) {
if (value == null || Number.isNaN(value)) return "n/a";
return value.toFixed(2);
}
function Pill({ children, tone = "default" }) {
const tones = {
default: "border-slate-700 bg-slate-900/70 text-slate-300",
success: "border-emerald-500/30 bg-emerald-500/10 text-emerald-300",
danger: "border-rose-500/30 bg-rose-500/10 text-rose-300",
warning: "border-amber-500/30 bg-amber-500/10 text-amber-300",
accent: "border-cyan-500/30 bg-cyan-500/10 text-cyan-300",
};
return (
{children}
);
}
function SectionCard({ icon: Icon, title, subtitle, children, action }) {
return (
{title}
{subtitle ?
{subtitle}
: null}
{action}
{children}
);
}
function Header({ health }) {
const healthy = health?.status === "ok";
return (
CodeCourt OpenEnv Spacev1.0.0
API {healthy ? "Healthy" : "Unavailable"}
Adversarial RL arena for code generation, hidden failures, and judge-ready proof.
CodeCourt visualizes the full OpenEnv loop: episode generation, secure code execution,
GRPO reward shaping, and artifact tracking. This dashboard is designed to make failure,
intervention, and improvement obvious in a single demo.
Story Arc
Before
Brute-force solvers fail on hidden adversarial cases.
Fix
Reward shaping, sandboxed Oracle, and seeded task variation.
After
Better pass rate, stronger reward, clearer training evidence.