Files
skills/tests/e2e/test_match_wasd_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

112 lines
4.5 KiB
Python

from __future__ import annotations
import json
import os
import shutil
import sys
import unittest
from pathlib import Path
from unittest import mock
HERE = Path(__file__).resolve().parent
sys.path[:0] = [str(HERE.parent), str(HERE)]
import test_match_release_card_e2e as deck
from kvb_orchestrator import batches
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-055-shots"))
WASD = """(async () => {@HELPERS@@CARD@@STEPS@
await screenShown(8000);
if (!(await until(card, 8000))) {
return {error: text(document.getElementById("main")).slice(0, 300)};
}
await sleep(300);
const front = () => (card() ? card().dataset.card : null);
const tally = () => text(document.querySelector("#main .match-tally"));
const press = async (name) => {
const was = front();
key(name);
await until(() => front() !== was, 3000);
await sleep(250);
return front();
};
const seen = [front()];
seen.push(await press("d"));
seen.push(await press("w"));
seen.push(await press("d"));
const decided = tally();
const undone = [await press("s"), await press("s"), await press("s")];
const cleared = tally();
for (let tries = 0; tries < 4 && !card().querySelector(".match-file tr[data-line]"); tries += 1) {
await press("w");
}
const row = card().querySelector(".match-file tr[data-line]");
let typed = null;
if (row) {
const spot = row.getBoundingClientRect();
row.dispatchEvent(new MouseEvent("contextmenu", {bubbles: true, cancelable: true, clientX: spot.left + 40, clientY: spot.top + 4, button: 2}));
const field = await until(() => card().querySelector(".match-comment textarea"), 3000);
const was = front();
field.focus();
field.dispatchEvent(new KeyboardEvent("keydown", {key: "d", bubbles: true, cancelable: true}));
await sleep(500);
typed = {front: front() === was, tally: tally()};
card().querySelector(".match-comment .btn.ghost").click();
}
key("a");
const sheet = Boolean(await until(() => document.querySelector(".sheet-box .match-feedback"), 3000));
document.querySelector(".sheet-box .btn.ghost").click();
await sleep(300);
for (let tries = 0; tries < 4 && (front() === "@RED@" || card().dataset.stale === "true"); tries += 1) {
await press("w");
}
await press("d");
const lap = [front()];
for (let step = 0; step < 8; step += 1) {
lap.push(await press("w"));
}
while (front() !== "release") {
await press("w");
}
const onRelease = {a: await press("a")};
document.querySelector("#main .match-open-overview").click();
await until(releasing, 3000);
onRelease.w = await press("w");
onRelease.s = await press("s");
window.e2eSubmits.length = 0;
key("d");
await until(() => window.e2eSubmits.length, 20000);
onRelease.d = window.e2eSubmits;
return {seen, decided, undone, cleared, typed, sheet, lap, onRelease};
})()"""
@unittest.skipUnless(shutil.which(os.environ.get("CHROMIUM", "chromium")), "no Chromium")
class TestMatchWasd(deck.ReleaseDeck):
def test_chromium_runs_the_deck_with_wasd_undoes_step_by_step_and_brings_the_release_card_once_a_lap(self):
OUT.mkdir(parents=True, exist_ok=True)
step = {"width": 1920, "height": 1080, "url": f"{self.base}?wasd#tasks/match", "wait": 1500, "shot": str(OUT / "chromium-wasd.png"), "probe": deck.probe(WASD, red=f"review:{self.red}")}
with mock.patch.object(batches, "UNDO", 0.3):
data = self.drive([step], self.authenticator(), init=deck.INIT)
(OUT / "chromium-wasd.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], [])
found = data["results"][0]
self.assertNotIn("error", found, found)
first, second, third, _ = found["seen"]
self.assertEqual(found["decided"], "2", found)
self.assertEqual(found["undone"], [third, second, first], found)
self.assertEqual(found["cleared"], "0", found)
self.assertEqual(found["typed"], {"front": True, "tally": "0"}, found)
self.assertTrue(found["sheet"], found)
lap = found["lap"]
period = lap.index(lap[0], 1)
self.assertEqual(lap[period:], lap[: len(lap) - period], found)
self.assertEqual(lap[:period].count("release"), 1, found)
self.assertNotIn("release", [found["onRelease"]["a"], found["onRelease"]["w"]], found)
self.assertEqual(found["onRelease"]["s"], "release", found)
self.assertEqual(len(found["onRelease"]["d"]), 1, found)
if __name__ == "__main__":
unittest.main()