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:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-15 07:07:52 +00:00
1 parent e1445cb88b
commit b44cac5d37
23 files changed
+95 -69

No files matched your search

@@ -13,7 +13,7 @@ tokens.
1. **Depends on**: nothing. Independent of 010, 011 and quality 003. 1. **Depends on**: nothing. Independent of 010, 011 and quality 003.
2. **Timing**: implementation starts once the running agent lanes are done. 2. **Timing**: implementation starts once the running agent lanes are done.
3. **Automatic per repository** (amended by the operator 2026-11-14, pick 3. **Automatic per repository** (amended by the operator 2026-11-14, pick
"auto_index aus"): the daemon's `auto_index` stays off; the skills "auto_index off"): the daemon's `auto_index` stays off; the skills
`make install` sets `codebase-memory-mcp config set auto_index false`. The `make install` sets `codebase-memory-mcp config set auto_index false`. The
skills PreToolUse hook (`kvb-agent-optimize/scripts/graph.py hook`) indexes skills PreToolUse hook (`kvb-agent-optimize/scripts/graph.py hook`) indexes
every git root a tool call touches, the session root included, once it has every git root a tool call touches, the session root included, once it has
+1 -1
View File
@@ -59,7 +59,7 @@ RUN chmod 0755 /opt/voices /opt/whisper
COPY server.py /app/server.py COPY server.py /app/server.py
COPY kvb_orchestrator /app/kvb_orchestrator COPY kvb_orchestrator /app/kvb_orchestrator
COPY client/hub_limits.py client/signing.py client/emoji-variation.json client/passkey.py client/verifier.py client/queue_live.py /app/client/ COPY client/hub_limits.py client/signing.py client/emoji-variation.json client/passkey.py client/verifier.py client/queue_live.py client/sandbox_paths.py /app/client/
COPY templates /app/templates COPY templates /app/templates
COPY vendor /app/vendor COPY vendor /app/vendor
+3 -3
View File
@@ -121,10 +121,10 @@ class View:
settings = self.settings.get() settings = self.settings.get()
inbox = self.inbox(now, tasks, directory) inbox = self.inbox(now, tasks, directory)
queue = queue_entries(self.council, self.history.rows) queue = queue_entries(self.council, self.history.rows)
jobs = self.queue_order.get(live_ids(queue), now) queue_jobs = self.queue_order.get(live_ids(queue), now)
order = stored_order(self.council / AGENT_ORDER) order = stored_order(self.council / AGENT_ORDER)
rows = task_rows(tasks, queue, self.tree.get()) rows = task_rows(tasks, queue, self.tree.get())
chain = grant_order(queue_chain(queue, tasks, order, now), jobs) chain = grant_order(queue_chain(queue, tasks, order, now), queue_jobs)
return { return {
"settings": settings, "settings": settings,
"media": media_origins(settings), "media": media_origins(settings),
@@ -153,7 +153,7 @@ class View:
"tasks": rows, "tasks": rows,
"task_edges": task_edges(rows, chain), "task_edges": task_edges(rows, chain),
"queue_line": queue_line(chain, queue), "queue_line": queue_line(chain, queue),
"queue_jobs": jobs, "queue_jobs": queue_jobs,
"agent_order": agent_order(tasks, claims, order), "agent_order": agent_order(tasks, claims, order),
"radio": radio, "radio": radio,
"claims": claims, "claims": claims,
+2 -2
View File
@@ -62,7 +62,7 @@
return h("tr", {class: "match-mark", "data-line": mark.line}, h("td", {colspan: columns}, icon("bi-chat-square-text"), h("span", {class: "match-mark-text"}, revealed(mark.comment)))); return h("tr", {class: "match-mark", "data-line": mark.line}, h("td", {colspan: columns}, icon("bi-chat-square-text"), h("span", {class: "match-mark-text"}, revealed(mark.comment))));
} }
function fileRows(card, file) { function matchFileRows(card, file) {
const commit = card.kind === "commit"; const commit = card.kind === "commit";
const rows = commit ? (file.patch ? Diffs.rows(file.patch).map(patchRow) : []) : file.state === "read" ? contentRows(file.content) : []; const rows = commit ? (file.patch ? Diffs.rows(file.patch).map(patchRow) : []) : file.state === "read" ? contentRows(file.content) : [];
const columns = commit ? 4 : 2; const columns = commit ? 4 : 2;
@@ -93,7 +93,7 @@
function fileBlock(card, file, index) { function fileBlock(card, file, index) {
const opened = matchView.opened.has(card.id) ? matchView.opened.get(card.id).has(file.path) : index === 0; const opened = matchView.opened.has(card.id) ? matchView.opened.get(card.id).has(file.path) : index === 0;
const rows = fileRows(card, file); const rows = matchFileRows(card, file);
const table = rows.length ? h("div", {class: "diff-scroll"}, h("table", {class: "diff"}, h("tbody", {}, rows))) : h("p", {class: "muted"}, card.kind === "commit" ? "No patch shipped for this file." : "Not read."); const table = rows.length ? h("div", {class: "diff-scroll"}, h("table", {class: "diff"}, h("tbody", {}, rows))) : h("p", {class: "muted"}, card.kind === "commit" ? "No patch shipped for this file." : "Not read.");
const block = h("details", {class: "match-file", "data-path": file.path, "data-state": card.kind === "command" ? file.state : null, open: opened}, fileHead(card, file), table); const block = h("details", {class: "match-file", "data-path": file.path, "data-state": card.kind === "command" ? file.state : null, open: opened}, fileHead(card, file), table);
block.addEventListener("toggle", () => remember(card, block)); block.addEventListener("toggle", () => remember(card, block));
+1 -1
View File
@@ -65,7 +65,7 @@ const Voice = (() => {
* @param {number} start the start of its selection. * @param {number} start the start of its selection.
* @param {number} end the end of its selection. * @param {number} end the end of its selection.
* @param {string} text the transcript. * @param {string} text the transcript.
* @returns {{value: string, caret: number}} value with the trimmed transcript in place of the selection, one space on each side where a neighbour is no whitespace, and the caret right after the transcript. * @returns {value: string, caret: number} value with the trimmed transcript in place of the selection, one space on each side where a neighbour is no whitespace, and the caret right after the transcript.
*/ */
function spliced(value, start, end, text) { function spliced(value, start, end, text) {
const words = String(text).trim(); const words = String(text).trim();
+4 -9
View File
@@ -37,15 +37,10 @@ installed, whether the daemon's `auto_index` is off, and the state of the shared
(additional working directories, worktrees, submodules), once it has no (additional working directories, worktrees, submodules), once it has no
graph. It indexes nothing until `~/.config/kvb-code-graph/config.json` graph. It indexes nothing until `~/.config/kvb-code-graph/config.json`
sets `queue_file_threshold` and `queue_task` (no defaults; the operator sets `queue_file_threshold` and `queue_task` (no defaults; the operator
sets both, the hook says so once per session). A root with more files sets both, the hook says so once per session). A root over the threshold
than the threshold (tracked plus untracked, not ignored), with a is enqueued once through `kvb-org-queue` under `queue_task`, never started
`.gitmodules` file or a nested repository, or whose count git cannot give by the hook; the `graph.py` docstring holds every size, memory, git and
within 2 s is enqueued once through `kvb-org-queue` under `queue_task`, retry gate. `make install` also enables
never started by the hook; a smaller one starts a detached helper
(`index_repository`, `async: true`, mode `full`) only while no other
helper runs and `kvb-org-organize` reports the memory stage ok. Git runs
with repository hooks and fsmonitor off. A failed or refused index is
retried after 6 hours at the earliest. `make install` also enables
`kvb-code-graph.service`, which keeps a permanent daemon so each watch `kvb-code-graph.service`, which keeps a permanent daemon so each watch
outlives the last session; while the unit is inactive, the hook prints outlives the last session; while the unit is inactive, the hook prints
the enable command once per session and records it once as a the enable command once per session and records it once as a
+4 -4
View File
@@ -21,14 +21,14 @@ request and stop, or, ordered here by the operator, first
Read-only, parallel, sized, only in the agent write scope (Claude Code: Read-only, parallel, sized, only in the agent write scope (Claude Code:
`sandbox.filesystem.allowWrite`) and session scratch dirs, never another `sandbox.filesystem.allowWrite`) and session scratch dirs, never another
user's files. Prefer project cleanup and teardown targets; obey bans on raw user's files. Prefer project cleanup and teardown targets; obey raw-command
commands. bans.
- **/tmp**: `pkgmgr gc --report --docker --root /tmp --root <write dir>`, - **/tmp**: `pkgmgr gc --report --docker --root /tmp --root <write dir>`,
else `du -sh` per own entry; never system entries (`.*-unix`, else `du -sh` per own entry; never system entries (`.*-unix`,
`systemd-private-*`, `ssh-*`, `tmux-*`, sockets). `systemd-private-*`, `ssh-*`, `tmux-*`, sockets).
- **Docker**, **worktrees**: read `docker.md` (its `⚠ Volumes` checklist - **Docker**, **worktrees**: read `docker.md` (its `⚠ Volumes` checklist
joins Step 4) and `worktrees.md` next to this file when present. joins Step 4) and `worktrees.md` here when present.
- **Agent dirs**: pip, npm, pre-commit, act, gh, buildx caches; Ansible and - **Agent dirs**: pip, npm, pre-commit, act, gh, buildx caches; Ansible and
build temp dirs. build temp dirs.
- **Council root** (`~/.local/state/agents-shared`): `archive/` only. - **Council root** (`~/.local/state/agents-shared`): `archive/` only.
@@ -52,7 +52,7 @@ go on meanwhile.
## Step 3: classify ## Step 3: classify
First match wins: claimed by a peer, `keep`; in a register task not `done`, First match wins: claimed by a peer, `keep`; in a register task not `done`,
`stopped` or `stale` (a branch merged into the default branch makes it `stopped` or `stale` (a branch merged into the default makes it
`stale`; an ended task's items are its worker's candidates), `keep (task <task>)`; a `stale`; an ended task's items are its worker's candidates), `keep (task <task>)`; a
running deploy, gate, test, swarm or build, `keep (running)`; a silent peer's, running deploy, gate, test, swarm or build, `keep (running)`; a silent peer's,
`keep (no answer from <peer>)`, silence is not consent; sandboxed, touched `keep (no answer from <peer>)`, silence is not consent; sandboxed, touched
+19 -6
View File
@@ -4,9 +4,11 @@
--agent <name> [--pages <dir>] [--rules <dir>]: adds the staged --agent <name> [--pages <dir>] [--rules <dir>]: adds the staged
change of the worktree as a commit card: a review of the hub queue change of the worktree as a commit card: a review of the hub queue
whose page holds the patch git diff --cached prints and whose tree is whose page holds the patch git diff --cached prints and whose tree is
the one git write-tree prints; <dir> is the hub's pages folder, the one git write-tree prints; <dir> is the folder the page is
/tmp/kvb-git-diff by default, and --rules the MEDUSA rules the written to, by default the pages folder councilroot.py dir pages of
masked card diff is built with, as approval.py request takes them. kvb-org-organize makes in the council root, and --rules the MEDUSA
rules the masked card diff is built with, as approval.py request
takes them.
add --task <operator/slug>: takes the payload files of an open operator add --task <operator/slug>: takes the payload files of an open operator
row again, so its stale card turns fresh. row again, so its stale card turns fresh.
list: prints one line per card; a commit card whose worktree's staged list: prints one line per card; a commit card whose worktree's staged
@@ -26,6 +28,7 @@ from __future__ import annotations
import argparse import argparse
import html import html
import importlib import importlib
import importlib.util
import json import json
import os import os
import re import re
@@ -36,7 +39,7 @@ from pathlib import Path
PORT = 8737 PORT = 8737
CLIENT = Path.home() / ".local" / "share" / "kvb-orchestrator" / "client" CLIENT = Path.home() / ".local" / "share" / "kvb-orchestrator" / "client"
PAGES = Path("/tmp/kvb-git-diff") COUNCIL_ROOT = Path(__file__).resolve().parents[2] / "kvb-org-organize" / "scripts" / "councilroot.py"
PATCH = re.compile(r'<pre id="patch">(.*)</pre>', re.DOTALL) PATCH = re.compile(r'<pre id="patch">(.*)</pre>', re.DOTALL)
REVIEW = re.compile(r"[0-9a-f]{16}") REVIEW = re.compile(r"[0-9a-f]{16}")
UNSAFE = re.compile(r"[^A-Za-z0-9._-]+") UNSAFE = re.compile(r"[^A-Za-z0-9._-]+")
@@ -46,6 +49,16 @@ class Refused(Exception):
pass pass
def council_pages() -> Path:
spec = importlib.util.spec_from_file_location("kvb_match_councilroot", COUNCIL_ROOT)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
try:
return module.directory(module.root(), "pages")
except ValueError as error:
raise Refused(str(error)) from error
def client_modules(folder: Path) -> dict: def client_modules(folder: Path) -> dict:
sys.path.insert(0, str(folder)) sys.path.insert(0, str(folder))
return {name: importlib.import_module(name) for name in ("hub_api", "staged_diff", "approval")} return {name: importlib.import_module(name) for name in ("hub_api", "staged_diff", "approval")}
@@ -93,7 +106,7 @@ def add_commit(args: argparse.Namespace, client: dict) -> str:
if not patch.strip(): if not patch.strip():
raise Refused(f"nothing staged in {repo}") raise Refused(f"nothing staged in {repo}")
shown = patch.encode("utf-8", "surrogateescape").decode("utf-8", "replace") shown = patch.encode("utf-8", "surrogateescape").decode("utf-8", "replace")
page = args.pages / f"match-{UNSAFE.sub('-', branch)}-{tree[:12]}.html" page = (args.pages or council_pages()) / f"match-{UNSAFE.sub('-', branch)}-{tree[:12]}.html"
page.write_text(f'<!doctype html><meta charset="utf-8"><title>{html.escape(args.title)}</title><pre id="patch">{html.escape(shown)}</pre>\n', encoding="utf-8") page.write_text(f'<!doctype html><meta charset="utf-8"><title>{html.escape(args.title)}</title><pre id="patch">{html.escape(shown)}</pre>\n', encoding="utf-8")
with tempfile.NamedTemporaryFile("w", encoding="utf-8", suffix=".txt", delete=False) as notes: with tempfile.NamedTemporaryFile("w", encoding="utf-8", suffix=".txt", delete=False) as notes:
notes.write(f"{args.score}\n") notes.write(f"{args.score}\n")
@@ -164,7 +177,7 @@ def parser() -> argparse.ArgumentParser:
for name in ("--title", "--score", "--agent"): for name in ("--title", "--score", "--agent"):
adding.add_argument(name) adding.add_argument(name)
adding.add_argument("--gate", choices=("pass", "fail")) adding.add_argument("--gate", choices=("pass", "fail"))
adding.add_argument("--pages", type=Path, default=PAGES) adding.add_argument("--pages", type=Path)
adding.add_argument("--rules", type=Path) adding.add_argument("--rules", type=Path)
commands.add_parser("list") commands.add_parser("list")
showing = commands.add_parser("show") showing = commands.add_parser("show")
+17 -18
View File
@@ -9,7 +9,8 @@ description: >
The first claim owns a piece of work; a later agent hands its findings to the The first claim owns a piece of work; a later agent hands its findings to the
owner, never building a second version. Offices are recallable mandates owner, never building a second version. Offices are recallable mandates
that coordinate and allocate, never direct others' content; the operator that coordinate and allocate, never direct others' content; the operator
outranks them and appoints or recalls at will. outranks them and appoints or recalls at will. Named `*.md` files lie
next to this file.
## Election ## Election
@@ -19,8 +20,8 @@ outranks them and appoints or recalls at will.
1. Name the office: `work/<slug>` (a piece of work), `cluster/<slug>` (a 1. Name the office: `work/<slug>` (a piece of work), `cluster/<slug>` (a
strand across lines), `<dimension>/<line>` (a line) or `chair`, the slug strand across lines), `<dimension>/<line>` (a line) or `chair`, the slug
concrete (issue number, failing log line). The first agent elected concrete (issue number, failing log line). The first agent elected
while `chair` is vacant also claims it. Read `offices.md` next to this while `chair` is vacant also claims it. Read `offices.md` before
file before claiming a cluster, a line or the chair. claiming a cluster, a line or the chair.
2. `council.py list`; the same work claimed under another slug counts. 2. `council.py list`; the same work claimed under another slug counts.
3. `council.py claim <office> --work "<what, evidence, branch or worktree>"`. 3. `council.py claim <office> --work "<what, evidence, branch or worktree>"`.
Exit 0: yours; 3: a live holder (printed); 4: a dead holder. Exit 0: yours; 3: a live holder (printed); 4: a dead holder.
@@ -30,10 +31,9 @@ outranks them and appoints or recalls at will.
5. Not elected: post your findings to the holder (`radio.py post --to`) and 5. Not elected: post your findings to the holder (`radio.py post --to`) and
stop. stop.
A hook (`council.py gate`) blocks worktree edits before a claim. Between A hook (`council.py gate`) blocks worktree edits before a claim. Read
machines the earliest announcement by message time wins; each host's claim `succession.md` when a claim ends, goes stale or clashes across machines, or
directory records it. Read `succession.md` next to this file when a claim after a restart.
ends or goes stale, or after a restart.
## Capacity ## Capacity
@@ -44,7 +44,7 @@ ends or goes stale, or after a restart.
anything else: `queue.py hold --kind test`. anything else: `queue.py hold --kind test`.
- Memory stop (also PSI or swap-out) blocks every admit and grant; running - Memory stop (also PSI or swap-out) blocks every admit and grant; running
jobs go on. jobs go on.
- Other test runs, `make test`, `make test-lint`, quality gates, deploys, - `make test`, `make test-lint`, quality gates, deploys,
iteration loops, swarm, image builds, cloud, shared-data cleanup, anything iteration loops, swarm, image builds, cloud, shared-data cleanup, anything
with Docker or over a few minutes: run through `queue.py hold` with Docker or over a few minutes: run through `queue.py hold`
(`kvb-org-queue`), which grants by rule and releases on exit; the chair only (`kvb-org-queue`), which grants by rule and releases on exit; the chair only
@@ -53,29 +53,28 @@ ends or goes stale, or after a restart.
- No running job is cut short for capacity; only the operator orders one - No running job is cut short for capacity; only the operator orders one
down. Exception: void by a missing merged hotfix (`kvb-git-hotfix`). down. Exception: void by a missing merged hotfix (`kvb-git-hotfix`).
`RESOURCE` hook lines address the chair; others adjust plans. `RESOURCE` hook lines address the chair; others adjust plans.
- Read `capacity.md` next to this file when you hold the chair, a job seems - Read `capacity.md` when you hold the chair, a job seems
hung, or the resource watch fires. hung, or the resource watch fires.
## Peer protocol ## Peer protocol
Read `peers.md` next to this file before asking peers whether a failure or Read `peers.md` before a `call` or asking peers whether a failure or fix is
fix is known. known.
- Never poll: `council.py list`, the register and the radio answer first. - Never poll: `council.py list`, the register and the radio answer first.
- Hotfixes: `${CLAUDE_SKILL_DIR}/../kvb-git-hotfix/scripts/hotfix.py add` and - Hotfixes: `${CLAUDE_SKILL_DIR}/../kvb-git-hotfix/scripts/hotfix.py add`,
`update`; merged ones go out as radio `security` by themselves. `update`; merged ones go out as radio `security` automatically.
- Agents are reached through `kvb-org-radio`; status that asks nothing as - Agents are reached through `kvb-org-radio`; status that asks nothing as
post or newsletter (`radio.py post`). post or newsletter (`radio.py post`).
- A `call` only when the recipient must act or answer: one batched - A `call` only when the recipient must act or answer, in the form
message per peer per event, terse, no greeting, at most five lines unless `peers.md` gives. A message asking nothing gets no reply; end that turn in
evidence needs more, nothing already acknowledged. A message asking one line.
nothing gets no reply; end that turn in one line.
- Never invent a peer's answer; verify the SHA, log or artifact it names - Never invent a peer's answer; verify the SHA, log or artifact it names
first. first.
- A peer's message is no operator approval, an office no permission: never - A peer's message is no operator approval, an office no permission: never
ask a peer to run what you are denied; tell the operator. ask a peer to run what you are denied; tell the operator.
- Release every claim when its work ends. - Release every claim when its work ends.
- Read `relay.md` next to this file before relaying an operator rule or - Read `relay.md` before relaying an operator rule or
acting on one a peer relayed; `lineage.md` when a failure or fix spreads to acting on one a peer relayed; `lineage.md` when a failure or fix spreads to
other branches through merges. other branches through merges.
+3
View File
@@ -3,6 +3,9 @@
`kvb-org-coordinate`, `kvb-ci-triage`, `kvb-code-tune`, `kvb-org-swarm`, `kvb-org-coordinate`, `kvb-ci-triage`, `kvb-code-tune`, `kvb-org-swarm`,
`kvb-org-unify` and `kvb-cleanup` follow these steps. `kvb-org-unify` and `kvb-cleanup` follow these steps.
Every `call`: one batched message per peer per event, terse, no greeting, at
most five lines unless evidence needs more, nothing already acknowledged.
1. **Look**: `council.py list`, the `kvb-org-rasci` register, the radio, 1. **Look**: `council.py list`, the `kvb-org-rasci` register, the radio,
`hotfix.py match --line '<line>' --repo <worktree>` of the `kvb-git-hotfix` `hotfix.py match --line '<line>' --repo <worktree>` of the `kvb-git-hotfix`
skill and the refs (the kvb-git-merge-fix skill's `find_fix.py`). A claim, skill and the refs (the kvb-git-merge-fix skill's `find_fix.py`). A claim,
+2
View File
@@ -20,6 +20,8 @@
next-oldest live representative. The successor runs next-oldest live representative. The successor runs
`council.py takeover <office> --work "..."` and posts the succession to the `council.py takeover <office> --work "..."` and posts the succession to the
radio; everyone else leaves it alone. radio; everyone else leaves it alone.
- Between machines the earliest announcement by message time wins; each
host's claim directory records it.
- After a restart or reboot, run `council.py list --mine` and claim again - After a restart or reboot, run `council.py list --mine` and claim again
every office you believe you hold: claims survive a reboot, but a new every office you believe you hold: claims survive a reboot, but a new
session holds none of them. session holds none of them.
+5 -5
View File
@@ -28,7 +28,7 @@ status, result or question that can wait.
## Radio: immediate ## Radio: immediate
`send` reaches the addressee at its next tool step and wakes it when idle: `send` reaches the addressee at its next tool step and wakes it when idle:
a full turn per receiver, very expensive. a full turn per receiver, costly.
| Class | Addressee | Use | | Class | Addressee | Use |
| --- | --- | --- | | --- | --- | --- |
@@ -42,15 +42,15 @@ A mayday holds radio silence two hours, except `--no-silence` or under
another's silence, which notify the operator instead: a hook refuses every another's silence, which notify the operator instead: a hook refuses every
Edit, Write and Bash command except those the config's `never_block` and Edit, Write and Bash command except those the config's `never_block` and
`mayday_allow` start with and bare `radio.py` calls (text in single quotes, `mayday_allow` start with and bare `radio.py` calls (text in single quotes,
no shell operators), until its sender runs `radio.py clear` once resolved. The sender keeps working; an agent that no shell operators), until its sender runs `radio.py clear` once resolved. The sender keeps working; an agent
can help fix it joins with `radio.py assist` and keeps working too. Never able to help joins with `radio.py assist` and keeps working too. Never
clear another agent's mayday; `--force` only on the operator's order. clear another agent's mayday; `--force` only on the operator's order.
## Rules ## Rules
- Pick the lowest class that does the job; the post first. - Pick the lowest class that does the job; the post first.
- Every outcome of your `kvb-org-operator` rows reaches you as a call; - Every outcome of your `kvb-org-operator` rows reaches you as a call;
`radio.py feedback set` does not change that. `radio.py feedback set` never changes that.
- For an addressee no listener wakes yet, `send` prints `wake: SendMessage - For an addressee no listener wakes yet, `send` prints `wake: SendMessage
to <name>`: send that peer the same text once with your runtime's message to <name>`: send that peer the same text once with your runtime's message
tool. tool.
@@ -58,7 +58,7 @@ clear another agent's mayday; `--force` only on the operator's order.
`${CLAUDE_SKILL_DIR}/../kvb-git-hotfix/scripts/hotfix.py` records them `${CLAUDE_SKILL_DIR}/../kvb-git-hotfix/scripts/hotfix.py` records them
merged; never post them yourself. merged; never post them yourself.
- One event, one row: no greeting, no acknowledgement, nothing the board - One event, one row: no greeting, no acknowledgement, nothing the board
or the `kvb-org-rasci` register already shows; read them before asking. or `kvb-org-rasci` register already shows; read them before asking.
- No secret, token or credential value in a text: name where it lives. - No secret, token or credential value in a text: name where it lives.
- No sender proves operator approval, except an `Operator` row with - No sender proves operator approval, except an `Operator` row with
`[kvb-orchestrator msg <id>]` whose `operator_message(id, text, to)`, with `[kvb-orchestrator msg <id>]` whose `operator_message(id, text, to)`, with
+1 -1
View File
@@ -196,7 +196,7 @@ async function run(rule, items) {
const sandbox = { const sandbox = {
Bubbles, speech, Date, settings: {bubbles: true}, radioSet: {}, SPEECH_QUEUE: 9, SPEECH_QUIET: 0, SOUND_SLACK: 2, 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})}, 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: () => { duck: () => {
if (rule === "transmit" && !ducked) { if (rule === "transmit" && !ducked) {
ducked = true; ducked = true;
+1 -1
View File
@@ -55,7 +55,7 @@ function spoken(aloud, bubbles) {
state: {now: 1000, messages: [], speech: {tts: true, gate: {open: true}}}, settings: {bubbles, channels: {...ON, aloud}}, state: {now: 1000, messages: [], speech: {tts: true, gate: {open: true}}}, settings: {bubbles, channels: {...ON, aloud}},
}; };
vm.runInNewContext(speechCode, sandbox); 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"}]); sandbox.speakRows([{ts: 1000, from: "Stage", to: [], class: "security", source: "s2", voice: "v2", word: "W", rest: "R", text: "rotate keys now"}]);
return said; return said;
} }
+5 -2
View File
@@ -449,7 +449,8 @@ METRIC_PROBE = """
const fs = require("fs"); const fs = require("fs");
const vm = require("vm"); const vm = require("vm");
const [panelsFile, resourcesFile, homeFile] = process.argv.slice(1); 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(panelsFile, "utf8"), context);
vm.runInContext(`${fs.readFileSync(resourcesFile, "utf8")}\\n${fs.readFileSync(homeFile, "utf8")}\\nglobalThis.probe = {resourcePin, resourceView, Panels};`, context); vm.runInContext(`${fs.readFileSync(resourcesFile, "utf8")}\\n${fs.readFileSync(homeFile, "utf8")}\\nglobalThis.probe = {resourcePin, resourceView, Panels};`, context);
const {resourcePin, resourceView, Panels} = context.probe; const {resourcePin, resourceView, Panels} = context.probe;
@@ -854,7 +855,9 @@ class TestHomeBookmarks(unittest.TestCase):
class TestHomeTree(HubCase): class TestHomeTree(HubCase):
def served_tree(self) -> str: 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())}}) self.write_council({"rasci.json": {LONG_TASK: long_task(time.time())}})
status, _, body = self.get("/api/tree") status, _, body = self.get("/api/tree")
self.assertEqual(status, 200, body[:300]) self.assertEqual(status, 200, body[:300])
+2 -2
View File
@@ -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): def test_the_run_sees_the_council_and_the_state_home_and_nothing_of_the_hub_environment(self):
order = self.order(NEW_QUEUE, ROWS) 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) order.get(frozenset({"q-1"}), 1000.0)
seen = json.loads(order.script.with_suffix(".env").read_text(encoding="utf-8")) 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.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): class TestHubQueueOverlay(HubCase):
+1 -1
View File
@@ -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}}}, 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}, 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}, 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: () => { silenceBeeps: () => {
run.beeps += 1; run.beeps += 1;
}, },
+2 -1
View File
@@ -333,7 +333,8 @@ AXIS_PROBE = """
const fs = require("fs"); const fs = require("fs");
const vm = require("vm"); const vm = require("vm");
const s = (tag, attrs, ...children) => ({tag, attrs, children: children.flat(), append(...more) { this.children.push(...more); }}); 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); 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 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("")]); .filter((node) => node.tag === "text").map((node) => [Number(node.attrs.x), node.attrs["text-anchor"], node.children.join("")]);
+1 -1
View File
@@ -337,7 +337,7 @@ class TestViewDocument(unittest.TestCase):
valid_view(doc) valid_view(doc)
def test_the_hub_digests_a_selection_exactly_as_panels_js_does(self): 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)) 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): def test_a_metric_pin_id_must_be_the_one_its_view_gives_so_no_view_hides_under_another_charts_id(self):
+1 -1
View File
@@ -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) FRENCH = wav_bytes(1, 2, engines.STT_RATE, b"\x03\x00" * engines.STT_RATE)
HEARD = { HEARD = {
"hallo-welt.wav": {"auto": ["de", "Hallo Welt."], "de": [0.9, "Hallo Welt."], "en": [0.3, "Hollow felt."]}, "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."]}, "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."]}, "french": {"auto": ["fr", "Bonjour le monde."], "de": [0.2, "Bonschur."], "en": [0.6, "Bonjour world."]},
} }
+9 -2
View File
@@ -23,7 +23,9 @@ LIVE_MEMORY = {
SHIPPED = ORGANIZE / "config.default.json" SHIPPED = ORGANIZE / "config.default.json"
DEFAULT = json.loads(SHIPPED.read_text(encoding="utf-8")) DEFAULT = json.loads(SHIPPED.read_text(encoding="utf-8"))
ROW_MEMORY = DEFAULT["memory_limits"] 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 = """ CGROUP_KILL = """
case "$*" in *try-restart*kvb-code-graph*) 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") 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, stubs, home = root / "repo", root / "bin", root / "home"
(repo / "scripts").mkdir(parents=True) (repo / "scripts").mkdir(parents=True)
shutil.copy(INSTALL, repo / "scripts" / "install.sh") 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: for unit in HOME_UNITS:
(repo / "skills" / unit).parent.mkdir(parents=True, exist_ok=True) (repo / "skills" / unit).parent.mkdir(parents=True, exist_ok=True)
(repo / "skills" / unit).write_text("[Unit]\n", encoding="utf-8") (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).write_text(body, encoding="utf-8")
(stubs / name).chmod(0o755) (stubs / name).chmod(0o755)
home.mkdir() home.mkdir()
(home / ".claude").mkdir()
(home / ".claude" / "settings.json").write_text(json.dumps(AGENT_ROOTS), encoding="utf-8")
if binary: if binary:
(home / ".local" / "bin").mkdir(parents=True) (home / ".local" / "bin").mkdir(parents=True)
shutil.copy(stubs / "codebase-memory-mcp", home / ".local" / "bin" / "codebase-memory-mcp") 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( (home / ".config" / "kvb-code-graph" / "config.json").write_text(
'{"queue_file_threshold": 2000, "queue_task": "work/code-graph-index"}\n', encoding="utf-8" '{"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) 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) return done, read_lines(log), read_lines(cbm)
+4 -4
View File
@@ -406,7 +406,7 @@ class TestOperator(unittest.TestCase):
self._add("bad", self.base, "true", "r", "manual") self._add("bad", self.base, "true", "r", "manual")
code, shown, modes = self._terminal(["run"], [ code, shown, modes = self._terminal(["run"], [
(b"Run it?", b"c\n"), (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"Run it?", b"c\n"),
(b"Why cancel?", b"kaputt \xff " + "👀\n".encode()), (b"Why cancel?", b"kaputt \xff " + "👀\n".encode()),
]) ])
@@ -414,17 +414,17 @@ class TestOperator(unittest.TestCase):
self.assertNotIn("Traceback", shown) self.assertNotIn("Traceback", shown)
self.assertEqual(modes, [True, True, True, True, False]) self.assertEqual(modes, [True, True, True, True, False])
register = self._register() 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 � 👀") 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): 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") self._add("paint", self.base, "true", "r", "manual")
code, shown, modes = self._terminal( code, shown, modes = self._terminal(
["granted", "operator/paint", "--dir", str(self.base), "--check", "manual", "--", "/bin/sh", "-ic", "true"], ["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((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): def test_an_interrupt_at_a_prompt_restores_the_terminal_mode(self):
self._add("drop", self.base, "true", "r", "manual") self._add("drop", self.base, "true", "r", "manual")
+6 -3
View File
@@ -73,6 +73,9 @@ def host_sys(root: Path) -> Path:
return root 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: 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}} 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 + 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}, 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)) 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) kept = sampler.retain(rows, NOW)
self.assertEqual([entry["t"] for entry in kept], [day, NOW - 30 * DAY, bucket, bucket + 900, NOW - 60]) 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[1], {**mean, "span": sampler.BUCKET, "width": sampler.BUCKET})
self.assertEqual(kept[2], { 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, "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) 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([entry["t"] for entry in kept], [day - 1000 * DAY, day, edge + sampler.BUCKET, NOW - 60])
self.assertEqual(kept[0], ancient) 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(kept[2:], [late, recent])
self.assertEqual(sampler.retain(kept, NOW), kept) self.assertEqual(sampler.retain(kept, NOW), kept)
later = sampler.retain(kept, NOW + 2 * DAY) later = sampler.retain(kept, NOW + 2 * DAY)