Skip to main content

Plugin developer SDK

The SDK gives you a small starting point to develop a BenchWeave device plugin with AI: generate, implement, test, review, then prepare a release. Use this guide for SDK installation, project generation, testing and packaging. The device developer guide (main repository) covers device evidence, integration requirements, firmware and qualification.

The device is the hardware. The plugin is its Python integration and descriptor. Follow the developer directory convention: plugins/<manufacturer>/<name>/, with src/<python_package>/ inside that project. The name normally identifies the device model, such as fnirsi/dps150.

The current SDK is benchweave-sdk for Python 3.13+, OTDP 0.2.4 and adapter API 1.1, with registry 0.1.3 schemas. Its source lives in this repository. The main BenchWeave repository mounts it at packages/sdk. Build it separately from the gateway. It supplies structural typing interfaces, offline contract validation, a scripted mock host, bounded async conformance helpers, an external project generator and file-inventory helpers.

1. Install the SDK and generate your project

Install the SDK from PyPI:

# plugin authoring: `new` renders the copier template (issue #347 WS2)
pip install 'benchweave-sdk[scaffold]'
# scaffold-free install (check/conformance/preview only)
pip install benchweave-sdk
# or as an isolated CLI tool
uv tool install benchweave-sdk

For the newest unreleased code, install from the default branch:

pip install git+https://github.com/madeinoz67/benchweave-sdk.git

Full channel list: see the README Installation section.

PyPI is the default install channel: pip install benchweave-sdk or uv pip install benchweave-sdk. Contributors and maintainers can instead build from a checkout of the main BenchWeave repository. Run this from that checkout’s root. packages/sdk is the submodule mount path there, not a directory in this repository:

uv build packages/sdk --out-dir dist/sdk

In your development directory, create an environment. Then install the built wheel from the checkout’s dist/sdk/:

uv venv --python 3.13
source .venv/bin/activate
uv pip install 'dist/sdk/benchweave_sdk-*.whl[scaffold]'
benchweave-sdk new plugins/acme/model100 --package benchweave_acme_model100
cd plugins/acme/model100
uv pip install -e '.[test]'
pytest

Keep the environment that contains the SDK wheel. If you create a new environment inside the project, install the wheel there too. For a repeatable uv lock against a locally built wheel, configure that wheel or your organisation’s package source explicitly.

Run benchweave-sdk doctor from the project to compare the pin with the installed SDK. The command names the recorded version, the installed version, and the reinstall command when they differ. The command works offline and does not fail the run. A stale SDK is a report, not an error.

The generated project also carries .copier-answers.yml at its root: the durable provenance record of which SDK template version produced it (new pins the canonical repository and the matching v<version> template tag — template version == SDK version). The pyproject pin that doctor reads remains a mutable declaration the author may move; the answers file is the record.

