Lightweight developer dashboard that keeps Rae compiler contributors aware of build health, test coverage, and historical performance trends without relying on heavy frameworks. The current implementation lives in this repository so it can eventually be re-authored in Rae itself.
- Goal: Provide a simple yet powerful dashboard for monitoring the Rae compiler (builds, tests, stats, Codex automation).
- Constraint: Keep everything transparent and portable so the entire stack can be rewritten in Rae once the language has UI primitives.
- Scope: Focus on developer productivity (build/test monitoring, stats, Codex hand-off). No attempt to replace IDE/editor tooling.
| Layer | Choice | Rationale |
|---|---|---|
| Runtime | Bun (preferred) or Node.js | Fast startup, familiar ecosystem, easy to port |
| Language | TypeScript | Static safety without build-time complexity |
| Server | Raw HTTP + WebSocket (Bun primitives or ws) |
Low abstraction overhead |
| Storage | SQLite via Bun's driver or better-sqlite3 |
Single-file DB, easy backup/versioning |
| Client | Vanilla JS / optional Preact micro-components + CSS variables | Minimal runtime, easy to inspect and port |
| Charts | Chart.js | Straightforward API |
| Syntax | Prism.js (or lightweight equivalent) | Highlight compiler/code snippets |
- Bun ≥ 1.0 (preferred) or Node.js ≥ 18
- Rae compiler repository available next to this project (default
../rae)
bun installconfig.json ships with the repo and should work out of the box. If you need local overrides (different paths/ports/commands), create a config.local.json file with the same shape. Any keys in config.local.json override config.json (and config.local.json is git-ignored). config.example.json mirrors the default config for reference.
{
"compilerPath": "../rae",
"port": 3000,
"examplesPath": "examples",
"defaultTarget": "live",
"targets": [
{
"id": "live",
"label": "Live (bytecode VM)",
"testCommand": "cd compiler && TEST_TARGET=live make test",
"buildCommand": "cd compiler && make",
"cleanCommand": "cd compiler && make clean",
"rebuildCommand": "cd compiler && make clean && make",
"exampleRunCommand": "./compiler/bin/rae run {{ENTRY}}",
"exampleWatchCommand": "./compiler/bin/rae run --watch {{ENTRY}}",
"exampleBuildCommand": "./compiler/bin/rae build --target live --out {{OUTDIR}} {{ENTRY}}"
},
{
"id": "compiled",
"label": "Compiled (C backend)",
"testCommand": "cd compiler && TEST_TARGET=compiled make test",
"buildCommand": "cd compiler && make",
"cleanCommand": "cd compiler && make clean",
"rebuildCommand": "cd compiler && make clean && make",
"exampleRunCommand": "./compiler/bin/rae build --target compiled --out {{OUTDIR}} {{ENTRY}}",
"exampleBuildCommand": "./compiler/bin/rae build --target compiled --out {{OUTDIR}} {{ENTRY}}"
},
{
"id": "hybrid",
"label": "Hybrid Dev",
"testCommand": "cd compiler && TEST_TARGET=hybrid make test",
"buildCommand": "cd compiler && make",
"cleanCommand": "cd compiler && make clean",
"rebuildCommand": "cd compiler && make clean && make",
"exampleRunCommand": "./compiler/bin/rae build --target hybrid --out {{OUTDIR}} {{ENTRY}}",
"exampleBuildCommand": "./compiler/bin/rae build --target hybrid --out {{OUTDIR}} {{ENTRY}}"
}
]
}# Development server with auto-restart + client reload
bun run dev
# Stop the dev server (kills the listener on the configured port)
make stop
# Production build (if/when a bundle step exists)
bun run startbun run dev launches a small watcher that restarts the Bun server whenever files under src/, config.json, config.local.json, or package.json change. The browser auto-reloads after each restart, so you rarely need to refresh manually. The server exposes both HTTP and WebSocket endpoints; open http://localhost:3000 in a browser.
- Use the Target dropdown (Live / Compiled / Hybrid) in the panel header to pick which compiler mode to exercise. The default comes from
defaultTarget, but you can switch at any time. - Click Run all tests (or press
Ctrl+T/Cmd+T) inside the dashboard to execute the command mapped to the selected target. Each target can point at a different script/Make target inconfig.json. - Live stdout/stderr output appears in the terminal panel; the run status chip flips to Passed/Failed when complete.
- Real-time per-test updates populate the suite summary and the test list so you can see which specific files passed/failed.
- The browser auto-reloads whenever the Bun dev server restarts, so you rarely need to manually refresh during local development.
- Compiled and Hybrid targets use the slim build suites (
make test TARGET=compiled|hybrid), so dashboard-triggered runs stay fast while still exercising the new codegen and packaging flows.
- Buttons for Build, Clean, and Rebuild run whichever commands you defined for the currently selected target.
Ctrl+T/Cmd+Tstill triggers tests, whileCtrl+B/Cmd+Btriggers Build. - Build stdout/stderr streams into its own terminal panel with copy button and status indicator.
- Rebuild executes the clean command followed by the build command (via
clean && build) so you can reset the compiler tree before building again.
- The Examples panel scans the configured
examplesPath(defaults to../rae/examples) and lists every.raedemo project, including metadata from optionaldevtools.jsonfiles (name, target restrictions, etc.). - Select an example and pick a target via the dropdown in the panel header. Examples can opt into specific targets (e.g., the new Hybrid hot reload demo only exposes the Hybrid profile).
- Use Run, Live watch, or Build artifacts:
- Run executes the configured per-target command (Live uses
rae run, Hybrid/Compiled runrae buildwith a temp output dir). - Live watch is only enabled for targets that define
exampleWatchCommand(typically Live). - Build artifacts runs the target’s
exampleBuildCommandand lists the emitted files + hashes so you can inspect Hybrid/Compiled bundles without leaving the browser.
- Run executes the configured per-target command (Live uses
- Output streams into a terminal next to the file tree; click any file button to view the highlighted source without leaving the dashboard.
- The inline editor still lets you tweak files in place. Save changes and rerun/watch as needed to simulate hot reload workflows.
- The
examples/hybrid_hot_reloadsample demonstrates the Hybrid packaging pipeline: build it via the dashboard to see both the compiled host stubs and VM chunks listed in the artifacts panel. - The hybrid demo now exposes versioned Dev download v1/v2/v3 and Release download v1/v2/v3 buttons; each one runs the helper script, stages the generated
.vmchunk+ manifest under.simulated_downloads/<profile>/<version>/, and streams the resulting hashes back into the terminal so you can mimic “downloaded code” events without leaving the UI. - Staged bundles appear in the Staged downloads card right below Build artifacts so you can verify which profiles, versions, and timestamps are available for the host to reload.
- Every test/build command stores metrics (durations, pass/fail counts) in
data/devtools.dbvia SQLite. - The Stats preview panel pulls recent entries from the database (default metrics:
tests.duration_ms,builds.duration_ms) so you can see trends without leaving the dashboard. - Data can be exported later for Chart.js visualizations; each entry carries metadata (
success, run id, etc.).
- The Test sources panel lists files from
testsPath(defaultcompiler/tests) and renders them with a lightweight Rae syntax highlighter. - Select a file to see its contents; use the corner copy icon to grab the code for editor reproduction or bug reports.
- The highlighter loads
syntaxSummaryPath(default../rae/docs/rae_syntax.json) for authoritative tokens—keep that file up to date as the language evolves.
- A warning icon in the header lights up when the dashboard encounters fetch/WebSocket/runtime errors; click it to open the error log for details.
- Use the log to capture errors (e.g., missing syntax file) before reporting issues—entries include timestamps and sources.
- File-system tree of Rae tests with real-time status (⚪ not run, 🟡 running, 🟢 pass, 🔴 fail, 🟠 error).
- Detailed view: expected vs. actual output diff, compiler stdout/stderr, stack traces.
- Controls for
Run All Tests,Run Failed,Run This Test,Clear Results. - WebSocket streaming for incremental updates; optimistic UI and sticky summary header.
- Buttons for
Build Compiler,Clean,Rebuild. - Terminal-style streaming panel with timestamps, ANSI-aware highlighting for warnings/errors, and auto-scroll.
- Status indicator with elapsed time tracking and cancellation support (future).
-
Records build/test durations, pass rate, file/line counts, binary size, and other metrics after each successful run.
-
Uses SQLite schema:
CREATE TABLE stats ( id INTEGER PRIMARY KEY, timestamp TEXT NOT NULL, metric_name TEXT NOT NULL, metric_value REAL NOT NULL, metadata TEXT ); CREATE INDEX idx_metric_time ON stats(metric_name, timestamp);
-
Chart.js line charts with toggles, multiple axes, and CSV export (last 30 days by default).
-
Manual "Snapshot Stats" button plus automatic post-build recording.
- "Ask Codex" button opens a panel with current failures/context and free-form prompt.
- Invokes the
codexCLI inside the Rae compiler repo and streams output back into the UI. - Optional templates to re-use common prompts.
- Dark theme by default with planned toggle.
- Consistent spacing via CSS variables, subtle shadows, and 200–300ms transitions.
- Keyboard shortcuts:
Ctrl+Bbuild,Ctrl+Trun all tests,Ctrl+Rre-run failed tests. - Toast notifications and friendly error handling when Rae paths/commands are misconfigured.
rae-devtools/
├── src/
│ ├── server/
│ │ ├── main.ts # HTTP server + websocket upgrade
│ │ ├── compiler.ts # Build orchestration
│ │ ├── tests.ts # Test runner + parsing
│ │ ├── stats.ts # SQLite accessors
│ │ ├── codex.ts # Wrapper around Codex CLI
│ │ └── websocket.ts # Pub/sub for live updates
│ ├── client/
│ │ ├── index.html
│ │ ├── style.css
│ │ ├── app.js
│ │ └── components/
│ └── shared/
│ └── types.ts # Shared DTOs and enums
├── data/ # Houses SQLite DB (tracked via .gitkeep)
├── package.json
├── tsconfig.json
└── README.md
- Backend: Minimal HTTP handlers plus WebSocket broadcaster. Uses child processes for build/test commands and streams stdout/stderr line-by-line.
- Frontend: Single-page layout with sidebar test tree and main content area for build logs/stats/test detail.
- Shared Types: Keep WebSocket messages and HTTP responses type-safe and portable.
- Data Folder: Contains SQLite DB (
devtools.dbor similar). Only the.gitkeepfile is tracked; DB files stay local.
- Add a metric descriptor in
src/server/stats.ts(name, units, query strategy). - Produce measurements after builds/tests (e.g., parse CLI output or inspect the Rae repo).
- Insert into SQLite with optional JSON metadata (
{ "commit": "...", "branch": "..." }). - Update frontend Chart.js config to display/select the metric.
- Document the new metric in this README so contributors understand how it is sourced.
- Core Infrastructure – project scaffolding, HTTP server, WebSocket plumbing, simple HTML shell.
- Test Dashboard – command execution, parser, tree UI, diff view.
- Build Controls – build/clean tooling with streaming output and status tracking.
- Statistics – SQLite integration, data recording, and visualization widgets.
- Polish – keyboard shortcuts, theming, Codex integration, accessibility.
- Unit tests for log parsing, stats persistence, and message serialization (to be added in
src/server/__tests__). - Manual checklist:
- Build runs end-to-end and updates status indicator.
- Full test suite plus "Run Failed" scenario.
- SQLite stats entries appear after builds/tests and persist across restarts.
- WebSocket reconnect handles server restarts gracefully.
- UI remains responsive during long-running operations.
- Run arbitrary Rae programs from the dashboard.
- Performance profiling overlays once Rae exposes profiling hooks.
- Benchmark suite tracking with regressions alerts.
- Git metadata correlation (stats + commits).
- Multi-project dashboards if Rae spawns additional repos.
- Plugin system for community metrics or custom panels.
- Fork/clone this repo alongside the main Rae compiler repo.
- Configure the path/commands in
config.json. - Work on one phase/feature at a time; keep abstractions simple.
- Commit meaningful increments frequently (aim for 1–10 commits per day) and push once changes build/run cleanly.
- Open PRs with screenshots or terminal captures so reviewers can visualize the UI.
The lightweight hub under hub/ coordinates all Rae work (compiler and
devtools) via numbered tasks:
- Queue a task in
hub/QUEUE.mdwith a short summary and acceptance checks. Every task uses theT### - titleformat. - Move the task to
hub/INPROGRESS.mdonce you start working. Create a branch namedagent/<repo>/T###-slugin the relevant repo. - Log starts, completions, and verification commands in
hub/LOG.mdso the UI (and humans) can track progress. - When finished, record the outcome in
hub/RESULTS/T###.md(summary + tests), run the acceptance checks, and remove the task from the queue.
The single-agent setup simply repeats these steps task-by-task, ensuring the devtools dashboard and the CLI stay in sync with the latest automation work.
Apache 2.0 (see LICENSE file).