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>
148 lines
7.3 KiB
Python
148 lines
7.3 KiB
Python
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import shutil
|
|
import sys
|
|
import time
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
sys.path[:0] = [str(HERE.parent), str(HERE)]
|
|
|
|
import hub_e2e_kit as base
|
|
import test_home_bookmarks_e2e as bm
|
|
import test_home_tile_open_e2e as opened
|
|
import test_workbench_w4_e2e as w4
|
|
from hub_case import HubCase
|
|
|
|
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-044-shots"))
|
|
PANELS = [
|
|
"stream", "radio-log", "radio", "radio-device", "radio-speak", "agents/orbit", "agents/chord", "agents/swimlane", "agents/3d", "agents/tree", "agents/hierarchy",
|
|
"artifacts/orbit", "artifacts/chord", "artifacts/swimlane", "artifacts/3d", "artifacts/tree", "tasks/list", "tasks/board", "tasks/rasci", "tasks/gantt", "tasks/burn",
|
|
"tasks/3d", "tasks/operator", "tasks/match", "agents/order", "resources-accounts",
|
|
]
|
|
NAMED = {"panel:radio-log": "radio-card", "panel:radio-device": "radio-card", "panel:radio-speak": "radio-card", "panel:tasks/gantt": "gantt-scroll"}
|
|
FLAT = """(async () => {@HELPERS@@HOME@@KIT@
|
|
await go("home");
|
|
await until(() => !all("#main .home-tile .empty h2").some((title) => text(title).endsWith("…")), 8000);
|
|
await sleep(1200);
|
|
const boxed = (node) => {
|
|
const look = getComputedStyle(node);
|
|
return parseFloat(look.borderTopWidth) > 0 || look.backgroundColor !== "rgba(0, 0, 0, 0)" || look.backgroundImage !== "none";
|
|
};
|
|
const area = (node) => node.offsetWidth * node.offsetHeight;
|
|
const left = (body) => {
|
|
for (let node = body.firstElementChild; node;) {
|
|
if (node.classList.contains("home-flat")) {
|
|
return null;
|
|
}
|
|
if (boxed(node)) {
|
|
return node.className;
|
|
}
|
|
const biggest = [...node.children].reduce((best, child) => (!best || area(child) > area(best) ? child : best), null);
|
|
node = biggest && area(biggest) >= 0.75 * area(node) ? biggest : null;
|
|
}
|
|
return null;
|
|
};
|
|
const found = all("#main .home-tile").map((node) => {
|
|
const body = node.querySelector(".home-body");
|
|
const flat = body.querySelector(".home-flat");
|
|
const look = flat ? getComputedStyle(flat) : null;
|
|
const pad = parseFloat(getComputedStyle(body).paddingBottom);
|
|
const tail = [];
|
|
for (let node = flat; node; node = node.nextElementSibling) {
|
|
tail.push(node.getBoundingClientRect().bottom);
|
|
}
|
|
const gap = flat ? body.getBoundingClientRect().top + body.clientTop + body.clientHeight - pad - Math.max(...tail) : null;
|
|
const heading = flat ? flat.querySelector(":scope > .radio-card-head > .group-title") : null;
|
|
return {
|
|
key: node.dataset.pin, flat: flat ? [...flat.classList].filter((name) => name !== "home-flat") : null, boxLeft: left(body),
|
|
border: look ? look.borderTopWidth : null, background: look ? look.backgroundColor : null, gap: gap === null ? null : Math.round(gap * 10) / 10,
|
|
heading: heading ? heading.getClientRects().length > 0 : null,
|
|
};
|
|
});
|
|
return {tiles: found, wide: document.documentElement.scrollWidth > innerWidth + 1};
|
|
})()"""
|
|
FULL = """(async () => {@HELPERS@@HOME@
|
|
await go("tasks/gantt");
|
|
const gantt = await until(() => document.querySelector("#main .gantt-scroll"), 8000);
|
|
const ganttBorder = gantt ? getComputedStyle(gantt).borderTopWidth : null;
|
|
document.getElementById("radio-open").click();
|
|
const log = await until(() => document.querySelector('#radio-spot:not([hidden]) [data-panel="radio-log"]'), 8000);
|
|
const device = document.querySelector('#radio-spot:not([hidden]) [data-panel="radio-device"]');
|
|
const out = {gantt: ganttBorder, log: log ? getComputedStyle(log).borderTopWidth : null, device: device ? getComputedStyle(device).borderTopWidth : null};
|
|
document.getElementById("radio-open").click();
|
|
return out;
|
|
})()"""
|
|
SHOW = """(async () => {@HELPERS@@HOME@
|
|
await go("home");
|
|
const found = await until(() => tile("@KEY@"), 8000);
|
|
found.scrollIntoView({block: "center"});
|
|
await sleep(400);
|
|
return {key: found.dataset.pin};
|
|
})()"""
|
|
|
|
|
|
def probe(template: str, **names: str) -> str:
|
|
return opened.probe(template.replace("@PANELS@", json.dumps(PANELS)), **names)
|
|
|
|
|
|
@unittest.skipUnless(shutil.which(os.environ.get("CHROMIUM", "chromium")), "no Chromium")
|
|
class TestHomeFlatWidgets(HubCase):
|
|
seed = base.OrchestratorE2ECase.seed
|
|
subagents = base.OrchestratorE2ECase.subagents
|
|
drive = base.OrchestratorE2ECase.drive
|
|
sample = w4.TestWorkbenchResources.sample
|
|
|
|
def setUp(self):
|
|
super().setUp()
|
|
OUT.mkdir(parents=True, exist_ok=True)
|
|
self.seed()
|
|
now = int(time.time())
|
|
self.start = now - now % 60 - w4.ROWS * 60
|
|
folder = self.kept / "resources"
|
|
folder.mkdir()
|
|
(folder / "samples.jsonl").write_text(self.jsonl([self.sample(index) for index in range(w4.ROWS)]), encoding="utf-8")
|
|
|
|
def steps(self) -> list[dict]:
|
|
steps = []
|
|
for width, height in ((1920, 1080), (390, 844)):
|
|
page = f"{self.base}?{width}"
|
|
steps += [
|
|
{"width": width, "height": height, "url": f"{page}-clear#stream", "wait": 600, "probe": bm.CLEAR, "shot": None},
|
|
{"width": width, "height": height, "url": f"{page}-seed#stream", "wait": 1200, "probe": probe(opened.SEED), "shot": None},
|
|
{"width": width, "height": height, "url": f"{page}-flat#home", "wait": 1500, "probe": probe(FLAT), "shot": str(OUT / f"chromium-{width}-home.png")},
|
|
{"width": width, "height": height, "url": f"{page}-full#stream", "wait": 1200, "probe": probe(FULL), "shot": None},
|
|
]
|
|
steps += [{"width": width, "height": height, "url": None, "wait": 0, "probe": probe(SHOW, key=key), "shot": str(OUT / f"chromium-{width}-{key.split(':')[1].replace('/', '-')}.png")} for key in NAMED]
|
|
return steps
|
|
|
|
def test_chromium_flattens_every_widget_whose_content_is_a_box_and_keeps_the_box_in_full_view_at_1920_and_390(self):
|
|
data = self.drive(self.steps(), None)
|
|
(OUT / "chromium-flat.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], [])
|
|
per_width = len(data["results"]) // 2
|
|
for index, width in enumerate((1920, 390)):
|
|
flat, full = data["results"][index * per_width + 2], data["results"][index * per_width + 3]
|
|
self.assertFalse(flat["wide"], flat)
|
|
tiles = {tile["key"]: tile for tile in flat["tiles"]}
|
|
self.assertEqual(len(tiles), len(PANELS) + 7, sorted(tiles))
|
|
for key, tile in tiles.items():
|
|
with self.subTest(width=width, key=key):
|
|
self.assertIsNone(tile["boxLeft"], tile)
|
|
if tile["flat"] is not None:
|
|
self.assertEqual((tile["border"], tile["background"]), ("0px", "rgba(0, 0, 0, 0)"), tile)
|
|
self.assertLessEqual(abs(tile["gap"]), 2, tile)
|
|
for key, box in NAMED.items():
|
|
with self.subTest(width=width, named=key):
|
|
self.assertIn(box, tiles[key]["flat"] or [], tiles[key])
|
|
for key in ("panel:radio-log", "panel:radio-device"):
|
|
self.assertFalse(tiles[key]["heading"], tiles[key])
|
|
self.assertEqual(full, {"gantt": "1px", "log": "1px", "device": "1px"}, full)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|