Skip to content

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.

conformance: R-07 deletes at the path §6 names, so a published link outliving its session is reported (#566)

Rudy Mizrahi Celekli25f579b579c4
diff --git a/protocol/conformance/tests/share_defect_stub.py b/protocol/conformance/tests/share_defect_stub.py
index 1556883b..c6851d60 100644
--- a/protocol/conformance/tests/share_defect_stub.py
+++ b/protocol/conformance/tests/share_defect_stub.py
@@ -27,6 +27,13 @@ DEFECT = os.environ.get("DEFECT", "none")
DIALECT = os.environ.get("DIALECT", "plain")
assert DIALECT in ("plain", "enabled"), f"unknown dialect {DIALECT!r}"
PORT = int(os.environ.get("PORT", "8931"))
+# Which of §6's two delete paths this server serves. §6 names DELETE /v1/sessions/{id} and says
+# /v1/traces/{id} is "the older path for the same operation" that a server MAY keep, so all three
+# combinations are servers the suite has to measure — and "sessions" alone is the one R-07 skipped
+# on, because it drove the alias and nothing else.
+DELETE_PATHS = tuple(sorted(filter(None, os.environ.get("DELETE_PATHS", "sessions,traces").split(","))))
+assert DELETE_PATHS and set(DELETE_PATHS) <= {"sessions", "traces"}, \
+ f"unknown delete paths {DELETE_PATHS!r}"
KEY = "stub-key"
DEFECTS = {
@@ -149,7 +156,8 @@ class H(BaseHTTPRequestHandler):
"metadata": {"session_id": sid, "harness_id": "h1"}})
if p[:2] == ["v1", "sessions"] and len(p) >= 4 and p[3] == "share":
return self.share_endpoint(method, p[2], p[4:])
- if method == "DELETE" and p[:2] == ["v1", "traces"] and len(p) == 3:
+ if (method == "DELETE" and len(p) == 3 and p[0] == "v1"
+ and p[1] in DELETE_PATHS):
return self.delete_session(p[2])
return self.send(404, {"error": {"code": "not_found", "message": "no such endpoint"}})
@@ -256,5 +264,6 @@ class H(BaseHTTPRequestHandler):
if __name__ == "__main__":
- print(f"stub: defect={DEFECT} dialect={DIALECT} port={PORT}", flush=True)
+ print(f"stub: defect={DEFECT} dialect={DIALECT} delete_paths={DELETE_PATHS} port={PORT}",
+ flush=True)
ThreadingHTTPServer(("127.0.0.1", PORT), H).serve_forever()
diff --git a/protocol/conformance/tests/test_session_sharing_checks.py b/protocol/conformance/tests/test_session_sharing_checks.py
index 69be8a89..eac75166 100644
--- a/protocol/conformance/tests/test_session_sharing_checks.py
+++ b/protocol/conformance/tests/test_session_sharing_checks.py
@@ -49,12 +49,13 @@ def _free_port() -> int:
return s.getsockname()[1]
-def _run_series(defect: str, dialect: str = "plain") -> dict[str, Outcome]:
+def _run_series(defect: str, dialect: str = "plain",
+ delete_paths: str = "sessions,traces") -> dict[str, Outcome]:
"""Every R- check against a stub carrying `defect`, in registration order."""
port = _free_port()
srv = subprocess.Popen([sys.executable, str(STUB)],
env={"DEFECT": defect, "DIALECT": dialect, "PORT": str(port),
- "PATH": "/usr/bin:/bin"},
+ "DELETE_PATHS": delete_paths, "PATH": "/usr/bin:/bin"},
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
try:
deadline = time.time() + 10
@@ -165,3 +166,27 @@ def test_the_toggle_dialect_is_not_a_licence_to_refuse_a_bodyless_post():
out = _run_series("bodyless_rejected")
assert out["R-08"] is Outcome.FAIL, out
assert [i for i, o in out.items() if o is Outcome.FAIL] == ["R-08"], out
+
+
+# ── §6's two delete paths ─────────────────────────────────────────────────────────────
+# §6 names `DELETE /v1/sessions/{id}` and says `DELETE /v1/traces/{id}` is the older path for
+# the same operation, which a server MAY keep. R-07 drove only the alias, so against a server
+# serving only the named path it skipped — and `share_outlives_session` went unreported while
+# every other R- check passed. The stub matched that drift (it too served only the alias), so
+# the diagonal above was green by coincidence rather than by coverage.
+
+
[email protected]("delete_paths", ["sessions", "traces", "sessions,traces"])
+def test_a_published_link_outliving_its_session_is_caught_at_either_delete_path(delete_paths):
+ out = _run_series("share_outlives_session", delete_paths=delete_paths)
+ assert out["R-07"] is Outcome.FAIL, (
+ f"a server serving delete at {delete_paths!r} let share_outlives_session through: {out}")
+ assert [i for i, o in out.items() if o is Outcome.FAIL] == ["R-07"], out
+
+
[email protected]("delete_paths", ["sessions", "traces", "sessions,traces"])
+def test_a_conformant_server_passes_every_check_at_either_delete_path(delete_paths):
+ """The fix must not turn a passing server into a failing one: whichever of §6's paths a
+ conformant server serves, the series stays green rather than reporting the other missing."""
+ out = _run_series("none", delete_paths=delete_paths)
+ assert all(o is Outcome.PASS for o in out.values()), f"{delete_paths!r}: {out}"
diff --git a/protocol/conformance/uhp_conformance/checks.py b/protocol/conformance/uhp_conformance/checks.py
index e0ed485f..12bfe373 100644
--- a/protocol/conformance/uhp_conformance/checks.py
+++ b/protocol/conformance/uhp_conformance/checks.py
@@ -1884,11 +1884,21 @@ def r07(ctx):
if ctx.client.get(path, auth=False).status != 200:
raise Skip("the disposable share's view did not resolve, so its disappearance proves nothing")
- gone = ctx.client.delete(f"/v1/traces/{sid}")
+ # §6 names DELETE /v1/sessions/{id}; /v1/traces/{id} is "the older path for the same
+ # operation", which a server MAY keep. So the named path is tried first and the alias only
+ # as a fallback — driving the alias first is how this check came to skip on every server
+ # that serves only what §6 names, and a skip here reports nothing about the one thing R-07
+ # watches. Whether the named path works at all is F-08's finding, not this one's, so a
+ # server serving only the alias is still measured rather than failed twice.
+ gone = ctx.client.delete(f"/v1/sessions/{sid}")
+ used = "/v1/sessions/{id}"
+ if gone.status in (404, 405, 501):
+ gone = ctx.client.delete(f"/v1/traces/{sid}")
+ used = "/v1/traces/{id}"
if gone.status in (404, 405, 501):
- raise Skip(f"DELETE /v1/traces/{{id}} returned HTTP {gone.status}, so a session cannot be "
- "deleted here and this check has nothing to observe")
- assert 200 <= gone.status < 300, f"deleting the session returned HTTP {gone.status}"
+ raise Skip(f"DELETE {used} returned HTTP {gone.status} and neither path §6 gives for "
+ "deletion removed the session, so this check has nothing to observe")
+ assert 200 <= gone.status < 300, f"deleting the session via {used} returned HTTP {gone.status}"
after = ctx.client.get(path, auth=False)
assert after.status in (404, 410), (
f"the shared link still returns HTTP {after.status} for a session that was deleted. §6 "