open-standards/wai/wai-web/Cargo.toml
Transaction Science 8cf9c53a03 wai-web: staged measurement and the session claim in the browser (W5-4)
wai-web binds wai::stage_measure, the code wai_stage_measure runs, compiled to
wasm32 (src/measure.rs): evaluateTitle gives the text `eval --json` prints for a
title, simulate and simulateModel the text `sim` prints, countObject one
envelope's counted bytes or the code it is not countable with, qualityRgb8 one
picture pair's integers (sums of squares as decimal strings), outputRoot the
output tree's root. A title is read from a map of files; titleMissing names the
next file it needs, so a page fetches them one at a time.

receipt_claims builds and runs for wasm32 with stage_measure, so signing is
exposed: sessionBegin records a session at its entry object
(SessionRecorder), decoderFor/presented/received record what the page did,
finish seals the reconstruct-session claim with a page-supplied seed (energy
null), and verifyClaim runs the claim-conformance runner against the outputs
and the objects. CI builds receipt_claims,stage_measure for wasm32 beside the
stage_measure guard.

demo/verify_measure_wasm.mjs requires, from the wasm32 build, every golden,
refusal title, counted object, quality pair and simulator result of
staged-measure-conformance/ byte for byte, and a page-recorded session per
fixture equal to the native tool's claim byte for byte. demo/verify_measure.sh
adds the native `eval --json` of every fixture (cmp against the wasm32 text)
and the native and Python claim verifiers' verdicts on every browser-sealed
session. wai-web-wasm.yml runs it (the W17 line).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 16:59:27 -04:00

41 lines
2.2 KiB
TOML

[package]
name = "wai-web"
version = "0.3.0"
edition = "2021"
license = "Apache-2.0"
description = "WAI envelope parser + capability dispatch for the browser. Wasm-bindgen surface over the standard's container format. NOT a codec backend — backends are pluggable, the deployer chooses (WASM / WebGPU / WebNN / native ONNX / transformers.js / etc.)."
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
serde-wasm-bindgen = "0.6"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
js-sys = "0.3"
# THE world engine — the same crate native sinks run, compiled to wasm32
# with the codec chain off. No second implementation: replay-equivalence
# in the browser is the identical Rust that generated the conformance
# corpus hashes.
wai = { path = "../wai-rs", default-features = false, features = ["world", "audio_scene", "haptic", "splat4d", "provenance", "score", "film", "neural_int", "generate", "video_int", "audio_int", "world_model", "world_int", "splat_int", "quantum", "quantum_ops", "quantum_cal", "quantum_mitigate", "quantum_qec", "quantum_control", "quantum_noise", "quantum_compile", "quantum_atom", "quantum_qbom", "quantum_receipt", "quantum_toolchain", "quantum_mps", "quantum_stabilizer", "quantum_pauli", "quantum_vml", "quantum_phasor", "quantum_qfhrr", "quantum_kernel", "quantum_phasor_meter", "quantum_qdata", "video_workflow", "staged", "stage_measure", "receipt_claims"] }
ed25519-dalek = "2" # actor keys for browser-side op authoring (same version as wai-rs)
blake3 = "1" # in-page receipt check: hash a decoded image against a pinned digest
[dev-dependencies]
# Pinned to the wasm-bindgen release Cargo.lock holds, so the test runner and the
# bindings agree.
wasm-bindgen-test = "=0.3.77"
[profile.release]
opt-level = "s" # size, not speed — runtime is parse-only
lto = true
codegen-units = 1
strip = "symbols"
[package.metadata.wasm-pack.profile.release]
# The host's wasm-opt (binaryen) is behind the Rust toolchain's emitted
# wasm features; rustc already runs LTO + size opts so skipping wasm-opt
# costs little. Re-enable when binaryen catches up.
wasm-opt = false