HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
"""Installing the suite outside a checkout must still run its schema checks (#203)."""
from __future__ import annotations
from importlib import resources
from pathlib import Path
import shutil
import subprocess
import sys
import pytest
from uhp_conformance import UHP_VERSION
PROJECT = Path(__file__).resolve().parents[1]
SCHEMA_NAME = f"uhp-{UHP_VERSION}.schema.json"
def test_bundled_schema_matches_the_specification():
"""The protocol owns the schema; the package carries an exact release snapshot of it."""
canonical = PROJECT.parent / "schema" / SCHEMA_NAME
bundled = resources.files("uhp_conformance").joinpath(SCHEMA_NAME)
assert bundled.read_bytes() == canonical.read_bytes(), (
f"refresh uhp_conformance/{SCHEMA_NAME} from protocol/schema/{SCHEMA_NAME}"
)
def _run(*args, cwd):
result = subprocess.run(
[sys.executable, "-I", *args], cwd=cwd, text=True, capture_output=True,
timeout=120,
)
assert result.returncode == 0, result.stdout + result.stderr
return result.stdout
@pytest.fixture(scope="module")
def distributions(tmp_path_factory):
# The build tools are not part of the package's own dependencies: without them these two
# tests say so and step aside, and the byte-for-byte test above still runs everywhere.
for tool in ("build", "setuptools", "wheel"):
pytest.importorskip(tool, reason=f"{tool} is not installed; pip install build setuptools wheel")
root = tmp_path_factory.mktemp("conformance-dist")
source = root / "source"
shutil.copytree(
PROJECT, source,
ignore=shutil.ignore_patterns("*.egg-info", "__pycache__", "build", "dist", ".pytest_cache"),
)
# Only the conformance project is copied: no sibling protocol/schema directory can rescue
# an incomplete distribution, and a stale local build/ or egg-info cannot supply its files.
output = root / "dist"
_run("-m", "build", "--no-isolation", "--wheel", "--sdist", "--outdir", str(output),
cwd=source)
return {"wheel": next(output.glob("*.whl")), "sdist": next(output.glob("*.tar.gz"))}
def test_the_built_distribution_carries_the_version_a_report_prints(distributions):
"""One version, in the package, read by the build. It was written twice, and for nine revisions
only the packaging copy moved: every report of 2026.10.4 to 2026.10.4.post8 named itself
2026.9.12.post4. A report is evidence, and evidence names the suite that produced it."""
from uhp_conformance import __version__
assert distributions["wheel"].name == f"uhp_conformance-{__version__}-py3-none-any.whl"
assert distributions["sdist"].name == f"uhp_conformance-{__version__}.tar.gz"
def test_the_version_is_written_in_one_place():
packaging = (PROJECT / "pyproject.toml").read_text()
project = packaging.split("[project]", 1)[1].split("\n[", 1)[0]
assert 'dynamic = ["version"]' in project and "\nversion" not in project, project
assert 'version = { attr = "uhp_conformance.__version__" }' in packaging
@pytest.mark.parametrize("kind", ["wheel", "sdist"])
def test_installed_distribution_validates_instead_of_skipping(distributions, tmp_path, kind):
target = tmp_path / "installed"
# jsonschema and build requirements are already test dependencies. Installing the sdist
# builds another wheel from its contents, without fetching anything or using the checkout.
_run("-m", "pip", "install", "--no-deps", "--no-build-isolation", "--no-index",
"--target", str(target), str(distributions[kind]), cwd=tmp_path)
_run("-c", """
import pathlib
import sys
target = pathlib.Path(sys.argv[1]).resolve()
sys.path.insert(0, str(target))
from uhp_conformance import context
from uhp_conformance.client import Client
assert pathlib.Path(context.__file__).resolve().is_relative_to(target)
ctx = context.Context(client=Client("http://unused.invalid", ""))
ctx.validate({"id": "file_1", "filename": "report.csv"}, "File")
try:
ctx.validate({"id": "file_1", "filename": 42}, "File")
except AssertionError as error:
assert "does not match schema File" in str(error)
else:
raise AssertionError("the installed schema accepted an invalid filename")
""", str(target), cwd=tmp_path)