fix(unify): repair the cross-branch integration failures of the skills unify
Probe sandboxes gain the channels, quietBubbles and known.now the merged branches added; the hub view keeps queue_jobs apart from the job list; the image ships sandbox_paths.py; kvb-match writes pages into the council root pages folder; the install test scaffolds the council parts and agent roots; skill texts move detail into their side files to stay under the word caps. 🎯 Fix: 88 % 💥 Break: 4 % 💸 Tokens: 98 % ⏱️ Velocity: 100 % 🛡️ Security: 100 % 🏆 Score: 86 🚦 Gate: ⛔ fix 88 % < 90 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1445cb88b
commit
b44cac5d37
23 files changed
+95
-69
No files matched your search
@@ -196,7 +196,7 @@ async function run(rule, items) {
|
||||
const sandbox = {
|
||||
Bubbles, speech, Date, settings: {bubbles: true}, radioSet: {}, SPEECH_QUEUE: 9, SPEECH_QUIET: 0, SOUND_SLACK: 2,
|
||||
Voice: {enqueue: (pending, next) => [...pending, next], loudness: () => 1}, RadioSet: {burst: (gain) => ({gain, seconds: 0.6, frequency: 1800, q: 0.9})},
|
||||
toast: () => null, context: () => audio, drawBubbles: () => null, performance: {now: () => 1000},
|
||||
toast: () => null, context: () => audio, drawBubbles: () => null, wordsRead: () => 0, saidOf: (item) => item.words || Bubbles.words(item.line), performance: {now: () => 1000},
|
||||
duck: () => {
|
||||
if (rule === "transmit" && !ducked) {
|
||||
ducked = true;
|
||||
|
||||
@@ -55,7 +55,7 @@ function spoken(aloud, bubbles) {
|
||||
state: {now: 1000, messages: [], speech: {tts: true, gate: {open: true}}}, settings: {bubbles, channels: {...ON, aloud}},
|
||||
};
|
||||
vm.runInNewContext(speechCode, sandbox);
|
||||
sandbox.say = (item) => said.push(item.silent);
|
||||
sandbox.say = (...items) => said.push(...items.map((item) => item.silent));
|
||||
sandbox.speakRows([{ts: 1000, from: "Stage", to: [], class: "security", source: "s2", voice: "v2", word: "W", rest: "R", text: "rotate keys now"}]);
|
||||
return said;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,8 @@ METRIC_PROBE = """
|
||||
const fs = require("fs");
|
||||
const vm = require("vm");
|
||||
const [panelsFile, resourcesFile, homeFile] = process.argv.slice(1);
|
||||
const context = vm.createContext({ViewStore: {get: () => ({tokens: "accumulated"}), update: () => Promise.resolve(true), on: () => null}, labelOf: (key) => key, toast: () => null, console});
|
||||
const Resources = require(require("path").join(require("path").dirname(resourcesFile), "resources.js"));
|
||||
const context = vm.createContext({ViewStore: {get: () => ({tokens: "accumulated"}), update: () => Promise.resolve(true), on: () => null}, labelOf: (key) => key, toast: () => null, Resources, console});
|
||||
vm.runInContext(fs.readFileSync(panelsFile, "utf8"), context);
|
||||
vm.runInContext(`${fs.readFileSync(resourcesFile, "utf8")}\\n${fs.readFileSync(homeFile, "utf8")}\\nglobalThis.probe = {resourcePin, resourceView, Panels};`, context);
|
||||
const {resourcePin, resourceView, Panels} = context.probe;
|
||||
@@ -854,7 +855,9 @@ class TestHomeBookmarks(unittest.TestCase):
|
||||
|
||||
class TestHomeTree(HubCase):
|
||||
def served_tree(self) -> str:
|
||||
self.tree_file.write_text(json.dumps({"generated_at": "2026-11-14T12:00:00+00:00", "delete_ready": False, "delete_reason": "Secret Service locked", "repos": long_repos()}), encoding="utf-8")
|
||||
scanned = {"generated_at": "2026-11-14T12:00:00+00:00", "delete_ready": False, "delete_reason": "Secret Service locked", "repos": long_repos()}
|
||||
self.tree_file.write_text(json.dumps(scanned), encoding="utf-8")
|
||||
self.write_local_plan(scanned, {MERGED_BRANCH: {"skip": None, "actions": ["local-branch"]}})
|
||||
self.write_council({"rasci.json": {LONG_TASK: long_task(time.time())}})
|
||||
status, _, body = self.get("/api/tree")
|
||||
self.assertEqual(status, 200, body[:300])
|
||||
|
||||
@@ -184,11 +184,11 @@ class TestQueueOrderRuns(unittest.TestCase):
|
||||
|
||||
def test_the_run_sees_the_council_and_the_state_home_and_nothing_of_the_hub_environment(self):
|
||||
order = self.order(NEW_QUEUE, ROWS)
|
||||
with mock.patch.dict(os.environ, {"KVB_HUB_SECRET": "x"}):
|
||||
with mock.patch.dict(os.environ, {"KVB_ORCHESTRATOR_SECRET": "x"}):
|
||||
order.get(frozenset({"q-1"}), 1000.0)
|
||||
seen = json.loads(order.script.with_suffix(".env").read_text(encoding="utf-8"))
|
||||
self.assertEqual((seen["HOME"], seen["AGENTS_COUNCIL_ROOT"], seen["PATH"]), (str(self.base / "home"), str(self.base / "council"), "/usr/local/bin:/usr/bin:/bin"))
|
||||
self.assertNotIn("KVB_HUB_SECRET", seen)
|
||||
self.assertNotIn("KVB_ORCHESTRATOR_SECRET", seen)
|
||||
|
||||
|
||||
class TestHubQueueOverlay(HubCase):
|
||||
|
||||
@@ -250,7 +250,7 @@ function radio({running = true, hold = "", long = "", fail = 0, scale = 1000, bu
|
||||
RadioSet, Voice, radioSet: RadioSet.valid(null), state: {now: 1000, messages: [], speech: {tts: true, gate: {open: true}}},
|
||||
speech: {pending: [], busy: false, warned: 0, current: null, source: null, loading: null, timer: 0, item: null},
|
||||
settings: {bubbles, music: {on: false, volume: 0.4}}, SPEECH_QUEUE: 20, SPEECH_QUIET: 60000, SOUND_SLACK: 2, HUMAN: "Operator", Bubbles: {reading: () => 0.001},
|
||||
keep: stub, drawRadioSet: stub, drawBubbles: stub, drawSpeaker: stub, duck: stub, clearBubbles: stub, toast: (title) => run.log.push(["toast", title]),
|
||||
keep: stub, drawRadioSet: stub, drawBubbles: stub, drawSpeaker: stub, duck: stub, clearBubbles: stub, wordsRead: () => 0, saidOf: (item) => item.words, toast: (title) => run.log.push(["toast", title]),
|
||||
silenceBeeps: () => {
|
||||
run.beeps += 1;
|
||||
},
|
||||
|
||||
@@ -333,7 +333,8 @@ AXIS_PROBE = """
|
||||
const fs = require("fs");
|
||||
const vm = require("vm");
|
||||
const s = (tag, attrs, ...children) => ({tag, attrs, children: children.flat(), append(...more) { this.children.push(...more); }});
|
||||
const context = {s, h: s, DAY: 86400, fixed: (value) => value.toFixed(1), stampOf: (t) => t, absolute: {format: () => "14 Nov 2026, 10:00"}, clock: {format: () => "10:00"}};
|
||||
const Resources = require(require("path").join(require("path").dirname(process.argv[1]), "resources.js"));
|
||||
const context = {s, h: s, DAY: 86400, Resources, fixed: (value) => value.toFixed(1), stampOf: (t) => t, absolute: {format: () => "14 Nov 2026, 10:00"}, clock: {format: () => "10:00"}};
|
||||
vm.runInNewContext(`${fs.readFileSync(process.argv[1], "utf8")}\\nglobalThis.frame = resourceFrame;`, context);
|
||||
const labels = (width, days) => context.frame({kind: "tokens", label: "Tokens"}, {from: 0, to: days * 86400}, {width, height: 120}, false).svg.children
|
||||
.filter((node) => node.tag === "text").map((node) => [Number(node.attrs.x), node.attrs["text-anchor"], node.children.join("")]);
|
||||
|
||||
@@ -337,7 +337,7 @@ class TestViewDocument(unittest.TestCase):
|
||||
valid_view(doc)
|
||||
|
||||
def test_the_hub_digests_a_selection_exactly_as_panels_js_does(self):
|
||||
texts = ["", "host:CPU", "burn:done\nhost:CPU", "agent:Ä€\U0001f600", "x" * 5000]
|
||||
texts = ["", "host:CPU", "burn:done\nhost:CPU", "agent:\N{LATIN CAPITAL LETTER A WITH DIAERESIS}\N{EURO SIGN}\U0001f600", "x" * 5000]
|
||||
self.assertEqual([viewstore.digest(text) for text in texts], client_digests(*texts))
|
||||
|
||||
def test_a_metric_pin_id_must_be_the_one_its_view_gives_so_no_view_hides_under_another_charts_id(self):
|
||||
|
||||
@@ -18,7 +18,7 @@ DUTCH = wav_bytes(1, 2, engines.STT_RATE, b"\x02\x00" * engines.STT_RATE)
|
||||
FRENCH = wav_bytes(1, 2, engines.STT_RATE, b"\x03\x00" * engines.STT_RATE)
|
||||
HEARD = {
|
||||
"hallo-welt.wav": {"auto": ["de", "Hallo Welt."], "de": [0.9, "Hallo Welt."], "en": [0.3, "Hollow felt."]},
|
||||
"hello-world.wav": {"auto": ["en", "Hello world."], "de": [0.2, "Hello Wörld."], "en": [0.9, "Hello world."]},
|
||||
"hello-world.wav": {"auto": ["en", "Hello world."], "de": [0.2, "Hello W\N{LATIN SMALL LETTER O WITH DIAERESIS}rld."], "en": [0.9, "Hello world."]},
|
||||
"dutch": {"auto": ["nl", "Hallo wereld."], "de": [0.7, "Hallo Welt."], "en": [0.4, "Hello world."]},
|
||||
"french": {"auto": ["fr", "Bonjour le monde."], "de": [0.2, "Bonschur."], "en": [0.6, "Bonjour world."]},
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@ LIVE_MEMORY = {
|
||||
SHIPPED = ORGANIZE / "config.default.json"
|
||||
DEFAULT = json.loads(SHIPPED.read_text(encoding="utf-8"))
|
||||
ROW_MEMORY = DEFAULT["memory_limits"]
|
||||
HOME_TOOLS = ("bash", "cp", "dirname", "find", "install", "ln", "mkdir", "rm")
|
||||
HOME_TOOLS = ("bash", "cp", "dirname", "find", "install", "ln", "mkdir", "python3", "rm")
|
||||
COUNCIL_PARTS = ("scripts/orchestrator.sh", "skills/kvb-org-organize/scripts/councilroot.py", "skills/kvb-org-organize/scripts/nofollow.py")
|
||||
AGENT_ROOTS = {"sandbox": {"filesystem": {"allowWrite": ["~/.local/state/agents-shared", "~/.local/state/agents-release/**"]}}}
|
||||
CGROUP_KILL = """
|
||||
case "$*" in *try-restart*kvb-code-graph*)
|
||||
unit=$(while IFS= read -r line; do echo "$line"; done < "$HOME/.config/systemd/user/kvb-code-graph.service")
|
||||
@@ -117,6 +119,9 @@ class TestInstall(unittest.TestCase):
|
||||
repo, stubs, home = root / "repo", root / "bin", root / "home"
|
||||
(repo / "scripts").mkdir(parents=True)
|
||||
shutil.copy(INSTALL, repo / "scripts" / "install.sh")
|
||||
for part in COUNCIL_PARTS:
|
||||
(repo / part).parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy(REPO_ROOT / part, repo / part)
|
||||
for unit in HOME_UNITS:
|
||||
(repo / "skills" / unit).parent.mkdir(parents=True, exist_ok=True)
|
||||
(repo / "skills" / unit).write_text("[Unit]\n", encoding="utf-8")
|
||||
@@ -136,6 +141,8 @@ class TestInstall(unittest.TestCase):
|
||||
(stubs / name).write_text(body, encoding="utf-8")
|
||||
(stubs / name).chmod(0o755)
|
||||
home.mkdir()
|
||||
(home / ".claude").mkdir()
|
||||
(home / ".claude" / "settings.json").write_text(json.dumps(AGENT_ROOTS), encoding="utf-8")
|
||||
if binary:
|
||||
(home / ".local" / "bin").mkdir(parents=True)
|
||||
shutil.copy(stubs / "codebase-memory-mcp", home / ".local" / "bin" / "codebase-memory-mcp")
|
||||
@@ -144,7 +151,7 @@ class TestInstall(unittest.TestCase):
|
||||
(home / ".config" / "kvb-code-graph" / "config.json").write_text(
|
||||
'{"queue_file_threshold": 2000, "queue_task": "work/code-graph-index"}\n', encoding="utf-8"
|
||||
)
|
||||
env = {"PATH": str(stubs), "TARGET": str(home), "HOME": str(home)}
|
||||
env = {"PATH": str(stubs), "TARGET": str(home), "HOME": str(home), "AGENTS_COUNCIL_LEGACY": str(root / "legacy")}
|
||||
done = subprocess.run(["/bin/bash", str(repo / "scripts" / "install.sh")], env=env, capture_output=True, text=True, check=False)
|
||||
return done, read_lines(log), read_lines(cbm)
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ class TestOperator(unittest.TestCase):
|
||||
self._add("bad", self.base, "true", "r", "manual")
|
||||
code, shown, modes = self._terminal(["run"], [
|
||||
(b"Run it?", b"c\n"),
|
||||
(b"Why cancel?", "ich hä\x7fätte gerne einen befehl bei dem ich seh was passiert\n".encode()),
|
||||
(b"Why cancel?", "I h\N{LATIN SMALL LETTER A WITH DIAERESIS}\x7f\N{LATIN SMALL LETTER A WITH DIAERESIS}d rather see a command that shows what happens\n".encode()),
|
||||
(b"Run it?", b"c\n"),
|
||||
(b"Why cancel?", b"kaputt \xff " + "👀\n".encode()),
|
||||
])
|
||||
@@ -414,17 +414,17 @@ class TestOperator(unittest.TestCase):
|
||||
self.assertNotIn("Traceback", shown)
|
||||
self.assertEqual(modes, [True, True, True, True, False])
|
||||
register = self._register()
|
||||
self.assertEqual(register["operator/drop"]["cancelled"], "ich hätte gerne einen befehl bei dem ich seh was passiert")
|
||||
self.assertEqual(register["operator/drop"]["cancelled"], "I h\N{LATIN SMALL LETTER A WITH DIAERESIS}d rather see a command that shows what happens")
|
||||
self.assertEqual(register["operator/bad"]["cancelled"], "kaputt � 👀")
|
||||
|
||||
def test_a_granted_cancel_typed_on_a_terminal_keeps_an_erased_umlaut_whole_and_restores_the_mode(self):
|
||||
self._add("paint", self.base, "true", "r", "manual")
|
||||
code, shown, modes = self._terminal(
|
||||
["granted", "operator/paint", "--dir", str(self.base), "--check", "manual", "--", "/bin/sh", "-ic", "true"],
|
||||
[(b"Run it?", b"c\n"), (b"Why cancel?", "ich hä\x7fätte gerne einen befehl\n".encode())],
|
||||
[(b"Run it?", b"c\n"), (b"Why cancel?", "I h\N{LATIN SMALL LETTER A WITH DIAERESIS}\x7f\N{LATIN SMALL LETTER A WITH DIAERESIS}d rather see a command\n".encode())],
|
||||
)
|
||||
self.assertEqual((code, modes), (75, [True, True, False]), shown)
|
||||
self.assertEqual(self._register()["operator/paint"]["cancelled"], "ich hätte gerne einen befehl")
|
||||
self.assertEqual(self._register()["operator/paint"]["cancelled"], "I h\N{LATIN SMALL LETTER A WITH DIAERESIS}d rather see a command")
|
||||
|
||||
def test_an_interrupt_at_a_prompt_restores_the_terminal_mode(self):
|
||||
self._add("drop", self.base, "true", "r", "manual")
|
||||
|
||||
@@ -73,6 +73,9 @@ def host_sys(root: Path) -> Path:
|
||||
return root
|
||||
|
||||
|
||||
NO_PRESSURE = {"psi_some": None, "psi_full": None, "swap_out_mb_min": None}
|
||||
|
||||
|
||||
def row(t: int, cpu: float, used: int, waiting: int, gpu: dict) -> dict:
|
||||
return {"t": t, "disks": [{"mount": "/", "used": used, "total": 1000}], "cpu": cpu, "ram": cpu / 2, "swap": 0.0, "load": cpu / 10, "gpus": [gpu], "queue": {"waiting": waiting, "active": 1}}
|
||||
|
||||
@@ -192,7 +195,7 @@ class TestPressure(unittest.TestCase):
|
||||
row(NOW + 60, 1.0, 1, 0, asleep) | {"psi_some": 2.0, "psi_full": 1.004, "swap_out_mb_min": 100.0},
|
||||
row(NOW + 120, 1.0, 1, 0, asleep) | {"psi_some": 4.5, "psi_full": None, "swap_out_mb_min": 301.0},
|
||||
]
|
||||
mean = sampler.mean_row(NOW, rows)
|
||||
mean = sampler.mean_row(NOW, sampler.BUCKET, rows)
|
||||
self.assertEqual((mean["psi_some"], mean["psi_full"], mean["swap_out_mb_min"]), (3.25, 1.0, 200.5))
|
||||
|
||||
|
||||
@@ -251,7 +254,7 @@ class TestRetention(unittest.TestCase):
|
||||
]
|
||||
kept = sampler.retain(rows, NOW)
|
||||
self.assertEqual([entry["t"] for entry in kept], [day, NOW - 30 * DAY, bucket, bucket + 900, NOW - 60])
|
||||
self.assertEqual(kept[0], {**row(day, 5.0, 1, 0, asleep), "queue": {"waiting": 0.0, "active": 1.0}, "span": 60, "width": DAY})
|
||||
self.assertEqual(kept[0], {**row(day, 5.0, 1, 0, asleep), **NO_PRESSURE, "queue": {"waiting": 0.0, "active": 1.0}, "span": 60, "width": DAY})
|
||||
self.assertEqual(kept[1], {**mean, "span": sampler.BUCKET, "width": sampler.BUCKET})
|
||||
self.assertEqual(kept[2], {
|
||||
"t": bucket, "disks": [{"mount": "/", "used": 200, "total": 1000}, {"mount": "/mnt", "used": 10, "total": 20}], "cpu": 30.0, "ram": 15.0, "swap": 0.0, "load": 3.0,
|
||||
@@ -273,7 +276,7 @@ class TestRetention(unittest.TestCase):
|
||||
kept = sampler.retain([ancient, *means, late, recent], NOW)
|
||||
self.assertEqual([entry["t"] for entry in kept], [day - 1000 * DAY, day, edge + sampler.BUCKET, NOW - 60])
|
||||
self.assertEqual(kept[0], ancient)
|
||||
self.assertEqual(kept[1], {**row(day, 30.0, 100, 0, asleep), "load": 3.0, "queue": {"waiting": 0.0, "active": 1.0}, "span": 3 * sampler.BUCKET, "width": DAY})
|
||||
self.assertEqual(kept[1], {**row(day, 30.0, 100, 0, asleep), **NO_PRESSURE, "load": 3.0, "queue": {"waiting": 0.0, "active": 1.0}, "span": 3 * sampler.BUCKET, "width": DAY})
|
||||
self.assertEqual(kept[2:], [late, recent])
|
||||
self.assertEqual(sampler.retain(kept, NOW), kept)
|
||||
later = sampler.retain(kept, NOW + 2 * DAY)
|
||||
|
||||
Reference in new issue
Block a user