feat(dashboard): operator-cockpit UI — backend/lattice panel, toy/dev/prod banner, validation badges, repro export - #6
Conversation
Adds a top-of-page "cockpit" panel to the SU(2) measurement dashboard and the supporting backend endpoints to power it. 1. Backend/precision/lattice/run-params chip row (β, ntherm, nmeas, nskip, R, T) sourced from progress + live meta. Commit hash, chip, RAM, OS collected once at server startup via platform/os/psutil (with sysctl fallback when psutil is missing) and exposed via /run_info. 2. TOY/DEV/PROD banner. L_max < 8 -> TOY (yellow); nmeas < 50 -> DEV (orange); otherwise PROD (green). Falls through to "Waiting..." when meta is empty. 3. Validation status chips. scripts/validate.sh now writes .dashboard_state/validate_ok.json; scripts/gpu_crosscheck.py writes .dashboard_state/gpu_crosscheck_ok.json. /run_info reports both markers; UI renders "passed" or "not run" without fabricating state. 4. ADMIN badge (red) in the banner, shown whenever the server is up. Hover surfaces auth mode (token / Tailscale / DISABLED). 5. Output-path warning pill. Server-side check via Path.resolve flags symlinked or out-of-repo out_dir values; pill renders next to the path in the cockpit chip row. 6. "Live approximate - Python postprocessor is authoritative." label above the Cornell V(R) panel (muted, warn-bordered). Numbers and existing JS fits are untouched. 7. Repro export button. /export_bundle?seed=<seed> returns a JSON bundle (commit, host, chip, ram, os, env, meta, progress header, validation markers, last-measurement snapshot); frontend triggers a browser download. Also gitignores .dashboard_state/ so the markers don't get committed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c9de14120
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if parsed.path == "/run_info": | ||
| self.handle_run_info(parsed) |
There was a problem hiding this comment.
Require auth before serving
/run_info
When --auth-token or Tailscale login allowlisting is enabled, this route still calls handle_run_info without is_authorized, so unauthenticated callers can query /run_info?seed=... and receive meta, progress_header, and out_dir_outside_repo derived from protected run files. That bypasses the access control currently enforced for /results/* and leaks experiment/run metadata (including filesystem path hints) in deployments that rely on result protection.
Useful? React with 👍 / 👎.
Summary
Follow-up to merged PR #5. Implements the UI scope @ether and @Petrus signed off on: dashboard becomes a real operator cockpit instead of a pretty graph.
Built on the same
fix/dashboard-and-safetybranch (one commit,7c9de14).What landed (UI/server, no driver changes)
tools/su2_dashboard_server.py_collect_host_info: chip / RAM / OS / git commit captured once at startup._read_marker: reads.dashboard_state/<name>.jsonmarkers written by validate/crosscheck._path_outside_repo: flagsout_dirthat's a symlink or escapes the repo root./run_infoendpoint: returns host info, commit, validation status, plus per-seed meta/progress when?seed=…is passed./export_bundle?seed=…endpoint: returns a JSON repro bundle withContent-Disposition: attachment(commit,hostname,chip,ram_gb,os,args,env_summary,seed,lattice,beta,ntherm,nmeas,nskip,R,T,dashboard_metrics_snapshot, etc., 21 keys).tools/su2_dashboard.html/export_bundle..cockpit*and.live-approx-label. No framework imports.scripts/validate.sh— writes.dashboard_state/validate_ok.jsonon success.scripts/gpu_crosscheck.py— writes.dashboard_state/gpu_crosscheck_ok.jsonon success..gitignore— ignores.dashboard_state/.Verification (run by the implementing agent)
python3 tools/su2_dashboard_server.py --helpclean../scripts/validate.shpasses; marker file written;baseline_V_R2 ≈ 0.31./run_infoand/run_info?seed=…— host info + commit + validation present./export_bundle?seed=…returns 953-byte JSON with all 21 expected keys andContent-Disposition: attachment.Operator TODOs (left intentionally)
precision,nskip,pipeline_labelaren't yet emitted in the worker'slive/progressJSON, so those chips render-. Worker-side change is out of scope for this PR._path_outside_repowill correctly flagresults/cpu_runwhenresults/is symlinked to an external volume (/Volumes/T705/...). If that's the normal MacBook setup and the pill is noisy, add an env-var allowlist.gpu_crosscheck.pymarker write wasn't end-to-end tested (requires full GPT toolchain + a long run), only the marker-write code path.Test plan
./scripts/validate.shproduces.dashboard_state/validate_ok.jsonand dashboard reads "✓ passed".nmeasthresholds.--auth-tokenis set, "token" or "Tailscale" otherwise.🤖 Generated with Claude Code