feat: add swarm dashboard tooling and package manifest#26
Conversation
- dashboard/View-SwarmDashboard.ps1: console-based live tail of trace log (C:\PersonalRepo\.planning\traces.jsonl), refreshed every 2s - dashboard/server.js: minimal Node HTTP server serving dashboard/index.html and a /data endpoint that streams the last 20 trace log entries as JSON - dashboard/index.html: browser table view polling /data every 2s to render swarm run traces (time, span, persona, action, tokens, reasoning) - package.json: manifest exposing `dashboard` (PowerShell) and `dashboard-web` (Node server) npm scripts - run-dashboard.ps1: entry point that launches View-SwarmDashboard.ps1
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e85554ac1d
ℹ️ 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".
| } | ||
| }); | ||
|
|
||
| server.listen(PORT, () => { |
There was a problem hiding this comment.
Bind the dashboard server to loopback
When npm run dashboard-web is run on a workstation where port 3000 is reachable, omitting the host makes Node bind the HTTP server to the unspecified address, so the unauthenticated /data endpoint can expose local trace contents to other machines even though the console message advertises localhost. Since this dashboard is for local traces, pass 127.0.0.1 or localhost to listen.
Useful? React with 👍 / 👎.
| res.writeHead(500); | ||
| res.end('Error reading trace file'); |
There was a problem hiding this comment.
Return JSON when the trace file is absent
When the dashboard is opened before C:\PersonalRepo\.planning\traces.jsonl exists, such as on a fresh checkout or any machine without that local path, /data reaches this catch and sends a plain-text 500 while dashboard/index.html always calls await resp.json(). That makes every poll throw and leaves the web dashboard blank instead of showing an empty/waiting state; return JSON like [] or handle non-OK responses in the client.
Useful? React with 👍 / 👎.
| const tr = document.createElement('tr'); | ||
| const fmtTime = new Date(log.timestamp).toLocaleTimeString(); | ||
| const reason = log.reasoning_path && log.reasoning_path.length > 60 ? log.reasoning_path.slice(0,57) + '...' : log.reasoning_path; | ||
| tr.innerHTML = ` |
There was a problem hiding this comment.
When a trace entry contains HTML in fields such as reasoning_path, persona, or action_type, assigning the interpolated row to innerHTML lets that markup execute in the dashboard, so model- or prompt-derived trace text can become script in the operator's browser. Build the cells with textContent or escape each value before interpolation.
Useful? React with 👍 / 👎.
Summary
dashboard/(View-SwarmDashboard.ps1, index.html, server.js),package.json,run-dashboard.ps1Notes
C:\PersonalRepo\.planning\traces.jsonl) — core functionality for the local dashboard, flagged for a future portability passmasteris blocked by branch protection (GH006), hence this PR🤖 Generated with Claude Code