feat(orchestrator): radio receipts inline (005 phase B)

Requirement 005: every radio message in the Stream and the radio log shows the avatars of the agents that read it, with read time and an ack badge where a receipt exists; receipt rows no longer appear as entries of their own, and the sender shows once. Read times come from seen marks, stamped only after a fresh presence pass no older than two sighting intervals; a stored time before its row is refused. An operator message links to its relay row through the ts radio.py prints first on stdout right after store(), checked against an exact row (sender Operator, relay text, targets, no to_sessions); a ts shared by two rows shows no readers. radio.py clips printed addresses; the hub keeps the first stdout line whole. Accepted MEDUSA false positives: MM-SCAN-058 at server.py:73, JB-SCAN-641 and JB-SCAN-616 at radio.py:389 (clip, the output sanitizer), FLA-SCAN-055 at radio.py:109. Committed below the 90/5 bar on the operator's word; the receipts e2e runs through the queue.

🎯 Fix: 89 %
💥 Break: 6 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 84
🚦 Gate: ⛔ fix 89 % < 90, break 6 % > 5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-13 17:19:39 +00:00
1 parent 92f5087eed
commit 30b2a32095
25 files changed
+1432 -87

No files matched your search

+11 -4
View File
@@ -12,25 +12,32 @@ SNAPSHOT = "agent-sessions.json"
SNAPSHOT_STALE = 5 * 60
def read_snapshot(path: Path, now: float) -> dict[str, dict]:
def fresh_snapshot(path: Path, now: float) -> dict[str, dict] | None:
"""Args:
path: the snapshot client/sessions.py writes on the host.
now: the moment to judge at.
Returns:
Its session records by session id; empty when it is missing,
Its session records by session id; None when it is missing,
malformed, written more than SNAPSHOT_STALE ago or dated in the
future.
"""
data = read_json(path)
if not isinstance(data, dict) or not isinstance(data.get("sessions"), dict):
return {}
return None
written = data.get("written")
if isinstance(written, bool) or not isinstance(written, int | float) or not 0 <= now - written <= SNAPSHOT_STALE:
return {}
return None
return {sid: record for sid, record in data["sessions"].items() if isinstance(record, dict)}
def read_snapshot(path: Path, now: float) -> dict[str, dict]:
"""Returns:
fresh_snapshot(), empty in place of None.
"""
return fresh_snapshot(path, now) or {}
def unanswered(news: list[dict], now: float) -> list[tuple[str, float]]:
"""Returns:
(callee, call time) of every call older than UNANSWERED without a