wai: the developer's path (hello, create, dev, verify), the floor with no system library, nine examples, and the quickstart archive #504
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/dx-a-examples-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this is
The free entry point to WAI: a five-minute path from nothing to a live room on your own machine, examples that run, and a
waicommand line that scaffolds them. Everything runs on the open reference software alone, self-hosted, with no account.Base.
train/wai-eat5b79d1550(Train E, #499, was still open when this started and is still open). Until #499 merges, this PR's diff againstmainalso shows Train E's commits; this branch adds only the commits on top of5b79d1550.What is in it
The floor with no system library (wai-rs features)
floor: the mandatory floor of SPEC §5 (PNG, FLAC, zstd) with no system codec library. PNG through theimagecrate's pure-Rust codec (its declaration now carriespngalone;codecsadds JPEG, WebP and AVIF, so acodecsbuild is unchanged), FLAC decoded by claxon, zstd from its reference source compiled in.wai decodeopens the three;wai encodewrites PNG and zstd; a codec outside the floor is refused naming the build that has it.wai::floor_capabilities().quickstart=floor+http+receipt_claims+getrandom: what the prebuiltwaiis built with.Four verbs, one module each, one dispatch table
src/bin/wai_cli/dx/:mod.rsholdsVERBS(name, usage, function);main()callsdx::dispatchonce. Renaming or regrouping a verb is a line there.wai hello [<dir>]: WAI's four steps on a picture made in place. Name (aWAI1envelope namingwai.image.png), Dispatch (SPEC §4 against this binary's capabilities), Rebuild (byte for byte), Receipt (a labelled group receipt signed with a key made for the run, written as http-delivery §8 lays receipts beside an object:<cid>.wai,<cid>.wai.receipts,rcpt/<link>.json, then checked).wai create <dir> --template <name>,--list [--json]: a project from one ofwai/examples/, whose files the binary holds (include_bytes!,dx/templates.rs); never into a directory that holds anything. A watch room's sample tone is generated.wai dev:joule-moq-relayandjoule-moq-roomstarted on loopback ports of their own, the room's keys made once in.wai/dev/, and one origin on127.0.0.1served as a production front serves it: your page at/, the room client beside it, the room service at/room-api/, the relay's WebSocket binding at/moq(the room client refuses a service on another origin).std::netonly, no new dependency.--checkchecks each piece through the origin (the page and its WebAssembly, the service and its clock's session on the relay, a viewer's grant, the relay's101 moqt-22upgrade), prints the time, and stops. Modes:--watch FILE,--call,--remote,--messaging,--e2ee.wai verify <path>...: every receipt index under a path, checked offline throughhttp_binding::receipts::check_indexwith a file fetcher.The project file,
wai.json, is read and written only indx/project.rs; an unknown member is refused.The examples (
wai/examples/), each with a test that runs it throughwai createandwai devvideo-roomwatch-togethermessagingencoder-ingestpackage-and-deliververify-receiptswai hello's receipts and each refuses a changed byteapple-appandroid-appremote-desktopremote_desktop_verify.py(Framework); a browser decodes it and drives it (Studio)Each README is a dozen lines: what it shows, run it, what you see, and how a coding assistant uses it (
wai setup-agent, from DX-B).The archive, its release and its installer (
wai/quickstart/)build-web.sh(the room client: pages and three wasm builds),build.sh(one archive per target:bin/wai, joule-moq-relay, joule-moq-room, wai-remote-host, wai-pack;share/wai/web/; README; LICENSE; reproducible tar;.sha256). It gives each build its own target directory under a shared one (wai's rlib carries no hash as a cdylib, and two feature sets overwrote each other), stops on a failed build, and checks the packagedwaiholds this checkout's examples byte for byte.install.sh(also on the site branch as/install.sh),formulae.py,publish.sh,test/clean-machine.sh,test/run-examples.sh..github/workflows/wai-release.yml: on a tagwai-v<version>, the room client once (macOS), archives for macOS (arm64, x86_64), Linux (x86_64, arm64, musl static) and Windows, each archive's ownwairun before upload, then the Homebrew formula and the Scoop manifest. Not run by this PR; nothing is published.CI
.github/workflows/wai-examples.yml: portable (linux), browser + archive +wai dev --checkfrom the unpacked archive + apple-app (macos), android-app (linux-arm64).wai-conformance.yml:tests/floor.rs(feature floor),tests/cli_dx.rsand the binary's dx tests (feature quickstart); fires onwai/examples/**.Measured quickstart
wai/quickstart/test/clean-machine.sh <archive> [--browser]: a fresh HOME and directory, the system's PATH only, the archive checked and unpacked,wai hello,wai verify,wai create my-room --template video-room,wai dev --check. Downloading the archive is not timed (no release exists yet).wai devreadywai-0.3.0-x86_64-unknown-linux-gnu.tar.gz, 18 MBwai-0.3.0-aarch64-apple-darwin.tar.gz, 15 MBFrom source instead (Framework, empty target directories, crates already fetched, 16 jobs): wai 84 s, relay 24 s, room service 38 s, 146 s in all; the room client's WebAssembly is a further step needing the wasm target and its bindings tool.
Checks
cargo test --no-default-features --features quickstart --bin wai --test floor --test cli_dxcargo test --no-default-features --features floor --test floorcargo test --lib codecs::(default features, system codec libraries) and--features quickstart --test floor --test cli_dxcargo clippy --all-targetswith--features quickstart,--features floor, none, and default: notes in the touched fileshttp_vectors_playlists.rs,int_payload,energy_reportthat everyhttpbuild withoutvideo_manifestshows)cargo clippy --all-targets -- -D warningsonexamples/verify-receipts/rustandexamples/encoder-ingestcargo metadata --locked --offlineon every lock holdingwai(14)bash wai/quickstart/test/run-examples.sh portable... browser(withBROWSER_BIN)... apple/... androidpython3 -I scripts/check-tests-in-ci.py./scripts/check-workflow-concurrency.shruby -ryamlover.github/workflows/*.ymlcheck-spec-refs,check-wai-section-refs,check-no-vanity-metrics,test-public-text-checks,check-comparative-prose,check-orphan-sourcescheck-public-names.shon every changed file; commit messages and this body bygrep -EFalsifications (committed first; mutated inside the build host's checkout, restored with
git checkout -- <file>)video-room/index.html:fetch("/room-api/room")→/room-api/rooms,wairebuilt: the test fails (the page's own line counts two present: not within 60000 ms, 2 of 3 checks, exit 1). Restored: 3 of 3, exit 0. (Studio)dx/dev.rs: the origin's/moqupgrade sent to the room service instead of the relay; archive rebuilt;clean-machine.shreportsFAIL the relay's WebSocket binding (moqt-22) (HTTP/1.1 404 Not Found),wai dev: NOT ready … 7 of 8 checks held,dev-check FAILED, stopped there, exit 1. Restored: 8 of 8, exit 0. (Framework)tests/cli_dx.rs, every run): one byte of the object, and one hex digit of the group's signature, each makewai verifyexit 1; the example's Rust and Python verifiers each refuse the same two (content_hash_mismatch,receipt_name_mismatch).waifrom an earlier build;build.shnow fails rather than package one, and checks the packaged templates againstwai/examples/.Verbs, flags and file names introduced (for the toolchain study to adopt or rename)
wai hello [<dir>],wai create <dir> --template <name>,wai create --list [--json],wai dev,wai verify <path>....wai up(the brief's name) was settled aswai dev, the study's name: it says the scope (development, local).helloandverifyare new verbs besideinspect/wrap/unwrap/encode/decode, which are unchanged.wai devflags:--port,--dir,--site,--web,--relay,--room,--publishers,--watch,--watch-ms,--call,--remote,--messaging,--e2ee,--check,--json,--for,--help; environmentWAI_WEB,WAI_RELAY_BIN,WAI_ROOM_BIN.wai devserves:/room-api/,/msg-api/,/moq; its directory.wai/dev/(room-keys.toml,msg-keys.toml,relay.toml,room.toml,conversation.toml,sessions.jsonl, logs).wai.json(project file:template,title,summary,dev.{site,page,mode,publishers,watch,watch_ms,messaging,e2ee});wai-hello/(hello's default output).floor,quickstart. Archive:wai-<version>-<triple>.tar.gz, release tagwai-v<version>, web assetwai-web-<version>.tar.gz; installer environmentWAI_VERSION,WAI_HOME(default~/.wai).Not done
SET-BY-THE-RELEASEdigests and install nothing until the release writes them.wai devon Windows stops its children withkill()rather than a signal.android-appis the sink's Kotlin API on the JVM; an Android application module (the AAR'sWaiPlayerSessionin an Activity) is not in the example, since it needs the Android SDK and NDK to build and was not built here.apple-app's player opens a window and was built, not driven; its test is the headless replay.wai cloud loginandwai deployare not here (not this builder's).wai devruns its relay and room service as child processes; a parent killed by a signal other than Ctrl-C (which reaches the whole process group) leaves them running.Decisions for the owner
wai,wai-rsandwai-cliare taken on crates.io,wai/wai-clion npm, and "WAI" is also the W3C's Web Accessibility Initiative. Proposals: cratewai-media(library) andwaictlorwai-media-cli(command line), npm@transaction-science/wai. The draft formula and manifest are namedwaiin our own tap and bucket, where the name is ours; say if they should bewai-media.wai-v0.3.0to runwai-release.yml, then merge the formula and manifest it attaches into the tap and the bucket in place of the drafts./install.sh.The site branch is
docs-quickstartof wai-transaction-science-web (pushed, not deployed): /docs/, /docs/quickstart/, /docs/examples/, /docs/sdk/, /docs/api/, each with a.mdtwin, /llms.txt indexing them, "Build this" links from the room and cargo demos, /install.sh.DX-B's
wai mcp/wai setup-agentand itsopenapi.jsonare referenced (READMEs,/docs/api/) but are in their PR; both PRs editsrc/bin/wai.rs's usage andmain(), a small merge.🤖 Generated with Claude Code