Skip to content

feat(webapp): add local analysis workbench and demo - #62

Merged
kevindadi merged 1 commit into
ptpnfrom
feat/webapp-workbench
Oct 20, 2026
Merged

kevindadi merged 1 commit into
ptpnfrom
feat/webapp-workbench

Conversation

@kevindadi

Copy link
Copy Markdown
Owner

Summary

Adds a local, zero-dependency web workbench for PTPN plus a precomputed
single-file demo.

  • webapp/server.py — Python 3.9 stdlib HTTP server wrapping build/ptpn
    (/api/status, /api/examples, /api/analyze), with temporary-directory
    execution, request limits, timeouts, and TDG/PTPN/SCG graph conversion.
  • webapp/static/ — plain HTML/CSS/JS workbench: RTSL/TDG editor with line
    diagnostics and pending measured by llm filling; interactive TDG/PTPN/SCG
    graphs; WCRT/WCET envelopes; core utilization; response-ratio dial; full
    metrics tables; run log with [STATS] timings; mobile model drawer.
  • webapp/make_demo.py — generates webapp/demo/demo-data.js from seven
    bundled examples.
  • webapp/build_standalone.py — bundles the page, CSS, JS, and demo data into
    one shareable HTML file.
  • README / webapp/README.md / CLAUDE.md documentation, plus a webapp
    syntax check in CI.

Graph layouts

PTPN uses Graphviz dot; SCG uses neato for a compact spring layout, with a
fallback to dot. Large PTPN nets open focused on the first execution chain
and expose FIT for the whole net.

Testing

  • ctest --test-dir build --output-on-failure: 331/331 passed.
  • python3 -m py_compile webapp/server.py webapp/make_demo.py webapp/build_standalone.py.
  • node --check webapp/static/app.js and node --check webapp/demo/demo-data.js.
  • API smoke test: 13 examples; intro-demo → 26 states, PTPN 32 nodes (dot),
    SCG 26 nodes (neato); pending check → 1 entry, expected_segments=3.
  • Demo server made no API calls, confirming the precomputed path.
  • webapp/demo/ptpn-chronograph-demo.html verified from file://.
  • Visually checked Overview, Model, TDG, PTPN, SCG, Metrics, pending, syntax
    error, deadlock, symmetry, and mobile layouts.

Notes

  • webapp/demo/demo-data.js and the standalone HTML are generated and
    gitignored; run python3 webapp/make_demo.py and
    python3 webapp/build_standalone.py.
  • No C++ changes.

🤖 Generated with Claude Code

Add a zero-dependency local web UI for PTPN:

- Python 3.9 stdlib HTTP server wrapping build/ptpn with structured JSON
- RTSL/TDG editor, diagnostics, and pending measurement filling
- interactive TDG/PTPN/SCG graphs, WCRT/WCET and utilization views
- precomputed demo mode and a single-file offline demo builder

Document the commands in README, webapp/README, and CLAUDE.md; ignore the
generated demo payloads. Add a webapp syntax check to CI.

Co-Authored-By: Claude Code <[email protected]>
@kevindadi
kevindadi merged commit 652cbb2 into ptpn Oct 20, 2026
2 checks passed
@kevindadi
kevindadi deleted the feat/webapp-workbench branch October 20, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant