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
@@ -228,7 +228,7 @@ def resolves(where: str, ref: str) -> bool:
|
||||
|
||||
|
||||
def task_of(rasci: ModuleType, slug: str) -> str:
|
||||
if not rasci.TASK.match(slug):
|
||||
if not rasci.TASK.fullmatch(slug):
|
||||
fail(f"invalid slug {slug!r}; use lowercase letters, digits, '.', '_', '-' and '/'")
|
||||
return PREFIX + slug
|
||||
|
||||
|
||||
@@ -38,7 +38,11 @@ before reporting it: one copy-pasteable command, its absolute directory, and
|
||||
why no agent can run it. The row gets the operator as R, your session as A,
|
||||
status `queued`. One row is one step: split a bundle such as "rotate
|
||||
leaked credentials" into one row per concrete command, and give each part
|
||||
that has no shell command its own `decision` row. Pick its check from
|
||||
that has no shell command its own `decision` row: the question as
|
||||
`--command`, each answer as `--option "<label>=<what it means>"`, your pick
|
||||
as `--recommended`; the hub shows them as buttons, and the answer reaches
|
||||
the row's A as a passkey-signed post `Decision <task>` / `Answer: <answer>`
|
||||
to check with `operator_message` before acting. Pick its check from
|
||||
`checks.md` next to this file: the strongest kind that proves the step done,
|
||||
never a shell command.
|
||||
|
||||
|
||||
@@ -15,9 +15,14 @@ Environment:
|
||||
|
||||
Args:
|
||||
add <slug> --dir <abs dir> --command "<cmd>" --reason "<why>"
|
||||
--check <kind>[:<arg>] [--session <id>]: record a command, or update
|
||||
--check <kind>[:<arg>] [--option "<label>=<description>" ...]
|
||||
[--recommended <label>] [--session <id>]: record a command, or update
|
||||
the row of that slug, as queued with Operator R and the adder A, its
|
||||
session id under `sessions`.
|
||||
session id under `sessions`. --option, only with --check decision
|
||||
and at most OPTION_LIMIT times, gives the answers the Agent
|
||||
Orchestrator shows as buttons beside a free answer; the operator's
|
||||
pick arrives as a signed post to the adder. --recommended names one
|
||||
of them.
|
||||
Kinds, never a shell command:
|
||||
pushed:<repo dir> `git rev-list --count @{u}..HEAD` is 0 there;
|
||||
no upstream counts as open.
|
||||
@@ -168,6 +173,8 @@ INTERRUPTED = 130
|
||||
SUDO = re.compile(r"\bsudo\b")
|
||||
PREFIX = "operator/"
|
||||
KINDS = ("pushed", "installed", "binary", "absent", "manual", "decision")
|
||||
OPTION_LIMIT = 12
|
||||
LABEL_LIMIT = 80
|
||||
OPEN = ("queued", "blocked")
|
||||
META = re.compile(r"[\s|&;()<>$`\\\"'*?\[\]{}~!#]")
|
||||
NAME = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._+-]*$")
|
||||
@@ -201,7 +208,7 @@ def module(name: str, path: Path) -> ModuleType:
|
||||
|
||||
|
||||
def task_of(rasci: ModuleType, slug: str) -> str:
|
||||
if not rasci.TASK.match(slug):
|
||||
if not rasci.TASK.fullmatch(slug):
|
||||
fail(f"invalid slug {slug!r}; use lowercase letters, digits, '.', '_', '-' and '/'")
|
||||
return PREFIX + slug
|
||||
|
||||
@@ -299,6 +306,41 @@ def cell(text: object) -> str:
|
||||
return visible(" ".join(str(text).split()), "").replace("|", "\\|")
|
||||
|
||||
|
||||
def choices(raw: list[str] | None, recommended: str | None, check: str) -> list[dict]:
|
||||
"""Args:
|
||||
raw: the --option values, each "<label>=<description>" or "<label>".
|
||||
recommended: the --recommended label, or None.
|
||||
check: the row's --check kind.
|
||||
|
||||
Returns:
|
||||
[{"label", "description"}] in the given order; [] without options.
|
||||
Exits 2 when options come with another check than decision, exceed
|
||||
OPTION_LIMIT, repeat a label, hold an empty, multi-line or longer
|
||||
than LABEL_LIMIT label, or when --recommended names no option.
|
||||
"""
|
||||
if not raw:
|
||||
if recommended:
|
||||
fail("--recommended needs --option")
|
||||
return []
|
||||
if check != "decision":
|
||||
fail("--option is only for --check decision")
|
||||
if len(raw) > OPTION_LIMIT:
|
||||
fail(f"at most {OPTION_LIMIT} --option values")
|
||||
options = []
|
||||
for text in raw:
|
||||
label, _, description = text.partition("=")
|
||||
label = label.strip()
|
||||
if not label or not label.isprintable() or len(label) > LABEL_LIMIT:
|
||||
fail(f"--option {text!r} needs a label of one line and at most {LABEL_LIMIT} characters before the =")
|
||||
options.append({"label": label, "description": " ".join(description.split())})
|
||||
labels = [option["label"] for option in options]
|
||||
if len(set(labels)) != len(labels):
|
||||
fail("--option labels must be distinct")
|
||||
if recommended and recommended not in labels:
|
||||
fail(f"--recommended {recommended!r} names none of {', '.join(labels)}")
|
||||
return options
|
||||
|
||||
|
||||
def cmd_add(rasci: ModuleType, args: argparse.Namespace) -> int:
|
||||
task = task_of(rasci, args.slug)
|
||||
for error in (path_problem(args.dir, "--dir"), problem(args.check)):
|
||||
@@ -313,6 +355,7 @@ def cmd_add(rasci: ModuleType, args: argparse.Namespace) -> int:
|
||||
refused = None if args.check == "decision" else unrunnable(command, args.dir)
|
||||
if refused:
|
||||
fail(f"--command {command!r} {refused}; write the real command, or record the step with --check decision")
|
||||
options = choices(args.option, args.recommended, args.check)
|
||||
council = module("council", rasci.COUNCIL)
|
||||
sid, _ = council.caller(args.session)
|
||||
party = council.live_sessions().get(sid) or sid
|
||||
@@ -322,8 +365,10 @@ def cmd_add(rasci: ModuleType, args: argparse.Namespace) -> int:
|
||||
entry = tasks.setdefault(task, {})
|
||||
entry.setdefault("seq", seq)
|
||||
entry.update(title=command, workdir=args.dir, description=reason, check=args.check)
|
||||
entry.pop("cancelled", None)
|
||||
entry.pop("failed", None)
|
||||
for name in ("cancelled", "failed", "options", "recommended"):
|
||||
entry.pop(name, None)
|
||||
if options:
|
||||
entry.update(options=options, recommended=args.recommended or "")
|
||||
roles = {p: v.replace("A", "") for p, v in entry.get("roles", {}).items()}
|
||||
roles[rasci.OPERATOR] = rasci.letters_of(roles.get(rasci.OPERATOR, ""), "R")
|
||||
roles[party] = rasci.letters_of(roles.get(party, ""), "A")
|
||||
@@ -1011,6 +1056,8 @@ def main() -> int:
|
||||
p.add_argument("slug")
|
||||
for flag in ("--dir", "--command", "--reason", "--check"):
|
||||
p.add_argument(flag, required=True)
|
||||
p.add_argument("--option", action="append")
|
||||
p.add_argument("--recommended")
|
||||
p.add_argument("--session")
|
||||
p.set_defaults(func=cmd_add)
|
||||
p = sub.add_parser("list")
|
||||
|
||||
@@ -55,7 +55,7 @@ def fail(message: str) -> None:
|
||||
|
||||
|
||||
def check_task(task: str) -> None:
|
||||
if not TASK.match(task):
|
||||
if not TASK.fullmatch(task):
|
||||
fail(f"invalid task {task!r}; use a slug like work/<slug>")
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ Merge duplicates and drop items a command can settle (those go to
|
||||
- **Agent Orchestrator**: when an operator message that `operator_message`
|
||||
verified asks "send me your open decisions as choices", send each item
|
||||
through the MCP tool `decision_request` (question, options, your agent
|
||||
name, the recommended label); it shows as a choice card under "Waits on
|
||||
name, the recommended label; an option that needs a visual comparison
|
||||
carries a `preview`); it shows as a choice card under "Waits on
|
||||
Operator". `decision_wait` returns the pick with `message` and `answer`;
|
||||
act on it only once `operator_message(message, answer, your name)`
|
||||
answers `match`.
|
||||
|
||||
Reference in new issue
Block a user