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: T-12 measures the step budget against work that cannot fit in it (suite 2026.10.19.post3) (#536)
aswathas038d4d27afed
diff --git a/protocol/CHANGELOG.md b/protocol/CHANGELOG.mdindex 89d9124d..83a58646 100644--- a/protocol/CHANGELOG.md+++ b/protocol/CHANGELOG.md@@ -13,6 +13,29 @@ wire: the field keeps its type, and servers keep sending it. Under the[deprecation rules](VERSIONING.md#deprecation) it is removed no earlier than the second versionafter this one. A client reads `default` and each model's `available`.+## Conformance suite 2026.10.19.post3 (2026-10-19)++No change to the protocol, the schema or any verdict a conformant server gets.++T-12 measures the step budget (Tasks §1.1). A task sent with `max_step: 1` whose work needs three+tool calls must end `incomplete`, never `completed` or `failed`. Nothing in the suite sent+`max_step` before this, so a server that ignored the budget scored as well as one that honoured+it. The fixture gains a tool, `uhp_steps`, whose answer asks for the next step, and the check+counts the rounds from the response's own items: the tool call and the answer to it are two items+the server produced, so a model that only claims a call cannot make the count rise. A tool named+with a server's own MCP prefix (`mcp__<server>__uhp_steps`) counts as the fixture's tool.++- A server that ran the chain past the budget and reported `completed` or `failed` fails.+- A server that names `max_step` in `metadata.ignored_fields`, the answer §1.1 gives a server that+ cannot bound a base, passes.+- `incomplete_details.reason` is reported in the result and never failed: §1.1 requires the status+ and not the reason, and a UEP is what would make the reason a rule.+- A chain that stayed inside the budget, or never began, says nothing about the rule and is+ skipped.++T-12 needs the fixture's `uhp_steps`, so the public copy of the fixture is rebuilt from this commit;+until it is, T-12 skips against the default `--plugin-mcp-url`.+## Conformance suite 2026.10.19.post2 (2026-10-19)The packaged copy of the 2026-10-19 schema marks `HarnessModels.fallback` deprecated. No check ordiff --git a/protocol/conformance/README.md b/protocol/conformance/README.mdindex 13583f08..dc070b9e 100644--- a/protocol/conformance/README.md+++ b/protocol/conformance/README.md@@ -52,13 +52,13 @@ anything that only inspects a schema.## What it checks-100 checks across three classes.+101 checks across three classes.| Class | Checks | Covers ||---|---|---|| **Core** | 41 | Discovery, version negotiation, authentication, the error envelope, harnesses, models, task execution (streaming and not), the event stream, sessions, cancellation, reserved request fields || **Extended** | +9 | Session listing and inspection, file input, artifacts, download headers, path-traversal probes |-| **Full** | +50 | Harness create / update / delete, refusal of an unsupported base, skill-folder round trip, MCP and disabled-tool persistence, session sharing, plugins (package round trip, derivation, refusals, export, and a tool call through a plugin's server) |+| **Full** | +51 | Harness create / update / delete, refusal of an unsupported base, skill-folder round trip, MCP and disabled-tool persistence, session sharing, plugins (package round trip, derivation, refusals, export, and a tool call through a plugin's server), the step budget |Every check names the section of the specification it enforces, so a failure points at the sentenceit violates rather than at a test name.@@ -102,6 +102,13 @@ A few of them are worth calling out, because they catch things a schema check neignored. Both halves matter: before these, the suite sent neither field, so a server thatrejected them outright and a server that silently acted on them scored the same as a correctone. T-10 covers the third mistake, a server that reports fields the request never sent.+- **T-12**: the step budget, measured. A task sent with `max_step: 1` whose work needs three tool+ calls must end `incomplete`, never `completed` or `failed`. Nothing in the suite sent `max_step`+ before this, so a server that ignored the budget scored as well as one that honoured it. The+ rounds are counted from the response's own items: the tool call and the answer to it are two+ items the server produced, so a model that only claims a call cannot make the count rise. A chain+ that stayed inside the budget says nothing about the rule, so it is skipped rather than failed. A+ server that cannot bound a base may name `max_step` in `metadata.ignored_fields`, which passes.- **R-01…R-08** — session sharing, which is mostly a set of refusals. Sessions §5 requires that ashared view be read-only, revocable, and free of credentials, and a check that merely opens alink and reads the conversation passes against a server that also lets that link continue the@@ -136,14 +143,21 @@ uhp-conformance --base-url https://your-uhp-server --api-key "$UHP_API_KEY" --cl--plugin-mcp-url https://fixture.example.com/mcp```-It is a streamable-HTTP MCP server with two tools: `uhp_echo`, whose answer is a function of its+It is a streamable-HTTP MCP server with three tools: `uhp_echo`, whose answer is a function of itsinput (the prefix `UHP-FIXTURE:` and the text reversed), which is how P-11 proves the agent called-it; and `uhp_time`. A run defaults to a public copy of the same code at `https://uhp-fixture.harnessrouter.ai/mcp`+it; `uhp_time`; and `uhp_steps`, whose answer names the step of a chain it is on and asks for the+next one, which is how T-12's work runs one round longer than its budget.+A run defaults to a public copy of the same code at `https://uhp-fixture.harnessrouter.ai/mcp`(`DEFAULT_PLUGIN_MCP_URL` in the package; `fixture/Dockerfile` is how it is built), reachable fromany host with outbound HTTPS.A host under test whose agents cannot reach the public internet needs a copy it can reach, and theaddress goes on `--plugin-mcp-url`.+The public copy is built from `fixture/Dockerfile`, so it has the tools of the commit it was built+from and not of the commit that runs the suite. A check that needs a tool the copy lacks skips+with the reason; T-12 needs `uhp_steps`, so the public copy has to be rebuilt and redeployed from+the commit that adds it before T-12 can run against the default URL.+## Outcomes| Outcome | Meaning |diff --git a/protocol/conformance/tests/step_budget_stub.py b/protocol/conformance/tests/step_budget_stub.pynew file mode 100644index 00000000..5e5ed3ee--- /dev/null+++ b/protocol/conformance/tests/step_budget_stub.py@@ -0,0 +1,154 @@+"""A UHP server that gets the step-budget rule wrong, one way at a time.++Tasks §1.1 makes `max_step` a budget: a server must stop the task at or after the budget, must+report `incomplete`, and must not report `completed` for work it truncated. Each defect below is+one way of getting that wrong, and the last few are the answers the check has to accept: a server+that cannot bound a base names `max_step` in `metadata.ignored_fields`, and a task whose chain+never began needs no budget at all.++The stub answers with the fixture's own answers, and its tool calls are the items a real server+would put in the response, so the check counts the rounds the way it counts a real server's.++ DEFECT=ignores_budget PORT=8942 PYTHONPATH=.. python3 step_budget_stub.py+"""+from __future__ import annotations++import json+import os+import re+import time+import uuid+from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer+from urllib.parse import urlsplit++from uhp_conformance.fixture import step_answer++DEFECT = os.environ.get("DEFECT", "none")+PORT = int(os.environ.get("PORT", "8942"))+KEY = "stub-key"+BASE = "stub-base"++DEFECTS = {+ "none", # stops at the budget and says so+ "ignores_budget", # runs the whole chain and reports `completed`+ "ignores_budget_two_calls", # runs the chain past the budget and reports `completed`+ "model_ended_the_turn", # the chain stays inside the budget and the model ends the turn+ "no_reason", # reports `incomplete` with no reason at all+ "wrong_reason", # names a budget the request never carried+ "rounds_reason", # names the budget in the spec's other word for it+ "reports_ignored", # cannot bound a base, and says so+ "no_tool_call", # the agent never called the tool, so nothing needed a budget+ "incomplete_never_started", # reports `incomplete` without the work ever starting+ "failed_status", # runs past the budget and reports `failed`+ "prefixed_tool", # stops at the budget; names the tool the way claude-family bases name MCP tools+}+assert DEFECT in DEFECTS, f"unknown defect {DEFECT!r}; one of {sorted(DEFECTS)}"++# How many rounds of the chain this defect's server lets through.+CALLS = {"none": 1, "ignores_budget": 3, "ignores_budget_two_calls": 2,+ "model_ended_the_turn": 1, "no_reason": 1, "wrong_reason": 1, "rounds_reason": 1,+ "reports_ignored": 1, "no_tool_call": 0, "incomplete_never_started": 0,+ "failed_status": 3, "prefixed_tool": 1}++# The nonce the check puts in the task's prompt, so the stub answers as the fixture would.+NONCE_RE = re.compile(r"set to ([0-9a-f]+)")+++class H(BaseHTTPRequestHandler):+ protocol_version = "HTTP/1.1"++ def log_message(self, *a):+ pass++ def send(self, status: int, payload=None):+ body = b"" if payload is None else json.dumps(payload).encode()+ self.send_response(status)+ self.send_header("content-type", "application/json")+ self.send_header("uhp-version", "2026-10-19")+ self.send_header("content-length", str(len(body)))+ self.end_headers()+ if body:+ self.wfile.write(body)++ def do_GET(self):+ p = [x for x in urlsplit(self.path).path.split("/") if x]+ if p == ["v1", "uhp"]:+ return self.send(200, {+ "object": "uhp.discovery", "versions": ["2026-10-19"],+ "default_version": "2026-10-19", "conformance_class": "full",+ "capabilities": {"streaming": True, "sessions": True, "cancellation": True,+ "files_input": True, "files_output": True,+ "session_listing": True, "harness_management": True}})+ if (self.headers.get("authorization") or "").removeprefix("Bearer ").strip() != KEY:+ return self.send(401, {"error": {"code": "unauthorized", "message": "no credential"}})+ if p == ["v1", "harnesses"]:+ return self.send(200, {"harnesses": [{"id": "h1", "name": "stub", "base": BASE,+ "defaultModel": "stub-model"}]})+ return self.send(404, {"error": {"code": "not_found", "message": "no such endpoint"}})++ def do_DELETE(self):+ if (self.headers.get("authorization") or "").removeprefix("Bearer ").strip() != KEY:+ return self.send(401, {"error": {"code": "unauthorized", "message": "no credential"}})+ return self.send(200, {"id": "h2", "object": "harness", "deleted": True})++ def do_POST(self):+ n = int(self.headers.get("content-length") or 0)+ raw = self.rfile.read(n) if n else b"{}"+ if (self.headers.get("authorization") or "").removeprefix("Bearer ").strip() != KEY:+ return self.send(401, {"error": {"code": "unauthorized", "message": "no credential"}})+ p = [x for x in urlsplit(self.path).path.split("/") if x]+ try:+ body = json.loads(raw)+ except Exception: # noqa: BLE001+ body = {}+ if p == ["v1", "harnesses"]:+ return self._harness(body)+ if p == ["v1", "responses"]:+ return self.send(200, self._response(body))+ return self.send(404, {"error": {"code": "not_found", "message": "no such endpoint"}})++ def _harness(self, body: dict):+ if body.get("base") == "uhp-conformance-unknown-base":+ return self.send(422, {"error": {"code": "unsupported_base",+ "message": "no such base",+ "detail": {"supported": [BASE]}}})+ return self.send(200, {"id": "h2", "object": "harness", "name": body.get("name"),+ "base": BASE, "defaultModel": "stub-model",+ "mcpServers": body.get("mcp_servers") or [],+ "disabledTools": []})++ def _response(self, body: dict):+ nonce = (NONCE_RE.search(str(body.get("input") or "")) or [None, "nonce"])[1]+ out = []+ # A server that honours the budget stops after the first step; one that ignores it runs+ # the chain on, and the chain is longer than the budget either way.+ for i in range(1, CALLS[DEFECT] + 1):+ out.append({"id": f"fc_{i}", "type": "function_call", "call_id": f"call_{i}",+ "name": ("mcp__conformance-fixture__uhp_steps" if DEFECT == "prefixed_tool"+ else "uhp_steps"), "arguments": json.dumps({"nonce": nonce}),+ "status": "completed"})+ out.append({"id": f"fco_{i}", "type": "function_call_output", "call_id": f"call_{i}",+ "output": step_answer(i, nonce), "status": "completed"})+ status, details = "completed", None+ if DEFECT in ("none", "incomplete_never_started", "prefixed_tool"):+ status, details = "incomplete", {"reason": "max_steps"}+ elif DEFECT == "no_reason":+ status = "incomplete"+ elif DEFECT == "wrong_reason":+ status, details = "incomplete", {"reason": "timeout"}+ elif DEFECT == "rounds_reason":+ status, details = "incomplete", {"reason": "maximum tool-call rounds reached"}+ elif DEFECT == "failed_status":+ status = "failed"+ meta = {"session_id": f"sess_{uuid.uuid4().hex[:10]}", "harness_id": "h2"}+ if DEFECT == "reports_ignored":+ meta["ignored_fields"] = ["max_step"]+ return {"id": f"resp_{uuid.uuid4().hex[:10]}", "object": "response", "status": status,+ "model": "stub-model", "usage": None, "created_at": int(time.time()),+ "error": None, "incomplete_details": details, "previous_response_id": None,+ "store": True, "output": out, "metadata": meta}+++if __name__ == "__main__":+ print(f"stub: defect={DEFECT} port={PORT}", flush=True)+ ThreadingHTTPServer(("127.0.0.1", PORT), H).serve_forever()diff --git a/protocol/conformance/tests/test_step_budget.py b/protocol/conformance/tests/test_step_budget.pynew file mode 100644index 00000000..a7354250--- /dev/null+++ b/protocol/conformance/tests/test_step_budget.py@@ -0,0 +1,146 @@+"""T-12 is shown to fail on servers that get the step-budget rule wrong.++Nothing in the suite sent `max_step` before this, so the rule was unmeasured: a server that+ignored the budget and reported `completed` scored as well as one that stopped at the budget and+reported `incomplete`. These tests pin the ways it can go wrong — a silent `completed`, a chain cut+short and reported done, an `incomplete` with no reason, a reason that names another budget — and+the answers the check has to accept: a server that names `max_step` in `metadata.ignored_fields`,+and a task whose chain never began, which measured nothing.+"""+from __future__ import annotations++import pathlib+import socket+import subprocess+import sys+import time+import urllib.error+import urllib.request++import pytest++from uhp_conformance import checks # noqa: F401 — importing populates the registry+from uhp_conformance.client import Client+from uhp_conformance.context import Context+from uhp_conformance.registry import REGISTRY, Outcome++STUB = pathlib.Path(__file__).parent / "step_budget_stub.py"+# The stub answers as the fixture does, so it needs the package the check reads the fixture from.+PKG_PATH = str(pathlib.Path(checks.__file__).resolve().parent.parent)+ID = "T-12"+++def _free_port() -> int:+ with socket.socket() as s:+ s.bind(("127.0.0.1", 0))+ return s.getsockname()[1]+++def _run(defect: str) -> dict[str, Outcome]:+ port = _free_port()+ srv = subprocess.Popen([sys.executable, str(STUB)],+ env={"DEFECT": defect, "PORT": str(port), "PATH": "/usr/bin:/bin",+ "PYTHONPATH": PKG_PATH},+ stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)+ try:+ deadline = time.time() + 10+ while time.time() < deadline:+ try:+ urllib.request.urlopen(f"http://127.0.0.1:{port}/v1/uhp", timeout=1).read()+ break+ except (urllib.error.URLError, OSError):+ time.sleep(0.05)+ else:+ pytest.fail(f"the stub did not start for defect {defect!r}")+ ctx = Context(client=Client(f"http://127.0.0.1:{port}", "stub-key"), task_timeout=30.0)+ return {c.id: c.run(ctx).outcome for c in REGISTRY if c.id == ID}+ finally:+ srv.terminate()+ srv.wait(timeout=5)+++def test_the_check_is_registered_at_full():+ got = [c for c in REGISTRY if c.id == ID]+ assert [c.id for c in got] == [ID]+ assert {c.cls for c in got} == {"full"}+++def test_a_conformant_server_passes():+ assert _run("none")[ID] is Outcome.PASS+++def test_a_server_that_ignores_the_budget_fails():+ """The task ended `completed` after the fixture's chain ran past the budget: the work was+ truncated and reported as done, which §1.1 forbids."""+ assert _run("ignores_budget")[ID] is Outcome.FAIL+++def test_a_server_that_runs_the_chain_past_the_budget_fails():+ """Two rounds against a budget of one is already past it: the server let the work outgrow the+ budget and then reported the task done."""+ assert _run("ignores_budget_two_calls")[ID] is Outcome.FAIL+++def test_a_task_that_failed_past_the_budget_fails():+ """A server that stopped the task at the budget must report `incomplete`; a task that ran+ past the budget and ended `failed` is not that."""+ assert _run("failed_status")[ID] is Outcome.FAIL+++def test_a_chain_that_stayed_inside_the_budget_skips():+ """One round is inside a budget of one, so the server truncated nothing and the model ended+ the turn. §1.1 forbids reporting `completed` for work the SERVER truncated; this is not+ that, so the check skips rather than failing a correct server."""+ assert _run("model_ended_the_turn")[ID] is Outcome.SKIP+++def test_incomplete_without_a_reason_passes_with_a_note():+ """§1.1 requires `incomplete` for work stopped at the budget and says nothing of the reason, so+ a missing reason is reported in the result, never failed: a check holds a server to the protocol."""+ assert _run("no_reason")[ID] is Outcome.PASS+++def test_a_reason_that_names_another_budget_passes_with_a_note():+ """A reason that names the time budget is a poor diagnosis, but §1.1 requires the status, not+ the reason, so it is reported and not failed."""+ assert _run("wrong_reason")[ID] is Outcome.PASS+++def test_a_reason_that_names_the_budget_in_the_specs_other_words_passes():+ """§1.1 calls `max_step` an upper bound on "agent steps (tool-call rounds)", so a server that+ says "rounds" names the same budget as one that says "steps"."""+ assert _run("rounds_reason")[ID] is Outcome.PASS+++def test_a_server_that_names_max_step_as_ignored_passes():+ """A server that cannot bound a base has to say so (§1.1: ignoring must be observable). That is+ §1.1's other answer, so it passes: a skip would leave the server short of a clean verdict for good."""+ assert _run("reports_ignored")[ID] is Outcome.PASS+++def test_a_tool_named_with_the_servers_mcp_prefix_is_counted():+ """Claude-family bases name an MCP tool mcp__<server>__<tool>; those rounds are the fixture's+ tool all the same, or the reference server would skip this check forever."""+ assert _run("prefixed_tool")[ID] is Outcome.PASS+++def test_a_task_that_never_called_the_tool_skips():+ """The agent never called the tool, so there was no work to truncate: the check measured+ nothing, and a model that ignores the prompt must not fail the suite."""+ assert _run("no_tool_call")[ID] is Outcome.SKIP+++def test_a_task_that_never_started_skips():+ """A server that reports `incomplete` without the work ever having started measured nothing+ either: no tool call, no chain, no truncation. The check skips rather than pass, because a+ pass would be a claim about a budget that was never spent."""+ assert _run("incomplete_never_started")[ID] is Outcome.SKIP+++def test_no_check_errors_on_any_defect():+ for defect in ["none", "ignores_budget", "ignores_budget_two_calls", "model_ended_the_turn",+ "no_reason", "wrong_reason", "rounds_reason", "reports_ignored",+ "no_tool_call", "incomplete_never_started", "failed_status", "prefixed_tool"]:+ got = _run(defect)+ assert ID in got, f"the check {ID} is not registered, so the defect {defect!r} was never run"+ assert Outcome.ERROR not in got.values(), defectdiff --git a/protocol/conformance/uhp_conformance/__init__.py b/protocol/conformance/uhp_conformance/__init__.pyindex 44a0b75e..f779b424 100644--- a/protocol/conformance/uhp_conformance/__init__.py+++ b/protocol/conformance/uhp_conformance/__init__.py@@ -3,7 +3,7 @@# and a report prints it as `suite_version`, so a report always names the code that produced it.# It used to be written twice, and from 2026.10.4 to 2026.10.4.post8 only the packaging copy moved:# every report of those nine revisions called itself 2026.9.12.post4.-__version__ = "2026.10.19.post2"+__version__ = "2026.10.19.post3"UHP_VERSION = "2026-10-19"# The MCP server the plugin checks point a plugin at. It must resolve and answer: a host is# allowed to refuse a server it cannot reach at configuration time and record that in `skipped`,diff --git a/protocol/conformance/uhp_conformance/checks.py b/protocol/conformance/uhp_conformance/checks.pyindex 4ac1e3f1..e0ed485f 100644--- a/protocol/conformance/uhp_conformance/checks.py+++ b/protocol/conformance/uhp_conformance/checks.py@@ -13,6 +13,7 @@ from __future__ import annotationsimport base64import json+import reimport timeimport uuid@@ -1453,6 +1454,143 @@ def t10(ctx):"ignored_fields reports what this request carried and the server dropped, not a ""catalogue of what the server would drop.")++# ══════════════════════════════════════════════════════════════════════════════════════+# Full — the step budget (Tasks §1.1)+# ══════════════════════════════════════════════════════════════════════════════════════+# `max_step` and `timeout_seconds` are budgets: a server must stop the task at or after the+# budget, must report `incomplete`, and must not report `completed` for work it truncated.+# Nothing in the suite sent either field, so the rule was never measured — a server that+# ignored the budget scored as well as one that honoured it.+#+# The check needs work that cannot fit in the budget, and it must be able to say how many+# rounds of it happened: the fixture's `uhp_steps` tool answers with the step it is on and asks+# for the next one, and the rounds are counted from the response's own items — the tool call and+# the answer to it are two items the SERVER produced, so a model that merely claims to have made+# the calls cannot make the count rise.++# The budget this check asks for, in tool-call rounds (Tasks §1.1: "Upper bound on agent steps+# (tool-call rounds)").+_T12_MAX_STEP = 1+# The words a reason may use to name the budget it stopped at. §1.1 calls `max_step` an upper+# bound on "agent steps (tool-call rounds)", and a server may say "steps", "rounds", "turns" or+# "limit" for the same thing.+_T12_BUDGET_WORDS = ("step", "round", "turn", "limit", "budget")+++def _is_tool(name: str, tool_name: str) -> bool:+ """Whether a function_call's name is `tool_name` as the server spells an MCP tool: bare, or+ after the server's own prefix (claude-family bases name MCP tools `mcp__<server>__<tool>`)."""+ return name == tool_name or re.search(r"(?:^|[_.:/-])" + re.escape(tool_name) + r"$", name) is not None+++def _tool_rounds(items: list, tool_name: str) -> int:+ """How many rounds of `tool_name` the response's own items show.++ A round is a `function_call` for the tool and the `function_call_output` that answers it:+ both are items the server produced, so a model that claims a call in its text cannot add a+ round. Only an ANSWERED call counts — a call the server never answered did not happen.+ """+ calls = {str(i.get("call_id") or "") for i in items+ if isinstance(i, dict) and i.get("type") == "function_call"+ and _is_tool(str(i.get("name") or ""), tool_name)}+ return sum(1 for i in items+ if isinstance(i, dict) and i.get("type") == "function_call_output"+ and str(i.get("call_id") or "") in calls)+++@check("T-12", "A task over its step budget ends incomplete, naming the budget", "full",+ f"{SPEC}/tasks.md#11-request-fields")+def t12(ctx):+ """The step budget, measured on work that cannot fit in it.++ The request carries `max_step: 1` — one tool-call round — and the work is a chain of three+ rounds, so the task cannot finish inside the budget. §1.1 requires the server to stop it at+ the budget, report `incomplete`, and say which budget stopped it. A server that cannot bound+ a base has another way out — it names `max_step` in `metadata.ignored_fields`, and this check+ accepts that answer, because §1.1 requires ignoring to be observable and a server that says+ so has told the client the truth.++ What the check does NOT say: a chain that stayed inside the budget proves nothing about the+ rule, so a task that ended `completed` after one round is a SKIP and not a failure — the model+ ended the turn, and the server truncated nothing.+ """+ from .fixture import STEP_TOOL_NAME+ base_h = _harness(ctx)+ nonce = uuid.uuid4().hex[:10]+ model = ctx.model or str(base_h.get("defaultModel") or "").strip()+ # The harness carries the fixture as an MCP server, so the agent can be asked to call it. It is+ # a managed harness, so F-07 removes it and proves the delete worked.+ mcp = [{"name": "conformance-fixture", "url": ctx.plugin_mcp_url, "transport": "http",+ "enabled": True}]+ h = _managed_harness(ctx, base=base_h.get("base") or _supported_base(ctx), mcp_servers=mcp,+ **({"default_model": model} if model else {}))+ hid = h.get("id")+ if not hid:+ raise Skip("the harness carrying the fixture was created without an id")+ try:+ return _t12_measure(ctx, hid, nonce, model)+ finally:+ # T-12 runs after F-07, which deletes the other managed harnesses, so this one is removed here.+ try:+ ctx.client.delete(f"/v1/harnesses/{hid}")+ except Exception: # noqa: BLE001+ pass+++def _t12_measure(ctx, hid: str, nonce: str, model: str) -> str:+ from .fixture import STEP_TOOL_NAME+ body = {"input": (f"Call the tool {STEP_TOOL_NAME} with the argument \"nonce\" set to "+ f"{nonce}. Call it again after each answer, one call per message, until it "+ "says the chain is done, then reply with the word DONE."),+ "max_step": _T12_MAX_STEP, "metadata": {"harness_id": hid}, "stream": False}+ if model:+ body["model"] = model+ r = ctx.client.post("/v1/responses", body=body)+ assert r.status == 200, (+ f"a task carrying `max_step` returned HTTP {r.status}: {r.body[:200]!r}. §1.1 requires "+ "a server to ignore a request field it does not understand rather than refuse the "+ "request that carried it.")+ d = r.json or {}+ if "max_step" in ((d.get("metadata") or {}).get("ignored_fields") or []):+ # §1.1's other answer: a server that cannot bound a base says so, observably.+ return "max_step named in metadata.ignored_fields: the server said it could not bound this base"+ rounds = _tool_rounds(d.get("output") or [], STEP_TOOL_NAME)+ status = str(d.get("status") or "")+ if not rounds:+ raise Skip(f"the fixture's tool {STEP_TOOL_NAME} was never called, so no work was cut at "+ f"the budget and nothing was measured. The fixture at {ctx.plugin_mcp_url} may "+ "predate this check's tool.")+ if status == "completed":+ # The chain ran past the budget and the server said the task was done: the work was+ # truncated, and §1.1 forbids reporting `completed` for work the server truncated.+ assert rounds <= _T12_MAX_STEP, (+ f"the task reported `completed` after {rounds} rounds of the fixture's tool, past the "+ f"budget of {_T12_MAX_STEP} the request carried, so the work was truncated and "+ "reported as done. §1.1 says a server must not report `completed` for work it "+ "truncated.")+ raise Skip(f"the chain stayed inside the budget: {rounds} round(s) of {_T12_MAX_STEP}, so "+ "the server truncated nothing and the model ended the turn. There is nothing "+ "here about the step budget.")+ if status == "incomplete":+ # §1.1 requires the `incomplete` status for work stopped at the budget, and nothing about+ # the reason, so a missing or unworded reason is reported, never failed: a check holds a+ # server to the protocol, and a UEP is what would make the reason a rule.+ details = d.get("incomplete_details")+ reason = details.get("reason") if isinstance(details, dict) else None+ if isinstance(reason, str) and any(w in reason.lower() for w in _T12_BUDGET_WORDS):+ return f"incomplete after {rounds} round(s): {reason}"+ return (f"incomplete after {rounds} round(s); incomplete_details.reason is {reason!r}, "+ "which does not name the budget (not required by §1.1)")+ if status == "failed":+ assert rounds <= _T12_MAX_STEP, (+ f"the task ended `failed` after {rounds} rounds of the fixture's tool, past the budget "+ f"of {_T12_MAX_STEP}. §1.1 says a server that stops a task at the budget must report "+ "it `incomplete`.")+ raise Skip(f"the task ended `failed` after {rounds} round(s), inside the budget: the "+ "failure is not the budget's, so there is nothing here about the step budget.")+ raise Skip(f"the task ended {status!r}, which is not an ending the step budget explains")+# Full — session sharing# ══════════════════════════════════════════════════════════════════════════════════════# Sessions §5 is the Full requirement this suite could not see, and it is the one where adiff --git a/protocol/conformance/uhp_conformance/fixture.py b/protocol/conformance/uhp_conformance/fixture.pyindex 5548f28d..00b7b2b5 100644--- a/protocol/conformance/uhp_conformance/fixture.py+++ b/protocol/conformance/uhp_conformance/fixture.py@@ -1,9 +1,10 @@"""The MCP server the plugin checks point a plugin at, shipped with the suite.-A streamable-HTTP MCP server with two tools. `uhp_echo` answers with a function of its input+A streamable-HTTP MCP server with three tools. `uhp_echo` answers with a function of its input(`fixture_answer`), so a conformance run can prove an agent called it: the answer cannot beproduced without the call. `uhp_time` says what time the fixture thinks it is, for a human at the-other end of a debugging session.+other end of a debugging session. `uhp_steps` answers with the step of a chain it is on and asks+for the next one, so a caller that follows it makes the chain's calls.Run it anywhere a host under test can reach: `uhp-conformance-fixture --host 0.0.0.0 --port 8080`serves at http://<host>:8080/mcp, and `uhp-conformance --plugin-mcp-url <that>` points a run at@@ -16,6 +17,11 @@ import datetime as _dtTOOL_NAME = "uhp_echo"PREFIX = "UHP-FIXTURE:"+STEP_TOOL_NAME = "uhp_steps"+STEP_COUNT = 3+# How many chains a long-lived fixture remembers at once. A run cut short by a budget leaves its+# entry behind, so the dict is bounded and the oldest entries go when it grows past this.+STEP_CACHE_MAX = 1024def fixture_answer(text: str) -> str:@@ -23,6 +29,14 @@ def fixture_answer(text: str) -> str:return PREFIX + str(text)[::-1]+def step_answer(step: int, nonce: str, steps: int = STEP_COUNT) -> str:+ """What `uhp_steps` returns for `step`: the step it is on, and a request for the next one."""+ text = f"{PREFIX} step {step} of {steps}"+ if step < steps:+ return f"{text}; call {STEP_TOOL_NAME} again to continue"+ return f"{text}; the chain is done"++def build_server(host: str, port: int):try:from mcp.server.fastmcp import FastMCP@@ -39,6 +53,24 @@ def build_server(host: str, port: int):def uhp_time() -> str:return _dt.datetime.now(_dt.timezone.utc).isoformat(timespec="seconds")+ # The chain is counted per nonce, so two runs against one shared fixture do not share a+ # counter. The entry is dropped when the chain COMPLETES; a run cut short by a budget leaves+ # its entry behind, so the dict is bounded and the oldest chains go when it grows too big.+ steps: dict[str, int] = {}++ @server.tool(name=STEP_TOOL_NAME, description="Count one step of a chain: the answer names the "+ "step it is on and asks for the next one, so a "+ "caller that follows it makes the chain's calls.")+ def uhp_steps(nonce: str) -> str:+ step = steps.get(nonce, 0) + 1+ if step >= STEP_COUNT:+ steps.pop(nonce, None)+ else:+ steps[nonce] = step+ while len(steps) > STEP_CACHE_MAX:+ steps.pop(next(iter(steps)))+ return step_answer(step, nonce)+return server