feat(orchestrator): readers and acknowledgers per radio row from the seen marks (requirement 005 phase A)

receipts.py builds, for every radio row in a window, the sessions that took it (from their prompt and radio-seen marks) and those that acknowledged a call, with names taken only from the host agent-sessions.json snapshot, so a forged name in a row never reaches the readers; one snapshot build per call keeps a 90k-entry history at 13 ms instead of 8385 ms. radio.py gains seen(), which pending() now uses, so the hooks and the hub decide taken the same way. gating.py and receipts.py share one script loader (skill_scripts.script_module). Not wired into the hub yet: phase B.

Tests: tests/test_hub_receipts.py and tests/test_radio_seen.py; both import unify-side helpers and run green merged into unify/skills-20261112-night with the prepared merge resolution.

🎯 Fix: 92 %
💥 Break: 3 %
💸 Cost: 100 %
⏱️ Time: 100 %
🛡️ Security: 100 %
🏆 Score: 89
🚦 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-13 10:59:36 +00:00
1 parent 3418738993
commit 5fea5f1206
6 files changed
+633 -22

No files matched your search

+2 -20
View File
@@ -1,7 +1,5 @@
from __future__ import annotations
import functools
import importlib.util
import sqlite3
import time
from contextlib import closing
@@ -12,6 +10,7 @@ from .errors import ToolError
from .fields import decode, expect
from .jobs import GATE_JOB
from .signed import signing
from .skill_scripts import script_module
GATES_SCRIPT = "kvb-check-gate/scripts/gates.py"
GATES_DB = "gates.db"
@@ -35,24 +34,7 @@ def gates_module(script: Path) -> ModuleType | None:
loaded again after an install changed it, None when it is missing or
does not load.
"""
try:
changed = script.stat().st_mtime_ns
except OSError:
return None
return loaded(script, changed)
@functools.cache
def loaded(script: Path, changed: int) -> ModuleType | None:
spec = importlib.util.spec_from_file_location(f"kvb_orchestrator_gates_{changed}", script)
if spec is None:
return None
module = importlib.util.module_from_spec(spec)
try:
spec.loader.exec_module(module)
except (OSError, ImportError, RuntimeError, SyntaxError):
return None
return module
return script_module(script)
def branch_gates(gates: ModuleType, db: sqlite3.Connection, repo: str, branch: str) -> dict: