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
UHP 2026-09-12: the Harness Plugins sub-protocol (#165)
github-actions[bot]7a205c6ca403
diff --git a/README.md b/README.mdindex edabbc10..844db354 100644--- a/README.md+++ b/README.md@@ -351,7 +351,7 @@ This repository contains the Apache 2.0 reference implementation, machine-readab<table><thead><tr><th>Resource</th><th>Purpose</th></tr></thead><tbody>- <tr><td><a href="protocol/versions/2026-08-11">Specification</a></td><td>Normative protocol behavior</td></tr>+ <tr><td><a href="protocol/versions/2026-09-12">Specification</a></td><td>Normative protocol behavior</td></tr><tr><td><a href="protocol/README.md#relationship-to-the-openai-responses-api">OpenAI Responses compatibility</a></td><td>Compatibility with existing OpenAI Responses API clients</td></tr><tr><td><a href="protocol/schema">OpenAPI and JSON Schema</a></td><td>Machine-readable contracts</td></tr><tr><td><a href="protocol/conformance">Conformance suite</a></td><td>Testable compatibility requirements</td></tr>diff --git a/protocol/CHANGELOG.md b/protocol/CHANGELOG.mdindex 1bee8a16..b587b381 100644--- a/protocol/CHANGELOG.md+++ b/protocol/CHANGELOG.md@@ -2,7 +2,74 @@All notable changes to the Unified Harness Protocol.-## Unreleased — additive to 2026-08-11+## 2026-09-12++Additive to `2026-08-11`: every request and object valid under the previous version is valid+here, and a client written against it keeps working against a server that serves this one. The+previous version stays published at its own address and a server SHOULD keep serving it.++### Added++- **Plugins** ([Plugins](versions/2026-09-12/plugins.md)), the Harness Plugins sub-protocol. A+ plugin is an [Agent Plugins](https://agent-plugins.org/specification) 1.0.0 package, carried as+ files and installed into a harness through a new `plugins` array on the harness object. The+ server derives `manifest`, `mcpServers`, `skills` and `skipped` from the package on every write;+ the package's servers and skills join the harness's own for every turn. UHP defines no package+ format of its own: as Agent Plugins wraps Agent Skills by saying where a skill lives and deferring+ the skill's format, this chapter wraps Agent Plugins by saying how a package travels, binds and+ runs, and defers the package's contents.++- **The composition rule** ([Plugins §4](versions/2026-09-12/plugins.md#4-composition-what-the-agent-gets)).+ A harness's own `mcpServers` and `skills` keep exactly the meaning they had: what a client wrote+ there, never a plugin's components copied in. This is what makes the version additive. A harness+ configured before this version is byte-for-byte a valid harness now, with `plugins` empty, and a+ client that reads a harness and writes it back cannot install a plugin's servers twice.+ Component names are unique within a harness across the direct lists and every enabled plugin;+ a collision is refused at configuration time with `plugin_conflict` rather than resolved+ silently at run time.++- **Export** ([Plugins §5](versions/2026-09-12/plugins.md#5-exporting-a-harness-as-a-plugin)):+ `GET /v1/harnesses/{id}/plugin` returns the harness's own tools and skills as an Agent Plugins+ package, credentials omitted and each omission recorded, that installs into another harness or+ any other Agent Plugins client unchanged. The direct fields were always the contents of a plugin+ without a name; this makes that an operation.++- **`stdio` MCP servers, inside plugins** ([Plugins §2.2](versions/2026-09-12/plugins.md#22-what-the-server-derives)):+ a plugin's `mcp.json` may declare a process (`command`, `args`, `env`, `cwd`), reported on the+ plugin as a `PluginMcpServer`. The harness's own `mcpServers` list stays remote-only and+ byte-for-byte what it was, because a process needs the root and data directory only a package+ provides. A server whose base cannot run a transport refuses the plugin with+ `unsupported_transport`.++- **Discovery**: the `plugins` capability, optional at every class, and `plugin_schemas`, the+ Agent Plugins manifest schemas the server installs+ ([Lifecycle §2](versions/2026-09-12/lifecycle.md#2-capability-discovery)).++- **Error codes**: `plugin_invalid` (422), `unsupported_plugin_schema` (422),+ `unsupported_transport` (422), `plugin_conflict` (409), `plugin_not_found` (404)+ ([Errors §3](versions/2026-09-12/errors.md#3-error-codes)).++- **Security §9, plugins are third-party code** ([Security](versions/2026-09-12/security.md#9-plugins-are-third-party-code)):+ stdio servers run inside the agent's sandbox and nowhere else, only the two placeholders are+ ever expanded, plugins are installed by whoever manages the harness and never per request.++- **Schema**: `Plugin`, `PluginManifest`, `PluginSkill`, `PluginSkipped`, `FileList`; the skill+ files endpoint, which the prose named and the OpenAPI document omitted, is now in both.++### Conformance++- **P-01 to P-10**, class Full, gated on the `plugins` capability: the schema list, package round+ trip and derivation, refusal of a package without a manifest, refusal of a name collision,+ survival of an unrelated edit, export that installs again without credentials, skipped+ components recorded, `enabled: false` preserved, refusal of an unsupported manifest schema,+ refusal of duplicate plugin names. Each is proven against a defect stub carrying one mistake at+ a time, the way the R-series is. The suite is now 74 checks.++## 2026-08-11, additive clarifications++These were published as additive changes to `2026-08-11` before `2026-09-12` and are carried+into it unchanged.+### Clarifieddiff --git a/protocol/CONNECTING.md b/protocol/CONNECTING.mdindex 2878e70f..5a70518d 100644--- a/protocol/CONNECTING.md+++ b/protocol/CONNECTING.md@@ -1,9 +1,9 @@# Implement a client-A UHP [client](versions/2026-08-11/architecture.md#1-roles) discovers the harnesses a server+A UHP [client](versions/2026-09-12/architecture.md#1-roles) discovers the harnesses a serverruns, submits a task, receives progress events, and retrieves the resulting files. It speaksonly UHP over HTTP and does not need to know which harness runs behind the server. This guide-is the procedure; the [Architecture chapter](versions/2026-08-11/architecture.md#1-roles) is+is the procedure; the [Architecture chapter](versions/2026-09-12/architecture.md#1-roles) isthe definition.For the other role — a server that runs harnesses behind the contract — see [Implement a server](SERVING.md).@@ -12,7 +12,7 @@ For the other role — a server that runs harnesses behind the contract — seeA client is a product, CLI, CI job, or another agent that wants work done. It does not runthe harness; it drives a server that does. The full definitions of client, server, and-harness are in the [Architecture chapter](versions/2026-08-11/architecture.md#1-roles) — this guide is+harness are in the [Architecture chapter](versions/2026-09-12/architecture.md#1-roles) — this guide isthe procedure, not the definition.Integration is deliberately light. The task surface is shaped like a responses API, so most@@ -21,24 +21,24 @@ of the work is ordinary HTTP plus reading an event stream.## Generate the clientDo not hand-write types. Every version publishes OpenAPI 3.1 and JSON Schema 2020-12 in the-[schema chapter](versions/2026-08-11/schema.md) — generate a typed client for your language from it and+[schema chapter](versions/2026-09-12/schema.md) — generate a typed client for your language from it andyou have the request and response shapes for free.## The integration, step by step1. **Discover the catalog.** Ask the server which harnesses it runs and which models eachaccepts. A client selects a *configured harness* — a base plus its configuration — by the- server-assigned id. [Harnesses chapter](versions/2026-08-11/harnesses.md).+ server-assigned id. [Harnesses chapter](versions/2026-09-12/harnesses.md).2. **Submit a task.** One unit of work: input in, result out. Name the configured harness and- send the request. [Tasks chapter](versions/2026-08-11/tasks.md).+ send the request. [Tasks chapter](versions/2026-09-12/tasks.md).3. **Consume the stream.** Read the event stream to follow progress while the task runs, andreconnect if the connection drops — the protocol defines how to resume without losing- events. [Streaming chapter](versions/2026-08-11/streaming.md).+ events. [Streaming chapter](versions/2026-09-12/streaming.md).4. **Continue in a session.** To pick up where a task left off, carry the session forward- instead of starting cold. [Sessions chapter](versions/2026-08-11/sessions.md).-5. **Take the artifacts.** Download the files the run produced. [Files chapter](versions/2026-08-11/files.md).+ instead of starting cold. [Sessions chapter](versions/2026-09-12/sessions.md).+5. **Take the artifacts.** Download the files the run produced. [Files chapter](versions/2026-09-12/files.md).6. **Cancel and handle errors.** Stop work cleanly, and read failures from the documented- error taxonomy rather than guessing from status codes. [Errors chapter](versions/2026-08-11/errors.md).+ error taxonomy rather than guessing from status codes. [Errors chapter](versions/2026-09-12/errors.md).## A minimal end-to-end shape@@ -49,7 +49,7 @@ A client that submits one task and reads its result touches only the core surfacGET /v1/tasks/{id} → read the resultGET /v1/files/{id} → download an artifact-Generate the exact request and response bodies from the [schema](versions/2026-08-11/schema.md); the+Generate the exact request and response bodies from the [schema](versions/2026-09-12/schema.md); the[conformance suite](conformance/README.md) shows the same calls run against a real server.## Nextdiff --git a/protocol/IMPLEMENTATIONS.md b/protocol/IMPLEMENTATIONS.mdindex 7bec788c..b5ff0da7 100644--- a/protocol/IMPLEMENTATIONS.md+++ b/protocol/IMPLEMENTATIONS.md@@ -1,7 +1,7 @@# ExamplesExample implementations of the Unified Harness Protocol, grouped by the-[role](versions/2026-08-11/architecture.md#1-roles) each fills. Listings are+[role](versions/2026-09-12/architecture.md#1-roles) each fills. Listings arecommunity-maintained by pull request and **do not imply endorsement orcertification** — the only conformance claim that means anything is[passing the conformance suite](conformance/README.md).diff --git a/protocol/README.md b/protocol/README.mdindex f28ae08b..605ea4fe 100644--- a/protocol/README.md+++ b/protocol/README.md@@ -38,9 +38,9 @@ job, not a completion.| | ||---|---|-| **Current version** | `2026-08-11` |+| **Current version** | `2026-09-12` || **Status** | Draft standard — stable enough to build on, versioned so it can change safely |-| **Specification** | [`versions/2026-08-11/`](versions/2026-08-11/) |+| **Specification** | [`versions/2026-09-12/`](versions/2026-09-12/) || **Machine-readable** | [`schema/`](schema/) — OpenAPI 3.1 + JSON Schema 2020-12 || **Conformance suite** | [`conformance/`](conformance/) — runnable, and the definition of "conformant" || **Change process** | [`GOVERNANCE.md`](GOVERNANCE.md) |@@ -65,16 +65,17 @@ your client depends on, that is a specification bug — please| Chapter | What it defines ||---|---|-| [Architecture](versions/2026-08-11/architecture.md) | Roles, conformance classes, and the object model |-| [Lifecycle](versions/2026-08-11/lifecycle.md) | Version negotiation, capability discovery, task lifecycle |-| [Harnesses](versions/2026-08-11/harnesses.md) | Discovering, selecting and configuring a harness |-| [Tasks](versions/2026-08-11/tasks.md) | Sending work and receiving a result |-| [Streaming](versions/2026-08-11/streaming.md) | Following progress as it happens |-| [Sessions](versions/2026-08-11/sessions.md) | Continuing a conversation, and cancelling one |-| [Files](versions/2026-08-11/files.md) | Sending files in, getting artifacts out |-| [Errors](versions/2026-08-11/errors.md) | Failure taxonomy, retries and idempotency |-| [Security](versions/2026-08-11/security.md) | What an implementer must get right, collected in one place |-| [Schema](versions/2026-08-11/schema.md) | The machine-readable definitions and how to use them |+| [Architecture](versions/2026-09-12/architecture.md) | Roles, conformance classes, and the object model |+| [Lifecycle](versions/2026-09-12/lifecycle.md) | Version negotiation, capability discovery, task lifecycle |+| [Harnesses](versions/2026-09-12/harnesses.md) | Discovering, selecting and configuring a harness |+| [Plugins](versions/2026-09-12/plugins.md) | Packages of tools and skills, installed into a harness as one unit |+| [Tasks](versions/2026-09-12/tasks.md) | Sending work and receiving a result |+| [Streaming](versions/2026-09-12/streaming.md) | Following progress as it happens |+| [Sessions](versions/2026-09-12/sessions.md) | Continuing a conversation, and cancelling one |+| [Files](versions/2026-09-12/files.md) | Sending files in, getting artifacts out |+| [Errors](versions/2026-09-12/errors.md) | Failure taxonomy, retries and idempotency |+| [Security](versions/2026-09-12/security.md) | What an implementer must get right, collected in one place |+| [Schema](versions/2026-09-12/schema.md) | The machine-readable definitions and how to use them |## Quick shape of it@@ -97,13 +98,13 @@ The stream is Server-Sent Events. The last event carries the finished `response`any files the agent produced. To continue the same conversation, send the next request with`previous_response_id` set to the id you just received.-Full walk-through: [Tasks](versions/2026-08-11/tasks.md).+Full walk-through: [Tasks](versions/2026-09-12/tasks.md).## Relationship to the OpenAI Responses APIUHP's task surface is deliberately shaped like the OpenAI Responses API, and a conformant server-MUST accept the subset of that request body described in [Tasks](versions/2026-08-11/tasks.md) and-emit the event vocabulary described in [Streaming](versions/2026-08-11/streaming.md).+MUST accept the subset of that request body described in [Tasks](versions/2026-09-12/tasks.md) and+emit the event vocabulary described in [Streaming](versions/2026-09-12/streaming.md).This is a compatibility decision, not an accident. Products already have code that speaks Responses;existing SDKs, streaming parsers, and UI components work against a UHP server with no changes. What@@ -117,15 +118,15 @@ of an existing field. A client that ignores every UHP extension still gets a wor## Implementing UHP-1. Read [Architecture](versions/2026-08-11/architecture.md) and pick a conformance class.-2. Generate types from [`schema/uhp-2026-08-11.openapi.yaml`](schema/uhp-2026-08-11.openapi.yaml).+1. Read [Architecture](versions/2026-09-12/architecture.md) and pick a conformance class.+2. Generate types from [`schema/uhp-2026-09-12.openapi.yaml`](schema/uhp-2026-09-12.openapi.yaml).3. Run the [conformance suite](conformance/) against your server while you build:```bashpip install -e protocol/conformanceuhp-conformance --base-url https://your-server --api-key "$KEY"```4. Publish your report. A server that passes at a class MAY describe itself as- "UHP 2026-08-11 conformant (<class>)".+ "UHP 2026-09-12 conformant (<class>)".Two role-specific guides walk through this in order:[Implement a client](CONNECTING.md) — discovery, task submission, event handling, anddiff --git a/protocol/SERVING.md b/protocol/SERVING.mdindex 395fd172..2d0684d9 100644--- a/protocol/SERVING.md+++ b/protocol/SERVING.md@@ -2,7 +2,7 @@How to put an agent harness behind the Unified Harness Protocol — what a server mustanswer, in what order to build it, and how to prove it works. This guide is the-practical companion to the [specification](versions/2026-08-11/index.md); where the two+practical companion to the [specification](versions/2026-09-12/index.md); where the twodisagree, the specification wins.## What a UHP server is@@ -26,20 +26,20 @@ Build in the order the conformance suite tests, because each stage is testable oown:1. **Discovery** — advertise the harnesses you run and the models they accept.- [Harnesses chapter](versions/2026-08-11/harnesses.md).+ [Harnesses chapter](versions/2026-09-12/harnesses.md).2. **Tasks** — accept one unit of work, run it, return the result. The task surface isdeliberately shaped like a responses API, plus what a harness needs and a model- endpoint has no concept of. [Tasks chapter](versions/2026-08-11/tasks.md).+ endpoint has no concept of. [Tasks chapter](versions/2026-09-12/tasks.md).3. **Streaming** — report progress while long tasks run, and survive a dropped- connection. [Streaming chapter](versions/2026-08-11/streaming.md).+ connection. [Streaming chapter](versions/2026-09-12/streaming.md).4. **Sessions** — let a task continue where a previous one left off.- [Sessions chapter](versions/2026-08-11/sessions.md).+ [Sessions chapter](versions/2026-09-12/sessions.md).5. **Files** — take files in, hand artifacts back.- [Files chapter](versions/2026-08-11/files.md).+ [Files chapter](versions/2026-09-12/files.md).6. **Cancellation and errors** — stop running work cleanly and fail in the documented- taxonomy. [Errors chapter](versions/2026-08-11/errors.md).+ taxonomy. [Errors chapter](versions/2026-09-12/errors.md).-The [schema chapter](versions/2026-08-11/schema.md) publishes OpenAPI 3.1 and JSON+The [schema chapter](versions/2026-09-12/schema.md) publishes OpenAPI 3.1 and JSONSchema 2020-12 for every version — generate your types instead of writing them.## Prove itdiff --git a/protocol/VERSIONING.md b/protocol/VERSIONING.mdindex 88218f28..6be9fafb 100644--- a/protocol/VERSIONING.md+++ b/protocol/VERSIONING.md@@ -2,8 +2,8 @@## The scheme-UHP versions are dates — `YYYY-MM-DD`, the day the version was published. `2026-08-11` is the-current version.+UHP versions are dates — `YYYY-MM-DD`, the day the version was published. `2026-09-12` is the+current version; `2026-08-11` remains published and served.Dates were chosen over semantic versioning deliberately. SemVer's promise is that a major bump means"expect breakage" and a minor bump means "safe" — a promise that is only as good as the discipline@@ -52,7 +52,9 @@ A server MUST:2. Reject an unsupported requested version with `unsupported_protocol_version` rather than serving adifferent one.3. Support at least one full version at a time, and SHOULD support the previous version for at least- six months after a new one is published.+ six months after a new one is published. When the newer version is additive, as `2026-09-12` is+ to `2026-08-11`, both are served from one code path: the same objects answer either request,+ and the only difference a client sees is the version echoed in the header.## Deprecationdiff --git a/protocol/conformance/README.md b/protocol/conformance/README.mdindex 56cbf2a8..2f4917d6 100644--- a/protocol/conformance/README.md+++ b/protocol/conformance/README.md@@ -37,13 +37,13 @@ anything that only inspects a schema.## What it checks-64 checks across three classes.+74 checks across three classes.| Class | Checks | Covers ||---|---|---|| **Core** | 40 | Discovery, version negotiation, authentication, the error envelope, harnesses, models, task execution (streaming and not), the event stream, sessions, cancellation, reserved request fields || **Extended** | +8 | Session listing and inspection, file input, artifacts, download headers, path-traversal probes |-| **Full** | +15 | Harness create / update / delete, refusal of an unsupported base, skill-folder round trip, MCP and disabled-tool persistence, session sharing |+| **Full** | +25 | 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) |Every check names the section of the specification it enforces, so a failure points at the sentenceit violates rather than at a test name.@@ -64,6 +64,11 @@ A few of them are worth calling out, because they catch things a schema check neown origin.- **X-08** — artifact ids do not traverse out of their container. Probes for `../` and itspercent-encoded form.+- **P-02/P-06** — a plugin package is derived, not copied, and a harness exports as a package+ that installs again. P-02 fails a server whose own `mcpServers` absorb a plugin's servers, the+ mistake that makes every read-then-write install them twice; P-06 fails an export that carries+ the operator's credentials, and one that omits them without saying so. Both series skip, never+ fail, on a server that reports the `plugins` capability false, because the chapter is optional.- **T-08/T-09/T-10** — the reserved fields `tools` and `include` are accepted, and reported asignored. 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 correct@@ -122,7 +127,7 @@ live instance on 2026-09-04 (suite 2026.8.11.post1):```Summary64/64 passed · 0 failed · 0 skipped · 0 errored- CONFORMANT — UHP 2026-08-11 (full)+ CONFORMANT — UHP 2026-09-12 (full) (the version the server serves; a 2026-08-11 server reads 2026-08-11)```<!-- conformance-recorded-run:end -->diff --git a/protocol/conformance/pyproject.toml b/protocol/conformance/pyproject.tomlindex c1192b7f..ec86c199 100644--- a/protocol/conformance/pyproject.toml+++ b/protocol/conformance/pyproject.toml@@ -1,6 +1,6 @@[project]name = "uhp-conformance"-version = "2026.8.11.post1"+version = "2026.9.12"description = "Conformance suite for the Unified Harness Protocol (UHP)"readme = "README.md"requires-python = ">=3.10"diff --git a/protocol/conformance/tests/plugin_stub.py b/protocol/conformance/tests/plugin_stub.pynew file mode 100644index 00000000..d2348508--- /dev/null+++ b/protocol/conformance/tests/plugin_stub.py@@ -0,0 +1,364 @@+"""A deliberately wrong UHP server, with one toggleable defect per rule in the Plugins chapter.++The P-series checks what a server DERIVES from a package, what it REFUSES, and what it leaves+out of an export. A check that only ever passes proves nothing about any of that, so this stub+implements the Plugins chapter in memory, correctly by default, and takes a DEFECT environment+variable naming one thing to get wrong. test_plugin_checks.py drives it once per defect and+asserts the diagonal: each defect is caught by the check that claims to cover it, and by no other.++No task is ever run: every P- check is configuration, so the stub needs no credentials, no+network and no agent tokens, and the matrix finishes in seconds.++ DEFECT=accepts_collision PORT=8932 python3 plugin_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++DEFECT = os.environ.get("DEFECT", "none")+PORT = int(os.environ.get("PORT", "8932"))+KEY = "stub-key"+VERSION = "2026-09-12"+MANIFEST_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"+MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"+NAME_RE = re.compile(r"^(?!.*(--|\.\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$")++DEFECTS = {+ "none",+ "no_plugin_schemas", # capability true, but the schema list is missing+ "copies_into_direct", # the harness's own mcpServers absorb the plugin's+ "files_endpoint_partial", # the files endpoint returns plugin.json alone+ "expands_placeholders", # ${PLUGIN_DATA} comes back as a sandbox path+ "accepts_no_manifest", # a package with no plugin.json installs+ "accepts_collision", # a plugin server named like the harness's own installs+ "loses_files_on_rename", # PUT keeps only the first file of each package+ "export_leaks_credentials", # the export carries auth and headers+ "export_unrecorded", # the export omits credentials and says nothing+ "drops_invalid_silently", # an invalid mcp.json entry vanishes with no skipped record+ "enabled_not_preserved", # enabled: false is stored as true+ "accepts_unknown_schema", # a manifest for an unknown Agent Plugins version installs+ "accepts_duplicate_name", # two plugins with one name install side by side+}+assert DEFECT in DEFECTS, f"unknown defect {DEFECT!r}; one of {sorted(DEFECTS)}"++HARNESSES: dict[str, dict] = {}+++class Refuse(Exception):+ def __init__(self, status: int, code: str, message: str, detail: dict | None = None):+ super().__init__(message)+ self.status, self.code, self.message, self.detail = status, code, message, detail+++# ── the Plugins chapter, in memory ────────────────────────────────────────────────────────+def check_path(path) -> str:+ if not isinstance(path, str) or not path or path.startswith("/"):+ raise Refuse(422, "plugin_invalid", "bad file path", {"path": path, "reason": "not relative"})+ parts = path.split("/")+ if any(seg in ("", ".", "..") for seg in parts):+ raise Refuse(422, "plugin_invalid", "path escapes the plugin root",+ {"path": path, "reason": "escapes the root"})+ return path+++def frontmatter(text: str) -> dict:+ m = re.match(r"^---\n(.*?)\n---", text, flags=re.S)+ out = {}+ for line in (m.group(1) if m else "").splitlines():+ if ":" in line:+ k, v = line.split(":", 1)+ out[k.strip()] = v.strip()+ return out+++def load_package(item: dict) -> dict:+ """Read a package as an Agent Plugins client would. Returns the derived plugin object."""+ files = item.get("files") or []+ if not isinstance(files, list) or not files:+ raise Refuse(422, "plugin_invalid", "a plugin needs files", {"path": "", "reason": "no files"})+ by_path = {check_path(f.get("path")): f for f in files}+ skipped: list[dict] = []++ raw = by_path.get("plugin.json")+ if raw is None:+ if DEFECT == "accepts_no_manifest":+ manifest = {"$schema": MANIFEST_SCHEMA, "name": "unnamed"}+ else:+ raise Refuse(422, "plugin_invalid", "no plugin.json at the root",+ {"path": "plugin.json", "reason": "missing"})+ else:+ try:+ manifest = json.loads(raw.get("content") or "")+ except Exception:+ raise Refuse(422, "plugin_invalid", "plugin.json is not JSON",+ {"path": "plugin.json", "reason": "not JSON"})+ if not isinstance(manifest, dict):+ raise Refuse(422, "plugin_invalid", "plugin.json is not an object",+ {"path": "plugin.json", "reason": "not an object"})+ if manifest.get("$schema") != MANIFEST_SCHEMA and DEFECT != "accepts_unknown_schema":+ raise Refuse(422, "unsupported_plugin_schema", "unsupported Agent Plugins version",+ {"supported": [MANIFEST_SCHEMA]})+ name = manifest.get("name")+ if not isinstance(name, str) or not NAME_RE.match(name):+ raise Refuse(422, "plugin_invalid", "manifest name is invalid",+ {"path": "plugin.json#/name", "reason": "does not satisfy §5.5"})+ known = {"$schema", "name", "version", "description", "author", "homepage", "repository",+ "license", "keywords", "extensions"}+ for k in manifest:+ if k not in known:+ skipped.append({"path": f"plugin.json#/{k}", "reason": "unknown top-level field"})+ if item.get("name") not in (None, name):+ raise Refuse(422, "plugin_invalid", "name contradicts the manifest",+ {"path": "plugin.json#/name", "reason": f"sent {item.get('name')!r}"})++ servers: list[dict] = []+ raw = by_path.get("mcp.json")+ if raw is not None:+ try:+ mcp = json.loads(raw.get("content") or "")+ except Exception:+ mcp = None+ entries = (mcp or {}).get("mcpServers") if isinstance(mcp, dict) else None+ if not isinstance(mcp, dict) or mcp.get("$schema") != MCP_SCHEMA or not isinstance(entries, dict):+ skipped.append({"path": "mcp.json", "reason": "not a valid Agent Plugins 1.0.0 mcp.json"})+ entries = {}+ for sname, cfg in entries.items():+ cfg = cfg if isinstance(cfg, dict) else {}+ t = cfg.get("type")+ allowed = {"stdio": {"type", "command", "args", "env", "cwd"},+ "streamable-http": {"type", "url", "headers"},+ "sse": {"type", "url", "headers"}}.get(t)+ ok = allowed is not None and set(cfg) <= allowed and (+ isinstance(cfg.get("command"), str) if t == "stdio" else isinstance(cfg.get("url"), str))+ if not ok:+ if DEFECT != "drops_invalid_silently":+ skipped.append({"path": f"mcp.json#/mcpServers/{sname}",+ "reason": f"not a valid server entry (type {t!r})"})+ continue+ s = {"name": sname, "enabled": True}+ if t == "stdio":+ s.update({"transport": "stdio", "command": cfg["command"]})+ for k in ("args", "env", "cwd"):+ if k in cfg:+ s[k] = cfg[k]+ if DEFECT == "expands_placeholders":+ s["args"] = [a.replace("${PLUGIN_DATA}", "/sandbox/plugin-data") for a in s.get("args", [])]+ else:+ s.update({"transport": "http" if t == "streamable-http" else "sse", "url": cfg["url"]})+ if "headers" in cfg:+ s["headers"] = cfg["headers"]+ servers.append(s)++ skills: list[dict] = []+ dirs = sorted({p.split("/")[1] for p in by_path if p.startswith("skills/") and p.count("/") >= 2})+ for d in dirs:+ md = by_path.get(f"skills/{d}/SKILL.md")+ if md is None:+ continue # not a skill, per Agent Plugins §7.1+ fm = frontmatter(md.get("content") or "")+ if fm.get("name") != d or not fm.get("description"):+ skipped.append({"path": f"skills/{d}", "reason": "SKILL.md does not conform to Agent Skills"})+ continue+ skills.append({"name": d, "description": fm["description"]})++ enabled = item.get("enabled", True) is not False+ if DEFECT == "enabled_not_preserved":+ enabled = True+ return {"name": name, "enabled": enabled, "manifest": manifest, "mcpServers": servers,+ "skills": skills, "skipped": skipped, "files": files}+++def build_harness(body: dict, existing: dict | None = None) -> dict:+ base = body.get("base")+ if base != "stub":+ raise Refuse(422, "unsupported_base", "unsupported base", {"supported": ["stub"]})+ skills = []+ for s in body.get("skills") or []:+ files = s.get("files") or ([{"path": "SKILL.md", "content": s["content"]}] if s.get("content") else [])+ if not any(f.get("path") == "SKILL.md" for f in files):+ raise Refuse(422, "invalid_input", "a skill needs a SKILL.md")+ skills.append({"name": s.get("name"), "enabled": s.get("enabled", True) is not False, "files": files})+ for s in body.get("mcp_servers") or []:+ if not isinstance(s.get("url"), str):+ raise Refuse(422, "invalid_input", "a harness MCP server needs a url")+ plugins = [load_package(p) for p in body.get("plugins") or []]+ if existing and DEFECT == "loses_files_on_rename":+ for p in plugins:+ p["files"] = p["files"][:1]++ seen: dict[str, str] = {}+ for p in plugins:+ if p["name"] in seen and DEFECT != "accepts_duplicate_name":+ raise Refuse(409, "plugin_conflict", "two plugins share a name",+ {"component": "plugin", "name": p["name"], "between": [p["name"], p["name"]]})+ seen[p["name"]] = "plugin"+ for component, direct, key in (("mcp_server", body.get("mcp_servers") or [], "mcpServers"),+ ("skill", skills, "skills")):+ owners: dict[str, str] = {d.get("name"): "harness" for d in direct if d.get("enabled", True) is not False}+ for p in plugins:+ if not p["enabled"]:+ continue+ for c in p[key]:+ if c["name"] in owners and DEFECT != "accepts_collision":+ raise Refuse(409, "plugin_conflict", f"{component} name collides",+ {"component": component, "name": c["name"],+ "between": [owners[c["name"]], p["name"]]})+ owners[c["name"]] = p["name"]+ return {"id": (existing or {}).get("id") or f"chrn_{uuid.uuid4().hex}", "name": body.get("name") or "",+ "base": base, "mcp_servers": body.get("mcp_servers") or [], "skills": skills,+ "plugins": plugins, "disabled_tools": body.get("disabled_tools") or [],+ "created_at": (existing or {}).get("created_at") or int(time.time() * 1000)}+++def out(h: dict) -> dict:+ servers = list(h["mcp_servers"])+ if DEFECT == "copies_into_direct":+ for p in h["plugins"]:+ servers += p["mcpServers"]+ return {"id": h["id"], "object": "harness", "name": h["name"], "base": h["base"],+ "mcpServers": servers, "skills": h["skills"], "plugins": h["plugins"],+ "disabledTools": h["disabled_tools"], "createdAt": h["created_at"]}+++def plugin_name_of(h: dict) -> str:+ n = re.sub(r"[^a-z0-9.]+", "-", h["name"].lower()).strip("-")+ n = re.sub(r"\.{2,}", ".", n).strip(".")+ if not NAME_RE.match(n):+ n = re.sub(r"[^a-z0-9.]+", "-", h["id"].lower()).strip("-")+ return n+++def export(h: dict) -> dict:+ files = [{"path": "plugin.json", "content": json.dumps({"$schema": MANIFEST_SCHEMA, "name": plugin_name_of(h)})}]+ skipped = []+ entries = {}+ for s in h["mcp_servers"]:+ if s.get("enabled", True) is False:+ continue+ t = s.get("transport") or "http"+ e = {"type": "streamable-http" if t == "http" else "sse", "url": s.get("url")}+ for k in ("auth", "headers"):+ if k in s:+ if DEFECT == "export_leaks_credentials":+ e[k] = s[k]+ elif DEFECT != "export_unrecorded":+ skipped.append({"path": f"mcp.json#/mcpServers/{s['name']}/{k}",+ "reason": "credentials are not exported"})+ entries[s["name"]] = e+ if entries:+ files.append({"path": "mcp.json", "content": json.dumps({"$schema": MCP_SCHEMA, "mcpServers": entries})})+ for sk in h["skills"]:+ if not sk["enabled"]:+ continue+ for f in sk["files"]:+ files.append({**f, "path": f"skills/{sk['name']}/{f['path']}"})+ return load_package({"files": files}) | {"skipped": skipped}+++class H(BaseHTTPRequestHandler):+ protocol_version = "HTTP/1.1"++ def log_message(self, *a): # quiet+ 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", VERSION)+ self.send_header("content-length", str(len(body)))+ self.end_headers()+ if body:+ self.wfile.write(body)++ def refuse(self, e: Refuse):+ err = {"type": "invalid_request_error", "code": e.code, "message": e.message,+ "param": None, "detail": e.detail}+ return self.send(e.status, {"error": err})++ def authed(self) -> bool:+ return (self.headers.get("authorization") or "").removeprefix("Bearer ").strip() == KEY++ def read_body(self) -> dict:+ n = int(self.headers.get("content-length") or 0)+ raw = self.rfile.read(n) if n else b""+ try:+ return json.loads(raw or b"{}")+ except Exception:+ return {}++ def path_parts(self):+ return [p for p in urlsplit(self.path).path.split("/") if p]++ def do_GET(self):+ self.route("GET")++ def do_POST(self):+ self.route("POST")++ def do_PUT(self):+ self.route("PUT")++ def do_DELETE(self):+ self.route("DELETE")++ def route(self, method: str):+ body = self.read_body()+ p = self.path_parts()+ if method == "GET" and p == ["v1", "uhp"]:+ d = {"object": "uhp.discovery", "protocol": "uhp", "versions": [VERSION],+ "default_version": VERSION, "conformance_class": "full",+ "capabilities": {"streaming": True, "sessions": True, "cancellation": True,+ "files_input": True, "files_output": True, "session_listing": True,+ "harness_management": True, "plugins": True},+ "plugin_schemas": [MANIFEST_SCHEMA]}+ if DEFECT == "no_plugin_schemas":+ d.pop("plugin_schemas")+ return self.send(200, d)+ if not self.authed():+ return self.send(401, {"error": {"type": "authentication_error", "code": "missing_credential",+ "message": "no credential", "param": None, "detail": None}})+ try:+ if p[:2] != ["v1", "harnesses"]:+ raise Refuse(404, "not_found", "no such endpoint")+ if method == "GET" and len(p) == 2:+ return self.send(200, {"harnesses": [out(h) for h in HARNESSES.values()]})+ if method == "POST" and len(p) == 2:+ h = build_harness(body)+ HARNESSES[h["id"]] = h+ return self.send(200, out(h))+ h = HARNESSES.get(p[2]) if len(p) >= 3 else None+ if h is None:+ raise Refuse(404, "harness_not_found", "no such harness")+ if method == "GET" and len(p) == 3:+ return self.send(200, out(h))+ if method == "PUT" and len(p) == 3:+ HARNESSES[h["id"]] = build_harness({**body, "base": h["base"]}, existing=h)+ return self.send(200, out(HARNESSES[h["id"]]))+ if method == "DELETE" and len(p) == 3:+ HARNESSES.pop(h["id"], None)+ return self.send(200, {"id": h["id"], "deleted": True})+ if method == "GET" and len(p) == 4 and p[3] == "plugin":+ return self.send(200, export(h))+ if method == "GET" and len(p) == 6 and p[3] in ("plugins", "skills") and p[5] == "files":+ items = h["plugins"] if p[3] == "plugins" else h["skills"]+ hit = next((i for i in items if i["name"] == p[4]), None)+ if hit is None:+ raise Refuse(404, "plugin_not_found" if p[3] == "plugins" else "invalid_input", "no such item")+ files = hit["files"]+ if DEFECT == "files_endpoint_partial" and p[3] == "plugins":+ files = [f for f in files if f["path"] == "plugin.json"]+ return self.send(200, {"files": files})+ raise Refuse(404, "not_found", "no such endpoint")+ except Refuse as e:+ return self.refuse(e)+++if __name__ == "__main__":+ ThreadingHTTPServer(("127.0.0.1", PORT), H).serve_forever()diff --git a/protocol/conformance/tests/test_plugin_checks.py b/protocol/conformance/tests/test_plugin_checks.pynew file mode 100644index 00000000..ee5c4150--- /dev/null+++ b/protocol/conformance/tests/test_plugin_checks.py@@ -0,0 +1,119 @@+"""The P-series is tested the way it asks servers to be tested: by being shown to fail.++The Plugins chapter is a set of derivations, refusals and omissions, and a check that only ever+passes cannot tell a server that refuses from one that does not. So every P- check runs against+a deliberately wrong server (plugin_stub.py) carrying one defect at a time. Each defect must be+caught by the check that claims to cover it, by no other, and a clean server must pass all ten.+No task is ever run, so this needs no credentials, no network and no agent tokens.+"""+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 / "plugin_stub.py"++# Each defect, and the check whose message names exactly that mistake.+CAUGHT_BY = {+ "no_plugin_schemas": "P-01",+ "copies_into_direct": "P-02",+ "files_endpoint_partial": "P-02",+ "expands_placeholders": "P-02",+ "accepts_no_manifest": "P-03",+ "accepts_collision": "P-04",+ "loses_files_on_rename": "P-05",+ "export_leaks_credentials": "P-06",+ "export_unrecorded": "P-06",+ "drops_invalid_silently": "P-07",+ "enabled_not_preserved": "P-08",+ "accepts_unknown_schema": "P-09",+ "accepts_duplicate_name": "P-10",+}+++def _free_port() -> int:+ with socket.socket() as s:+ s.bind(("127.0.0.1", 0))+ return s.getsockname()[1]+++def _run_series(defect: str) -> dict[str, Outcome]:+ """Every P- check against a stub carrying `defect`, in registration order."""+ port = _free_port()+ srv = subprocess.Popen([sys.executable, str(STUB)],+ env={"DEFECT": defect, "PORT": str(port), "PATH": "/usr/bin:/bin"},+ 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.startswith("P-")}+ finally:+ srv.terminate()+ srv.wait(timeout=5)+++def test_the_series_is_registered_at_full():+ ids = [c.id for c in REGISTRY if c.id.startswith("P-")]+ assert ids == [f"P-{i:02d}" for i in range(1, 11)]+ assert {c.cls for c in REGISTRY if c.id.startswith("P-")} == {"full"}+++def test_a_conformant_server_passes_every_check():+ out = _run_series("none")+ assert all(o is Outcome.PASS for o in out.values()), out++[email protected]("defect,expected", sorted(CAUGHT_BY.items()))+def test_each_defect_is_caught_by_its_own_check(defect, expected):+ out = _run_series(defect)+ assert out[expected] is Outcome.FAIL, f"{defect!r} was not caught by {expected}: {out}"++[email protected]("defect,expected", sorted(CAUGHT_BY.items()))+def test_no_other_check_reports_a_failure_for_that_defect(defect, expected):+ """One defect, one red check. A second failure elsewhere is a misleading diagnosis."""+ out = _run_series(defect)+ also_failed = [i for i, o in out.items() if o is Outcome.FAIL and i != expected]+ assert not also_failed, f"{defect!r} also failed {also_failed}, which diagnoses one bug twice"+++def test_no_check_errors_on_any_defect():+ """An ERROR is a bug in the suite. It must never be how a defect gets reported."""+ for defect in ["none", *CAUGHT_BY]:+ out = _run_series(defect)+ assert Outcome.ERROR not in out.values(), f"{defect}: {out}"+++def test_a_server_without_the_capability_skips_the_series():+ """Plugins are a MAY: a server that reports the capability false must skip, never fail."""+ from uhp_conformance.registry import Skip+ from uhp_conformance.checks import _plugins_supported++ class _Client:+ def get(self, path, auth=True):+ class R:+ json = {"capabilities": {"plugins": False}}+ return R()++ with pytest.raises(Skip):+ _plugins_supported(Context(client=_Client()))diff --git a/protocol/conformance/uhp_conformance/__init__.py b/protocol/conformance/uhp_conformance/__init__.pyindex a635850a..d2063ec4 100644--- a/protocol/conformance/uhp_conformance/__init__.py+++ b/protocol/conformance/uhp_conformance/__init__.py@@ -1,3 +1,3 @@"""UHP conformance suite — the definition of "conformant" for the Unified Harness Protocol."""-__version__ = "2026.8.11.post1"-UHP_VERSION = "2026-08-11"+__version__ = "2026.9.12"+UHP_VERSION = "2026-09-12"diff --git a/protocol/conformance/uhp_conformance/checks.py b/protocol/conformance/uhp_conformance/checks.pyindex 0e0ee408..e96c589f 100644--- a/protocol/conformance/uhp_conformance/checks.py+++ b/protocol/conformance/uhp_conformance/checks.py@@ -18,7 +18,7 @@ import uuidfrom .registry import Skip, check-SPEC = "protocol/versions/2026-08-11"+SPEC = "protocol/versions/2026-09-12"# ── shared fixtures ────────────────────────────────────────────────────────────────────@@ -811,6 +811,310 @@ def f06(ctx):return "mcp + disabledTools preserved"+# ══════════════════════════════════════════════════════════════════════════════════════+# Full — plugins (capability `plugins`, Plugins chapter)+# ══════════════════════════════════════════════════════════════════════════════════════+# Every P- check creates its harnesses through _managed_harness, so F-07 below removes them.++_AP_MANIFEST_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"+_AP_MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"+++def _plugins_supported(ctx) -> None:+ """Skip, with the reason, unless discovery reports the capability. Plugins are a MAY."""+ d = ctx.state.get("discovery") or ctx.client.get("/v1/uhp", auth=False).json or {}+ ctx.state["discovery"] = d+ if not (d.get("capabilities") or {}).get("plugins"):+ raise Skip("this server reports the plugins capability false or absent, and the Plugins "+ "chapter is optional at every class")+++def _package(name: str = "uhp-conformance-plugin", *, manifest: dict | None = None,+ mcp: dict | None = None, skill: bool = True, extra: list | None = None) -> list[dict]:+ """An Agent Plugins package as UHP files: manifest, mcp.json, one skill folder with a nested+ reference and a binary member. `manifest=None` omits plugin.json; `mcp=None` omits mcp.json."""+ files = []+ if manifest is not None:+ files.append({"path": "plugin.json", "content": json.dumps(manifest)})+ if mcp is not None:+ files.append({"path": "mcp.json", "content": json.dumps(mcp)})+ if skill:+ files += [+ {"path": "skills/conformance-skill/SKILL.md",+ "content": "---\nname: conformance-skill\ndescription: A conformance fixture.\n---\n\n"+ "See references/data.md.\n"},+ {"path": "skills/conformance-skill/references/data.md", "content": "nested reference\n"},+ {"path": "bin/tool.bin", "content_b64": "AAECAwQF"},+ ]+ return files + (extra or [])+++_PLUGIN_MANIFEST = {"$schema": _AP_MANIFEST_SCHEMA, "name": "uhp-conformance-plugin",+ "version": "1.0.0", "description": "A conformance fixture."}+_PLUGIN_MCP = {"$schema": _AP_MCP_SCHEMA, "mcpServers": {+ "conformance-http": {"type": "streamable-http", "url": "https://mcp.example.invalid/mcp"},+ "conformance-stdio": {"type": "stdio", "command": "./bin/tool.bin",+ "args": ["--data", "${PLUGIN_DATA}"]},+}}+_PLUGIN_FILES = _package(manifest=_PLUGIN_MANIFEST, mcp=_PLUGIN_MCP)+_PLUGIN_PATHS = sorted(f["path"] for f in _PLUGIN_FILES)+++def _error_code(r) -> str:+ return str((((r.json or {}) if isinstance(r.json, dict) else {}).get("error") or {}).get("code") or "")+++def _plugin_files(ctx, hid: str, name: str) -> list[str]:+ r = ctx.client.get(f"/v1/harnesses/{hid}/plugins/{name}/files")+ assert r.status == 200, f"plugin files endpoint returned HTTP {r.status}"+ body = r.json+ files = body.get("files") if isinstance(body, dict) else body+ ctx.state["_last_plugin_files"] = files or []+ return sorted(str((f or {}).get("path")) for f in (files or []))+++@check("P-01", "The plugins capability names the manifest schemas it installs", "full",+ f"{SPEC}/plugins.md#7-discovery")+def p01(ctx):+ _plugins_supported(ctx)+ schemas = (ctx.state.get("discovery") or {}).get("plugin_schemas")+ assert isinstance(schemas, list) and schemas and all(isinstance(s, str) and s for s in schemas), (+ f"capabilities.plugins is true but plugin_schemas is {schemas!r}. A client cannot tell which "+ "packages this server will install, so it cannot offer any.")+ return f"plugin_schemas={schemas}"+++@check("P-02", "A plugin package round-trips, and is derived rather than copied", "full",+ f"{SPEC}/plugins.md#2-the-plugin-object")+def p02(ctx):+ _plugins_supported(ctx)+ h = _managed_harness(ctx, plugins=[{"files": _PLUGIN_FILES}])+ got = ctx.client.get(f"/v1/harnesses/{h['id']}").json or {}+ plugins = got.get("plugins") or []+ assert len(plugins) == 1, f"installed one plugin, read back {len(plugins)}"+ pl = plugins[0]+ ctx.validate(pl, "Plugin")+ assert pl.get("name") == "uhp-conformance-plugin", (+ f"the plugin's name is {pl.get('name')!r}; it must be the manifest's name")+ assert (pl.get("manifest") or {}).get("name") == "uhp-conformance-plugin", (+ "manifest was not derived from plugin.json")+ servers = {s.get("name"): s for s in (pl.get("mcpServers") or [])}+ assert set(servers) == {"conformance-http", "conformance-stdio"}, (+ f"mcpServers derived from mcp.json are {sorted(servers)}, expected both entries")+ assert servers["conformance-http"].get("transport") == "http", "streamable-http did not map to http"+ st = servers["conformance-stdio"]+ assert st.get("transport") == "stdio" and st.get("command") == "./bin/tool.bin", (+ f"the stdio entry came back as {st}")+ assert "${PLUGIN_DATA}" in json.dumps(st.get("args")), (+ "the placeholder was expanded in what the client sees; a sandbox path is not the client's "+ "business and changes from turn to turn")+ assert [s.get("name") for s in pl.get("skills") or []] == ["conformance-skill"], (+ f"skills derived from skills/ are {pl.get('skills')}, expected conformance-skill")+ assert isinstance(pl.get("skipped"), list) and not pl["skipped"], (+ f"skipped must be present and empty for a clean package, got {pl.get('skipped')!r}")+ # The compatibility rule: the direct fields report what was written to them, and nothing was.+ assert not got.get("mcpServers") and not got.get("skills"), (+ f"the harness's own mcpServers/skills absorbed the plugin's ({got.get('mcpServers')}, "+ f"{got.get('skills')}). A client that PUTs back what it read would then install them twice, "+ "and uninstalling the plugin would leave them behind.")+ paths = _plugin_files(ctx, h["id"], "uhp-conformance-plugin")+ assert paths == _PLUGIN_PATHS, (+ f"the package did not round-trip: got {paths}, expected {_PLUGIN_PATHS}. A plugin's skills "+ "carry references and its stdio servers carry executables; a partial package breaks both.")+ assert "AAECAwQF" in json.dumps(ctx.state.get("_last_plugin_files")), (+ "the binary member's content_b64 was not preserved byte-for-byte")+ return f"{len(paths)} files, 2 servers, 1 skill derived"+++@check("P-03", "A package without plugin.json is refused at configuration time", "full",+ f"{SPEC}/plugins.md#21-files")+def p03(ctx):+ _plugins_supported(ctx)+ base = _supported_base(ctx)+ r = ctx.client.post("/v1/harnesses", body={+ "name": "uhp-conformance-nomanifest", "base": base,+ "plugins": [{"files": _package(manifest=None, mcp=_PLUGIN_MCP)}]})+ if r.status == 200:+ ctx.client.delete(f"/v1/harnesses/{(r.json or {}).get('id')}")+ raise AssertionError(+ "a package with no plugin.json was accepted; there is no plugin without a manifest, and "+ "storing one means it is silently ignored at run time")+ assert r.status in (400, 422), f"expected 400/422, got HTTP {r.status}"+ assert _error_code(r) == "plugin_invalid", (+ f"refused with code {_error_code(r)!r}, expected plugin_invalid")+ return f"refused with HTTP {r.status} plugin_invalid"+++@check("P-04", "A component name collision across the harness and a plugin is refused", "full",+ f"{SPEC}/plugins.md#42-one-namespace-checked-at-configuration-time")+def p04(ctx):+ _plugins_supported(ctx)+ base = _supported_base(ctx)+ direct = [{"name": "conformance-http", "url": "https://direct.example.invalid/mcp",+ "transport": "http"}]+ r = ctx.client.post("/v1/harnesses", body={+ "name": "uhp-conformance-collision", "base": base,+ "mcp_servers": direct, "plugins": [{"files": _PLUGIN_FILES}]})+ if r.status == 200:+ ctx.client.delete(f"/v1/harnesses/{(r.json or {}).get('id')}")+ raise AssertionError(+ "a plugin whose MCP server shares a name with the harness's own was accepted. The agent "+ "sees one flat namespace, so one of the two is silently lost at run time.")+ assert r.status == 409, f"expected 409, got HTTP {r.status}"+ assert _error_code(r) == "plugin_conflict", (+ f"refused with code {_error_code(r)!r}, expected plugin_conflict")+ detail = (((r.json or {}).get("error") or {}).get("detail") or {})+ assert detail.get("component") == "mcp_server" and detail.get("name") == "conformance-http", (+ f"detail does not say which component collided: {detail}")+ return "refused with 409 plugin_conflict"+++@check("P-05", "An unrelated harness edit does not destroy plugin contents", "full",+ f"{SPEC}/plugins.md#3-installing-a-plugin")+def p05(ctx):+ _plugins_supported(ctx)+ h = _managed_harness(ctx, plugins=[{"files": _PLUGIN_FILES}])+ hid = h["id"]+ got = ctx.client.get(f"/v1/harnesses/{hid}").json or {}+ if got.get("mcpServers") or got.get("skills"):+ raise Skip("the harness's own mcpServers/skills carry the plugin's components, which P-02 "+ "reports; a round trip on top of that cannot be measured separately")+ if _plugin_files(ctx, hid, "uhp-conformance-plugin") != _PLUGIN_PATHS:+ raise Skip("the package is already incomplete before any edit, which P-02 reports")+ # Rename only, sending back exactly what was read: the case the round-trip rule exists for.+ r = ctx.client.put(f"/v1/harnesses/{hid}", body={+ "name": "uhp-conformance-renamed", "base": got.get("base"),+ "plugins": got.get("plugins") or [], "skills": got.get("skills") or [],+ "mcp_servers": got.get("mcpServers") or [], "disabled_tools": got.get("disabledTools") or []})+ assert r.status == 200, f"rename returned HTTP {r.status}: {r.body[:160]!r}"+ paths = _plugin_files(ctx, hid, "uhp-conformance-plugin")+ assert paths == _PLUGIN_PATHS, (+ f"after renaming the harness the package is {paths} — the round trip lost contents, which a "+ "user cannot detect until an agent behaves oddly.")+ after = ctx.client.get(f"/v1/harnesses/{hid}").json or {}+ assert [p.get("name") for p in after.get("plugins") or []] == ["uhp-conformance-plugin"], (+ f"after the rename the plugin list is {after.get('plugins')}")+++@check("P-06", "A harness exports as a package that installs, without its credentials", "full",+ f"{SPEC}/plugins.md#5-exporting-a-harness-as-a-plugin")+def p06(ctx):+ _plugins_supported(ctx)+ direct = [{"name": "conformance-direct", "url": "https://mcp.example.invalid/mcp",+ "transport": "http", "headers": {"X-Team": "conformance"}, "auth": "secret-token"}]+ h = _managed_harness(ctx, mcp_servers=direct, skills=[_SKILL_BUNDLE])+ r = ctx.client.get(f"/v1/harnesses/{h['id']}/plugin")+ assert r.status == 200, f"export returned HTTP {r.status}"+ pl = r.json if isinstance(r.json, dict) else {}+ ctx.validate(pl, "Plugin")+ files = {str((f or {}).get("path")): (f or {}) for f in pl.get("files") or []}+ assert "plugin.json" in files, f"the export has no plugin.json; files: {sorted(files)}"+ manifest = json.loads(files["plugin.json"].get("content") or "{}")+ ctx.validate(manifest, "PluginManifest")+ assert manifest.get("name") == pl.get("name"), "the export's name and its manifest's disagree"+ assert "mcp.json" in files, f"the enabled MCP server was not exported; files: {sorted(files)}"+ mcp = json.loads(files["mcp.json"].get("content") or "{}")+ entry = (mcp.get("mcpServers") or {}).get("conformance-direct") or {}+ assert entry.get("type") == "streamable-http" and entry.get("url"), (+ f"the http server exported as {entry}, expected type streamable-http with its url")+ assert "headers" not in entry and "auth" not in entry, (+ f"the export carries the operator's credentials: {sorted(entry)}. An export is meant to leave.")+ assert json.dumps(entry).find("secret-token") < 0, "the bearer token leaked into the export"+ skipped = json.dumps(pl.get("skipped") or [])+ assert "conformance-direct" in skipped, (+ "the omitted credentials are not recorded in skipped, so whoever imports the package cannot "+ "know what to re-enter")+ want = {"skills/uhp-conformance-skill/SKILL.md", "skills/uhp-conformance-skill/references/data.md",+ "skills/uhp-conformance-skill/assets/blob.bin"}+ assert want <= set(files), f"the skill folder was not exported whole: {sorted(files)}"+ # The promise is that the result installs unchanged.+ h2 = _managed_harness(ctx, plugins=[{"files": list(files.values())}])+ got = (ctx.client.get(f"/v1/harnesses/{h2['id']}").json or {}).get("plugins") or []+ assert len(got) == 1 and got[0].get("name") == pl.get("name"), (+ f"the exported package did not install into a fresh harness: {got}")+ assert [s.get("name") for s in got[0].get("mcpServers") or []] == ["conformance-direct"], (+ f"the reinstalled plugin's servers are {got[0].get('mcpServers')}")+ assert [s.get("name") for s in got[0].get("skills") or []] == ["uhp-conformance-skill"], (+ f"the reinstalled plugin's skills are {got[0].get('skills')}")+ return f"exported {len(files)} files as {pl.get('name')!r}, reinstalled"+++@check("P-07", "A component that fails to load is recorded, not silently dropped", "full",+ f"{SPEC}/plugins.md#22-what-the-server-derives")+def p07(ctx):+ _plugins_supported(ctx)+ mcp = {"$schema": _AP_MCP_SCHEMA, "mcpServers": {+ "conformance-http": {"type": "streamable-http", "url": "https://mcp.example.invalid/mcp"},+ "conformance-broken": {"type": "carrier-pigeon", "url": "https://mcp.example.invalid/x"}}}+ h = _managed_harness(ctx, plugins=[{"files": _package(manifest=_PLUGIN_MANIFEST, mcp=mcp)}])+ pl = ((ctx.client.get(f"/v1/harnesses/{h['id']}").json or {}).get("plugins") or [{}])[0]+ names = [s.get("name") for s in pl.get("mcpServers") or []]+ assert names == ["conformance-http"], (+ f"derived servers are {names}: the invalid entry must be skipped and the valid one kept")+ skipped = pl.get("skipped") or []+ hit = [s for s in skipped if "conformance-broken" in str(s.get("path"))]+ assert hit, (+ f"the invalid server was dropped without a skipped entry (skipped={skipped}). Ignoring is "+ "allowed; silent ignoring is not.")+ assert hit[0].get("reason"), "the skipped entry carries no reason"+ return f"skipped: {hit[0].get('path')}"+++@check("P-08", "A disabled plugin stays installed, and stays disabled", "full",+ f"{SPEC}/plugins.md#3-installing-a-plugin")+def p08(ctx):+ _plugins_supported(ctx)+ h = _managed_harness(ctx, plugins=[{"files": _PLUGIN_FILES, "enabled": False}])+ pl = ((ctx.client.get(f"/v1/harnesses/{h['id']}").json or {}).get("plugins") or [{}])[0]+ assert pl.get("name") == "uhp-conformance-plugin", f"the disabled plugin was not kept: {pl}"+ assert pl.get("enabled") is False, (+ "enabled: false was not preserved; a client cannot tell an inert plugin from an active one, "+ "and the difference decides whether a third party's server is launched")+++@check("P-09", "An unsupported manifest schema is refused, naming the supported ones", "full",+ f"{SPEC}/plugins.md#22-what-the-server-derives")+def p09(ctx):+ _plugins_supported(ctx)+ base = _supported_base(ctx)+ manifest = {**_PLUGIN_MANIFEST,+ "$schema": "https://agent-plugins.org/schemas/0.0.1/plugin.schema.json"}+ r = ctx.client.post("/v1/harnesses", body={+ "name": "uhp-conformance-oldschema", "base": base,+ "plugins": [{"files": _package(manifest=manifest, mcp=None)}]})+ if r.status == 200:+ ctx.client.delete(f"/v1/harnesses/{(r.json or {}).get('id')}")+ raise AssertionError(+ "a manifest targeting an Agent Plugins version this server never claimed to support was "+ "accepted; its rules were not applied, so whatever it declares was interpreted by guess")+ assert r.status == 422, f"expected 422, got HTTP {r.status}"+ assert _error_code(r) == "unsupported_plugin_schema", (+ f"refused with code {_error_code(r)!r}, expected unsupported_plugin_schema")+ supported = ((((r.json or {}).get("error") or {}).get("detail") or {}).get("supported"))+ assert isinstance(supported, list) and supported, (+ f"detail.supported is {supported!r}; the refusal must say what would have been accepted")+ return f"refused; supported={supported}"+++@check("P-10", "Two plugins with the same name are refused", "full",+ f"{SPEC}/plugins.md#3-installing-a-plugin")+def p10(ctx):+ _plugins_supported(ctx)+ base = _supported_base(ctx)+ twin = _package(manifest=_PLUGIN_MANIFEST, mcp=None, skill=False)+ r = ctx.client.post("/v1/harnesses", body={+ "name": "uhp-conformance-twins", "base": base,+ "plugins": [{"files": _PLUGIN_FILES}, {"files": twin}]})+ if r.status == 200:+ ctx.client.delete(f"/v1/harnesses/{(r.json or {}).get('id')}")+ raise AssertionError("two plugins named uhp-conformance-plugin were installed side by side; "+ "the name is the address of the files endpoint, so one is unreachable")+ assert r.status == 409, f"expected 409, got HTTP {r.status}"+ assert _error_code(r) == "plugin_conflict", (+ f"refused with code {_error_code(r)!r}, expected plugin_conflict")+ return "refused with 409 plugin_conflict"++@check("F-07", "Configured harnesses are cleaned up", "full", f"{SPEC}/harnesses.md#53-delete")def f07(ctx):ids = [i for i in ctx.state.get("_cleanup_harnesses") or [] if i]diff --git a/protocol/conformance/uhp_conformance/cli.py b/protocol/conformance/uhp_conformance/cli.pyindex fd579f91..43938df7 100644--- a/protocol/conformance/uhp_conformance/cli.py+++ b/protocol/conformance/uhp_conformance/cli.py@@ -51,11 +51,12 @@ def main(argv=None) -> int:if not a.plain:print("\r", end="")- print(render(results, a.base_url, a.cls, plain=a.plain))+ discovery = ctx.state.get("discovery")+ print(render(results, a.base_url, a.cls, plain=a.plain, discovery=discovery))if a.json_out:with open(a.json_out, "w") as f:- f.write(to_json(results, a.base_url, a.cls) + "\n")+ f.write(to_json(results, a.base_url, a.cls, discovery=discovery) + "\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/context.py b/protocol/conformance/uhp_conformance/context.pyindex aad8048c..6c0adf1d 100644--- a/protocol/conformance/uhp_conformance/context.py+++ b/protocol/conformance/uhp_conformance/context.py@@ -13,7 +13,7 @@ except ImportError: # pragma: no coverfrom .client import ClientSCHEMA_PATH = (pathlib.Path(__file__).resolve().parents[2]- / "schema" / "uhp-2026-08-11.schema.json")+ / "schema" / "uhp-2026-09-12.schema.json")@dataclassdiff --git a/protocol/conformance/uhp_conformance/report.py b/protocol/conformance/uhp_conformance/report.pyindex 534a7d99..42975c5b 100644--- a/protocol/conformance/uhp_conformance/report.py+++ b/protocol/conformance/uhp_conformance/report.py@@ -4,7 +4,7 @@ from __future__ import annotationsimport jsonfrom datetime import datetime, timezone-from . import __version__+from . import UHP_VERSION, __version__from .registry import CLASSES, OutcomeGREEN, RED, YELLOW, GREY, BOLD, RESET = (@@ -13,7 +13,16 @@ MARK = {Outcome.PASS: f"{GREEN}PASS{RESET}", Outcome.FAIL: f"{RED}FAIL{RESET}",Outcome.SKIP: f"{YELLOW}SKIP{RESET}", Outcome.ERROR: f"{RED}ERR {RESET}"}-def render(results, target: str, cls: str, plain: bool = False) -> str:+def served_version(discovery: dict | None) -> str:+ """The version the server says it serves by default. The suite measures the contract of+ UHP_VERSION; the claim a run supports names the version the server actually answered+ with, because a 2026-08-11 server that passes every applicable check is 2026-08-11+ conformant, not 2026-09-12 conformant, and the label must not promote it."""+ d = discovery or {}+ 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 c(s, colour):return s if plain else f"{colour}{s}{RESET}"@@ -22,7 +31,11 @@ def render(results, target: str, cls: str, plain: bool = False) -> str:lines = [""]lines.append(c(f"UHP conformance — {target}", BOLD))- lines.append(f"protocol 2026-08-11 · requested class: {cls}")+ served = served_version(discovery)+ lines.append(f"suite {UHP_VERSION} · server serves {served} · requested class: {cls}")+ if served != UHP_VERSION and served in ("2026-08-11",):+ lines.append(f" ({served} is the previous version; {UHP_VERSION} is additive to it, so every "+ f"check applies and the plugin series skips)")lines.append("")for k in CLASSES[: CLASSES.index(cls) + 1]:@@ -56,10 +69,10 @@ def render(results, target: str, cls: str, plain: bool = False) -> str: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 2026-08-11 ({cls})", YELLOW))+ 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 2026-08-11 ({cls})", GREEN))+ lines.append(c(f" CONFORMANT — UHP {served} ({cls})", GREEN))lines.append("")return "\n".join(lines)@@ -98,16 +111,19 @@ def _wrap(text: str, width: int):return out or [""]-def to_json(results, target: str, cls: str) -> str:+def to_json(results, target: str, cls: str, discovery: dict | None = None) -> str:n = {o.value: sum(1 for r in results if r.outcome is o) for o in Outcome}return json.dumps({"protocol": "uhp",- "protocol_version": "2026-08-11",+ # The version the server served, which is what the verdict is a claim about; the+ # suite's own version is the contract it measured against.+ "protocol_version": served_version(discovery),+ "suite_protocol_version": UHP_VERSION,# The suite revision and the moment of the run, because this file is published as# EVIDENCE (GOVERNANCE.md § Conformance claims) and evidence that cannot be dated or# tied to the suite that produced it has to be dated in prose somewhere else — which is# exactly what happened to the 0.3.0 report. A report without these fields predates- # suite 2026.8.11.post1.+ # suite 2026.9.12."suite_version": __version__,"generated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),"target": target,diff --git a/protocol/schema/build.py b/protocol/schema/build.pyindex 17758126..8a807750 100644--- a/protocol/schema/build.py+++ b/protocol/schema/build.py@@ -25,7 +25,7 @@ except ImportError: # pragma: no cover - environment guidance, not logicsys.exit("PyYAML is required: pip install pyyaml")HERE = pathlib.Path(__file__).parent-VERSION = "2026-08-11"+VERSION = "2026-09-12"SRC = HERE / f"uhp-{VERSION}.openapi.yaml"OUT = HERE / f"uhp-{VERSION}.schema.json"diff --git a/protocol/schema/uhp-2026-09-12.openapi.yaml b/protocol/schema/uhp-2026-09-12.openapi.yamlnew file mode 100644index 00000000..d8bb450d--- /dev/null+++ b/protocol/schema/uhp-2026-09-12.openapi.yaml@@ -0,0 +1,1380 @@+openapi: 3.1.0+info:+ title: Unified Harness Protocol+ version: '2026-09-12'+ summary: An open standard for running complete agent harnesses as shared infrastructure.+ description: |+ UHP defines how a product drives a complete agent harness — Codex, Claude Code, Hermes, or any+ other — over HTTP: selecting and configuring a harness, sending work, following progress,+ continuing a session, cancelling execution, handling errors and files, and receiving results.++ This document is normative for **structure**. The prose specification in `protocol/versions/`+ is normative for **behaviour**; where they disagree about behaviour, the prose wins, because+ behaviour is not expressible in OpenAPI.++ Conformance is defined by the suite in `protocol/conformance/`, not by this document.++ This version is additive to 2026-08-11. It adds plugins (packages of tools and skills in the+ Agent Plugins format, installed into a harness, with stdio MCP servers inside them), the+ `plugins` capability, and the error codes those need. Every request and object valid under+ 2026-08-11 is valid here, and no object 2026-08-11 defined changes shape, so a server serves+ both versions from one code path.+ license:+ name: Apache-2.0+ identifier: Apache-2.0+ contact:+ name: UHP maintainers+ url: https://github.com/HarnessRouter/harnessrouter++servers:+ - url: https://your-uhp-server+ description: Any conformant UHP server. The protocol requires no hosted service.+ - url: http://127.0.0.1:3000/api/harness+ description: HarnessRouter Community Edition, default local deployment++security:+ - bearerAuth: []++tags:+ - name: Discovery+ description: Protocol version and capability discovery (conformance class Core)+ - name: Harnesses+ description: Discovering, selecting and managing configured harnesses+ - name: Tasks+ description: Running work and reading results+ - name: Sessions+ description: Continuing, inspecting and cancelling sessions+ - name: Files+ description: File input and artifact retrieval (conformance class Extended)+ - name: Plugins+ description: Packages of tools and skills installed into a harness (capability `plugins`)++paths:+ /v1/uhp:+ get:+ tags: [Discovery]+ operationId: getDiscovery+ summary: Protocol discovery document+ description: |+ Served without authentication: a client must be able to learn whether it is talking to a UHP+ server, and which versions it speaks, before presenting credentials. The document contains+ nothing principal-specific.+ security: []+ responses:+ '200':+ description: The discovery document+ headers:+ UHP-Version: { $ref: '#/components/headers/UHPVersion' }+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Discovery' }++ /v1/harnesses:+ get:+ tags: [Harnesses]+ operationId: listHarnesses+ summary: List configured harnesses+ responses:+ '200':+ description: Harnesses within the caller's scope. May be empty.+ content:+ application/json:+ schema:+ type: object+ required: [harnesses]+ properties:+ harnesses:+ type: array+ items: { $ref: '#/components/schemas/Harness' }+ '401': { $ref: '#/components/responses/Unauthorized' }+ post:+ tags: [Harnesses]+ operationId: createHarness+ summary: Create a configured harness+ description: Conformance class Full. Check the `harness_management` capability first.+ requestBody:+ required: true+ content:+ application/json:+ schema: { $ref: '#/components/schemas/HarnessCreate' }+ responses:+ '200':+ description: The created harness+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Harness' }+ '401': { $ref: '#/components/responses/Unauthorized' }+ '422': { $ref: '#/components/responses/UnprocessableEntity' }++ /v1/harnesses/{harness_id}:+ parameters:+ - $ref: '#/components/parameters/HarnessId'+ get:+ tags: [Harnesses]+ operationId: getHarness+ summary: Get one harness+ responses:+ '200':+ description: The harness+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Harness' }+ '404': { $ref: '#/components/responses/NotFound' }+ put:+ tags: [Harnesses]+ operationId: updateHarness+ summary: Update a harness configuration+ description: |+ Conformance class Full. `id`, `base` and `createdAt` are immutable — changing the base of an+ existing harness would silently change the behaviour of every session attached to it.+ requestBody:+ required: true+ content:+ application/json:+ schema: { $ref: '#/components/schemas/HarnessCreate' }+ responses:+ '200':+ description: The updated harness+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Harness' }+ '404': { $ref: '#/components/responses/NotFound' }+ delete:+ tags: [Harnesses]+ operationId: deleteHarness+ summary: Delete a harness+ description: Must not delete the sessions or responses that used it.+ responses:+ '200':+ description: Deleted+ content:+ application/json:+ schema:+ type: object+ properties:+ id: { type: string }+ deleted: { type: boolean }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/harnesses/{harness_id}/skills/{skill_name}/files:+ parameters:+ - $ref: '#/components/parameters/HarnessId'+ - $ref: '#/components/parameters/SkillName'+ get:+ tags: [Harnesses]+ operationId: getSkillFiles+ summary: The complete file list of one skill+ description: |+ Conformance class Full. Whether or not the server stores the bundle out of line, this returns+ every file of the skill folder, byte-for-byte.+ responses:+ '200':+ description: The skill's files+ content:+ application/json:+ schema: { $ref: '#/components/schemas/FileList' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/harnesses/{harness_id}/plugins/{plugin_name}/files:+ parameters:+ - $ref: '#/components/parameters/HarnessId'+ - $ref: '#/components/parameters/PluginName'+ get:+ tags: [Plugins]+ operationId: getPluginFiles+ summary: The complete package of one installed plugin+ description: |+ Conformance class Full, capability `plugins`. Every file of the package, byte-for-byte, whether+ or not the server stores it out of line. `404` with `plugin_not_found` when the harness has no+ plugin of that name.+ responses:+ '200':+ description: The plugin's files+ content:+ application/json:+ schema: { $ref: '#/components/schemas/FileList' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/harnesses/{harness_id}/plugin:+ parameters:+ - $ref: '#/components/parameters/HarnessId'+ get:+ tags: [Plugins]+ operationId: exportHarnessPlugin+ summary: The harness's own tools and skills as an Agent Plugins package+ description: |+ Conformance class Full, capability `plugins`. Builds a package from the harness's direct+ `mcpServers` and `skills`: a `plugin.json` whose name derives from the harness name, an+ `mcp.json` of the enabled servers with `auth` and `headers` omitted (each omission recorded in+ `skipped`), and each enabled skill folder. Installed plugins, the system prompt, the model,+ the base and `disabledTools` are not included. The result installs into another harness by+ passing it to `plugins` unchanged.+ responses:+ '200':+ description: The package+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Plugin' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/models:+ get:+ tags: [Harnesses]+ operationId: listModels+ summary: The model catalogue, by backend+ responses:+ '200':+ description: Models grouped by backend, each with computed availability+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ModelCatalog' }+ '401': { $ref: '#/components/responses/Unauthorized' }++ /v1/harnesses/{harness_id}/models:+ parameters:+ - $ref: '#/components/parameters/HarnessId'+ get:+ tags: [Harnesses]+ operationId: listHarnessModels+ summary: Models this harness can run+ responses:+ '200':+ description: The harness's allowed models, default and authorized fallback+ content:+ application/json:+ schema: { $ref: '#/components/schemas/HarnessModels' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/responses:+ post:+ tags: [Tasks]+ operationId: createResponse+ summary: Run a task+ description: |+ The core of the protocol. With `stream: false` the server returns one Response object when+ the task reaches a terminal state. With `stream: true` it returns `text/event-stream`+ carrying the events defined in the Streaming chapter.++ Retries MUST carry `Idempotency-Key`: without one, a retry after a timeout runs the task a+ second time while the first may still be running.+ parameters:+ - name: Idempotency-Key+ in: header+ required: false+ schema: { type: string, maxLength: 255 }+ description: Repeating a key returns the first request's result and does not re-execute.+ - name: UHP-Version+ in: header+ required: false+ schema: { type: string, examples: ['2026-08-11'] }+ requestBody:+ required: true+ content:+ application/json:+ schema: { $ref: '#/components/schemas/CreateResponseRequest' }+ responses:+ '200':+ description: |+ The finished Response (non-streaming), or the event stream (streaming).+ headers:+ UHP-Version: { $ref: '#/components/headers/UHPVersion' }+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Response' }+ text/event-stream:+ schema:+ type: string+ description: SSE; each `data:` line is one Event object.+ '401': { $ref: '#/components/responses/Unauthorized' }+ '404': { $ref: '#/components/responses/NotFound' }+ '409': { $ref: '#/components/responses/Conflict' }+ '422': { $ref: '#/components/responses/UnprocessableEntity' }+ '429': { $ref: '#/components/responses/RateLimited' }++ /v1/responses/{response_id}:+ parameters:+ - $ref: '#/components/parameters/ResponseId'+ get:+ tags: [Tasks]+ operationId: getResponse+ summary: Read a task back+ responses:+ '200':+ description: The Response+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Response' }+ '404': { $ref: '#/components/responses/NotFound' }+ delete:+ tags: [Tasks]+ operationId: deleteResponse+ summary: Delete a stored response+ description: Must not cancel a running task — deletion and cancellation are different intentions.+ responses:+ '200':+ description: Deleted+ content:+ application/json:+ schema:+ type: object+ properties:+ id: { type: string }+ deleted: { type: boolean }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/responses/{response_id}/input_items:+ parameters:+ - $ref: '#/components/parameters/ResponseId'+ get:+ tags: [Tasks]+ operationId: getResponseInputItems+ summary: The input the task was created with+ responses:+ '200':+ description: Input items+ content:+ application/json:+ schema:+ type: object+ properties:+ object: { type: string, const: list }+ data: { type: array, items: { type: object, additionalProperties: true } }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/responses/{response_id}/cancel:+ parameters:+ - $ref: '#/components/parameters/ResponseId'+ post:+ tags: [Sessions]+ operationId: cancelResponse+ summary: Cancel a running task+ description: |+ Idempotent. Cancelling an already-terminal task succeeds and changes nothing — a client+ retrying a cancel after a dropped connection must not be punished for having succeeded.+ responses:+ '200':+ description: The Response, now cancelling or terminal+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Response' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/sessions:+ get:+ tags: [Sessions]+ operationId: listSessions+ summary: List sessions+ description: Conformance class Extended.+ parameters:+ - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 20 } }+ - { name: cursor, in: query, schema: { type: string } }+ - { name: harness, in: query, schema: { type: string }, description: Filter by harness id }+ responses:+ '200':+ description: A page of sessions+ content:+ application/json:+ schema: { $ref: '#/components/schemas/SessionList' }+ '401': { $ref: '#/components/responses/Unauthorized' }++ /v1/sessions/{session_id}:+ parameters:+ - $ref: '#/components/parameters/SessionId'+ get:+ tags: [Sessions]+ operationId: getSession+ summary: Get one session+ responses:+ '200':+ description: The session+ content:+ application/json:+ schema: { $ref: '#/components/schemas/Session' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/sessions/{session_id}/turns:+ parameters:+ - $ref: '#/components/parameters/SessionId'+ get:+ tags: [Sessions]+ operationId: getSessionTurns+ summary: The ordered task history of a session+ responses:+ '200':+ description: Turns, oldest first+ content:+ application/json:+ schema:+ type: object+ properties:+ turns: { type: array, items: { $ref: '#/components/schemas/TurnItem' } }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/sessions/{session_id}/share:+ parameters:+ - $ref: '#/components/parameters/SessionId'+ post:+ tags: [Sessions]+ operationId: shareSession+ summary: Publish a read-only view of the session (Sessions §5, class Full)+ description: |+ A body is OPTIONAL; no body means publish. A server MAY accept `{"enabled": bool}` as a+ toggle. Sharing itself is a MAY; a server that does not implement it answers 404/405/501.+ requestBody:+ required: false+ content:+ application/json:+ schema:+ type: object+ properties:+ enabled: { type: boolean, default: true }+ additionalProperties: true+ responses:+ '200':+ description: The share+ content:+ application/json:+ schema: { $ref: '#/components/schemas/SessionShare' }+ '404': { $ref: '#/components/responses/NotFound' }+ get:+ tags: [Sessions]+ operationId: getSessionShare+ summary: Read the session's share back+ responses:+ '200':+ description: The share, agreeing with what POST published+ content:+ application/json:+ schema: { $ref: '#/components/schemas/SessionShare' }+ '404': { $ref: '#/components/responses/NotFound' }+ delete:+ tags: [Sessions]+ operationId: revokeSessionShare+ summary: Revoke — every link minted for the session stops resolving+ responses:+ '200':+ description: Revoked+ content:+ application/json:+ schema: { $ref: '#/components/schemas/SessionShare' }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/sessions/{session_id}/cancel:+ parameters:+ - $ref: '#/components/parameters/SessionId'+ post:+ tags: [Sessions]+ operationId: cancelSession+ summary: Cancel whatever is running in a session+ responses:+ '200':+ description: Accepted+ content:+ application/json:+ schema:+ type: object+ properties:+ id: { type: string }+ status: { type: string }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/files:+ post:+ tags: [Files]+ operationId: uploadFile+ summary: Upload a file for use as task input+ description: Conformance class Extended.+ requestBody:+ required: true+ content:+ multipart/form-data:+ schema:+ type: object+ required: [file]+ properties:+ file: { type: string, format: binary }+ purpose: { type: string, default: user_data }+ responses:+ '200':+ description: The stored file+ content:+ application/json:+ schema: { $ref: '#/components/schemas/File' }+ '413': { $ref: '#/components/responses/PayloadTooLarge' }++ /v1/sessions/{session_id}/files:+ parameters:+ - $ref: '#/components/parameters/SessionId'+ get:+ tags: [Files]+ operationId: listSessionFiles+ summary: Every artifact of a session+ description: Must include artifacts from earlier tasks, not only the most recent.+ responses:+ '200':+ description: Artifacts+ content:+ application/json:+ schema:+ type: object+ required: [files]+ properties:+ files: { type: array, items: { $ref: '#/components/schemas/File' } }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/sessions/{session_id}/files/archive:+ parameters:+ - $ref: '#/components/parameters/SessionId'+ get:+ tags: [Files]+ operationId: downloadSessionArchive+ summary: Every artifact as one archive+ responses:+ '200':+ description: An archive of the session's artifacts+ content:+ application/zip:+ schema: { type: string, format: binary }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/containers/{container_id}/files/{file_id}/content:+ parameters:+ - $ref: '#/components/parameters/ContainerId'+ - $ref: '#/components/parameters/FileId'+ get:+ tags: [Files]+ operationId: downloadFile+ summary: Download an artifact+ description: |+ Returns raw bytes with the file's own media type — never JSON-wrapped. Servers must send+ `X-Content-Type-Options: nosniff`: artifacts are attacker-influenceable content, and serving+ them without it turns an artifact into stored XSS against the client's origin.+ responses:+ '200':+ description: The bytes+ headers:+ Content-Disposition:+ schema: { type: string }+ X-Content-Type-Options:+ required: true+ schema: { type: string, const: nosniff }+ content:+ '*/*':+ schema: { type: string, format: binary }+ '404': { $ref: '#/components/responses/NotFound' }++ /v1/containers/{container_id}/files/{file_id}/pdf:+ parameters:+ - $ref: '#/components/parameters/ContainerId'+ - $ref: '#/components/parameters/FileId'+ get:+ tags: [Files]+ operationId: previewFile+ summary: A rendered PDF preview of a document artifact+ responses:+ '200':+ description: The rendered PDF+ content:+ application/pdf:+ schema: { type: string, format: binary }+ '404': { $ref: '#/components/responses/NotFound' }+ '501':+ description: This server does not implement preview conversion+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }+ '502':+ description: Conversion of this file failed+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }++components:+ securitySchemes:+ bearerAuth:+ type: http+ scheme: bearer+ description: How tokens are issued is out of scope for this protocol.++ headers:+ UHPVersion:+ description: The protocol version actually used to serve this response.+ required: true+ schema: { type: string, examples: ['2026-08-11'] }++ parameters:+ HarnessId:+ name: harness_id+ in: path+ required: true+ schema: { type: string, pattern: '^chrn_' }+ SkillName:+ name: skill_name+ in: path+ required: true+ schema: { type: string }+ PluginName:+ name: plugin_name+ in: path+ required: true+ schema: { type: string }+ ResponseId:+ name: response_id+ in: path+ required: true+ schema: { type: string, pattern: '^resp_' }+ SessionId:+ name: session_id+ in: path+ required: true+ schema: { type: string }+ ContainerId:+ name: container_id+ in: path+ required: true+ schema: { type: string }+ FileId:+ name: file_id+ in: path+ required: true+ schema: { type: string }++ responses:+ Unauthorized:+ description: Missing, malformed or unknown credential+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }+ NotFound:+ description: |+ No such object in the caller's scope. Servers return 404 rather than 403 for objects outside+ the caller's scope, so that an id's existence is not disclosed.+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }+ Conflict:+ description: '`session_busy` or `harness_mismatch`'+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }+ UnprocessableEntity:+ description: '`model_unavailable` or `unsupported_base`'+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }+ PayloadTooLarge:+ description: '`file_too_large`'+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }+ RateLimited:+ description: '`rate_limited` or `quota_exhausted`'+ headers:+ Retry-After:+ schema: { type: string }+ content:+ application/json:+ schema: { $ref: '#/components/schemas/ErrorEnvelope' }++ schemas:+ Discovery:+ type: object+ required: [object, protocol, versions, default_version, conformance_class, capabilities]+ properties:+ object: { type: string, const: uhp.discovery }+ protocol: { type: string, const: uhp }+ versions:+ type: array+ minItems: 1+ items: { type: string }+ default_version: { type: string }+ conformance_class: { type: string, enum: [core, extended, full] }+ capabilities: { $ref: '#/components/schemas/Capabilities' }+ plugin_schemas:+ type: array+ items: { type: string, format: uri }+ description: |+ The Agent Plugins manifest schema identifiers this server installs. Present and non-empty+ when `capabilities.plugins` is true.+ examples: [['https://agent-plugins.org/schemas/1.0.0/plugin.schema.json']]+ implementation:+ type: object+ properties:+ name: { type: string }+ version: { type: string }+ additionalProperties: true+ additionalProperties: true++ Capabilities:+ type: object+ description: |+ Named booleans. A server reports `false` for a capability it does not implement rather than+ omitting it, so a client can distinguish "not supported" from "server predates this field".+ A client treats an absent key as `false`.+ properties:+ streaming: { type: boolean }+ sessions: { type: boolean }+ cancellation: { type: boolean }+ files_input: { type: boolean }+ files_output: { type: boolean }+ session_listing: { type: boolean }+ harness_management: { type: boolean }+ session_sharing: { type: boolean }+ idempotency: { type: boolean }+ plugins:+ type: boolean+ description: |+ The server installs Agent Plugins packages into harnesses, serves their files, and exports+ a harness as a package. Optional at every class.+ additionalProperties: { type: boolean }++ Harness:+ type: object+ required: [id, name, base]+ properties:+ id: { type: string, pattern: '^chrn_' }+ object: { type: string, const: harness }+ name: { type: string }+ base:+ type: string+ description: |+ Opaque. Not enumerated by this specification — a client must treat it as a string, or the+ protocol would need revising every time a harness is released.+ examples: [codex, claude-code, hermes]+ baseLabel: { type: string }+ defaultModel: { type: string }+ systemPrompt: { type: string }+ mcpServers: { type: array, items: { $ref: '#/components/schemas/McpServer' } }+ skills: { type: array, items: { $ref: '#/components/schemas/Skill' } }+ plugins:+ type: array+ items: { $ref: '#/components/schemas/Plugin' }+ description: |+ Installed plugins. Their servers and skills join the harness's own for every turn;+ `mcpServers` and `skills` above report only what was written to them directly.+ disabledTools: { type: array, items: { type: string } }+ maxStep: { type: [integer, 'null'] }+ timeoutSeconds: { type: [integer, 'null'] }+ createdAt: { type: integer, description: Unix milliseconds }+ additionalProperties: true++ McpServer:+ type: object+ required: [name, url]+ description: |+ A remote MCP server attached to a harness. Only enabled entries are connected for a turn; a+ disabled entry must not be contacted at all. An unreachable server must not fail the task.+ Unchanged from 2026-08-11: a process (stdio) server is declared inside a plugin, see+ PluginMcpServer.+ properties:+ name: { type: string, description: Sanitised to a CLI-safe identifier by the server. }+ url: { type: string, format: uri }+ transport: { type: string, enum: [http, sse], default: http }+ enabled: { type: boolean, default: true }+ headers: { type: object, additionalProperties: { type: string } }+ auth:+ type: string+ description: |+ Bearer token, or a server-side reference the server resolves. A server must never return+ a resolved credential to a client.+ additionalProperties: true++ PluginMcpServer:+ type: object+ required: [name]+ description: |+ An MCP server a plugin's mcp.json declares, derived by the server. The harness MCP server+ object plus the `stdio` transport: `url` is required for `http` and `sse`, `command` for+ `stdio`. Placeholders are reported unexpanded; `enabled` is always true, the plugin's own+ `enabled` governs.+ properties:+ name: { type: string }+ transport:+ type: string+ enum: [http, sse, stdio]+ default: http+ description: |+ `http` is Streamable HTTP (`streamable-http` in mcp.json); `sse` the older HTTP+SSE+ transport; `stdio` a process the server launches inside the agent's sandbox.+ url: { type: string, format: uri, description: Endpoint (`http` and `sse`). }+ headers:+ type: object+ additionalProperties: { type: string }+ description: Fixed request headers (`http` and `sse`). Never subject to placeholder expansion.+ command:+ type: string+ description: |+ One executable token (`stdio`): a bare name resolved on the sandbox's search path, or a+ plugin-relative path beginning with `./`. Never a shell string, never expanded.+ args:+ type: array+ items: { type: string }+ description: Arguments (`stdio`). `${PLUGIN_ROOT}` and `${PLUGIN_DATA}` expand at run time.+ env:+ type: object+ additionalProperties: { type: string }+ description: |+ Environment overlay (`stdio`). Must not name PLUGIN_ROOT or PLUGIN_DATA; the server sets+ those. Values expand at run time.+ cwd:+ type: string+ description: |+ Working directory (`stdio`). Defaults to the plugin root; must stay within the plugin+ root or PLUGIN_DATA.+ enabled: { type: boolean, default: true }+ allOf:+ - if:+ properties: { transport: { const: stdio } }+ required: [transport]+ then: { required: [command] }+ else: { required: [url] }+ additionalProperties: true++ Skill:+ type: object+ required: [name]+ description: |+ A skill is a FOLDER, not a file. A server must materialise the whole folder where the agent+ can read it — materialising only SKILL.md breaks every skill carrying references, scripts or+ data. Round-tripping a harness through GET and PUT must not lose skill contents.+ properties:+ name: { type: string }+ enabled:+ type: boolean+ default: true+ description: false suppresses the skill, including one inherited from the base.+ files:+ type: array+ items: { $ref: '#/components/schemas/SkillFile' }+ description: The bundle. Must contain a SKILL.md.+ content:+ type: string+ description: Shorthand for a single-file bundle whose only member is SKILL.md.+ blob:+ type: string+ description: |+ Server-assigned handle for a bundle stored out of line. A client receives it, passes it+ back unchanged, and reads the files from the skill files endpoint.+ additionalProperties: true++ SkillFile:+ type: object+ required: [path]+ description: One file of a skill folder or of a plugin package.+ properties:+ path:+ type: string+ description: |+ Relative to the skill's own folder, or to the plugin root; nested directories are+ supported. A server must reject a path that escapes the folder.+ examples: ['SKILL.md', 'references/codes.md', 'assets/logo.png']+ content: { type: string, description: Text content. }+ content_b64: { type: string, description: Base64 for binary content; preserved byte-for-byte. }+ additionalProperties: true++ FileList:+ type: object+ required: [files]+ properties:+ files:+ type: array+ items: { $ref: '#/components/schemas/SkillFile' }++ Plugin:+ type: object+ required: [name]+ description: |+ An Agent Plugins package installed into a harness: `plugin.json` at the root, MCP servers in+ `mcp.json`, skills under `skills/`. A client writes `files` (or passes back `blob`) and+ optionally `name` and `enabled`; the server derives `manifest`, `mcpServers`, `skills` and+ `skipped` from the package on every write and ignores those fields on input. A refused+ package leaves the harness unchanged.+ properties:+ name:+ type: string+ pattern: '^(?!.*(--|\.\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$'+ maxLength: 64+ description: The manifest's `name`. Optional on write; if sent it must equal the manifest's.+ enabled:+ type: boolean+ default: true+ description: false keeps the plugin installed and inert; nothing in it is materialised or contacted.+ files:+ type: array+ items: { $ref: '#/components/schemas/SkillFile' }+ description: The package. Must contain `plugin.json` at its root.+ blob:+ type: string+ description: |+ Server-assigned handle for a package stored out of line. A client passes it back unchanged+ and reads the files from the plugin files endpoint.+ manifest: { $ref: '#/components/schemas/PluginManifest' }+ mcpServers:+ type: array+ items: { $ref: '#/components/schemas/PluginMcpServer' }+ description: |+ Derived from `mcp.json`. Placeholders are reported unexpanded; `enabled` is always true,+ the plugin's own `enabled` governs.+ skills:+ type: array+ items: { $ref: '#/components/schemas/PluginSkill' }+ description: Derived from `skills/`, one entry per immediate child directory with a SKILL.md.+ skipped:+ type: array+ items: { $ref: '#/components/schemas/PluginSkipped' }+ description: |+ What the server found and could not load. Present on every plugin object the server+ returns, empty when nothing was skipped.+ additionalProperties: true++ PluginManifest:+ type: object+ required: ['$schema', name]+ description: |+ `plugin.json`, parsed. Mirrors the Agent Plugins 1.0.0 manifest schema+ (https://agent-plugins.org/schemas/1.0.0/plugin.schema.json, Apache-2.0) field for field, and+ permits additional properties because a UHP client ignores fields it does not know. The+ schema a manifest's own `$schema` names is authoritative; a server validates against that.+ properties:+ '$schema': { type: string, format: uri }+ name:+ type: string+ minLength: 1+ maxLength: 64+ pattern: '^(?!.*(--|\.\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$'+ version: { type: string }+ description: { type: string }+ author:+ type: object+ properties:+ name: { type: string }+ email: { type: string }+ url: { type: string }+ additionalProperties: true+ homepage: { type: string }+ repository: { type: string }+ license: { type: string }+ keywords: { type: array, items: { type: string } }+ extensions:+ type: object+ description: Client-specific data keyed by reverse-domain namespace, per Agent Plugins §8.+ additionalProperties: { type: object }+ additionalProperties: true++ PluginSkill:+ type: object+ required: [name]+ properties:+ name: { type: string, description: The SKILL.md frontmatter name, equal to the directory name. }+ description: { type: string }+ additionalProperties: true++ PluginSkipped:+ type: object+ required: [path, reason]+ properties:+ path:+ type: string+ description: Where in the package, e.g. `skills/broken`, `mcp.json#/mcpServers/redline`, `plugin.json#/vendorField`.+ examples: ['skills/broken', 'mcp.json#/mcpServers/redline']+ reason: { type: string, description: One sentence. }+ additionalProperties: true++ HarnessCreate:+ type: object+ required: [base]+ properties:+ name: { type: string }+ base: { type: string }+ default_model: { type: string }+ system_prompt: { type: string }+ mcp_servers: { type: array, items: { $ref: '#/components/schemas/McpServer' } }+ skills: { type: array, items: { $ref: '#/components/schemas/Skill' } }+ plugins:+ type: array+ items: { $ref: '#/components/schemas/Plugin' }+ description: Requires the `plugins` capability. Each item needs `files` or `blob`.+ disabled_tools: { type: array, items: { type: string } }+ max_step: { type: [integer, 'null'] }+ timeout_seconds: { type: [integer, 'null'] }+ additionalProperties: true++ ModelCatalog:+ type: object+ required: [backends]+ properties:+ backends:+ type: object+ additionalProperties:+ type: object+ required: [default, models]+ properties:+ default: { type: string }+ models: { type: array, items: { $ref: '#/components/schemas/Model' } }++ HarnessModels:+ type: object+ required: [models]+ properties:+ harness_id: { type: string }+ backend: { type: string }+ default: { type: string }+ fallback: { type: string }+ models: { type: array, items: { $ref: '#/components/schemas/Model' } }++ Model:+ type: object+ required: [id, available]+ properties:+ id: { type: string }+ label: { type: string }+ backend: { type: string }+ available:+ type: boolean+ description: |+ Computed, not asserted: true means the server can serve this model for this harness right+ now. Listing a model as available and then failing the task is the worst outcome for a+ client, because a user has already chosen it.+ default: { type: boolean }+ additionalProperties: true++ CreateResponseRequest:+ type: object+ required: [input]+ properties:+ input:+ oneOf:+ - type: string+ - type: array+ items: { type: object, additionalProperties: true }+ description: A bare string is shorthand for one user message.+ model: { type: string, description: Canonical model id. Omitted means the harness default. }+ metadata:+ type: object+ description: Client metadata. `harness_id` selects the configured harness.+ properties:+ harness_id: { type: string }+ additionalProperties: true+ stream: { type: boolean, default: false }+ previous_response_id: { type: [string, 'null'] }+ instructions: { type: string }+ store: { type: boolean, default: true }+ max_output_tokens: { type: [integer, 'null'] }+ max_step: { type: [integer, 'null'], description: Agent step (tool-call round) budget }+ timeout_seconds: { type: [integer, 'null'], description: Wall-clock budget }+ tools:+ type: array+ items: { type: object, additionalProperties: true }+ description: |+ Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in+ `metadata.ignored_fields` on the response. A UHP harness invokes and executes tools+ itself and reports them in `output`; there is no input path for a tool result, so the+ client-executed tool loop this field implies cannot be completed by a conformant server.+ Configure tools on the harness instead — see Harnesses §4.1. Tasks §1.4.+ include:+ type: array+ items: { type: string }+ description: |+ Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in+ `metadata.ignored_fields` on the response. No values are enumerated, so any string a+ server recognised would be one it named itself. Tasks §1.4.+ background: { type: boolean, default: false }+ additionalProperties: true++ Response:+ type: object+ required: [id, object, created_at, status, output, model]+ properties:+ id: { type: string, pattern: '^resp_' }+ object: { type: string, const: response }+ created_at: { type: integer, description: Unix seconds }+ status: { $ref: '#/components/schemas/ResponseStatus' }+ error:+ oneOf:+ - type: 'null'+ - $ref: '#/components/schemas/Error'+ description: Non-null only when status is `failed`.+ incomplete_details: { type: [object, 'null'], additionalProperties: true }+ previous_response_id: { type: [string, 'null'] }+ model: { type: string, description: The model that actually ran. }+ output:+ type: array+ items: { $ref: '#/components/schemas/OutputItem' }+ store: { type: boolean }+ usage:+ oneOf:+ - type: 'null'+ - $ref: '#/components/schemas/Usage'+ description: |+ null when the server cannot account for usage. A fabricated zero would be worse than an+ honest absence, because a client cannot tell it from a free task.+ metadata:+ type: object+ properties:+ session_id: { type: string }+ requested_model:+ type: string+ description: Present when the server ran a different model than was requested.+ model_fallback: { type: boolean }+ model_fallback_reason: { type: string }+ ignored_fields:+ type: array+ items: { type: string }+ description: |+ Request fields the server did not act on, by name, in any order. Required when the+ request carried `tools` or `include`, which are reserved and ignored. A silently+ ignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4.+ additionalProperties: true+ additionalProperties: true++ ResponseStatus:+ type: string+ enum: [in_progress, completed, failed, incomplete, cancelled]+ description: |+ `incomplete` means a budget stopped the work and is usually worth continuing.+ `failed` means it could not be done. `cancelled` means the client asked for a stop, and must+ never be reported as `failed`.++ OutputItem:+ type: object+ required: [type]+ description: |+ A client must tolerate item types it does not recognise. A client that renders only `message`+ items and ignores the rest is a valid client.+ properties:+ id: { type: string }+ type:+ type: string+ examples: [message, reasoning, function_call, function_call_output]+ status: { type: string }+ role: { type: string }+ content:+ type: array+ items: { $ref: '#/components/schemas/ContentPart' }+ summary:+ type: array+ items: { type: object, additionalProperties: true }+ call_id: { type: string }+ name: { type: string }+ arguments: { type: string, description: JSON, as a string }+ output: { type: string }+ additionalProperties: true++ ContentPart:+ type: object+ required: [type]+ properties:+ type: { type: string, examples: [output_text] }+ text: { type: string }+ annotations:+ type: array+ items: { $ref: '#/components/schemas/Annotation' }+ additionalProperties: true++ Annotation:+ type: object+ required: [type]+ properties:+ type: { type: string, const: container_file_citation }+ container_id: { type: string }+ file_id: { type: string }+ filename: { type: string }+ download_url: { type: string, format: uri }+ start_index: { type: integer }+ end_index: { type: integer }+ additionalProperties: true++ Usage:+ type: object+ properties:+ input_tokens: { type: integer, minimum: 0 }+ output_tokens: { type: integer, minimum: 0 }+ total_tokens: { type: integer, minimum: 0 }+ cache_read_tokens: { type: integer, minimum: 0 }+ cache_write_tokens: { type: integer, minimum: 0 }+ additionalProperties: true++ SessionShare:+ type: object+ description: |+ A published read-only view of a session (Sessions §5). `url` may be relative, resolving+ against the base URL the caller is already using — a server behind a proxy cannot know its+ public origin, and a base-relative path survives every fronting. The share's id MUST NOT+ function as a credential for the rest of the API.+ required: [id, url]+ properties:+ id: { type: string }+ url: { type: string }+ object: { type: string, description: 'SHOULD be "session.share"' }+ enabled: { type: boolean }+ additionalProperties: true++ TurnItem:+ type: object+ description: |+ One turn of a session's history (Sessions §3). Previously an object with no stated shape,+ which kept every conformance check at "the endpoint answered 200" and made transcript+ rebuilding an exercise in one implementation's habits.+ required: [id, status]+ properties:+ id: { type: string, description: "The response id, usable with GET /v1/responses/{id}" }+ status: { type: string }+ user: { type: string }+ assistant: { type: string }+ tools: { type: array, items: { type: object, additionalProperties: true } }+ files: { type: array, items: { type: object, additionalProperties: true } }+ additionalProperties: true++ Session:+ type: object+ required: [id]+ properties:+ id: { type: string }+ object: { type: string, const: session }+ harness_id: { type: string }+ title: { type: string }+ status: { type: string }+ created_at: { type: integer }+ updated_at: { type: integer }+ additionalProperties: true++ SessionList:+ type: object+ required: [sessions]+ properties:+ sessions: { type: array, items: { $ref: '#/components/schemas/Session' } }+ next_cursor:+ type: [string, 'null']+ description: |+ null on the last page. A client must not be required to detect the end by receiving fewer+ items than requested — that heuristic is wrong whenever a page is exactly full.+ additionalProperties: true++ File:+ type: object+ required: [id, filename]+ properties:+ id: { type: string }+ object: { type: string, const: file }+ container_id: { type: string }+ filename: { type: string }+ bytes: { type: integer, minimum: 0 }+ created_at: { type: integer }+ additionalProperties: true++ ErrorEnvelope:+ type: object+ required: [error]+ properties:+ error: { $ref: '#/components/schemas/Error' }+ detail:+ type: string+ deprecated: true+ description: |+ A human-readable alias of `error.message`, retained for clients written against+ implementations that predate this envelope. Carries no information not in `error`.+ additionalProperties: true++ Error:+ type: object+ required: [type, code, message]+ properties:+ type:+ type: string+ enum:+ - invalid_request_error+ - authentication_error+ - permission_error+ - rate_limit_error+ - harness_error+ - server_error+ code:+ type: string+ description: |+ Specific and machine-readable. Servers may define additional codes for conditions this+ specification does not cover, and must namespace them with a vendor prefix so a future+ version cannot collide with them.+ examples:+ - unsupported_protocol_version+ - invalid_input+ - harness_not_found+ - response_not_found+ - session_not_found+ - plugin_not_found+ - file_not_found+ - session_expired+ - harness_mismatch+ - session_busy+ - plugin_conflict+ - file_too_large+ - model_unavailable+ - unsupported_base+ - plugin_invalid+ - unsupported_plugin_schema+ - unsupported_transport+ - missing_credential+ - invalid_credential+ - insufficient_scope+ - rate_limited+ - quota_exhausted+ - harness_error+ - harness_unavailable+ - provider_error+ - timeout+ - cancelled+ - preview_unavailable+ - preview_failed+ message:+ type: string+ description: |+ One sentence, safe to show a user. Must not contain credentials, internal hostnames, file+ paths, or stack traces.+ param: { type: [string, 'null'], description: Dotted path to the offending field. }+ detail: { type: [object, 'null'], additionalProperties: true }+ additionalProperties: true++ Event:+ type: object+ required: [type, sequence_number]+ description: |+ One streamed event. `sequence_number` starts at 0 and increases by exactly 1 per event, so a+ client can detect a dropped event rather than silently rendering a gap.+ properties:+ type:+ type: string+ examples:+ - response.created+ - response.in_progress+ - response.output_item.added+ - response.output_item.done+ - response.content_part.added+ - response.content_part.done+ - response.output_text.delta+ - response.output_text.done+ - response.output_text.annotation.added+ - response.reasoning_summary_part.added+ - response.reasoning_summary_text.delta+ - response.reasoning_summary_part.done+ - response.function_call_arguments.delta+ - response.function_call_arguments.done+ - response.completed+ - response.incomplete+ - response.failed+ - error+ sequence_number: { type: integer, minimum: 0 }+ response: { $ref: '#/components/schemas/Response' }+ item: { $ref: '#/components/schemas/OutputItem' }+ part: { $ref: '#/components/schemas/ContentPart' }+ annotation: { $ref: '#/components/schemas/Annotation' }+ delta: { type: string }+ text: { type: string }+ arguments: { type: string }+ item_id: { type: string }+ output_index: { type: integer, minimum: 0 }+ content_index: { type: integer, minimum: 0 }+ summary_index: { type: integer, minimum: 0 }+ annotation_index: { type: integer, minimum: 0 }+ code: { type: string }+ message: { type: string }+ param: { type: [string, 'null'] }+ additionalProperties: truediff --git a/protocol/schema/uhp-2026-09-12.schema.json b/protocol/schema/uhp-2026-09-12.schema.jsonnew file mode 100644index 00000000..296043f1--- /dev/null+++ b/protocol/schema/uhp-2026-09-12.schema.json@@ -0,0 +1,1367 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://unifiedharnessprotocol.org/schema/uhp-2026-09-12.schema.json",+ "title": "Unified Harness Protocol",+ "description": "Object definitions for UHP 2026-09-12. Generated from uhp-2026-09-12.openapi.yaml by build.py — do not edit by hand.",+ "$defs": {+ "Discovery": {+ "type": "object",+ "required": [+ "object",+ "protocol",+ "versions",+ "default_version",+ "conformance_class",+ "capabilities"+ ],+ "properties": {+ "object": {+ "type": "string",+ "const": "uhp.discovery"+ },+ "protocol": {+ "type": "string",+ "const": "uhp"+ },+ "versions": {+ "type": "array",+ "minItems": 1,+ "items": {+ "type": "string"+ }+ },+ "default_version": {+ "type": "string"+ },+ "conformance_class": {+ "type": "string",+ "enum": [+ "core",+ "extended",+ "full"+ ]+ },+ "capabilities": {+ "$ref": "#/$defs/Capabilities"+ },+ "plugin_schemas": {+ "type": "array",+ "items": {+ "type": "string",+ "format": "uri"+ },+ "description": "The Agent Plugins manifest schema identifiers this server installs. Present and non-empty\nwhen `capabilities.plugins` is true.\n",+ "examples": [+ [+ "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"+ ]+ ]+ },+ "implementation": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ },+ "version": {+ "type": "string"+ }+ },+ "additionalProperties": true+ }+ },+ "additionalProperties": true+ },+ "Capabilities": {+ "type": "object",+ "description": "Named booleans. A server reports `false` for a capability it does not implement rather than\nomitting it, so a client can distinguish \"not supported\" from \"server predates this field\".\nA client treats an absent key as `false`.\n",+ "properties": {+ "streaming": {+ "type": "boolean"+ },+ "sessions": {+ "type": "boolean"+ },+ "cancellation": {+ "type": "boolean"+ },+ "files_input": {+ "type": "boolean"+ },+ "files_output": {+ "type": "boolean"+ },+ "session_listing": {+ "type": "boolean"+ },+ "harness_management": {+ "type": "boolean"+ },+ "session_sharing": {+ "type": "boolean"+ },+ "idempotency": {+ "type": "boolean"+ },+ "plugins": {+ "type": "boolean",+ "description": "The server installs Agent Plugins packages into harnesses, serves their files, and exports\na harness as a package. Optional at every class.\n"+ }+ },+ "additionalProperties": {+ "type": "boolean"+ }+ },+ "Harness": {+ "type": "object",+ "required": [+ "id",+ "name",+ "base"+ ],+ "properties": {+ "id": {+ "type": "string",+ "pattern": "^chrn_"+ },+ "object": {+ "type": "string",+ "const": "harness"+ },+ "name": {+ "type": "string"+ },+ "base": {+ "type": "string",+ "description": "Opaque. Not enumerated by this specification — a client must treat it as a string, or the\nprotocol would need revising every time a harness is released.\n",+ "examples": [+ "codex",+ "claude-code",+ "hermes"+ ]+ },+ "baseLabel": {+ "type": "string"+ },+ "defaultModel": {+ "type": "string"+ },+ "systemPrompt": {+ "type": "string"+ },+ "mcpServers": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/McpServer"+ }+ },+ "skills": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Skill"+ }+ },+ "plugins": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Plugin"+ },+ "description": "Installed plugins. Their servers and skills join the harness's own for every turn;\n`mcpServers` and `skills` above report only what was written to them directly.\n"+ },+ "disabledTools": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "maxStep": {+ "type": [+ "integer",+ "null"+ ]+ },+ "timeoutSeconds": {+ "type": [+ "integer",+ "null"+ ]+ },+ "createdAt": {+ "type": "integer",+ "description": "Unix milliseconds"+ }+ },+ "additionalProperties": true+ },+ "McpServer": {+ "type": "object",+ "required": [+ "name",+ "url"+ ],+ "description": "A remote MCP server attached to a harness. Only enabled entries are connected for a turn; a\ndisabled entry must not be contacted at all. An unreachable server must not fail the task.\nUnchanged from 2026-08-11: a process (stdio) server is declared inside a plugin, see\nPluginMcpServer.\n",+ "properties": {+ "name": {+ "type": "string",+ "description": "Sanitised to a CLI-safe identifier by the server."+ },+ "url": {+ "type": "string",+ "format": "uri"+ },+ "transport": {+ "type": "string",+ "enum": [+ "http",+ "sse"+ ],+ "default": "http"+ },+ "enabled": {+ "type": "boolean",+ "default": true+ },+ "headers": {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ "auth": {+ "type": "string",+ "description": "Bearer token, or a server-side reference the server resolves. A server must never return\na resolved credential to a client.\n"+ }+ },+ "additionalProperties": true+ },+ "PluginMcpServer": {+ "type": "object",+ "required": [+ "name"+ ],+ "description": "An MCP server a plugin's mcp.json declares, derived by the server. The harness MCP server\nobject plus the `stdio` transport: `url` is required for `http` and `sse`, `command` for\n`stdio`. Placeholders are reported unexpanded; `enabled` is always true, the plugin's own\n`enabled` governs.\n",+ "properties": {+ "name": {+ "type": "string"+ },+ "transport": {+ "type": "string",+ "enum": [+ "http",+ "sse",+ "stdio"+ ],+ "default": "http",+ "description": "`http` is Streamable HTTP (`streamable-http` in mcp.json); `sse` the older HTTP+SSE\ntransport; `stdio` a process the server launches inside the agent's sandbox.\n"+ },+ "url": {+ "type": "string",+ "format": "uri",+ "description": "Endpoint (`http` and `sse`)."+ },+ "headers": {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ },+ "description": "Fixed request headers (`http` and `sse`). Never subject to placeholder expansion."+ },+ "command": {+ "type": "string",+ "description": "One executable token (`stdio`): a bare name resolved on the sandbox's search path, or a\nplugin-relative path beginning with `./`. Never a shell string, never expanded.\n"+ },+ "args": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Arguments (`stdio`). `${PLUGIN_ROOT}` and `${PLUGIN_DATA}` expand at run time."+ },+ "env": {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ },+ "description": "Environment overlay (`stdio`). Must not name PLUGIN_ROOT or PLUGIN_DATA; the server sets\nthose. Values expand at run time.\n"+ },+ "cwd": {+ "type": "string",+ "description": "Working directory (`stdio`). Defaults to the plugin root; must stay within the plugin\nroot or PLUGIN_DATA.\n"+ },+ "enabled": {+ "type": "boolean",+ "default": true+ }+ },+ "allOf": [+ {+ "if": {+ "properties": {+ "transport": {+ "const": "stdio"+ }+ },+ "required": [+ "transport"+ ]+ },+ "then": {+ "required": [+ "command"+ ]+ },+ "else": {+ "required": [+ "url"+ ]+ }+ }+ ],+ "additionalProperties": true+ },+ "Skill": {+ "type": "object",+ "required": [+ "name"+ ],+ "description": "A skill is a FOLDER, not a file. A server must materialise the whole folder where the agent\ncan read it — materialising only SKILL.md breaks every skill carrying references, scripts or\ndata. Round-tripping a harness through GET and PUT must not lose skill contents.\n",+ "properties": {+ "name": {+ "type": "string"+ },+ "enabled": {+ "type": "boolean",+ "default": true,+ "description": "false suppresses the skill, including one inherited from the base."+ },+ "files": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/SkillFile"+ },+ "description": "The bundle. Must contain a SKILL.md."+ },+ "content": {+ "type": "string",+ "description": "Shorthand for a single-file bundle whose only member is SKILL.md."+ },+ "blob": {+ "type": "string",+ "description": "Server-assigned handle for a bundle stored out of line. A client receives it, passes it\nback unchanged, and reads the files from the skill files endpoint.\n"+ }+ },+ "additionalProperties": true+ },+ "SkillFile": {+ "type": "object",+ "required": [+ "path"+ ],+ "description": "One file of a skill folder or of a plugin package.",+ "properties": {+ "path": {+ "type": "string",+ "description": "Relative to the skill's own folder, or to the plugin root; nested directories are\nsupported. A server must reject a path that escapes the folder.\n",+ "examples": [+ "SKILL.md",+ "references/codes.md",+ "assets/logo.png"+ ]+ },+ "content": {+ "type": "string",+ "description": "Text content."+ },+ "content_b64": {+ "type": "string",+ "description": "Base64 for binary content; preserved byte-for-byte."+ }+ },+ "additionalProperties": true+ },+ "FileList": {+ "type": "object",+ "required": [+ "files"+ ],+ "properties": {+ "files": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/SkillFile"+ }+ }+ }+ },+ "Plugin": {+ "type": "object",+ "required": [+ "name"+ ],+ "description": "An Agent Plugins package installed into a harness: `plugin.json` at the root, MCP servers in\n`mcp.json`, skills under `skills/`. A client writes `files` (or passes back `blob`) and\noptionally `name` and `enabled`; the server derives `manifest`, `mcpServers`, `skills` and\n`skipped` from the package on every write and ignores those fields on input. A refused\npackage leaves the harness unchanged.\n",+ "properties": {+ "name": {+ "type": "string",+ "pattern": "^(?!.*(--|\\.\\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$",+ "maxLength": 64,+ "description": "The manifest's `name`. Optional on write; if sent it must equal the manifest's."+ },+ "enabled": {+ "type": "boolean",+ "default": true,+ "description": "false keeps the plugin installed and inert; nothing in it is materialised or contacted."+ },+ "files": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/SkillFile"+ },+ "description": "The package. Must contain `plugin.json` at its root."+ },+ "blob": {+ "type": "string",+ "description": "Server-assigned handle for a package stored out of line. A client passes it back unchanged\nand reads the files from the plugin files endpoint.\n"+ },+ "manifest": {+ "$ref": "#/$defs/PluginManifest"+ },+ "mcpServers": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/PluginMcpServer"+ },+ "description": "Derived from `mcp.json`. Placeholders are reported unexpanded; `enabled` is always true,\nthe plugin's own `enabled` governs.\n"+ },+ "skills": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/PluginSkill"+ },+ "description": "Derived from `skills/`, one entry per immediate child directory with a SKILL.md."+ },+ "skipped": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/PluginSkipped"+ },+ "description": "What the server found and could not load. Present on every plugin object the server\nreturns, empty when nothing was skipped.\n"+ }+ },+ "additionalProperties": true+ },+ "PluginManifest": {+ "type": "object",+ "required": [+ "$schema",+ "name"+ ],+ "description": "`plugin.json`, parsed. Mirrors the Agent Plugins 1.0.0 manifest schema\n(https://agent-plugins.org/schemas/1.0.0/plugin.schema.json, Apache-2.0) field for field, and\npermits additional properties because a UHP client ignores fields it does not know. The\nschema a manifest's own `$schema` names is authoritative; a server validates against that.\n",+ "properties": {+ "$schema": {+ "type": "string",+ "format": "uri"+ },+ "name": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64,+ "pattern": "^(?!.*(--|\\.\\.))[a-z0-9]([a-z0-9.-]*[a-z0-9])?$"+ },+ "version": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "author": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ },+ "email": {+ "type": "string"+ },+ "url": {+ "type": "string"+ }+ },+ "additionalProperties": true+ },+ "homepage": {+ "type": "string"+ },+ "repository": {+ "type": "string"+ },+ "license": {+ "type": "string"+ },+ "keywords": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "extensions": {+ "type": "object",+ "description": "Client-specific data keyed by reverse-domain namespace, per Agent Plugins §8.",+ "additionalProperties": {+ "type": "object"+ }+ }+ },+ "additionalProperties": true+ },+ "PluginSkill": {+ "type": "object",+ "required": [+ "name"+ ],+ "properties": {+ "name": {+ "type": "string",+ "description": "The SKILL.md frontmatter name",+ "equal to the directory name.": null+ },+ "description": {+ "type": "string"+ }+ },+ "additionalProperties": true+ },+ "PluginSkipped": {+ "type": "object",+ "required": [+ "path",+ "reason"+ ],+ "properties": {+ "path": {+ "type": "string",+ "description": "Where in the package, e.g. `skills/broken`, `mcp.json#/mcpServers/redline`, `plugin.json#/vendorField`.",+ "examples": [+ "skills/broken",+ "mcp.json#/mcpServers/redline"+ ]+ },+ "reason": {+ "type": "string",+ "description": "One sentence."+ }+ },+ "additionalProperties": true+ },+ "HarnessCreate": {+ "type": "object",+ "required": [+ "base"+ ],+ "properties": {+ "name": {+ "type": "string"+ },+ "base": {+ "type": "string"+ },+ "default_model": {+ "type": "string"+ },+ "system_prompt": {+ "type": "string"+ },+ "mcp_servers": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/McpServer"+ }+ },+ "skills": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Skill"+ }+ },+ "plugins": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Plugin"+ },+ "description": "Requires the `plugins` capability. Each item needs `files` or `blob`."+ },+ "disabled_tools": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "max_step": {+ "type": [+ "integer",+ "null"+ ]+ },+ "timeout_seconds": {+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "additionalProperties": true+ },+ "ModelCatalog": {+ "type": "object",+ "required": [+ "backends"+ ],+ "properties": {+ "backends": {+ "type": "object",+ "additionalProperties": {+ "type": "object",+ "required": [+ "default",+ "models"+ ],+ "properties": {+ "default": {+ "type": "string"+ },+ "models": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Model"+ }+ }+ }+ }+ }+ }+ },+ "HarnessModels": {+ "type": "object",+ "required": [+ "models"+ ],+ "properties": {+ "harness_id": {+ "type": "string"+ },+ "backend": {+ "type": "string"+ },+ "default": {+ "type": "string"+ },+ "fallback": {+ "type": "string"+ },+ "models": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Model"+ }+ }+ }+ },+ "Model": {+ "type": "object",+ "required": [+ "id",+ "available"+ ],+ "properties": {+ "id": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "backend": {+ "type": "string"+ },+ "available": {+ "type": "boolean",+ "description": "Computed, not asserted: true means the server can serve this model for this harness right\nnow. Listing a model as available and then failing the task is the worst outcome for a\nclient, because a user has already chosen it.\n"+ },+ "default": {+ "type": "boolean"+ }+ },+ "additionalProperties": true+ },+ "CreateResponseRequest": {+ "type": "object",+ "required": [+ "input"+ ],+ "properties": {+ "input": {+ "oneOf": [+ {+ "type": "string"+ },+ {+ "type": "array",+ "items": {+ "type": "object",+ "additionalProperties": true+ }+ }+ ],+ "description": "A bare string is shorthand for one user message."+ },+ "model": {+ "type": "string",+ "description": "Canonical model id. Omitted means the harness default."+ },+ "metadata": {+ "type": "object",+ "description": "Client metadata. `harness_id` selects the configured harness.",+ "properties": {+ "harness_id": {+ "type": "string"+ }+ },+ "additionalProperties": true+ },+ "stream": {+ "type": "boolean",+ "default": false+ },+ "previous_response_id": {+ "type": [+ "string",+ "null"+ ]+ },+ "instructions": {+ "type": "string"+ },+ "store": {+ "type": "boolean",+ "default": true+ },+ "max_output_tokens": {+ "type": [+ "integer",+ "null"+ ]+ },+ "max_step": {+ "type": [+ "integer",+ "null"+ ],+ "description": "Agent step (tool-call round) budget"+ },+ "timeout_seconds": {+ "type": [+ "integer",+ "null"+ ],+ "description": "Wall-clock budget"+ },+ "tools": {+ "type": "array",+ "items": {+ "type": "object",+ "additionalProperties": true+ },+ "description": "Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in\n`metadata.ignored_fields` on the response. A UHP harness invokes and executes tools\nitself and reports them in `output`; there is no input path for a tool result, so the\nclient-executed tool loop this field implies cannot be completed by a conformant server.\nConfigure tools on the harness instead — see Harnesses §4.1. Tasks §1.4.\n"+ },+ "include": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in\n`metadata.ignored_fields` on the response. No values are enumerated, so any string a\nserver recognised would be one it named itself. Tasks §1.4.\n"+ },+ "background": {+ "type": "boolean",+ "default": false+ }+ },+ "additionalProperties": true+ },+ "Response": {+ "type": "object",+ "required": [+ "id",+ "object",+ "created_at",+ "status",+ "output",+ "model"+ ],+ "properties": {+ "id": {+ "type": "string",+ "pattern": "^resp_"+ },+ "object": {+ "type": "string",+ "const": "response"+ },+ "created_at": {+ "type": "integer",+ "description": "Unix seconds"+ },+ "status": {+ "$ref": "#/$defs/ResponseStatus"+ },+ "error": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/$defs/Error"+ }+ ],+ "description": "Non-null only when status is `failed`."+ },+ "incomplete_details": {+ "type": [+ "object",+ "null"+ ],+ "additionalProperties": true+ },+ "previous_response_id": {+ "type": [+ "string",+ "null"+ ]+ },+ "model": {+ "type": "string",+ "description": "The model that actually ran."+ },+ "output": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/OutputItem"+ }+ },+ "store": {+ "type": "boolean"+ },+ "usage": {+ "oneOf": [+ {+ "type": "null"+ },+ {+ "$ref": "#/$defs/Usage"+ }+ ],+ "description": "null when the server cannot account for usage. A fabricated zero would be worse than an\nhonest absence, because a client cannot tell it from a free task.\n"+ },+ "metadata": {+ "type": "object",+ "properties": {+ "session_id": {+ "type": "string"+ },+ "requested_model": {+ "type": "string",+ "description": "Present when the server ran a different model than was requested."+ },+ "model_fallback": {+ "type": "boolean"+ },+ "model_fallback_reason": {+ "type": "string"+ },+ "ignored_fields": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Request fields the server did not act on, by name, in any order. Required when the\nrequest carried `tools` or `include`, which are reserved and ignored. A silently\nignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4.\n"+ }+ },+ "additionalProperties": true+ }+ },+ "additionalProperties": true+ },+ "ResponseStatus": {+ "type": "string",+ "enum": [+ "in_progress",+ "completed",+ "failed",+ "incomplete",+ "cancelled"+ ],+ "description": "`incomplete` means a budget stopped the work and is usually worth continuing.\n`failed` means it could not be done. `cancelled` means the client asked for a stop, and must\nnever be reported as `failed`.\n"+ },+ "OutputItem": {+ "type": "object",+ "required": [+ "type"+ ],+ "description": "A client must tolerate item types it does not recognise. A client that renders only `message`\nitems and ignores the rest is a valid client.\n",+ "properties": {+ "id": {+ "type": "string"+ },+ "type": {+ "type": "string",+ "examples": [+ "message",+ "reasoning",+ "function_call",+ "function_call_output"+ ]+ },+ "status": {+ "type": "string"+ },+ "role": {+ "type": "string"+ },+ "content": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/ContentPart"+ }+ },+ "summary": {+ "type": "array",+ "items": {+ "type": "object",+ "additionalProperties": true+ }+ },+ "call_id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "arguments": {+ "type": "string",+ "description": "JSON",+ "as a string": null+ },+ "output": {+ "type": "string"+ }+ },+ "additionalProperties": true+ },+ "ContentPart": {+ "type": "object",+ "required": [+ "type"+ ],+ "properties": {+ "type": {+ "type": "string",+ "examples": [+ "output_text"+ ]+ },+ "text": {+ "type": "string"+ },+ "annotations": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Annotation"+ }+ }+ },+ "additionalProperties": true+ },+ "Annotation": {+ "type": "object",+ "required": [+ "type"+ ],+ "properties": {+ "type": {+ "type": "string",+ "const": "container_file_citation"+ },+ "container_id": {+ "type": "string"+ },+ "file_id": {+ "type": "string"+ },+ "filename": {+ "type": "string"+ },+ "download_url": {+ "type": "string",+ "format": "uri"+ },+ "start_index": {+ "type": "integer"+ },+ "end_index": {+ "type": "integer"+ }+ },+ "additionalProperties": true+ },+ "Usage": {+ "type": "object",+ "properties": {+ "input_tokens": {+ "type": "integer",+ "minimum": 0+ },+ "output_tokens": {+ "type": "integer",+ "minimum": 0+ },+ "total_tokens": {+ "type": "integer",+ "minimum": 0+ },+ "cache_read_tokens": {+ "type": "integer",+ "minimum": 0+ },+ "cache_write_tokens": {+ "type": "integer",+ "minimum": 0+ }+ },+ "additionalProperties": true+ },+ "SessionShare": {+ "type": "object",+ "description": "A published read-only view of a session (Sessions §5). `url` may be relative, resolving\nagainst the base URL the caller is already using — a server behind a proxy cannot know its\npublic origin, and a base-relative path survives every fronting. The share's id MUST NOT\nfunction as a credential for the rest of the API.\n",+ "required": [+ "id",+ "url"+ ],+ "properties": {+ "id": {+ "type": "string"+ },+ "url": {+ "type": "string"+ },+ "object": {+ "type": "string",+ "description": "SHOULD be \"session.share\""+ },+ "enabled": {+ "type": "boolean"+ }+ },+ "additionalProperties": true+ },+ "TurnItem": {+ "type": "object",+ "description": "One turn of a session's history (Sessions §3). Previously an object with no stated shape,\nwhich kept every conformance check at \"the endpoint answered 200\" and made transcript\nrebuilding an exercise in one implementation's habits.\n",+ "required": [+ "id",+ "status"+ ],+ "properties": {+ "id": {+ "type": "string",+ "description": "The response id, usable with GET /v1/responses/{id}"+ },+ "status": {+ "type": "string"+ },+ "user": {+ "type": "string"+ },+ "assistant": {+ "type": "string"+ },+ "tools": {+ "type": "array",+ "items": {+ "type": "object",+ "additionalProperties": true+ }+ },+ "files": {+ "type": "array",+ "items": {+ "type": "object",+ "additionalProperties": true+ }+ }+ },+ "additionalProperties": true+ },+ "Session": {+ "type": "object",+ "required": [+ "id"+ ],+ "properties": {+ "id": {+ "type": "string"+ },+ "object": {+ "type": "string",+ "const": "session"+ },+ "harness_id": {+ "type": "string"+ },+ "title": {+ "type": "string"+ },+ "status": {+ "type": "string"+ },+ "created_at": {+ "type": "integer"+ },+ "updated_at": {+ "type": "integer"+ }+ },+ "additionalProperties": true+ },+ "SessionList": {+ "type": "object",+ "required": [+ "sessions"+ ],+ "properties": {+ "sessions": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/Session"+ }+ },+ "next_cursor": {+ "type": [+ "string",+ "null"+ ],+ "description": "null on the last page. A client must not be required to detect the end by receiving fewer\nitems than requested — that heuristic is wrong whenever a page is exactly full.\n"+ }+ },+ "additionalProperties": true+ },+ "File": {+ "type": "object",+ "required": [+ "id",+ "filename"+ ],+ "properties": {+ "id": {+ "type": "string"+ },+ "object": {+ "type": "string",+ "const": "file"+ },+ "container_id": {+ "type": "string"+ },+ "filename": {+ "type": "string"+ },+ "bytes": {+ "type": "integer",+ "minimum": 0+ },+ "created_at": {+ "type": "integer"+ }+ },+ "additionalProperties": true+ },+ "ErrorEnvelope": {+ "type": "object",+ "required": [+ "error"+ ],+ "properties": {+ "error": {+ "$ref": "#/$defs/Error"+ },+ "detail": {+ "type": "string",+ "deprecated": true,+ "description": "A human-readable alias of `error.message`, retained for clients written against\nimplementations that predate this envelope. Carries no information not in `error`.\n"+ }+ },+ "additionalProperties": true+ },+ "Error": {+ "type": "object",+ "required": [+ "type",+ "code",+ "message"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "invalid_request_error",+ "authentication_error",+ "permission_error",+ "rate_limit_error",+ "harness_error",+ "server_error"+ ]+ },+ "code": {+ "type": "string",+ "description": "Specific and machine-readable. Servers may define additional codes for conditions this\nspecification does not cover, and must namespace them with a vendor prefix so a future\nversion cannot collide with them.\n",+ "examples": [+ "unsupported_protocol_version",+ "invalid_input",+ "harness_not_found",+ "response_not_found",+ "session_not_found",+ "plugin_not_found",+ "file_not_found",+ "session_expired",+ "harness_mismatch",+ "session_busy",+ "plugin_conflict",+ "file_too_large",+ "model_unavailable",+ "unsupported_base",+ "plugin_invalid",+ "unsupported_plugin_schema",+ "unsupported_transport",+ "missing_credential",+ "invalid_credential",+ "insufficient_scope",+ "rate_limited",+ "quota_exhausted",+ "harness_error",+ "harness_unavailable",+ "provider_error",+ "timeout",+ "cancelled",+ "preview_unavailable",+ "preview_failed"+ ]+ },+ "message": {+ "type": "string",+ "description": "One sentence, safe to show a user. Must not contain credentials, internal hostnames, file\npaths, or stack traces.\n"+ },+ "param": {+ "type": [+ "string",+ "null"+ ],+ "description": "Dotted path to the offending field."+ },+ "detail": {+ "type": [+ "object",+ "null"+ ],+ "additionalProperties": true+ }+ },+ "additionalProperties": true+ },+ "Event": {+ "type": "object",+ "required": [+ "type",+ "sequence_number"+ ],+ "description": "One streamed event. `sequence_number` starts at 0 and increases by exactly 1 per event, so a\nclient can detect a dropped event rather than silently rendering a gap.\n",+ "properties": {+ "type": {+ "type": "string",+ "examples": [+ "response.created",+ "response.in_progress",+ "response.output_item.added",+ "response.output_item.done",+ "response.content_part.added",+ "response.content_part.done",+ "response.output_text.delta",+ "response.output_text.done",+ "response.output_text.annotation.added",+ "response.reasoning_summary_part.added",+ "response.reasoning_summary_text.delta",+ "response.reasoning_summary_part.done",+ "response.function_call_arguments.delta",+ "response.function_call_arguments.done",+ "response.completed",+ "response.incomplete",+ "response.failed",+ "error"+ ]+ },+ "sequence_number": {+ "type": "integer",+ "minimum": 0+ },+ "response": {+ "$ref": "#/$defs/Response"+ },+ "item": {+ "$ref": "#/$defs/OutputItem"+ },+ "part": {+ "$ref": "#/$defs/ContentPart"+ },+ "annotation": {+ "$ref": "#/$defs/Annotation"+ },+ "delta": {+ "type": "string"+ },+ "text": {+ "type": "string"+ },+ "arguments": {+ "type": "string"+ },+ "item_id": {+ "type": "string"+ },+ "output_index": {+ "type": "integer",+ "minimum": 0+ },+ "content_index": {+ "type": "integer",+ "minimum": 0+ },+ "summary_index": {+ "type": "integer",+ "minimum": 0+ },+ "annotation_index": {+ "type": "integer",+ "minimum": 0+ },+ "code": {+ "type": "string"+ },+ "message": {+ "type": "string"+ },+ "param": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "additionalProperties": true+ }+ }+}diff --git a/protocol/site/build.py b/protocol/site/build.pyindex 125987f8..7fcce9e4 100644--- a/protocol/site/build.py+++ b/protocol/site/build.py@@ -28,12 +28,14 @@ except ImportError: # pragma: no coverHERE = pathlib.Path(__file__).parentROOT = HERE.parent # protocol/DIST = HERE / "dist"-VERSION = "2026-08-11"+VERSION = "2026-09-12"# Published specification versions, latest first. The spec is served under a per-version path# (/spec/<date>/…, mirroring MCP's /specification/<date>/…) so every version keeps a permanent# address: a citation to the 2026-08-11 architecture never silently becomes a later version. Only# the specification is versioned this way; conformance, governance and versioning are living docs.-VERSIONS = ["2026-08-11"]+# Every version listed is built from its own frozen tree under protocol/versions/<date>/; the latest+# is the one in the sidebar, the rest are served at their dated addresses with a notice.+VERSIONS = ["2026-09-12", "2026-08-11"]SITE = "unifiedharnessprotocol.org"# The specification's chapters, in reading order. NAV builds their per-version paths from this so@@ -43,6 +45,7 @@ SPEC_CHAPTERS = [("architecture", "Architecture"),("lifecycle", "Lifecycle"),("harnesses", "Harnesses"),+ ("plugins", "Plugins"),("tasks", "Tasks"),("streaming", "Streaming"),("sessions", "Sessions"),@@ -52,6 +55,21 @@ SPEC_CHAPTERS = [("schema", "Schema"),]+++def chapters_for(version: str):+ """The chapters a version actually has: a chapter added later has no page in an earlier+ version, and the build must not invent one. The frozen tree is the authority."""+ return [(name, title) for name, title in SPEC_CHAPTERS+ if (ROOT / "versions" / version / f"{name}.md").exists()]+++def archived_pages():+ """Pages of every version but the latest, served at their dated addresses, not in the nav."""+ return [(f"spec/{v}/{name}.html", title, ROOT / f"versions/{v}/{name}.md")+ for v in VERSIONS[1:] for name, title in chapters_for(v)]++# ── information architecture ────────────────────────────────────────────────────────────# Mirrors the shape a protocol site is expected to have — an introduction, a versioned# specification, the machine-readable definitions, conformance, and the change process — so a@@ -116,6 +134,9 @@ DESCRIPTIONS = {"spec/harnesses.html":"UHP harness discovery: the harness object, model availability, and how a conformant ""server advertises what can run a client's work.",+ "spec/plugins.html":+ "UHP plugins: Agent Plugins packages of tools and skills installed into a harness as one "+ "unit, how they compose with the harness's own, and how a harness exports as one.","spec/tasks.html":"UHP tasks: one unit of work, input in and result out — the request shape, execution ""semantics, and response contract clients build on.",@@ -404,6 +425,9 @@ hr{border:0;border-top:1px solid var(--line);margin:32px 0}.card-sm span{color:var(--muted);font-size:13px;line-height:1.5}@media (max-width:640px){.cards-primary,.cards-secondary{grid-template-columns:1fr}}+.vnotice{margin:0 0 22px;padding:12px 16px;border:1px solid var(--line);border-left:3px solid var(--brand);+ border-radius:8px;background:var(--subtle);font-size:14px;color:var(--muted)}+.vnotice b{color:var(--ink)}.pager{display:flex;justify-content:space-between;gap:16px;margin-top:56px;padding-top:20px;border-top:1px solid var(--line);max-width:var(--content)}.pager a{font-size:14px;font-weight:560}@@ -577,15 +601,19 @@ def toc_html(toc):f'<ul>{items}</ul></nav>')-def rewrite_links(html_text: str, depth: int) -> str:- """Point in-repo markdown links at their built pages (root-absolute, see url_for)."""+def rewrite_links(html_text: str, depth: int, version: str = VERSION) -> str:+ """Point in-repo markdown links at their built pages (root-absolute, see url_for).++ `version` is the version of the page being rendered: a same-directory link on a 2026-08-11+ chapter stays inside 2026-08-11, so a citation into an older version never drifts forward."""up = "/"- samedir = f"/spec/{VERSION}/" if depth else "/"+ samedir = f"/spec/{version}/" if depth else "/"+ ver = r"(\d{4}-\d{2}-\d{2})"pairs = [# The spec overview is served at /spec/<version> (index stripped), so map it before the# general chapter rule, which would otherwise turn index.md into …/index (a 404).- (rf'href="(?:\.\./)*versions/{VERSION}/index\.md"', rf'href="{up}spec/{VERSION}"'),- (rf'href="(?:\.\./)*versions/{VERSION}/([a-z]+)\.md"', rf'href="{up}spec/{VERSION}/\1"'),+ (rf'href="(?:\.\./)*versions/{ver}/index\.md"', rf'href="{up}spec/\1"'),+ (rf'href="(?:\.\./)*versions/{ver}/([a-z]+)\.md"', rf'href="{up}spec/\1/\2"'),(r'href="(?:\.\./)*README\.md"', f'href="{url_for("index.html", up)}"'),(r'href="(?:\.\./)*VERSIONING\.md"', f'href="{up}versioning"'),(r'href="(?:\.\./)*GOVERNANCE\.md"', f'href="{up}governance"'),@@ -596,17 +624,19 @@ def rewrite_links(html_text: str, depth: int) -> str:(r'href="(?:\.\./)*conformance/README\.md"', f'href="{up}conformance"'),(r'href="(?:\.\./)*conformance/?"', f'href="{up}conformance"'),(r'href="(?:\.\./)*\.\./conformance/"', f'href="{up}conformance"'),+ # A same-directory chapter link, with or without a section anchor, stays in this version.+ (r'href="([a-z]+)\.md#([^"]+)"', rf'href="{samedir}\1#\2"'),(r'href="([a-z]+)\.md"', rf'href="{samedir}\1"'),(r'href="(?:\.\./)*schema/([^"/]+)"',rf'href="{up}schema/\1"'), # the machine-readable files ship with the site- (r'href="(?:\.\./)*schema/"', f'href="{up}spec/{VERSION}/schema"'),- (rf'href="versions/{VERSION}/"', f'href="{up}spec/{VERSION}"'),+ (r'href="(?:\.\./)*schema/"', f'href="{up}spec/{version}/schema"'),+ (rf'href="versions/{ver}/"', rf'href="{up}spec/\1"'),# An anchor into another document's section: keep the section, retarget the document.(r'href="(?:\.\./)*VERSIONING\.md#([^"]+)"', rf'href="{up}versioning#\1"'),(r'href="(?:\.\./)*GOVERNANCE\.md#([^"]+)"', rf'href="{up}governance#\1"'),(r'href="(?:\.\./)*README\.md#([^"]+)"', rf'href="{url_for("index.html", up)}#\1"'),- (rf'href="(?:\.\./)*versions/{VERSION}/([a-z]+)\.md#([^"]+)"',- rf'href="{up}spec/{VERSION}/\1#\2"'),+ (rf'href="(?:\.\./)*versions/{ver}/([a-z]+)\.md#([^"]+)"',+ rf'href="{up}spec/\1/\2#\3"'),]for pat, repl in pairs:html_text = re.sub(pat, repl, html_text)@@ -643,7 +673,7 @@ def desc_key(path: str) -> str:"""Map a built page path to its description key. Spec pages carry the version in their path(spec/2026-08-11/architecture.html) but their descriptions are authored per chapter, version-independent (spec/architecture.html) — one description serves every version of a chapter."""- return re.sub(rf"^spec/{re.escape(VERSION)}/", "spec/", path)+ return re.sub(r"^spec/\d{4}-\d{2}-\d{2}/", "spec/", path)def section_of(path):@@ -708,6 +738,16 @@ def page(current: str, title: str, body: str, depth: int, hero: str = "", toc: s# On a dated spec page the pill names that page's version; elsewhere it names the latest.page_ver = next((v for v in VERSIONS if current.startswith(f"spec/{v}/")), VERSION)shell_wide = "" if toc else " no-toc"+ notice = ""+ if page_ver != VERSION:+ # An older version stays at its address, and says so: a reader who arrived by citation+ # should know a newer version exists without being moved off the text they were sent to.+ chapter = current.rsplit("/", 1)[-1]+ target = f"/spec/{VERSION}" if chapter == "index.html" else f"/spec/{VERSION}/{chapter[:-5]}"+ if not (DIST / target.lstrip("/")).with_suffix(".html").exists() and chapter != "index.html":+ target = f"/spec/{VERSION}"+ notice = (f'<div class="vnotice">This is version <b>{page_ver}</b> of the specification. '+ f'The current version is <a href="{target}">{VERSION}</a>.</div>')pages = flat_pages()idx = next((i for i, (p, _, _) in enumerate(pages) if p == current), -1)prev_ = pages[idx - 1] if idx > 0 else None@@ -791,7 +831,7 @@ def page(current: str, title: str, body: str, depth: int, hero: str = "", toc: s<div class="shell{shell_wide}"><aside>{sidebar(current, depth)}</aside><main>- {hero}+ {hero}{notice}<article>{body}</article>{pager}<footer>@@ -892,7 +932,7 @@ def check_count() -> int:HERO = f"""<div class="quicklinks">- <a class="card-sm" href="/spec/{VERSION}"><b>Specification</b><span>The normative contract — ten versioned chapters.</span></a>+ <a class="card-sm" href="/spec/{VERSION}"><b>Specification</b><span>The normative contract — {len(SPEC_CHAPTERS) - 1} versioned chapters.</span></a><a class="card-sm" href="/conformance"><b>Conformance suite</b><span>{check_count()} runnable checks; the definition of conformant.</span></a><a class="card-sm" href="/connecting"><b>Implement a client</b><span>Discovery, tasks, events, artifacts — over HTTP.</span></a><a class="card-sm" href="/serving"><b>Implement a server</b><span>The operations a server answers behind the contract.</span></a>@@ -919,7 +959,8 @@ def build() -> int:if DIST.exists():shutil.rmtree(DIST)- (DIST / "spec" / VERSION).mkdir(parents=True)+ for v in VERSIONS:+ (DIST / "spec" / v).mkdir(parents=True)built = 0search_index = []@@ -976,6 +1017,19 @@ def build() -> int:"body": plain_text(body)[:1400]})built += 1+ # Earlier versions: each chapter from its own frozen tree, links kept inside that version,+ # a notice pointing at the current one. Not in the sidebar, but sitemapped and citable.+ for path, title, src in archived_pages():+ v = path.split("/")[1]+ depth = path.count("/")+ rendered, toc = render_markdown(src.read_text())+ body = rewrite_links(rendered, depth, version=v)+ (DIST / path).write_text(page(path, title, body, depth, "", toc_html(toc)))+ search_index.append({"title": f"{title} ({v})", "section": f"Specification {v}",+ "url": url_for(path).lstrip("/"),+ "body": plain_text(body)[:1400]})+ built += 1+# The dropdown offers every entry in VERSIONS; each must actually have been built, or a reader# who picks it lands on a 404. Today NAV emits only the latest version's chapters, so adding a# second version means teaching the build to emit its pages too — this assertion makes that a@@ -994,7 +1048,7 @@ def build() -> int:(DIST / "robots.txt").write_text(f"User-agent: *\nAllow: /\nSitemap: https://{SITE}/sitemap.xml\n")urls = "".join(f" <url><loc>https://{SITE}/{url_for(p).lstrip('./')}</loc></url>\n"- for p, _, _ in flat_pages() + EXTRA)+ for p, _, _ in flat_pages() + EXTRA + archived_pages())(DIST / "sitemap.xml").write_text(f'<?xml version="1.0" encoding="UTF-8"?>\n'f'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n{urls}</urlset>\n')@@ -1009,6 +1063,11 @@ def build() -> int:llms.append("\n## Background\n")for p, title, _ in EXTRA:llms.append(f"- [{title}](https://{SITE}/{url_for(p).lstrip('./')}): {DESCRIPTIONS[desc_key(p)]}")+ if VERSIONS[1:]:+ llms.append("\n## Earlier specification versions\n")+ for v in VERSIONS[1:]:+ llms.append(f"- [Specification {v}](https://{SITE}/spec/{v}): the {v} version, "+ f"kept at its own address; the current version is {VERSION}.")(DIST / "llms.txt").write_text("\n".join(llms) + "\n", encoding="utf-8")# Search index: every page's title and plain-text body, built from the same render as thediff --git a/protocol/vercel.json b/protocol/vercel.jsonindex f16a3584..3fd5f444 100644--- a/protocol/vercel.json+++ b/protocol/vercel.json@@ -6,7 +6,7 @@"cleanUrls": true,"trailingSlash": false,"redirects": [- { "source": "/spec", "destination": "/spec/2026-08-11", "permanent": false }+ { "source": "/spec", "destination": "/spec/2026-09-12", "permanent": false }],"headers": [{diff --git a/protocol/versions/2026-09-12/architecture.md b/protocol/versions/2026-09-12/architecture.mdnew file mode 100644index 00000000..04a63794--- /dev/null+++ b/protocol/versions/2026-09-12/architecture.md@@ -0,0 +1,141 @@+# Architecture++**Unified Harness Protocol, version `2026-09-12`**++The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY and+OPTIONAL in this specification are to be interpreted as described in [RFC 2119][rfc2119] and+[RFC 8174][rfc8174] when, and only when, they appear in all capitals.++[rfc2119]: https://www.rfc-editor.org/rfc/rfc2119+[rfc8174]: https://www.rfc-editor.org/rfc/rfc8174++## 1. Roles++```+┌──────────┐ UHP over HTTP ┌──────────┐ implementation-defined ┌──────────┐+│ Client │ ────────────────▶ │ Server │ ─────────────────────────▶ │ Harness │+└──────────┘ └──────────┘ └──────────┘+```++**Client** — an application that wants work done: a product backend, a CLI, a CI job, another agent.+A client speaks only UHP. It MUST NOT be required to know which harness implementation runs behind+the server, nor how the server executes it.++**Server** — implements this specification. It accepts tasks, drives one or more harnesses, and+reports progress and results in the vocabulary defined here. Everything about *how* it runs a+harness — containers, subprocesses, queues, remote workers — is out of scope for this specification+and MUST NOT leak into the wire format.++**Harness** — a complete agent runtime with its own loop, tools and session state. UHP does not+specify the harness itself; it specifies how a client drives one through a server. Harnesses are+identified by a **base**: a stable string such as `codex`, `claude-code` or `hermes`.++A **configured harness** is a base plus configuration — default model, system prompt, tool+restrictions, skills, MCP servers, step and time budgets. It is the unit a client selects when it+sends work, and it is addressed by a server-assigned id.++> **Why a configured harness, and not just a base?**+> The same base behaves very differently with a different system prompt, a different model, or a+> different tool set. Making the configuration a first-class, addressable object means a product can+> change how its agent behaves without redeploying its backend, and means two products can share a+> server without sharing behaviour.++## 2. Conformance classes++A server declares which class it implements. Each class is cumulative: **Extended** includes+**Core**, **Full** includes **Extended**.++| Class | A server at this class MUST implement |+|---|---|+| **Core** | Capability discovery, harness discovery, non-streaming and streaming task execution, session continuation, cancellation, and the error model. |+| **Extended** | Core, plus file input, artifact retrieval, and session listing/inspection. |+| **Full** | Extended, plus harness lifecycle management (create, update, delete) and session sharing. |++A client MUST NOT assume any capability above **Core** without checking capability discovery+(see [Lifecycle §2](lifecycle.md)). A server MUST NOT advertise a capability it does not implement —+advertising is a promise, and a client that trusts it and receives a `404` has been lied to in a way+it cannot recover from.++The [conformance suite](../../conformance/) tests each class separately and reports per class. A+server that passes at a class MAY describe itself as "UHP <version> conformant (<class>)", naming+the version its discovery document serves as `default_version`, which the suite reports. No+other use of the term "conformant" is meaningful.++## 3. Object model++Six object types. Every one carries an `object` field naming its type, and an `id` with a+type-distinguishing prefix so an identifier is never ambiguous about what it points at.++| Object | `object` value | Id prefix | Lifetime |+|---|---|---|---|+| Harness | `harness` | `chrn_` | Until deleted |+| Response | `response` | `resp_` | Retained per server policy |+| Session | `session` | `hsess` | Until deleted |+| File | `file` | `file_` | With its container |+| Container | `container` | `cntr_` | With its session |+| Event | *(none — events carry `type`)* | — | Streamed, and replayable |++Their relationships:++```+Harness ──┐+ ├──▶ Session ──┬──▶ Response ──▶ Response ──▶ … (one per task, chained)+Model ───┘ └──▶ Container ──▶ File, File, … (artifacts)+```++- A **response** is one task: one request in, one result out. It is the atomic unit of work.+- A **session** is a chain of responses that share conversational context and a working directory.+ A session is created implicitly by the first task and extended by `previous_response_id`.+- A **container** is the file namespace of a session. Files the agent writes become artifacts in it.++> **Why is the session implicit?**+> Requiring `POST /sessions` before any work could be done would add a round trip, a failure mode,+> and an object to clean up — for a concept most first tasks never need. A client that only ever+> sends one-shot tasks never learns the word "session"; a client that needs continuity gets it by+> quoting the id it already has.++## 4. Transport++- All requests MUST be HTTP/1.1 or later over TLS, except for loopback development where a server+ MAY accept plaintext.+- Request and response bodies are `application/json; charset=utf-8`, except file upload+ (`multipart/form-data`) and file download (the file's own media type).+- Streaming uses Server-Sent Events (`text/event-stream`) as described in+ [Streaming](streaming.md).+- Servers MUST accept requests with an absent `Accept` header and default to JSON.++## 5. Authentication++A client authenticates with a bearer token:++```http+Authorization: Bearer <token>+```++How tokens are issued is out of scope. A server MUST reject an absent, malformed, or unknown token+with `401` and the error model in [Errors](errors.md), and MUST NOT distinguish "no such token"+from "token not permitted here" in a way that lets a caller enumerate valid tokens.++A server MUST scope every object to the principal that created it. A client MUST NOT be able to+read, continue, cancel or delete another principal's response, session, or file — including by+guessing an id. Servers MUST return `404`, not `403`, for objects outside the caller's scope, so+that an id's existence is not disclosed.++## 6. Design principles++These are the rules the specification holds itself to. They are included because they explain the+shape of what follows, and because a future change that violates one is probably a mistake.++1. **The client should not be able to tell which harness ran the work** — except by asking. Every+ difference between harnesses that a client can observe is a leak, and each leak is a place where+ swapping harnesses breaks a product.+2. **Progress is a stream of facts, not a rendering.** Events describe what happened — text, a tool+ call, a file — never how to display it.+3. **A field means one thing.** Where UHP extends a borrowed surface, it adds fields; it never+ redefines one.+4. **Absent is not empty, and empty is not zero.** A server that does not know a value omits it. It+ MUST NOT invent a placeholder, an estimate, or a zero.+5. **Failure is a first-class result.** Every failure is reportable in the same envelope as success,+ with a machine-readable code. A client should never have to parse prose to find out what to do.+6. **The specification, the reference implementation and the conformance suite move together.** A+ sentence here that no test enforces is a wish, not a standard.diff --git a/protocol/versions/2026-09-12/errors.md b/protocol/versions/2026-09-12/errors.mdnew file mode 100644index 00000000..57ed9aa9--- /dev/null+++ b/protocol/versions/2026-09-12/errors.md@@ -0,0 +1,129 @@+# Errors++**Unified Harness Protocol, version `2026-09-12`**++A client's error handling is only as good as the server's error reporting. This chapter defines one+envelope, a closed set of codes, and which failures are worth retrying.++## 1. The error envelope++Every non-2xx response MUST have this body:++```json+{+ "error": {+ "type": "invalid_request_error",+ "code": "harness_not_found",+ "message": "No harness with id 'chrn_deadbeef'.",+ "param": "metadata.harness_id",+ "detail": null+ }+}+```++| Field | Type | Required | Meaning |+|---|---|---|---|+| `type` | string | yes | Broad class; see §2 |+| `code` | string | yes | Specific, machine-readable reason; see §3 |+| `message` | string | yes | Human-readable, one sentence, no stack trace |+| `param` | string \| null | yes | Dotted path to the offending field, when there is one |+| `detail` | object \| null | yes | Structured extra context, or `null` |++Rules:++- `message` MUST be safe to show a user. It MUST NOT contain credentials, internal hostnames, file+ paths, or stack traces.+- `code` MUST come from §3 where one applies. A server MAY define additional codes for conditions+ this specification does not cover, and MUST namespace them with a vendor prefix (`acme_…`) so a+ future version of this specification cannot collide with them.+- A server MUST NOT return `200` with an error inside. The failure of a *task* is reported as a+ response with `status: "failed"` and HTTP `200`, because the request succeeded; the failure of a+ *request* is a non-2xx with this envelope. Those are different events and MUST NOT be conflated.++> **Compatibility note.** A server MAY additionally include a top-level `detail` string alongside+> `error`, for clients written against implementations that predate this envelope. That field is+> deprecated, carries no information not in `error.message`, and will be removed in a future version.++## 2. Error types++| `type` | HTTP | Meaning |+|---|---|---|+| `invalid_request_error` | 400, 404, 409, 413, 422 | The request was wrong. Retrying it unchanged will fail again. |+| `authentication_error` | 401 | The credential is missing, malformed or unknown. |+| `permission_error` | 403 | Authenticated, but not allowed to do this. |+| `rate_limit_error` | 429 | Too many requests, or a quota is exhausted. |+| `harness_error` | 200 (in a failed response) | The harness ran and failed. |+| `server_error` | 500, 502, 503, 504 | The server failed. Retrying MAY succeed. |++## 3. Error codes++### 3.1 Request and routing++| Code | HTTP | Meaning |+|---|---|---|+| `unsupported_protocol_version` | 400 | `UHP-Version` names a version this server cannot serve. `detail.supported` lists what it can. |+| `invalid_input` | 400 | The body could not be parsed, or a field has the wrong type. |+| `harness_not_found` | 404 | No such harness in the caller's scope. |+| `response_not_found` | 404 | No such response in the caller's scope. |+| `session_not_found` | 404 | No such session in the caller's scope. |+| `plugin_not_found` | 404 | The harness has no plugin of that name. |+| `file_not_found` | 404 | No such file in the caller's scope. |+| `session_expired` | 404 | The session existed but is past its retention. |+| `harness_mismatch` | 409 | The task named a different harness than the session it continues. |+| `session_busy` | 409 | A task is already running in this session. |+| `plugin_conflict` | 409 | Two plugins share a name, or a component name collides across the harness and its plugins. `detail.component`, `detail.name` and `detail.between` say which. |+| `file_too_large` | 413 | The upload exceeds the server's limit. `detail.max_bytes` states it. |+| `model_unavailable` | 422 | The requested model cannot be served for this harness. |+| `unsupported_base` | 422 | The requested harness base is not supported by this server. |+| `plugin_invalid` | 422 | The package is not a valid Agent Plugins package: no manifest, a fatal manifest error, a path that escapes the root, or a `name` that contradicts the manifest. `detail.path` and `detail.reason` say where. |+| `unsupported_plugin_schema` | 422 | The manifest's `$schema` names an Agent Plugins version this server does not install. `detail.supported` lists what it does. |+| `unsupported_transport` | 422 | A plugin declares an MCP server whose transport cannot be run for this harness base. `detail.transport` and `detail.base` say which. |++### 3.2 Authentication and limits++| Code | HTTP | Meaning |+|---|---|---|+| `missing_credential` | 401 | No bearer token. |+| `invalid_credential` | 401 | The token is malformed, unknown, or revoked. |+| `insufficient_scope` | 403 | The credential cannot perform this operation. |+| `rate_limited` | 429 | Slow down. `Retry-After` SHOULD be set. |+| `quota_exhausted` | 429 | A budget is spent; retrying now will not help. |++### 3.3 Execution++| Code | Where | Meaning |+|---|---|---|+| `harness_error` | failed response | The harness ran and could not complete the work. |+| `harness_unavailable` | 503 | No capacity to run this harness right now. |+| `provider_error` | failed response | The upstream model provider refused or failed. |+| `timeout` | failed response | The task exceeded its wall-clock budget. |+| `cancelled` | cancelled response | The client cancelled it. |+| `preview_unavailable` | 501 | This server does not render previews. |+| `preview_failed` | 502 | Conversion of this file failed. |++## 4. Retrying++| Situation | Retry? |+|---|---|+| `server_error` (500, 502, 503, 504) | Yes, with exponential backoff and jitter |+| `rate_limited` | Yes, after `Retry-After` |+| `quota_exhausted` | No — nothing will change until the quota does |+| `session_busy` | Yes, once the in-flight task is terminal |+| Any `invalid_request_error` | No — fix the request |+| `authentication_error` | No — fix the credential |+| A task that reached `failed` | Only with the client's own judgment; it consumed real resources |++**Retries of `POST /v1/responses` MUST carry an `Idempotency-Key`.** Without one, a retry after a+timeout runs the task a second time — and the first may still be running, editing the same files.+This is the single most damaging mistake a UHP client can make; see [Tasks §6](tasks.md).++## 5. Timeouts++A client SHOULD set generous timeouts. Agent tasks routinely run for minutes; a 30-second HTTP+timeout will cancel healthy work.++- Streaming: no total timeout. Use an inactivity timeout instead — a server SHOULD emit a comment+ line (`: keep-alive`) at least every 30 seconds so the client can distinguish a working agent from+ a dead connection.+- Non-streaming: at least the task's `timeout_seconds`, plus margin.+- A client that gives up MUST NOT assume the task stopped. It has not. Cancel it explicitly.diff --git a/protocol/versions/2026-09-12/files.md b/protocol/versions/2026-09-12/files.mdnew file mode 100644index 00000000..353c5dc6--- /dev/null+++ b/protocol/versions/2026-09-12/files.md@@ -0,0 +1,137 @@+# Files++**Unified Harness Protocol, version `2026-09-12`**++An agent that can only return text is a chatbot. A harness edits files, writes reports, produces+diagrams. This chapter defines getting files in and artifacts out.++Conformance class **Extended**.++## 1. Sending files in++### 1.1 Inline++For small files, inline the bytes as a data URL:++```json+{+ "input": [+ { "role": "user", "content": [+ { "type": "input_text", "text": "Summarise this." },+ { "type": "input_file", "filename": "q3.pdf",+ "file_data": "data:application/pdf;base64,JVBERi0xLjQK…" }+ ]}+ ]+}+```++### 1.2 By upload++For anything larger, upload once and reference by id:++```http+POST /v1/files+Content-Type: multipart/form-data+```++```json+{ "id": "file_abc123", "object": "file", "filename": "q3.pdf", "bytes": 184320, "created_at": 1786400000 }+```++```json+{ "type": "input_file", "file_id": "file_abc123" }+```++A server MUST accept both forms. Inline avoids a round trip for a 4 KB file; upload avoids+base64-inflating a 40 MB one through every retry. A server MUST document its size limit and MUST+reject an oversized upload with `413` and `code: "file_too_large"` rather than truncating — a+silently truncated input produces a confident, wrong answer.++## 2. Getting artifacts out++Files an agent produces become artifacts of the session's container. They are reported in two+places.++### 2.1 On the response++Artifacts appear as annotations on the assistant message:++```json+{+ "type": "message",+ "content": [+ { "type": "output_text", "text": "I've written the report.",+ "annotations": [+ { "type": "container_file_citation",+ "container_id": "cntr_…",+ "file_id": "file_…",+ "filename": "report.md",+ "download_url": "https://server/v1/containers/cntr_…/files/file_…/content",+ "start_index": 0, "end_index": 24 }+ ]+ }+ ]+}+```++A client that renders only text still shows a correct answer; a client that reads annotations can+offer the file. That is the intended layering — artifacts are additive to the message, never a+replacement for it.++### 2.2 By listing the session++```http+GET /v1/sessions/{session_id}/files+```++```json+{ "files": [ { "id": "file_…", "container_id": "cntr_…", "filename": "report.md",+ "bytes": 2048, "created_at": 1786400240 } ] }+```++A server MUST list every artifact of the session, including files from earlier tasks. Restricting the+list to the most recent task would make a multi-step session's earlier outputs unreachable.++## 3. Downloading++```http+GET /v1/containers/{container_id}/files/{file_id}/content+```++Returns the raw bytes with the file's own `Content-Type`. A server MUST NOT wrap the bytes in JSON.++A server SHOULD send `Content-Disposition` with the original filename, and MUST set+`X-Content-Type-Options: nosniff`. Artifacts are attacker-influenced content — an agent can be+persuaded to write a file — so serving them without those headers turns an artifact into stored+XSS against the client's own origin.++### 3.1 Preview rendering++A server MAY offer a rendered preview of a document format:++```http+GET /v1/containers/{container_id}/files/{file_id}/pdf+```++If a server does not implement conversion it MUST return `501` with+`code: "preview_unavailable"`, not a broken or empty PDF. If conversion fails it MUST return `502`+with `code: "preview_failed"`. A client can then tell "this server never previews" from "this file+would not convert", and only the second is worth retrying.++## 4. Bulk download++```http+GET /v1/sessions/{session_id}/files/archive+```++Returns every artifact of the session as a single archive. A server SHOULD implement this: a session+that produced forty files should not require forty requests.++## 5. Retention and scope++- Artifacts live with their session. Deleting a session MUST make its artifacts unreachable.+- A server MUST scope file access to the owning principal. A `file_id` from another principal MUST+ return `404`, never the bytes.+- A server MUST NOT let a `container_id` / `file_id` pair traverse outside its container. Path+ traversal through artifact ids is the most likely serious vulnerability in a UHP implementation,+ and the conformance suite probes for it.diff --git a/protocol/versions/2026-09-12/harnesses.md b/protocol/versions/2026-09-12/harnesses.mdnew file mode 100644index 00000000..8c94a845--- /dev/null+++ b/protocol/versions/2026-09-12/harnesses.md@@ -0,0 +1,271 @@+# Harnesses++**Unified Harness Protocol, version `2026-09-12`**++Before a client can send work it needs to know what can run it, and with which models. This chapter+defines discovery, the harness object, and — at conformance class **Full** — how harnesses are+created and changed.++## 1. Discovering harnesses++```http+GET /v1/harnesses+```++```json+{+ "harnesses": [+ {+ "id": "chrn_08dae611630d467ab3e67ed792570ae5",+ "object": "harness",+ "name": "Research agent",+ "base": "claude-code",+ "baseLabel": "Claude Code",+ "defaultModel": "claude-sonnet-4.6",+ "systemPrompt": "",+ "mcpServers": [],+ "skills": [],+ "plugins": [],+ "disabledTools": [],+ "maxStep": null,+ "timeoutSeconds": null,+ "createdAt": 1786403298205+ }+ ]+}+```++A server MUST return only harnesses within the caller's scope. The list MAY be empty — a server with+no configured harnesses is valid, and a client MUST handle that rather than assuming index `0`+exists.++```http+GET /v1/harnesses/{harness_id}+```++Returns one harness object, or `404` with `code: "harness_not_found"`.++## 2. The harness object++| Field | Type | Required | Meaning |+|---|---|---|---|+| `id` | string | yes | `chrn_`-prefixed |+| `object` | string | yes | Always `harness` |+| `name` | string | yes | Human-readable label; not an identifier |+| `base` | string | yes | Which harness runtime: `codex`, `claude-code`, `hermes`, … |+| `baseLabel` | string | no | Display name for `base` |+| `defaultModel` | string | no | Model used when a task omits `model` |+| `systemPrompt` | string | no | Additional standing instructions |+| `mcpServers` | array | no | MCP servers attached to this harness |+| `skills` | array | no | Skills available to this harness |+| `plugins` | array | no | Installed plugins, each a package of tools and skills; see [Plugins](plugins.md) |+| `disabledTools` | string[] | no | Tools withheld from the agent |+| `maxStep` | integer \| null | no | Default step budget |+| `timeoutSeconds` | integer \| null | no | Default wall-clock budget |+| `createdAt` | integer | yes | Unix milliseconds |++`base` values are not enumerated by this specification. A server MAY support bases this document has+never heard of, and a client MUST treat `base` as an opaque string — anything else means the+protocol has to be revised every time a harness is released, which is exactly the coupling UHP+exists to remove.++## 3. Models++```http+GET /v1/models+```++```json+{+ "backends": {+ "claude": {+ "default": "claude-sonnet-4.6",+ "models": [+ { "id": "claude-sonnet-4.6", "label": "claude-sonnet-4.6", "backend": "claude",+ "available": true, "default": true }+ ]+ }+ }+}+```++```http+GET /v1/harnesses/{harness_id}/models+```++```json+{+ "harness_id": "chrn_…",+ "backend": "claude",+ "default": "claude-sonnet-4.6",+ "fallback": "claude-sonnet-4.6",+ "models": [ { "id": "claude-opus-5", "available": true, "default": false } ]+}+```++### 3.1 `available` is a promise++`available: true` means the server can serve that model for that harness **right now** — a+credential exists and the provider can reach it. `available: false` means a request for it will not+run as asked.++A server MUST compute `available`, not assert it. Listing a model as available and then failing the+task is the worst outcome for a client: it presents a choice to a user, the user picks it, and the+work fails after they have committed to it.++A client SHOULD present unavailable models as disabled rather than hiding them, so a user can see+that a model exists and is not configured, rather than wondering why it is missing.++## 4. Tools and skills++A configured harness carries three things that decide what its agent can do. All three are part of+the harness object and are set the same way it is.++### 4.1 MCP servers++```json+{ "mcpServers": [+ { "name": "vault", "url": "https://mcp.example.com/mcp", "transport": "http", "enabled": true }+] }+```++| Field | Required | Meaning |+|---|---|---|+| `name` | yes | Identifies the server to the agent; sanitised to a CLI-safe identifier |+| `url` | yes | Endpoint |+| `transport` | no | `http` (Streamable HTTP, default) or `sse` |+| `enabled` | no | Absent or `true` means enabled |+| `headers` | no | Extra request headers |+| `auth` | no | Bearer token, or a server-side reference the server resolves |++This list carries remote servers only, exactly as it did in the previous version. An MCP server that+runs as a process (`stdio`) is declared inside a plugin, which is what gives it a root to run from+and a directory to keep state in ([Plugins §2.2](plugins.md#22-what-the-server-derives)).++A server MUST connect only the **enabled** entries for a turn. A disabled entry MUST NOT be+contacted at all — not connected and then hidden, which would still leak the turn's existence to+whoever operates that endpoint.++An MCP server that cannot be reached MUST NOT fail the task. The turn MUST proceed without those+tools, because a third-party endpoint being down is not a reason to lose the user's work. A server+SHOULD make the degradation visible in the run rather than silent.++> A server MUST NOT advertise MCP support it cannot deliver. If the harness runtime behind it cannot+> speak the configured transport, that is a broken installation, and reporting it only in a log file+> inside the workspace is indistinguishable — to the user — from the model refusing to use the tool.++### 4.2 Skills++A skill is a **folder**, not a file:++```json+{ "skills": [+ { "name": "vault-manual", "enabled": true, "files": [+ { "path": "SKILL.md", "content": "---\nname: vault-manual\n---\n…" },+ { "path": "references/codes.md", "content": "…" },+ { "path": "scripts/helper.sh", "content": "#!/bin/sh\n…" },+ { "path": "assets/logo.png", "content_b64": "iVBORw0KGgo…" }+ ]}+] }+```++- `files[].path` is relative to the skill's own folder and MUST support nested directories. A server+ MUST reject a path that escapes the folder.+- Text is carried in `content`; binary in `content_b64`. A server MUST preserve both byte-for-byte.+- A bundle MUST contain a `SKILL.md`; a server MUST reject one that does not, at configuration time+ rather than at run time.+- A server MUST materialise the **whole folder** where the agent can read it. Materialising only+ `SKILL.md` breaks every skill that carries references, scripts or data — which is most non-trivial+ skills.+- `enabled: false` suppresses a skill, including one inherited from the base.++A server MAY store large bundles out of line, and MUST return the complete file list from:++```http+GET /v1/harnesses/{harness_id}/skills/{skill_id}/files+```++Round-tripping a harness through `GET` and `PUT` MUST NOT lose skill contents. This is the failure+worth designing against: an unrelated edit — renaming the harness — silently emptying a skill folder+that the user cannot tell is gone until an agent behaves oddly weeks later.++### 4.3 Disabled tools++```json+{ "disabledTools": ["WebSearch"] }+```++Names come from the harness base's own tool catalogue. Enforcement differs by runtime and a server+MUST NOT overstate it:++- Where the runtime supports per-tool restriction, the server MUST enforce it as a hard block.+- Where it does not, the server MUST still convey the restriction to the agent — as a standing+ instruction — and MUST NOT silently drop it. Dropping it is the worst outcome: the operator+ believes a tool is off, and it is not.++A client that requires a guaranteed block SHOULD confirm the harness base supports one rather than+assuming `disabledTools` is always hard.++### 4.4 Plugins++```json+{ "plugins": [ { "name": "contract-review", "enabled": true, "blob": "plg_…" } ] }+```++A plugin is an [Agent Plugins](https://agent-plugins.org/specification) package: `plugin.json`,+`mcp.json` and `skills/`, carried as one folder and installed whole. Its servers and skills join the+harness's own for every turn; the harness's own `mcpServers` and `skills` report only what was+written to them and never absorb a plugin's. The object, the composition rule, the export of a+harness as a package, and what a hosted server owes a running plugin are in the+[Plugins chapter](plugins.md). The capability is `plugins`; a server without it is conformant at+every class.++## 5. Managing harnesses++Conformance class **Full** only. A client MUST check the `harness_management` capability first.++### 5.1 Create++```http+POST /v1/harnesses+```++```json+{ "name": "Research agent", "base": "claude-code", "default_model": "claude-sonnet-4.6" }+```++Returns the created harness object. `base` is REQUIRED and MUST be one the server supports;+otherwise `422` with `code: "unsupported_base"`.++### 5.2 Update++```http+PUT /v1/harnesses/{harness_id}+```++Replaces the mutable configuration. A server MUST NOT change `id`, `base`, or `createdAt`. Changing+the base of an existing harness would silently change the behaviour of every session already+attached to it; a client that wants a different base MUST create a different harness.++### 5.3 Delete++```http+DELETE /v1/harnesses/{harness_id}+```++A server MUST NOT delete the sessions or responses that used the harness. History that disappears+when configuration changes cannot be audited.++## 6. Choosing a harness++Non-normative, but the question every client faces:++| If the task is… | Consider |+|---|---|+| Code editing in a repository | A coding-specialised base (`codex`, `claude-code`) |+| Long-horizon multi-tool work | A base with an explicit step budget and strong tool use |+| Cheap, high-volume classification | The smallest model on any base |++The point of UHP is that this choice stays reversible. A product that speaks UHP can change base or+model with a configuration edit, and can A/B two harnesses against the same input without a second+integration.diff --git a/protocol/versions/2026-09-12/index.md b/protocol/versions/2026-09-12/index.mdnew file mode 100644index 00000000..d06f56d5--- /dev/null+++ b/protocol/versions/2026-09-12/index.md@@ -0,0 +1,90 @@+# Unified Harness Protocol — specification `2026-09-12`++An open standard for running complete agent harnesses as shared infrastructure.++This is the normative specification. For an introduction to what UHP is and why it exists, start at+the [protocol README](../../README.md).++## Chapters++| # | Chapter | Defines |+|---|---|---|+| 1 | [Architecture](architecture.md) | Roles, conformance classes, object model, transport, authentication, design principles |+| 2 | [Lifecycle](lifecycle.md) | Version negotiation, capability discovery, task and session states, concurrency |+| 3 | [Harnesses](harnesses.md) | Discovering, selecting, configuring and managing harnesses; models and availability |+| 4 | [Plugins](plugins.md) | Packages of tools and skills, in the Agent Plugins format, installed into a harness; composition; export |+| 5 | [Tasks](tasks.md) | Running work, the response object, model substitution, idempotency |+| 6 | [Streaming](streaming.md) | The event vocabulary, ordering guarantees, reconnection |+| 7 | [Sessions](sessions.md) | Continuing, inspecting, cancelling, sharing, deleting |+| 8 | [Files](files.md) | File input, artifacts, download, retention and scope |+| 9 | [Errors](errors.md) | The error envelope, codes, retry rules, timeouts |+| 10 | [Security](security.md) | Credentials, object scope, artifacts, injection, exhaustion, plugins, error hygiene |+| 11 | [Schema](schema.md) | Machine-readable definitions and how to generate from them |++## Endpoint summary++| Method | Path | Class | Chapter |+|---|---|---|---|+| `GET` | `/v1/uhp` | Core | [Lifecycle](lifecycle.md) |+| `GET` | `/v1/harnesses` | Core | [Harnesses](harnesses.md) |+| `GET` | `/v1/harnesses/{id}` | Core | [Harnesses](harnesses.md) |+| `GET` | `/v1/models` | Core | [Harnesses](harnesses.md) |+| `GET` | `/v1/harnesses/{id}/models` | Core | [Harnesses](harnesses.md) |+| `POST` | `/v1/responses` | Core | [Tasks](tasks.md) |+| `GET` | `/v1/responses/{id}` | Core | [Tasks](tasks.md) |+| `GET` | `/v1/responses/{id}/input_items` | Core | [Tasks](tasks.md) |+| `POST` | `/v1/responses/{id}/cancel` | Core | [Sessions](sessions.md) |+| `DELETE` | `/v1/responses/{id}` | Core | [Tasks](tasks.md) |+| `POST` | `/v1/sessions/{id}/cancel` | Core | [Sessions](sessions.md) |+| `GET` | `/v1/sessions` | Extended | [Sessions](sessions.md) |+| `GET` | `/v1/sessions/{id}` | Extended | [Sessions](sessions.md) |+| `GET` | `/v1/sessions/{id}/turns` | Extended | [Sessions](sessions.md) |+| `POST` | `/v1/files` | Extended | [Files](files.md) |+| `GET` | `/v1/sessions/{id}/files` | Extended | [Files](files.md) |+| `GET` | `/v1/sessions/{id}/files/archive` | Extended | [Files](files.md) |+| `GET` | `/v1/containers/{cid}/files/{fid}/content` | Extended | [Files](files.md) |+| `GET` | `/v1/containers/{cid}/files/{fid}/pdf` | Extended | [Files](files.md) |+| `POST` | `/v1/harnesses` | Full | [Harnesses](harnesses.md) |+| `PUT` | `/v1/harnesses/{id}` | Full | [Harnesses](harnesses.md) |+| `DELETE` | `/v1/harnesses/{id}` | Full | [Harnesses](harnesses.md) |+| `GET` | `/v1/harnesses/{id}/skills/{name}/files` | Full | [Harnesses](harnesses.md) |+| `GET` | `/v1/harnesses/{id}/plugins/{name}/files` | Full, `plugins` | [Plugins](plugins.md) |+| `GET` | `/v1/harnesses/{id}/plugin` | Full, `plugins` | [Plugins](plugins.md) |+| `POST` | `/v1/sessions/{id}/share` | Full | [Sessions](sessions.md) |+| `GET` | `/v1/sessions/{id}/share` | Full | [Sessions](sessions.md) |+| `DELETE` | `/v1/sessions/{id}` | Full | [Sessions](sessions.md) |+| `DELETE` | `/v1/traces/{id}` | Full | [Sessions](sessions.md) (older path, same operation) |++The `plugins` column entries are served only by a server whose discovery document reports the+`plugins` capability; the capability is optional at every class.++## What changed in this version++This version is additive to `2026-08-11`: every request and object that was valid then is valid+now, and a client written against the previous version keeps working against a server that serves+this one. It adds the [Plugins](plugins.md) chapter, with `stdio` MCP servers inside plugins, the+`plugins` capability, and five error codes. A server may serve both versions from one code path. The [changelog](../../CHANGELOG.md) has the full list.++## Conformance++A server is conformant at a class when it passes the [conformance suite](../../conformance/) at that+class. Nothing else is a conformance claim — not a self-assessment, not an implementation of the+endpoints, not passing "most" tests.++```bash+pip install -e protocol/conformance+uhp-conformance --base-url https://your-server --api-key "$KEY" --class extended+```++The suite is part of this specification. If the suite and this prose disagree, that is a bug in one+of them and MUST be resolved by changing whichever is wrong — never by leaving them inconsistent.++## Conventions++- MUST / SHOULD / MAY are used as defined in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119) and+ [RFC 8174](https://www.rfc-editor.org/rfc/rfc8174).+- JSON examples are illustrative; the [schema](../../schema/) is authoritative for structure.+- Field names are `snake_case` on the task surface (inherited from the Responses-compatible shape)+ and `camelCase` on the harness object. This inconsistency is real, is called out here rather than+ hidden, and is retained because changing either would break existing clients for cosmetic gain.+ A future major version SHOULD unify them.diff --git a/protocol/versions/2026-09-12/lifecycle.md b/protocol/versions/2026-09-12/lifecycle.mdnew file mode 100644index 00000000..b24e8180--- /dev/null+++ b/protocol/versions/2026-09-12/lifecycle.md@@ -0,0 +1,153 @@+# Lifecycle++**Unified Harness Protocol, version `2026-09-12`**++This chapter defines how a client and server agree on a protocol version, how a client learns what+a server can do, and the states a task moves through from submission to result.++## 1. Version negotiation++UHP versions are dates: `YYYY-MM-DD`, the day the version was published. Dates sort, do not imply a+compatibility promise that semantic versioning would imply and not keep, and make the age of an+implementation obvious. See [VERSIONING.md](../../VERSIONING.md) for the compatibility rules.++A client MAY declare the version it was written against:++```http+UHP-Version: 2026-09-12+```++- If the header is absent, the server MUST assume its own default version and MUST state that+ version in the response header. A client that omits the header is asking for the server's choice,+ and gets it.+- If the header names a version the server supports, the server MUST honour it for that request.+- If the header names a version the server does not support, the server MUST fail the request with+ `400` and `code: "unsupported_protocol_version"`, and the error `detail` MUST list the versions it+ does support. It MUST NOT silently serve a different version — a client that asked for a version+ it can parse should not receive one it cannot.++Every response, including errors, MUST carry the version actually used:++```http+UHP-Version: 2026-09-12+```++## 2. Capability discovery++```http+GET /v1/uhp+```++Unauthenticated or authenticated — a server MUST serve this endpoint without a bearer token, because+a client needs to know whether it is talking to a UHP server *before* it can sensibly present+credentials. The document MUST NOT contain anything principal-specific.++```json+{+ "object": "uhp.discovery",+ "protocol": "uhp",+ "versions": ["2026-09-12", "2026-08-11"],+ "default_version": "2026-09-12",+ "conformance_class": "full",+ "capabilities": {+ "streaming": true,+ "sessions": true,+ "cancellation": true,+ "files_input": true,+ "files_output": true,+ "session_listing": true,+ "harness_management": true,+ "session_sharing": true,+ "idempotency": true,+ "plugins": true+ },+ "plugin_schemas": ["https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"],+ "implementation": { "name": "HarnessRouter Community Edition", "version": "0.3.0" }+}+```++| Field | Type | Required | Meaning |+|---|---|---|---|+| `object` | string | yes | Always `uhp.discovery` |+| `protocol` | string | yes | Always `uhp` — lets a client distinguish UHP from a lookalike |+| `versions` | string[] | yes | Every version this server can serve; MUST be non-empty |+| `default_version` | string | yes | Used when the client sends no `UHP-Version`; MUST appear in `versions` |+| `conformance_class` | string | yes | `core`, `extended` or `full` |+| `capabilities` | object | yes | Named booleans; see below |+| `plugin_schemas` | string[] | when `plugins` is true | The Agent Plugins manifest schemas the server installs; see [Plugins §7](plugins.md#7-discovery) |+| `implementation` | object | no | Free-form identification, for debugging and bug reports |++A server MUST report `false` for a capability it does not implement, rather than omitting it, so+that a client can tell "not supported" from "server is older than this field". A client MUST treat+an absent capability key as `false`.++`conformance_class` MUST be consistent with `capabilities`: a server claiming `extended` MUST report+`files_input`, `files_output` and `session_listing` as `true`. The conformance suite checks this,+because a class claim that contradicts the capability list tells a client two different things.++## 3. Task lifecycle++A task moves through these states. `status` on the response object carries the current one.++```+ ┌──────────────┐+ POST /responses │ │+ ────────────────▶│ in_progress │+ │ │+ └──────┬───────┘+ │+ ┌──────────────────┼──────────────────┬───────────────────┐+ ▼ ▼ ▼ ▼+ ┌──────────┐ ┌──────────┐ ┌────────────┐ ┌───────────┐+ │completed │ │ failed │ │ incomplete │ │ cancelled │+ └──────────┘ └──────────┘ └────────────┘ └───────────┘+```++| Status | Meaning | Terminal |+|---|---|---|+| `in_progress` | Accepted and running | no |+| `completed` | The harness finished the work and produced a result | yes |+| `failed` | The task could not be completed; `error` explains why | yes |+| `incomplete` | The harness stopped at a budget — step limit or time limit — with partial output | yes |+| `cancelled` | The client cancelled it; partial output MAY be present | yes |++Rules:++- A server MUST NOT transition out of a terminal state. Once a client has seen `completed`, later+ reads of that response MUST return `completed`.+- `incomplete` MUST be used when a budget stopped the work, and MUST NOT be used for errors. The+ distinction matters to a client: `incomplete` is usually worth continuing, `failed` usually is not.+- A `cancelled` task MUST report `cancelled`, not `failed`. A client that asked for a stop did not+ experience an error.+- Terminal responses MUST retain whatever output was produced before they became terminal. Discarding+ partial work because a task later failed destroys the only evidence of what went wrong.++## 4. Session lifecycle++```+first task ──▶ session created implicitly ──▶ session active ──▶ deleted (client) or expired (server policy)+ ▲ │+ └────┘+ each continued task extends it+```++- A session is created by the server when the first task of a chain runs. Its id MUST be reported in+ the response's `metadata.session_id`.+- A session MUST preserve, across tasks in the chain: conversational context, the working directory+ and its files, and the configured harness.+- A session MUST NOT be extended by a task that names a different configured harness. A server MUST+ fail such a request with `409` and `code: "harness_mismatch"` rather than silently starting a new+ session — continuing a conversation with a different agent is a different conversation, and doing+ it quietly loses work the client believed it had.+- Session expiry is server policy. A server that expires sessions MUST report `404` with+ `code: "session_expired"` on continuation, distinguishable from `session_not_found`.++## 5. Concurrency++- A server MUST accept concurrent tasks in *different* sessions.+- A server MUST NOT run two tasks concurrently in the *same* session: a session has one working+ directory and one conversation, and two agents writing to both is not a defined state. A second+ task for a busy session MUST fail with `409` and `code: "session_busy"`.+- A client that receives `session_busy` SHOULD wait for the in-flight task to reach a terminal state+ and retry. Servers SHOULD include `retry_after_ms` in the error `detail` when they can estimate it,+ and MUST omit it when they cannot rather than guessing.diff --git a/protocol/versions/2026-09-12/plugins.md b/protocol/versions/2026-09-12/plugins.mdnew file mode 100644index 00000000..f17b26f3--- /dev/null+++ b/protocol/versions/2026-09-12/plugins.md@@ -0,0 +1,380 @@+# Plugins++**Unified Harness Protocol, version `2026-09-12`**++A harness carries the tools and skills its agent can use ([Harnesses §4](harnesses.md#4-tools-and-skills)).+Until this version they could only be attached one at a time, to one harness. An operator who wanted+the same three MCP servers and two skills on a second harness, or in a different product, entered+them again. A **plugin** is those same components carried as one named, versioned package that+installs into any harness on any UHP server, and into any other client that reads the same package+format.++This chapter is the Harness Plugins sub-protocol. It is optional: a server advertises it with the+`plugins` capability, and a server that does not implement it is conformant at every class.++## 1. What a plugin is++UHP does not define a package format. A UHP plugin **is** an+[Agent Plugins](https://agent-plugins.org/specification) package, version 1.0.0: a folder with a+`plugin.json` manifest at its root, MCP servers declared in `mcp.json`, and skills under `skills/`,+each skill an [Agent Skills](https://agentskills.io/specification) folder with a `SKILL.md`.++Agent Plugins wraps Agent Skills without redefining them: it says where a skill lives inside the+package and defers the skill's own format to the Agent Skills specification. This chapter does the+same one layer up. It says how a package travels over UHP, how it is bound to a harness, and what a+hosted server owes it. Everything about the package's contents defers to Agent Plugins.++```+Agent Skills SKILL.md and its folder what one skill is+Agent Plugins plugin.json + mcp.json + skills/ how skills and tools are packaged+UHP Plugins this chapter how a package is installed into a hosted harness+```++A plugin carries three things, and the harness object already had a place for two of them:++| Part | Where in the package | What it becomes in the harness |+|---|---|---|+| Meta | `plugin.json` | The plugin's identity: `name`, `version`, `author`, `license`, … |+| Tools | `mcp.json` | MCP servers of the harness ([Harnesses §4.1](harnesses.md#41-mcp-servers)) |+| Skills | `skills/<name>/SKILL.md` | Skills of the harness ([Harnesses §4.2](harnesses.md#42-skills)) |++> **Why adopt a format rather than define one?**+> A package format is worth exactly the number of places it installs. Agent Plugins is maintained+> by a steering committee drawn from the major agent clients, so a plugin written for one of them+> installs into a UHP harness unchanged, and a plugin exported from a UHP harness ([§5](#5-exporting-a-harness-as-a-plugin))+> installs into them. A UHP-specific format would need converting at every boundary, and the+> conversion is where contents get lost.++## 2. The plugin object++```json+{+ "name": "contract-review",+ "enabled": true,+ "manifest": {+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",+ "name": "contract-review",+ "version": "1.2.0",+ "description": "Clause extraction and a risk checklist for commercial agreements.",+ "author": { "name": "Example Legal Tools" },+ "license": "MIT"+ },+ "mcpServers": [+ { "name": "clauses", "transport": "http", "url": "https://mcp.example.com/clauses", "enabled": true },+ { "name": "redline", "transport": "stdio", "command": "./bin/redline",+ "args": ["--data", "${PLUGIN_DATA}"], "enabled": true }+ ],+ "skills": [+ { "name": "risk-checklist", "description": "Turn an agreement into a JSON risk checklist." }+ ],+ "skipped": [],+ "files": [+ { "path": "plugin.json", "content": "{ … }" },+ { "path": "mcp.json", "content": "{ … }" },+ { "path": "skills/risk-checklist/SKILL.md", "content": "---\nname: risk-checklist\n…" },+ { "path": "skills/risk-checklist/references/clauses.md", "content": "…" },+ { "path": "bin/redline", "content_b64": "f0VMRgIB…" }+ ]+}+```++| Field | Type | Written by | Meaning |+|---|---|---|---|+| `name` | string | either | The manifest's `name`; unique among the harness's plugins |+| `enabled` | boolean | client | Absent or `true` means installed and active |+| `files` | array | client | The package, as files relative to the plugin root |+| `blob` | string | server | Handle for a package the server stores out of line |+| `manifest` | object | server | `plugin.json`, parsed |+| `mcpServers` | array | server | The servers `mcp.json` declares, as plugin MCP server objects (`PluginMcpServer`) |+| `skills` | array | server | The skills found under `skills/`: `name` and `description` each |+| `skipped` | array | server | Components the server found and could not load, each with the reason |++The server-written fields are derived from the package on every write. A client MAY send them back+unchanged, which is what a client does when it `PUT`s what it read, and the server MUST recompute+them rather than store what was sent. A client MUST NOT rely on changing them: editing `mcpServers`+on a plugin changes nothing, because the package is the source and `mcp.json` is where the servers+are.++### 2.1 Files++The rules are the ones skills already follow ([Harnesses §4.2](harnesses.md#42-skills)):++- `files[].path` is relative to the plugin root and MUST support nested directories. A server MUST+ reject a path that escapes the root, or that names anything other than a regular file, with+ `plugin_invalid`.+- Text travels in `content`; binary in `content_b64`. A server MUST preserve both byte-for-byte.+- The package MUST contain `plugin.json` at its root. A server MUST reject one that does not, at+ configuration time rather than at run time.+- A server MUST materialise the **whole package** where the agent can read it. A plugin's skills+ carry references and scripts, and its stdio servers carry the executables they launch.+- A server MAY store the package out of line and return `blob` in place of `files`. It MUST then+ return the complete file list from+ `GET /v1/harnesses/{harness_id}/plugins/{plugin_name}/files` ([§3.1](#31-reading-the-files)).+- A server SHOULD cap package size, and MUST refuse an oversized one with `file_too_large`+ (`detail.max_bytes` states the limit) rather than truncating it.++### 2.2 What the server derives++On every write the server reads the package as an Agent Plugins client would, and records what it+found on the object.++**`manifest`.** The server MUST validate `plugin.json` against the rules of Agent Plugins §5 for the+version its `$schema` names. A `$schema` the server does not support is refused with+`unsupported_plugin_schema`; `detail.supported` lists the identifiers it does support. An unknown+top-level field, or a non-object `extensions`, is not fatal: the field is ignored and recorded in+`skipped`. Any other violation is fatal, and the write is refused with `plugin_invalid`.++**`mcpServers`.** From `mcp.json`, read as Agent Plugins §7.2 says. Each valid server entry becomes+one plugin MCP server object, mapped as follows. An invalid entry is recorded in `skipped` and the+rest still load. If `mcp.json` itself is invalid, or its `$schema` names a different Agent Plugins+version than `plugin.json`, every server in it is skipped with that reason.++| `mcp.json` `type` | UHP `transport` | Fields carried |+|---|---|---|+| `streamable-http` | `http` | `url`, `headers` |+| `sse` | `sse` | `url`, `headers` |+| `stdio` | `stdio` | `command`, `args`, `env`, `cwd` |++`${PLUGIN_ROOT}` and `${PLUGIN_DATA}` are reported exactly as written. A server MUST NOT expand them+in what it returns to a client: the expansion is a filesystem path inside the server's sandbox, which+is not the client's business and changes from turn to turn. `enabled` on each derived server is+always `true`; the plugin's own `enabled` is what turns them off, together.++A plugin MCP server object is the harness MCP server object of+[Harnesses §4.1](harnesses.md#41-mcp-servers) plus the `stdio` transport, with `command`, `args`,+`env` and `cwd` in place of `url`, `headers` and `auth`. `command` is one executable token, never a+shell string: a bare name, or a plugin-relative path beginning with `./`.++> **Why is `stdio` declared only inside a plugin?**+> A process needs somewhere to run from and somewhere to keep state, and a plugin is the object+> that provides both: `PLUGIN_ROOT` and `PLUGIN_DATA` are defined by the package, not by the+> harness. A stdio server on the harness's own list would need a second set of rules for a root+> it does not have, and it could not be exported, because its executable would not travel with+> it. So the harness's own list stays what it was in the previous version, remote servers only,+> and a process is two files away: a `plugin.json` and an `mcp.json` make a complete plugin. That+> keeps every object the previous version defined byte-for-byte unchanged, which is what lets a+> server serve both versions from one code path ([§4.1](#41-the-direct-fields-are-unchanged)).++**`skills`.** Each immediate child directory of `skills/` that contains a regular file named+`SKILL.md` is one skill, per Agent Plugins §7.1. A server MUST NOT search deeper. Each skill MUST+conform to Agent Skills, including the rule that its frontmatter `name` equals its directory name; a+skill that does not is recorded in `skipped` and the rest still load. The derived entry carries the+frontmatter `name` and `description`.++**`skipped`.** Each entry is `{ "path": …, "reason": … }`, where `path` locates the component in+the package (`skills/broken`, `mcp.json#/mcpServers/redline`, `plugin.json#/vendorField`) and+`reason` is one sentence. A server MUST return `skipped` on every plugin object, empty when nothing+was skipped, so a client can tell "nothing skipped" from "server does not report skips".++> **Why is a broken component recorded rather than refused?**+> Two rules meet here. [Harnesses §4.2](harnesses.md#42-skills) refuses a skill without a+> `SKILL.md` at configuration time, because a bundle that is stored and then silently ignored at+> run time is the hardest failure a user can be handed. Agent Plugins §11.3 requires the opposite+> inside a package: a failure isolated to one component MUST NOT stop the rest from loading,+> because a package is written by someone other than the person installing it, and one stale entry+> should not take the whole plugin down with it. Both are right about their own case. The+> reconciliation is the one [Tasks §1.1](tasks.md#11-request-fields) already makes for reserved+> fields: ignoring is allowed, silent ignoring is not. The package installs, and what did not load+> is written on the object, where the person configuring the harness can see it. The manifest is+> the exception. Without a valid manifest there is no plugin to isolate failures within, so a fatal+> manifest error refuses the write.++## 3. Installing a plugin++Plugins are part of the harness object and are set the way its other configuration is set+([Harnesses §5](harnesses.md#5-managing-harnesses)): conformance class **Full**, and the `plugins`+capability MUST be `true`.++```http+POST /v1/harnesses+```++```json+{+ "name": "Contract Review Agent",+ "base": "claude-code",+ "plugins": [+ { "files": [+ { "path": "plugin.json", "content": "{\"$schema\":\"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json\",\"name\":\"contract-review\"}" },+ { "path": "skills/risk-checklist/SKILL.md", "content": "---\nname: risk-checklist\ndescription: …\n---\n…" }+ ] }+ ]+}+```++- `name` on the write is OPTIONAL. If present it MUST equal the manifest's `name`; otherwise the+ write is refused with `plugin_invalid`. The manifest is the source of the name, so that a plugin+ renamed on install is still the plugin its author published.+- Two plugins with the same `name` in one harness MUST be refused with `plugin_conflict`.+- A refused write MUST leave the harness unchanged. A plugin is installed whole or not at all.+- `PUT /v1/harnesses/{harness_id}` replaces `plugins` as it replaces every other mutable field.+ Round-tripping a harness through `GET` and `PUT` MUST NOT lose package contents; a client that+ sends back `{ "name": "contract-review", "blob": "…" }` keeps the package it read.+- `enabled: false` keeps the plugin installed and inert. Nothing in it is materialised, and none of+ its MCP servers is contacted ([Harnesses §4.1](harnesses.md#41-mcp-servers)).++### 3.1 Reading the files++```http+GET /v1/harnesses/{harness_id}/plugins/{plugin_name}/files+```++```json+{ "files": [ { "path": "plugin.json", "content": "…" }, { "path": "bin/redline", "content_b64": "…" } ] }+```++The complete package, byte-for-byte, whether or not the server stores it out of line. `404` with+`plugin_not_found` when the harness has no plugin of that name.++## 4. Composition: what the agent gets++A harness's **effective configuration** is what its agent runs with. A server computes it from the+harness object for every turn:++- the effective MCP servers are the harness's enabled `mcpServers`, plus the `mcpServers` of every+ enabled plugin;+- the effective skills are the harness's enabled `skills`, plus the `skills` of every enabled plugin;+- `disabledTools` applies to all of them alike.++### 4.1 The direct fields are unchanged++`mcpServers` and `skills` on the harness keep exactly the meaning they had in the previous version.+They report what a client wrote there and nothing else. A plugin's components are reported on the+plugin and are never copied into the direct fields.++A harness with no plugins is what it was before this version, with `plugins` an empty array. Every+harness that exists today is a valid harness under this version, and every client written against+the previous version keeps working, by the client rules in [Versioning](../../VERSIONING.md): it+ignores `plugins` and sees a harness with fewer tools than the agent actually has, which is already+what it sees for tools the base provides on its own.++The converse holds too. Nothing this version defines changes the shape of an object the previous+version defined, so a server that implements plugins serves both versions from one code path: it+lists both in `versions`, answers a `2026-08-11` request with the same objects, and the `plugins`+field is simply one more field that version's clients ignore. A server that has not implemented+plugins keeps serving `2026-08-11`, reports the `plugins` capability `false`, and is conformant+at every class under this version's suite; the plugin checks skip, and a skip is never a pass.++> **Why not report the effective set in `mcpServers`?**+> Because of the round trip. A client that reads a harness and `PUT`s it back after an unrelated+> edit is the case [Harnesses §4.2](harnesses.md#42-skills) is designed around. If `mcpServers`+> carried plugin-derived servers, that `PUT` would write them into the direct list, and the harness+> would then carry every plugin server twice: once from the plugin and once as its own. Uninstalling+> the plugin would leave its servers behind. So the direct fields report what was written to them,+> and a client that wants the effective set takes the union, which this section makes a one-line+> computation with no server-specific rules in it.++### 4.2 One namespace, checked at configuration time++Within a harness, MCP server names MUST be unique across the direct list and every enabled plugin,+and skill names likewise. A write that would create a collision MUST be refused with `409` and+`plugin_conflict`; `detail.component` is `mcp_server` or `skill`, `detail.name` is the colliding+name, and `detail.between` names the two owners, each either `harness` or a plugin name.++> **Why refuse rather than prefix?**+> The agent sees one flat namespace: one MCP configuration, one skills directory. Whether a server+> could prefix a plugin's components with the plugin's name depends on the harness base, and for+> skills it cannot: Agent Skills requires a skill's `name` to equal its directory name, so renaming+> the directory breaks the skill. A rule the protocol cannot keep on every base is not a rule. So+> the ambiguity is refused at configuration time, where a person is present to resolve it, rather+> than resolved silently at run time, where nobody is. Disabling either side clears the conflict.++### 4.3 The direct fields are a plugin without a name++The direct `mcpServers` and `skills` of a harness are exactly the contents of a plugin: tools and+skills, with the harness standing in for the manifest. This is not an analogy. [§5](#5-exporting-a-harness-as-a-plugin)+makes it an operation.++## 5. Exporting a harness as a plugin++```http+GET /v1/harnesses/{harness_id}/plugin+```++Returns a plugin object whose `files` are an Agent Plugins package built from the harness's direct+configuration. The result installs into another harness by passing it to `plugins` unchanged, or+into any other Agent Plugins client by writing its files to disk.++| In the package | Built from |+|---|---|+| `plugin.json` | `$schema` for Agent Plugins 1.0.0 and `name` derived from the harness `name` |+| `mcp.json` | The enabled direct `mcpServers`; `http` becomes `streamable-http`, `sse` stays `sse` |+| `skills/<name>/…` | Each enabled direct skill, the whole folder |++- The derived `name` is the harness `name` lower-cased, with every run of characters outside+ `a-z`, `0-9` and `.` replaced by one `-`, leading and trailing `-` removed, and `..` collapsed to+ `.`. If nothing remains, the harness `id` is used the same way. The result satisfies Agent Plugins+ §5.5 by construction.+- `auth` and `headers` MUST be omitted from every server in `mcp.json`. They are credentials the+ operator entered for this harness, and a package travels. Each omission is recorded in+ `skipped`, with the server's path in `mcp.json`, so the person exporting knows what to re-enter.+- Installed plugins are not included. A plugin does not contain plugins; a client that wants one of+ them reads its files ([§3.1](#31-reading-the-files)).+- `systemPrompt`, `defaultModel`, `disabledTools` and `base` are not included. They describe the+ harness, not its tools and skills, and Agent Plugins has no portable place for them.+- A harness with nothing to export still returns a valid package: a manifest and nothing else.++## 6. Running with plugins++What a hosted server owes an installed, enabled plugin at run time:++- **Skills** are materialised as [Harnesses §4.2](harnesses.md#42-skills) requires: the whole folder,+ where the agent reads skills.+- **Remote MCP servers** (`http`, `sse`) are connected as [Harnesses §4.1](harnesses.md#41-mcp-servers)+ requires. Placeholder expansion MUST NOT be performed in `url` or `headers`.+- **stdio MCP servers** run inside the same sandbox as the agent, with the same privileges, and never+ anywhere else. A server MUST set `PLUGIN_ROOT` and `PLUGIN_DATA` in the subprocess environment,+ MUST expand `${PLUGIN_ROOT}` and `${PLUGIN_DATA}` in `args`, `env` and `cwd`, MUST NOT expand+ anything else, and MUST resolve `command` as Agent Plugins §7.2.1 says: a bare executable name, or+ a plugin-relative path beginning with `./`, with no expansion in `command` itself. The default+ working directory is the plugin root. The containment rules of Agent Plugins §4.1 apply: a+ `command` or `cwd` that resolves outside the plugin root (or, for `cwd`, outside `PLUGIN_DATA`)+ is an invalid entry.+- **`PLUGIN_DATA`** MUST exist and be writable before the first subprocess launches, and MUST persist+ for the life of the session ([Sessions](sessions.md)), which is the unit of workspace persistence+ in UHP. A server MAY keep it longer. Agent Plugins asks for persistence across plugin updates; on+ a hosted server the session is the boundary a client can reason about, so it is the one promised.+- **A server that cannot run a transport for a base** MUST refuse the write with+ `unsupported_transport`, naming the transport and the base in `detail`, rather than accept the+ plugin and skip the server at run time. The rule of Harnesses §4.1 holds: a server MUST NOT+ advertise MCP support it cannot deliver.+- **An MCP server that fails** MUST NOT fail the task, exactly as for a directly attached one. A+ stdio server that exits is the same event as a remote one that refuses the connection.+- **A disabled plugin** is not materialised and nothing in it is contacted or launched.++## 7. Discovery++A server that implements this chapter reports it in the discovery document+([Lifecycle §2](lifecycle.md#2-capability-discovery)):++```json+{+ "capabilities": { "harness_management": true, "plugins": true },+ "plugin_schemas": ["https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"]+}+```++`plugin_schemas` lists the Agent Plugins manifest schema identifiers the server accepts, and MUST be+present and non-empty when `plugins` is `true`. A client MUST check both before offering to install+a package, and MUST NOT offer a package whose `$schema` the server does not list.++A server that reports `plugins: true` MUST accept `plugins` on harness create and update, MUST serve+the files endpoint ([§3.1](#31-reading-the-files)), and MUST serve the export+([§5](#5-exporting-a-harness-as-a-plugin)). There is no partial form of the capability.++## 8. Relationship to Agent Plugins conformance++A UHP server with `plugins: true` is an Agent Plugins *client* in that specification's terms+(§11): it loads a package from a directory, validates the closed manifest, discovers both component+types from their fixed locations, and, when it launches subprocesses, provides the two environment+variables and expands them. This chapter adds to that, and never subtracts:++- what Agent Plugins §11.3 says a client SHOULD report, this chapter says a server MUST report, on+ the object, as `skipped`;+- placeholders are returned to clients unexpanded;+- `PLUGIN_DATA` persistence is promised for the life of a session;+- component names are unique within a harness, and a collision is refused at configuration time.++Agent Plugins itself is versioned by its schema identifiers (§10.1). A later Agent Plugins version+appears in UHP as a new entry in `plugin_schemas`, which is an additive change to a server and needs+no new UHP version.diff --git a/protocol/versions/2026-09-12/schema.md b/protocol/versions/2026-09-12/schema.mdnew file mode 100644index 00000000..d6876392--- /dev/null+++ b/protocol/versions/2026-09-12/schema.md@@ -0,0 +1,71 @@+# Schema++**Unified Harness Protocol, version `2026-09-12`**++The machine-readable definitions are normative for structure. Where this prose and the schema+disagree about the shape of an object, the schema wins; where they disagree about behaviour, the+prose wins, because behaviour is not expressible in JSON Schema.++## Files++| File | Format | Use |+|---|---|---|+| [`uhp-2026-09-12.openapi.yaml`](../../schema/uhp-2026-09-12.openapi.yaml) | OpenAPI 3.1 | Generate clients and servers; browse the API |+| [`uhp-2026-09-12.schema.json`](../../schema/uhp-2026-09-12.schema.json) | JSON Schema 2020-12 | Validate objects and streamed events |++Both are versioned by filename. A published version is immutable: fixing a schema means publishing a+new version, never editing one clients may already have generated from.++## Generating a client++```bash+# TypeScript+npx openapi-typescript protocol/schema/uhp-2026-09-12.openapi.yaml -o uhp.d.ts++# Python+openapi-python-client generate --path protocol/schema/uhp-2026-09-12.openapi.yaml++# Go+oapi-codegen -package uhp protocol/schema/uhp-2026-09-12.openapi.yaml > uhp.gen.go+```++## Validating events++Every streamed event validates against the `Event` definition, which is a discriminated union on+`type`:++```python+import json, jsonschema++schema = json.load(open("protocol/schema/uhp-2026-09-12.schema.json"))+validator = jsonschema.Draft202012Validator(+ {"$ref": "#/$defs/Event", **schema})++for line in stream:+ if line.startswith("data: "):+ validator.validate(json.loads(line[6:]))+```++The conformance suite does exactly this against a live server, so a schema change that the reference+implementation does not satisfy fails CI rather than shipping.++## The plugin manifest++`PluginManifest` mirrors the Agent Plugins 1.0.0 manifest schema field for field, and is looser in+one way: it permits additional properties, because a UHP client MUST ignore fields it does not know+([Versioning](../../VERSIONING.md)) and a later Agent Plugins version will add some. The+authoritative schema for a manifest is the one its own `$schema` names; a UHP server validates+against that, and the definition here describes only the shape a client may rely on+([Plugins §2.2](plugins.md#22-what-the-server-derives)).++## Extension points++A server MAY add fields anywhere the schema allows additional properties:++- `metadata` on a request or response — the intended place for client and server context.+- `detail` on an error — structured context for a specific failure.+- Additional output item types, and additional event types.++A server MUST NOT redefine the meaning of a specified field, and MUST NOT add a required field: a+client written against this version has to keep working. Vendor-specific fields SHOULD carry a+vendor prefix so that a later version of this specification cannot collide with them.diff --git a/protocol/versions/2026-09-12/security.md b/protocol/versions/2026-09-12/security.mdnew file mode 100644index 00000000..b11970b0--- /dev/null+++ b/protocol/versions/2026-09-12/security.md@@ -0,0 +1,143 @@+# Security considerations++**Unified Harness Protocol, version `2026-09-12`**++A UHP server runs an agent that executes tools, writes files, and holds a provider credential, on+behalf of a caller it has never met. That is a larger blast radius than a model endpoint, and the+requirements here are collected in one place so an implementer can check them off rather than+rediscover them.++Requirements stated in other chapters are repeated here rather than only cross-referenced. A+security rule a reader has to assemble from six chapters is a rule that gets missed.++## 1. Credentials++- A server MUST authenticate every endpoint except `GET /v1/uhp`+ ([Lifecycle §2](lifecycle.md)).+- A server MUST NOT distinguish "no such token" from "token not permitted here" in a way that lets a+ caller enumerate valid tokens.+- A server MUST NOT echo a credential — the caller's or a provider's — in any response body, error+ message, event, log line, or artifact.+- A server SHOULD support revoking a credential, and revocation MUST take effect for new requests+ immediately.++### 1.1 Provider credentials++The credential a server uses to reach a model provider is the most valuable secret in the system,+and the agent's own sandbox is the least trustworthy place in it: an agent can be induced to read+its environment and print it.++- A server SHOULD NOT place a provider credential where the agent's tools can read it.+- A server that must give a harness a credential SHOULD issue a short-lived, single-session one, and+ MUST be able to revoke it independently of the underlying key.+- A server MUST NOT accept a caller-supplied upstream URL for a brokered request without validating+ it against a configured allow-list. An unvalidated upstream turns the server into an SSRF proxy+ with its own credential attached.++## 2. Object scope++- Every object — harness, response, session, container, file — MUST be scoped to the principal that+ created it.+- A request for an object outside the caller's scope MUST return `404`, never `403`. `403` confirms+ the id exists, which is exactly what an enumerating attacker wants+ ([Architecture §5](architecture.md)).+- Scope MUST be enforced on every operation, not only on read. Cancel, delete, continue and download+ are all object access.++> The conformance suite cannot fully verify this with one credential. An implementer SHOULD run the+> equivalent check with two principals: create an object as A, then attempt every operation on it as+> B, and confirm each returns `404`.++## 3. Artifacts are attacker-influenced content++An agent can be persuaded to write a file with chosen content and a chosen name. Everything that+serves artifacts MUST treat them as hostile.++- Artifact downloads MUST be served with `X-Content-Type-Options: nosniff`. Without it, an artifact+ named `x.html` becomes stored XSS against the client's own origin+ ([Files §3](files.md)).+- Artifacts SHOULD be served from a different origin than the console or application UI, so that a+ successful injection cannot reach first-party cookies or storage.+- A server MUST NOT allow a `container_id` / `file_id` pair to address anything outside its+ container. Path traversal through artifact ids is the most likely serious vulnerability in a UHP+ implementation; the conformance suite probes for it (X-08), and passing that probe is a floor, not+ proof.+- A server SHOULD cap artifact size and count per session.++## 4. Prompt injection is in scope for the client++A harness that reads a web page, a repository, or an uploaded file may encounter instructions+addressed to it. UHP cannot prevent this, and a specification that pretended otherwise would be+worse than one that says so plainly.++What the protocol does provide, and a client SHOULD use:++- **`disabledTools`** on a configured harness — the smallest tool set that can do the job is the+ smallest injection surface.+- **`max_step` and `timeout_seconds`** — a bounded task cannot be induced into an unbounded one.+- **Separate harnesses for separate trust levels.** A harness that reads untrusted input SHOULD NOT+ be the same configured harness that holds privileged tools or MCP servers.+- **The event stream.** Tool calls are visible as they happen; a client can surface or gate them.++A server MUST NOT claim that any of this makes an agent safe to point at untrusted input.++## 5. Resource exhaustion++- A server MUST bound task duration, and MUST report `incomplete` rather than `completed` when a+ budget stopped the work ([Lifecycle §3](lifecycle.md)).+- A server MUST refuse a second concurrent task in the same session (`session_busy`) — two agents in+ one working directory is not a defined state, and is also a cheap way to multiply cost.+- A server SHOULD rate-limit task creation per principal and SHOULD expose remaining budget through+ `rate_limit_error` responses rather than by failing opaquely.+- A server MUST bound upload size and reject with `file_too_large` rather than truncating. A silently+ truncated input produces a confident, wrong answer.++## 6. Data handling++- Session artifacts and transcripts MUST be unreachable after the session is deleted.+- A server SHOULD document its retention period. "Indefinite" is an answer; silence is not.+- Session sharing, where implemented, MUST be read-only and revocable, and MUST NOT expose+ credentials or another principal's data ([Sessions §5](sessions.md)).++## 7. Transport++- TLS MUST be used except on loopback.+- A server SHOULD send `Strict-Transport-Security`.+- A server serving any HTML MUST send `X-Frame-Options: DENY` or an equivalent+ `frame-ancestors 'none'` policy.++## 8. Error hygiene++- `error.message` MUST be safe to show a user: no credentials, internal hostnames, file paths, or+ stack traces ([Errors §1](errors.md)).+- A server SHOULD log the detail it withholds, with a correlation id it returns in `error.detail`,+ so an operator can diagnose what a caller cannot see.++## 9. Plugins are third-party code++A plugin ([Plugins](plugins.md)) is instructions and executables written by someone other than the+operator installing it. Installing one extends the harness's trust to its author.++- A stdio MCP server declared by a plugin MUST run inside the sandbox that runs the agent, with the+ agent's privileges and no more. It MUST NOT run on the server host, and MUST NOT be launched+ through a shell.+- A server MUST expand only `${PLUGIN_ROOT}` and `${PLUGIN_DATA}`, only in `args`, `env` and `cwd`,+ and MUST NOT perform any other placeholder or environment-variable expansion. A plugin that could+ read the sandbox's environment into its own process arguments would read whatever credentials the+ sandbox holds ([§1](#1-credentials)).+- A `command` or `cwd` that resolves outside the plugin root is an invalid entry, never a permitted+ one ([Plugins §6](plugins.md#6-running-with-plugins)).+- Plugins are installed by whoever manages the harness (class Full), never per request. A+ per-request plugin would be a per-request MCP server, which [Tasks §1.4](tasks.md#14-reserved-fields-tools-and-include)+ already declines for the same reason: narrowing is safe, widening is escalation.+- A skill inside a plugin is prompt content and is subject to [§4](#4-prompt-injection-is-in-scope-for-the-client).+ A client SHOULD show the manifest's `author`, `homepage` and `repository` before installing, and+ SHOULD show `skipped` after, so that what did not load is not mistaken for what did.+- A server MUST omit `auth` and `headers` from an exported package+ ([Plugins §5](plugins.md#5-exporting-a-harness-as-a-plugin)). An export is meant to leave.++## 10. Reporting a vulnerability++Vulnerabilities in the reference implementation or in this specification follow private disclosure,+not a public issue. See the repository's security policy. A specification bug that makes a secure+implementation impossible is treated as a vulnerability, not as a documentation defect.diff --git a/protocol/versions/2026-09-12/sessions.md b/protocol/versions/2026-09-12/sessions.mdnew file mode 100644index 00000000..3262ef31--- /dev/null+++ b/protocol/versions/2026-09-12/sessions.md@@ -0,0 +1,174 @@+# Sessions++**Unified Harness Protocol, version `2026-09-12`**++A session is what makes a second task cheaper than the first: the conversation is still there, and+so is the working directory. This chapter defines continuing a session, inspecting one, and stopping+work in one.++## 1. Continuing a session++Send the next task with `previous_response_id`:++```json+{+ "input": "Now add tests for the function you just wrote.",+ "previous_response_id": "resp_a1b2c3"+}+```++The server MUST:++- run the new task in the same session, with the same working directory and its files;+- give the harness the conversational context of the earlier tasks;+- use the same configured harness;+- report the same `metadata.session_id`.++`model` MAY differ between tasks in a session. A server MUST honour a per-task model change, because+switching to a cheaper model for a follow-up is a common and legitimate pattern.++If `previous_response_id` names an unknown response, the server MUST fail with `404` and+`code: "response_not_found"`. If the session it referred to has expired, `404` with+`code: "session_expired"` — a client can retry the first from scratch, and should not retry the+second.++> **Why chain on the response id rather than the session id?**+> Because the response id is what the client already has: it comes back from the task it just ran.+> Chaining on it also names an exact point in the conversation, which leaves room for a server to+> branch from an earlier response later without changing the request shape.++## 2. Listing sessions++Conformance class **Extended**.++```http+GET /v1/sessions?limit=20&cursor=&harness=chrn_…+```++```json+{+ "sessions": [+ {+ "id": "hsess7e78…",+ "object": "session",+ "harness_id": "chrn_…",+ "title": "Summarise README.md",+ "status": "completed",+ "created_at": 1786400000,+ "updated_at": 1786400240+ }+ ],+ "next_cursor": null+}+```++Pagination is cursor-based. A server MUST return `next_cursor: null` on the last page, and MUST NOT+require a client to detect the end by receiving fewer items than it asked for — that heuristic is+wrong whenever a page is exactly full.++## 3. Inspecting a session++```http+GET /v1/sessions/{session_id}+GET /v1/sessions/{session_id}/turns+```++`/turns` returns the ordered task history of the session, so a client can rebuild a transcript it did+not store. Each turn identifies its response id, so a client can fetch the full response for any of+them.++Each item in `turns` MUST carry at least:++| Field | Type | Meaning |+|---|---|---|+| `id` | string | The response id of the turn, usable with `GET /v1/responses/{id}`. |+| `status` | string | The turn's status, in the response-status vocabulary of [Tasks §1](tasks.md). |++and SHOULD carry, when the server has them: `user` (string, the user message), `assistant` (string,+the assistant's final text), `tools` (array, the tool calls of the turn), and `files` (array, the+files the turn produced). A server MAY add fields; a client MUST ignore fields it does not+understand. This was previously an object with no stated shape, which meant no conformance check+could assert anything past the status code, and every client that rebuilt a transcript did so+against one implementation's habits.++## 4. Cancelling++Two scopes, deliberately distinct:++```http+POST /v1/responses/{response_id}/cancel # stop this task+POST /v1/sessions/{session_id}/cancel # stop whatever is running in this session+```++Semantics:++- Cancellation is a request, not a guarantee of immediacy. A server MUST stop the work as soon as it+ can and MUST reach a terminal state.+- A cancelled task MUST end with `status: "cancelled"`, never `failed`.+- Output produced before cancellation MUST be retained.+- Cancelling an already-terminal task MUST succeed and change nothing. A client retrying a cancel+ after a dropped connection should not receive an error for having succeeded twice.+- Cancelling MUST NOT delete the session. The conversation remains continuable.++A server SHOULD respond to cancel within one second even if the harness takes longer to wind down.+The client is usually a user interface, and a Stop button that does nothing visible for thirty+seconds reads as broken.++## 5. Session sharing++Conformance class **Full**. A server MAY let a client publish a read-only view of a session.++```http+POST /v1/sessions/{session_id}/share # publish (a body is OPTIONAL; no body means publish)+GET /v1/sessions/{session_id}/share # read the share back+DELETE /v1/sessions/{session_id}/share # revoke+```++If implemented, the share object returned by `POST` and `GET` MUST carry:++| Field | Type | Meaning |+|---|---|---|+| `id` | string | The share's identity. |+| `url` | string | Where the shared view is served. May be relative, in which case it resolves against the base URL the caller is already using — a server behind a proxy cannot know its public origin, and a base-relative path survives every fronting. |++`object` SHOULD be `"session.share"`. A server MAY carry additional fields (the reference also+returns an `enabled` toggle and accepts `{"enabled": bool}` bodies); a client MUST ignore fields it+does not understand. A second `POST` MAY return the existing share or mint a new one, but+revocation MUST reach every link minted for the session — revoking only the newest tells an+operator the session is private while somebody still holds a working link.++The rules, unchanged:++- the shared view MUST be read-only — it MUST NOT permit continuing, cancelling, or uploading;+- `GET` on the published `url` MUST serve the view to a holder of the link with no other+ credential — a view only its creator can open has not been published to anyone;+- after `DELETE`, and after the session itself is deleted (§6), the published `url` MUST stop+ resolving (404 or 410);+- the share's id MUST NOT function as a credential for the rest of the API;+- the server MUST NOT expose provider credentials, tokens, or another principal's data through the+ view.++These were previously behaviors the conformance suite had to discover by probing (the endpoints and+the object had no stated shape, so a portable check could only guess at paths and skip when the+guesses missed). They are codified from the shapes the reference implementation demonstrates and+the R-series measures; the suite now asserts them.++## 6. Deleting++```http+DELETE /v1/sessions/{session_id}+```++Deletes the session and its stored history: the transcript, the trace, and the working folder the+session's tasks wrote. Afterwards the session MUST NOT count toward any storage or memory allowance+the server enforces, because deletion is how a client makes room. A server MUST answer `2xx`, and a+later `GET /v1/sessions/{session_id}` MUST return `404`.++`DELETE /v1/traces/{session_id}` is the older path for the same operation. It predates the session+vocabulary; a server MAY keep serving it (the reference implementation does, as the same handler),+but the path above is the one the protocol names and the one clients SHOULD use.++A server MUST cancel any in-flight task in the session first, and MUST make the session+unreadable afterwards. Deletion is the one place where cancel and+delete are legitimately coupled, because the alternative is a running task writing into storage that+no longer has an owner.diff --git a/protocol/versions/2026-09-12/streaming.md b/protocol/versions/2026-09-12/streaming.mdnew file mode 100644index 00000000..09e4fb12--- /dev/null+++ b/protocol/versions/2026-09-12/streaming.md@@ -0,0 +1,161 @@+# Streaming++**Unified Harness Protocol, version `2026-09-12`**++Agent tasks take minutes. Without a stream, a product can only show a spinner and hope. This chapter+defines how a server reports progress while work is happening.++## 1. Opening a stream++Set `"stream": true` on `POST /v1/responses`. The server MUST respond with:++```http+HTTP/1.1 200 OK+Content-Type: text/event-stream+Cache-Control: no-cache+```++Each event is a Server-Sent Events message whose `data` is one JSON object:++```+data: {"type":"response.created","sequence_number":0,"response":{…}}++data: {"type":"response.output_text.delta","sequence_number":7,"item_id":"msg_1","output_index":0,"content_index":0,"delta":"Sum"}++data: {"type":"response.completed","sequence_number":42,"response":{…}}++```++Rules:++- Every event MUST carry `type` and `sequence_number`.+- `sequence_number` MUST start at `0` and increase by exactly 1 per event within a stream. A client+ can therefore detect a dropped event rather than silently rendering a gap.+- The stream MUST end with exactly one terminal event (§4).+- A server MUST NOT buffer the stream to completion before sending it. A stream delivered all at once+ at the end is not a stream, and a client cannot tell the difference between that and a hang.+- Servers behind a proxy MUST disable response buffering. This is the single most common deployment+ error for UHP servers; it looks exactly like the harness being slow.++## 2. Event vocabulary++Events describe *what happened*. They never describe how to display it.++### 2.1 Response lifecycle++| Event | When |+|---|---|+| `response.created` | The task was accepted. Carries the initial `response` with `status: in_progress`. |+| `response.in_progress` | Work has started. |+| `response.completed` | Terminal — success. Carries the final `response`. |+| `response.incomplete` | Terminal — a budget stopped the work. Carries the final `response`. |+| `response.failed` | Terminal — failure. Carries the final `response`, whose `error` is non-null. |++### 2.2 Output items++| Event | When |+|---|---|+| `response.output_item.added` | A new item begins. Carries `output_index` and a shell `item`. |+| `response.output_item.done` | That item is final. Carries the complete `item`. |++### 2.3 Assistant text++| Event | Payload |+|---|---|+| `response.content_part.added` | An empty `output_text` part opens |+| `response.output_text.delta` | `delta`: the next fragment of text |+| `response.output_text.done` | `text`: the complete text of the part |+| `response.content_part.done` | `part`: the finished part |+| `response.output_text.annotation.added` | `annotation`: an artifact citation (see [Files](files.md)) |++Text deltas are fragments, not lines or tokens. A client MUST concatenate them in `sequence_number`+order and MUST NOT assume any particular chunking.++### 2.4 Reasoning++| Event | Payload |+|---|---|+| `response.reasoning_summary_part.added` | An empty summary part opens |+| `response.reasoning_summary_text.delta` | `delta`: the next fragment of the summary |+| `response.reasoning_summary_part.done` | `part`: the finished summary part |++Reasoning is a *summary*, not a verbatim chain of thought. A server MUST NOT be required to expose+raw model reasoning, and a client MUST treat reasoning as optional — many harness and model+combinations produce none, and a client that requires it will break on those.++### 2.5 Tool use++| Event | Payload |+|---|---|+| `response.function_call_arguments.delta` | `delta`: fragment of the JSON arguments |+| `response.function_call_arguments.done` | `arguments`: the complete JSON string |++The tool call itself arrives as an `output_item` of type `function_call`, and its result as+`function_call_output` matched by `call_id`.++### 2.6 Errors++| Event | Payload |+|---|---|+| `error` | `code`, `message`, `param` — an error that did not end the task |++An `error` event MUST be followed by a terminal event. A stream that emits `error` and then stops+without a terminal event is malformed: the client cannot tell whether the task died or the+connection did.++## 3. Ordering guarantees++A server MUST guarantee:++1. `response.created` is the first event.+2. Exactly one terminal event is the last.+3. For any item, `output_item.added` precedes every event referring to it, and `output_item.done`+ follows them all.+4. `sequence_number` is strictly monotonic with no gaps.++A server MUST NOT guarantee, and a client MUST NOT assume:++- that items complete in the order they were added (a long tool call may finish after later text);+- that text arrives in any particular chunk size;+- that any optional event type appears at all.++## 4. Terminal events++Exactly one of `response.completed`, `response.incomplete`, `response.failed`. Each carries the+complete final `response` object — a client that missed intermediate events can rely on this one+alone to render the result. This redundancy is deliberate: a dropped connection mid-stream should+cost latency, not correctness.++A cancelled task terminates with `response.failed` carrying `status: "cancelled"` in the response+object. The status field, not the event name, is authoritative.++## 5. Reconnecting++A dropped connection MUST NOT abort the task. The work continues server-side.++To follow a task after a disconnect, a client re-reads it:++```http+GET /v1/responses/{response_id}+```++or, for a live event feed of a harness's sessions:++```http+GET /v1/harnesses/{harness_id}/events+```++A server MAY additionally support SSE `Last-Event-ID` resumption. If it does, it MUST resume from+the event *after* the given `sequence_number` and MUST NOT replay events the client already saw.++> A client SHOULD treat the stream as an optimisation and the stored response as the source of+> truth. Products written the other way round — where the stream is the only place a result exists —+> lose work every time a load balancer recycles a connection.++## 6. Non-streaming++With `"stream": false` (the default), the server returns a single response object when the task+reaches a terminal state, with the same `output` array the stream would have assembled. The two+paths MUST produce identical results for identical input. A server that assembles a different+`output` for streaming than for non-streaming has two implementations of its own protocol, and one+of them is wrong.diff --git a/protocol/versions/2026-09-12/tasks.md b/protocol/versions/2026-09-12/tasks.mdnew file mode 100644index 00000000..a3322e36--- /dev/null+++ b/protocol/versions/2026-09-12/tasks.md@@ -0,0 +1,287 @@+# Tasks++**Unified Harness Protocol, version `2026-09-12`**++A task is one unit of work: input in, a result out. It is the endpoint most clients spend all their+time in.++## 1. Run a task++```http+POST /v1/responses+Authorization: Bearer <token>+Content-Type: application/json+```++```json+{+ "input": "Summarise README.md in three bullets.",+ "model": "claude-sonnet-4.6",+ "metadata": { "harness_id": "chrn_08dae611630d467ab3e67ed792570ae5" },+ "stream": true+}+```++### 1.1 Request fields++| Field | Type | Required | Meaning |+|---|---|---|---|+| `input` | string \| item[] | yes | The work. A bare string is shorthand for one user message. See §2. |+| `model` | string | no | Canonical model id. Omitted means the harness's default. |+| `metadata` | object | no | Client metadata. `harness_id` selects the configured harness. See §1.2. |+| `stream` | boolean | no | `true` streams Server-Sent Events; default `false` returns one JSON object. |+| `previous_response_id` | string | no | Continue the session that produced that response. See [Sessions](sessions.md). |+| `instructions` | string | no | Additional system guidance for this task only. |+| `store` | boolean | no | Whether the server retains the response for later reads. Default `true`. |+| `max_output_tokens` | integer | no | Upper bound on generated tokens. |+| `max_step` | integer | no | Upper bound on agent steps (tool-call rounds) for this task. |+| `timeout_seconds` | integer | no | Wall-clock budget for this task. |+| `tools` | array | no | **Reserved and ignored.** Accepted, never acted on. See §1.4. |+| `include` | string[] | no | **Reserved and ignored.** Accepted, never acted on. See §1.4. |+| `background` | boolean | no | Return as soon as the task is accepted; follow it with the events endpoint. |++A server MUST ignore request fields it does not understand rather than rejecting the request. A+client MUST NOT rely on an unknown field having an effect.++Ignoring MUST be observable. When a server does not act on a field the request carried, it MUST+name that field in `metadata.ignored_fields` on the response — an array of request-field names, in+any order. This is the same principle as model substitution in §1.3: where the server did not do+what the request literally said, the response says so. A silently ignored field is+indistinguishable from an honoured one, and a client cannot tell which it got.++`tools` and `include` are reserved and ignored (§1.4), so a server MUST name them in+`metadata.ignored_fields` whenever a request carries them. A server MUST NOT reject a request for+carrying either.++`max_step` and `timeout_seconds` are budgets, not guarantees of precision: a server MUST stop the+task at or after the budget, MUST report `incomplete`, and MUST NOT report `completed` for work it+truncated.++### 1.2 Selecting the harness++The configured harness is selected by `metadata.harness_id`:++```json+{ "metadata": { "harness_id": "chrn_…" } }+```++- If `harness_id` is absent, the server MUST use a default harness and MUST report which one it used+ in the response `metadata`.+- If `harness_id` names an unknown harness, or one outside the caller's scope, the server MUST fail+ with `404` and `code: "harness_not_found"`.+- If both `previous_response_id` and `harness_id` are present and disagree, the server MUST fail with+ `409` and `code: "harness_mismatch"` (see [Lifecycle §4](lifecycle.md)).++> **Why is the harness in `metadata` rather than a top-level field?**+> Because the task surface is deliberately Responses-compatible (see the+> [README](../../README.md)), and `metadata` is the extension point that surface already defines for+> caller-supplied context. A top-level `harness` field would be a second, conflicting convention for+> the same idea, and every existing Responses SDK would have to be patched to send it.++### 1.3 Model selection and substitution++`model` names a canonical model id, not a provider-specific one. Canonical ids are stable across+providers, so the same request works whether the server reaches a model directly or through an+aggregator.++If the requested model cannot be served for the selected harness, a server MUST NOT fail silently+and MUST NOT pretend it ran what was asked. It MUST do exactly one of:++1. **Fail** with `422` and `code: "model_unavailable"`; or+2. **Substitute** the harness's authorized default, and record the substitution in the response:++```json+{+ "model": "gpt-5.4",+ "metadata": {+ "requested_model": "gpt-5.6-sol",+ "model_fallback": true,+ "model_fallback_reason": "model 'gpt-5.6-sol' is not available for this harness's backend"+ }+}+```++A client can therefore always answer "did the model I asked for actually run?" by comparing `model`+with `metadata.requested_model`.++> This rule exists because its absence is expensive. A server that substitutes silently makes every+> measurement downstream wrong — benchmarks, cost attribution, quality comparisons — and the client+> has no way to detect it. Reporting the substitution costs two fields.++### 1.4 Reserved fields: `tools` and `include`++Both fields arrived with the OpenAI Responses wire shape this version stays compatible with. Neither+was designed for UHP, and neither has ever had defined semantics here. They are **reserved**: a+server accepts them, never acts on them, and reports them under `metadata.ignored_fields` (§1.1).++This is a decision rather than a gap left open, so implementers can stop carrying them as unfinished+work and client authors can stop building on them.++**`tools` cannot mean what it means in the Responses API.** There, the field exists because the+*client* executes tools: the model emits a `function_call`, the client runs it, and returns a+`function_call_output` as input on the next request. UHP puts both of those in `output` (§3.1). The+harness invokes and executes tools itself and reports them as observability. There is no input path+for a tool result, so the loop `tools` implies cannot be completed by a conformant server — not+because implementations are immature, but because the object model has no place for the return leg.++**`tools` also cannot mean "MCP servers for this task", which is the other plausible reading.**+[Harnesses](harnesses.md) §4.1 already specifies MCP servers on the harness, with a+field table and the semantics that matter: a disabled entry MUST NOT be contacted, an unreachable+server MUST NOT fail the task. A request-level form would be a second mechanism for one behaviour.++More importantly, it would be an **escalation primitive**. If a request can attach an MCP server,+anyone holding an API key can point the agent at an endpoint of their choosing, and the agent+executes tools server-side with the harness's credentials and workspace access. The harness owner+and the API caller are routinely different parties — a product configures a harness, and its end+users drive tasks against it. Request-level declaration silently moves a capability decision from+the accountable party to any caller. The configured harness is a first-class object precisely so+that decision is made once, deliberately, by whoever owns the consequences.++The durable rule underneath, which applies beyond this field: **narrowing is safe, widening is+escalation.** A future version could reasonably add a typed per-request tool *disable* list. It+should never add a per-request *grant*.++**`include` has no vocabulary.** It is `array of string` with no enumerated values, so any string a+server recognises is one that server named itself. Recognising a value would be inventing a+vocabulary no other implementation shares.++**How an agent gets tools:** configure them on the harness. See+[Harnesses](harnesses.md) §4.1 for MCP servers and §4.2 for skills.++Removal is a question for the next version. This one is additive-only and cannot drop a field, so+the honest form here is to say plainly that these two do nothing.++## 2. Input++`input` is either a string or an array of items.++```json+{ "input": "Summarise README.md" }+```++```json+{+ "input": [+ { "role": "user", "content": [+ { "type": "input_text", "text": "Summarise this report." },+ { "type": "input_file", "filename": "q3.pdf", "file_data": "data:application/pdf;base64,…" }+ ]}+ ]+}+```++| Item type | Purpose |+|---|---|+| `input_text` | Text |+| `input_file` | A file, inline as a data URL in `file_data`, or by `file_id` from a prior upload |+| `input_image` | An image, inline or by `file_id` |++A server at conformance class **Core** MUST accept `input_text`. A server at **Extended** MUST also+accept `input_file` and `input_image`. See [Files](files.md).++## 3. The response object++```json+{+ "id": "resp_a1b2c3",+ "object": "response",+ "created_at": 1786400000,+ "status": "completed",+ "error": null,+ "incomplete_details": null,+ "previous_response_id": null,+ "model": "claude-sonnet-4.6",+ "output": [+ { "id": "rs_1", "type": "reasoning", "summary": [ { "type": "summary_text", "text": "…" } ], "status": "completed" },+ { "id": "fc_1", "type": "function_call", "call_id": "call_1", "name": "read_file",+ "arguments": "{\"path\":\"README.md\"}", "status": "completed" },+ { "id": "fco_1", "type": "function_call_output", "call_id": "call_1", "output": "…", "status": "completed" },+ { "id": "msg_1", "type": "message", "role": "assistant", "status": "completed",+ "content": [ { "type": "output_text", "text": "- …\n- …\n- …", "annotations": [] } ] }+ ],+ "store": true,+ "usage": { "input_tokens": 5120, "output_tokens": 240, "total_tokens": 5360 },+ "metadata": { "session_id": "hsess7e78…" }+}+```++| Field | Type | Required | Notes |+|---|---|---|---|+| `id` | string | yes | `resp_`-prefixed |+| `object` | string | yes | Always `response` |+| `created_at` | integer | yes | Unix seconds |+| `status` | string | yes | See [Lifecycle §3](lifecycle.md) |+| `error` | object \| null | yes | Present and non-null only when `status` is `failed` |+| `output` | item[] | yes | Ordered; MAY be empty for a task that produced nothing |+| `model` | string | yes | The model that actually ran |+| `usage` | object \| null | yes | `null` when the server cannot account for usage — never a fabricated zero |+| `metadata` | object | yes | MUST include `session_id`; see §1.3 for substitution fields |+| `previous_response_id` | string \| null | yes | The response this one continues, if any |+| `store` | boolean | yes | Whether this response was retained |++### 3.1 Output items++| `type` | Meaning |+|---|---|+| `message` | Assistant text, in `content[].text`, with `annotations` for artifacts |+| `reasoning` | The agent's summarised thinking, in `summary[].text` |+| `function_call` | A tool the agent invoked, with `arguments` as a JSON string |+| `function_call_output` | The result of that tool call, matched by `call_id` |++A client MUST tolerate output item types it does not recognise, and MUST NOT assume any ordering+beyond the array order given. A client that renders only `message` items and ignores the rest is a+valid client.++## 4. Reading a task back++```http+GET /v1/responses/{response_id}+```++Returns the same response object. A server that retained the response (`store: true`) MUST return it+after completion; a server MAY return `404` with `code: "response_not_found"` for a response created+with `store: false`.++```http+GET /v1/responses/{response_id}/input_items+```++Returns the input the task was created with, for clients that need to reconstruct a transcript+without having stored it themselves.++## 5. Cancelling++```http+POST /v1/responses/{response_id}/cancel+```++See [Sessions §4](sessions.md).++## 6. Idempotency++A client MAY send an idempotency key:++```http+Idempotency-Key: <client-generated-unique-string>+```++A server that advertises `idempotency` MUST, for a repeated key:++- return the result of the **first** request, and+- **not** start a second execution.++If the first request is still running, the server MUST wait for it and return its result rather than+returning a partial or a conflict. Agent tasks are expensive and side-effecting: a retry that runs+the work twice is worse than a slow answer.++Idempotency keys SHOULD be retained for at least 24 hours.++## 7. Deleting++```http+DELETE /v1/responses/{response_id}+```++Deletes the stored response. A server MUST NOT let this cancel a running task — cancellation and+deletion are different intentions, and conflating them means a client cannot clean up history+without stopping work.