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-10-04: one vocabulary for who acts on a memory (#390)
github-actions[bot]20c030705627
diff --git a/protocol/CHANGELOG.md b/protocol/CHANGELOG.mdindex 55c69df7..23cf9283 100644--- a/protocol/CHANGELOG.md+++ b/protocol/CHANGELOG.md@@ -38,6 +38,16 @@ from a default of one memory). A server MAY cap the memories one question coverscapability `recall.max_depth` is gone: the subtree is the server's to compose. Schema:`MemoryRecall.results[].memory` is required. Suite `2026.10.4.post3`: ME-03 rewritten.+**Fourth patch of 2026-10-04, same version.** One vocabulary for who acts on a memory. A grant's+principal was "an opaque typed identifier" whose kinds each server chose, and a record's+`written_by` named its kinds only by example (`harness`, `consolidator`); two implementations had+already stamped a person as `member` and as `user`. Now four kinds serve both places: `member`,+`harness`, `group` (holds grants, never writes) and `provider` (writes, never holds a grant); a+server's own kind is `x.`-prefixed. `consolidator` is gone: a consolidation's records are written+by the `provider`, with `consolidation_id` beside it, and a record derived from an observation+carries `on_behalf_of`. A credential is not a kind. Schema: `MemoryWriter`, and a pattern on a+grant's `principal`. Suite `2026.10.4.post4`: ME-02 checks the writer's kind.+- **Memories** ([Memories](versions/2026-10-04/memories.md)), the Harness Memories sub-protocol,optional at every class behind the `memories` capability. A memory is a named node in a tree:it holds records and may have child memories. A grant gives a principal privileges (`read`,diff --git a/protocol/conformance/pyproject.toml b/protocol/conformance/pyproject.tomlindex 77257e9b..43654868 100644--- a/protocol/conformance/pyproject.toml+++ b/protocol/conformance/pyproject.toml@@ -1,6 +1,6 @@[project]name = "uhp-conformance"-version = "2026.10.4.post3"+version = "2026.10.4.post4"description = "Conformance suite for the Unified Harness Protocol (UHP)"readme = "README.md"requires-python = ">=3.10"diff --git a/protocol/conformance/uhp_conformance/checks.py b/protocol/conformance/uhp_conformance/checks.pyindex 69cc2f66..55f3de72 100644--- a/protocol/conformance/uhp_conformance/checks.py+++ b/protocol/conformance/uhp_conformance/checks.py@@ -2057,6 +2057,10 @@ def me02(ctx):assert (rec.get("attributes") or {}).get("account") == "quillon", f"attributes did not round-trip: {rec.get('attributes')!r}"got = ctx.client.get(f"/v1/memories/{rec['memory_id']}/records/{rec['id']}").json or {}assert got.get("id") == rec["id"] and got.get("content") == rec["content"], "the record does not read back by its id"+ w = rec.get("written_by") or {}+ assert w.get("kind") in ("member", "harness") or str(w.get("kind") or "").startswith("x."), (+ f"a stated record's writer is a member, a harness or an x.-prefixed kind of the server's own; got {w.get('kind')!r}")+ assert w.get("id"), "written_by carries the id of who wrote the record"return f"{rec['id']} written by {rec.get('written_by')}"diff --git a/protocol/conformance/uhp_conformance/uhp-2026-10-04.schema.json b/protocol/conformance/uhp_conformance/uhp-2026-10-04.schema.jsonindex 6493c6fb..32cf7b92 100644--- a/protocol/conformance/uhp_conformance/uhp-2026-10-04.schema.json+++ b/protocol/conformance/uhp_conformance/uhp-2026-10-04.schema.json@@ -2182,7 +2182,8 @@},"principal": {"type": "string",- "description": "A typed identifier, `<kind>:<id>`; the kinds a server accepts are its own."+ "pattern": "^(member|harness|group|x\\.[a-z0-9_.-]+):.+",+ "description": "Who holds the grant, `<kind>:<id>`: `member`, `harness`, `group`, or a kind of the server's own, `x.`-prefixed."},"privileges": {"type": "array",@@ -2329,9 +2330,7 @@}},"written_by": {- "type": "object",- "additionalProperties": true,- "description": "Stamped by the server from the authenticated caller."+ "$ref": "#/$defs/MemoryWriter"},"references": {"type": "array",@@ -2574,6 +2573,32 @@}}},+ "MemoryWriter": {+ "type": "object",+ "description": "Who wrote a record, stamped by the server from the authenticated caller. `kind` and `id` joined by a colon are the principal a grant would name.",+ "required": [+ "kind",+ "id"+ ],+ "properties": {+ "kind": {+ "type": "string",+ "pattern": "^(member|harness|provider|x\\.[a-z0-9_.-]+)$"+ },+ "id": {+ "type": "string"+ },+ "on_behalf_of": {+ "type": "string",+ "description": "When the provider wrote it: the principal whose observation it was derived from."+ },+ "consolidation_id": {+ "type": "string",+ "description": "When the provider wrote it: the consolidation run that concluded it."+ }+ },+ "additionalProperties": true+ },"MemoryFilter": {"type": "object","description": "One of `{field, op, value}`, `{and: [...]}` or `{or: [...]}`.",@@ -2935,8 +2960,7 @@"additionalProperties": true},"written_by": {- "type": "object",- "additionalProperties": true+ "$ref": "#/$defs/MemoryWriter"},"error": {"type": "string"diff --git a/protocol/schema/uhp-2026-10-04.openapi.yaml b/protocol/schema/uhp-2026-10-04.openapi.yamlindex 27ca62d1..151672f9 100644--- a/protocol/schema/uhp-2026-10-04.openapi.yaml+++ b/protocol/schema/uhp-2026-10-04.openapi.yaml@@ -2694,7 +2694,7 @@ components:id: { type: string }object: { type: string, const: memory.grant }memory_id: { type: string }- principal: { type: string, description: 'A typed identifier, `<kind>:<id>`; the kinds a server accepts are its own.' }+ principal: { type: string, pattern: '^(member|harness|group|x\.[a-z0-9_.-]+):.+', description: 'Who holds the grant, `<kind>:<id>`: `member`, `harness`, `group`, or a kind of the server''s own, `x.`-prefixed.' }privileges: { type: array, items: { $ref: '#/components/schemas/MemoryPrivilege' } }inherited: { type: boolean, description: True when the grant sits on an ancestor. }MemoryGrantCreate:@@ -2735,7 +2735,7 @@ components:valid_to: { type: [string, 'null'] }written_at: { type: [string, 'null'] }invalidated_at: { type: [string, 'null'] }- written_by: { type: object, additionalProperties: true, description: Stamped by the server from the authenticated caller. }+ written_by: { $ref: '#/components/schemas/MemoryWriter' }references: { type: array, items: { $ref: '#/components/schemas/MemoryReference' } }trust: { type: string, const: untrusted }additionalProperties: true@@ -2804,6 +2804,16 @@ components:status: { type: string, enum: [pending, completed, failed] }error: { type: string }data: { type: array, items: { $ref: '#/components/schemas/MemoryRecord' } }+ MemoryWriter:+ type: object+ description: 'Who wrote a record, stamped by the server from the authenticated caller. `kind` and `id` joined by a colon are the principal a grant would name.'+ required: [kind, id]+ properties:+ kind: { type: string, pattern: '^(member|harness|provider|x\.[a-z0-9_.-]+)$' }+ id: { type: string }+ on_behalf_of: { type: string, description: 'When the provider wrote it: the principal whose observation it was derived from.' }+ consolidation_id: { type: string, description: 'When the provider wrote it: the consolidation run that concluded it.' }+ additionalProperties: trueMemoryFilter:type: objectdescription: 'One of `{field, op, value}`, `{and: [...]}` or `{or: [...]}`.'@@ -2922,7 +2932,7 @@ components:changes: { type: object, additionalProperties: true }usage: { type: object, additionalProperties: true }budget: { type: object, additionalProperties: true }- written_by: { type: object, additionalProperties: true }+ written_by: { $ref: '#/components/schemas/MemoryWriter' }error: { type: string }additionalProperties: trueMemoryConsolidationStart:diff --git a/protocol/schema/uhp-2026-10-04.schema.json b/protocol/schema/uhp-2026-10-04.schema.jsonindex 6493c6fb..32cf7b92 100644--- a/protocol/schema/uhp-2026-10-04.schema.json+++ b/protocol/schema/uhp-2026-10-04.schema.json@@ -2182,7 +2182,8 @@},"principal": {"type": "string",- "description": "A typed identifier, `<kind>:<id>`; the kinds a server accepts are its own."+ "pattern": "^(member|harness|group|x\\.[a-z0-9_.-]+):.+",+ "description": "Who holds the grant, `<kind>:<id>`: `member`, `harness`, `group`, or a kind of the server's own, `x.`-prefixed."},"privileges": {"type": "array",@@ -2329,9 +2330,7 @@}},"written_by": {- "type": "object",- "additionalProperties": true,- "description": "Stamped by the server from the authenticated caller."+ "$ref": "#/$defs/MemoryWriter"},"references": {"type": "array",@@ -2574,6 +2573,32 @@}}},+ "MemoryWriter": {+ "type": "object",+ "description": "Who wrote a record, stamped by the server from the authenticated caller. `kind` and `id` joined by a colon are the principal a grant would name.",+ "required": [+ "kind",+ "id"+ ],+ "properties": {+ "kind": {+ "type": "string",+ "pattern": "^(member|harness|provider|x\\.[a-z0-9_.-]+)$"+ },+ "id": {+ "type": "string"+ },+ "on_behalf_of": {+ "type": "string",+ "description": "When the provider wrote it: the principal whose observation it was derived from."+ },+ "consolidation_id": {+ "type": "string",+ "description": "When the provider wrote it: the consolidation run that concluded it."+ }+ },+ "additionalProperties": true+ },"MemoryFilter": {"type": "object","description": "One of `{field, op, value}`, `{and: [...]}` or `{or: [...]}`.",@@ -2935,8 +2960,7 @@"additionalProperties": true},"written_by": {- "type": "object",- "additionalProperties": true+ "$ref": "#/$defs/MemoryWriter"},"error": {"type": "string"diff --git a/protocol/versions/2026-10-04/memories.md b/protocol/versions/2026-10-04/memories.mdindex 48ec65bc..3ca3c91b 100644--- a/protocol/versions/2026-10-04/memories.md+++ b/protocol/versions/2026-10-04/memories.md@@ -98,6 +98,29 @@ caller has no effective privilege, and MUST NOT reveal that one exists.## 3. Access+### Who acts on a memory++One vocabulary names everyone who can act on a memory. It is used in two places: a grant names who+may act, and a record's `written_by` names who did.++| Kind | Who | Holds grants | Writes records |+|---|---|---|---|+| `member` | A person | yes | yes |+| `harness` | An agent, running under that harness | yes | yes |+| `group` | A set of members the server resolves: a team, a workspace | yes | no, its members do |+| `provider` | The memory's provider itself: what it derived from an observation, what a consolidation run concluded | no | yes |++A kind of a server's own is `x.`-prefixed (`x.team`). A server MUST NOT use another unprefixed+kind, and refuses a grant that names one.++The two places write the same identity two ways. In a grant, a **principal** is the string+`<kind>:<id>`. On a record, the writer is `{ "kind": …, "id": … }`. They name the same thing:+`written_by.kind` and `written_by.id`, joined by a colon, are the principal a grant would name.+The `id` is the server's own and opaque to a client.++A credential is not a kind. A request made with an API key acts as the member or the harness the+key belongs to, and is granted and stamped as that.+### 3.1 Grants and inheritanceA **grant** gives one principal a set of privileges on one memory. A principal's effective@@ -115,13 +138,9 @@ privileges on it, an implicit grant that flows down like any other.| Request | What it does ||---|---|| `GET /v1/memories/{id}/grants` | Who holds what on this memory, and on which node each grant sits |-| `POST /v1/memories/{id}/grants` | Grant a principal privileges: `{ principal, privileges }` |+| `POST /v1/memories/{id}/grants` | Grant a principal privileges: `{ principal, privileges }`, the principal as `<kind>:<id>` || `DELETE /v1/memories/{id}/grants/{grant_id}` | Revoke one grant |-A **principal** is an opaque typed identifier the server resolves: a harness, a credential, a-person, a group. The protocol does not define principals beyond that; a server documents the kinds-it accepts.-### 3.2 The cutoffA memory with `restricted: true` stops inheritance: grants on its ancestors do not reach it or its@@ -171,7 +190,7 @@ A record is one thing a memory holds. Its `id` is the provider's and opaque to a| `attributes` | Structured fields. Free-form for core types; the type's schema for extension types ([§8](#8-types)) || `version`, `status`, `supersedes` | A change appends a version and closes the one before it ([§5.3](#53-nothing-is-overwritten)). `status` is `active`, `superseded` or `forgotten` || `time` | When it was true in the world (`valid_*`) and when the memory held it (`written_at`, `invalidated_at`). A provider without validity leaves `valid_*` null |-| `written_by` | Stamped by the server from the authenticated caller. A client cannot supply it |+| `written_by` | Who wrote it, `{ kind, id }` in the vocabulary of [§3](#who-acts-on-a-memory), stamped by the server from the authenticated caller; a client cannot supply it. When the provider wrote it, two more fields say why: `on_behalf_of`, the principal whose observation it was derived from, and `consolidation_id`, the run that concluded it ([§9.2](#92-consolidation-runs)) || `references` | Other records this one points at ([§4.2](#42-references)) || `trust` | Always `untrusted` on a read: what a memory returns is data, never instructions ([§13](#13-security)) |@@ -562,15 +581,16 @@ trusted. A provider that consolidates through the protocol exposes each pass as"changes": { "created": 31, "superseded": 6, "forgotten": 2 },"usage": { "input_tokens": 182000, "output_tokens": 9100 },"budget": { "limit": 250000, "unit": "tokens", "exhausted": false },- "written_by": { "kind": "consolidator", "id": "native" },+ "written_by": { "kind": "provider", "id": "native" },"error": ""}```- `status` is `queued`, `running`, `completed`, `stopped` (the budget ran out; what was done staysdone and the next run resumes after `read.through`) or `failed`.-- Every record a run writes carries the run's `written_by`, so a reader can tell what a person or- an agent stated from what consolidation concluded.+- Every record a run writes carries the run's `written_by` and the run's id beside it+ (`"consolidation_id": "hcon_5d2e…"`), so a reader can tell what a person or an agent stated from+ what consolidation concluded, and which run to revert.- `revert` appends: each record the run superseded or forgot becomes current again as a newversion, and each record it created is forgotten. History keeps both the run and its reversal.- A provider declares `consolidate` as `runs` (this section), `trigger` (it can be started and