[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C99P8491NMHSKAAEG6TSPQ":3,"skill-same:01M7C99P8491NMHSKAAEG6TSPQ":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7C99P8491NMHSKAAEG6TSPQ","vivarium",null,"Run and debug vivarium tests (nixidae's NixOS test runner on UML, QEMU, krun and container guests) -- choose sandboxed or by-hand runs, wait with `vivarium monitor`, pause on failure and reach into live guests with `vivarium ctl` or the vivarium MCP tools, read events.jsonl. Load before running any vivarium `mkTest`\u002F`fromNixosTest` attribute, a `.driver`, or a test suite that runs in vivarium guests (pynixd, nixkube, easykubenix and others).","nixidae\u002Fnixidae","nixidae","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F314243010?v=4","01M789GD9EED7CKZH51N43BRAE","01M7C999TKC5S1ZA161B2S4GCG",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae\u002Fblob\u002Fmain\u002Fvivarium\u002Fskill\u002Fvivarium\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vivarium\ndescription: Run and debug vivarium tests (nixidae's NixOS test runner on UML, QEMU, krun and container guests) -- choose sandboxed or by-hand runs, wait with `vivarium monitor`, pause on failure and reach into live guests with `vivarium ctl` or the vivarium MCP tools, read events.jsonl. Load before running any vivarium `mkTest`\u002F`fromNixosTest` attribute, a `.driver`, or a test suite that runs in vivarium guests (pynixd, nixkube, easykubenix and others).\n---\n\n# vivarium\n\nA test is `mkTest`: guests (`nodes.\u003Cname>`, NixOS modules) plus phases (`async def test(vms)` files or pytest), ordered by `after`. Every test attribute has run variants; the guests are the same in each.\n\n## Choose the run\n\n| attribute | when |\n| --- | --- |\n| `nix build --file . \u003Ctest>` | the verdict, as CI runs it. No network, no way in. A failure keeps its output: `nix eval --raw --file . \u003Ctest>.attempt` |\n| `nix run --file . \u003Ctest>.driverDebug -- --out DIR` | anything that may fail: pauses at the first failure, guests stay up |\n| `nix run --file . \u003Ctest>.driver -- --out DIR` | by hand, exits at the first failure. Add `--break-on-failure` for the same pause as `driverDebug` |\n| `\u003Ctest>.uml` `.qemu` `.krun` `.container` | the same test on one backend |\n\n- A test that pulls from the internet must run as a driver. In the sandbox it fails on DNS, which reads like a broken test.\n- `--offline` makes a by-hand run match the sandbox. A sandbox failure reproduces this way; there is no way into a sandboxed run.\n- Driver flags: `--break PHASE|start|failure|end`, `--only PHASE` (runs its `after` phases too, nothing after it), `-v` (every command sent), `--keep`, `--cpus [GUEST=]N` \u002F `--cpu-scale [GUEST=]S` (processors of one guest, or of every guest not named; QEMU and krun default to all host cores; MCP `start` takes `cpus`\u002F`cpu_scale` as a number or `{guest: n}`).\n- `--out` may be relative; use a new directory per run, in the scratchpad. Files a container guest wrote there can be owned by a sub-uid and resist `rm` (nixidae\u002Fnixidae#1064): pick a new name instead.\n- Never edit a phase and start a new run to test the edit. Pause and send it, or `vivarium reload` (below).\n\n## Wait\n\nOne command, in the background, run bare: it starts the run detached (its output in `$OUT\u002Frun.log`) and exits at the first pause or at the verdict, with the monitor's codes. The guests stay up after it exits 4.\n\n```sh\nvivarium run \u003Ctest> --out \"$OUT\" --break-on-failure --until-pause    # background\nvivarium ctl --out \"$OUT\" continue --wait                            # after probing: next pause or verdict\n```\n\nWithout the `vivarium` CLI, start the driver and the monitor together, both in the background:\n\n```sh\nnix run --file . \u003Ctest>.driverDebug -- --out \"$OUT\" > \"$OUT.log\" 2>&1   # background\nvivarium monitor \"$OUT\" --quiet                                          # background\n```\n\n- The monitor waits up to `--wait` (1800 s) for the run to start, because the driver evaluates and builds first. No `until [ -e ... ]` loop, no `sleep`. For a run `vivarium run` started, it prints each derivation as it starts building (not with `--quiet`), and exits 2 with the error if evaluating or building fails; `$OUT\u002Fbuild.jsonl` holds every Nix log record, build log lines included.\n- Exit: 0 passed, 1 failed, 2 no verdict (crash, eval error), 3 stream lost or no run started, 4 paused, 5 stopped, 6 ready (an environment). Re-arm after each `continue`, or use `ctl continue --wait`: it exits at the next pause or the verdict with the same codes.\n- `--through-pauses` runs to the verdict; without `--quiet` it also prints each phase start and pass.\n- With a `nix run` driver, the driver's own exit is the other half: a build or eval failure ends the driver and the monitor then times out. Read `$OUT.log` when the driver task ends first.\n- A background task exiting 0 is not a pass. Read the monitor's exit code, `status`, or `phases.json`.\n- Run the monitor bare. `vivarium monitor ... | tail` or `...; echo rc=$?` makes the task exit 0 at a pause; a paused run then reads as \"completed (exit code 0)\".\n- Name what you wait on when you stop: \"waiting on the monitor for \u003Ctest> (task X); then \u003Cnext step>\".\n- Never wait on GitHub Actions. A local pass is the verdict.\n\n## Environments\n\nGuests that stay up after the phases, for work from the host (a cluster to `kubectl` against):\n\n```sh\nvivarium up \u003Ctest> --out \"$OUT\"     # background; exits 0 at ready with access.json on stdout, 4 if a phase failed (paused)\nvivarium ls                         # runs up on this host: state, test, --out\nvivarium down --out \"$OUT\"          # 0 if every phase passed\n```\n\n- `up` is `run --hold` detached; the runner's `--hold` (MCP `start(hold=True)`) pauses at `ready` after the last phase passes. `ctl stop` at ready ends the run with its verdict (exit 0), not `stopped`.\n- Way in, written before boot: `$OUT\u002Faccess.json` (each guest's ssh and forwards), `ssh -F $OUT\u002Fssh_config \u003Cguest>` (root, `vivarium.rootPassword`), `$OUT\u002Faccess\u002F` (what phases write via `vms.access`; `bring_up` writes `access\u002Fkubeconfig` when the control plane forwards 6443, the `modules\u002Fk8s.nix` default).\n- A host port reaches only `vivarium.forward`, fixed at boot; `{ guest = N; }` (no `host`) gets N or the next free port, named in `access.json`. `ctl`, `switch`, `reload` work at ready as at a pause; `continue` at ready runs what a reload added and holds again; only `stop` ends it.\n- Plain Nix: `nix run --file . \u003Ctest>.up -- --out DIR`, in the foreground.\n- `checks.k8s-host`: a one-node cluster, ready to `up`.\n\n## At a pause\n\n`vivarium` is on PATH in the dev shell of each project that runs vivarium tests (`packages.vivarium`, built on huggorm). The run also prints absolute command lines at start and at each pause, and `$OUT\u002Frun.json` holds them, with the test's name, guests, phases and spec. A run the `vivarium` CLI started prints `vivarium` lines; a `nix run` driver prints its runner's path. Never scrape `$OUT.log` for them.\n\n```sh\nvivarium ctl --out \"$OUT\" state\nvivarium ctl --out \"$OUT\" exec 'print(await one.succeed(\"systemctl --failed\"))'\nvivarium ctl --out \"$OUT\" exec - \u003C probe.py\nvivarium ctl --out \"$OUT\" inject .\u002Ftests\u002Fcheck.py        # a file's async def test(vms), read fresh\nvivarium ctl --out \"$OUT\" pytest .\u002Ftests\u002Fguest -- -k etcd\nvivarium ctl --out \"$OUT\" run check                       # a declared phase\nvivarium ctl --out \"$OUT\" continue\nvivarium ctl --out \"$OUT\" continue --wait                # then wait: exit 4 at the next pause, else the verdict\nvivarium ctl --out \"$OUT\" watch                          # progress, pauses, verdict: one line each, to the end\nvivarium ctl --out \"$OUT\" stop                           # end it here, guests down\n```\n\n- `exec`: Python on the host, top-level await; `vms`, `session`, `anyio` and each guest by name in scope; names persist between calls. `exec` and `inject` print the code's output as it comes, and `pytest` one line per case as it ends (`--json`: the whole reply at the end). `exec`, `inject`, `state` and `stop` also work while phases run; `pytest`, `run`, `continue` need a pause.\n- Loop: read the failure, probe with `exec`, edit the test file, `inject`\u002F`pytest` again, repeat until it passes, then `continue`.\n- `inject` reads the phase file fresh, but a helper module on the test's `pythonPath` stays the store copy the run imported. To test an edited helper, name its working-tree directory: `vivarium ctl --out \"$OUT\" inject .\u002Fphases\u002Fx.py --reload .\u002Flib` (repeatable; `pytest` takes it too). The directory goes first on `sys.path`, and the modules it provides are dropped.\n- A run started by `vivarium run \u003Cattr>` also prints `vivarium reload --out O`: evaluate the test again and give the paused run its edited phases (scripts, pytest specs, `after`, `nodes`, settings), guests kept. Then `ctl run \u003Cphase>` or `continue`. Refused if a guest changed. A phase that ran keeps its verdict until run again.\n- A run started by `vivarium run \u003Cattr>` also prints a `switch` line (`vivarium switch --out O --node N --module .\u002Fmodule.nix`; the attribute comes from `run.json`): edit a NixOS module, switch one guest to it, no new run. A `nix run` driver prints none.\n- `ctl stop` ends the run, paused or running: guests down, exit 5, verdict `stopped`. It returns once the run has exited. Never kill the driver by pid or pattern.\n- `ctl state` prints `paused before \u003Cphase>` (or `running`), then `phase\\tstate`, with the first line of the error on a failed phase. `ctl --json \u003Cop>` prints the whole reply as one JSON object: `pause`, `state`, `errors` (full text).\n- Do not pipe `ctl` into `tail`\u002F`head`: a refusal goes to stderr and exit 1, and the pipe hides both.\n- Guest helpers: `succeed`, `execute` (rc, out), `fail`, `wait_for_unit`, `wait_until_succeeds`\u002F`wait_until_fails(cmd, timeout)`, `until(what, check, timeout, evidence=)` (async check returns a value, or `None` for not yet), `never(what, check, timeout)`, `vms.until(what, check(vm), timeout, machines=)`: no hand-written retry loops. `journal(unit)`, `processes()`, `meminfo()`, `switch_to(name)`, screen methods on QEMU guests with `vivarium.display`.\n- Links: `await vms.segment(\"core\").cut(\"leaf1\")` \u002F `.restore(...)` drops a member's frames on the host, carrier up; `.capture()` writes `\u003Cout>\u002Fpcap\u002Fcore.pcap` (`segments.core.capture = true`: from boot). Only a hub segment (`segments.core.hub = true`, or three members); no `nft` or `tcpdump` in the guest. By hand: `vivarium ctl --out \"$OUT\" segment core cut leaf1`.\n\n## MCP\n\nThe `vivarium` server (`vivarium-mcp`) does the same through tools: `start(attr, file, env, breaks, break_on_failure, only, hold)`, `state`, `exec`, `inject`, `run_pytest`, `run_phase`, `resume`, `segment`, `switch`, `reload`, `screenshot`, `events`, `runs`, `stop`.\n\n- `start` takes `attr` (with `file`, the directory or file to evaluate) or `spec`, never `file` alone. It runs with `--break-on-failure`.\n- `start` returns `monitor`: run it with the Monitor tool or in the background, exactly as above.\n- The `vivarium-runs` mod (`share\u002Fclaude-plugins\u002Fvivarium-runs`, if loaded) shows each run in a pane with Continue and Stop; it follows `start` and `vivarium run --out \u003Cliteral>` by itself, `\u002Fvivarium-runs \u003Cout>` any other.\n- `events` replies have no size limit: always pass `kind`, `machine`, `phase` or `contains`, and a small `limit`. One unfiltered `case` query returned 233k characters.\n\n## Evidence\n\nIn `--out` (by hand) or `result\u002F` \u002F `.attempt` (sandboxed):\n\n| file | holds |\n| --- | --- |\n| `run.json` | written before the first guest boots: `vivarium` (the CLI), `socket`, `pid`, `commands` |\n| `events.jsonl` | every event, with `kind`, `machine`, `phase`, `seconds`. Query with `jq`, not grep |\n| `phases.json` | each phase's state and why one was skipped |\n| `console\u002F\u003Cguest>.log` | one guest's console |\n| `log` | everything, readable |\n| `report.json` | where the time went: `.slowest`, `.by_command` |\n| `artifacts\u002F\u003Cguest>\u002F` | what the guest wrote to `\u002Fartifacts`, including `journal.jsonl` |\n\n```sh\njq -r 'select(.kind==\"phase_finished\") | \"\\(.phase)\\t\\(.data.state)\"' \"$OUT\u002Fevents.jsonl\"\njq -c 'select(.kind==\"journal\" and .data.priority \u003C= 3)' \"$OUT\u002Fevents.jsonl\"\njq -c 'select(.kind==\"case\" and .data.outcome==\"failed\") | .text' \"$OUT\u002Fevents.jsonl\"\n```\n\n## Traps\n\n- `vivarium.memory` below ~192M OOM-kills the guest agent; it looks like a hang.\n- A guest agent failure surfaces as an exception from `vm.execute`; the traceback is in `await vm.journal(\"vivarium-agent\")`.\n- Writes to `\u002Fnix\u002Fstore` in a guest vanish at poweroff, by design.\n- A run cleans up however it ends, SIGKILL included. A guest process (QEMU, libkrun, UML) left after the run ended is a vivarium bug worth an issue.\n- The working copy reaches a run only through Nix: in a jj repository a new file needs a jj command first.\n","# vivarium\n\nA test is `mkTest`: guests (`nodes.\u003Cname>`, NixOS modules) plus phases (`async def test(vms)` files or pytest), ordered by `after`. Every test attribute has run variants; the guests are the same in each.\n\n## Choose the run\n\n| attribute | when |\n| --- | --- |\n| `nix build --file . \u003Ctest>` | the verdict, as CI runs it. No network, no way in. A failure keeps its output: `nix eval --raw --file . \u003Ctest>.attempt` |\n| `nix run --file . \u003Ctest>.driverDebug -- --out DIR` | anything that may fail: pauses at the first failure, guests stay up |\n| `nix run --file . \u003Ctest>.driver -- --out DIR` | by hand, exits at the first failure. Add `--break-on-failure` for the same pause as `driverDebug` |\n| `\u003Ctest>.uml` `.qemu` `.krun` `.container` | the same test on one backend |\n\n- A test that pulls from the internet must run as a driver. In the sandbox it fails on DNS, which reads like a broken test.\n- `--offline` makes a by-hand run match the sandbox. A sandbox failure reproduces this way; there is no way into a sandboxed run.\n- Driver flags: `--break PHASE|start|failure|end`, `--only PHASE` (runs its `after` phases too, nothing after it), `-v` (every command sent), `--keep`, `--cpus [GUEST=]N` \u002F `--cpu-scale [GUEST=]S` (processors of one guest, or of every guest not named; QEMU and krun default to all host cores; MCP `start` takes `cpus`\u002F`cpu_scale` as a number or `{guest: n}`).\n- `--out` may be relative; use a new directory per run, in the scratchpad. Files a container guest wrote there can be owned by a sub-uid and resist `rm` (nixidae\u002Fnixidae#1064): pick a new name instead.\n- Never edit a phase and start a new run to test the edit. Pause and send it, or `vivarium reload` (below).\n\n## Wait\n\nOne command, in the background, run bare: it starts the run detached (its output in `$OUT\u002Frun.log`) and exits at the first pause or at the verdict, with the monitor's codes. The guests stay up after it exits 4.\n\n```sh\nvivarium run \u003Ctest> --out \"$OUT\" --break-on-failure --until-pause    # background\nvivarium ctl --out \"$OUT\" continue --wait                            # after probing: next pause or verdict\n```\n\nWithout the `vivarium` CLI, start the driver and the monitor together, both in the background:\n\n```sh\nnix run --file . \u003Ctest>.driverDebug -- --out \"$OUT\" > \"$OUT.log\" 2>&1   # background\nvivarium monitor \"$OUT\" --quiet                                          # background\n```\n\n- The monitor waits up to `--wait` (1800 s) for the run to start, because the driver evaluates and builds first. No `until [ -e ... ]` loop, no `sleep`. For a run `vivarium run` started, it prints each derivation as it starts building (not with `--quiet`), and exits 2 with the error if evaluating or building fails; `$OUT\u002Fbuild.jsonl` holds every Nix log record, build log lines included.\n- Exit: 0 passed, 1 failed, 2 no verdict (crash, eval error), 3 stream lost or no run started, 4 paused, 5 stopped, 6 ready (an environment). Re-arm after each `continue`, or use `ctl continue --wait`: it exits at the next pause or the verdict with the same codes.\n- `--through-pauses` runs to the verdict; without `--quiet` it also prints each phase start and pass.\n- With a `nix run` driver, the driver's own exit is the other half: a build or eval failure ends the driver and the monitor then times out. Read `$OUT.log` when the driver task ends first.\n- A background task exiting 0 is not a pass. Read the monitor's exit code, `status`, or `phases.json`.\n- Run the monitor bare. `vivarium monitor ... | tail` or `...; echo rc=$?` makes the task exit 0 at a pause; a paused run then reads as \"completed (exit code 0)\".\n- Name what you wait on when you stop: \"waiting on the monitor for \u003Ctest> (task X); then \u003Cnext step>\".\n- Never wait on GitHub Actions. A local pass is the verdict.\n\n## Environments\n\nGuests that stay up after the phases, for work from the host (a cluster to `kubectl` against):\n\n```sh\nvivarium up \u003Ctest> --out \"$OUT\"     # background; exits 0 at ready with access.json on stdout, 4 if a phase failed (paused)\nvivarium ls                         # runs up on this host: state, test, --out\nvivarium down --out \"$OUT\"          # 0 if every phase passed\n```\n\n- `up` is `run --hold` detached; the runner's `--hold` (MCP `start(hold=True)`) pauses at `ready` after the last phase passes. `ctl stop` at ready ends the run with its verdict (exit 0), not `stopped`.\n- Way in, written before boot: `$OUT\u002Faccess.json` (each guest's ssh and forwards), `ssh -F $OUT\u002Fssh_config \u003Cguest>` (root, `vivarium.rootPassword`), `$OUT\u002Faccess\u002F` (what phases write via `vms.access`; `bring_up` writes `access\u002Fkubeconfig` when the control plane forwards 6443, the `modules\u002Fk8s.nix` default).\n- A host port reaches only `vivarium.forward`, fixed at boot; `{ guest = N; }` (no `host`) gets N or the next free port, named in `access.json`. `ctl`, `switch`, `reload` work at ready as at a pause; `continue` at ready runs what a reload added and holds again; only `stop` ends it.\n- Plain Nix: `nix run --file . \u003Ctest>.up -- --out DIR`, in the foreground.\n- `checks.k8s-host`: a one-node cluster, ready to `up`.\n\n## At a pause\n\n`vivarium` is on PATH in the dev shell of each project that runs vivarium tests (`packages.vivarium`, built on huggorm). The run also prints absolute command lines at start and at each pause, and `$OUT\u002Frun.json` holds them, with the test's name, guests, phases and spec. A run the `vivarium` CLI started prints `vivarium` lines; a `nix run` driver prints its runner's path. Never scrape `$OUT.log` for them.\n\n```sh\nvivarium ctl --out \"$OUT\" state\nvivarium ctl --out \"$OUT\" exec 'print(await one.succeed(\"systemctl --failed\"))'\nvivarium ctl --out \"$OUT\" exec - \u003C probe.py\nvivarium ctl --out \"$OUT\" inject .\u002Ftests\u002Fcheck.py        # a file's async def test(vms), read fresh\nvivarium ctl --out \"$OUT\" pytest .\u002Ftests\u002Fguest -- -k etcd\nvivarium ctl --out \"$OUT\" run check                       # a declared phase\nvivarium ctl --out \"$OUT\" continue\nvivarium ctl --out \"$OUT\" continue --wait                # then wait: exit 4 at the next pause, else the verdict\nvivarium ctl --out \"$OUT\" watch                          # progress, pauses, verdict: one line each, to the end\nvivarium ctl --out \"$OUT\" stop                           # end it here, guests down\n```\n\n- `exec`: Python on the host, top-level await; `vms`, `session`, `anyio` and each guest by name in scope; names persist between calls. `exec` and `inject` print the code's output as it comes, and `pytest` one line per case as it ends (`--json`: the whole reply at the end). `exec`, `inject`, `state` and `stop` also work while phases run; `pytest`, `run`, `continue` need a pause.\n- Loop: read the failure, probe with `exec`, edit the test file, `inject`\u002F`pytest` again, repeat until it passes, then `continue`.\n- `inject` reads the phase file fresh, but a helper module on the test's `pythonPath` stays the store copy the run imported. To test an edited helper, name its working-tree directory: `vivarium ctl --out \"$OUT\" inject .\u002Fphases\u002Fx.py --reload .\u002Flib` (repeatable; `pytest` takes it too). The directory goes first on `sys.path`, and the modules it provides are dropped.\n- A run started by `vivarium run \u003Cattr>` also prints `vivarium reload --out O`: evaluate the test again and give the paused run its edited phases (scripts, pytest specs, `after`, `nodes`, settings), guests kept. Then `ctl run \u003Cphase>` or `continue`. Refused if a guest changed. A phase that ran keeps its verdict until run again.\n- A run started by `vivarium run \u003Cattr>` also prints a `switch` line (`vivarium switch --out O --node N --module .\u002Fmodule.nix`; the attribute comes from `run.json`): edit a NixOS module, switch one guest to it, no new run. A `nix run` driver prints none.\n- `ctl stop` ends the run, paused or running: guests down, exit 5, verdict `stopped`. It returns once the run has exited. Never kill the driver by pid or pattern.\n- `ctl state` prints `paused before \u003Cphase>` (or `running`), then `phase\\tstate`, with the first line of the error on a failed phase. `ctl --json \u003Cop>` prints the whole reply as one JSON object: `pause`, `state`, `errors` (full text).\n- Do not pipe `ctl` into `tail`\u002F`head`: a refusal goes to stderr and exit 1, and the pipe hides both.\n- Guest helpers: `succeed`, `execute` (rc, out), `fail`, `wait_for_unit`, `wait_until_succeeds`\u002F`wait_until_fails(cmd, timeout)`, `until(what, check, timeout, evidence=)` (async check returns a value, or `None` for not yet), `never(what, check, timeout)`, `vms.until(what, check(vm), timeout, machines=)`: no hand-written retry loops. `journal(unit)`, `processes()`, `meminfo()`, `switch_to(name)`, screen methods on QEMU guests with `vivarium.display`.\n- Links: `await vms.segment(\"core\").cut(\"leaf1\")` \u002F `.restore(...)` drops a member's frames on the host, carrier up; `.capture()` writes `\u003Cout>\u002Fpcap\u002Fcore.pcap` (`segments.core.capture = true`: from boot). Only a hub segment (`segments.core.hub = true`, or three members); no `nft` or `tcpdump` in the guest. By hand: `vivarium ctl --out \"$OUT\" segment core cut leaf1`.\n\n## MCP\n\nThe `vivarium` server (`vivarium-mcp`) does the same through tools: `start(attr, file, env, breaks, break_on_failure, only, hold)`, `state`, `exec`, `inject`, `run_pytest`, `run_phase`, `resume`, `segment`, `switch`, `reload`, `screenshot`, `events`, `runs`, `stop`.\n\n- `start` takes `attr` (with `file`, the directory or file to evaluate) or `spec`, never `file` alone. It runs with `--break-on-failure`.\n- `start` returns `monitor`: run it with the Monitor tool or in the background, exactly as above.\n- The `vivarium-runs` mod (`share\u002Fclaude-plugins\u002Fvivarium-runs`, if loaded) shows each run in a pane with Continue and Stop; it follows `start` and `vivarium run --out \u003Cliteral>` by itself, `\u002Fvivarium-runs \u003Cout>` any other.\n- `events` replies have no size limit: always pass `kind`, `machine`, `phase` or `contains`, and a small `limit`. One unfiltered `case` query returned 233k characters.\n\n## Evidence\n\nIn `--out` (by hand) or `result\u002F` \u002F `.attempt` (sandboxed):\n\n| file | holds |\n| --- | --- |\n| `run.json` | written before the first guest boots: `vivarium` (the CLI), `socket`, `pid`, `commands` |\n| `events.jsonl` | every event, with `kind`, `machine`, `phase`, `seconds`. Query with `jq`, not grep |\n| `phases.json` | each phase's state and why one was skipped |\n| `console\u002F\u003Cguest>.log` | one guest's console |\n| `log` | everything, readable |\n| `report.json` | where the time went: `.slowest`, `.by_command` |\n| `artifacts\u002F\u003Cguest>\u002F` | what the guest wrote to `\u002Fartifacts`, including `journal.jsonl` |\n\n```sh\njq -r 'select(.kind==\"phase_finished\") | \"\\(.phase)\\t\\(.data.state)\"' \"$OUT\u002Fevents.jsonl\"\njq -c 'select(.kind==\"journal\" and .data.priority \u003C= 3)' \"$OUT\u002Fevents.jsonl\"\njq -c 'select(.kind==\"case\" and .data.outcome==\"failed\") | .text' \"$OUT\u002Fevents.jsonl\"\n```\n\n## Traps\n\n- `vivarium.memory` below ~192M OOM-kills the guest agent; it looks like a hang.\n- A guest agent failure surfaces as an exception from `vm.execute`; the traceback is in `await vm.journal(\"vivarium-agent\")`.\n- Writes to `\u002Fnix\u002Fstore` in a guest vanish at poweroff, by design.\n- A run cleans up however it ends, SIGKILL included. A guest process (QEMU, libkrun, UML) left after the run ended is a vivarium bug worth an issue.\n- The working copy reaches a run only through Nix: in a jj repository a new file needs a jj command first.\n",{"name":5,"description":7},"main","17aad688ef361318255894a9ab3844b0c68a6215","vivarium\u002Fskill\u002Fvivarium",0,"https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae","https:\u002F\u002Fgithub.com\u002Fnixidae","2026-11-15 05:51:34",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add nixidae\u002Fnixidae --skill vivarium",{"tool":36,"command":37},"bunx","bunx skills add nixidae\u002Fnixidae --skill vivarium",{"tool":39,"command":40},"pnpm","pnpm dlx skills add nixidae\u002Fnixidae --skill vivarium","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae\u002Fblob\u002Fmain\u002Fvivarium\u002Fskill\u002Fvivarium\u002FSKILL.md",true,[],[45,53,60],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":49,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7C99HKGGPHD4HF60TXJMYJP","pytest-agent","How to run pytest and read its results when the pytest-agent plugin is installed. Use when running tests, investigating a test failure, deciding whether a failure is new, re-running failures, profiling a slow test, or diagnosing a hung or killed run.","https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae\u002Fblob\u002Fmain\u002Fnanopynix\u002Fpytest-agent\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae\u002Fblob\u002Fmain\u002Fnanopynix\u002Fpytest-agent\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M7C99DB517Q033RZ410V2GJ4","pynix","Run Nix through the pynix CLI instead of the nix CLI -- eval, build, develop, print-dev-env, path-info, log, why-depends, copy, store, search, flake, config, registry. Load before any Nix command; fall back to nix only for what pynix lacks.","https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae\u002Fblob\u002Fmain\u002Fnanopynix\u002Fpynix\u002Fskill\u002Fpynix\u002FSKILL.md",[],[],{"skillNo":61,"name":47,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7C99C68W1E4F6H7HP9DEPHC","https:\u002F\u002Fgithub.com\u002Fnixidae\u002Fnixidae\u002Fblob\u002Fmain\u002Fnanopynix\u002F.claude\u002Fskills\u002Fpytest-agent\u002FSKILL.md",[],[]]