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
fix(conformance): report partial check runs without class claim (#286)
Yominma3e416614ca04
diff --git a/protocol/conformance/README.md b/protocol/conformance/README.mdindex 8cb281cd..2dd62645 100644--- a/protocol/conformance/README.md+++ b/protocol/conformance/README.md@@ -35,10 +35,14 @@ check.| `--model` | Run tasks with a specific model. Required when the harness named by `--harness-id` has no default model: the suite says so and stops before the first task rather than waiting out the task timeout on each. || `--task-timeout` | Seconds to allow one agent task. Default 300. || `--plugin-mcp-url` | A reachable streamable-HTTP MCP server the plugin checks point a plugin at, or set `UHP_PLUGIN_MCP_URL`. Defaults to the public copy of the suite's own fixture (below). |-| `--only` | Comma-separated check ids, for iterating on one failure. |+| `--only` | Comma-separated check ids, for iterating on one failure. A subset is reported as a partial run, not a class conformance claim. || `--json` | Write a machine-readable report. || `--plain` | No ANSI colour, for CI logs. |+`--only` keeps the exit-code convention for debugging: `0` means the selected checks did not+fail or error. It does not certify the requested class. Use the JSON `conformant` and `coverage`+fields, or the terminal summary, when deciding whether to publish a class claim.+Exit code is `0` when nothing failed and `1` otherwise, so it drops into CI unchanged.**The suite runs real agent tasks.** It sends about seven of them, which costs real model tokens and a@@ -151,11 +155,14 @@ lying about the thing it exists to establish.The JSON report holds itself to the same rule, because it is the artifact published as evidencefor a conformance claim and its reader is frequently not the person who ran it:-- `conformant` is `true` only when every check ran and none failed or errored. A single skip- makes it `false`.-- `conformant_with_skips` is `true` when nothing failed or errored — the checks that ran are- clean, and the ones that didn't are enumerated in `skipped_not_verified` by id, so the report- says exactly what it did not establish.+- `conformant` is `true` only when every check required by the requested class ran and passed.+ A skipped or unselected check makes it `false`.+- `conformant_with_skips` is `true` only when every required check ran and none failed or errored;+ actual skips are enumerated in `skipped_not_verified`. A partial `--only` run sets this to+ `false` because unselected checks were not attempted.+- `coverage` reports whether all required checks ran, their counts, and the IDs that were not run+ or appeared more than once. A partial run can pass every selected check while still making no+ conformance claim. `highest_class_passed` credits only fully covered and passing classes.- `suite_version` and `generated_at` (UTC) tie the report to the suite revision and the momentthat produced it. A report without these fields predates suite `2026.8.11.post1`; thechecked-in reports from earlier runs are of that older shape.diff --git a/protocol/conformance/tests/test_report.py b/protocol/conformance/tests/test_report.pyindex ef583e55..b807446a 100644--- a/protocol/conformance/tests/test_report.py+++ b/protocol/conformance/tests/test_report.py@@ -22,37 +22,37 @@ FAILING = [_r("B-01", Outcome.PASS), _r("B-02", Outcome.FAIL, detail="wrong statdef test_clean_run_is_conformant():- d = json.loads(to_json(CLEAN, "http://t", "core"))+ d = json.loads(to_json(CLEAN, "http://t", "core", required_checks=CLEAN))assert d["conformant"] is Trueassert d["conformant_with_skips"] is Trueassert d["skipped_not_verified"] == []def test_a_skip_is_never_a_pass_in_the_json_verdict():- d = json.loads(to_json(SKIPPY, "http://t", "core"))+ d = json.loads(to_json(SKIPPY, "http://t", "core", required_checks=SKIPPY))assert d["conformant"] is Falseassert d["conformant_with_skips"] is Trueassert d["skipped_not_verified"] == ["B-02", "B-03"]def test_failures_fail_both_verdicts():- d = json.loads(to_json(FAILING, "http://t", "core"))+ d = json.loads(to_json(FAILING, "http://t", "core", required_checks=FAILING))assert d["conformant"] is Falseassert d["conformant_with_skips"] is Falsedef test_report_dates_itself_and_names_the_suite():- d = json.loads(to_json(CLEAN, "http://t", "core"))+ d = json.loads(to_json(CLEAN, "http://t", "core", required_checks=CLEAN))assert d["suite_version"] == __version__stamped = datetime.strptime(d["generated_at"], "%Y-%m-%dT%H:%M:%SZ")assert abs((datetime.now(timezone.utc).replace(tzinfo=None) - stamped).total_seconds()) < 60def test_human_summary_speaks_the_same_vocabulary():- out = render(SKIPPY, "http://t", "core", plain=True)+ out = render(SKIPPY, "http://t", "core", plain=True, required_checks=SKIPPY)assert "CONFORMANT WITH SKIPS" in outassert "A skip is not a pass." in out- clean = render(CLEAN, "http://t", "core", plain=True)+ clean = render(CLEAN, "http://t", "core", plain=True, required_checks=CLEAN)assert "CONFORMANT WITH SKIPS" not in cleanassert "CONFORMANT" in clean@@ -60,8 +60,47 @@ def test_human_summary_speaks_the_same_vocabulary():def test_highest_class_is_strict():# "Fully passed" means every check at and below the class ran and passed: fails, errors,# skips, and classes with no results at all each break the ladder.- assert highest_class(CLEAN) == "core" # only core ran — full is not creditable- assert highest_class(SKIPPY) == "" # a skipped check was not verified- assert highest_class(FAILING) == ""+ assert highest_class(CLEAN, CLEAN) == "core" # only core ran — full is not creditable+ assert highest_class(SKIPPY, SKIPPY) == "" # a skipped check was not verified+ assert highest_class(FAILING, FAILING) == ""full = [_r(f"{c}-01", Outcome.PASS, cls=c) for c in ("core", "extended", "full")]- assert highest_class(full) == "full"+ assert highest_class(full, full) == "full"+++def test_selected_success_is_not_a_class_verdict():+ selected = CLEAN[:1]+ d = json.loads(to_json(selected, "http://t", "core", required_checks=CLEAN))+ assert d["conformant"] is False+ assert d["conformant_with_skips"] is False+ assert d["highest_class_passed"] == ""+ assert d["coverage"] == {"complete": False, "required": 2, "reported": 1,+ "not_run": ["B-02"], "duplicate_or_unknown": []}+ out = render(selected, "http://t", "core", plain=True, required_checks=CLEAN)+ assert "PARTIAL RUN" in out+ assert "Not run (1):\n B-02" in out+ assert "CONFORMANT —" not in out+++def test_full_core_and_partial_extended_still_credit_core():+ required = CLEAN + [_r("X-01", Outcome.PASS, "extended"),+ _r("X-02", Outcome.PASS, "extended")]+ selected = CLEAN + required[2:3]+ d = json.loads(to_json(selected, "http://t", "extended", required_checks=required))+ assert d["conformant"] is False+ assert d["highest_class_passed"] == "core"+ assert d["coverage"]["not_run"] == ["X-02"]+++def test_repeated_result_does_not_replace_an_unrun_check():+ results = [CLEAN[0], CLEAN[0]]+ d = json.loads(to_json(results, "http://t", "core", required_checks=CLEAN))+ assert d["conformant"] is False+ assert d["coverage"]["not_run"] == ["B-02"]+ assert d["coverage"]["duplicate_or_unknown"] == ["B-01"]+++def test_failed_selected_check_still_shows_missing_coverage_in_terminal():+ out = render([FAILING[1]], "http://t", "core", plain=True, required_checks=FAILING)+ assert "NOT CONFORMANT" in out+ assert "Required coverage: 1/2 checks" in out+ assert "Not run (1):\n B-01" in outdiff --git a/protocol/conformance/uhp_conformance/cli.py b/protocol/conformance/uhp_conformance/cli.pyindex f856ed46..bb7fda74 100644--- a/protocol/conformance/uhp_conformance/cli.py+++ b/protocol/conformance/uhp_conformance/cli.py@@ -75,7 +75,8 @@ def main(argv=None) -> int:print(f"tasks run on harness {a.harness_id} ({r.json.get('name') or 'unnamed'}), model "f"{a.model or r.json.get('defaultModel')}", file=sys.stderr)- selected = checks_for(a.cls)+ required = checks_for(a.cls)+ selected = requiredif a.only:want = {s.strip().upper() for s in a.only.split(",") if s.strip()}selected = [c for c in selected if c.id.upper() in want]@@ -92,11 +93,13 @@ def main(argv=None) -> int:print("\r", end="")discovery = ctx.state.get("discovery")- print(render(results, a.base_url, a.cls, plain=a.plain, discovery=discovery))+ print(render(results, a.base_url, a.cls, plain=a.plain, discovery=discovery,+ required_checks=required))if a.json_out:with open(a.json_out, "w") as f:- f.write(to_json(results, a.base_url, a.cls, discovery=discovery, label=a.label) + "\n")+ f.write(to_json(results, a.base_url, a.cls, discovery=discovery, label=a.label,+ required_checks=required) + "\n")print(f" JSON report: {a.json_out}\n")bad = sum(1 for r in results if r.outcome in (Outcome.FAIL, Outcome.ERROR))diff --git a/protocol/conformance/uhp_conformance/report.py b/protocol/conformance/uhp_conformance/report.pyindex 948c460f..7f06fcc4 100644--- a/protocol/conformance/uhp_conformance/report.py+++ b/protocol/conformance/uhp_conformance/report.py@@ -2,10 +2,12 @@from __future__ import annotationsimport json+from collections import Counterfrom datetime import datetime, timezonefrom . import UHP_VERSION, __version__-from .registry import CLASSES, Outcome+from . import checks as _checks # noqa: F401 — populate the complete check registry+from .registry import CLASSES, Outcome, checks_forGREEN, RED, YELLOW, GREY, BOLD, RESET = ("\033[32m", "\033[31m", "\033[33m", "\033[90m", "\033[1m", "\033[0m")@@ -22,7 +24,19 @@ def served_version(discovery: dict | None) -> str:return str(d.get("default_version") or (d.get("versions") or [""])[0] or "unknown")-def render(results, target: str, cls: str, plain: bool = False, discovery: dict | None = None) -> str:+def _coverage(results, required_checks):+ """Compare the results with the registry, including duplicate or unexpected results."""+ expected = Counter((c.cls, c.id) for c in required_checks)+ observed = Counter((r.cls, r.id) for r in results)+ missing = list((expected - observed).elements())+ extra = list((observed - expected).elements())+ return not missing and not extra, missing, extra+++def render(results, target: str, cls: str, plain: bool = False, discovery: dict | None = None,+ required_checks=None) -> str:+ if required_checks is None:+ required_checks = checks_for(cls)def c(s, colour):return s if plain else f"{colour}{s}{RESET}"@@ -62,22 +76,38 @@ def render(results, target: str, cls: str, plain: bool = False, discovery: dictlines.append(f" {n[Outcome.PASS]}/{total} passed · {n[Outcome.FAIL]} failed · "f"{n[Outcome.SKIP]} skipped · {n[Outcome.ERROR]} errored")- achieved = highest_class(results)+ complete, missing, extra = _coverage(results, required_checks)+ achieved = highest_class(results, required_checks)if n[Outcome.FAIL] or n[Outcome.ERROR]:lines.append(c(f" NOT CONFORMANT at class '{cls}'", RED))if achieved:lines.append(f" Highest class fully passed: {achieved}")+ elif not complete:+ lines.append(c(f" PARTIAL RUN — class '{cls}' not verified", YELLOW))+ if achieved:+ lines.append(f" Highest class fully passed: {achieved}")elif n[Outcome.SKIP]:# Same vocabulary as the JSON report: skips demote the verdict, they never vanish into it.lines.append(c(f" CONFORMANT WITH SKIPS — UHP {served} ({cls})", YELLOW))lines.append(c(" Note: skipped checks were not verified. A skip is not a pass.", YELLOW))else:lines.append(c(f" CONFORMANT — UHP {served} ({cls})", GREEN))+ if not complete:+ lines.append(f" Required coverage: {len(required_checks) - len(missing)}/"+ f"{len(required_checks)} checks")+ if missing:+ lines.append(f" Not run ({len(missing)}):")+ lines.extend(f" {chunk}" for chunk in+ _wrap(", ".join(check_id for _, check_id in missing), 88))+ if extra:+ lines.append(f" Duplicate or unknown results ({len(extra)}):")+ lines.extend(f" {chunk}" for chunk in+ _wrap(", ".join(check_id for _, check_id in extra), 88))lines.append("")return "\n".join(lines)-def highest_class(results) -> str:+def highest_class(results, required_checks=None) -> str:"""The highest class every check of which — and of the classes below it — ran and passed."Fully passed" means exactly that: a fail or error anywhere at or below the class breaks@@ -85,13 +115,18 @@ def highest_class(results) -> str:results at all breaks it too — before this rule, a run that only exercised `core` reported`highest_class_passed: "full"`, crediting classes that never ran (issue #7's green-summaryshape, in class form)."""+ if required_checks is None:+ required_checks = checks_for("full")best = ""for k in CLASSES:upto = CLASSES[: CLASSES.index(k) + 1]+ required = [c for c in required_checks if c.cls in upto]group = [r for r in results if r.cls in upto]- if any(r.outcome is not Outcome.PASS for r in group):+ if not any(c.cls == k for c in required_checks):+ break+ if not _coverage(group, required)[0]:break- if not any(r.cls == k for r in results):+ if any(r.outcome is not Outcome.PASS for r in group):breakbest = kreturn best@@ -111,7 +146,11 @@ def _wrap(text: str, width: int):return out or [""]-def to_json(results, target: str, cls: str, discovery: dict | None = None, label: str = "") -> str:+def to_json(results, target: str, cls: str, discovery: dict | None = None, label: str = "",+ required_checks=None) -> str:+ if required_checks is None:+ required_checks = checks_for(cls)+ complete, missing, extra = _coverage(results, required_checks)n = {o.value: sum(1 for r in results if r.outcome is o) for o in Outcome}return json.dumps({"protocol": "uhp",@@ -135,12 +174,16 @@ def to_json(results, target: str, cls: str, discovery: dict | None = None, label# A skip is never a pass (README), and the consumer of this file is frequently not the# person who ran the suite — so the verdict field itself goes strict: a run in which# checks never executed is not "conformant", however green the rest of it is.- # `conformant_with_skips` keeps the old meaning under an honest name, and- # `skipped_not_verified` names the checks a reader must not assume anything about.- "conformant": n["fail"] == 0 and n["error"] == 0 and n["skip"] == 0,- "conformant_with_skips": n["fail"] == 0 and n["error"] == 0,+ # `conformant_with_skips` means every required check ran without failure or error;+ # `skipped_not_verified` names attempted checks that were skipped.+ "conformant": complete and n["fail"] == 0 and n["error"] == 0 and n["skip"] == 0,+ "conformant_with_skips": complete and n["fail"] == 0 and n["error"] == 0,"skipped_not_verified": [r.id for r in results if r.outcome is Outcome.SKIP],- "highest_class_passed": highest_class(results),+ "coverage": {"complete": complete, "required": len(required_checks),+ "reported": len(results),+ "not_run": [check_id for _, check_id in missing],+ "duplicate_or_unknown": [check_id for _, check_id in extra]},+ "highest_class_passed": highest_class(results, required_checks),"summary": {**n, "total": len(results)},"checks": [{"id": r.id, "title": r.title, "class": r.cls, "spec": r.spec,"outcome": r.outcome.value, "detail": r.detail, **r.evidence}