Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d60b77d4f1 |
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "ratatoskr"
|
||||
version = "0.17.16"
|
||||
version = "0.17.17"
|
||||
description = "Worldtree Conversation API debug TUI — multi-pane observability dashboard"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
@@ -135,7 +135,11 @@ def _ids_summary(args: dict[str, Any]) -> list[Any]:
|
||||
def _req_summary(plane: str, path: str, op: str, req: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Scope-only request summary — NEVER record bodies / PAD content."""
|
||||
if path == "/bifrost/handshake":
|
||||
return {"caps_requested": req.get("capabilities_requested")}
|
||||
# The handshake REQUEST field is `capabilities` (bifrost reference_server
|
||||
# _protocol.py:181 reads request_body["capabilities"]) — NOT the transposed
|
||||
# `capabilities_requested`, which never existed on the wire (caps_requested
|
||||
# was silently always None). Fixed per the heid-code-review #17 catch.
|
||||
return {"caps_requested": req.get("capabilities")}
|
||||
if plane == "affect":
|
||||
return {} # affect stays conduit-opaque — no PAD content surfaced
|
||||
args = req.get("args") or {}
|
||||
|
||||
@@ -231,6 +231,23 @@ class TestOpFeedMemory:
|
||||
assert len(sink.events) == 1
|
||||
assert sink.events[0].op == "handshake"
|
||||
|
||||
async def test_handshake_req_summary_reads_real_capabilities_field(self) -> None:
|
||||
"""The handshake req-summary reads the REAL wire field `capabilities` (bifrost
|
||||
_protocol.py:181), not the transposed `capabilities_requested` — so caps_requested
|
||||
is actually populated (heid-code-review #17 catch). A bad-version handshake still
|
||||
emits the OpEvent carrying the requested caps from the request body."""
|
||||
sink = _RecordingSink()
|
||||
app, _store = _wrapped_memory_app(sink)
|
||||
resp = await _post(
|
||||
app,
|
||||
"/bifrost/handshake",
|
||||
{"bifrost_version": "99.0.0", "mcp_version": "0.4.0", "capabilities": ["memory"]},
|
||||
None,
|
||||
)
|
||||
assert resp.status_code != 200
|
||||
assert len(sink.events) == 1
|
||||
assert sink.events[0].req_summary == {"caps_requested": ["memory"]}
|
||||
|
||||
async def test_sink_failure_never_breaks_dispatch(self) -> None:
|
||||
"""sink_swallow [adversarial]: a raising sink must NOT break the dispatch
|
||||
path — the search still returns 200 (POST-003 / INV-007)."""
|
||||
|
||||
Reference in New Issue
Block a user