test(orchestrator): close the 001 and 003 acceptance gaps with named tests

Ticks in 001 and 003 now name a test that passes on the final code: a 21-screen sweep in Chromium and Firefox at 1920, 1366 and 390 (no page scroll, every scroller reaches its last child, nothing clipped), the sessions timer check, the pkgmgr branch tree file, the forecast scope, the resources charts, bubble schedule, assets, stop and reading time, and the kanban and cleanup executors. Scrolling screens move into a pane so only main scrolls. The cleanup sheet keeps its dry-run note as visible text, now pinned by a test. The W6 fade check stamps removal from a MutationObserver against a timer started on the same mutation. Boxes whose final browser run is still owed stay unticked.

🎯 Fix: 95 %
💥 Break: 4 %
💸 Cost: 100 %
⏱️ Time: 100 %
🛡️ Security: 100 %
🏆 Score: 91
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-13 09:32:39 +00:00
1 parent 3418738993
commit b202e021c7
11 files changed
+687 -26

No files matched your search

+142 -8
View File
@@ -20,6 +20,10 @@ OUT = Path(os.environ.get("E2E_OUT", "/tmp/workbench-w6-shots"))
CUE = "e2e-bubbles"
FIRST = "Disk almost full on the build host, the gate waits for space now"
SECOND = "Gate green for the merge"
LONG = (
"Reconfiguration of the infrastructure monitoring dashboards requires acknowledgement from administrators before synchronization across distributed environments, "
"otherwise notifications accumulate indefinitely throughout overnight maintenance windows affecting availability measurements considerably and delaying deployments"
)
READING = max(1.5, len(FIRST.split()) * 60 / 180)
EARLY = 0.1
LATE = 2.0
@@ -27,6 +31,8 @@ VIEWS = {1920: "agents/orbit", 1366: "stream/radio", 390: "agents/hierarchy"}
SECOND_FROM = {1920: "Skills", 1366: "Skills", 390: "Docs"}
SECOND_ANCHORED = {1920: True, 1366: False, 390: False}
CALM = [{"name": "prefers-reduced-motion", "value": "reduce"}]
FADE_MS = 400
FADE_SLACK = 50
GUARD = """() => {
window.e2eViolations = [];
document.addEventListener("securitypolicyviolation", (event) => window.e2eViolations.push(`${event.violatedDirective} ${event.blockedURI}`));
@@ -38,18 +44,30 @@ READ = """
const live = () => all(".speech-bubble:not(.leaving)", layer);
const speaking = () => live().find((node) => node.dataset.state === "speaking") || null;
const waiting = () => live().find((node) => node.dataset.state === "waiting") || null;
const visible = (box) => box.width > 0 && box.height > 0 && box.right > 0 && box.bottom > 0 && box.left < innerWidth && box.top < innerHeight;
const face = (who) => [...document.querySelectorAll(`[data-face="${CSS.escape(who)}"]`)].map((node) => node.getBoundingClientRect()).find(visible) || null;
const read = (node) => {
if (!node) {
return null;
}
const style = getComputedStyle(node);
const box = node.getBoundingClientRect();
const scale = new DOMMatrix(style.transform).a;
const anchor = face(node.dataset.who);
return {
who: node.dataset.who, scale: Number(node.dataset.scale), state: node.dataset.state, words: Number(node.dataset.words), text: text(node.querySelector(".bubble-words")),
anchored: node.parentElement === layer, rendered: Math.round(new DOMMatrix(style.transform).a * 100) / 100, transition: style.transitionProperty, font: style.fontFamily,
anchored: node.parentElement === layer, rendered: Math.round(scale * 100) / 100, transition: style.transitionProperty, font: style.fontFamily,
box: {left: box.left, top: box.top, right: box.right, bottom: box.bottom},
aim: {tip: (box.left + box.right) / 2 + (parseFloat(node.style.getPropertyValue("--tail")) || 0) * scale, bottom: box.bottom, height: box.bottom - box.top,
mid: anchor ? anchor.left + anchor.width / 2 : null, top: anchor ? anchor.top : null},
bar: node.parentElement.classList.contains("bubble-bar"),
};
};
const frame = () => {
const css = getComputedStyle(layer);
const bar = layer.querySelector(".bubble-bar").getBoundingClientRect();
return {position: css.position, events: css.pointerEvents, bar: Math.round(innerHeight - bar.bottom)};
};
const cue = (word) => fetch("/api/tts", {method: "POST", headers: {"X-Kvb-Orchestrator": "1", "Content-Type": "application/json"}, body: JSON.stringify({text: word, voice: ""}), cache: "no-store"});
"""
BUBBLES_ON = """(async () => {@HELPERS@@READ@
@@ -59,10 +77,29 @@ BUBBLES_ON = """(async () => {@HELPERS@@READ@
t: performance.now(), who: node.dataset.who, state: node.dataset.state || null, words: Number(node.dataset.words || 0),
leaving: node.classList.contains("leaving"), read: node.dataset.read === undefined ? null : Number(node.dataset.read), removed: !node.isConnected,
});
window.e2eFades = [];
const watched = new Map();
const fading = (node) => {
const css = getComputedStyle(node);
const times = css.transitionDuration.split(", ");
const fade = {who: node.dataset.who, removed: null, reference: null, seconds: parseFloat(times[css.transitionProperty.split(", ").indexOf("opacity")] ?? "NaN"), start: performance.now()};
watched.set(node, fade);
window.setTimeout(() => {
fade.reference = Math.round(performance.now() - fade.start);
}, @FADE@);
window.e2eFades.push(fade);
};
new MutationObserver((records) => {
for (const record of records) {
const gone = [...record.removedNodes].filter((node) => node instanceof Element && node.matches(".speech-bubble") && !node.isConnected);
[...(record.type === "attributes" && record.target.matches(".speech-bubble") ? [record.target] : []), ...gone].forEach(note);
if (record.type === "attributes" && record.target.matches(".speech-bubble.leaving") && !watched.has(record.target)) {
fading(record.target);
}
gone.filter((node) => watched.has(node)).forEach((node) => {
const fade = watched.get(node);
fade.removed = Math.round(performance.now() - fade.start);
});
}
}).observe(layer, {subtree: true, childList: true, attributes: true, attributeFilter: ["class", "data-state", "data-words", "data-read"]});
toggle.click();
@@ -72,7 +109,7 @@ BUBBLES_ON = """(async () => {@HELPERS@@READ@
return {before, on, error: "no pair of bubbles", bubbles: live().map(read), toasts: all("#toasts .toast").map(text)};
}
await sleep(400);
return {before, on, first: read(speaking()), second: read(waiting())};
return {before, on, first: read(speaking()), second: read(waiting()), layer: frame()};
})()"""
BUBBLES_GROW = """(async () => {@HELPERS@@READ@
const log = window.e2eBubbleLog || [];
@@ -84,7 +121,9 @@ BUBBLES_GROW = """(async () => {@HELPERS@@READ@
await Promise.all((speaking() ? speaking().getAnimations() : []).map((animation) => animation.finished.catch(() => null)));
grown = read(speaking());
await until(() => mine().some((entry) => entry.removed), 4000);
await until(() => (window.e2eFades || []).some((entry) => entry.who === who && entry.removed !== null && entry.reference !== null), 2000);
}
const fading = (window.e2eFades || []).find((entry) => entry.who === who) || null;
const entries = mine();
const fade = entries.findIndex((entry) => entry.leaving);
const reading = entries.slice(0, fade < 0 ? entries.length : fade).filter((entry) => entry.state === "speaking").map((entry) => entry.words);
@@ -92,7 +131,7 @@ BUBBLES_GROW = """(async () => {@HELPERS@@READ@
return {
who, words: reading.filter((value, index) => value !== reading[index - 1]), read: left ? left.read : null,
seconds: start && left ? Math.round(left.t - start.t) / 1000 : null,
faded: fade > 0 && entries.slice(fade).every((entry) => entry.leaving), gone: entries.some((entry) => entry.removed), grown,
faded: fade > 0 && entries.slice(fade).every((entry) => entry.leaving), gone: entries.some((entry) => entry.removed), grown, fading,
};
})()"""
BUBBLES_DONE = """(async () => {@HELPERS@@READ@
@@ -100,6 +139,28 @@ BUBBLES_DONE = """(async () => {@HELPERS@@READ@
const faces = [...document.fonts].filter((face) => face.family.replace(/["']/g, "") === "Comic Neue").map((face) => face.status);
return {cleared, faces, hidden: layer.hidden, violations: window.e2eViolations || null};
})()"""
BUBBLES_LONG = """(async () => {@HELPERS@@READ@
await cue("@CUE@-long");
const node = await until(() => live().find((entry) => entry.dataset.state === "speaking" && text(entry.querySelector(".bubble-words")).startsWith("Reconfiguration")), 25000);
if (!node) {
return {error: "no long bubble", bubbles: live().map(read)};
}
const words = node.querySelector(".bubble-words");
const line = parseFloat(getComputedStyle(words).lineHeight);
const samples = [];
const end = Date.now() + 30000;
while (node.isConnected && Date.now() < end) {
samples.push({top: words.scrollTop, client: words.clientHeight, full: words.scrollHeight, count: Number(node.dataset.words), text: text(words)});
await sleep(40);
}
const total = Math.max(...samples.map((sample) => sample.count));
const final = samples.filter((sample) => sample.count === total);
return {
text: final.length ? final.at(-1).text : null, lines: Math.max(...samples.map((sample) => sample.client)) / line,
overflow: samples.some((sample) => sample.full > sample.client + line / 2), scrolled: samples.some((sample) => sample.top > 0),
gap: final.length ? Math.min(...final.map((sample) => sample.full - sample.client - sample.top)) : null, gone: !node.isConnected,
};
})()"""
BUBBLES_3D = """(async () => {@HELPERS@@READ@
const canvas = Boolean(await until(() => document.querySelector("#main .graph3d canvas"), 15000));
await until(() => {
@@ -115,9 +176,21 @@ BUBBLES_3D = """(async () => {@HELPERS@@READ@
if (!(await until(speaking, 25000))) {
return {canvas, error: "no bubble in 3D", bubbles: live().map(read)};
}
const first = read(speaking());
await sleep(500);
const later = read(speaking());
const scene = (window.e2eGraphs || []).at(-1);
const track = async () => {
await new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done)));
const node = speaking();
const found = read(node);
const entry = scene.graphData().nodes.find((item) => item.id === node.dataset.who);
const box = document.querySelector("#main .graph3d").getBoundingClientRect();
const at = entry ? scene.graph2ScreenCoords(entry.x, entry.y, entry.z) : null;
return {...found, projected: at ? {x: box.left + at.x, y: box.top + at.y} : null};
};
const first = await track();
const camera = scene.cameraPosition();
scene.cameraPosition({x: camera.z, y: camera.y, z: -camera.x});
await sleep(300);
const later = await track();
const graph = document.querySelector("#main .graph3d").getBoundingClientRect();
return {canvas, first, later, graph: {left: graph.left, top: graph.top, right: graph.right, bottom: graph.bottom}, mode: text(document.querySelector("#main .space-note"))};
})()"""
@@ -131,7 +204,7 @@ BUBBLES_KEPT = """(async () => {@HELPERS@@READ@
def probe(template: str, cue: str = CUE) -> str:
return template.replace("@HELPERS@", base.HELPERS).replace("@READ@", READ).replace("@CUE@", cue)
return template.replace("@HELPERS@", base.HELPERS).replace("@READ@", READ).replace("@CUE@", cue).replace("@FADE@", str(FADE_MS))
def quiet(found: dict) -> dict:
@@ -162,7 +235,10 @@ class TestWorkbenchBubbles(HubCase):
def synthesize(body: bytes) -> bytes:
word = json.loads(body)["text"]
if word.startswith(CUE):
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}]))
elif word.startswith(CUE):
now = time.time()
rows = [
{"ts": now - 0.01, "from": "Stage", "to": [], "text": FIRST, "class": "security", "v": 2},
@@ -189,18 +265,66 @@ class TestWorkbenchBubbles(HubCase):
{"width": width, "height": height, "url": None, "wait": 0, "probe": probe(BUBBLES_GROW), "shot": f"{shot}-grown.png", "media": media},
{"width": width, "height": height, "url": None, "wait": 0, "probe": probe(BUBBLES_DONE), "shot": None, "media": media},
]
if width == 1366:
steps.append({"width": width, "height": height, "url": None, "wait": 0, "probe": probe(BUBBLES_LONG), "shot": None, "media": media})
if three and width == 1366:
steps.append({"width": width, "height": height, "url": f"{self.base}?3d#agents/3d", "wait": 1500, "probe": probe(BUBBLES_3D), "shot": f"{shot}-3d.png"})
steps.append({"width": width, "height": height, "url": f"{self.base}?{width}-reloaded#{view}", "wait": 1200, "probe": probe(BUBBLES_KEPT), "shot": f"{shot}-off.png", "media": media})
if width == 1366:
steps += [
{"width": width, "height": height, "url": f"{self.base}?{width}-stream#stream", "wait": 1200, "probe": probe(BUBBLES_ON), "shot": f"{shot}-stream.png", "media": media},
{"width": width, "height": height, "url": None, "wait": 0, "probe": probe(BUBBLES_DONE), "shot": None, "media": media},
{"width": width, "height": height, "url": f"{self.base}?{width}-stream-reloaded#stream", "wait": 1200, "probe": probe(BUBBLES_KEPT), "shot": None, "media": media},
]
return steps
def aimed(self, found: dict, anchor: tuple[float, float] | None = None) -> None:
aim = found["aim"]
mid, top = anchor or (aim["mid"], aim["top"])
self.assertIsNotNone(mid, found)
self.assertAlmostEqual(aim["tip"], mid, delta=4, msg=found)
self.assertAlmostEqual(aim["bottom"], max(top - 4, 8 + aim["height"]), delta=4, msg=found)
def check(self, data: dict, browser: str, calm: bool, three: bool) -> None:
results = iter(data["results"])
for width, _ in base.WIDTHS:
on, grow, done = next(results), next(results), next(results)
long = next(results) if width == 1366 else None
solid = next(results) if three and width == 1366 else None
kept = next(results)
stream = [next(results), next(results), next(results)] if width == 1366 else None
first_key, second_key = self.keys["Stage"], self.keys[SECOND_FROM[width]]
with self.subTest(browser=browser, width=width, part="anchor"):
self.assertNotIn("error", on, on)
self.assertEqual(on["layer"]["position"], "fixed")
self.assertEqual(on["layer"]["events"], "none")
self.assertTrue(0 <= on["layer"]["bar"] <= 48, on["layer"])
self.aimed(on["first"])
if SECOND_ANCHORED[width]:
self.aimed(on["second"])
else:
self.assertEqual((on["second"]["bar"], on["second"]["aim"]["mid"]), (True, None), on["second"])
with self.subTest(browser=browser, width=width, part="fade"):
fading = grow["fading"]
self.assertIsNotNone(fading, grow)
self.assertIsNotNone(fading["reference"], fading)
self.assertIsNotNone(fading["removed"], fading)
self.assertTrue(0 <= fading["seconds"] <= FADE_MS / 1000 and (fading["seconds"] > 0 or (calm and width == 390)), fading)
self.assertLessEqual(fading["removed"], fading["reference"] + FADE_SLACK, fading)
if stream is not None:
with self.subTest(browser=browser, width=width, view="stream"):
shown, cleared, switched = stream
self.assertNotIn("error", shown, shown)
self.assertEqual((shown["before"], shown["on"]), (["false", True], True))
self.assertEqual((shown["first"]["who"], shown["first"]["scale"], shown["first"]["state"]), (first_key, 1, "speaking"), shown)
self.assertEqual((shown["second"]["scale"], shown["second"]["state"]), (0.8, "waiting"), shown)
for found in (shown["first"], shown["second"]):
if found["aim"]["mid"] is None:
self.assertEqual((found["anchored"], found["bar"]), (False, True), found)
else:
self.aimed(found)
self.assertTrue(quiet(cleared)["cleared"], cleared)
self.assertEqual(quiet(switched), {"kept": ["true", False, "Speech bubbles", "Speech bubbles"], "off": True, "display": "none", "bubbles": 0, "violations": []})
with self.subTest(browser=browser, width=width):
self.assertNotIn("error", on, on)
self.assertEqual((on["before"], on["on"]), (["false", True], True))
@@ -224,6 +348,12 @@ class TestWorkbenchBubbles(HubCase):
self.assertEqual(grown["text"], " ".join(SECOND.split()[: grown["words"]]))
self.assertEqual(quiet(done), {"cleared": True, "faces": ["loaded"], "hidden": False, "violations": []})
self.assertEqual(quiet(kept), {"kept": ["true", False, "Speech bubbles", "Speech bubbles"], "off": True, "display": "none", "bubbles": 0, "violations": []})
if long is not None:
with self.subTest(browser=browser, width=width, bubble="long"):
self.assertNotIn("error", long, long)
self.assertEqual((long["text"], long["overflow"], long["scrolled"], long["gone"]), (LONG, True, True, True), long)
self.assertTrue(5.5 < long["lines"] <= 6.05, long)
self.assertLessEqual(long["gap"], 2, long)
if solid is not None:
with self.subTest(browser=browser, view="3d"):
self.assertNotIn("error", solid, solid)
@@ -232,6 +362,10 @@ class TestWorkbenchBubbles(HubCase):
self.assertEqual((read["who"], read["anchored"]), (first_key, True), solid)
middle = (read["box"]["left"] + read["box"]["right"]) / 2
self.assertTrue(graph["left"] <= middle <= graph["right"] and graph["top"] - 16 <= read["box"]["bottom"] <= graph["bottom"], solid)
self.assertIsNotNone(read["projected"], solid)
self.aimed(read, (read["projected"]["x"], read["projected"]["y"] - 8))
moved = solid["later"]["projected"], solid["first"]["projected"]
self.assertGreater(abs(moved[0]["x"] - moved[1]["x"]) + abs(moved[0]["y"] - moved[1]["y"]), 20, solid)
self.assertFalse(self.httpd.hub.settings.get()["bubbles"])
def test_chromium_reads_two_rows_without_tts_as_growing_bubbles_keeps_the_switch_and_hides_the_layer_at_three_widths(self):