feat(orchestrator): hub requirements 066 to 082 and 084
Radio footer, rules page, schedules editor (System timers and Claude tasks through signed runner jobs), account usage bar, usage explorer with a streamed usage.jsonl, queue Controls tab and override, running tasks on the board, stale task prune with the generic dial, greyed card stamps, commit-tree diffs from the runner preview, VS Code path links, expired asks and decisions that stay as EXPIRED cards (asks keyed by a call digest; an async PostToolUse hook closes those answered in the terminal), the Match refresh hourglass, attachments by paste, drop and paperclip in every text field (page CSP gains img-src blob: for the thumbnails) and the limits board with profiles and a passkey to loosen. Fixes: one red accept on a red-gate commit and no release while a risk is open, the send bar footer segments share one height, the mic button survives a redraw, new Match cards queue before the release card. E2E specs were still running at commit time (operator order); their failures follow as separate fixes. 🎯 Fix: 88 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 81 🚦 Gate: ⛔ fix 88 % < 90, break 8 % > 5 (committed on the operator's word) Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc0d578eca
commit
f356083a24
149 files changed
+10646
-963
No files matched your search
@@ -0,0 +1,77 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
|
||||
from .errors import ToolError
|
||||
from .fields import expect
|
||||
from .jobs import PRUNE_JOB
|
||||
from .register import ENDED, REGISTER, read_register, status_of
|
||||
from .signed import pruning, signing
|
||||
|
||||
PRUNE_TASK = "prune"
|
||||
ANNOUNCE_KEYS = ("kind", "argv")
|
||||
APPLY_KEYS = ("kind", "argv", "not_before")
|
||||
|
||||
|
||||
def prune_request(raw: object) -> bool:
|
||||
return isinstance(raw, list) and bool(raw) and all(isinstance(entry, dict) and entry.get("kind") == PRUNE_JOB for entry in raw)
|
||||
|
||||
|
||||
def shown_command(argv: list[str]) -> str:
|
||||
if argv[0] == pruning.ANNOUNCE:
|
||||
return f"radio.py send security {pruning.announcement(argv)}"
|
||||
return " ".join(["rasci.py", *argv])
|
||||
|
||||
|
||||
def prune_items(raw: object, now: float, open_tasks: set[str]) -> list[dict]:
|
||||
"""Args:
|
||||
raw: the page's two items under one passkey assertion: first
|
||||
{"kind": "prune", "argv"} with the announce argv, then
|
||||
{"kind": "prune", "argv", "not_before"} with the rasci.py prune
|
||||
argv and the deadline (pruning.prune_argv()).
|
||||
now: the current time in epoch seconds.
|
||||
open_tasks: the register tasks neither done nor stopped.
|
||||
|
||||
Returns:
|
||||
The two signed items, once both name the same tasks, all open in
|
||||
the register, the apply job's not_before is the announced deadline,
|
||||
that deadline lies ahead (pruning.timely()) and --since is no older
|
||||
than one signature lifetime and at most pruning.SKEW ahead.
|
||||
"""
|
||||
if not isinstance(raw, list) or len(raw) != 2 or not all(isinstance(entry, dict) for entry in raw):
|
||||
raise ToolError("a prune is two items: the announce, then the apply job")
|
||||
announce, apply = raw
|
||||
expect(announce, ANNOUNCE_KEYS)
|
||||
expect(apply, APPLY_KEYS)
|
||||
try:
|
||||
first = pruning.prune_argv(announce["argv"], None)
|
||||
second = pruning.prune_argv(apply["argv"], apply["not_before"])
|
||||
pruning.timely(first, None, now)
|
||||
except signing.Refused as error:
|
||||
raise ToolError(f"prune: {error}") from None
|
||||
if pruning.tasks_of(first) != pruning.tasks_of(second) or pruning.deadline_of(first) != apply["not_before"]:
|
||||
raise ToolError("the announce and the apply job must name the same tasks and the same deadline")
|
||||
if not now - signing.LIFETIME <= int(second[2]) <= now + pruning.SKEW:
|
||||
raise ToolError("--since must be the epoch the page listed the stale tasks at")
|
||||
closed = [task for task in pruning.tasks_of(first) if task not in open_tasks]
|
||||
if closed:
|
||||
raise ToolError(f"not open in the register: {', '.join(closed)[:300]}")
|
||||
return [pruning.prune_item(first, None), pruning.prune_item(second, apply["not_before"])]
|
||||
|
||||
|
||||
class Prunes:
|
||||
def prune_changes(self, raw: object) -> list[dict]:
|
||||
tasks = read_register(self.council / REGISTER)
|
||||
return prune_items(raw, time.time(), {task for task, row in tasks.items() if status_of(row) not in ENDED})
|
||||
|
||||
def prune(self, body: bytes) -> dict:
|
||||
"""Args:
|
||||
body: {"items", "proof"}: the two prune items (prune_items())
|
||||
and the one passkey assertion over both.
|
||||
|
||||
Returns:
|
||||
{"jobs": ids, "status": "queued"}: the announce job, which the
|
||||
runner runs at once, and the apply job it holds until the
|
||||
deadline.
|
||||
"""
|
||||
return self.signed_jobs(body, self.prune_changes, PRUNE_JOB, PRUNE_TASK, shown_command)
|
||||
Reference in new issue
Block a user