import { Copy } from "lucide-react"; import { toast } from "sonner"; export default function ReproSnippet({ runId }) { const text = `# NeuroScope reproducibility snippet # Re-run this analysis locally with TransformerLens + SAELens (CPU friendly). import os, requests BACKEND = os.environ.get("NEUROSCOPE_API", "${process.env.REACT_APP_BACKEND_URL || "http://localhost:8001"}/api/v1") run_id = "${runId}" run = requests.get(f"{BACKEND}/runs/{run_id}").json() print("task:", run["task"]) for s in run["steps"]: print(f" step {s['step_n']}", s["output"][:80], "risk=", s["hallucination"]["composite"]) patch = requests.post(f"{BACKEND}/runs/{run_id}/patch", json={"source_step": 1, "target_step": 3, "patch_layer": 7}).json() print("cross-step KL:", patch["kl"], "significant:", patch["significant"]) `; function copy() { navigator.clipboard.writeText(text); toast.success("snippet copied"); } return (
reproducibility
                {text}
            
); }