diff --git a/skills/kvb-org-organize/scripts/watch.py b/skills/kvb-org-organize/scripts/watch.py index 8fe5367..bb88fdf 100755 --- a/skills/kvb-org-organize/scripts/watch.py +++ b/skills/kvb-org-organize/scripts/watch.py @@ -184,7 +184,7 @@ IN_USE = re.compile( r"image is being used by (?:running|stopped) container \S+$", re.MULTILINE, ) -OK, KEPT = "ok: ", "kept (in use): " +OK, KEPT_LINE = "ok: ", "kept (in use): " GUARD_REFUSED = 3 SHIM = '#!/bin/sh\nexec {python} -I {watch} guard {real} {report} "$@"\n' REFUSALS = { @@ -1415,12 +1415,12 @@ def remove_leftovers(prefix: list[str]) -> list[str]: for image in dict.fromkeys(fields[0] for fields in rows if fields[1:] == [NONE, NONE] and IMAGE_ID.fullmatch(fields[0])): code, _, err = run_step([*prefix, "rmi", image], False) in_use = code != 0 and IN_USE.search(err.decode(errors="replace")) is not None - lines.append(KEPT + shown(prefix, ["rmi", image]) if in_use else result_line(code, shown(prefix, ["rmi", image]))) + lines.append(KEPT_LINE + shown(prefix, ["rmi", image]) if in_use else result_line(code, shown(prefix, ["rmi", image]))) return lines def cleanup_failures(results: list[str]) -> list[str]: - return [line for line in results if not line.startswith((OK, KEPT))] + return [line for line in results if not line.startswith((OK, KEPT_LINE))] def guard_env(directory: Path, report: Path, binaries: dict[str, str | None]) -> dict[str, str]: diff --git a/tests/test_hub_operator_tasks.py b/tests/test_hub_operator_tasks.py index 97ac4f9..6538882 100644 --- a/tests/test_hub_operator_tasks.py +++ b/tests/test_hub_operator_tasks.py @@ -285,7 +285,7 @@ class TestOperatorPage(unittest.TestCase): def test_the_tasks_entry_carries_the_waiting_count_hidden_at_zero_and_no_inbox_entry_exists(self): status = self.data["status"] - self.assertEqual(status["keys"], ["stream", "rules", "agents", "artifacts", "tasks", "resources"]) + self.assertEqual(status["keys"], ["home", "stream", "rules", "agents", "artifacts", "tasks", "resources"]) self.assertEqual((status["text"], status["hidden"], status["urgent"], status["title"]), ("3", False, "badge urgent", "(3) Agent Orchestrator")) self.assertEqual(status["zero"], [True, "Agent Orchestrator"]) diff --git a/tests/test_hub_receipts.py b/tests/test_hub_receipts.py index c36dbef..9a88997 100644 --- a/tests/test_hub_receipts.py +++ b/tests/test_hub_receipts.py @@ -66,7 +66,7 @@ const find = (node, test, out = []) => { return out; }; const sandbox = { - Receipts, RadioSet, Node, NS: "svg", HUMAN: "Operator", DAY: 86400, WEEKDAYS: [], + Receipts, RadioSet, Node, NS: "svg", HUMAN: "Operator", DAY: 86400, WEEKDAYS: [], revealed: String, document: {createElement: (tag) => new Node(tag), createElementNS: (ns, tag) => new Node(tag)}, relative: {format: () => "ago"}, absolute: {format: (date) => `at ${date.getTime() / 1000}`}, Faces: {of: () => ({parts: []}), SIZE: 10}, speech: {current: null}, look: {hidden: new Set()}, PRESENCE: {}, STATUS: {}, diff --git a/tests/test_hub_view.py b/tests/test_hub_view.py index 78b53a4..44e2565 100644 --- a/tests/test_hub_view.py +++ b/tests/test_hub_view.py @@ -161,7 +161,7 @@ const caught = (run) => { const long = "x".repeat(300); console.log(JSON.stringify({ unknown, wide, listSet, local, stored, combined, adopted, rebased, merged, churned, gaveUp, refused, during, kept, beforeLeave, atLeave, landed, sent, server: left, hooks: hooks.pagehide, error: V.error(), notRestored, restored, - ids: [V.id("host", "CPU"), V.id("disk", "/"), V.id("util", "0000:01:00.0"), V.id("agent", "Stage (this session) [5d88e9]"), V.id("a:b", "c"), V.id("a", "b:c"), V.id("a_3a_b"), V.id("agent", long), V.id("agent", `${long}y`), V.id("agent", "Ärger 🦫")], + ids: [V.id("host", "CPU"), V.id("disk", "/"), V.id("util", "0000:01:00.0"), V.id("agent", "Stage (this session) [5d88e9]"), V.id("a:b", "c"), V.id("a", "b:c"), V.id("a_3a_b"), V.id("agent", long), V.id("agent", `${long}y`), V.id("agent", "Çelik 🦫")], })); })(); """.replace("@PIN@", json.dumps(PIN)).replace("@PIN_ID@", PIN["id"])