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
conformance: an unavailable validator stops at the share mint, so the R-series still measures Sessions §5 (#567)
Rudy Mizrahi Celeklic1590a98559e
diff --git a/protocol/conformance/tests/test_session_sharing_checks.py b/protocol/conformance/tests/test_session_sharing_checks.pyindex eac75166..99c69a97 100644--- a/protocol/conformance/tests/test_session_sharing_checks.py+++ b/protocol/conformance/tests/test_session_sharing_checks.py@@ -22,6 +22,7 @@ import urllib.requestimport pytestfrom uhp_conformance import checks # noqa: F401 — importing populates the registry+from uhp_conformance import contextfrom uhp_conformance.client import Clientfrom uhp_conformance.context import Contextfrom uhp_conformance.registry import REGISTRY, Outcome@@ -190,3 +191,59 @@ def test_a_conformant_server_passes_every_check_at_either_delete_path(delete_patconformant server serves, the series stays green rather than reporting the other missing."""out = _run_series("none", delete_paths=delete_paths)assert all(o is Outcome.PASS for o in out.values()), f"{delete_paths!r}: {out}"+++# ── a broken installation of the suite ────────────────────────────────────────────────+# `ctx.validate` raises RuntimeError when the suite cannot validate anything: no jsonschema, or+# no schema file beside the installed package. #203 ruled that condition an ERROR rather than a+# SKIP, and the checks whose subject IS a schema still report it that way.+#+# The R-series' subject is what a shared view refuses, and `_share` validates the one share+# object it mints and caches on all eight checks' behalf. So the unavailable validator must not+# escape that mint: every check downstream of the cache would report a suite bug in place of a+# §5 measurement, and the whole series would say "broken install" six more times than the one+# cause deserves.+++def _break_the_validator(monkeypatch, how: str) -> None:+ """Put `ctx.validate` in the state a broken installation puts it in.++ Both conditions are the two its own docstring names, and it raises RuntimeError — not Skip —+ for each. Asserted here, so a handler written for the wrong exception type cannot pass this+ file by catching something `ctx.validate` never raises.+ """+ if how == "no_jsonschema":+ monkeypatch.setattr(context, "jsonschema", None)+ elif how == "no_schema_file":+ monkeypatch.setattr(context, "SCHEMA_RESOURCE",+ pathlib.Path("/nonexistent/uhp_conformance/uhp.schema.json"))+ else:+ raise AssertionError(f"unknown way to break the validator: {how!r}")+ with pytest.raises(context.ValidatorUnavailable): # what _share catches, and nothing wider+ context.Context(client=Client("http://127.0.0.1:1", "unused")).validate({}, "SessionShare")++[email protected]("how", ["no_jsonschema", "no_schema_file"])+def test_an_unavailable_validator_does_not_cascade_through_the_shared_mint(monkeypatch, how):+ """One unavailable validator, not six suite bugs: the series still measures §5."""+ _break_the_validator(monkeypatch, how)+ out = _run_series("none")+ errored = [i for i, o in out.items() if o is Outcome.ERROR]+ assert not errored, (+ f"{how}: {errored} report a suite bug because the mint they all share could not validate "+ f"its own share object: {out}")+ assert all(o is Outcome.PASS for o in out.values()), f"{how}: {out}"++[email protected]("defect,expected", sorted(CAUGHT_BY.items()))+def test_a_real_defect_is_still_caught_when_the_validator_is_unavailable(monkeypatch, defect,+ expected):+ """Degrading the mint's own validation must cost no detection.++ A suite that cannot fail is worse than one that cannot run, so the whole defect matrix is+ driven again without a validator: each defect must still be caught by its own check.+ """+ _break_the_validator(monkeypatch, "no_jsonschema")+ out = _run_series(defect)+ assert out[expected] is Outcome.FAIL, (+ f"{defect!r} went uncaught by {expected} without a validator: {out}")diff --git a/protocol/conformance/uhp_conformance/checks.py b/protocol/conformance/uhp_conformance/checks.pyindex 12bfe373..59e84382 100644--- a/protocol/conformance/uhp_conformance/checks.py+++ b/protocol/conformance/uhp_conformance/checks.py@@ -17,6 +17,7 @@ import reimport timeimport uuid+from .context import ValidatorUnavailablefrom .registry import Skip, checkSPEC = "protocol/versions/2026-10-19"@@ -1701,7 +1702,7 @@ def _share(ctx) -> dict:"revoke what it just published.")try:ctx.validate(d, "SessionShare")- except Skip:+ except ValidatorUnavailable:# Validator unavailable (no jsonschema, or the schema file is not alongside an installed# wheel). The structural asserts above already ran; degrading here is the difference# between one weaker check and the ENTIRE R-series cascade-skipping through this cacheddiff --git a/protocol/conformance/uhp_conformance/context.py b/protocol/conformance/uhp_conformance/context.pyindex ca0a0d81..37dc040c 100644--- a/protocol/conformance/uhp_conformance/context.py+++ b/protocol/conformance/uhp_conformance/context.py@@ -16,6 +16,12 @@ from .client import ClientSCHEMA_RESOURCE = resources.files("uhp_conformance").joinpath(f"uhp-{UHP_VERSION}.schema.json")+class ValidatorUnavailable(RuntimeError):+ """The suite cannot validate anything: a broken installation (no jsonschema, or no schema file beside+ the package). A RuntimeError, so a check that meets it reports ERROR as #203 ruled; its own name, so a+ caller that degrades on it (the R-series' share mint) catches this and nothing else."""++@dataclassclass Context:client: Client@@ -38,11 +44,11 @@ class Context:with thirty skips read as a partial server rather than a partial suite."""if jsonschema is None:- raise RuntimeError("jsonschema is not installed; the suite needs it to validate "+ raise ValidatorUnavailable("jsonschema is not installed; the suite needs it to validate ""responses (pip install jsonschema)")if self._schema is None:if not SCHEMA_RESOURCE.is_file():- raise RuntimeError(f"the UHP {UHP_VERSION} schema is missing from this installation "+ raise ValidatorUnavailable(f"the UHP {UHP_VERSION} schema is missing from this installation "f"of uhp-conformance (expected {SCHEMA_RESOURCE}); reinstall the ""package")self._schema = json.loads(SCHEMA_RESOURCE.read_text(encoding="utf-8"))