open-standards/wai/wai-web/demo/world.html
Transaction Science 46c5688b86 wai: the WAI open standard — full cargo-class surface + provenance
Commit the WAI standard source: a content + capability-dispatch standard
whose thesis is "carries whatever it can reconstruct, verifies whatever
it carries." Source only — large vendored/model assets and build output
are gitignored.

Reconstruct classes (each: spec + conformance corpus + in-tab browser
sink that re-derives the corpus hash, one wai.det.fixed64 fixed-point
floor, one *-equivalence apiece):
  - interactive worlds  (replay-equivalence)   + 3 sim registrants,
    multiplayer over a relay, session receipts, glTF + real SPZ assets
  - spatial audio        (mixdown-equivalence)
  - haptics              (sample-equivalence)
  - state-feeds          (replay-equivalence, non-physics sim)
  - avatars / digital humans (pose-equivalence) + telepresence over the relay
  - volumetric / 4D splats   (frame-state-equivalence) + WebGPU EWA render,
    real-SPZ-derived clip

Verify half (lever 4):
  - asset provenance: a signed, energy-accounted lineage for opaque
    captured content WAI does not reconstruct; tamper-evident, in-tab.

Cross-cutting: JWP receipt profiles per class; a native energy meter
(IOReport via macmon, no sudo) emitting receipts with REAL measured
joules; the learned-image/neural codec family and JPEG AI entropy port
from earlier work.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-13 22:28:51 -04:00

79 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WAI — Interactive Worlds sink</title>
<style>
:root {
--bg: #06080c; --bg2: #0d1117; --border: #1e2736;
--text: #e6edf5; --text2: #8b99ad; --text3: #4a5568;
--g: #00e5a0; --w: #f0b429; --r: #ff6b6b;
--mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--mono); padding: 24px; }
h1 { font-size: 15px; letter-spacing: .04em; margin-bottom: 4px; }
h1 em { font-style: normal; color: var(--g); }
.sub { font-size: 11px; color: var(--text2); margin-bottom: 14px; max-width: 920px; line-height: 1.5; }
.bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
select, button { background: var(--bg2); color: var(--text); border: 1px solid var(--border);
border-radius: 6px; padding: 6px 12px; font-family: var(--mono); font-size: 12px; cursor: pointer; }
button:hover, select:hover { border-color: var(--g); }
canvas { background: #04060a; border: 1px solid var(--border); border-radius: 10px; display: block; }
.hud { display: flex; gap: 22px; margin-top: 10px; font-size: 11px; color: var(--text2); flex-wrap: wrap; }
.hud b { color: var(--text); font-weight: 600; }
.hash { color: var(--g); }
#badge { font-size: 12px; padding: 4px 12px; border-radius: 99px; display: none; }
#badge.ok { display: inline-block; background: rgba(0,229,160,.12); color: var(--g); border: 1px solid rgba(0,229,160,.5); }
#badge.bad { display: inline-block; background: rgba(255,107,107,.12); color: var(--r); border: 1px solid rgba(255,107,107,.5); }
.note { margin-top: 14px; font-size: 10.5px; color: var(--text3); max-width: 920px; line-height: 1.55; }
.note b { color: var(--text2); }
</style>
</head>
<body>
<h1>WAI <em>interactive worlds</em> — browser sink</h1>
<p class="sub">
This tab is a conformant <code>wai.world.replay</code> sink. The kilobytes that arrived are a
tick-0 world + a signed op log; every frame below is re-derived locally by the same Rust engine
(compiled to WASM) that generated the conformance corpus. At the sealed final tick the sink
recomputes the BLAKE3 state hash and checks it against the publisher's Ed25519-signed seal.
</p>
<div class="bar">
<select id="vector">
<option value="playground">playground — LIVE multiplayer: shove the tower (open twice)</option>
<option value="truss_fracture">truss_fracture — two actors snap a member (truss0 solver)</option>
<option value="ballistic_bounce">ballistic_bounce — gravity + restitution (ballistic0)</option>
<option value="basic_kinematics">basic_kinematics — two-actor session (kinematic0)</option>
<option value="gallery">gallery — wai.mesh.glb, verified, rendered as a solid PBR cube</option>
<option value="gallery_splat">gallery (splats) — a real wai.splat.spz file, hash-verified & decoded in-tab</option>
</select>
<button id="restart">⟲ restart</button>
<button id="pause">⏸ pause</button>
<button id="seal">⏷ seal &amp; download replay</button>
<span id="badge"></span>
</div>
<canvas id="c" width="900" height="600"></canvas>
<div class="hud">
<span>sim <b id="sim">—</b></span>
<span>tick <b id="tick">0</b> / <b id="final">0</b></span>
<span>nodes <b id="nodes">0</b></span>
<span>state hash <b class="hash" id="hash">—</b></span>
<span>payload <b id="bytes">0</b> B</span>
<span>actors <b id="actors">—</b></span>
<span>sync <b id="sync">—</b></span>
<span>receipt <b id="receipt">—</b></span>
<span>assets <b id="assets">—</b></span>
</div>
<p class="note">
<b>What you are looking at:</b> not a video, and not an approximation. The wire carried instructions —
a deterministic world and signed causal ops. Replay-equivalence (extensions/interactive-worlds §7) means
every conformant sink, on any hardware, derives the bit-identical state at every checkpoint: the hash in
this HUD is the hash in <code>world-conformance/expected_hashes.json</code>. In <i>truss_fracture</i>,
two actors pull the same member in opposite directions at the same tick; both impulses act (the SUM
conflict rule), the member's strain exceeds yield, and it fractures — structural failure as a solver
consequence, identical on every machine that ever replays it.
</p>
<script type="module" src="world.js"></script>
</body>
</html>