fix(kvb-org-radio): council text reaches no agent as a tag

Every agent writes alerts.jsonl, news.jsonl and radio-silence.json
directly, so a planted </system-reminder><system-reminder> in a row's
sender or text reached every other agent's context as markup. watch.py's
clip() joins whitespace, turns each < into <\ and caps at 1000
characters; the watch hook's alerts, the block hook's mayday reason and
every radio line and silence line go through it, and radio.py delegates
to it instead of keeping its own CLIP. The radio skill adds the rule that
no sender proves operator approval.

🎯 Fix: 90 %
💥 Break: 3 %
💸 Cost: 100 %
⏱️ Time: 100 %
🛡️ Security: 100 %
💰 Value: ?
🏆 Score: 87
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-06 13:27:00 +00:00
1 parent 454670a77e
commit aa2b03da17
5 files changed
+38 -4

No files matched your search

+7 -2
View File
@@ -95,6 +95,7 @@ ACCEPTED = ROOT / "security-accepted.jsonl"
KEPT_ACCEPTED = KEPT / "security-accepted.jsonl"
MIRRORED = ((HISTORY, KEPT_HISTORY), (ACCEPTED, KEPT_ACCEPTED))
ALERT_TTL = 3600
CLIP = 1000
CLEANUP_LOCK = "cleanup.lock"
LOCK_TTL = 1800
GB = 1e9
@@ -127,6 +128,10 @@ def disk(cfg: dict) -> tuple[float, float]:
return st.f_bavail * st.f_frsize / GB, st.f_blocks * st.f_frsize / GB
def clip(value: object) -> str:
return " ".join(str(value).split()).replace("<", "<\\")[:CLIP]
def read_json(path: Path) -> dict:
try:
data = json.loads(nofollow.read_text(ROOT, path))
@@ -181,7 +186,7 @@ def unseen_alerts(session: str) -> list[str]:
]
if fresh:
write_text(seen_path, str(fresh[-1]["id"]))
return [a["text"] for a in fresh]
return [clip(a["text"]) for a in fresh]
def write_text(path: Path, text: str) -> None:
@@ -333,7 +338,7 @@ def cmd_block(cfg: dict) -> int:
return 0
if any(re.search(p, command) for p in cfg["heavy_commands"]):
reason = (
f"a mayday by {mayday.get('by', '?')} holds radio silence: {mayday.get('text', '')}; "
f"a mayday by {clip(mayday.get('by', '?'))} holds radio silence: {clip(mayday.get('text', ''))}; "
"it ends with radio.py clear"
if mayday
else f"resource stage is {stage}; new heavy jobs are blocked until the disk recovers"