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:
1 parent
7505fcb55d
commit
dbc10536a4
8 files changed
+100
-22
No files matched your search
@@ -213,18 +213,20 @@ class Approving:
|
||||
|
||||
def requester(self, raw: dict, who: str) -> str:
|
||||
"""Returns:
|
||||
The requester a denial addresses, empty for every other item.
|
||||
The agent a denial addresses: the requester the inbox showed, or
|
||||
for a direct channel the claimed agent the operator picked
|
||||
instead; empty for every other item.
|
||||
|
||||
Raises:
|
||||
Conflict when it is no longer the one the inbox showed the
|
||||
operator, sent back as raw["to"].
|
||||
Conflict when raw["to"] is neither, the requester sent back as
|
||||
raw["to"].
|
||||
"""
|
||||
if raw["verb"] != "reject" or "channel" not in raw:
|
||||
return ""
|
||||
name = self.addressee(who)[0]
|
||||
if raw["to"] != name:
|
||||
if raw["to"] != name and not self.pickable(raw["channel"], raw["to"]):
|
||||
raise Conflict({"id": raw["id"], "status": "recipient changed", "to": name})
|
||||
return name
|
||||
return raw["to"]
|
||||
|
||||
def operator_entry(self, raw: dict, tasks: dict[str, dict]) -> dict:
|
||||
"""Args:
|
||||
|
||||
@@ -132,6 +132,15 @@ class Denying:
|
||||
def addressee(self, who: str) -> tuple[str, str]:
|
||||
return requester_of(read_claims(self.council), who)
|
||||
|
||||
def pickable(self, channel: str, name: object) -> bool:
|
||||
"""Returns:
|
||||
Whether the operator may address a denial over channel to name:
|
||||
a direct channel and the agent of a claim with a radio address
|
||||
that no other agent's claim shares.
|
||||
"""
|
||||
claims = read_claims(self.council)
|
||||
return channel in DIRECT and isinstance(name, str) and any(claim["agent"] == name and claim["address"] for claim in claims) and requester_of(claims, name)[0] == name
|
||||
|
||||
def tell(self, item: dict, proof: dict | None, who: str, what: str) -> str:
|
||||
"""Args:
|
||||
item: the denied inbox item: its note holds the chosen channel,
|
||||
|
||||
@@ -56,6 +56,7 @@ class Mcp:
|
||||
"notes": text_property("Text shown with the review, such as the commit table; may be empty."),
|
||||
"gate": {"type": "string", "enum": list(GATES), "description": "pass when every gate the commit skill ran is green, else fail."},
|
||||
"score": text_property("The kvb-check-score line of the commit, one line."),
|
||||
"agent": text_property("Your agent name as the radio knows it; the operator's denial and its reason go to it."),
|
||||
},
|
||||
),
|
||||
tool("review_status", "Status of a review (pending, approved, rejected, superseded: a newer review of the same worktree and branch replaced it, named by superseded_by), its tree, decision time and the passkey proof that approval.py verify --record checks.", {"id": review_id}),
|
||||
|
||||
Reference in new issue
Block a user