feat(org): kvb-org-radio and kvb-org-queue replace chair and peer messages

kvb-org-radio is the default channel to other agents: broadcast and direct reach the receiver on its next prompt, security and pan-pan mid-turn through a PostToolBatch hook, and only mayday or direct --wake wake a session, through the receiver's own asyncRewake Stop hook (a SendMessage fallback is printed for sessions without a listener). It keeps the news.jsonl store and lock, so news.py stays a forwarding shim. A mayday holds radio silence for two hours: watch.py blocks new heavy commands and the operator gets a desktop notice. hotfix.py announces merged hotfixes as security items.

kvb-org-queue grants heavy jobs by rule instead of chair messages: queue.py hold waits under a flock with disk reservation, hotfix-first and register rank order, slot limits, stage and silence checks, then runs the command and releases. Every job is recorded; history.py learns disk need per command and slot limits per kind (p90, five runs), watch.py mirrors the history to ~/.local/state. enable-plugins.js registers the new hooks behind a file check so a missing script never blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-04 17:07:24 +01:00
1 parent ed5bb074c5
commit 27559dabc4
18 files changed
+2607 -225

No files matched your search

+6 -7
View File
@@ -7,7 +7,8 @@ description: >
`${CLAUDE_SKILL_DIR}/scripts/hotfix.py` keeps each hotfix as a task
`hotfix/<slug>` of the `kvb-org-rasci` register, the author as R and A;
never a message or news post.
recording it merged radios a `security` item (`kvb-org-radio`), never post it
yourself.
```bash
hotfix.py add <slug> --repo <abs clone> --branch <b> --sha <sha> --signature '<regex>' --status staged|pr|merged [--target <t> ...] [--pr <n>]
@@ -39,12 +40,12 @@ hotfix.py void --repo <worktree> --target <t> [--target ...]
names the blocker. Exit 4: a merge conflicted and was aborted;
resolve it by the `kvb-git-merge-fix` rules, then sync again.
2. `pending`: exit 0 means every merged hotfix is in HEAD. `open, not
merged` is reported, never merged: name it in your report and go on.
merged` is reported, never merged: report it.
`not on origin/<default>` or exit 2: tell its A to correct the row.
## On any failure
Before triage, investigation or asking a peer: `match`, the line quoted
Before triage or asking a peer: `match`, the line quoted
literally; `foreign` marks another repository's hotfix. A merged match: sync
and run again. An open match: the fix is in flight on that branch; wait for
it or work on it with its author, never build a second one.
@@ -59,10 +60,8 @@ capacity rules).
target; on exit 3 finished targets keep their results.
- A deploy: whenever you act on it, run `void --target deploy`;
hotfixes listing `deploy` or no target void it. Only on exit 3 stop it at
the next safe point, between stages and never inside a task. Never on a
timer.
- After exit 3: post the release to the news, sync, and request the chair's
grant again before rerunning.
the next safe point between stages. Never on a timer.
- After exit 3: sync, then rerun through `queue.py hold` (`kvb-org-queue`).
## Rules
+39 -5
View File
@@ -22,11 +22,13 @@ Args:
--target is a make target or `deploy` the fix turns green, none listed
means every target; --pr is the pull request number.
update <slug> --status staged|pr|merged [--sha <commit>] [--pr <n>]
[--repo <abs clone>] [--default <branch>]: move a hotfix on. --sha
resolves in the recorded git common dir or in --repo, which must be
the same repository unless the recorded one is unknown, and records
it anew. --status merged needs --sha, the commit as it sits on
origin/<default> after a fetch.
[--repo <abs clone>] [--default <branch>] [--session <id>]: move a
hotfix on. --sha resolves in the recorded git common dir or in
--repo, which must be the same repository unless the recorded one is
unknown, and records it anew. --status merged needs --sha, the commit
as it sits on origin/<default> after a fetch. add and update with
--status merged post a kvb-org-radio security item; a failed post
only warns.
pending --repo <dir> [--target <t> ...]: every hotfix of that repository
against HEAD; with --target only those that turn one of the targets
green, as void counts them.
@@ -127,6 +129,7 @@ SKILLS = Path(__file__).resolve().parents[2]
RASCI = SKILLS / "kvb-org-rasci" / "scripts" / "rasci.py"
GATE = SKILLS / "kvb-check-gate" / "scripts" / "gate.py"
WATCH = SKILLS / "kvb-org-organize" / "scripts" / "watch.py"
RADIO = SKILLS / "kvb-org-radio" / "scripts" / "radio.py"
PREFIX = "hotfix/"
STAGES = ("staged", "pr", "merged")
REGISTER_STATUS = {"staged": "running", "pr": "running", "merged": "done"}
@@ -584,9 +587,37 @@ def cmd_add(rasci: ModuleType, args: argparse.Namespace) -> int:
fail(f"{task} is already in the register; move it on with update")
tasks[task] = entry
print(f"added {task}")
if args.status == "merged":
announce(task, entry, args.session)
return 0
def announce(task: str, entry: dict, session: str | None) -> None:
"""Post a merged hotfix as a kvb-org-radio security item; never fails the caller.
Args:
task: the register task, hotfix/<slug>.
entry: its register row.
session: the caller's --session, for runtimes without CLAUDE_CODE_SESSION_ID.
"""
if not RADIO.is_file():
return
text = (
f"HOTFIX merged: {task} {entry.get('sha', '-')[:12]} on {repository(entry)}; "
"hotfix.py sync before your next deploy, merge or gate"
)
command = [sys.executable, str(RADIO), "send", "security", text]
if session:
command += ["--session", session]
try:
result = subprocess.run(command, capture_output=True, text=True, timeout=30, check=False)
except (OSError, subprocess.TimeoutExpired) as error:
print(f"hotfix: radio announcement failed: {error}", file=sys.stderr)
return
if result.returncode != 0:
print(f"hotfix: radio announcement failed: {result.stderr.strip()}", file=sys.stderr)
def located(task: str, entry: dict, given: str | None) -> tuple[str, dict]:
if given is None:
common = entry.get("common_dir") or ""
@@ -624,6 +655,8 @@ def cmd_update(rasci: ModuleType, args: argparse.Namespace) -> int:
entry["stage"] = args.status
rasci.apply_status(entry, REGISTER_STATUS[args.status])
print(f"updated {task}")
if args.status == "merged":
announce(task, entry, args.session)
return 0
@@ -856,6 +889,7 @@ def main() -> int:
p.add_argument("--pr", type=int)
p.add_argument("--repo")
p.add_argument("--default")
p.add_argument("--session")
p.set_defaults(func=cmd_update)
p = sub.add_parser("pending")
p.add_argument("--repo", required=True)