Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

wool-protocol

Wool's wire protocol definitions — protobuf schemas, generated Python bindings, gRPC service wrappers, and the service registry.

Importable as wool.protocol.

Installation

From PyPI

pip install wool-protocol

From source

git clone https://github.com/wool-labs/wool-protocol.git
cd wool-protocol
pip install .

Running tests

git clone https://github.com/wool-labs/wool-protocol.git
cd wool-protocol
pip install '.[dev]'
pytest

Wire protocol

Wool uses a binary wire protocol built on Protocol Buffers and gRPC for all communication between clients and workers.

Dispatch sequence

The Worker.dispatch RPC uses a server-streaming pattern. The client sends a single Task message and receives a stream of Response messages:

sequenceDiagram
    Client->>Worker: Task
    alt accepted
        Worker-->>Client: Response(Ack)
        alt coroutine
            Worker-->>Client: Response(Result)
        else async generator
            loop each iteration
                Worker-->>Client: Response(Result)
            end
        else failure
            Worker-->>Client: Response(Exception)
        end
    else rejected
        Worker-->>Client: Response(Nack)
    end

Task fields

# Field Type Description
1 version string Wire protocol version (envelope)
2 id string Unique task identifier (envelope)
3 caller string Identifier of the calling client (envelope)
4 tag string Routing tag for worker selection (envelope)
5 proxy_id string Unique identifier of the originating proxy
6 proxy bytes cloudpickle-serialized proxy reference for callbacks
7 callable bytes cloudpickle-serialized coroutine or async generator
8 args bytes cloudpickle-serialized positional arguments
9 kwargs bytes cloudpickle-serialized keyword arguments
10 timeout int32 Execution timeout in seconds

Response types

  1. Ack — The worker accepted the task and started processing. Carries the worker's version string for observability.
  2. Nack — The worker rejected the task. The reason field describes why (e.g., major version mismatch, unparseable version). No further responses follow a Nack.
  3. Result — A cloudpickle-serialized return value. Coroutine tasks yield exactly one result; async generator tasks yield one per iteration.
  4. Exception — A cloudpickle-serialized exception from the remote execution. Terminates the stream.

Serialization

Wool uses a hybrid serialization approach:

  • Protobuf envelope — Structured metadata fields (id, version, caller, timeout, etc.) are native protobuf fields for efficient parsing and forward compatibility.
  • cloudpickle payloads — The callable, args, kwargs, and proxy fields are serialized with cloudpickle and stored as bytes fields. This allows arbitrary Python objects to be transmitted without schema changes.
  • Results and exceptions — Result.dump and Exception.dump are cloudpickle-serialized bytes.

Version compatibility

The wire protocol follows PEP 440 versioning. A servicer accepts tasks from any client whose protocol version is less than or equal to its own within the same major version. For example, a servicer running 1.3.0 will accept tasks from a client running 1.0.0, but not from one running 1.4.0. There is no forward compatibility guarantee from client to servicer.

  • Minor and patch releases are backwards compatible. New fields may be appended with new field numbers; existing field numbers and types never change within the same major version.
  • Major releases may introduce breaking schema changes (field renumbering, type changes, removal). A major version mismatch between client and worker is treated as incompatible.
  • Fields 1–4 are the envelope. The Task message reserves fields 1–4 (version, id, caller, tag) for lightweight metadata, enabling pre-deserialization extraction via TaskEnvelope.

Implementations are responsible for enforcing version compatibility.

Release coordination

The wool and wool-protocol packages are developed in parallel but released independently: wool pins a specific wool-protocol version in its pyproject.toml, and wool's CI gates merges on the pinned version being available as a stable PyPI release. A separate non-blocking CI job tests against pre-releases for early signal.

On publish, wool-protocol dispatches a wool-protocol-released event to wool via GitHub's repository_dispatch API, triggering automatic re-runs of failing checks on open PRs that depend on the newly released version.

Metadata

Release files for wool-protocol 0.1rc0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wool-protocol 0.1rc0
File Size Uploaded
wool_protocol-0.1rc0.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wool-protocol 0.1rc0
File Interpreter ABI Platform
wool_protocol-0.1rc0-py3-none-any.whl Python 3 none any Details

Total release size: 30.8 kB

Release files / wool_protocol-0.1rc0.tar.gz

Download URL wool_protocol-0.1rc0.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d3f921f6743f8868810e7b61318d8a806201695cee11c246cbeabe35cfb86a66
BLAKE2b-256 checksum
How to use checksums
6d37de5aadda27148acffb5b1431a9d341d689d6dcbf29f94653e0c9196f9899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / wool_protocol-0.1rc0-py3-none-any.whl

Download URL wool_protocol-0.1rc0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9ede65e5fb0f2fae54dbf8d5eccabebcdda133da1530014a7728a3c2848a29a
BLAKE2b-256 checksum
How to use checksums
11175694c477cdbed3c3f480c57dae918ef1287d8762e180020843613a62a147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1rc0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page