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

+17 -4
View File
@@ -7,9 +7,9 @@ from .council import (
MAYDAY_ACTIVE,
NEWS,
grants,
message_rows,
night_mode,
night_parts,
radio_rows,
read_claims,
sessions,
silence_of,
@@ -24,6 +24,7 @@ from .messaging import message_row
from .orbits import TRACK_STEPS, track
from .phrasing import joined, phrase_parts
from .presence import presence, read_snapshot
from .receipts import inline, read_of
from .records import epoch, iso_epoch, read_jsonl
from .register import (
AGENT_ORDER,
@@ -76,6 +77,16 @@ class View:
self.tree.beat()
return self.state(begin, end, now, TRACK_STEPS if sampled else 0)
def inlined(self, news: list[dict], window: tuple[float, float], now: float) -> dict[float, dict]:
"""Returns:
inline() of the rows; empty when it fails, so the state builds
without readers.
"""
try:
return inline(self.scripts.skills, self.council, self.receipt_names, self.receipt_reads, self.agent_sessions, news, window, now)
except Exception: # noqa: BLE001
return {}
def first(self, news: list[dict], history: list[dict], claims: list[dict], now: float) -> float:
moments = [epoch(row.get("ts")) for row in news] + [epoch(row.get("start")) for row in history]
moments += [iso_epoch(claim["since"]) for claim in claims] + [self.transcripts.first()]
@@ -90,13 +101,15 @@ class View:
names = sessions(claims)
directory = self.directory(claims, news, now)
radio = []
for row in radio_rows(news, begin, end):
inlined = self.inlined(news, (begin, end), now)
for row in message_rows(news, begin, end):
source = directory.key(row["from"], row["ts"])
targets = [directory.key(name, row["ts"]) for name in row["to"]]
called = [directory.at(key, row["ts"]) or name for key, name in zip(targets, row["to"], strict=True)]
word, rest = phrase_parts(row["class"], directory.at(source, row["ts"]) or row["from"], called, row["text"])
spoken = {"speech": joined((word, rest)), "word": word, "rest": rest, "voice": self.speech.voice_of(source)}
radio.append({**row, "source": source, "targets": targets, "now": directory.now(source), **spoken})
read = read_of(inlined, row["ts"])
radio.append({**row, "source": source, "targets": targets, "now": directory.now(source), **spoken, **read})
grant_rows = [{**grant, "target": directory.key(grant["to"], grant["ts"])} for grant in grants(history, (begin, end), claims, tasks)]
self.watch.see(tasks, now)
jobs = [{**{key: value for key, value in job.items() if key != "proof"}, "output": job["output"][-OUTPUT_LIMIT:]} for job in self.jobs.listed()[-JOBS_SHOWN:]]
@@ -132,7 +145,7 @@ class View:
"reviews": [row for row in map(review_row, self.reviews.pending()) if row["created_ts"] <= end],
"asks": [ask_row(ask, names) for ask in self.asks.pending() if ask["expires"] > now and ask["created_ts"] <= end],
"decisions": [decision_row(decision) for decision in self.decisions.pending() if decision["created_ts"] <= end],
"messages": [message_row(message) for message in self.messages.listed() if begin <= message["created_ts"] <= end],
"messages": [{**message_row(message), **read_of(inlined, epoch(message.get("relay_ts")))} for message in self.messages.listed() if begin <= message["created_ts"] <= end],
"operator": operator_rows(tasks),
"register": register_rows(tasks),
"tasks": rows,