fix(hub): tests follow requirement 030 and the line comments, dead ask answer path removed
🧪 Test / 🧪 Lock + lint (push) Waiting to run

Requirement 030 answers a permission ask with Grant and Deny only, so the
ask branch of choiceOf, answerAsk, askDialog, ALLOW and TELL had no caller
left; they are removed. test_ask_answers_e2e now denies one ask with Deny and
one through Deny via with a typed reason, both by post to the requester;
test_stream_keeps_typing_e2e types into a named-option decision while an
ask keeps its diff scroll. The grant-mode and inbox-gone harnesses load
page-diff.js (and page-deny.js) instead of missing lineNotes, the slash
marker test names the new Comment field, and the line-comment e2e expect the
requester and radio commands the hub really sends. The help line no longer
reads as an agent calling an agent and uses an ASCII minus for the zoom keys.

Evidence: tests/e2e 146 OK, make test 2123 OK with ruff, shellcheck and
markdownlint clean, MEDUSA 100 % over 624729d..this tree.

🎯 Fix: 96 %
💥 Break: 2 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 94
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-25 08:29:50 +00:00
1 parent 2722cda1b5
commit d3bc54f401
11 files changed
+45 -44

No files matched your search

+18 -12
View File
@@ -13,22 +13,26 @@ sys.path[:0] = [str(HERE.parent), str(HERE)]
import hub_e2e_kit as base
from hub_case import HubCase
from hub_support import ASK, iso
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 rowOf = () => all("#main .feed > li.k-ask").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".diff-scroll") && li.querySelector(".option.other input"));
const row = await until(rowOf, 10000);
if (!row) {
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"))};
}
row.dataset.probe = "old";
const scroller = row.querySelector(".diff-scroll");
const field = row.querySelector(".option.other input");
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@;
@@ -36,14 +40,14 @@ PROBE = """(async () => {@HELPERS@
field.setSelectionRange(6, 6);
const top = scroller.scrollTop;
const redrawn = await until(() => {
const now = rowOf();
return now && now.dataset.probe !== "old" ? now : null;
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.querySelector(".option.other input");
return {top, after: redrawn.querySelector(".diff-scroll").scrollTop, focused: document.activeElement === again, value: again.value, caret: [again.selectionStart, again.selectionEnd]};
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]};
})()"""
@@ -56,10 +60,12 @@ class TestStreamKeepsTyping(HubCase):
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("@TYPED@", json.dumps(TYPED))
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")