fix(hub): let the operator pick who hears a denial and require the agent on review requests

A review_request without agent reached nobody when denied: the hub
found no requester and dropped the reason. The MCP schema now requires
agent, the deny sheet preselects Call, offers a recipient picker
defaulting to the card's creator and stays disabled for a direct
channel without one, and the hub accepts a picked name only for a
direct channel and an agent with a unique claimed radio address.

🎯 Fix: 93 %
💥 Break: 4 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 89
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-25 00:17:42 +00:00
1 parent 7505fcb55d
commit dbc10536a4
8 files changed
+100 -22

No files matched your search

+18 -2
View File
@@ -94,10 +94,26 @@ DENY_SHEET = """(async () => {@HELPERS@@LABELS@
const row = await until(() => rowOf("git push"), 8000);
press(row, "Deny via …");
const box = await until(() => document.querySelector(".sheet-box"), 4000);
const channels = all(".deny-channels input[type=radio]", box).map((input) => [input.value, input.checked]);
const hints = all(".deny-channel small", box).map(text);
const recipient = box.querySelector(".deny-recipient select");
const deny = all("button", box).find((button) => text(button) === "Deny");
const picked = recipient.value;
const sendable = !deny.disabled;
recipient.value = "";
recipient.dispatchEvent(new Event("change"));
const blocked = deny.disabled;
box.querySelector(".deny-channels input[value=broadcast]").click();
const toAll = !deny.disabled;
box.querySelector(".deny-channels input[value=call]").click();
recipient.value = picked;
recipient.dispatchEvent(new Event("change"));
return {
title: text(box.querySelector(".panel-title")),
channels: all(".deny-channels input[type=radio]", box).map((input) => [input.value, input.checked]),
hints: all(".deny-channel small", box).map(text),
channels,
hints,
recipient: picked,
gate: [sendable, blocked, toAll, !deny.disabled],
reason: Boolean(box.querySelector("textarea")),
unlabelled: unlabelled(box),
wide: wide(),
+2 -1
View File
@@ -102,8 +102,9 @@ class TestHubInbox(base.OrchestratorE2ECase):
self.layout(probe)
self.assertTrue(probe["console"].startswith("doneExit code 0"), probe)
self.assertEqual(sheet["title"], "Deny")
self.assertEqual(sheet["channels"], [["post", True], ["call", False], ["newsletter", False], ["broadcast", False], ["pan-pan", False], ["security", False]])
self.assertEqual(sheet["channels"], [["post", False], ["call", True], ["newsletter", False], ["broadcast", False], ["pan-pan", False], ["security", False]])
self.assertEqual(sheet["hints"][:3], ["to Skills, when its turn ends", "to Skills, at once, wakes it", "to all, when their turn ends"])
self.assertEqual((sheet["recipient"], sheet["gate"]), ("Skills", [True, True, True, True]))
self.assertEqual((sheet["reason"], sheet["unlabelled"], sheet["wide"]), (True, [], False))
denied, gone, accepted = rest[6:]
self.assertNotIn("error", denied, denied)
+25 -1
View File
@@ -10,7 +10,7 @@ import unittest
from unittest import mock
from hub_case import HubCase
from hub_support import ASK, CLIENT, PAGE, Key, key, signing, verifier
from hub_support import ASK, CLIENT, PAGE, TREE, Key, key, signing, verifier
from kvb_orchestrator import batches, denying, skill_scripts
PUSH = "git push"
@@ -196,6 +196,30 @@ class TestHubDeny(HubCase):
self.assertIn("recipient changed", answer.decode())
self.assertEqual((self.ask_status(ask_id, "0"), self.radio()), ("pending", []))
def test_the_operator_picks_the_recipient_of_a_review_that_names_no_agent(self):
self.claim("s1", "Skills session")
self.claim("s2", "Docs session")
review_id = self.tool("review_request", self.arguments("feat: nameless", "", self.page("bundle.html", PAGE)))["structuredContent"]["id"]
entry = self.denial("review", review_id, "", "call", "rebase first")
self.assertEqual(entry["to"], "")
for to, channel in (("Ghost", "call"), ("Docs", "broadcast"), ("", "post")):
with self.subTest(to=to, channel=channel):
status, _, answer = self.post_json("/api/sign", {"items": [{**entry, "to": to, "channel": channel}]}, self.guard(self.host))
if to:
self.assertEqual(status, 409, answer)
self.assertIn("recipient changed", answer.decode())
else:
self.assertEqual(status, 200, answer)
picked = {**entry, "to": "Docs"}
subject = signing.review_item(review_id, "/repo/.git", "/repo/.worktrees/feature/x", "feature/x", TREE)
self.assertEqual(self.prepare([picked])["payload"]["items"], [signing.item_hash(signing.denial_item(subject, "call", "rebase first", "Docs"))])
with mock.patch.object(batches, "UNDO", 0.05):
self.assertEqual(self.approve([picked], self.signed([picked], self.pin()))[0], 202)
self.settle(lambda: self.radio() != [])
sent = self.radio()[-1]
self.assertEqual(sent[:4], ["send", "call", "--to", "Docs session"])
self.assertTrue(sent[-1].endswith("Denied by the operator: commit feat: nameless on feature/x (from an agent). Reason: rebase first"), sent[-1])
def test_a_claim_planted_before_signing_leaves_a_direct_denial_without_recipient(self):
self.claim("s1", "Skills session")
self.write_council(PLANTED)
+1 -1
View File
@@ -112,7 +112,7 @@ class TestHubMcp(HubCase):
def test_mcp_requires_gate_score_and_recommended(self):
tools = {entry["name"]: entry["inputSchema"] for entry in self.rpc("tools/list", {})["result"]["tools"]}
self.assertEqual(tools["review_request"]["properties"]["gate"]["enum"], ["pass", "fail"])
self.assertTrue({"gate", "score"} <= set(tools["review_request"]["required"]))
self.assertTrue({"gate", "score", "agent"} <= set(tools["review_request"]["required"]))
self.assertIn("recommended", tools["decision_request"]["required"])
review_id = self.request("feat: gated", "")
decision_id = self.decision("Wait")