Hub: send in the field (032), coherent speak box (033), stream head band (034), Match at full width with its pile (035, 036), Home without the outer box (037), badge to Match (038), rejects that survive a changed or withdrawn card (039), the release card (040), code marks in the review diff (041), why Deny is off (042), the undo window clock (043), widgets without inner boxes (044), the Artifacts head on one line (045), accepting a red gate's risk (046), one code box (047), done rows greyed and folded (048), one control height (049), menus that stay open (050), radio settings in the Device card (051), bubbles beside the modes (052), agent settings on every face and name (053), pin only by menu (054), WASD in Match (055), the flowing card edge (056), Schedules in Controls (057) and the hub poll cost (059). Skills: the coach leaves for its own repository kevinveenbirkenbach/coach (058; test_install pins its four skills in skills-lock.json and stays red until that repository is published and pinned), hooks and timers start fewer processes (060), council files on hot paths stay bounded and mirror by marker instead of mtime (061), scripts and hooks hand agents less output (062), and block.py builds the commit table and message block in one run (063). Requirement documents 032 to 063 with their implementation amendments. MEDUSA false positives accepted after kvb-think-criticize (36 lines): MM-SCAN-058 (pla inside replace or plan), JB-SCAN-616/641 (the local clip helper), CODEGEN-SCAN-001 (drop-in paths), CGS-SCAN-029 (systemctl argv from constants), CGS-SCAN-040 (runner poll loop), FLA-SCAN-055 (feedback), WM-SCAN-354, AI-BACKDOOR-006, GENAI-SCAN-1270, B604 (runner shell path for passkey-verified commands), TC004, EXA002, EXA006, EXA010 and WEB-SSRF. 🎯 Fix: 92 % 💥 Break: 8 % 💸 Tokens: 89 % ⏱️ Velocity: – 🛡️ Security: ~100 % 🏆 Score: 95 🚦 Gate: ⛔ break 8 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
245 lines
14 KiB
Python
245 lines
14 KiB
Python
from __future__ import annotations
|
|
|
|
from hub_e2e_kit import HELPERS, LABELS
|
|
|
|
RUN_START = """(async () => {@HELPERS@@LABELS@
|
|
const row = await until(() => rowOf("Row"), 8000);
|
|
if (!row) {
|
|
return {error: text(document.getElementById("main"))};
|
|
}
|
|
press(row, "Run");
|
|
const toast = await until(() => all("#toasts .toast.wait").find((box) => box.textContent.includes("Run")), 8000);
|
|
const queued = await until(() => out() && line(), 15000);
|
|
await until(() => out().textContent.includes("Row 60"), 20000);
|
|
return {toast: text(toast), queued, running: line(), overflows: out().scrollHeight > out().clientHeight, followed: atEnd()};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
RUN_HELD = """(async () => {@HELPERS@@LABELS@
|
|
out().scrollTop = 0;
|
|
await sleep(300);
|
|
await until(() => out().textContent.includes("Row 80"), 20000);
|
|
await sleep(300);
|
|
return {held: out().scrollTop, running: line()};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
RUN_DONE = """(async () => {@HELPERS@@LABELS@
|
|
out().scrollTop = out().scrollHeight;
|
|
await until(() => document.querySelector("#main .console").dataset.status === "done", 20000);
|
|
await sleep(500);
|
|
const lines = out().textContent.trim().split("\\n");
|
|
return {done: line(), last: lines[lines.length - 1], lines: lines.length, followed: atEnd(), actions: all(":is(.item-actions, .code-foot) button", out().closest("li")).map(name)};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
INBOX_PICK = """(async () => {@HELPERS@
|
|
navigator.credentials.get = @SIGNS@ ? navigator.credentials.get.bind(navigator.credentials) : () => Promise.reject(new DOMException("The operator canceled.", "NotAllowedError"));
|
|
const posted = [];
|
|
const send = window.fetch.bind(window);
|
|
window.fetch = (path, init) => {
|
|
if (["/api/sign", "/api/inbox/approve"].includes(String(path))) {
|
|
posted.push([String(path), JSON.parse(init.body).items.map((item) => [item.id, item.verb, item.channel || null, item.reason])]);
|
|
}
|
|
return send(path, init);
|
|
};
|
|
const list = await until(() => document.querySelector("#main .inbox-list"), 8000);
|
|
if (!list) {
|
|
return {error: text(document.getElementById("main"))};
|
|
}
|
|
let scroller = list;
|
|
while (scroller && !(scroller.scrollHeight > scroller.clientHeight + 4 && getComputedStyle(scroller).overflowY !== "visible")) {
|
|
scroller = scroller.parentElement;
|
|
}
|
|
scroller = scroller || document.scrollingElement;
|
|
const last = all("#main .inbox-list > li").filter((li) => li.textContent.includes("echo row")).pop();
|
|
last.scrollIntoView({block: "center"});
|
|
await sleep(300);
|
|
const title = text(last.querySelector(".command code"));
|
|
const ref = last.dataset.ref;
|
|
await cursorTo(ref);
|
|
await sleep(300);
|
|
const before = scroller.scrollTop;
|
|
await pressKey("x");
|
|
await sleep(300);
|
|
const after = scroller.scrollTop;
|
|
const focused = Boolean(document.querySelector(`#main .inbox-list > li.cursor[data-ref="${ref}"]`));
|
|
await selectRow(all("#main .inbox-list > li").find((li) => li.textContent.includes("pick a name")).dataset.ref);
|
|
const buttons = all("#grant-bar .grant-split button").map(name);
|
|
document.querySelector("#grant-bar details.grant-menu > summary").click();
|
|
await until(() => document.querySelector("#grant-bar details.grant-menu[open]"), 2000);
|
|
all("#grant-bar .grant-split button").find((button) => name(button).startsWith("Deny selection")).click();
|
|
await until(() => document.querySelector(".sheet-box .actions"), 4000);
|
|
const listed = all(".sheet-box ul.mini > li strong").map(text);
|
|
const reason = document.querySelector(".sheet-box .deny-reason textarea");
|
|
const reasoned = Boolean(reason && document.activeElement === reason);
|
|
reason.value = "rebase first";
|
|
const confirm = all(".sheet-box .actions button").find((button) => text(button).startsWith("Deny "));
|
|
const label = text(confirm);
|
|
const shown = new Set(all("#toasts .toast"));
|
|
confirm.click();
|
|
const toast = await until(() => all("#toasts .toast").filter((node) => !shown.has(node)).map(text).find((entry) => entry.startsWith("Deny selection")), 15000);
|
|
return {title, before, moved: Math.abs(after - before), focused, buttons, listed, label, reasoned, toast, posted, wide: document.documentElement.scrollWidth > window.innerWidth + 1};
|
|
})()""".replace("@HELPERS@", HELPERS)
|
|
LAYOUT = """(async () => {@HELPERS@@LABELS@
|
|
await until(() => document.querySelector("#main .console") && rowOf("Rule request"), 8000);
|
|
const rule = rowOf("Rule request");
|
|
return {
|
|
kinds: all("#main .inbox-list > li").map((li) => all(".msg-meta .pill", li).map(text).find((label) => label !== "done")),
|
|
done: all("#main .inbox-list > li[data-done]").length,
|
|
splits: all("#main .deny-split").map((group) => all("button", group).map(name)),
|
|
console: line(),
|
|
followed: atEnd(),
|
|
fits: out().getBoundingClientRect().right <= window.innerWidth,
|
|
dry: text(rule.querySelector(".dry-run-count")),
|
|
fields: all(".rule-request dt", rule).map(text),
|
|
accept: all("button", rule).filter((button) => name(button) === "Accept").length,
|
|
unlabelled: unlabelled(document),
|
|
wide: wide(),
|
|
};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
DENY_SHEET = """(async () => {@HELPERS@@LABELS@
|
|
const row = await until(() => rowOf("git push"), 8000);
|
|
press(row, "Deny via …");
|
|
const box = await until(() => document.querySelector(".sheet-box"), 4000);
|
|
const channels = all(".deny-channels input[type=radio]", box).map((input) => [input.value, input.checked]);
|
|
const hints = all(".deny-channel small", box).map(text);
|
|
const recipient = box.querySelector(".deny-recipient select");
|
|
const deny = all("button", box).find((button) => text(button) === "Deny");
|
|
const picked = recipient.value;
|
|
const sendable = !deny.disabled;
|
|
recipient.value = "";
|
|
recipient.dispatchEvent(new Event("change"));
|
|
const blocked = deny.disabled;
|
|
box.querySelector(".deny-channels input[value=broadcast]").click();
|
|
const toAll = !deny.disabled;
|
|
box.querySelector(".deny-channels input[value=call]").click();
|
|
recipient.value = picked;
|
|
recipient.dispatchEvent(new Event("change"));
|
|
return {
|
|
title: text(box.querySelector(".panel-title")),
|
|
channels,
|
|
hints,
|
|
recipient: picked,
|
|
gate: [sendable, blocked, toAll, !deny.disabled],
|
|
reason: Boolean(box.querySelector("textarea")),
|
|
unlabelled: unlabelled(box),
|
|
wide: wide(),
|
|
};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
DENY = """(async () => {@HELPERS@@LABELS@
|
|
const row = await until(() => askOf("make deploy"), 8000);
|
|
if (!row) {
|
|
return {error: text(document.getElementById("main"))};
|
|
}
|
|
press(row, "Deny via …");
|
|
const box = await until(() => document.querySelector(".sheet-box"), 4000);
|
|
box.querySelector('input[value="call"]').click();
|
|
box.querySelector("textarea").value = "make the gate green first";
|
|
press(box.querySelector(".actions"), "Deny");
|
|
const undo = await until(() => all("#toasts .toast.wait").find((toast) => toast.textContent.includes("Denial")), 8000);
|
|
return {undo: text(undo), sheet: !document.getElementById("sheet").hidden};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
DENIED = """(async () => {@HELPERS@@LABELS@
|
|
return {gone: Boolean(await until(() => !askOf("make deploy"), 20000))};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
ACCEPT = """(async () => {@HELPERS@@LABELS@
|
|
press(rowOf("Rule request"), "Accept");
|
|
const toast = await until(() => all("#toasts .toast").find((box) => box.textContent.includes("Created: Rule")), 15000);
|
|
await until(() => !rowOf("Rule request"), 8000);
|
|
return {toast: text(toast), left: Boolean(rowOf("Rule request"))};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
WATCH = """
|
|
const questions = [];
|
|
window.confirm = (question) => {
|
|
questions.push(question);
|
|
return true;
|
|
};
|
|
let asked = 0;
|
|
const get = navigator.credentials.get.bind(navigator.credentials);
|
|
navigator.credentials.get = (options) => {
|
|
asked += 1;
|
|
return @SIGNS@ ? get(options) : Promise.reject(new DOMException("The operator canceled.", "NotAllowedError"));
|
|
};
|
|
const posted = [];
|
|
const send = window.fetch.bind(window);
|
|
window.fetch = (path, init) => {
|
|
if (["/api/choices/sign", "/api/choices", "/api/sign", "/api/inbox/approve"].includes(String(path))) {
|
|
const body = JSON.parse(init.body);
|
|
posted.push([String(path), Object.keys(body).sort(), body.class || null, body.to || null]);
|
|
}
|
|
return send(path, init);
|
|
};
|
|
const bar = () => document.getElementById("choice-request");
|
|
const fresh = async (shown, prefix) => until(() => all("#toasts .toast").filter((box) => !shown.has(box)).map(text).find((entry) => entry.startsWith(prefix)), 20000);
|
|
const fits = () => ({tall: document.documentElement.scrollHeight > window.innerHeight, wide: document.documentElement.scrollWidth > window.innerWidth + 1});
|
|
"""
|
|
CHOICE_VIEW = """(async () => {@HELPERS@@LABELS@
|
|
const found = await until(() => document.getElementById("choice-request") && all("#main .inbox-list > li.k-decision .options").length === @CARDS@ && document.querySelector('#choice-request input[type="checkbox"]'), 8000);
|
|
if (!found) {
|
|
return {error: text(document.getElementById("main"))};
|
|
}
|
|
const box = document.getElementById("choice-request");
|
|
const chip = document.querySelector('#main [aria-label="Task filters"] button[data-filter="operator"]');
|
|
const closed = all("button[data-channel]", box).filter((button) => button.checkVisibility()).length;
|
|
return {
|
|
kinds: [...new Set(all("#main .inbox-list > li").map((li) => text(li.querySelector(".pill"))))].sort(),
|
|
filter: [text(chip).replace(/[0-9]+$/, ""), chip.getAttribute("aria-pressed")],
|
|
channels: all("button[data-channel]", box).map((button) => [button.dataset.channel, name(button), button.disabled]),
|
|
fields: all("textarea, input:not([type=checkbox])", box).length,
|
|
agents: all('input[type="checkbox"]', box).map((input) => input.value),
|
|
multi: [name(box.querySelector("summary")), box.open, closed, text(box.querySelector(".menu-box h3 .count")), all('input[type="checkbox"]', box).filter((input) => input.checked).length],
|
|
bar: [box.parentElement.getAttribute("aria-label"), toolbarRows(), taskLayout()],
|
|
cards: all("#main .inbox-list > li").filter((li) => li.querySelector(".options")).map((li) => [text(li.querySelector(".pill")), all(".option strong", li).map(text)]),
|
|
choices: all("#main [data-column], #main .group-title, #main h2, #main h3").filter((node) => node.dataset.column === "choices" || text(node) === "Choices").length,
|
|
unlabelled: unlabelled(document),
|
|
tall: document.documentElement.scrollHeight > window.innerHeight,
|
|
wide: wide(),
|
|
};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@LABELS@", LABELS)
|
|
CHOICE_SEND = """(async () => {@HELPERS@@WATCH@
|
|
const menu = bar();
|
|
menu.querySelector("summary").click();
|
|
await sleep(200);
|
|
const boxes = all('input[type="checkbox"]', menu).slice(0, 2);
|
|
boxes.forEach((box) => box.click());
|
|
const counted = text(menu.querySelector(".menu-box h3 .count"));
|
|
const opened = [menu.open, all("button[data-channel]", menu).filter((button) => button.checkVisibility()).length];
|
|
const picked = boxes.map((box) => box.value).sort((a, b) => a.localeCompare(b));
|
|
const runs = [];
|
|
for (const button of all("button[data-channel]", bar())) {
|
|
const [before, prompts, sent] = [asked, questions.length, posted.length];
|
|
const shown = new Set(all("#toasts .toast"));
|
|
const disabled = button.disabled;
|
|
button.click();
|
|
const toast = await fresh(shown, "Choice request");
|
|
runs.push({channel: button.dataset.channel, disabled, asked: asked - before, question: questions.slice(prompts), posted: posted.slice(sent), toast});
|
|
}
|
|
return {picked, counted, opened, runs, fields: all("textarea, input:not([type=checkbox])", bar()).length, ...fits()};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@WATCH@", WATCH)
|
|
CHOICE_ANSWER = """(async () => {@HELPERS@@WATCH@
|
|
const closed = [bar().open, all("button[data-channel]", bar()).filter((button) => button.checkVisibility()).length];
|
|
const card = await until(() => all("#main .inbox-list > li").find((li) => li.textContent.includes("@QUESTION@")), 8000);
|
|
if (!card) {
|
|
return {error: text(document.getElementById("main"))};
|
|
}
|
|
const option = all("button.option", card).find((button) => text(button.querySelector("strong")) === "Wait");
|
|
const title = option.title;
|
|
const shown = new Set(all("#toasts .toast"));
|
|
option.click();
|
|
const toast = await fresh(shown, "Choice: Wait");
|
|
const gone = @SIGNS@ ? Boolean(await until(() => !all("#main .inbox-list > li").some((li) => li.textContent.includes("@QUESTION@")), 20000)) : null;
|
|
return {title, asked, posted, toast, gone, closed, ...fits()};
|
|
})()""".replace("@HELPERS@", HELPERS).replace("@WATCH@", WATCH)
|
|
TASKS_FIT = """(async () => {@HELPERS@
|
|
await until(() => document.getElementById("choice-request") && document.querySelector("#main .tasks-body > *"), 8000);
|
|
document.getElementById("toasts").replaceChildren();
|
|
await sleep(300);
|
|
return {
|
|
hash: location.hash,
|
|
bar: all("#choice-request button[data-channel]").map((button) => button.dataset.channel),
|
|
rows: toolbarRows(),
|
|
layout: taskLayout(),
|
|
columns: all("#main .task-column").map((column) => column.dataset.column),
|
|
choices: all("#main [data-column], #main .group-title, #main h2, #main h3").filter((node) => node.dataset.column === "choices" || text(node) === "Choices").length,
|
|
tall: document.documentElement.scrollHeight > window.innerHeight,
|
|
wide: document.documentElement.scrollWidth > window.innerWidth + 1,
|
|
};
|
|
})()""".replace("@HELPERS@", HELPERS)
|
|
CHOICE_REQUEST = "send me your open decisions as choices"
|
|
SLOW ="seq -f 'Row %g' 1 60; sleep 4; seq -f 'Row %g' 61 80; sleep 4; echo finished"
|