Skip to content

AADL diagrams stuck on 'Loading…' in static HTML export (compliance reports) — inline SVG at export time #468

@avrabe

Description

@avrabe

Bug (user-reported)

AADL architecture diagrams in the published static compliance report never render — they're stuck on "Loading AADL diagram…" forever. Reproduced at https://pulseengine.eu/reports/rivet/0.15.0/compliance/documents/ARCH-001.html (every diagram: System Architecture, Core Process Internals, CLI Process, Adapter Pipeline, Dashboard).

Root cause (traced through the code)

AADL diagrams are produced as a placeholder that is filled client-side at runtime, only by rivet serve:

  • rivet-core/src/document.rs:567 (and rivet-cli/src/render/artifacts.rs:627) emit
    <div class="aadl-diagram" data-root="…"><p class="aadl-loading">Loading AADL diagram...</p></div>.
  • The JS that fills it — initAadlDiagrams() in rivet-cli/src/serve/js.rs:741 — is part of the serve bundle only and:
    • fetchAadlSources()fetch('/source-raw/arch') + fetch('/source-raw/arch/<file>')
    • checkWasmAvailable()fetch('/wasm/spar_wasm.js')
    • renders via the spar WASM module in-browser.

A static export (rivet export --format html, used for the compliance report) bundles neither that JS nor those server routes, so the placeholder is never touched → perpetual "Loading…". Two compounding problems:

  1. The export doesn't include/invoke the AADL JS at all (so every JS error/fallback path — "requires spar WASM", "Failed to load sources" — never even runs; hence "Loading…" not a fallback message).
  2. Even if it did, the fetch paths are absolute-from-domain-root (/source-raw/…, /wasm/…), wrong for a report served under /reports/rivet/0.15.0/compliance/.

On rivet serve the diagrams render only if the spar WASM was built (./scripts/build-wasm.sh); otherwise serve shows the "requires spar WASM" fallback (not a hang).

Fixes

  • Immediate (done, #REQ-196 / linked PR): the export now rewrites the perpetual "Loading AADL diagram…" into an honest static note pointing to the interactive rivet serve view, so the report no longer looks hung.
  • Proper (this issue): inline the rendered SVG at export time. rivet-core/src/wasm_runtime.rs already has a server-side spar renderer (render_aadl_via_wasm / call_render, "load the real spar WASM component"). At rivet export --format html, for each .aadl-diagram data-root="X", run that renderer over the .aadl sources (the arch/ dir) and inline the <svg> directly — no client JS, no server routes, works in any static host.
    • Requires the wasm feature in the export/release build + the spar component present; needs a clean fallback when unavailable (the #REQ-196 note).
    • Alternative considered: bundle spar_wasm.js + .wasm + the .aadl sources as relative files and rewrite the fetch URLs to relative (reuses the existing client renderer offline). Heavier payload; compileStreaming from a static host is fine over http.

Workaround now

View the document in rivet serve with the WASM built (./scripts/build-wasm.sh); the dashboard renders the diagrams interactively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions