Skip to content

Comments

Implement wire protocol as wool-protocol namespace package#2

Draft
conradbzura wants to merge 5 commits intomainfrom
1-extract-wire-protocol
Draft

Implement wire protocol as wool-protocol namespace package#2
conradbzura wants to merge 5 commits intomainfrom
1-extract-wire-protocol

Conversation

@conradbzura
Copy link
Contributor

@conradbzura conradbzura commented Feb 23, 2026

Summary

Implement Wool's wire protocol — protobuf schemas, generated Python bindings, and wrapper modules — as a namespace package importable as wool.protocol. Include protobuf definitions for task and worker messages, gRPC service wrappers, a service registry, and CI/CD workflows for testing, releasing, and repo hygiene.

Closes #1

Proposed changes

Add wool.protocol namespace package

Create protobuf schemas (task.proto, worker.proto) defining the gRPC Worker service, task dispatch messages (Task, Result, Exception, TaskVersionEnvelope), and the response streaming protocol (Ack, Nack, Response). Add wrapper modules under src/wool/protocol/ providing a clean public API with error handling and a service registry. Configure pyproject.toml with package metadata, build hooks for git-based versioning and gRPC import fixup, and dependencies.

Add CI/CD workflows

Add 7 workflow files for test execution (pyright + pytest across Python 3.11–3.13), release cutting, publishing, PR validation, labeling, and branch sync. Include 6 composite actions and supporting shell scripts for versioning, publishing, and setup.

Add protobuf wrapper tests

Add tests for the wrapper modules (task.py, worker.py, exception.py, __init__.py) covering public API exports, error handling, and the service registry.

Test cases

Test Suite Test ID Given When Then Coverage Target
TestTaskModule TM-001 The task module is imported Accessing Task symbol Returns the protobuf Task class task.py public export
TestTaskModule TM-002 The task module is imported Accessing Result symbol Returns the protobuf Result class task.py public export
TestTaskModule TM-003 The task module is imported Accessing Exception symbol Returns the protobuf Exception class task.py public export
TestTaskModule TM-004 The task module is imported Accessing TaskVersionEnvelope symbol Returns the protobuf TaskVersionEnvelope class task.py public export
TestTaskModule TM-005 The task module is imported Checking __all__ Contains exactly Exception, Result, Task, TaskVersionEnvelope, Worker task.py __all__
TestWorkerModule WM-001 The worker module is imported Accessing WorkerServicer symbol Returns the gRPC servicer base class worker.py public export
TestWorkerModule WM-002 The worker module is imported Accessing WorkerStub symbol Returns the gRPC stub class worker.py public export
TestWorkerModule WM-003 The worker module is imported Accessing WorkerMetadata symbol Returns the protobuf WorkerMetadata class worker.py public export
TestWorkerModule WM-004 The worker module is imported Checking __all__ Contains exactly 9 symbols: Ack, Nack, Response, StopRequest, Void, WorkerMetadata, WorkerServicer, WorkerStub, add_WorkerServicer_to_server worker.py __all__
TestProtobufImportError PE-001 An ImportError with message "No module named 'foo'" Raising ProtobufImportError wrapping it Error message includes original message and compilation hint exception.py
TestServiceRegistry SR-001 The protobuf package is imported Accessing add_to_server dict Maps WorkerServicer to add_WorkerServicer_to_server __init__.py registry

Implementation plan

    • Add protobuf schemas (task.proto, worker.proto) and configure pyproject.toml with package metadata, build hooks, and dependencies
    • Add wrapper modules (task.py, worker.py, exception.py, __init__.py) under src/wool/protocol/ with public API, error handling, and service registry
    • Add CI/CD workflow files, composite actions, and shell scripts
    • Add protobuf wrapper test suite (tests/protocol/) covering TM-001 through SR-001

@conradbzura conradbzura linked an issue Feb 23, 2026 that may be closed by this pull request
@conradbzura conradbzura changed the title Extract wire protocol into standalone wool-protocol package Extract wire protocol into standalone wool-protocol namespace package Feb 23, 2026
@conradbzura conradbzura force-pushed the 1-extract-wire-protocol branch from ec1d923 to 7406525 Compare February 23, 2026 15:06
@wool-labs wool-labs bot added the code-change Indicates that a PR should trigger a release label Feb 23, 2026
@conradbzura conradbzura force-pushed the 1-extract-wire-protocol branch from 7406525 to a2c07fc Compare February 23, 2026 15:08
@conradbzura conradbzura changed the title Extract wire protocol into standalone wool-protocol namespace package Add wire protocol as wool-protocol namespace package Feb 23, 2026
@conradbzura conradbzura force-pushed the 1-extract-wire-protocol branch from a2c07fc to f6b8a68 Compare February 23, 2026 15:31
@conradbzura conradbzura added documentation Indicates that a PR includes changes to documentation feature New feature or capability cicd CI/CD pipeline changes build Build system or dependency changes labels Feb 23, 2026
@conradbzura conradbzura changed the title Add wire protocol as wool-protocol namespace package Implement wire protocol as wool-protocol namespace package Feb 23, 2026
@conradbzura conradbzura force-pushed the 1-extract-wire-protocol branch 5 times, most recently from 436a6f9 to 30cc069 Compare February 23, 2026 16:51
@conradbzura conradbzura self-assigned this Feb 23, 2026
@conradbzura conradbzura force-pushed the 1-extract-wire-protocol branch 2 times, most recently from 7d19d4e to eee14cf Compare February 23, 2026 17:27
Add .gitignore, LICENSE (Apache 2.0), and README for the
wool-protocol repository. Include build hooks for git-based
versioning and gRPC import fixup.
Add CI/CD infrastructure for the wool-protocol repo: test
runner, release cutting, publishing, PR labeling and validation,
branch syncing, and issue templates.
Implement Wool's wire protocol as a namespace package importable as
wool.protocol. Includes protobuf definitions for task and worker
messages, gRPC service wrappers, and the service registry.
Add 18 tests covering the wool.protocol public surface: task
module exports and protobuf messages, worker module exports
with servicer/stub/message verification, ProtobufImportError
wrapping, and the service registry mapping.
@conradbzura conradbzura force-pushed the 1-extract-wire-protocol branch from eee14cf to 4c850a2 Compare February 23, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system or dependency changes cicd CI/CD pipeline changes code-change Indicates that a PR should trigger a release documentation Indicates that a PR includes changes to documentation feature New feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement wire protocol as wool-protocol namespace package

1 participant