You signed in with another tab or window. Reload to refresh your session.
8000
You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UX and DX: CLI, ctl, MCP, error text, docs and skill truth
Maintainability and house rules
Tests and CI coverage
Each domain gets one comment with its full findings. A last comment gives a verdict for every finding (fix or not, with the reason). A finding marked "fix" gets its own issue, linked from the verdict comment.
The review agent's findings, not yet verified. The verdict comment checks each one before an issue is opened.
A1 A guest kind's assertions never run, so .uml, .krun and .container of a kind test evaluate and boot the wrong thing (high)
Where:
lib.nix:248-253: the toplevel is forced only for kind == "nixos".
lib.nix:530-540: only the run's cfg.assertions are read.
The kind modules: routeros-guest.nix:91, vyos-guest.nix:241, sonic-guest.nix:52, image-guest.nix:258, appliance.nix:115, dinix-guest.nix:196.
Evidence:
Each kind guards its backend with a node assertion, for example "vivarium.routeros boots under QEMU only".
Node assertions throw only when system.build.toplevel is forced, and machineSpec forces it only for NixOS guests.
nix eval --file . checks.routeros.uml.drvPath evaluates. The node's failed assertions are ["vivarium.routeros boots under QEMU only; this guest is uml."].
Control: checks.screen.uml.drvPath (a NixOS guest) throws as it should.
Impact:
For the ten kind tests, three of the four backend variants are wrong runs that evaluate cleanly.
Each fails only after a build and a 180 s boot timeout.
Fix:
Add every node's failed assertions and warnings to failed in lib.nix:530, whatever the guest kind.
Optionally, onBackend leaves a kind that pins its backend alone.
A2 Every guest runs its agent from the host's runner package, so a change to a host-side runner file rebuilds every guest (high; related to #1182)
Where:
modules/guest.nix:348;
modules/default.nix:1040-1042;
pkgs/vivarium-runner/default.nix:11-18.
Evidence:
The agent's ExecStart is vivarium-runner/bin/vivarium-agent. This is the same store path as packages.runner.
The guest closure holds vivarium-runner-0.2.0.drv, which carries backend.py, machine.py, container.py, nixos_test.py, ocr.py, the runner tests and qemu-qmp.
Impact:
An edit to backend.py, to machine.py or to a runner test rebuilds every guest's toplevel, root image and store database.
This holds in every consumer: pynixd, nixkube and easykubenix.
Fix:
Make a separate vivarium-agent package that holds agent.py, arpyc.py, channel.py and the guest half of cloud.py.
The host runner depends on it, not the reverse.
No ./tests in a src that a guest reads.
A3 The backend abstraction leaks: the core branches on backend names, and the entry-point registry cannot be used (high)
time.sleep polls, up to 10 s for the egress and up to 5 s for gvproxy;
qemu-img convert of a whole cloud image;
qemu-img create;
shutil.copytree of a container root file system;
storeview.build.
Impact:
The "parallel" launches run one after another.
The console pumps, the control socket and agent calls stall meanwhile.
Fix: make launch async, or call it through to_thread. The cost of each call is not measured.
A10 Machine is one 2,000-line class with six jobs (medium)
Where:
machine.py: 2,019 lines, Machine at 490-1873;
backend.py: 1,798 lines.
Evidence: Machine covers six areas:
lifecycle and reboot;
console;
agent RPC wrappers;
store views;
memory;
screen and input.
Screen and memory exist on every guest, and on most backends they fail at run time.
Fix:
Split machine.py into spec, guest, agent client, store, screen and memory modules.
Make screen and memory capability objects that a backend gives or does not.
Split backend.py into a backends/ package.
Keep Machine as a facade.
A11 Run assembly sits in the session, and a second, UML-only entry builds its own spec (medium)
Where:
session.py:420-527, 547-605;
vivarium_runner/cli.py:1-40, 91-98;
modules/image.nix:142-146;
default.nix:228, 245.
Evidence:
Session.prepare does mechanism work: segment membership, LAN fds, forward resolution, router wiring.
Its own comment says the shared taken set is wrong for an MCP server that holds several runs.
vivarium-run is UML-only and builds a LaunchSpec by hand. It is still wired in as system.build.vivariumRunner and in the speedtest app.
Fix:
A runner-side Run that owns segments, forwards, routing and instances.
Remove vivarium-run, or rebuild it on mkTest.
A12 Nits
Socket path length: four mechanisms handle it. Krun._gvproxy checks > 107, but macOS's limit is 104, so a 105-107-byte path passes the check and then fails at bind. Use one helper. Confidence: medium.
Duplicated code in backend.py:
the subordinate-id error text, at 849-855 and 1493-1499;
the cleanup after a failed launch, where only the QEMU copy checks poll();
These are the review agent's findings. They are not verified yet.
The numbers come from three sources:
Run reports: 1,624 report.json files and their events.jsonl on disk, from runs between 2026-11-01 and 2026-11-17 on one Linux host, across several revisions of main.
Backend comparison: three runs of the same two-guest uplink test on 2026-11-17, one per backend, named vs-uml, vs-qemu and vs-krun.
nix eval timings: one or two samples each.
S1 Guest launches run one after another, about 0.3 s each; half of a container launch is a host probe that repeats for every guest (high; extends A9)
Where:
backend.py:1644: container.probe runs on every launch.
backend.py:1671: tap_fails.
backend.py:1715: container.scope, a second cgroup probe.
machine.py:680: the launch is synchronous.
Evidence:
A pynixd run with 5 container guests and 1 QEMU guest shows the exec: lines at 0.28, 0.58, 0.89, 1.22, 1.49 and 1.88 s.
Timed inside unshare:
container.probe() takes 82–112 ms;
tap_fails() takes 26 ms;
scope() takes 31–39 ms.
The three probes are 140–175 ms of each 0.3 s step.
These are not the cause: copytree takes 1 ms, and storeview.build takes 19–35 ms.
Impact:
With N guests, the last guest starts about 0.3 × N s late.
The event loop blocks during the launches.
Fix:
Probe the host once per session and cache the result.
Then make launch async. Do not use a thread; see R7.
S2 report.json misreports boot time and leaves out launch and teardown (high)
Where:
machine.py:738: the boot clock starts only after the process is created.
cli.py:627-628: write_output runs before teardown.
report.py:136.
Evidence:
In the run in S1, all six boot steps have at: 1.88.
One guest is reported at 0.15 s. Its exec was at 0.28 s and its ready line at 2.03 s, so the real time is 1.75 s.
Container boot_seconds has a p50 of 1.0 s (n=4,225). The real time is about 1.8 s.
In vs-uml, total_seconds is 94.3 s, but the summary says 96.4 s. The 2.0 s difference is the teardown, which is not in the report.
Impact: this file is the instrument behind "never guess at slowness". It hides the serial launches and never shows teardown.
Fix:
Start the clock before backend.launch, and record launch as its own step.
Record the teardown steps, and write the report after them.
S3 Stage 1 costs QEMU and krun guests 3.75–3.89 s per boot, with an idle 1.00 s inside (high for the numbers; medium for the fix)
Where:
modules/qemu.nix:184: the systemd initrd.
modules/qemu.nix:269-274: the root file system, with fsck.
modules/qemu.nix:354-362: the /nix overlay.
Evidence, from the console, since Nov 1 (QEMU n=1,066, krun n=77):
From the initrd banner to "Welcome", p50: 3.89 s on QEMU, 3.75 s on krun.
Whole boot to "Startup finished", p50: QEMU 8.78 s, krun 8.13 s, UML 8.77 s. UML has no initrd.
Inside stage 1, p50 QEMU / krun:
fsck of a disk that is new on every run: 0.20 / 0.14 s;
from "Mounting /sysroot" to "Mounting /sysroot/nix": 1.00 / 1.00 s (p90 1.02 / 1.00);
from switch root to "Welcome": 1.21 / 1.19 s.
About 2.2 s of this is specific to the initrd.
The cause of the 1.00 s gap is an unmeasured hypothesis: a timer, or a daemon-reload. The early journal is lost (J1), so it cannot be traced.
Fix:
Set fileSystems."/".noCheck = true. The disk comes from mkfs and is new on every run.
Boot once with initrd debug logging to find the 1.00 s.
Longer term: boot QEMU and krun without an initrd, which saves about 2.2 s per boot. That reverses the decision recorded in qemu.nix:3-7.
S4 Teardown takes 18 s p50 for a seven-guest container and QEMU run, and up to 9 s of it has no event (medium; extends #1182)
Where:
session.py:1082-1094;
machine.py:891-940, with POWEROFF_GRACE = 20;
storeview.py:126-148: one bind mount for each closure path;
cli.py:568-574: the drain waits up to 5 s.
Evidence: time from run_finished to the summary, since Nov 14:
guests
p50
p90
n
1
3.4 s
5.0 s
226
2–4
2.3 s
7.3 s
75
5 or more
18.0 s
25.3 s (max 31.5 s)
53
The runs with 5 or more guests are mostly pynixd's suite. Pure UML runs with 5–7 guests take 7–8 s.
Two runs on Nov 17:
each container guest's systemd stops about 770 store mount units, which takes 1.7–5.0 s;
one guest's /artifacts unmount took 7.5 s;
after that, 7.4–8.7 s pass with no event at all.
Impact: about 18 s after the verdict, in CI too, for a guest disk that is thrown away.
Fix:
In a check (--no-control), send SIGKILL after the final drain, or power off with a grace of about 2 s.
Keep the orderly power-off for --hold and interactive runs.
Add events for the reap, the cleanup and the drain.
Present the store to container guests as fewer mounts.
S5 Every phase spends 0.34–0.55 s after its body (medium for the numbers; low for the cause)
Where:
session.py:678-717: settle sends one token RPC to each guest in series, then polls every 20 ms until the token comes back through the journal stream.
session.py:978-981.
Evidence: p50 overhead per phase, by backend, for one guest and for two or more:
backend
1 guest
2 or more
container
0.37 s
0.39 s
UML
0.43 s
0.52 s
QEMU
0.43 s
0.54 s
krun
0.34 s
0.55 s
The RPC itself takes 4–39 ms. The rest is a wait on the journal path, which is not split further.
Impact: 20 phases cost 7–11 s.
Fix:
Send the tokens in parallel.
Measure where the wait goes.
Settle only on failure, at a pause and at the end of the run.
Importing vivarium_runner.agent takes 104–119 ms. It loads 17 modules, because __init__ pulls in machine, backend, qmp and ocr.
It is not on the critical path.
J1 The journal stream drops everything logged before it starts (high; outside speed)
Where: modules/guest.nix:379-397.
Evidence:
The comment says --boot carries everything logged earlier. But journalctl --follow starts with only the last 10 entries, and journalctl(1) says --no-tail shows all of them.
In vs-uml, the first entry in journal.jsonl has __SEQNUM 275.
None of 5,609 journal.jsonl files starts at sequence number 1.
Impact:
The early-boot and initrd journal never reaches events.jsonl.
A boot failure before the stream starts leaves only the console.
These are the review agent's findings. They are not verified yet. The ruff numbers come from the root's ruff 0.16.10, run with vivarium's own ruff.toml and --exclude docs/design.
M1 No gate runs ruff on vivarium, and the code has drifted from its own rules (high)
Neither checks nor CI names vivarium-eval.tests (zuban strict and pytest) or internal.mcp-check. The stated reason is that CI would have to build nanopynix.
check-python loops over the other three packages only.
So 1,312 lines in server.py and cli.py that agents use are untested in CI.
Impact: a change in the runner or the session that breaks the CLI lands green.
Fix: add both to a CI job. nanopynix is already cached for the other sources.
M3 The shared ban list misses three asyncio spellings, so #949 sees a quarter of the sites; cloud.py adds new bare asyncio (high; extends #949)
Where:
machine.py:36, 710, 728, 778, 847-848;
arpyc.py:261, 325;
vivarium/cloud.py:11-215;
vivarium_runner/cloud.py:138;
nix/shared/ruff-anyio.toml.
Evidence:
Not banned: asyncio.ensure_future (7 sites), start_unix_server and open_unix_connection.
from asyncio import subprocess dodges the create_subprocess_exec ban.
The anyio config gives 13 TID251 findings in pkgs/. The 10 unstructured sites above are invisible to it.
machine.py:728, 778, 848 have no comment saying why they stay unstructured, which the rules require.
Extend nix/shared/ruff-anyio.toml through shared-config-update.
Comment or restructure the three machine.py sites.
Write cloud.py with anyio primitives now.
M4 Library modules print, and their output reaches events.jsonl without its machine, or not at all (medium)
Rule: "Never print in the runner: Session.emit is the one way in."
Where:
vivarium_k8s/__init__.py: 13 sites;
forward.py:441, 443, 472, 474;
net.py:342;
session.py:1147;
machine.py:1084.
Evidence:
The captured stdout becomes OUTPUT events with phase= only, so a filter on the k8s guest's name misses every progress line.
net.py:342 and session.py:1147 run at teardown, outside any capture. Their output never reaches log or events.jsonl. That includes the warning for a guest that did not shut down cleanly.
Fix:
Give Machine and the recipes an emit callback.
Route these sites through Session.emit with machine=.
Enforce it with ruff T201, with per-file ignores for the CLIs and the tests.
M5 monitor.py reads events as raw dicts and string literals, beside the typed Event and Kind (medium)
Where:
monitor.py:84-177, 242-270, 334-343;
server.py:105, 327-330;
events.py:51-81.
Evidence:
The monitor compares kind with string literals.
Pause, resume and ready are all kind == "note", told apart by which data key is present.
The channel events carry booleans as the strings "true" and "false".
events.py has no parse function.
Impact:
A rename breaks the monitor and the MCP server silently.
This is the same root cause as the exit-code drift in U3.
Fix:
Add Event.from_dict and a phase-state StrEnum.
Give pause, resume and ready their own kinds.
Type the channel events.
Add a meta test that no module compares a Kind value as a string.
M6 pytestCheck is documented as vivarium.lib.pytestCheck but is not exported (high)
Where: lib.nix:369-386, default.nix:143-165.
Evidence: nix eval --file vivarium lib --apply builtins.attrNames does not list pytestCheck.
Add a check that every vivarium.lib.X named in a /** */ example exists.
M7 Ten checks interpolate all of tests/checks/, so an edit to one check script reruns all ten guest checks (medium)
Rule: every src is a lib.fileset allow-list.
Where:
${../checks}/<script>.py in ten tests/*/default.nix;
tests/check-python/default.nix:23: the whole package directories;
pkgs/vivarium-eval/default.nix:66-67;
tests/check-scripts/default.nix:28.
Impact: minutes of guest time per edit, locally and in the CI sessions job.
Fix: one fileset helper in tests/default.nix that gives harness.py plus the one script.
M8 run.sh is dead, and it is bash (high)
Where: run.sh:11, kept by .gitignore:24.
Evidence:
It builds vivariumRunner. nix eval says that attribute does not exist; it lives at internal.vivariumRunner.
It writes to fixed paths in /tmp.
Nothing references it.
Fix: delete it.
M9 Values written twice (medium)
Uplink addresses:forward.py:387-394, 430 hard-codes 10.0.2.15/.2/.3 and fd00:10:0:2::2, and modules/router.nix:28-33, 125, 326 declares them again. Fix: put them in the spec.
In the green run 43862556000 (main, 2026-11-16), 37 jobs together substituted 40 attempts from lillecarl.cachix.org. No job logged building '…-attempt.drv', so that green run booted no guest.
Two dispatches on commit 554ceb3 both copied uplink-iperf-attempt from the cache.
Impact:
A daily run on unchanged inputs proves nothing.
A cached attempt with status 1 keeps a flake red until an input changes.
A developer who has the cache configured gets CI's verdict from nix build.
The ssh-ng builder store, which is also a trusted substituter, receives every attempt as a build input.
Fix:
Set allowSubstitutes = false on the attempt.
Correct the filter to -vivarium-session-.
Upload a failed attempt as a CI artifact. The accidental cachix push is today the only way to fetch one.
Document nix build --rebuild … <test>.attempt.
T2 Most red jobs in the daily run fail for reasons outside vivarium, and UML tests run on the remote builder (high)
Where:
nix/ci.nix:58: the remote builder is added to every job when the actor is Lillecarl;
ci/workflows.nix:428: a step gets the job's limit minus 10 minutes;
lib.nix:880-900.
Evidence: the one scheduled run, 44104177551, had 49 jobs and 33 of them red.
test-lan and sessions failed with pynixd: store local did not answer QueryValidPathsRequest within 300 s.
test-artifacts, test-reboot, test-reboot-krun and test-screen printed [vivarium] passed. Their step then timed out while it copied a 512 MiB root image to the builder, to build a reader that only runs cat status.
test-container timed out in its 5-minute probe step.
UML attempts and the typecheck derivations build on the remote builder.
Impact:
A red daily run is mostly noise.
The UML results describe the builder host, not the runner.
CI behaves differently for other actors.
Fix:
Set preferLocalBuild = true; allowSubstitutes = false; on both readers.
Decide on purpose where UML attempts run.
Report the pynixd stall as a pynixd issue.
T3 A failed CI run keeps no evidence, and nothing reports it beyond GitHub's default mail (medium)
Evidence:
The workflow has no if: failure() step and no upload-artifact step. pynixd-tests.yml:57 has both.
The build uses --no-link, so the attempt dies with the runner.
The daily run costs 713 runner-minutes.
Fix:
On failure, upload <attr>.attempt.
Add a final job that opens or updates one issue when a scheduled run is red.
T4 22 checks run in no CI job, and no list says which ones are by hand on purpose (high)
Evidence: the checks that no workflow builds, in three groups:
kvm plus uid-range, which the QEMU and container jobs already have:
store-view: store isolation on all four backends;
segments;
backends;
mixed: its file says "the session job has no /dev/kvm", but other jobs have it.
By hand, with a reason in the file:nested, kata, kata-containerd, nixos-screen-tests, appliance, vyos, routeros-route, crio and containerd-zero-layers.
Impact:
These areas can break unnoticed: the cloud API, template launch, the nixos-test shim (a public API), and store isolation.
A new check lands outside CI silently.
Fix:
Move the first two groups into jobs.
Add byHand = { name = "reason"; } in ci/workflows.nix.
Add a check that every name in checks is either in CI or in byHand, in both directions.
T5 The container backend and macOS hardly run in CI, and no contract test runs on all four backends (medium)
Evidence:
No job builds a .container variant. The container backend runs only checks.container and container-lan: one guest each, with no uplink and a read-only store.
forward, artifacts and fuse run on QEMU only.
lan runs on UML and krun-vsock only.
The session rules run on UML only.
No vivarium job runs on macOS. forward.py's darwin branches have only a unit test that patches sys.platform.
The main session checked these findings against the code at a260990: A1, A4, J1, M6, M8, R3 (the mechanism only), T1, U1, U4, and U3 (in part). The others are taken on the review's evidence. Each issue repeats what it carries.
These are the review agent's findings. They are not verified yet. The verdict comment checks each one before an issue is opened.
R1 Host isolation of UML guests in impure runs (high)
The finding gives a path from local access on the host to the runner user's files. It works while an impure run or a vivarium up environment is up. Sandboxed checks are not affected.
It has two causes:
a guest-side file system feature that is not confined;
a guest login whose credentials are well known.
Details: nixidae/security#45 (private).
Fix direction:
confine the host-side mount to a directory for each guest;
give each run its own login key.
Confidence: high for the two mechanisms. The chain is not run end to end.
R2 QEMU guests: host-side trust of guest-written data (medium)
Three places trust data that the guest controls more than they should:
the virtiofs daemon runs without its sandbox;
a guest-written boot description is used without validation;
screenshots are written into a directory the guest can modify.
Details: nixidae/security#46 (private).
Fix direction:
run the sandboxed virtiofs mode;
accept only boot files from the store;
write host-side files outside the shared directory.
Confidence: medium.
R3 After the agent channel closes, a call writes to a closed or reused file descriptor (high; not run)
Where:
arpyc.py: FdStream.write at 125-130, call at 245-246, 277-283 and 329-340, close at 344-354.
machine.py: _reboot at 817-834, crash at 1032-1058, and 1213-1223.
Evidence:
close() runs os.close(fd). It does not stop the _answering tasks, and nothing checks _closed before a write.
Reboot keeps the old AgentControl in _control for up to 180 s.
_boot's socket.socketpair() most likely gets the freed descriptor number back.
So, depending on timing, an execute in that window does one of two things:
raises EBADF;
writes into the new guest's channel and waits out its full timeout. Its stale reply carries the old sequence number.
tests/reboot.py:38 already catches OSError while it polls.
The same happens after crash() or a UML panic, and when a guest deletes its own instance through the cloud API.
Impact:
Errors name the wrong cause.
A command can reach the wrong guest.
Junk can be written to an unrelated descriptor.
Fix:
call and _send raise EOFError at once when the connection is closed.
close() cancels the _answering tasks.
_reboot and crash clear _control.
FdStream.write refuses to write after close.
R4 arpyc writes with a blocking os.write on the event loop (medium-high)
Where:
arpyc.py:85-87, 125-130;
machine.py:676, 770: the socketpair is blocking, and no code calls set_blocking.
Evidence:
A scratch script:
a detached socketpair end is blocking;
a 4 MiB write that nobody reads blocks.
The docstring assumes that every frame is small. A command can carry file contents, and cloud replies are host writes too.
Impact:
A slow guest stalls every console pump, the control socket and the journal follower.
A guest that wedges in the middle of a frame freezes the loop:
fail_after cannot fire;
SIGTERM is not handled;
only SIGKILL ends the run, and it loses the evidence.
Fix: make the descriptor non-blocking. Write through add_writer with a send lock for each connection, or through an anyio stream.
R5 arpyc trusts the peer's frame length, and reports protocol errors as a dead guest (medium)
Where:
arpyc.py:154-158, 285-325;
remote.py:71-76.
Evidence:
A 4-byte length leads straight to readexactly(length), which buffers up to 4 GiB.
serve_forever catches only EOF and OSError.
A brine or zlib error ends the loop inside _serving, a task that nothing awaits. Pending calls then get "connection closed", and _ask says "guest went away".
Cap the frame length and raise a ProtocolError that names the guest.
Pass the real exception to the pending calls.
Keep a client's failure inside its handler.
R6 A timeout inside the guest reaches the host as the wrong error (high)
Where:
agent.py:57-69, 97, 131, 138;
machine.py:1164-1180, 1792-1809;
recipes/boot.py:24.
Evidence: a scratch round trip showed two things:
A guest TimeoutError arrives as a real TimeoutError. So:
a slow dinit boot reads as "guest stopped answering during: system_state";
an execute past its timeout raises a generic exception, not MachineError.
A guest subprocess.TimeoutExpired arrives as a generic rpyc exception with the message ('sleep 5', 0.2). So a systemd boot stuck in starting fails with ('systemctl is-system-running --wait', 180) and lists no failed units.
wait_until_succeeds(cmd, timeout=600) catches only its own TimeoutError. One slow attempt ends the whole wait.
subprocess.run kills only sh, so a pipeline or a backgrounded child keeps running.
Fix:
The agent returns a typed timeout result.
The agent runs each command in its own process group and kills the group.
The host raises MachineError("... timed out after Ns").
_ask does not treat a timeout raised in the guest as silence.
R7 The UML bridge's children have no parent-death signal, and _reap signals only the bridge's group (medium)
The prctl(2) man page says a fork clears the parent-death signal. Neither forked child sets one again.
crash()'s own comment says killing the group alone left the kernel running. Its SIGKILL step therefore also kills the guest's pid. _reap's SIGKILL step does not.
A trap for A9's fix: the parent-death signal follows the thread that forked. With launch in anyio.to_thread, every helper that uses die_with_parent gets SIGKILL when its worker thread retires, after 10 s idle.
Fix:
Call prctl(PR_SET_PDEATHSIG, SIGKILL) in both forked children.
Kill the guest's pid in _reap too.
Spawn helpers from a thread that lives as long as the run.
R8 A run the MCP server started does not die with the server, and a paused run waits forever (medium)
The agent can die without a trace: the vivarium-agent unit has no OOMScoreAdjust and no Restart=. The OOM killer picks the agent first, and a run then looks hung. That is the known CLAUDE.md trap; OOMScoreAdjust = -1000 removes the common cause.
The cloud API has no limits:
With no capacity entry, it has no limit at all.
Any guest can delete any instance.
If this is intended, the docs should say so.
_pending leaks: a cancelled call leaves its _pending entry for the connection's lifetime.
Local exposure: three items about file and socket permissions and about what a guest can reach on the host. Details: nixidae/security#47 (private).
Activity
Lillecarl commentedon Nov 17, 2026
Domain 1: architecture and boundaries
The review agent's findings, not yet verified. The verdict comment checks each one before an issue is opened.
A1 A guest kind's assertions never run, so
.uml,.krunand.containerof a kind test evaluate and boot the wrong thing (high)lib.nix:248-253: the toplevel is forced only forkind == "nixos".lib.nix:530-540: only the run'scfg.assertionsare read.routeros-guest.nix:91,vyos-guest.nix:241,sonic-guest.nix:52,image-guest.nix:258,appliance.nix:115,dinix-guest.nix:196.system.build.toplevelis forced, andmachineSpecforces it only for NixOS guests.nix eval --file . checks.routeros.uml.drvPathevaluates. The node's failed assertions are["vivarium.routeros boots under QEMU only; this guest is uml."].checks.screen.uml.drvPath(a NixOS guest) throws as it should.assertionsandwarningstofailedinlib.nix:530, whatever the guest kind.onBackendleaves a kind that pins its backend alone.A2 Every guest runs its agent from the host's runner package, so a change to a host-side runner file rebuilds every guest (high; related to #1182)
modules/guest.nix:348;modules/default.nix:1040-1042;pkgs/vivarium-runner/default.nix:11-18.ExecStartisvivarium-runner/bin/vivarium-agent. This is the same store path aspackages.runner.vivarium-runner-0.2.0.drv, which carriesbackend.py,machine.py,container.py,nixos_test.py,ocr.py, the runner tests and qemu-qmp.backend.py, tomachine.pyor to a runner test rebuilds every guest's toplevel, root image and store database.vivarium-agentpackage that holdsagent.py,arpyc.py,channel.pyand the guest half ofcloud.py../testsin asrcthat a guest reads.A3 The backend abstraction leaks: the core branches on backend names, and the entry-point registry cannot be used (high)
machine.py:11-12, 448, 644, 648, 666, 1334, 1473, 1483, 1597-1604;backend.py:1522, 1545, 1770-1773;modules/default.nix:208-215, 956-963, 1126-1131;lib.nix:254-263, 815-818;modules/guest.nix:34-61, 300.Machinebranches on the backend name for these:drop_caches;host_memory_kib;MemoryControl = Mconsole | Qmpis a closed union.Krun.launchcallsQemu._scratch_diskandQemu._passt, two private methods of another backend.backend.py:1770says other packages add backends throughvivarium.backendsentry points. On the Nix side, three things stand in the way:vivarium.backendis a closed enum;machineSpecpicksbootby backend name;onBackendspecial-cases qemu and krun.modules/uml.nixexists. UML-only and qemu/krun-only settings live indefault.nixandguest.nix, against the rule.host_memory_kib;modules/uml.nix.A4
--kerneledits backend-private JSON from the session, and krun silently ignores it (high for the code path; not run)session.py:168-187, 427-434;backend.py:1502-1510, 1568-1572;cli.py:158-166._with_kernelswapslaunch.config.kernelandboot.kernel, but krun boots--vmlinux={boot['vmlinux']}.A5 The spec's top level is strict, and its machines are not checked (high evidence, medium impact)
spec.py:29-38, 143-146;machine.py:95-107, 196-226, 307-404;session.py:425-437;lib.nix:214-263.Strictforbids unknown fields, because of a measured skew: an older runner ignoredpythonPath.machinesis a list of plain JSON objects, cast to aTypedDictwithtotal=Falseand read with.get(default).bootis a second launch channel besidelaunch.config, and it mixes boot data with features (nested,display,acpi,efi).bootintolaunch.config, and give each feature a field of its own.A6 A guest kind is bound to one backend through a differently named, shape-detected config section (medium)
backend.py:93-149, 227-246, 765-793, 1096-1179;launch.config.{root,disk,boot}lines.root, QEMUdisk, krunboot.UmlRoot.oftells the kinds apart by the shape of the value ("initrd" in value)._launch_disk, with its own copy of the NIC loop.A7 The agent's RPC surface is written twice, joined by a
cast, and half the agent blocks the channel (medium)machine.py:452-468;agent.py:115-170, 250-254;arpyc.py:250-264.AgentRpcProtocol restates the agent'sexposed_*methods by hand, andcast(AgentRpc, conn.root)joins the two. No check compares them.arpyc._dispatchruns a sync handler inline on the loop. Four handlers call_sh(..., 30)synchronously:unit_state;unit_info;list_units;journal.channel.py, with a test against theexposed_signatures.A8 Two remote-control surfaces, and one makes all of
Machinea wire API (medium)remote.py:35-67;control.py:1-25;pytest_host.py:372-419;vivarium_eval/cli.py:262-268, 375-377.machines.sock(arpyc) runsgetattron any publicMachineattribute, andpytest_hostcalls methods on it by string.vivarium switchsends generated Python asOp.EXEC, whilereloadhas its own op,Op.RELOAD.Machinemember is an unlisted remote API, so a rename breaks only at run time.machines.socka typed allow-list, or fold its calls intocontrol.sock.Op.SWITCH.A9
Backend.launchis synchronous and blocks the event loop that boots guests in parallel (medium; extends #949)backend.py:564-572, 605-634, 781-785, 1207, 1308, 1360, 1465-1478, 1651;machine.py:648, 680;session.py:1120-1138.time.sleeppolls, up to 10 s for the egress and up to 5 s for gvproxy;qemu-img convertof a whole cloud image;qemu-img create;shutil.copytreeof a container root file system;storeview.build.launchasync, or call it throughto_thread. The cost of each call is not measured.A10
Machineis one 2,000-line class with six jobs (medium)Where:
machine.py: 2,019 lines,Machineat 490-1873;backend.py: 1,798 lines.Evidence:
Machinecovers six areas:Screen and memory exist on every guest, and on most backends they fail at run time.
Fix:
machine.pyinto spec, guest, agent client, store, screen and memory modules.backend.pyinto abackends/package.Machineas a facade.A11 Run assembly sits in the session, and a second, UML-only entry builds its own spec (medium)
session.py:420-527, 547-605;vivarium_runner/cli.py:1-40, 91-98;modules/image.nix:142-146;default.nix:228, 245.Session.preparedoes mechanism work: segment membership, LAN fds, forward resolution, router wiring.takenset is wrong for an MCP server that holds several runs.vivarium-runis UML-only and builds aLaunchSpecby hand. It is still wired in assystem.build.vivariumRunnerand in the speedtest app.Runthat owns segments, forwards, routing and instances.vivarium-run, or rebuild it onmkTest.A12 Nits
Krun._gvproxychecks> 107, but macOS's limit is 104, so a 105-107-byte path passes the check and then fails at bind. Use one helper. Confidence: medium.backend.py:poll();backend.py:8says "Both backends";__init__.py:3says "three backends";machine.py:197, 304say "mkTest in flake.nix";machine.py:3-7says "the same three fds";pkgs/vivarium-runner/default.nix:43says "under User-Mode Linux";vivarium_runner/cli.py:24says the agent "serves one request at a time".vivarium-runneris both the mechanism package and the session's executable;control.py,cloud.pyandcli.pyexist in two packages;uml-prefix is on the run directory and the crun names of every backend.session.py:384readsvm._history. A publicconsole_tailwould replace it.machine.py:527falls back toreport.RUN, a per-run module global.Assisted-By: Claude Opus 5.5
Lillecarl commentedon Nov 17, 2026
Domain 3: speed
These are the review agent's findings. They are not verified yet.
The numbers come from three sources:
report.jsonfiles and theirevents.jsonlon disk, from runs between 2026-11-01 and 2026-11-17 on one Linux host, across several revisions of main.nix evaltimings: one or two samples each.S1 Guest launches run one after another, about 0.3 s each; half of a container launch is a host probe that repeats for every guest (high; extends A9)
backend.py:1644:container.proberuns on every launch.backend.py:1671:tap_fails.backend.py:1715:container.scope, a second cgroup probe.machine.py:680: the launch is synchronous.exec:lines at 0.28, 0.58, 0.89, 1.22, 1.49 and 1.88 s.unshare:container.probe()takes 82–112 ms;tap_fails()takes 26 ms;scope()takes 31–39 ms.copytreetakes 1 ms, andstoreview.buildtakes 19–35 ms.launchasync. Do not use a thread; see R7.S2
report.jsonmisreports boot time and leaves out launch and teardown (high)machine.py:738: the boot clock starts only after the process is created.cli.py:627-628:write_outputruns beforeteardown.report.py:136.bootsteps haveat: 1.88.boot_secondshas a p50 of 1.0 s (n=4,225). The real time is about 1.8 s.total_secondsis 94.3 s, but the summary says 96.4 s. The 2.0 s difference is the teardown, which is not in the report.backend.launch, and record launch as its own step.S3 Stage 1 costs QEMU and krun guests 3.75–3.89 s per boot, with an idle 1.00 s inside (high for the numbers; medium for the fix)
modules/qemu.nix:184: the systemd initrd.modules/qemu.nix:269-274: the root file system, with fsck.modules/qemu.nix:354-362: the/nixoverlay.fileSystems."/".noCheck = true. The disk comes frommkfsand is new on every run.qemu.nix:3-7.S4 Teardown takes 18 s p50 for a seven-guest container and QEMU run, and up to 9 s of it has no event (medium; extends #1182)
Where:
session.py:1082-1094;machine.py:891-940, withPOWEROFF_GRACE = 20;storeview.py:126-148: one bind mount for each closure path;cli.py:568-574: the drain waits up to 5 s.Evidence: time from
run_finishedto the summary, since Nov 14:/artifactsunmount took 7.5 s;Impact: about 18 s after the verdict, in CI too, for a guest disk that is thrown away.
Fix:
--no-control), send SIGKILL after the final drain, or power off with a grace of about 2 s.--holdand interactive runs.S5 Every phase spends 0.34–0.55 s after its body (medium for the numbers; low for the cause)
Where:
session.py:678-717:settlesends one token RPC to each guest in series, then polls every 20 ms until the token comes back through the journal stream.session.py:978-981.Evidence: p50 overhead per phase, by backend, for one guest and for two or more:
Impact: 20 phases cost 7–11 s.
Fix:
S6 Nits
wait_for_unitpolls every 0.5 s, andwait_until_succeeds,untilandneverpoll every 1.0 s.checks.lan.drivertakes 4.5–4.9 s,checks.k8s.driver10.0 s, and anextendof one node 3.4–3.7 s.reloadbuilds the whole.driver, so a reload of phases alone pays 4.5–10 s..phasescosts 4.0–4.8 s becausecheckedConfigforces every node'svivarium.nics.diskSize, 512 MiB, for about 17 MiB of content.nix-hashof one image takes 0.55 s, and every change to a guest's closure rebuilds the image.vivarium_runner.agenttakes 104–119 ms. It loads 17 modules, because__init__pulls in machine, backend, qmp and ocr.J1 The journal stream drops everything logged before it starts (high; outside speed)
modules/guest.nix:379-397.--bootcarries everything logged earlier. Butjournalctl --followstarts with only the last 10 entries, andjournalctl(1)says--no-tailshows all of them.journal.jsonlhas__SEQNUM275.journal.jsonlfiles starts at sequence number 1.events.jsonl.--no-tailto thejournalctlarguments.Assisted-By: Claude Opus 5.5
Lillecarl commentedon Nov 17, 2026
Domain 4: UX and DX
These are the review agent's findings. They are not verified yet.
U1 Commands in the docs that pass no
--outfail at argument parsing (high)README.md:48:checks.lan.driverInteractive;docs/reference.md:218and:677.--out(vivarium/cli.py:132-138).driverInteractiveHerepasses none (lib.nix:796).the following arguments are required: --outand exits 2.-- --out ./outto the three lines, or givedriverInteractivea temporary--outby default.nix runline with the runner's parser.U2
vivarium run --helphides every runner flag, andrunwith no--outevaluates and builds before it fails (high)vivarium_eval/cli.py:101-124, 149-170, 435-462.run --helplists only--fileand--until-pause, andup --helplists only--file.vivariumhelp screen:--out,--break,--break-on-failure,--hold,--only;--offline,--serial,--kernel,--cpus,-v/runwith no--outevaluates, builds, execs the runner, and only then fails.upand--until-pausecheck--outfirst.--break-on-failureor--holdthrough--help.--outcosts a whole evaluation and build.runandup, the wayadd_ctlandadd_monitoralready are.--outbefore evaluating.U3 Exit codes collide, and six places list them differently (high)
monitor.py:142-154;vivarium/cli.py:735-737, 750-755, 766, 789-791;vivarium_eval/cli.py:320-321, 364-366, 475-477, 541-559.ctl continue --wait);continue --waiton a running run reads as a failed run.downgives 1 both for "no run" and for "a phase failed".run --until-pausehelp: 0 1 2 4 5;ctl --waithelp: 0 1 4 5 6;monitor: 0-6;howto.md:64-70: 0-4;howto.md:133-135: 0 1 4 5 6;IntEnum, with separate codes for "no run listening" and "refused", outside the verdict range.U4
Machine.succeedreturns stdout and stderr joined, so the howto'sjson.loads(await vm.succeed(...))breaks on any warning (high)agent.py:57-69, 131-132:done.stdout + done.stderr;machine.py:1233-1243;docs/howto.md:379.exec 2>/dev/console(nixos_test.py:107-112). Native phase scripts get no such protection.json.loads(await …succeed(.JSONDecodeErroron the first deprecation warning.U5
.driveris documented as stopping at the first failure, but it runs every independent phase (high)README.md:110;skill/vivarium/SKILL.md:16;lib.nix:788.phases.py:7: "a failed phase skips what depends on it and nothing else"._schedulekeeps launching phases.README.md:98-100contradicts line 110.U6 MCP replies, channel events and failure lines have no size bound, and tools pass raw socket errors (medium-high)
server.py:507-535, 592-627, 653-683;monitor.py:118-121;session.py:927-944;machine.py:1242.SKILL.md:101records a 233k-character reply as a usage rule instead of fixing it.succeedputs its whole output into the phase error. That error is then:request()directly. Beforecontrol.sockexists, they fail with a bareFileNotFoundError.stateon an exited run gives onlyexited N, althoughphases.jsonholds the verdict.limit=0.request()with "still evaluating or building".statereadphases.json.U7 The MCP server cannot reach runs it did not start, against what the howto says (high)
server.py:338-342;howto.md:314-315.Runs.getknows only the runs this server process started.vivarium upenvironment;--outpath or aregistry.runs()id, and add anattachtool.U8 Progress goes to stdout from the runner and to stderr from the CLI, and stderr is never quiet (medium)
vivarium/sinks.py:46-48;vivarium/cli.py:391;vivarium_eval/cli.py:323-374, 407-409, 444-454, 495-497.vivarium run Xprints evaluate and build lines on stderr, then execs the runner. The runner sends every phase line to stdout.switchandreloadprint progress on stderr on every success.uphas to redirect the monitor to keep its stdout clean.-v.U9 The pytest-host guest proxy fails silently on a property and cannot run the waits the howto prescribes (medium; not run)
pytest_host.py:90-110;remote.py:58-68;howto.md:292-295, 371-395.vm.uplink_ip == "10.0.2.15"is always false, andif vm.ip:is always true.until,never,vms.untilandwaiting()cannot cross the proxy, and the howto prescribes exactly those.Any, so zuban catches nothing.untilandneveron the host side, or document the limit.U10 The first-test path has gaps for a user outside nixidae (low-medium; not run)
README.md:34, 55-81, 217-226;docs/getting-started.md:12-16, 53-55;nix/sources.nix:17-18;default.nix:14-19.sources.vivariumand an unboundpkgs.getting-started.md.import <nixpkgs> { }, whichdefault.nixwarns against. A first test may compile the UML kernel.builtins.fetchTreeneeds thefetch-treefeature outside flakes, and no page says so.test-options.mdandguest-options.mdare dead links on GitHub.U11 Nits
howto.md:20-26is stale:control.commands()also printsstop, andreloadandswitchfor a run the CLI started.startdocstring (server.py:453-454) tells agents to setUMBRELLA_DEV: nothing reads that variable.monitor's description says it follows a run that vivarium-mcp started: it follows any run.ctl --waitis a flag, whilemonitor --waittakes seconds;continue/resume,ctl run/run_phase,ctl pytest/run_pytest,--break/breaks;--break-on-startduplicates--break start.driver -- --helpis misleading: it printsusage: vivarium run … --spec SPEC, with--specrequired, although the wrapper already sets it.Machine's positional arguments differ:executeislabel, but the third ofsucceedisenv.timeout=0silently means the default.README.md:188-189) is incomplete: it omitsup,down,lsandclosure.SKILL.md:21omits driver flags:--hold,--serial,--interactive,--kerneland-q.Assisted-By: Claude Opus 5.5
Lillecarl commentedon Nov 17, 2026
Domain 5: maintainability and house rules
These are the review agent's findings. They are not verified yet. The ruff numbers come from the root's ruff 0.16.10, run with vivarium's own
ruff.tomland--exclude docs/design.M1 No gate runs ruff on vivarium, and the code has drifted from its own rules (high)
tests/check-python/default.nix:22-27(zuban only),ci/workflows.nix:522-528,ruff.toml:1-7.ruff checkreports 25 findings: 20 I001, SIM300, RUF022, RUF043 and RUF059.ruff format --checkwould reformat 24 files.ruff.tomlextends the sharedruff.toml, notruff-anyio.toml. So the anyio ban is not configured.docs/design/macos-guest-spike/: 3.14 syntax under apy312target.checks.lintthat runsruff checkwith the anyio config andruff format --check, and run it in thechecksCI job.docs/designandlab.M2 vivarium-eval (the
vivariumCLI andvivarium-mcp) has no gate (high)default.nix:110-114, 250-256,pkgs/vivarium-eval/default.nix:55-72,tests/check-python/default.nix:23.checksnor CI namesvivarium-eval.tests(zuban strict and pytest) orinternal.mcp-check. The stated reason is that CI would have to build nanopynix.check-pythonloops over the other three packages only.server.pyandcli.pythat agents use are untested in CI.M3 The shared ban list misses three asyncio spellings, so #949 sees a quarter of the sites;
cloud.pyadds new bare asyncio (high; extends #949)machine.py:36, 710, 728, 778, 847-848;arpyc.py:261, 325;vivarium/cloud.py:11-215;vivarium_runner/cloud.py:138;nix/shared/ruff-anyio.toml.asyncio.ensure_future(7 sites),start_unix_serverandopen_unix_connection.from asyncio import subprocessdodges thecreate_subprocess_execban.pkgs/. The 10 unstructured sites above are invisible to it.machine.py:728, 778, 848have no comment saying why they stay unstructured, which the rules require.vivarium/cloud.pyis new code (vivarium: guests created at run time, through a cloud API that guests call #1408) and usesasyncio.Event,asyncio.timeout,asyncio.sleepandensure_future.nix/shared/ruff-anyio.tomlthroughshared-config-update.machine.pysites.cloud.pywith anyio primitives now.M4 Library modules print, and their output reaches
events.jsonlwithout itsmachine, or not at all (medium)printin the runner:Session.emitis the one way in."vivarium_k8s/__init__.py: 13 sites;forward.py:441, 443, 472, 474;net.py:342;session.py:1147;machine.py:1084.OUTPUTevents withphase=only, so a filter on the k8s guest's name misses every progress line.net.py:342andsession.py:1147run at teardown, outside any capture. Their output never reacheslogorevents.jsonl. That includes the warning for a guest that did not shut down cleanly.Machineand the recipes an emit callback.Session.emitwithmachine=.M5
monitor.pyreads events as raw dicts and string literals, beside the typedEventandKind(medium)monitor.py:84-177, 242-270, 334-343;server.py:105, 327-330;events.py:51-81.kindwith string literals.kind == "note", told apart by which data key is present."true"and"false".events.pyhas no parse function.Event.from_dictand a phase-stateStrEnum.Kindvalue as a string.M6
pytestCheckis documented asvivarium.lib.pytestCheckbut is not exported (high)lib.nix:369-386,default.nix:143-165.nix eval --file vivarium lib --apply builtins.attrNamesdoes not listpytestCheck.vivarium.lib.Xnamed in a/** */example exists.M7 Ten checks interpolate all of
tests/checks/, so an edit to one check script reruns all ten guest checks (medium)srcis alib.filesetallow-list.${../checks}/<script>.pyin tentests/*/default.nix;tests/check-python/default.nix:23: the whole package directories;pkgs/vivarium-eval/default.nix:66-67;tests/check-scripts/default.nix:28.sessionsjob.tests/default.nixthat givesharness.pyplus the one script.M8
run.shis dead, and it is bash (high)run.sh:11, kept by.gitignore:24.vivariumRunner.nix evalsays that attribute does not exist; it lives atinternal.vivariumRunner./tmp.M9 Values written twice (medium)
forward.py:387-394, 430hard-codes10.0.2.15/.2/.3andfd00:10:0:2::2, andmodules/router.nix:28-33, 125, 326declares them again. Fix: put them in the spec.vivarium_k8s._until(160-200) reimplementsMachine.until.wait_until_succeedsis its own loop, whilewait_until_failscallsuntil.untila progress callback.lib.nix:432-444andlib.nix:880-906. Fix: one Python script.MachineSpec, infrom_jsonand in Nix.backend,kind,seccompanduplink_proxyare typedstrand should beStrEnum.pyedit indexfinds 4 exact duplicates in the test helpers. The index is stale.M10 Exported library attributes lack
/** */doc comments (medium)runner(lib.nix:33),k8s(:52),typeCheck(:127),mkNode(:340),cacheFacts(:446).typeCheckandmkNodeare the functions outside callers call.libname has a/**comment.M11 Comments that tell history, or have gone stale (medium)
lib.nix:3;sinks.py:43;modules/default.nix:603;modules/guest.nix:285, 415;vivarium_k8s/__init__.py:62, 262;session.py:339, 1014;backend.py:1303.lib.nix:44-49: whatsessionis.tests/check-python/default.nix:1: the package list.vivarium/cloud.py:86: "bare asyncio until vivarium: move the runner from bare asyncio to anyio structured concurrency #949".pkgs/, and 46 % invivarium_k8s/__init__.py.M12 Nits (each one a lint can enforce)
from __future__ import annotations: 121 of 219 files lack it. The library files among them:vivarium_k8s/__init__.py;crun_launch.py;vyos-footer.py;modules/instance.py;__init__.py.assertoutside the tests: 6 sites, inmachine.py,forward.py,container.pyandbackend.py. S101 catches them.backend.py:345andcontainer.py:776-777, 877. PLC0415 catches them.sinks.py:178,session.py:1146andpytest_plugin.py:195, 200.noqadirectives name rules that vivarium does not select.os.pathand plainopen(): 41 PTH findings inpkgs/.kernelandimageatmachine.py:98, 112, 203are host paths typedstr.typeCheck's loop (lib.nix:196-205);vivarium-k8s-cniandvivarium-k8s-join(modules/k8s.nix:372, 436). The join script usessedon values the user supplies.lab/router/*.py: these scripts use a shebang for one person's host, and they are in the ruff tree.//that should belib.mkMerge.run.sh.Assisted-By: Claude Opus 5.5
Lillecarl commentedon Nov 17, 2026
Domain 6: tests and CI coverage
These are the review agent's findings. They are not verified yet.
T1 CI publishes every test verdict and replays it later, so a green run can boot no guest, and a flake stays red (high)
ci/lib.nix:67:pushFilter = "(-vivarium-test-)";lib.nix:839-854: the attempt is namedvivarium-session-${name}-attempt;lib.nix:880: the reader.vivarium-test-*, so the filter excludes nothing. Neither derivation setsallowSubstitutes.test-forward(run 44104177551) loggedPushing …-vivarium-session-forward-attempt.lillecarl.cachix.org. No job loggedbuilding '…-attempt.drv', so that green run booted no guest.uplink-iperf-attemptfrom the cache.nix build.ssh-ngbuilder store, which is also a trusted substituter, receives every attempt as a build input.allowSubstitutes = falseon the attempt.-vivarium-session-.nix build --rebuild … <test>.attempt.T2 Most red jobs in the daily run fail for reasons outside vivarium, and UML tests run on the remote builder (high)
nix/ci.nix:58: the remote builder is added to every job when the actor is Lillecarl;ci/workflows.nix:428: a step gets the job's limit minus 10 minutes;lib.nix:880-900.test-lanandsessionsfailed withpynixd: store local did not answer QueryValidPathsRequest within 300 s.test-artifacts,test-reboot,test-reboot-krunandtest-screenprinted[vivarium] passed. Their step then timed out while it copied a 512 MiB root image to the builder, to build a reader that only runscat status.test-containertimed out in its 5-minute probe step.preferLocalBuild = true; allowSubstitutes = false;on both readers.T3 A failed CI run keeps no evidence, and nothing reports it beyond GitHub's default mail (medium)
if: failure()step and noupload-artifactstep.pynixd-tests.yml:57has both.--no-link, so the attempt dies with the runner.<attr>.attempt.T4 22 checks run in no CI job, and no list says which ones are by hand on purpose (high)
sessionsjob:cloudandlaunch(vivarium: guests created at run time, through a cloud API that guests call #1408, the newest feature),python-packages,cache,lan-router,nixos-compat,nixos-testsandsuse.kvmplusuid-range, which the QEMU and container jobs already have:store-view: store isolation on all four backends;segments;backends;mixed: its file says "the session job has no /dev/kvm", but other jobs have it.nested,kata,kata-containerd,nixos-screen-tests,appliance,vyos,routeros-route,crioandcontainerd-zero-layers.byHand = { name = "reason"; }inci/workflows.nix.checksis either in CI or inbyHand, in both directions.T5 The container backend and macOS hardly run in CI, and no contract test runs on all four backends (medium)
.containervariant. The container backend runs onlychecks.containerandcontainer-lan: one guest each, with no uplink and a read-only store.forward,artifactsandfuserun on QEMU only.lanruns on UML and krun-vsock only.forward.py's darwin branches have only a unit test that patchessys.platform.artifacts,forwardandfuseon all four backends.byHand.T6 No negative control for the verdict reader, and a guest that will not stop never fails a check (medium; extends #1165)
lib.nix:433-445, 852-853, 880-900;cli.py:627-628:statusis written before teardown;session.py:1141-1147: teardown swallows each failure.<test>and expects the build to fail.status.leaksphase like pynixd's.testers.testBuildFailureover a failing session and overpytestCheck.write_output.ERRORif any remain.T7 The offline guarantee is printed, never asserted (medium)
tests/phases/uplink.py:1-41,pkgs/vivarium/tests/test_namespace.py:26.uplink.py"prints the answer rather than asserting it".--offlinetest checks only that--netis in theunsharearguments.--offline(vivarium: --offline leaks IPv6 to the internet, and differs from a sandboxed build #1094), and nothing would catch it if it came back.uplink.pyassert the expected answer, and run it in a job with--offline, astest-k8s-pullruns its driver.T8 Unit tests miss pure logic that only guest tests reach (medium)
forward.py:to_args/_specbuilds for passt is never asserted._assignfor two Linux guests with a non-emptytaken.encode/decodehas no round-trip test.parse_spechas no test against whategress_argsproduces.uml-passt-bridge(298 lines) has no tests.spec.py: the_one_kindvalidator is untested.monitor.channel_event: its only direct tests are invivarium-eval, which no gate runs (M2).phases.py:passed()withINTERRUPTED.passed({})isTrue.channel_eventtests intopkgs/vivarium/tests.T9 No local equivalent of the CI matrix (medium)
ci/workflows.nix.internal.ci, alinkFarmof every CIattr, from the same data that renders the workflow. T4's check can reuse it.T10 Nits
ci/workflows.nix:496:test-k8s-pullwaits onkernel, butk8s-pullis a QEMU test. Its comment at 476-490 is stale.ci/workflows.nix:537: the comment says "five checks in one job", but the job lists 18.lib.nix:840): every backend variant has the same attempt name. Add the backend to the name.test_monitor.py:348, 369: both prove an absence by waiting out a timeout. A slow wrong answer passes.test_forward.py:18-27:free_port_abovechecks a port and binds it later, so it can race other processes on darwin.Assisted-By: Claude Opus 5.5
Lillecarl commentedon Nov 17, 2026
Verdicts
The main session checked these findings against the code at a260990: A1, A4, J1, M6, M8, R3 (the mechanism only), T1, U1, U4, and U3 (in part). The others are taken on the review's evidence. Each issue repeats what it carries.
Fix: one issue per theme
--kernelon krun_pending, A7internal.ciSecurity, in the private tracker:
access/mode, socket window and host-loopback reach are nixidae/security#47.Needs a decision
succeedjoins stdout and stderr. The fix breaks the API. The recommendation is stdout only, with stderr streamed as events.Covered by an existing issue, no new one
launch, belongs to vivarium: move the runner from bare asyncio to anyio structured concurrency #949. R7 holds its trap:die_with_parenttogether withto_thread.Will not fix
.driver(4.5–10 s). It waits for huggorm's file watching (Evaluation server: persistent state, watched files, background eval #553). Caching around the evaluator is the wrong layer.qemu.nix:3-7records the decision, and the dinix kind already gives a direct boot where speed matters. vivarium: stage 1 costs QEMU and krun guests about 3.8 s, with an idle 1.00 s inside #1482 takes the cheap part.control.py,cloud.py,cli.py) and theuml-prefix. Renames cost every consumer, and buy only cosmetics.lab/routershebang.lab/is outside every check. vivarium: lint gates, the anyio ban list, and the house rules they would enforce #1487 excludes it from ruff instead.test_monitor.py's timeout-based absence tests. They cannot fail falsely, and an event-based rewrite buys nothing.continue/resumeand similar). Each surface is consistent within itself. Only the duplicate--break-on-startgoes, in vivarium: one exit-code table and a typed event model for the CLI, monitor and MCP #1483.Order
First the ones that make every later measurement and verdict true:
Then #1487, the gates, so that the rest lands under a lint.
Assisted-By: Claude Opus 5.5
Lillecarl commentedon Nov 17, 2026
Domain 2: robustness
These are the review agent's findings. They are not verified yet. The verdict comment checks each one before an issue is opened.
R1 Host isolation of UML guests in impure runs (high)
vivarium upenvironment is up. Sandboxed checks are not affected.R2 QEMU guests: host-side trust of guest-written data (medium)
R3 After the agent channel closes, a call writes to a closed or reused file descriptor (high; not run)
arpyc.py:FdStream.writeat 125-130,callat 245-246, 277-283 and 329-340,closeat 344-354.machine.py:_rebootat 817-834,crashat 1032-1058, and 1213-1223.close()runsos.close(fd). It does not stop the_answeringtasks, and nothing checks_closedbefore a write.AgentControlin_controlfor up to 180 s._boot'ssocket.socketpair()most likely gets the freed descriptor number back.executein that window does one of two things:EBADF;tests/reboot.py:38already catchesOSErrorwhile it polls.crash()or a UML panic, and when a guest deletes its own instance through the cloud API.calland_sendraiseEOFErrorat once when the connection is closed.close()cancels the_answeringtasks._rebootandcrashclear_control.FdStream.writerefuses to write after close.R4 arpyc writes with a blocking
os.writeon the event loop (medium-high)arpyc.py:85-87, 125-130;machine.py:676, 770: the socketpair is blocking, and no code callsset_blocking.fail_aftercannot fire;add_writerwith a send lock for each connection, or through an anyio stream.R5 arpyc trusts the peer's frame length, and reports protocol errors as a dead guest (medium)
arpyc.py:154-158, 285-325;remote.py:71-76.readexactly(length), which buffers up to 4 GiB.serve_forevercatches only EOF andOSError._serving, a task that nothing awaits. Pending calls then get "connection closed", and_asksays "guest went away".machines.sock, the same exception stopslistener.serve. This is the shape of vivarium: a ctl client that disconnects mid-exec ends the run #1166 on the other socket.ProtocolErrorthat names the guest.R6 A timeout inside the guest reaches the host as the wrong error (high)
agent.py:57-69, 97, 131, 138;machine.py:1164-1180, 1792-1809;recipes/boot.py:24.TimeoutErrorarrives as a realTimeoutError. So:executepast its timeout raises a generic exception, notMachineError.subprocess.TimeoutExpiredarrives as a generic rpyc exception with the message('sleep 5', 0.2). So a systemd boot stuck instartingfails with('systemctl is-system-running --wait', 180)and lists no failed units.wait_until_succeeds(cmd, timeout=600)catches only its ownTimeoutError. One slow attempt ends the whole wait.subprocess.runkills onlysh, so a pipeline or a backgrounded child keeps running.MachineError("... timed out after Ns")._askdoes not treat a timeout raised in the guest as silence.R7 The UML bridge's children have no parent-death signal, and
_reapsignals only the bridge's group (medium)pkgs/uml-passt-bridge/src/main.rs:125-158, 171, 295-296;machine.py:985-1008, 1032-1058.crash()'s own comment says killing the group alone left the kernel running. Its SIGKILL step therefore also kills the guest's pid._reap's SIGKILL step does not.launchinanyio.to_thread, every helper that usesdie_with_parentgets SIGKILL when its worker thread retires, after 10 s idle.prctl(PR_SET_PDEATHSIG, SIGKILL)in both forked children._reaptoo.R8 A run the MCP server started does not die with the server, and a paused run waits forever (medium)
vivarium_eval/server.py:278-291, 344-381, 705-722;control.py:669-670.break_on_failureis on by default, and the pause has no time bound.stop_allstops runs one after another. Each stop takes up to 70 s.R9 A pytest phase's timeout and a stop do not reach code that blocks in the worker thread (medium)
session.py:837;pytest_plugin.py:106-109, 148-159;cli.py:812-824.to_thread.run_synccannot be cancelled. A stop then waits untilSTOP_WAIT(300 s) runs out.session.shouldstopand interrupt the worker. pytest-timeout's thread method shows one way.R10 Nits
control.py:705-718acts on_stoppingand_continuingonly after the reply is sent. A client that leaves early loses itsstoporcontinue. Extends vivarium: a ctl client that disconnects mid-exec ends the run #1166.vivarium-agentunit has noOOMScoreAdjustand noRestart=. The OOM killer picks the agent first, and a run then looks hung. That is the known CLAUDE.md trap;OOMScoreAdjust = -1000removes the common cause.capacityentry, it has no limit at all._pendingleaks: a cancelledcallleaves its_pendingentry for the connection's lifetime.Assisted-By: Claude Opus 5.5
vivarium: a guest's launch waits on its helpers without holding the loop