Mazes of Menace

JavaScript port of NetHack 3.7

View the Project on GitHub davidbau/menace

Test Statistics Dashboard

“You gaze into the Oracle’s crystal ball…”

What is This?

This directory contains the Test Statistics Dashboard - a visual interface for tracking test health over time.

Live Dashboard: https://davidbau.github.io/mazesofmenace/oracle/

Local: Open index.html in your browser

Files

index.html - The Dashboard

“A blessed scroll of Dashboard UI”

Interactive web interface showing:

Open in browser to view test history.

dashboard.js - Visualization Logic

“A wand of Visualization (0:∞)”

JavaScript that:

dashboard.css - Styling

“A cloak of Styling [+0]”

CSS for:

rebuild.sh - Sync Script

“A scroll of Rebuild”

Standalone script that fetches git notes from remote, rebuilds results.jsonl, and commits+pushes if there are changes. Run periodically or manually.

results.jsonl - Test History

“The Book of Testing (one entry per commit)”

Newline-delimited JSON (JSONL) format:

Data Source: Rebuilt from refs/notes/test-results by oracle/rebuild.sh

Example line:

{"commit":"abc123","date":"2026-02-11T10:30:00Z","stats":{"total":631,"pass":137,"fail":494},"regression":false}

schema.json - Log Format Documentation

“The Sacred Format of Test Logs”

JSON Schema defining the structure of test log entries. Includes:

Use this to understand or validate the log format.

How It Works

Git Notes (authoritative)
    refs/notes/test-results
            ↓
    oracle/rebuild.sh
            ↓
    results.jsonl (mirror)
            ↓
    Dashboard (loads via fetch)

Process:

  1. Tests run → results saved as git note attached to the commit
  2. oracle/rebuild.sh fetches notes, rebuilds results.jsonl, commits and pushes if changed
  3. Dashboard loads results.jsonl and visualizes

Run oracle/rebuild.sh periodically or manually to keep the dashboard up-to-date.

Viewing the Dashboard

GitHub Pages (After Push)

Once pushed to GitHub:

https://davidbau.github.io/mazesofmenace/oracle/

Requirements:

Local (Before Push)

# Option 1: Direct file
open oracle/index.html

# Option 2: Local server (avoids CORS issues)
cd oracle
python3 -m http.server 8000
# Open http://localhost:8000

Data Format (JSONL)

Why JSONL?

Example:

{"commit":"abc123","date":"2026-02-11T09:00:00Z","stats":{"pass":100,"fail":10}}
{"commit":"def456","date":"2026-02-11T10:00:00Z","stats":{"pass":105,"fail":5}}
{"commit":"ghi789","date":"2026-02-11T11:00:00Z","stats":{"pass":110,"fail":0}}

Each line is independent. Load all lines, parse each as JSON, sort by date.

Regenerating Dashboard Data

# Rebuild results.jsonl from all git notes, commit and push if changed
oracle/rebuild.sh

This fetches notes from remote, merges with local notes, rebuilds the JSONL file, and commits/pushes if anything changed.

Manual Inspection

# View all test notes
git notes --ref=test-results list

# Show specific note
git notes --ref=test-results show abc123

# View last 5 test results
tail -5 oracle/results.jsonl | jq '.'

# Check current pass rate
jq -r '.stats.pass' oracle/results.jsonl | tail -1

# Count total entries
wc -l oracle/results.jsonl

Customizing the Dashboard

Add New Charts

Edit dashboard.js:

  1. Load data from results.jsonl
  2. Create new Chart.js chart
  3. Add to renderCharts() function

Change Theme

Edit dashboard.css:

Add New Data Fields

  1. Update schema.json with new field
  2. Modify test runner to include new field
  3. Update dashboard.js to display it

Troubleshooting

Dashboard Not Loading

# Check if results.jsonl exists
ls -la oracle/results.jsonl

# Validate JSONL format
while IFS= read -r line; do
  echo "$line" | jq empty || echo "Invalid line";
done < oracle/results.jsonl

# Check if file is empty
wc -l oracle/results.jsonl

Charts Not Rendering

Common causes:

Fix:

  1. Open browser DevTools (F12)
  2. Check Console for errors
  3. Verify results.jsonl loads (Network tab)
  4. Check if Chart.js loaded

GitHub Pages Not Updating

# Verify _config.yml includes oracle
grep -A 5 "include:" _config.yml

# Force rebuild by pushing a change
git commit --allow-empty -m "Trigger Pages rebuild"
git push

GitHub Pages can take 1-2 minutes to update after push.

Documentation


“The crystal ball shows all. Your tests’ past, present, and future.”

May your pass rate ever increase!