From 1f8f17b182fd0e70a6febc0cd7ff0481cfdf8fca Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 13 Nov 2026 20:40:57 +0000 Subject: [PATCH] test(e2e): follow 004's browser-side speech settings in the bubble tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requirement 004 (acf3925) moved speech on, classes and muted into each browser's localStorage and gave the speech tool a second argument admit; the bubble-faces fixture still saved the old hub settings and stubbed the one-argument tool, which settings.py now refuses. The fixture saves only bubbles, stubs (body, admit) and sets the radio to Silence with mayday and security through a start-up script. W6's long row moves from security to broadcast, the class 004 switched W6 to, so the browser picks it again. 🎯 Fix: 95 % 💥 Break: 2 % 💸 Cost: – ⏱️ Time: – 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 --- tests/e2e/test_hub_bubble_faces_e2e.py | 14 +++++++++++--- tests/e2e/test_workbench_w6_e2e.py | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/e2e/test_hub_bubble_faces_e2e.py b/tests/e2e/test_hub_bubble_faces_e2e.py index 79bc574..b155793 100644 --- a/tests/e2e/test_hub_bubble_faces_e2e.py +++ b/tests/e2e/test_hub_bubble_faces_e2e.py @@ -6,6 +6,7 @@ import shutil import sys import time import unittest +from collections.abc import Callable from pathlib import Path from unittest import mock @@ -21,6 +22,13 @@ WIDTH, HEIGHT = 1366, 768 CUE = "front" SPEAKERS = ("Skills session", "Stage", "Docs") SAID = "disk almost full on the build host so rotate the logs and retry the gate before the next push" +SILENT = """() => { + try { + localStorage.setItem("kvb-orchestrator.radio", JSON.stringify({mode: "silence", classes: ["mayday", "security"], muted: []})); + } catch (error) { + return; + } +}""" SPAWN = """ const agentChart = () => document.querySelector('#main svg.ancestry[aria-label="Ancestry: operator, chair, sessions, subagents"]'); const agentNodes = () => all("g.ancestry-node", agentChart()).map((node) => { @@ -166,9 +174,9 @@ class TestHubBubbleFrontAndSpawnFaces(HubCase): }) self.subagents(now) hub = self.httpd.hub - hub.settings.put({**hub.settings.get(), "bubbles": True, "speech": {"on": False, "classes": ["mayday", "security"], "muted": []}}, hub.settings.get()) + hub.settings.put({**hub.settings.get(), "bubbles": True}, hub.settings.get()) - def synthesize(body: bytes) -> bytes: + def synthesize(body: bytes, admit: Callable[[str], None]) -> bytes: if json.loads(body)["text"] == CUE: rows = [{"ts": time.time(), "from": name, "to": [], "text": f"{name}: {SAID}, {SAID}", "class": "security", "v": 2} for name in SPEAKERS] with (self.council / "news.jsonl").open("a", encoding="utf-8") as handle: @@ -222,7 +230,7 @@ class TestHubBubbleFrontAndSpawnFaces(HubCase): self.assertNotEqual(following["speaker"], following["first"]) def test_chromium_keeps_the_speaking_bubble_in_front_and_draws_faces_in_the_spawn_ancestry(self): - data = self.drive(self.steps(), None) + data = self.drive(self.steps(), None, init=SILENT) (OUT / "chromium-bubble-faces.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], []) self.check(data) diff --git a/tests/e2e/test_workbench_w6_e2e.py b/tests/e2e/test_workbench_w6_e2e.py index 20b5df2..eb093ee 100644 --- a/tests/e2e/test_workbench_w6_e2e.py +++ b/tests/e2e/test_workbench_w6_e2e.py @@ -247,7 +247,7 @@ class TestWorkbenchBubbles(HubCase): word = json.loads(body)["text"] if word == f"{CUE}-long": with (self.council / "news.jsonl").open("a", encoding="utf-8") as handle: - handle.write(self.jsonl([{"ts": time.time(), "from": "Stage", "to": [], "text": LONG, "class": "security", "v": 2}])) + handle.write(self.jsonl([{"ts": time.time(), "from": "Stage", "to": [], "text": LONG, "class": "broadcast", "v": 2}])) elif word.startswith(CUE): now = time.time() rows = [