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

+19 -11
View File
@@ -18,18 +18,25 @@ from kvb_orchestrator import batches, skill_scripts
TYPED = "run make test first"
ANSWER = """(async () => {@HELPERS@
const row = await until(() => all("#main .inbox-list > li").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".options button.option")), 10000);
const row = await until(() => all("#main .inbox-list > li").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".deny-split")), 10000);
if (!row) {
return {error: text(document.getElementById("main"))};
}
const shown = new Set(all("#toasts .toast"));
const options = all(".options button.option", row).length;
if (@TYPED@) {
row.querySelector(".option.other input").value = @TYPED@;
row.querySelector(".option.other button[type=submit]").click();
all(".deny-split button", row).find((button) => name(button) === "Deny via …").click();
const reason = await until(() => document.querySelector(".sheet-box .deny-reason textarea"), 4000);
if (!reason) {
return {error: "no Deny via sheet"};
}
reason.value = @TYPED@;
document.querySelector('.sheet-box .deny-channels input[value="post"]').click();
all(".sheet-box .actions button").find((button) => text(button) === "Deny").click();
} else {
all(".options button.option", row).find((option) => text(option.querySelector("strong")) === "No").click();
all(".deny-split button", row).find((button) => name(button) === "Deny").click();
}
return {toast: await until(() => all("#toasts .toast").filter((box) => !shown.has(box)).map(text).find((entry) => entry.startsWith("Denial")), 20000)};
return {options, toast: await until(() => all("#toasts .toast").filter((box) => !shown.has(box)).map(text).find((entry) => entry.startsWith("Denial")), 20000)};
})()"""
@@ -39,20 +46,21 @@ class TestAskAnswers(base.OrchestratorE2ECase):
script = ANSWER.replace("@HELPERS@", base.HELPERS).replace("@COMMAND@", json.dumps(command)).replace("@TYPED@", json.dumps(typed))
return {"width": 1366, "height": 768, "url": f"http://localhost:{self.port}/#stream/inbox", "wait": 1200, "probe": script, "shot": self.shot(f"1366-ask-answer-{'typed' if typed else 'no'}")}
def test_chromium_no_and_a_typed_answer_deny_the_ask_and_tell_its_requester(self):
def test_chromium_deny_and_deny_via_with_a_reason_deny_the_boolean_ask_and_tell_its_requester(self):
self.create_ask({**ASK, "command": "make clean", "timeout": 3600})
with mock.patch.object(batches, "UNDO", 0.3):
data = self.drive([self.step("make deploy", ""), self.step("make clean", TYPED)], self.authenticator())
(OUT / "chromium-ask-answers.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
for found in data["results"]:
self.assertNotIn("error", found, found)
self.assertEqual(found["options"], 0, found)
self.assertTrue(found["toast"].startswith("Denial (Post): Bash: make"), found)
self.settle(lambda: all(ask["status"] == "denied" for ask in self.httpd.hub.asks.listed()))
(OUT / "chromium-ask-answers.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], [])
for found in data["results"]:
self.assertNotIn("error", found, found)
self.assertTrue(found["toast"].startswith("Denial (Post): Bash: make"), found)
asks = {ask["command"]: (ask["status"], ask["channel"], ask["reason"]) for ask in self.httpd.hub.asks.listed()}
self.assertEqual(asks, {"make deploy": ("denied", "post", ""), "make clean": ("denied", "post", TYPED)})
radio = [args for script, args in self.scripts.calls if script == skill_scripts.RADIO]
self.assertEqual([args[:4] for args in radio], [["send", "post", "--to", "Skills session"]] * 2)
self.assertEqual([args[:3] for args in radio], [["post", "--to", "Skills session"]] * 2)
if __name__ == "__main__":