Wardian docs

USL lab as little apps

Try it

This suite uses its own database, Splunk or channels, which need a Wardian. Download it and import it in Wardian to run it.

Download usl-lab.wardian Import it in Wardian: Settings → Import.

A wasm-like architecture using plain web technology. Each app is a sealed unit with a declared contract; the kernel enforces it. The result builds into one self-contained HTML page (what the Claude viewer publishes).

apps/<name>/view.html   markup the app owns
apps/<name>/app.js      Kernel.register({ name, emits, listens, provides, needs, caps, init(ctx) })
core/kernel.js          runtime: contracts, copied messages, capability grants, hot-plug (UslKernel.mount)
core/lib.js             frozen pure helpers (formatting, model, peak maths)
core/engine.js          the maths. Identical source runs in a Web Worker or on the page
core/style.css          shared theme
build.py                audits every app, then assembles dist/usl-lab-apps.html
test/e2e.js             boots the page in jsdom: all apps, worker + fallback, sealing tests
appownstalks to
inputsmeasurements, units, context, storage, tables from the Splunk table app (channel splunk.table)emits data:changed, context:changed; receives splunk.table
sessionnothing visible; coordinatesdata:changed -> engine.analyze -> analysis:ready
enginethe maths, in a worker (or page)provides analyze, curve; emits engine:status
chartchart, legend, hover, target lineanalysis:ready, whatif:changed, target:changed -> engine.curve
meaningplain-language reading of the fit (fixed rules, no AI), "Plan for a target", the N/X/R glossary (storage)analysis:ready, checks:ready -> emits target:changed
whatifsliders, plain-language boxemits whatif:changed; calls diagnosis.parseWhatIf
readoutsparameters and rangesanalysis:ready
checksfindings in wordsanalysis:ready -> emits checks:ready
diagnosisClaude (claude:sample)emits capability:ai, diagnosis:updated
exportreport/CSV (claude:downloads)many listens; calls engine.curve

What makes them "wasm-like": declared imports/exports; nothing shared by reference (every message and call is structuredClone'd); no DOM/window/storage/network except through granted capabilities (build.py audits this); retained topics so a late-joining app gets the latest state; apps can be hot-plugged at runtime.

Build: python3 build.py then node test/e2e.js (needs npm i jsdom). Debug in the browser console: UslKernel.apps(), UslKernel.trace(), UslKernel.faults().

This page is apps/usl-lab/README.md in the repository. Something wrong or missing? Change that file.