cadence_observer_readback: name the failed read kind and HTTP status (no body).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 236506@bnt-lap001
Assistant-Session: 09087018-91e1-48c5-ab2f-acfbb62c92e4
This commit is contained in:
codex 2026-11-03 21:31:32 +01:00
parent 2fb7f951eb
commit 645b529a3c

View file

@ -81,7 +81,10 @@ def read_http(origin, token, path, allowed):
with response:
raw = response.read(1048577)
require(len(raw) <= 1048576, "readback_too_large")
require(response.status == 200, "independent_readback_failed")
# Name the read kind and HTTP status only; never the body or the token.
kind = ("reconciliation" if path.startswith("/v1/reconciliation")
else "stream_findings" if path == "/v1/stream-findings" else "event")
require(response.status == 200, f"independent_readback_failed:{kind}:{response.status}")
return json.loads(raw)