Files
skills/tests/e2e/test_done_rows_e2e.py
T
Kevin Veen-BirkenbachandClaude Opus 5.5 0fad1bfae3 feat: hub and skills requirements 032 to 063
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>
2026-11-26 08:44:15 +00:00

89 lines
4.9 KiB
Python

from __future__ import annotations
import json
import os
import shutil
import sys
import time
import unittest
from pathlib import Path
from unittest import mock
HERE = Path(__file__).resolve().parent
sys.path[:0] = [str(HERE.parent), str(HERE)]
import hub_e2e_kit as base
from hub_support import ASK
from kvb_orchestrator import batches
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-048-shots"))
DONE = """(async () => {@HELPERS@
const row = (ref) => document.querySelector(`#main .inbox-list > li[data-ref="${ref}"]`);
if (!(await until(() => row("@OPEN@") && document.querySelector("#main details.inbox-done"), 8000))) {
return {error: text(document.getElementById("main")).slice(0, 300)};
}
const fold = document.querySelector("#main details.inbox-done");
const done = all(".inbox-list > li", fold).map((li) => ({ref: li.dataset.ref, done: li.hasAttribute("data-done"), pill: all(".msg-meta .pill", li).map(text).includes("done"), opacity: Number(getComputedStyle(li).opacity)}));
const shown = {open: fold.open, summary: text(fold.querySelector("summary")), last: fold === document.querySelector("#main .inbox").lastElementChild, done,
boxes: all('#main .inbox-list .item input[type="checkbox"]').length};
await ViewStore.set("approval.mode", "select");
await until(() => row("@OPEN@") && row("@OPEN@").hasAttribute("aria-selected"), 10000);
const check = () => row("@OPEN@").querySelector("[aria-pressed]");
const state = () => [row("@OPEN@").getAttribute("aria-selected"), check() ? check().getAttribute("aria-pressed") : null];
const before = state();
check().click();
await until(() => state()[0] === "true", 3000);
const picked = state();
check().click();
await until(() => state()[0] === "false", 3000);
const cleared = state();
await cursorTo("@OPEN@");
await pressKey("x");
await until(() => state()[0] === "true", 3000);
const keyed = state();
await pressKey("x");
await until(() => state()[0] === "false", 3000);
await ViewStore.set("approval.mode", "direct");
fold.scrollIntoView({block: "center"});
return {...shown, before, picked, cleared, keyed, wide: document.documentElement.scrollWidth > innerWidth + 1};
})()"""
@unittest.skipUnless(shutil.which(os.environ.get("CHROMIUM", "chromium")), "no Chromium")
class TestDoneRows(base.OrchestratorE2ECase):
def setUp(self):
super().setUp()
OUT.mkdir(parents=True, exist_ok=True)
now = time.time()
greet = {"title": "echo greet", "workdir": str(self.outside), "description": "greets", "check": "manual", "status": "queued", "roles": {"Operator": "R", "Skills session": "A"}}
self.write_council({"rasci.json": {"operator/greet": greet}})
fields = {"task": "operator/greet", "command": "echo greet", "directory": str(self.outside), "sha256": "", "status": "done", "proof": None}
self.httpd.hub.jobs.add({**fields, "code": 0, "output": "greet\n", "created_ts": now - 20, "started": now - 19, "finished": now - 10, "dismissed": False})
self.open = f"ask:{self.create_ask({**ASK, 'command': 'make open', 'timeout': 3600})}"
held = self.create_ask({**ASK, "command": "make held", "timeout": 3600})
self.held = f"ask:{held}"
entries = [self.entry("ask", held, "", "")]
with mock.patch.object(batches, "UNDO", 120):
self.assertEqual(self.approve(entries, self.signed(entries, self.pin()))[0], 202)
self.base = f"http://{self.host}/"
def test_chromium_folds_held_and_ended_rows_under_done_and_selects_by_the_green_check_without_a_checkbox_at_1920_and_390(self):
probe = DONE.replace("@HELPERS@", base.HELPERS).replace("@OPEN@", self.open)
steps = [{"width": width, "height": height, "url": f"{self.base}?{width}#tasks/operator", "wait": 1500, "probe": probe, "shot": str(OUT / f"chromium-{width}-done-rows.png")} for width, height in ((1920, 1080), (390, 844))]
data = self.drive(steps, None)
(OUT / "chromium-done-rows.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
self.assertEqual([error for error in data["errors"] if "/favicon.ico" not in error], [])
for (width, _), found in zip(((1920, 1080), (390, 844)), data["results"], strict=True):
with self.subTest(width=width):
self.assertNotIn("error", found, found)
self.assertEqual((found["open"], found["summary"], found["last"], found["boxes"], found["wide"]), (False, "Done (2)", True, 0, False), found)
self.assertEqual(sorted(row["ref"] for row in found["done"]), sorted([self.held, "operator:operator/greet"]), found)
for row in found["done"]:
self.assertTrue(row["done"] and row["pill"], row)
self.assertLessEqual(row["opacity"], 0.5, row)
self.assertEqual((found["before"], found["picked"], found["cleared"], found["keyed"]), (["false", "false"], ["true", "true"], ["false", "false"], ["true", "true"]), found)
if __name__ == "__main__":
unittest.main()