An open protocol + reference implementation for AI-controlled laboratory instruments ("MCP for lab equipment"): AI agents discover, command, and stream data from scientific instruments, with ed25519-signed run manifests. The repo must stay impressive on GitHub and runnable by a stranger in under 5 minutes with zero hardware (instruments are simulated).
- Python 3.12 (CI also runs 3.13), uv for env/packaging, hatchling build backend
- Protocol: JSON-RPC 2.0 over WebSocket and stdio; capability discovery inspired by MCP; no gRPC in v0.1
- pydantic v2 for message models (approved),
websocketsfor the WS transport - Signing: ed25519 via pynacl (dependency added at M4, not before), RFC 8785 (JCS) canonicalization before signing
- ruff (lint+format), pyright strict, pytest + pytest-asyncio
(
asyncio_mode=auto) - GitHub Actions CI must be green on every milestone commit
- Apache-2.0 (patent grant matters for a standard)
uv workspace monorepo; one distribution per packages/* dir sharing the
labwire.* import namespace (PEP 420):
-
packages/core→labwire-core(M0): server + client SDKs -
packages/sim→labwire-sim(M3): simulated instruments -
packages/drivers→labwire-drivers(M3): drivers speaking native wire protocols (SCPI/TCP, serial-style) against the sims -
packages/cli→labwire-cli(M4):labwireCLI (verify, …) -
packages/mcp→labwire-mcp(M5): MCP adapter -
spec/(M1),examples/(first example lands M2) -
packages/bridges/ophyd→labwire-ophyd: exposes ophyd devices as Labwire instruments (ophyd is an optional dependency; never vendor or fork it)
NEVER create src/labwire/__init__.py, nor
src/labwire/bridges/__init__.py, in any package. Both are PEP 420
namespace directories shared by several
distributions. Only the leaf src/labwire/<subpkg>/__init__.py exists. The uv
workspace lists packages/bridges/* as members and excludes the
packages/bridges grouping directory itself.
Packages/directories are created at the milestone that fills them: no hollow placeholder packages.
- GitHub repo
benchwire/labwireis public (orgbenchwire; released with a fresh single-commit history). Push after every milestone; verify the Actions run is green. - Git identity (repo-local, already configured):
Silous Ramelli <204268110+TheRoboMaster123@users.noreply.github.com>. Never commit with the user's personal email. - The project name "labwire" is a placeholder; the user will rename later.
- Approved M0-M2 plan:
~/.claude/plans/project-labwire-placeholder-delegated-cerf.md
Work M0→M7 strictly in order. Per milestone: one conventional commit
(chore:, docs(spec):, feat(core):, …). After each milestone:
make checkgreen locally- Summarize what exists; list known gaps honestly
- Push; confirm GitHub Actions green before moving on
- Every numeric command parameter needs a UCUM code in
units=, every named numeric result field one inreturns_units=("1"for dimensionless); channels need a non-empty UCUMunit. Violations raiseTypeErrorat declaration time: that is deliberate, do not weaken it. - Every command has a
safety_class(S0-S3, default S1). Costly or irreversible actions are S2, hazardous ones S3; both require aconfirmationon submit. Recovery paths (clearing an interlock, e-stop) are S0 so they stay submittable while interlocked. - The UCUM discipline and the S0-S3 taxonomy come from LAP (arXiv:2606.03755) and MUST keep their credit in SPEC §17 and PRIOR_ART.md.
- Comparisons to other protocols stay factual and never disparaging; LAP in particular gets treated with respect. Never claim LAP compatibility or endorsement.
- TDD where practical: failing test → minimal implementation → green → next
- Coverage ≥85% on
labwire.core, CI-enforced (fail_underin root pyproject); pyright strict and ruff must pass at every commit - Every public API has a docstring with an example (ruff
Drules enforce on src; off for tests/examples) - Simulators are first-class code, never throwaway mocks
- Never claim compatibility with a real vendor instrument model we have not tested against real hardware
- Mark uncertain external claims
TODO-VERIFYinstead of asserting them - PRIOR_ART comparisons (M7) must be honest; credit what we borrow (MCP, SiLA 2, Bluesky/Ophyd, OPC-UA LADS)
- Conformance table in the spec states plainly what the reference implementation does and does not implement
Fleet control plane, web UI, auth/RBAC beyond a stub API key, real hardware drivers, cloud hosting, certification tooling.
- macOS; Python is uv-managed (system python3 is 3.9, never use it);
brew-installed uv ghCLI is authenticated with push access to thebenchwireorgmake setup=uv sync --all-packages(plainuv syncdoes NOT install workspace members: the root ispackage = false)