Moving a project to a newer template: benchweave-sdk upgrade (from the project root, on a committed and clean git tree) fetches the installed SDK’s released template tag from the canonical repository and applies it — author-owned files (pyproject, README, CLAUDE.md, src/<pkg>/**, tests/**) are preserved byte-for-byte; the managed AI-GUIDE.md moves with the template, and a file you both changed gets conflict markers to resolve and commit. Released template tags only: a development install’s version has no tag and the update refuses with upgrade_tag_missing. Projects scaffolded before the copier port gain provenance with benchweave-sdk adopt — it infers the package name and base version from the generated pyproject.toml (--package / --scaffolded-at override) and refuses a project whose provenance it cannot establish.

The upgrade command reads and writes only two sets of files: the files that git tracks, and the files that the update itself changed. The command does not read ignore rules. The command never reads through a symlink. It never writes through a symlink. On Windows, the command also never reads through a junction. It never writes through a junction. The command does not touch ignored and untracked directories, such as a project virtualenv. It produces no output for them. If a tracked file is a symlink, the command skips the file and prints one notice line.

Replace acme/model100 with your manufacturer and device or plugin name. The destination controls the directory hierarchy. The --package option controls the Python import package. The SDK creates missing parent directories and refuses to overwrite an existing project. A destination that you reach through a symlinked directory is canonicalized before any write. On macOS, /tmp/... is such a symlink. Messages report the real path.

plugins/
└── acme/
    └── model100/                       # Independent build/test/release root
        ├── pyproject.toml
        ├── README.md
        ├── AI-GUIDE.md
        ├── CLAUDE.md                   # Agent notes; root dev tooling
        ├── AGENTS.md                   # SDK-managed agent guide; CLAUDE.md imports it
        ├── .claude/skills/             # Five SDK-managed workflow skills
        ├── src/benchweave_acme_model100/
        │   ├── __init__.py
        │   ├── adapter.py
        │   ├── protocol.py
        │   ├── descriptor.json
        │   ├── protocol.md
        │   ├── vectors.json
        │   └── skills/                 # Seeded agent skills; ship in the wheel
        │       ├── develop-plugin/SKILL.md
        │       └── drive-device/SKILL.md
        └── tests/test_plugin.py

The root also carries AGENTS.md, the SDK-managed agent guide: CLAUDE.md imports it, and benchweave-sdk upgrade refreshes it together with the five workflow skills under .claude/skills/ (benchweave-plugin-workflow, benchweave-descriptor, benchweave-plugin-ui, benchweave-adapter-testing, benchweave-capture). They are repo-level dev tooling outside src/<python_package>/; they never enter the plugin wheel. The seeded package skills inside src/<python_package>/skills/ are different content and do ship in the wheel. If you edit a managed file, the upgrade writes conflict markers; resolve both sides, then commit. A project made before these files existed adds the @AGENTS.md import line to its CLAUDE.md by hand.

Generate the dependency lock and retain it. Add your chosen licence file. When you develop custom firmware, add firmware/ with its own build and tests. The starter does not create these project-specific files. You can copy the manufacturer and name directory into its own external repository unchanged. It has no runtime dependency on BenchWeave core or the SDK. The SDK is a development dependency.

The starter deliberately implements a made-up, read-only identify and voltage protocol. A pass of its tests demonstrates that the tools work. It says nothing about your instrument.

2. Give the AI the facts and prompts

Open the generated AI-GUIDE.md. It contains five copyable prompts: establish device facts, implement with mocks, demonstrate behaviour, prepare independent review, and prepare release artefacts for owner review.

Provide the exact model, firmware, transport, supported operations and authoritative protocol evidence. Review the AI’s proposed scope before you replace the example. The AI should keep the protocol code separate from the async adapter. The AI should use only the supplied scoped host services. The current gateway loader supports package-relative and standard-library imports. Arbitrary third-party runtime dependencies need more integration work.

For custom hardware, follow Build my own device firmware (main repository) as well. Firmware and the Python plugin have separate builds and compatibility evidence, even when you maintain them in one project.

3. Run the checks

From your plugin project, use the environment that contains the SDK:

pytest
benchweave-sdk check src/benchweave_acme_model100/descriptor.json
uv build

Generated tests cover identify and read, quiet lifecycle, invalid inputs, pre-dispatch cancellation and expiry, and uncertain malformed and transport responses. Extend them for your actual operations, failure modes and evidence. check_operation validates request and result schemas and correlation. check_lifecycle checks a quiet lifecycle and repeated cleanup. Both bound cooperative async calls with a configurable wall-clock timeout. Python that blocks, or code that suppresses cancellation, needs process-level isolation.

Descriptor checks currently cover its schema, matching capabilities and policies, unique parameter names, ordered ranges and transport-provider declarations (next subsection). These are partial checks, not all S01–S18, C01–C12 or M01–M14 obligations. The SDK provides no physical transport provider, complete profile or capture test harness, or hardware qualification certificate.

Standards versions: per-pin validation and the served set

The SDK does not validate against “the” OTDP schema. It vendors a multi-version standards tree. It validates every document against its descriptor’s own pinned version. The otdp_version field decides which bytes answer. A 0.2.0-pinned descriptor validates against 0.2.0’s schemas. A 0.2.2-pinned descriptor validates against 0.2.2’s schemas. Neither is reinterpreted through the active version. Explicit otdp/<version>/<file> lookup keys resolve the same way.

standards-lock.json pins what the SDK carries: one row per retained, in-range (id, version), with yanked-in-interval versions carried but marked. The lock also carries a verbatim mirror of the gateway’s dependency_policy block. The mirror holds the declared ranges, yank records and retirements. Every vendored file is sha256-checked against its lock row at load. benchweave-sdk sync-standards --check re-verifies the committed tree, the stamps and the row-marker and mirror agreement offline, with no gateway checkout.

Pin classification follows that state, under stable refusal prefixes:

  • version_not_served: means that this SDK does not carry the pin. The pin is out of the declared range or was never retained here. The refusal carries the five VR-37 fields: standard, pinned version, supported range, nearest move-to and the migration-note pointer.
  • retired_identifier: means that the pin names a retired version. A retired version was used, is now dead, and will never be reissued.
  • A yanked pin is carried and yank-marked. It stays conforming and validates against its own bytes. A deprecation warning names the derived move-to. The move-to is the highest served version. When nothing is served, the declared range’s lower bound is the guidance. When the pin orders above every served version, the move-to is a downgrade. The warning then carries the exact text (a downgrade — no served version is newer). It does not present the move-to as an upgrade path.

Transport providers (custom transports)

A custom transport may declare a pinned transport-provider contract (OTDP 0.2.1). The declaration is an optional provider object on the transport. It carries the required feature_id and an {id, path, sha256} pin to the reviewed contract document inside your plugin package. benchweave-sdk check verifies the whole declaration offline. It refuses with named, machine-matchable prefixes:

  • provider_feature_missing: means that the provider’s feature_id is not in required_features.
  • provider_transport_undeclared: means that an otdp.transport.* feature is required but no provider on the custom transport declares it. It also fires when the provider’s feature_id is not a sanctioned otdp.transport.<name>/<semver> id. Such a declaration is one that nothing admissible can ever back.
  • unknown_otdp_feature: means an otdp.* feature id that is neither corpus-known nor declared through a provider. The namespace is corpus-owned. A typo or a fake version does not pass.
  • provider_contract_missing: means that the pin does not resolve to a contained regular file. Provider pins are descriptor-relative: the contract ships beside your descriptor, and subdirectories are allowed. Provider pins refuse traversal, absolute paths and symlinked components.
  • provider_contract_hash_mismatch: means that the pinned bytes do not hash to the pinned sha256.
  • provider_contract_invalid: means that the pinned document fails one of these checks: the transport-provider contract schema; grammar subschemas that are not valid Draft 2020-12 schemas; kinds that are not unique strings; a kind that shadows a generic transfer kind; identity fields that disagree, including disagreement with the descriptor’s own declaration.

A provider in the wrong place refuses through the ordinary error surface for schema validation. The wrong places are a non-custom transport and the missing adapter integration mode. Provider-object shape faults refuse through the same surface. A custom transport without a provider stays valid. That is the honestly-incomplete posture, not a refusal. The Python entry points behind these checks are validation.validate_transport_provider (contract documents) and validation.verify_provider_pin (pin resolution).

These checks prove the declaration well-formed and self-consistent only. Only the gateway can prove the grant: that your host admitted the pinned contract and that connection_key resolves to a connection it backs. An offline pass is not an admission claim.

Local UI preview (simulated)

benchweave-sdk check-ui and check-preset validate presentation candidates offline. preview-ui previews a plugin project. It serves the standalone host on the scripted mock transport, on loopback only. The command needs the [server] extra. On a default installation, it refuses with benchweave_sdk_server_extras_missing: and exit 2. preview-ui never leaves the mock transport. Every scenario, observation and control receipt is simulated and labelled as such. The preview path has no gateway, registry or hardware reach. The served document’s shape is pinned by plugin-ui-preview-v1 (main repository). The emitter validates it. The renderer_version field of the served document reports the version of the SDK that emitted it. Previews render the manifest’s declared plots and channel hints from per-scenario snapshot values. Each observed target gets one simulated value. Previews do not show observation history.

Three-layer resolution and derive-ui

benchweave-sdk derive-ui <project> builds the presentation set from your descriptor and the vendored class reference for the device’s profile. The command writes ui/manifest.json, presentation.json, binding-catalogue.json, ui/settings/configure.schema.json, the preset scaffolds for configuration slots, and ui/class-reference.json. A manifest that differs from the command’s own last output refuses with derive_ui_dirty_tree:. Move author edits into ui/manifest.overrides.json, or pass --force. A descriptor whose profiles match no vendored class reference refuses with derive_ui_reference:.

Every declared action gets one control plan row during derivation. The row carries a resolution value, and the value names the layer that supplied the action’s catalog side. The value takes one of three forms:

  • Layer 1, catalog: the served OTDP catalog or a pinned vendor catalog describes the action.
  • Layer 2, composed: a pinned composed action class claims the action. The row also carries the class URN and the class’s declared side_effect.
  • Layer 3, custom: no catalog side exists. The row derives from the descriptor’s own input_constraints.

The workflow never refuses an action that no catalog describes, and every rendered action states where it came from. Integrity faults still refuse with their own codes. An unreadable pin, a digest that no longer matches, a schema-invalid document, or a claim conflict each refuses the derivation.

A residual member renders into a section the expander mints, titled Custom device actions, on the device-features page. Catalogued vendor actions stay in the main section, so resolution partitions the two, and they never mix. A page whose layout the reference authors stands as authored. The custom member then surfaces in the plan, the ledger, and the gate report only.

A computed measurement variable derives into the dataset targets as an ordinary value variable. It also derives a plot series when the plot kind admits numeric series. It never derives a reading tile. A reading tile must name a readable parameter, and a computed variable has no parameter. The gate states each target the value derives into, and each target the value does not derive into.

A custom decoder needs no catalog row. Its annotation lanes render in a digital-lanes plot only. A decoder whose lanes no derived plot carries stays disclosed. A channel whose role matches no resolved channel slot stays disclosed too. The verify-ui section below gives the exact rows.

The gateway mirrors this resolution. At serving time a gateway derives the same three layers from the pins in your descriptor. An action that this SDK resolves also resolves on the gateway. The composed action class and the composed member declaration are the same documents that this section describes. The gateway reads the documents those pins name. A residual member renders in the Custom device actions section, unless an authored layout stands.

Author a composed action class

A composed action class is a versioned JSON document. It supplies the catalog side of the derivation for the action URNs it claims. One class can claim many actions. The class names every action URN it presents. It never guesses from names.

The document has six keys:

{
  "contract_version": "0.1.0",
  "urn": "otdp.action.numeric_staging/1.0.0",
  "title": "Numeric staging action",
  "claims": ["acme.set_trigger_position/1.0.0"],
  "input_schema": {
    "type": "object",
    "properties": {
      "stage_level": { "type": "number", "minimum": 0.0, "maximum": 10.0 }
    },
    "required": ["stage_level"]
  },
  "side_effect": "state_change"
}

contract_version is the dialect version, and it stays 0.1.0. It is not the family version, so a family bump does not repin the document. urn is the class’s own identity, for example otdp.action.numeric_staging/1.0.0. title is a short display title.

claims holds 1 to 64 unique action URNs. A claim is any versioned action key: a name, a slash, and a three-part version, such as acme.set_trigger_position/1.0.0. The descriptor puts no pattern on its action keys, and pinned catalogs serve any key shape. The claims pattern stays as permissive as the layers on both sides.

input_schema is a JSON Schema object. It plays the catalog side of the narrowing, and the descriptor’s input_constraints still narrow it. A keyword outside the closed intersection vocabulary refuses with classref_constraint_unsupported:.

side_effect takes one of three values: none, state_change, energy_removing. Over-classification is legal. A class may declare a stronger side effect than the descriptor’s action row. Under-classification refuses. A class that declares none for an action the descriptor declares state_change refuses with classref_composed_side_effect_under:.

A class that declares energy_removing makes its actions energy-removing for the gate. A deviation row that names such an action refuses with classref_deviation_forbidden:.

Conflicts refuse. They never merge. A claim against a served catalog row refuses with classref_composed_claim_conflict:. The same code fires for a claim against a pinned vendor catalog row. It also fires for a claim another class holds, and for one class URN in two pinned documents.

A pinned document is one of three kinds. A document with actions is a vendor catalog. A document with both urn and claims is a composed class. A document with actions together with urn or claims is ambiguous and refuses with classref_invalid_composed_class:. A document with neither shape contributes nothing and discloses on every run. It contributes nothing to check-ui either: no profile row from such a document enters the admission map, so a target that names its profile id reports capability_mismatch until a member declaration carries the row.

An accepted pinned document must own its $id values. A document whose input-schema $id matches a $id the served corpus carries, or a $id another accepted pin carries, refuses with pinned_id_shadow:. The derive and check-ui refuse the same shape with the same code.

Integrity checks run before any shape discrimination. An unreadable file refuses with classref_vendor_catalog_unreadable:. Bytes that do not match the pin’s sha256 refuse with classref_vendor_catalog_digest_mismatch:. A document that is not a JSON object, or whose actions is not an object, refuses with classref_vendor_catalog_invalid:.

Put the document in the plugin package, beside the descriptor. Pin it in descriptor.json under contracts[] with a non-urn:otdp: id, a path relative to the descriptor, and the sha256 of the file bytes:

{
  "id": "urn:acme:composed-staging:1.0.0",
  "path": "composed-staging.json",
  "sha256": "3f8a2c91d47e5b06a1f8c3d7e2b94506c8d1f7a2b3c4d5e6f708192a3b4c5d6e"
}

The derivation resolves the path relative to the descriptor. The file must be a regular file, and no path component may be a symlink. A claim that names no action the descriptor declares applies nowhere. The gate discloses such a class every run, and the ledger does not count it.

Author a composed member declaration

A composed member declaration is a versioned JSON document. It supplies the placement side of the derivation that the served class reference does not carry. The class reference authors the slots and pages. The member declaration adds one slot for each member and the page that hosts the slot.

The document is a pinned project document. Put it in the plugin package, beside the descriptor. Pin it in descriptor.json under contracts[]. The pin row carries a non-urn:otdp: id, a path relative to the descriptor, and the sha256 of the file bytes. The pin has the same shape as the pin of a composed action class. The section “Author a composed action class” above gives the pin row.

The document has three keys:

Key What it carries
contract_version The dialect version of this document. The schema fixes the value. The value is not the class-reference family version, so a family bump does not change the document.
members One to 64 member rows. The array is required.
profiles One optional vendor profile row. The array holds exactly one row when it is present.

A member row has a slot, a kind and a page. The page must name an existing page of the class reference. The slot names the new slot key. Four kinds take a slot:

  • channels adds a channels slot. The row also carries where_role. The optional key is id. The optional label is label. The member applies when a declared channel carries the role.
  • dataset adds a dataset slot. The row also carries claims. The row can also carry plot.
  • configuration adds a configuration slot. The row also carries claims.
  • procedure adds a procedure slot. The row also carries claims.

A dataset, configuration or procedure member also carries claims, an array of one to 64 action URNs. The descriptor must declare the claim. An action member also needs the vendor profile row in the same document. A configuration or procedure member also needs a served catalog or a pinned vendor catalog to describe the claimed action. The vendor profile row names the profile that the composed target uses. It does not supply the action input schema.

A dataset member does not need a catalog row: its target carries the descriptor’s pinned measurement contract. The member table below gives the fields each kind accepts.

Field channels dataset configuration procedure
slot required required required required
kind required required required required
page required required required required
where_role optional - - -
claims - required required required
plot - optional - -
schema_source - optional optional optional
host_supplied - optional optional optional
when_declared - optional optional optional

A channels member with no where_role applies nowhere. It discloses as an applied-nowhere row. It does not refuse.

The schema admits schema_source, host_supplied and when_declared on every action kind. The derivation copies them into the composed slot.

A plot block carries a kind and an over_slot. The kind is digital_lanes, time_series or waveform. The over_slot must name the member’s own slot. A time_series or waveform plot also carries series with the value numeric_variables. A digital_lanes plot can carry group_size, group_label_pattern and group_radix. The plot kind decides the shape of the dataset variables.

The vendor profile row makes the composed target admissible. The row carries id, title, channel_roles, required_actions and optional_actions. The descriptor claims the row by listing the profile id in its profiles[] array. The descriptor profiles[] accepts any profile id. A composed action target names this profile id, so the canonical validator admits it.

Every closed set in the document comes from a document that already ships it. The member kinds, the channel fields and the action fields come from the class reference’s slot vocabulary. The page id shape and the plot block come from the class reference’s page template. The claim pattern and the profile row shape come from the composed action class and the device profile catalog.

Conflicts refuse. They never merge. These refusals can stop the derivation:

  • A slot key that a reference slot or another member already uses refuses with classref_composed_slot_conflict:.
  • A claim that a reference slot, another member or a composed action class already holds refuses with classref_composed_slot_conflict:.
  • A page that names no existing page refuses with classref_composed_slot_conflict:.
  • A plot.over_slot that names another slot refuses with classref_composed_plot_slot_mismatch:.
  • A member plot whose kind the page cannot host refuses with classref_composed_plot_page_mismatch:. A readings page hosts a time-series plot only.
  • A document with keys from more than one pin shape refuses with classref_invalid_composed_class:. A member document carries members alone.
  • A document that fails the member-declaration schema refuses with classref_invalid_member_declaration:. The same code stops an applied action member whose document carries no vendor profile row.
  • An action member whose claim no served catalog or pinned vendor catalog describes refuses with classref_unknown_action:. This rule covers the configuration and procedure kinds. A dataset member is exempt, because its target carries the measurement contract.
  • A member id that the derivation already owns on a readings page refuses with classref_composed_slot_conflict:.
  • An unreadable pin refuses with classref_vendor_catalog_unreadable:. A digest that does not match refuses with classref_vendor_catalog_digest_mismatch:. A pin that is not a JSON object refuses with classref_vendor_catalog_invalid:.

A member that applies nowhere composes nothing. A malformed declaration still refuses, whether or not the member applies. The shape, self-reference, page and conflict refusals over the declaration itself cover every declared member. Three refusals need the composed surface and therefore depend on the member’s application: the vendor profile row, the claimed action’s catalogue entry and the derived-id collision. The gate discloses a member that applies nowhere. The verify-ui section below gives the disclosure rows.

The composed member surface is not an admission claim. A clean derivation proves the declaration well-formed and self-consistent only.

The conformance ledger (ui/class-reference.json)

derive-ui writes ui/class-reference.json when the project’s profile has a vendored class reference. The file is the project’s conformance record. You can edit its rows. The upgrade command and migrate-ui both read the file.

The document carries these keys:

Key What it records
contract_version, reference_version The class-reference family version the derivation used.
profile_ids The profiles the derivation followed.
deviations One row per declared divergence: expectation_id and reason.
custom_actions One row per residual member: action, resolution, and reason.
composed_actions One row per composed member: action, resolution, and class.
composed_classes One row per applied class: class and validated_against.
composed_members One row per applied member, keyed by vocabulary: procedures, settings, datasets and channels. A channels row carries slot, page and where_role. An action row carries slot, page and action. A dataset row can also carry plot_kind.

At birth the derivation fills deviations with three kinds of row. An intended control that derives at a different level gets one row. A configuration surface with no commissioned presets gets one row. A catalogued member that derives no control gets one row.

The deviation vocabulary refuses an unknown id with classref_unknown_expectation:. A deviation row that names an action in the abort class refuses with classref_deviation_forbidden:. The same refusal applies to an action whose class declares energy_removing.

The ledger records the classes the derivation applied. A pinned class whose claims name no action the descriptor declares applies nowhere. It stays out of composed_classes, and the gate discloses it every run.

The ledger also records the composed members that the derivation applied. A member that applies nowhere stays out of composed_members. The gate discloses it every run. The gate compares the authored inventory with the derived inventory in both directions and for each member slot. The gate reports a row that names the right slot with the wrong mapping.

No schema governs the whole key set. Only the deviation vocabulary is validated. The gate reports a row that disagrees with the derivation, and migrate-ui refuses a drifted ledger.

What verify-ui reports

benchweave-sdk verify-ui <project> renders the project’s pages through the standalone host, counts the served components, and asserts the expectation, the coverage arm, and the ledger. The command needs the [server] extra. On a default installation it refuses with benchweave_sdk_server_extras_missing: and exit 2.

The report has two channels. Findings fail the run. The command prints classref_gate_* codes and exits non-zero. Reported rows are disclosures. The command prints one reported deviation: line per row, and a run with disclosures only stays clean.

These rows are disclosures, not failures:

Row Meaning
custom: <urn> A residual member, and its controls rendered.
custom, renders nothing: <urn> A residual member with no rendered control. Nothing derives for it, or the page’s layout stands as authored.
a declared id A declared deviation. The gate reports it instead of failing.
custom mismatch: ... The ledger’s custom_actions disagrees with the derived set, in either direction.
composed mismatch: ... The ledger’s composed_actions or composed_classes disagrees with the derived set, in either direction, or names the wrong class for an action.
pinned document <path> contributed nothing A pinned document matched neither a vendor catalog nor a composed class.
composed class <urn> is pinned (<path>) but its claims name no action this descriptor declares An unapplied class.
pinned document <path> contributed nothing (its vendor-catalog actions map is empty) A catalog pin that declares no actions.
custom inventory unavailable: ... and composed inventory unavailable: ... A project with no class reference has no ledger to read.
observation variable <id>: computed variable derives into dataset variables (no tile; no parameter to read) A computed measurement the descriptor declares. The value derives into the variable set of the dataset target. The computed variable appears in the plot series when the plot kind admits it. It never derives a reading tile, because a tile must name a readable parameter and a computed variable has none.
observation variable <id>: id collides with a dataset variable on <targets>; no tile (no parameter to read) The computed id is the same as a variable that the dataset already carries. The host drops the value from that target. The row names the id and the target.
observation variable <id>: id collides with a dataset variable on <targets>; derives into N of M dataset targets (no tile; no parameter to read) The computed id collides on some dataset targets. The value derives into the other dataset targets. The row gives the number of targets that derive and the total number of targets.
observation variable <id>: computed variable derives into dataset variables (no tile; no parameter to read); no plot series on <target> (the plot's y admits 16 numeric series) The value stays in the dataset target. The plot leaves it out because the plot series count is at its limit. The row names the target and the series limit.
observation variable <id>: computes no dataset variable (no dataset target derives); no tile (no parameter to read) No dataset target derives the value. The host computes no variable for the id.
channel <id> (role <role>): resolves to no lanes surface A channel whose role matches no channel slot the derivation resolves lanes for. The channel derives no lane. A channel that resolves is not disclosed.
custom decoder <id>: no lane host (this class's plot is <kind>; lanes host in digital_lanes plots alone) A pinned decoder that no derived plot renders. A decoder whose lanes land is not disclosed.
composed member declaration <pin> applied nowhere A pinned member declaration whose members apply nowhere. No member matched a declared action or a declared channel role.
composed member declaration <pin> member <slot> applied nowhere (its claims name no action this descriptor declares) One action member inside a pin that applied. This member applies nowhere, so it composes nothing.
composed member declaration <pin> member <slot> applied nowhere (no declared channel carries role <role>) One channels member inside a pin that applied. No declared channel carries its role.
composed plot <slot>: page <page> admits no plot (plots render on dataset and readings pages alone) A member plot on a page that hosts no plot. The member derives no plot.
composed dataset <slot>: no plot carries its binding (the plot on page <page> binds <over_slot>) A dataset member whose page plot binds another slot. The member derives no plot.
composed lane <id> (role <role>): no lane surface on page <page> (the page's channels slots join to <n> lanes; the plot's y admits 64) A joined lane set above the plot limit. The plot drops the overflow lane. The row names it.
composed members mismatch: ... The ledger’s composed_members inventory disagrees with the derived inventory in either direction. The row also reports a member slot with the wrong mapping.

A residual-member row names one member. A computed measurement discloses on every run. A channel discloses only when no resolved channel slot takes its role. A decoder discloses only when no derived plot carries a lane for it. A built lane is not a rendered lane. Lanes land in a digital-lanes plot alone. In the reference-less arm every declared channel and every declared decoder discloses, because that path resolves no slot and derives no lanes at all.

A disclosure row never fails the run by itself. A residual member still fails the coverage arm when the derivation minted its controls and the render lacks them.

Standalone development loop (composed UIs)

You can author, derive and preview a composed user interface with no gateway. The workflow is offline after the installation. The loop has 7 steps.

  1. Install the SDK with the server and scaffold extras. The [server] extra supplies the preview host. The [scaffold] extra supplies the project template.

    uv pip install 'benchweave-sdk[server,scaffold]'
  2. Create a project with the optional UI resources.

    benchweave-sdk new acme-widget --package acme_widget_plugin --with-ui

    Pass --provider-transport instead for a plugin that declares a transport provider: the scaffold pins the banked FTDI control contract inside the package, emits provider-shaped builders and adapter, and writes a provider-dialect vectors.json. The mock transport rehearses the bring-up conversation from that corpus at the transaction boundary. The generated test suite also runs the shipped driver double, which proves the executor path one boundary down. The section “Live FTDI transport (provider control)” below states the serve and record commands.

  3. Write the composed action class document in the plugin package, beside the descriptor. The section “Author a composed action class” above gives the document shape. A composed member declaration uses the same pin seam. The section “Author a composed member declaration” above gives that document shape.

  4. Pin the document in descriptor.json under contracts[]. The pin gives an id, a path relative to the descriptor, and the sha256 of the file bytes. The same section gives the row shape. The digest is the digest of the current bytes. Update the pin after each edit of the document. A pin that does not match the bytes refuses the derivation with classref_vendor_catalog_digest_mismatch:.

  5. Derive the presentation set.

    benchweave-sdk derive-ui acme-widget
  6. Run the rendered gate.

    benchweave-sdk verify-ui acme-widget
  7. Serve the preview.

    benchweave-sdk preview-ui acme-widget --no-open

    The command prints the serve URL and the bearer token. Open the URL in a browser.

The loop shows these results. After step 5, ui/class-reference.json records one row for each composed action, one row for each residual member and one row for each applied composed member. After step 6, the command prints Rendered gate clean. It also prints one reported deviation: line for each residual member and for each declared deviation. The served device-features page shows the composed control. The control takes its fields from the class’s input_schema. The page also shows the Custom device actions section for the residual members.

The preview host pins the mock transport. Every value on the page is simulated, and the page labels each one. The loop never admits a plugin. It never operates hardware.

Contract-version migration (migrate-ui)

The three presentation documents (presentation.json, ui/manifest.json, binding-catalogue.json) carry a contract_version stamp. The SDK writes this stamp when it generates the documents. The stamp comes from the lock’s active plugin-ui version. A new SDK release can move the active version. The upgrade command refreshes the template only. It does not write into src/. The artifacts then keep the stamp of the SDK that made them. A project in this state fails check-ui and the generated preview test with unsupported_version.

benchweave-sdk migrate-ui repairs this state. The command takes the same arguments as check-ui. It makes four writes: the three plugin-ui documents and the class-reference ledger ui/class-reference.json. For the three documents it changes only the version stamp and the envelope’s manifest hash. For the ledger it changes only the three family stamps. Your formatting and your content stay as bytes. The command validates the re-stamped set before it writes any file. A set that does not validate is refused. Nothing is written then. The command writes the files one at a time. It does not lock the project tree. Use your version control to review the change and to undo it. The command refuses with two families of named prefixes. The migrate_ui_* family covers the version motion:

  • migrate_ui_ahead: means that a document carries a version above this SDK’s active version. Install the newer SDK that serves that version. The command never writes a version down.
  • migrate_ui_version_absent: means that a document does not parse, or has no version-shaped contract_version.
  • migrate_ui_stamp_unlocatable: means that the version value parses, but the command cannot find its byte pattern in the file. The command does not re-write the document.
  • migrate_ui_invalid_after_stamp: means that the re-stamped set fails validation. The findings name changes that the re-stamp does not make. A changed descriptor needs re-derivation, not migration.
  • migrate_ui_composed_unresolved: means that a ledger-named composed action class cannot be resolved again. The pin is missing, the digest moved, the class urn does not match, or the document does not validate under the active class-reference version. Nothing is written.
  • migrate_ui_ledger_drift: means that the ui/class-reference.json inventories do not agree with the descriptor and its pins. Re-derive the project with benchweave-sdk derive-ui --force. A version write cannot repair this state.

The second family is classref_*, from the resolution walk. The ledger motion reads the pinned documents again. A pin that is unreadable, a pin whose bytes are not a JSON object, a pin whose actions map is not a JSON object, or a pin whose digest does not verify, refuses with a classref_* code (classref_vendor_catalog_unreadable:, classref_vendor_catalog_invalid:, classref_vendor_catalog_digest_mismatch:). Nothing is written when this happens.

When all three documents and the ledger already carry the active versions, the command is a no-op. It exits 0. This makes it safe in scripts and CI.

Two surfaces point at the command. check-ui adds a remediation line when a finding has code unsupported_version on one of the three documents. upgrade prints a notice when the artifacts are behind the active version. The notice tells you to run migrate-ui after you commit the upgrade.

Migration is not re-derivation. migrate-ui keeps your manifest content. It does not derive pages or plots from the descriptor. For that path, use benchweave-sdk derive-ui. A class-conformant project also carries ui/class-reference.json. The command re-stamps this file’s contract_version and reference_version stamps to the active class-reference version. It also re-stamps each composed_classes[].validated_against record. It does this only after it resolves each named class from its pin and validates the document under the active version. The class urn keeps its own version. The command never writes content. Author overlays survive in ui/manifest.overrides.json.

The command also reads the ledger’s composed_members inventory. The inventory must agree with the members that the derivation applied, in both directions and for each member slot. An inventory that disagrees refuses with migrate_ui_ledger_drift:.

The command does not rewrite a member declaration across a family bump. The declaration carries its own dialect version. The schema keeps that version across a family bump. The command reads the dialect and names both versions when they disagree. A declaration above the active dialect refuses with migrate_ui_ahead:. The active dialect above the declaration refuses with migrate_ui_ahead: too, because the command does not write the declaration. A declaration with no version-shaped dialect refuses with migrate_ui_version_absent:.

derive-ui writes ui/manifest.json from the descriptor. A ui/manifest.json that records another descriptor’s digest is stale, and the command replaces it. It refuses without --force only when the file records this descriptor’s digest and still differs (author drift), or when it records no digest at all — there a descriptor change cannot be told from author edits. Put author edits in ui/manifest.overrides.json.

Refresh the example fixtures (regen-fixtures)

The scaffold writes two example preview fixtures into ui/fixtures/. The files are normal.json and warning.json. The examples are generated synthetic content. They are a valid, copyable format model. They are also the input that makes the scaffolded project test exercise the fixture loader.

benchweave-sdk regen-fixtures <project> writes the two examples again. The command takes the project root as its only argument. It uses the same generator as the scaffold.

The example fixtures go stale on two axes. On the first axis, you edit the descriptor or the binding catalogue. A target id, unit or type moves. The project’s own test then fails with preview_unknown_binding:, preview_unit_mismatch: or preview_type_mismatch:.

On the second axis, a plugin-ui-preview contract bump moves the active version. The fixture schema pins contract_version as a const. Older fixtures then fail preview_invalid_fixture: until a re-stamp. A single run of the command rewrites both files at the lock’s active plugin-ui-preview version.

The command is idempotent. It does not rewrite bytes that are already current. A run with nothing to do is a no-op. It exits 0. This makes the command safe in scripts and CI.

The command keeps author content safe. The two example ids are example-normal and example-warning. A file at an example filename whose scenario id is one of these ids is an example. A file at an example filename with any other scenario id is author content. When the command writes the file again, it discards edits that keep an example id.

The command refuses an author-content file and writes nothing. The command writes both files or neither file. The command writes the files through staged temporary files, and it does not lock the project tree. Use your version control to review the change and to undo it. The command never touches any other *.json in the directory. Put author scenarios at their own ids.

The command refuses with named prefixes:

  • regen_fixtures_author_content: means that an example filename holds author content. The command writes nothing.
  • regen_fixtures_unreadable_example: means that the command could not open a file at an example filename. The command did not judge the file, and it writes nothing.
  • regen_fixtures_id_collision: means that another fixture file already carries an example id (example-normal or example-warning). If the command writes the example at its own name, a duplicate exists. The command refuses and names the colliding file. Delete the copy or give it its own id.
  • regen_fixtures_no_package: means that the project has no package under src/.
  • regen_fixtures_no_catalogue: means that the project has no binding-catalogue.json.
  • regen_fixtures_no_observation_target: means that the catalogue declares no observation target.
  • regen_fixtures_invalid_generated: means that an internally generated document failed validation. This is an internal guard, and the command writes nothing.
  • regen_fixtures_write_failed: means that the command could not write the staged files. The command writes nothing when staging fails in the fixtures directory.

A project can have no ui/fixtures/ directory. A class-reference derived project is an example. The scaffold’s classref path writes no examples. The command then creates the directory and writes the two examples. The author decides whether to wire the examples into project tests.

Regeneration is not admission, qualification or approval to operate hardware.

For real hardware, use benchweave-sdk-server serve --transport serial directly. The command starts without a device path. Scan from the index page, then bind one listed port with its Bind button. Bind and Unbind need the operator action token. serve prints this token at startup. The launch URL carries it. The command also writes it to operator-action-token.json under the capture root. The binding is stored in device-bindings.json under the working directory. Name another file with --bindings <path> or BENCHWEAVE_STANDALONE_BINDINGS. The stored binding survives a restart: the next serve connects to the bound port without a device path. A connect refuses not_ready with reason binding_stale when the bound port is gone. The device page shows a re-pick action beside this refusal. A bind also refuses when the picked port is no longer present, or when the port now carries a different USB serial than the scan recorded. Scan again, then pick one of the listed ports. A connect also refuses when the unit answers the identify request with a different manufacturer or model than the descriptor declares. The session stays closed. Pass --device <path> for the headless form. The host then serves that constant path. The bindings file is still opened and validated at startup. The stored binding is not consulted to resolve the endpoint in this form. The pick flow in the UI can still write the file.

The SDK’s runtime dependencies are Click, jsonschema (with the referencing, rfc3339-validator and rfc3987 format backends) and Rich. This repository’s pyproject.toml declares them all. In a main-checkout layout, the file is at packages/sdk/pyproject.toml. The wheel vendors the canonical contract JSONs and the pure presentation validator.

Operational notes: preview-ui is an interactive tool. It serves until you interrupt it, by design. It exits 0 on SIGINT as a normal stop. The default port is 8477. Pass --port to change it.

Caution

Under the explicitly acknowledged --allow-network mode, request bodies have no handler timeout. Only untrusted peers are affected. Do not expose the preview to untrusted peers.

The plugin stylesheet override (preview.css)

A plugin can declare a local stylesheet override for its preview pages. The manifest declares an assets[] row whose path is exactly preview.css. The row also declares the file’s sha256.

The manifest row. Add an assets[] row to the manifest. Give path the value preview.css. The value must be exactly preview.css. Give sha256 the digest of the file bytes. Put the file in the plugin’s resource directory.

{
  "assets": [
    { "path": "preview.css", "sha256": "5f2a9c8e1b7d4f6a0c3e9d2b8a7f1e4c6d5b3a9f0e8c7d6b5a4f3e2d1c0b9a87" }
  ]
}

The serve-time checks. At serve time the host checks the file bytes against the row’s sha256. The file can be 64 KiB at most. The host serves it as text/css. The override loads last on your plugin’s preview pages. The gateway never serves a plugin stylesheet override.

The refusal. If the bytes do not match the pin, the host refuses the override. The page renders with the default tokens and carries the marker attribute data-bw-override-refused on the html element. A direct fetch of the file returns 403 with the prefix standalone_preview_override_refused:. A fetch when the manifest declares no override returns 404. The host also refuses an unreadable file or a file above the cap.

The cascade. The override wins at equal CSS specificity, because it loads last. The host rules for the lanes figure sit at specificity (0,2,0). An example selector is .bw-lanes__segment[data-bw-state-kind="high"]. To change such a rule, an override must copy the exact selector. The reduced-motion rules are an accessibility floor. They carry !important, and an override cannot reach them.

The theme. The preview uses the system color scheme, and it renders light and dark. The behavior is the same as the gateway console.

The capture page. A page that carries a digital_lanes plot leads with the lane traces. The reading tiles sit below as the secondary surface. A page without a lanes plot keeps the tile-first layout.

The lanes figure today. The figure shows the declared structure only. The acquisition line shows Acquired 0 samples · plotted 0. A channel hint visible: false hides that lane in the preview. The preview fixtures carry no capture data yet, so the viewport toolbar does not appear today. A later release will add capture data to the preview fixtures, and the toolbar will then appear. The paragraphs below describe these controls.

The viewport toolbar. A lanes figure over a capture with samples carries a viewport toolbar below it. The toolbar holds the controls ◀, Full, Zoom ×½ and ▶. The server computes the window for each control. The ◀ and ▶ controls move the shown window back or forward by half its size. The Zoom ×½ control shows the middle half of the shown window. The Full control shows the whole capture again.

The rendered controls. The ◀, ▶ and Zoom ×½ controls do not render when their action has no effect. The Full control always renders. A capture without samples renders no toolbar at all.

The window swap. Each toolbar control asks the server for a window of the capture. The request carries two parameters, from and to. Both parameters are absolute sample indices, and sample 0 is the first sample of the capture. The server renders the same lanes against the requested window. The browser then replaces the whole viewport block, figure and toolbar, with the served block. The page refreshes its readings on its own, and a refresh never touches the lanes region.

The served window. The server clamps a requested window into the capture. A request before sample 0 clamps to sample 0, and a request beyond the last sample clamps to the last sample. The served block carries the served window in data-bw-window, which names the first and the last shown sample. The axis label names the served sample span, for example samples 500–999. The acquisition line reports the counts of the shown window. The block also carries the marker data-bw-window-clamped when the served window differs from the request.

The viewport refusal. The server refuses a window request that it cannot serve. The refusal returns status 400, and its body starts with viewport_window_refused:. An empty window or an inverted window refuses. This can happen when the capture changed after the server built the toolbar. The browser then shows a notice in the viewport region. The notice tells the operator to push Full, and the Full control always serves.

Mock transports (offline rehearsal)

The standalone host serves a plugin on a scripted mock transport when you run serve --transport mock or preview-ui. For serve, the mock transport is the default. The script comes from the evidence file of the plugin, src/<package>/vectors.json. The file declares which of the three transaction dialects the adapter uses. The host serves the mock that matches the dialect.

The three dialects. Declare the dialect with the file-level transaction_dialect key. If you omit the key, the file is a stream_exchange script. Every row is a {"request": ..., "response": ...} pair of strings. The mock serves whole-dict exchanges. This is the shape of the starter protocol. The request is ID?\n and the response is one line.

If you declare "transaction_dialect": "send_receive", the rows form a binary section 8.1 SEND/RECEIVE conversation. The strings of each row are frames. The stream_send of the adapter must match the next scripted request frame exactly. The mock serves stream_receive with the exact outcomes of the serial backend. The section “A standalone runtime around the writer” below states these outcomes.

If you declare "transaction_dialect": "provider", the rows carry a provider plugin’s bring-up. Each row is a journal-shaped {"name": ..., "transaction": ..., "response": ...} record: the transaction is a provider control operation of the plugin’s pinned contract, or a section 8.1 stream kind; the payloads spell themselves — hex for stream data, base64 for the grammar’s byte fields. The mock matches each row on the whole transaction and serves the scripted result. A provider plugin that the scaffold emits with --provider-transport carries this dialect, so serve --transport mock rehearses its bring-up with no hardware and no journal.

Which rehearsal to reach for: iterate on the adapter against the mock dialect (the default transport, the fastest loop); prove the executor path with the generated driver-double test (it runs in the emitted suite on every pytest); answer what the device did with a recorded journal on --transport replay; prove the device with --transport ftdi.

Encoding. By default, the bytes of a row are the ASCII bytes of the row string. Set "encoding": "hex" at file level, or on one row, for binary frames. A string is then a hex byte string, for example "response": "53544154000a". The ascii encoding refuses a string that is not ASCII. The hex encoding refuses an odd-length string or a non-hex string. Both refusals give the row.

The row contract. Every row carries a response. A row without request is a response-only row. A response-only row is a device-initiated frame that the mock releases to the inbound stream. The release happens in row order, when the conversation reaches the row. Response-only rows need transaction_dialect: "send_receive". The default dialect cannot contain an unsolicited frame.

A row can also carry a name. Diagnostics refer to a row by its name or by its index.

Evidence. The file can carry an evidence key. The value is "synthetic" or "hardware". An absent key means "synthetic". When the bytes of one row are hand-recorded from the device, put "evidence": "hardware" on that row. That row then carries a recorded object. The recorded object needs a when field, and the when field names the capture moment.

The host refuses a "hardware" claim at file level when no row carries recorded bytes. The host also refuses a row that claims "hardware" without the recorded object. The refusal gives the row.

A file that claims less than it holds does not refuse: a "synthetic" file with one recorded row is accepted.

The check proves that a hardware claim comes with recorded provenance. The check cannot prove that the provenance itself is true. Hand-recorded bytes exist to break a circle: a script your own builder writes proves only that the builder agrees with itself. At least one recorded exchange is the anti-circularity property. Builder-generated vectors cannot supply it. The scaffold seeds "synthetic" evidence and claims nothing.

How selection works. The host reads the declaration at connect time and builds the matching mock host. Nothing else changes. serve --transport serial never reads vectors.json. The script is rehearsal evidence, not device configuration.

Demand order. The mock serves the rows in order. The shipped driver walks the descriptor: identify, then each readable parameter in declaration order. The corpus rows must follow that walk. A corpus that is ordered against another walk rehearses a flow that the host never runs. validate_vectors_walk_order in benchweave_sdk.vectors rehearses the walk over the corpus. It refuses a drift. The refusal names the walk step and the row. The corpus alone cannot say which row serves which parameter. The mapping is plugin code. The rehearsal with the adapter is the check that decides it. A corpus can also carry rows that the walk never reaches. The rehearsal names those rows. It does not ignore them.

How the script loops. The mock detects a repeating unit from the captured rows. The rows before the first full unit are the establishment. The mock serves these rows once. The unit then serves every later cycle in captured order.

A capture needs at least two full units of evidence. A capture with no derivable unit is not an error. Two causes are usual. A truncated capture is one cause. A polled value that varies across occurrences of the same request is another cause. Such a capture then obeys the plain tail rule. Under this rule, row 0 is the establishment. The whole tail becomes the cycle. The cycle repeats in captured order on every restore.

A repeating unit must contain at least one row with a request. A response-only row releases once per cycle pass. A captured burst drains once. Then the line goes quiet. When the adapter consumes a row with a request, the cycle re-arms.

Session continuity bounds the rehearsal. A plugin that enforces strict command-counter continuity can rehearse only as many cycles as its corpus carries. The mock restores the poll cycle from a pristine copy. The recycled rows carry the same counters again. A strict tracker refuses that repeat. A session that runs past the corpus wedges on the mock. The mitigation is the third cycle. Capture three cycles, not two. Two cycles derive the unit. The third leaves the rehearsal one cycle of counter headroom before the rows recycle. Bounding the mock’s cycles to the corpus size keeps a rehearsal inside the recorded counters.

What the mock can and cannot rehearse. The send_receive mock reproduces exactly the RECEIVE outcomes of the serial backend: exact_bytes precedence over termination, the lf and crlf terminators, the overlong-line discard, the quiet-line {"data": b""}, and a partial frame retained across a deadline. The mock releases unsolicited frames strictly in row order. The mock cannot rehearse the interleaving that a real streaming device produces between rows. The mock does not serve can_receive, can_send, i2c_transfer or spi_transfer. A plugin that needs those kinds needs a real transport.

The timings of the mock are not the timings of the device. The quiet line answers at once, not after the quiet window of the backend. A receive that cannot complete raises the TimeoutError of the backend at once. The mock does not wait until the deadline.

For this reason, a rehearsal proves the command flow, not the timing budget. A capture that fits its timeout_ms on the mock proves nothing about the hardware budget. Budget-fit evidence needs --transport serial and the device.

Poll cadence. A device that answers on its own timer needs a paced poll. Declare the poll interval from the device cadence. A declared interval that no loop reads is a defect. The scaffold’s wire module carries paced_poll. The helper owns the wait between attempts, so the loop cannot skip the pace.

A loop that polls faster than the cadence exhausts its attempts before the device becomes ready. The timeout is then false, and only hardware shows it.

The bound, in simple words. The discipline of the mock is exact. When a frame that the adapter SENDs differs from the frame of the scripted row, the rehearsal fails. The failure gives the row and both frames. The mock never guesses what the device meant.

But a script can prove only what its rows record. A script that does not match the real device proves nothing about the device. Use --transport serial and the hardware for interleaving, for non-serial transports, for timing, and for any claim about the device.

Replay transport (recorded evidence)

benchweave-sdk-server serve <project> --transport replay --replay <journal.json> serves a recorded journal. The journal is a JSON document of the exchanges that one hardware session recorded. The mock script comes from the plugin’s own builders. The journal comes from the device session. This difference is the point. A builder that drifts from the recording fails the replay at the first divergent row. A builder-generated script cannot catch that drift, because it is the drift.

What the journal carries. The journal names its provider contract: the feature, the identity, and the sha256 of the pinned contract bytes. The journal loads only when this triple agrees with the contract that the served plugin pins. The recorded block states when the capture started, its source, and whether one owner held the device. The rows carry the transactions in recorded order. Provider transactions are matched on the full transaction. Stream sends are matched on bytes. A send of 4096 bytes or more is recorded as a digest row: data_sha256 plus byte_length. The journal file is refused above 1 MiB. Record bulk sends as digest rows.

Honesty rules. A replay never reports more than its recording. The page banner says REPLAYED RECORDED EXCHANGES · NOT A LIVE DEVICE. Readings and captures take their timestamps at replay time. The start time of the recording is evidence, not an observation. A capture over the replay transport records the journal digest in its sidecar. A row that recorded a timeout replays that timeout. The recording’s no-response stays a no-response.

Exhaustion. The replay restores a repeating unit when the recording proves one: at least two full units, and one command row in the unit. A recording with no derivable unit plays once. A receive past the end then answers the quiet line, or holds a partial frame until the deadline. A transmit past the end fails and names the recording. The host never invents a row.

Use the replay to prove that the plugin still speaks the recorded conversation. Do not use it for timing, and do not use it for any claim about the device. A replay proves what the recording shows.

Live FTDI transport (provider control)

benchweave-sdk-server serve <project> --transport ftdi --device <ftdi-url> serves a plugin over an FTDI-class USB device. The URL is the pyftdi device selector, for example ftdi://::0x0403:0x6001/1. The descriptor’s connection_key stays the logical identity of the device. With --device, the URL is a constant endpoint: the host serves that URL on every connection. Without --device, the serve starts binding-pending. The index page shows the scan button. A scan confirms each FTDI device by its identify answer. The Bind button persists the picked URL in the binding document, and a later serve resolves it on its own. The binding behaves as the serial binding does: it survives a restart, it refuses binding_stale when the bound URL is gone, and bind and unbind need the operator action token.

The plugin must pin the FTDI common control contract in its descriptor. If the plugin declares no provider, serve refuses with live_provider_plugin_unpinned:. If the plugin pins a different contract, serve refuses with live_provider_feature_unsupported:.

Control transactions are the seven operations of the pinned contract: reset_device, set_timeouts, set_latency, set_baud, purge, set_bitmode and read_pins. The host checks each transaction against the pinned grammar before any device call. The host refuses a transaction outside the grammar with live_provider_transaction_grammar:. The host refuses a device answer outside the contract with live_provider_result_grammar:. The host refuses a control transaction during a parked receive with live_provider_line_busy:.

The generic stream kinds of section 8.1 use the same data pipe on the device. Send and receive behave as they do on the serial backend.

The transport needs the server extra. Without pyftdi, serve refuses with live_provider_backend_missing:. With no device at the URL, connect refuses with live_provider_device_unavailable: and names the exception class. Each connect is one attempt, with no retry. An explicit scan enumerates the FTDI devices and confirms each by identify. When pyftdi is absent, the scan refuses with live_provider_enumeration_failed:.

Other refusals the transport can answer with: a capture start on services that lack the capture members refuses with capture_services_incomplete: naming the missing members; a live recording whose journal could not be written warns with live_provider_record_write: and never blocks the device close; a provider-dialect vectors corpus refuses its own load problems with the standalone_vectors_provider_* and standalone_vectors_dialect_unknown prefixes (the mock-transports section above states the provider dialect).

Pass --record <path> with --transport ftdi to record the live session as a replay journal. The host refuses --record on every other transport. The host writes the journal when the session closes. Each row records one completed exchange that the device made. A receive that does not complete before its deadline records a timeout row, and a transaction that the host refused records no row. The recorded journal replays with --transport replay, so a bench session produces replay evidence directly.

The SDK test suite drives its scripted driver double from the synthetic bring-up journal, and the replay transport validates the same journal. Rehearse a control plugin against its journal with --transport replay. Use --transport ftdi on a real bench to prove the device itself. The live-device acceptance is not complete.

Capture without a gateway (standalone writer)

Plugin and bench development happens on machines that never run the gateway. benchweave_sdk.capture.StandaloneCaptureWriter implements the three capture methods that an adapter calls in gateway mode: artifact_append, artifact_finalise and artifact_abort. The writer works over one directory per capture on a local filesystem. It is three of the ten CaptureServices members. The host also demands two host-lifecycle members at capture start: configure_capture and capture_progress. The CaptureServices protocol in benchweave_sdk.interfaces declares both beside the artifact methods. Device I/O still comes from a transport that a composing runtime supplies.

from benchweave_sdk.capture import StandaloneCaptureWriter

writer = StandaloneCaptureWriter()          # or StandaloneCaptureWriter(some_path)
await writer.artifact_append("cap-demo-1", chunk, context)
manifest = await writer.artifact_finalise("cap-demo-1", {
    "format": "waveform_f64le",
    "started_at": "2026-09-22T00:00:00Z",
    "sample_count": 1024, "sample_interval_s": 0.001, "unit": "V",
}, context)

The capture root is an explicit constructor argument. Next comes the BENCHWEAVE_CAPTURE_DIR environment variable. Last comes captures/ under the current working directory. A relative root resolves against the working directory when you construct the writer.

The writer refuses a root inside the installed package tree. A reinstall or upgrade wipes such a root, and the SDK’s inventory verification refuses unlisted files. The writer also refuses a BENCHWEAVE_CAPTURE_DIR that is set but empty or whitespace-only. It also refuses a root that exists but is not a directory.

Caution

A reinstall or an upgrade deletes a capture root inside the installed package tree. Do not put the capture root there.

Each capture event is one directory. The directory holds manifest.json, a staging/ tree while chunks accumulate, the primary artefact, and an optional renderings/ tree that the plugin writes itself. The primary artefact name depends on the format: <capture_id>.f64 for waveform_f64le, .bin for raw_binary, .csv, .txt or .vcd for declared extension formats, and .data otherwise.

The manifest’s sha256, byte_length and artifact_id (art-<sha256>) are computed over the real published bytes. Standalone extras live under x-standalone-* keys. The finalise format must be in the constructor’s declared set. The set comes from formats=, and it holds the two core formats by default. An empty set refuses everything. The writer refuses a capture that appended nothing. It does not publish an empty capture. It also refuses a waveform_f64le capture whose byte length is not sample_count × 8, as the gateway refuses that too. An abort deletes only staging/ and the in-flight primary. A published capture and renderings/ survive an unconditional finally-cleanup abort.

Standalone does not apply the gateway’s two host-side admission checks: the descriptor’s capture_limits (G2) and the host’s storage quota (G3). A capture that finalises standalone can still be refused by a gateway.

There is no automatic import of standalone captures into the gateway. Ingest is a separate, deliberate path.

A standalone runtime around the writer (worked example)

The writer is three of the ten members. A bench script that drives an adapter without a gateway needs the other seven as well: clocks, evidence, the transport, and the two host-lifecycle members. The example below is one complete CaptureServices object for a device on a serial port. A contributor fork of the ADC board wrote a serial host for the same purpose, and this example is adapted from it.

It implements the three scoped stream transactions of OTDP §8.1 exactly. It adds one behaviour that the spec leaves unspecified: the quiet-line answer below. The transactions are stream_send, stream_receive and stream_exchange. In them, exact_bytes takes precedence over termination. Only lf and crlf terminators exist here, because serial has no eom. Unspecified fields are refused. An incomplete frame is never returned as complete.

A receive that sees no bytes at all for a short quiet window answers {"data": b""}. Nothing was offered. Adapters read that as a quiet line, not as an error. The DPS-150 plugin’s telemetry drain ends on exactly that answer. Once a frame starts, it is only ever returned whole. Bytes already read when a deadline expires stay buffered for the next receive, so a slow reply is not lost.

The capture methods delegate to StandaloneCaptureWriter. This is author-side tooling, not an SDK module. Copy it into your project and adapt it.

import asyncio
import json
import time
from datetime import UTC, datetime
from pathlib import Path
from typing import Any

from benchweave_sdk.capture import StandaloneCaptureWriter

_TERMINATORS = {"lf": b"\n", "crlf": b"\r\n"}
_RECEIVE = {"max_bytes", "termination", "exact_bytes"}
_FIELDS = {
    "stream_send": {"kind", "data"},
    "stream_receive": {"kind"} | _RECEIVE,
    "stream_exchange": {"kind", "data"} | _RECEIVE,
}


class BenchContext:
    """A minimal OperationContext for bench use: identity, deadline, cancellation."""

    def __init__(self, operation_id: str, timeout_s: float,
                 dataset_id: str | None = None) -> None:
        self.operation_id = operation_id
        self.dataset_id = dataset_id
        self.deadline_monotonic = time.monotonic() + timeout_s
        self.dispatched = False
        self._cancelled = False

    def cancel(self) -> None:
        self._cancelled = True

    def is_cancelled(self) -> bool:
        return self._cancelled

    async def mark_dispatch_started(self) -> None:
        self.dispatched = True


class SerialStandaloneHost:
    """All ten CaptureServices members over one serial port, without a gateway.

    ``port`` is anything with pyserial's ``write(bytes)``, ``read(size) -> bytes``
    (returning early on the port's own short timeout, which bounds how quickly a
    deadline or cancellation is noticed) and ``close()``. ``quiet_s`` is how long
    a receive waits for its first byte before answering that nothing was offered.
    """

    def __init__(self, port: Any, *, writer: Any = None, evidence_path: Path | None = None,
                 max_frame_bytes: int = 4096, quiet_s: float = 0.1) -> None:
        self._port = port
        self._writer = writer if writer is not None else StandaloneCaptureWriter()
        self._evidence_path = evidence_path
        self._max_frame = max_frame_bytes
        self._quiet_s = quiet_s
        self._pending = bytearray()  # read from the port, not yet returned
        self._closed = False
        self._capture_bytes: dict[str, int] = {}
        self.evidence: list[dict[str, Any]] = []

    # clocks
    def monotonic(self) -> float:
        return time.monotonic()

    def utc_now(self) -> str:
        return datetime.now(UTC).isoformat(timespec="milliseconds").replace("+00:00", "Z")

    # transport (OTDP section 8.1 stream transactions)
    def _live(self, context: Any) -> None:
        if context.is_cancelled() or self.monotonic() >= context.deadline_monotonic:
            raise TimeoutError("operation cancelled or expired")
        if self._closed:
            raise ConnectionError("serial port is closed")

    async def transfer(self, transaction: dict[str, Any], context: Any) -> dict[str, Any]:
        kind = transaction.get("kind")
        if kind not in _FIELDS or set(transaction) != _FIELDS[kind]:
            raise ValueError(f"not a section 8.1 stream transaction: {sorted(transaction)}")
        receive = None
        if kind != "stream_send":
            receive = self._receive_bounds(transaction)
        if kind != "stream_receive" and not isinstance(transaction["data"], bytes):
            raise ValueError("data must be bytes")
        self._live(context)
        if kind != "stream_receive":
            data = transaction["data"]
            try:
                sent = await asyncio.to_thread(self._port.write, data)
            except OSError as error:
                raise ConnectionError(f"serial write failed: {error}") from error
            # pyserial reports a short count without raising when a pending write
            # is cancelled, or under write_timeout=0. None means the port reports
            # no count (pyserial's own rs485.RS485 and cp2110:// ports).
            if sent is not None and sent != len(data):
                raise ConnectionError(f"serial write reported {sent} of {len(data)} bytes")
            if kind == "stream_send":
                return {}
        return {"data": await self._receive(*receive, context)}

    def _receive_bounds(self, t: dict[str, Any]) -> tuple[int, bytes, int]:
        max_bytes, termination, exact = t["max_bytes"], t["termination"], t["exact_bytes"]
        if not isinstance(max_bytes, int) or isinstance(max_bytes, bool) \
                or not 1 <= max_bytes <= self._max_frame:
            raise ValueError(f"max_bytes must be 1..{self._max_frame}")
        if termination not in _TERMINATORS:  # serial does not support "eom"
            raise ValueError("termination must be 'lf' or 'crlf' on a serial port")
        if exact is not None and (not isinstance(exact, int) or isinstance(exact, bool)
                                  or not 0 <= exact <= max_bytes):
            raise ValueError("exact_bytes must be None or 0..max_bytes")
        return max_bytes, _TERMINATORS[termination], exact or 0

    async def _receive(self, max_bytes: int, terminator: bytes, exact: int, context: Any) -> bytes:
        quiet_until = self.monotonic() + self._quiet_s
        while True:
            if exact:  # a positive exact_bytes takes precedence over termination
                if len(self._pending) >= exact:
                    return self._take(exact)
            else:
                end = self._pending[:max_bytes].find(terminator)
                if end >= 0:
                    return self._take(end + len(terminator))
                if len(self._pending) >= max_bytes:
                    self._take(max_bytes)  # discard, so the next call can resynchronise
                    raise ValueError(f"no terminator within {max_bytes} bytes")
            if not self._pending and self.monotonic() >= quiet_until:
                return b""  # nothing offered: a quiet line, not an error
            self._live(context)  # a partial frame stays pending across the timeout
            want = (exact or max_bytes) - len(self._pending)
            try:
                chunk = await asyncio.to_thread(self._port.read, max(1, want))
            except OSError as error:
                raise ConnectionError(f"serial read failed: {error}") from error
            self._pending += chunk

    def _take(self, count: int) -> bytes:
        out = bytes(self._pending[:count])
        del self._pending[:count]
        return out

    async def close_transport(self, context: Any) -> None:
        if not self._closed:
            self._closed = True
            await asyncio.to_thread(self._port.close)

    # evidence
    async def record_evidence(self, entry: dict[str, Any], context: Any) -> None:
        record = {**entry, "at": self.utc_now(), "operation_id": context.operation_id}
        self.evidence.append(record)
        if self._evidence_path is not None:
            with self._evidence_path.open("a", encoding="utf-8") as stream:
                stream.write(json.dumps(record, sort_keys=True) + "\n")

    # capture: the SDK's standalone writer
    def configure_capture(self, capture_id: str, *, metadata: dict[str, Any],
                          max_bytes: int | None = None) -> None:
        """Arm one capture's configuration (the host lifecycle's call)."""
        self._capture_bytes.setdefault(capture_id, 0)

    def capture_progress(self, capture_id: str) -> int:
        """The bytes this host handed the writer (zero for an unknown id)."""
        return self._capture_bytes.get(capture_id, 0)

    async def artifact_append(self, capture_id: str, data: bytes, context: Any) -> None:
        await self._writer.artifact_append(capture_id, data, context)
        self._capture_bytes[capture_id] = self._capture_bytes.get(capture_id, 0) + len(data)

    async def artifact_finalise(self, capture_id: str, metadata: dict[str, Any],
                                context: Any) -> dict[str, Any]:
        return await self._writer.artifact_finalise(capture_id, metadata, context)

    async def artifact_abort(self, capture_id: str) -> None:
        await self._writer.artifact_abort(capture_id)

Using it with pyserial and a plugin’s adapter:

import serial  # pyserial, installed separately

port = serial.Serial("/dev/ttyUSB0", 115200, timeout=0.05)
host = SerialStandaloneHost(port, writer=StandaloneCaptureWriter(formats=("raw_binary",)))
plugin = create_plugin()
open_context = BenchContext("open", timeout_s=2.0)
await plugin.open(descriptor, host, open_context)
op_context = BenchContext("bench-1", timeout_s=2.0)
result = await plugin.execute({"operation_id": "bench-1", "verb": "read",
                               "arguments": {"parameter": "voltage"}}, op_context)

Give each operation its own BenchContext. The adapter checks operation_id against the request. tests/test_guide_serial_host.py executes the first block above and drives a freshly scaffolded plugin through it, so the example cannot drift from the SDK or from the generated adapter.

Analyse captures (standalone host)

The standalone host serves the Analyse page at GET /analyse. The page works on the published waveform captures under the host’s capture root. You select captures, set a time window, and read the statistics that the host computes under definition benchweave-analysis/1. Every statistics block states its denominators: the sample count, the null count and the window.

The Captures list offers one check box per capture, and it lists only captures with state published and format waveform_f64le. No other capture can enter an analysis.

Select one or more check boxes, then select Analyse. The page shows one plot and one statistics table per capture. The statistics recompute each time you submit the form. The table rows are count, null_count, min, mean, max, rms and peak-to-peak. A line under each table names the capture’s manifest sha256.

Set the window with the two fields Window start (s) and Window end (s). Both times are seconds from the capture’s own start. The window is inclusive. An empty field leaves that end unbounded.

Both values must be finite numbers, and the start must not exceed the end. A window that breaks these rules refuses with the standalone_report_window_invalid: prefix. The page shows the refusal in a Refused notice.

Drag is the other way to set the window. Press the mouse on a plot and drag across a region. The drag zooms the plot to the region, fills both window fields, and submits the form. The window is then the dragged region. Both fields receive values rounded to 6 decimal places. The window fields alone are the complete path without script.

A sample counts as null exactly when it is NaN. The host counts null samples and excludes them, and it never reads a null as zero. When the window holds no non-null sample, every statistic shows the absence mark —.

The marker editor works on one capture at a time. Select exactly one capture to see it. Each marker row has three fields: a label, a time and a note.

A label is one uppercase letter A to Z. One marker exists per label, and a save with a repeated label replaces the earlier row. The note is free text. The editor pads empty rows to three, and it shows at most 26 rows.

The time is seconds from the capture’s own start. It must lie inside the capture’s displayable span, from 0 to (sample_count - 1) × sample_interval_s. A marker outside that span refuses with the standalone_report_marker_invalid: prefix.

Click a plot to write a time into a marker row. The click fills the row you last touched, or the first row with an empty time. A drag never places a marker. The drag brush owns drags. The marker time fields alone are the complete path without script.

Select Save markers to store the rows. The save rewrites the capture’s analysis.json overlay, format standalone-analysis/1. The save replaces the whole overlay with the editor’s rows, stored sorted by label. Empty rows store no marker. Your unsaved rows also ride the export. When you export, the editor’s current rows become the report’s markers for that capture.

Power modes pair the set’s voltage captures and current captures into rails. The pairing uses the units only, never the capture names. A capture with unit A, mA, uA or nA is a current side. A capture with unit V, mV, uV or kV is a voltage side. Letter case does not matter, and µ reads as u.

Without explicit rails, the first voltage side and the first current side of your selection form rail 1. The next pair forms rail 2, and so on. A current side without a voltage partner keeps its own rail, with rows for the current side only. A voltage side without a current partner forms nothing.

A rail pairs whole captures only. Both sides must declare the same sample interval and the same sample count. A mismatch refuses with the standalone_report_power_pairing: prefix.

The Power mode field names one presentation over the rails:

Mode Works on More input
battery rail 1 Battery capacity (Ah), for the runtime row
dc-dc rails 1 and 2 none
sleep rail 1 current Sleep threshold, in the rail’s current unit
load-step rail 1 none

The battery runtime row appears only when you give a capacity. The runtime is the capacity divided by the mean current. A zero or non-finite mean current omits the row, and no default capacity exists. The sleep block reads not_evaluated with reason no threshold when you give no threshold. An empty class reports its count and shows the absence mark for its mean.

The dc-dc efficiency row stays absent when the host cannot compute it, and a reason names why. The same holds for the load-step resistance row.

Every power label derives from the rail’s actual units. The power label is W only when both sides use the base units V and A. A scaled rail prints its unit product instead, for example V·mA. The charge label is Ah only for unit A, and the energy label is Wh only for a W rail. The host never rescales a value to match a label.

The power section can state an unavailability instead of rows. power_unavailable: no current series means the selection holds no current side. The section then shows no power rows, never a 0 W row. A rail with no voltage side states power_unavailable: no voltage series where the paired rows would be. Its charge row stays, because the charge integrates the current capture alone.

Export and read the analysis report (standalone host)

Select Export report to render one self-contained HTML document. The host writes the pair reports/<report id>.html and reports/<report id>.json under the capture root. The report id is rep- plus the first 16 hex digits of the document’s SHA-256. The id names the document’s own bytes. Identical inputs re-export to the same report. The second export writes nothing new, and the API result answers created: false for it.

The document holds these sections:

  • a banner line STANDALONE — no gateway, plus SIMULATED (a source capture records mock transport) when a source records mock transport;
  • the definitions line, which names the definition ids and states Processed values are host-computed (uncertainty: unknown);
  • the context chart, with every capture’s full extent, the window shaded, and the in-extent markers drawn;
  • the zoom chart, with the window at full detail, only when the window is a proper part of the extent;
  • one window statistics block and one edge timing block per capture;
  • the power section, when a power mode was selected;
  • the assertions table, when the export carried assertion rows from the REST or MCP surface;
  • the markers table, with every stored row and an in-window yes or no;
  • one sources block per capture, with the unit, the sample count, the interval, the byte length, the start time, the full manifest sha256, the device, the firmware, the plugin, the descriptor sha256, the operator, the project and the notes;
  • the footer, with the SDK version, the renderer pin and the re-derivable statement.

Each edge timing block uses definition benchweave-edge/1. The baseline is the mean of the first 15 % of the window’s non-null samples. The final value is the mean of the last 15 %. Each side counts at least 1 sample. A window with fewer than 3 samples, or a flat step, reads detected: no.

The rise_time row is the span from the 10 % crossing to the 90 % crossing. The settle_time row measures from the 10 % crossing. It shows the absence mark when the window’s last sample is still outside the settle band. The settle band is 2.0 % of the step, and the web export always uses this value.

An assertion row uses definition benchweave-assert/1. It names a capture and a lower bound, an upper bound, or both. The verdict is pass, fail or not_evaluated. An empty window is not_evaluated, never pass. A fail row names its reasons, below_min and above_max.

Every charge and energy row carries two coverage rows. One states the integrated span in seconds. The other states how many segments were dropped. A dropped segment is a segment where one sample of the pair is null.

The integral never steps across a gap. When no segment was counted, the value is the absence mark. No data integrated is an absence, not zero energy.

The report uses these marks where a value does not exist:

Mark Meaning
— The window held no data for this value. No value was computed.
n/a (non-finite) Data was present, but the statistic has no finite value.
not_evaluated An assertion found no samples in its window, or a sleep block had no threshold. It never means pass.

Before any number renders, the export reads each primary file again and recomputes its SHA-256. A capture that changed after publication refuses with the standalone_report_primary_mismatch: prefix. A refused export writes nothing, and it never creates the reports directory.

The document holds no clock value, so the same inputs give the same bytes. The JSON file beside the document records the export time, the parameters and the digests. The parameters are a replayable export input. Feed them back to reproduce the document with the same bytes.

Two limits protect the report’s shape. The report draws at most two distinct units. A larger set refuses with the standalone_report_units_unsupported: prefix. Split the export in that case.

A window that holds more than 2000000 samples for a plot refuses with the standalone_report_window_too_large: prefix. Narrow the window in that case. One export names at most 16 captures.

The export pins every source capture. A pinned capture never expires under retention, and it refuses deletion until you unpin it. Without a pin, mcp captures expire after 30 days. The ui and rest sources stay until you delete them. The capture retention section above explains the schedule. After the export, the browser lands on the report at GET /reports/<report id>. ### The MCP stdio session (the shim)

Agents speak MCP over stdio to the standalone host:

benchweave-sdk-server mcp /path/to/plugin-project

The command does one of three things:

  1. Proxy. A started host owns the supervision family beside the bindings document, which comes from --bindings <path>, or BENCHWEAVE_STANDALONE_BINDINGS, then device-bindings.json under the working directory. The start command applies the same resolution. The stdio session then proxies to that host. The browser page and the agent share one host and one device session. The proxy sets no call timeout. A hung host holds the session, and the command says so once on stderr at startup.
  2. Fallback. No host runs, because no pidfile exists or the pidfile names a dead process. The command serves the plugin in-process and prints one line on stderr that says so. No browser can attach to that session. The transport is the scripted mock. Captures in that session are ephemeral and go to a private temporary capture root that the command discards when the session ends normally. A fallback never touches the ambient capture root.
  3. Refuse. A host runs, but the command cannot verify it or use its credential file, or another process holds the library lock of the capture root. The command exits non-zero and names the fix. The status command shows the family’s verdict. When the command cannot verify a family, no lifecycle verb clears it. The refusal names the path of the stale file that remains: the pidfile, or the tokens file when no pidfile exists. Remove that file to resolve the state. The command never serves a second host beside a live one.

A .mcp.json entry:

{
  "mcpServers": {
    "benchweave-sdk-server": {
      "command": "benchweave-sdk-server",
      "args": ["mcp", "/path/to/plugin-project"]
    }
  }
}

The stdio session holds no state of its own: it writes no pidfile, no journal row, no tokens file and no capture-root file. In proxy mode the served tools are exactly the host’s tools. The session answers initialize with instructions that name the mode. The proxy sentence carries the host URL and the pid. The fallback sentence says that no other surface can attach and that the session’s captures are ephemeral. Point the entry at the same bindings document as start, so the supervision family has one anchor.

4. Review compatibility and deployment

Use the AI device integration reviewer (main repository) with the exact revision and test evidence. Its SDK maintenance checklist covers public interfaces, contracts, generated projects, mocks, gateway compatibility and release artefacts.

The gateway now has an explicit load_otdp_plugin and OTDPBridge path for async adapter API 1.1. The bridge mediates the OTDP verbs identify, read, write, capture, stream_subscribe, stream_unsubscribe and invoke: scalar read, scalar write, single-channel capture, streaming subscriptions and pinned-contract invoke. The capture verb comes with pre-dispatch bounds checks, staged appends and a host-computed manifest. The step’s timeout_ms is the capture budget. The release smoke exercises a generated multi-module plugin through identify and read. Separate bridge tests cover write conversion and rejection paths. The OTDP loader path also serves dataset publishing and payload services. The bridge does not mediate the self_test, get_errors and reset verbs. Profile scheduling needs a native asynchronous host. The bridge does not supply it. The gateway retains the existing simulator loader for its separate synchronous interface.

A gateway integrator must first do four things:

  • complete admission;
  • supply the verified manifest and cache, and the descriptor;
  • inject authorised scoped services;
  • use the same monotonic timebase as the host’s deadlines.

The loader rechecks all listed file hashes and imports verified package code and resources in memory. This is an integrity check and namespace isolation, not an operating-system sandbox. Adapters remain trusted Python.

An SDK install does not add a plugin to a running workbench. There is no live device-install endpoint, automatic dependency installer or Docker hot-install command. A Docker deployment still needs persistent storage for verified packages, bench configuration, commissioned host services and activation at an approved idle boundary. See package formats and gateway installation (main repository).

5. Prepare the release, then approve publication

A Python wheel or source distribution and a registry release are different artefacts. Prepare the registry-required identity, exact compatibility, payload inventory, hashes, dependency locks, licence, source and build provenance, SBOM (software bill of materials) and evidence status. benchweave-sdk inventory <prepared-bundle-directory> prints file paths, byte counts and SHA-256 values. It does not create or approve a complete registry manifest.

Before you publish, show the owner the actual built files, the evidence and the remaining gaps. Hardware qualification and local commissioning remain separate. The SDK retains the project’s proprietary licence declaration. Release owners must establish distribution rights before they share it publicly.

After your submission lands as a pull request (PR), track it without asking anyone. benchweave-sdk registry status --publisher <you> --registry-clone <clone-of-benchweave-registry> reports your exact submission set. It also reports every release’s lifecycle timeline, from the committed records alone. The timeline covers publishes, advisories, yanks and transfers. This command is the contributor-facing half of the queue that maintainers see. Stages carry stage_partial flags, because PR-side review activity is not derivable from records. The maintainer’s registry queue reads it when a live gh is available.

Maintenance and release cycle

The main repository’s Package workflow builds the gateway and SDK from source distributions, then tests installed wheels in temporary environments on Linux and macOS. It generates, builds and installs an external plugin outside the checkout. It runs the plugin’s tests. It checks packaged contract bytes and versions. It exercises gateway loading. It rejects tampered code.

Run the same check locally from a checkout of the main BenchWeave repository. The script scripts/sdk_smoke.py lives there, not in this repository. Run:

uv run --no-project --python 3.13 scripts/sdk_smoke.py --out-dir dist/packages

On a published GitHub release, a separate job repeats these checks. It then attaches the SDK wheel and source distribution to that release. A release tag triggers the publish workflow. The workflow builds the source distribution and wheel. It smoke-installs the wheel on five OS and arch lanes (Linux x86-64 and arm64, macOS arm64 and Intel, and Windows). It verifies each installed wheel’s vendored standards with benchweave-sdk sync-standards --check. It publishes to PyPI via Trusted Publishing. No release is published simply by an edit to these files or by a run of the local smoke check.

An installed SDK can verify its own vendored standards offline: benchweave-sdk sync-standards --check compares the packaged lock with the packaged tree and needs no repository checkout. An import of a standards bundle rewrites the source tree, so the command refuses to run outside a checkout (sync_requires_repo_checkout:).

When you change the SDK API, canonical contracts, template, gateway bridge or build tooling, update the affected tests and documentation together. Keep SDK distribution metadata, __version__, generated development dependency and this compatibility statement aligned. The smoke checks guard the installed distribution and contract resources.