feat(hub): grant split menu, radio redesign and answerable decision rows
The Grant bar becomes one split control: Select, or Grant N with a menu for Deny, Grant all green, the picked list, Clear and Direct mode; picked items turn pale green. The radio drops its filter flyout and gains three-state bells per row, a test per row including Speak, Auto or Morse on a second click, mute on the sender avatar and the agent profile, Cancel MAYDAY beside Send only while one is active, a Send menu with a test message and hold-to-record push-to-talk. Decision rows read as questions with their options; the signed answer is Decision <id> plus Answer: <answer>, and the card names its recipient. Security: the passkey-signed answer carries no agent-written text, the inbox lists answerable rows only when their id fullmatches the TASK rule of the installed rasci.py (skill_scripts.task_pattern), and rasci.py, operator.py and hotfix.py check task slugs with fullmatch, so a trailing newline no longer passes. Accepted MEDUSA findings after kvb-think-criticize: page-inbox.js:116 EXA006 (by design after the fix), page-inbox.js:125 EXA010, operator.py:173, 618 and 633 RP001, FT-TRIGGER-005 and RLHF-POISON-002, operator.py:639 MEX-SCAN-346, operator.py:968 MM-SCAN-058, operator.py:974 ACP-SCAN-028 (false positives). 🎯 Fix: 85 % 💥 Break: 10 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 77 🚦 Gate: ⛔ fix 85 % < 90, break 10 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff9bbc19c2
commit
d695bb2b58
42 files changed
+1158
-340
No files matched your search
@@ -3,9 +3,11 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
from .council import HUMAN, agent, ordered
|
||||
from .fields import ORDER_NAME
|
||||
from .fields import DESCRIPTION_LIMIT, OPTION_LIMIT, ORDER_NAME
|
||||
from .records import read_json, shown
|
||||
|
||||
LABEL_LIMIT = 80
|
||||
|
||||
REGISTER = "rasci.json"
|
||||
AGENT_ORDER = "agent-order.json"
|
||||
OPERATOR = "operator/"
|
||||
@@ -53,19 +55,46 @@ def is_open(task: str, row: dict, operator: bool) -> bool:
|
||||
return task.startswith(OPERATOR) == operator and status_of(row) not in ENDED
|
||||
|
||||
|
||||
def row_options(row: dict) -> list[dict]:
|
||||
"""Args:
|
||||
row: an operator row of the register, which agents write.
|
||||
|
||||
Returns:
|
||||
A decision row's options as {"label", "description"}, at most
|
||||
OPTION_LIMIT, each label one non-empty line of at most LABEL_LIMIT
|
||||
characters and unique; [] for any other row or malformed options.
|
||||
"""
|
||||
raw = row.get("options")
|
||||
if row.get("check") != "decision" or not isinstance(raw, list):
|
||||
return []
|
||||
options = []
|
||||
for option in raw[:OPTION_LIMIT]:
|
||||
label = option.get("label") if isinstance(option, dict) else None
|
||||
description = option.get("description", "") if isinstance(option, dict) else None
|
||||
if isinstance(label, str) and isinstance(description, str) and label.strip() and label.isprintable() and len(label) <= LABEL_LIMIT:
|
||||
options.append({"label": label.strip(), "description": " ".join(description.split())[:DESCRIPTION_LIMIT]})
|
||||
labels = [option["label"] for option in options]
|
||||
return options if len(set(labels)) == len(labels) else []
|
||||
|
||||
|
||||
def operator_rows(tasks: dict[str, dict]) -> list[dict]:
|
||||
return [
|
||||
{
|
||||
rows = []
|
||||
for task, row in sorted(tasks.items()):
|
||||
if not is_open(task, row, True):
|
||||
continue
|
||||
options = row_options(row)
|
||||
recommended = row.get("recommended")
|
||||
rows.append({
|
||||
"task": task,
|
||||
"command": shown(row.get("title")),
|
||||
"directory": shown(row.get("workdir")),
|
||||
"why": shown(row.get("description")),
|
||||
"check": shown(row.get("check")),
|
||||
"status": status_of(row),
|
||||
}
|
||||
for task, row in sorted(tasks.items())
|
||||
if is_open(task, row, True)
|
||||
]
|
||||
"options": options,
|
||||
"recommended": recommended if recommended in [option["label"] for option in options] else "",
|
||||
})
|
||||
return rows
|
||||
|
||||
|
||||
def runnable(row: dict) -> bool:
|
||||
|
||||
Reference in new issue
Block a user