wintechis/wot-lab: WoT Lab 0.1.0 - virtual WoT devices and benchmark environments
Abstract
First release of WoT Lab, a Bun/TypeScript framework for prototyping virtual W3C Web of Things devices and running reproducible benchmark scenarios against them. Thing Models A Thing is built from a directory: a Thing Description ( .td.json) and an initial state (state.json). Behaviour is optional and comes from either or both of logic.js — imperative handlers with thing, state (a Valtio proxy), http and logging injected; vre:effects annotations on action affordances — declarative effects in the VRE language, compiled into action handlers with snapshot-then-apply semantics, pre/post-state references, action outputs and cross-Thing writes. Without either, property read and write handlers are generated from the TD, so a Thing declared as TD + state is readable, writable and observable over WoT with no code. Every Thing is served by @node-wot/binding-http (default port 8081), with the TD id, the URL path and the internal state key kept identical. Environments and benchmark tasks An environment is a JSON manifest that brings a fixed set of Things online with pinned ids, state overrides, per-instance links and TD annotations. Starts are all-or-nothing, and POST /_lab/reset and POST /_lab/state give between-run reset and initial-condition injection. Seven environments ship with 80 benchmark tasks (request, goal predicates, initial state, optimal plan, graded L0–L5): e-commerce, supply-chain, social-media, smart-home — the four ported scenarios ibm-building3 (2279 Things, 281 rooms, Brick topology) and ibm-building3-small — converted from the IBM Building 3 dataset mosaik — a 37-Thing shopfloor whose plans are computed by a recipe simulator tools/tee2wotlab.py regenerates the converted environments, tools/make_tasks.py writes the task files, and tools/verify_tasks.py replays every claim a task makes against a running lab. tools/run.schema.json defines the run format an agent harness produces. Dashboard A React/Primer dashboard (built by Vite, served by the lab) browses the model catalog, creates and removes Things, inspects TDs and live state, authors new Thing Models, starts environments, and replays runs step by step against a task's goal at /_replay. Lab API /_lab/thing-models, /_lab/things, /_lab/environments, /_lab/reset and /_lab/state. Writes are loopback-only unless WOT_LAB_ALLOW_REMOTE_WRITE=1. Runtime Runs on Bun with no build step for the server; bun run build type-checks, bun run dev -- --env starts a scenario. Licensed under AGPL-3.0.