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>
90 lines
4.5 KiB
Python
90 lines
4.5 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
|
|
from hub_case import HubCase
|
|
from hub_support import ASK, OPTIONS, iso
|
|
|
|
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-stream-keep-shots"))
|
|
COMMAND = "git commit -m 'stream keeps typing'"
|
|
QUESTION = "Merge the stream fix?"
|
|
TYPED = "rebase onto main first"
|
|
LINES = 300
|
|
DIFF = [{"path": "long.txt", "status": "M", "mode": "100644", "additions": LINES, "deletions": 0, "patch": f"@@ -0,0 +1,{LINES} @@\n" + "\n".join(f"+line {n}" for n in range(LINES)), "note": ""}]
|
|
PROBE = """(async () => {@HELPERS@
|
|
const askOf = () => all("#main .feed > li.k-ask").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".diff-scroll"));
|
|
const choiceOf = () => all("#main .feed > li.k-decision").find((li) => li.textContent.includes(@QUESTION@) && li.querySelector(".option.other input"));
|
|
const rows = await until(() => (askOf() && choiceOf() ? [askOf(), choiceOf()] : null), 10000);
|
|
if (!rows) {
|
|
return {error: text(document.getElementById("main"))};
|
|
}
|
|
const [ask, choice] = rows;
|
|
ask.dataset.probe = "old";
|
|
choice.dataset.probe = "old";
|
|
const scroller = ask.querySelector(".diff-scroll");
|
|
const field = choice.querySelector(".option.other input");
|
|
scroller.scrollTop = 200;
|
|
field.focus();
|
|
field.value = @TYPED@;
|
|
field.dispatchEvent(new Event("input", {bubbles: true}));
|
|
field.setSelectionRange(6, 6);
|
|
const top = scroller.scrollTop;
|
|
all("#main .chip").find((chip) => text(chip) === "Transcripts").click();
|
|
const redrawn = await until(() => {
|
|
const [now, typed] = [askOf(), choiceOf()];
|
|
return now && typed && now.dataset.probe !== "old" && typed.dataset.probe !== "old" ? [now, typed] : null;
|
|
}, 15000);
|
|
if (!redrawn) {
|
|
return {error: "the stream never redrew", top};
|
|
}
|
|
const again = redrawn[1].querySelector(".option.other input");
|
|
return {top, after: redrawn[0].querySelector(".diff-scroll").scrollTop, focused: document.activeElement === again, value: again.value, caret: [again.selectionStart, again.selectionEnd]};
|
|
})()"""
|
|
|
|
|
|
class TestStreamKeepsTyping(HubCase):
|
|
drive = base.OrchestratorE2ECase.drive
|
|
|
|
def setUp(self):
|
|
super().setUp()
|
|
now = time.time()
|
|
self.write_council({"work/s1/claim.json": {"office": "work/s1", "session": "s1", "runtime": "claude", "name": "Skills session", "since": iso(now - 86400), "beat": now, "work": "stream"}})
|
|
status, _, body = self.post_json("/api/asks", {**ASK, "command": COMMAND, "session": "s1", "diff": DIFF}, self.local())
|
|
self.assertEqual(status, 201, body)
|
|
decided = self.tool("decision_request", {"question": QUESTION, "options": OPTIONS, "agent": "Skills session", "recommended": ""})
|
|
self.assertFalse(decided["isError"], decided)
|
|
OUT.mkdir(parents=True, exist_ok=True)
|
|
|
|
def check(self, browser: str, driver: str, binary: str) -> None:
|
|
script = PROBE.replace("@HELPERS@", base.HELPERS).replace("@COMMAND@", json.dumps(COMMAND)).replace("@QUESTION@", json.dumps(QUESTION)).replace("@TYPED@", json.dumps(TYPED))
|
|
steps = [{"width": 1366, "height": 768, "url": f"http://localhost:{self.port}/?1366#stream", "wait": 1500, "probe": script, "shot": str(OUT / f"{browser}-1366-stream.png")}]
|
|
data = self.drive(steps, None, driver, binary)
|
|
(OUT / f"{browser}-stream.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
|
|
self.assertEqual([error for error in data["errors"] if "(style-src-elem)" not in error and "/favicon.ico" not in error], [])
|
|
found = data["results"][0]
|
|
self.assertNotIn("error", found, found)
|
|
self.assertGreater(found["top"], 0, found)
|
|
self.assertEqual((found["after"], found["focused"], found["value"], found["caret"]), (found["top"], True, TYPED, [6, 6]), found)
|
|
|
|
@unittest.skipUnless(shutil.which(os.environ.get("CHROMIUM", "chromium")), "no Chromium")
|
|
def test_chromium_keeps_the_typed_answer_its_focus_and_the_diff_scroll_across_a_stream_redraw(self):
|
|
self.check("chromium", "cdp.mjs", os.environ.get("CHROMIUM", "chromium"))
|
|
|
|
@unittest.skipUnless(shutil.which(os.environ.get("FIREFOX", "firefox")), "no Firefox")
|
|
def test_firefox_keeps_the_typed_answer_its_focus_and_the_diff_scroll_across_a_stream_redraw(self):
|
|
self.check("firefox", "bidi.mjs", os.environ.get("FIREFOX", "firefox"))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|