---
name: hpc-attack-live-admin-editing
description: Use when changing HPC Attack instructor/admin-facing pages, room dashboard text, CSS, or lightweight JavaScript during a running class without restarting the game or disrupting student sessions.
---

# HPC Attack Live Admin Editing

## Core Rule

Keep the running `hpc-attack` process alive. Student sessions and game state live in memory, so restarting Python, Uvicorn, or `scripts/start-game.sh` resets the game.

Make live instructor-facing edits through files in `live-admin/`. The server reads these files on each `/admin` or `/dashboard` request.

## Safe Workflow

1. Edit or create files under `live-admin/`.
2. Refresh only the instructor/admin browser tab that should change.
3. Verify `/healthz` still shows the same `session_id`.
4. Do not touch `/terminal`, `/board`, student auth, WebSocket handling, or `GameEngine` during live play unless the class is paused and a reset is acceptable.

## Live Files

| File | Effect |
| --- | --- |
| `live-admin/admin-note.html` | Adds instructor-only HTML above the normal admin console while preserving controls. |
| `live-admin/dashboard-note.html` | Adds HTML above the projected room dashboard. |
| `live-admin/live.css` | Adds CSS to both `/admin` and `/dashboard`. |
| `live-admin/admin.css` | Adds CSS only to `/admin`. |
| `live-admin/dashboard.css` | Adds CSS only to `/dashboard`. |
| `live-admin/admin.js` | Adds lightweight JavaScript only to `/admin`. |
| `live-admin/dashboard.js` | Adds lightweight JavaScript only to `/dashboard`. |
| `live-admin/admin.html` | Advanced: replaces the entire admin body. Preserve controls and API calls. |
| `live-admin/dashboard.html` | Advanced: replaces the entire dashboard body. Preserve `/api/dashboard` polling. |

Prefer note/CSS/JS files. Use full `admin.html` or `dashboard.html` only for deliberate layout rewrites.

## Editing Rules

- Keep changes instructor-facing. Do not modify the student terminal or situation board for a running class.
- Avoid Python code changes during live play. They will not take effect without restart.
- If a change needs new API behavior, defer it until after class or implement it before starting the game.
- Keep injected JavaScript small and defensive. If it fails, it should not block existing admin controls.
- Do not expose access codes on public tunnel pages. Admin and roster remain localhost-only.

## Quick Checks

```bash
curl -s http://127.0.0.1:8765/healthz
curl -s http://127.0.0.1:8765/admin | rg "your live text"
curl -s http://127.0.0.1:8765/dashboard | rg "your live text"
```

If the page does not change, confirm the server was started from the repo root or set `HPC_LIVE_ADMIN_DIR=/absolute/path/to/live-admin` before starting.
