Files
skills/orchestrator/kvb_orchestrator/signed.py
T
Kevin Veen-BirkenbachandClaude Opus 5.5 58187e8323 feat(orchestrator): inbox console, deny by channel and agent rule requests
The inbox shows the console output of a command under its "Ausführen"
row, kept to the same tail the job list shows. A deny picks its radio
channel (post by default, call, newsletter, broadcast, pan-pan,
security) and an optional reason; the passkey signs denial, channel and
reason, the hub verifies the proof before it stores or sends anything,
and the PermissionRequest hook quotes a reason only when it verifies.

Agents ask for an auto-approval rule through the MCP tool rule_request;
the request shows in the inbox with a dry run over the last seven days
and is accepted only with a passkey assertion the hub verifies against
the pinned keys and the hub origin, for every rule kind. Requests lapse
with the ask lifetime and are capped per agent and in total.

The image runs as nobody by default and carries the health check
command; compose keeps the timing.

🎯 Fix: 93 %
💥 Break: 4 %
💸 Cost: 98 %
⏱️ Time: 75 %
🛡️ Security: 100 %
🏆 Score: 100
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 18:14:30 +00:00

52 lines
1.8 KiB
Python

from __future__ import annotations
import importlib.util
import sys
from pathlib import Path
from types import ModuleType
CLIENT = Path(__file__).resolve().parents[1] / "client"
def client_module(name: str, uses: dict[str, ModuleType]) -> ModuleType:
"""Args:
name: a module of orchestrator/client, loaded under its own
kvb_orchestrator_<name> name.
uses: the client modules it imports by their bare names; they are
visible under those names only while it loads.
"""
spec = importlib.util.spec_from_file_location(f"kvb_orchestrator_{name}", CLIENT / f"{name}.py")
module = importlib.util.module_from_spec(spec)
before = {key: sys.modules.get(key) for key in uses}
sys.modules.update(uses)
try:
spec.loader.exec_module(module)
finally:
for key, old in before.items():
if old is None:
sys.modules.pop(key, None)
else:
sys.modules[key] = old
return module
signing = client_module("signing", {})
passkey = client_module("passkey", {"signing": signing})
verifier = client_module("verifier", {"signing": signing, "passkey": passkey})
def ask_signed(ask: dict) -> dict:
return signing.ask_item(ask["id"], ask["tool"], ask["command"], ask["cwd"], ask["session"])
def review_signed(review: dict) -> dict:
return signing.review_item(review["id"], review.get("repo", ""), review["worktree"], review["branch"], review["tree"])
def operator_signed(row: dict) -> dict:
return signing.operator_item(row["task"], row["command"], row["directory"])
def request_signed(request: dict) -> dict:
return signing.rule_request_item(request["id"], request["kind"], request["tool"], request["pattern"], request["scope"], int(request["expires"]))