unifiedharnessprotocol
The Unified Harness Protocol, as data.
A harness is a complete agent runtime — a loop that plans, calls tools, edits files and reports back. UHP is the HTTP contract for driving one: start a task, follow it, continue the conversation, cancel it, collect the files it produced.
This package contains no network code. It is the specification's vocabulary in machine-readable form, so that a client, a server, or a test suite can agree on the strings without each one retyping them out of the prose and getting one subtly wrong.
pip install unifiedharnessprotocol
from unifiedharnessprotocol import (
PROTOCOL_VERSION, Events, TaskStatus, ERROR_CODES,
is_terminal, is_retryable, check_discovery, check_sequence,
)
PROTOCOL_VERSION # '2026-08-11'
is_terminal(TaskStatus.IN_PROGRESS) # False
is_retryable(code="quota_exhausted") # False — nothing changes until the quota does
What's in it
| Export | What it is |
|---|---|
PROTOCOL_VERSION, VERSION_HEADER |
The version this package describes, and the header that carries it |
CONFORMANCE_CLASSES, CLASS_CAPABILITIES |
core / extended / full, and what each obliges a server to implement |
CAPABILITIES |
The capability keys of the discovery document |
TaskStatus, TERMINAL_STATUSES |
in_progress, completed, failed, incomplete, cancelled |
Events, TERMINAL_EVENTS |
The streaming event vocabulary |
ERROR_TYPES, ERROR_CODES, RETRYABLE_CODES |
The failure taxonomy and which parts are worth retrying |
ID_PREFIXES, object_type_for_id |
Which kind of object an id points at |
Endpoints |
Every path, so nobody spells one wrong |
Two checks worth running
Does the server's class claim match its capabilities? A class claim that contradicts the capability list tells a client two different things, and it is cheap to notice.
import json, urllib.request
from unifiedharnessprotocol import check_discovery
with urllib.request.urlopen("http://localhost:3000/v1/uhp") as response:
ok, problems = check_discovery(json.load(response))
Did the stream drop an event? sequence_number starts at 0 and increases by exactly 1. That
rule exists so a client can tell a lost event from a quiet agent — but only if it checks.
check_sequence(events) # (False, [7, 8])
Related
harnessclientprotocol— SSE decoding, output assembly, idempotency keys and retry policyharnessrouter— the HTTP client and CLIuhp— all three under one import
Specification
https://github.com/HarnessRouter/harnessrouter/tree/main/protocol
Apache-2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unifiedharnessprotocol-0.1.0.tar.gz.
File metadata
- Download URL: unifiedharnessprotocol-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad5f54a2133c8c5baf97eab164567c5d870ee7cd0e79fe2272854b6120335342
|
|
| MD5 |
33fcec8e1f415aeb4dd9214bf358e47e
|
|
| BLAKE2b-256 |
f12a1ffa99d5f34d270da814cac44629cb748d90e4861f00bcce0cd8f186830d
|
File details
Details for the file unifiedharnessprotocol-0.1.0-py3-none-any.whl.
File metadata
- Download URL: unifiedharnessprotocol-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b844f1f4aa61204a51c8342c6c6406da79c695df3883d28579a709382b26a12
|
|
| MD5 |
e34f1b25c0ada4b7be6917e8b6695489
|
|
| BLAKE2b-256 |
9f8c93cd1e608853bc986af5f91f8c7445cc634b07d094af033ee25882a0058b
|