Files

4411 lines
1.2 MiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>devvm – Contributing</title><link>https://next.devvm.dev/docs/contributing/</link><description>Recent content in Contributing on devvm</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://next.devvm.dev/docs/contributing/index.xml" rel="self" type="application/rss+xml"/><item><title>Testing on other hosts</title><link>https://next.devvm.dev/docs/contributing/testing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/testing/</guid><description>
&lt;p&gt;For contributors. The everyday tests, CLI tests and end-to-end tests are in &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;Contributing&lt;/a&gt;, and how to raise a package&amp;rsquo;s coverage baseline is in &lt;a href="https://next.devvm.dev/docs/contributing/tests/#coverage"&gt;Coverage&lt;/a&gt;; this page is about running them on a host other than your Mac.&lt;/p&gt;
&lt;h2 data-hextra-search-id="whats-platform-specific"&gt;What&amp;rsquo;s platform-specific&lt;span class="hx:absolute hx:-mt-20" id="whats-platform-specific"&gt;&lt;/span&gt;
&lt;a href="#whats-platform-specific" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The same code and tests run on macOS and Linux; what differs is behind build tags in &lt;code&gt;internal/platform&lt;/code&gt; and the backend&amp;rsquo;s own checks:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Linux&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VMs&lt;/td&gt;
&lt;td&gt;Lima on Apple&amp;rsquo;s Virtualization framework (&lt;code&gt;vz&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Lima on QEMU with KVM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mounts&lt;/td&gt;
&lt;td&gt;virtiofs&lt;/td&gt;
&lt;td&gt;9p, one mount per share per guest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project VM disks&lt;/td&gt;
&lt;td&gt;APFS copy-on-write clones of the image&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;qcow2 overlays of the image&amp;rsquo;s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Confined tiers&lt;/td&gt;
&lt;td&gt;the VM&amp;rsquo;s Lima process under a macOS sandbox&lt;/td&gt;
&lt;td&gt;QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; and a &lt;code&gt;guestfwd&lt;/code&gt; to the proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/td&gt;
&lt;td&gt;locked with &lt;code&gt;chflags&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;read-only in QEMU&amp;rsquo;s namespace, or, where the kernel refuses it, watched, and devvm says so (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#linux-hosts"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Set-id files&lt;/td&gt;
&lt;td&gt;dropped by virtiofs&lt;/td&gt;
&lt;td&gt;reach the host: new VMs check for them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tokens&lt;/td&gt;
&lt;td&gt;the Keychain&lt;/td&gt;
&lt;td&gt;files only you can read, in &lt;code&gt;~/.local/share/devvm/secrets/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The CA&lt;/td&gt;
&lt;td&gt;kept out of Time Machine&lt;/td&gt;
&lt;td&gt;no backup to keep it out of&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The end-to-end tests check each side where they run: on Linux, the &lt;code&gt;.git&lt;/code&gt; protection checks look at QEMU&amp;rsquo;s namespace and what root in the VM can do, or, on a host whose kernel refuses the namespace, that it&amp;rsquo;s off and devvm says so, and the Keychain check is left out. The CLI tests run as on a Linux host that can&amp;rsquo;t pin (&lt;code&gt;DEVVM_PINS&lt;/code&gt;), whatever the host&amp;rsquo;s kernel allows, and the unit tests that pin for real (&lt;code&gt;TestRunPinned&lt;/code&gt;, &lt;code&gt;TestProbePin&lt;/code&gt;) run only on a Linux host that allows it.&lt;/p&gt;
&lt;p&gt;On macOS, the end-to-end tests also need OpenSSL as &lt;code&gt;openssl&lt;/code&gt;, because its CA checks serve HTTPS with &lt;code&gt;openssl s_server&lt;/code&gt;, and the LibreSSL that macOS ships as &lt;code&gt;/usr/bin/openssl&lt;/code&gt; cuts the VM&amp;rsquo;s OpenSSL client off mid-request. Install it with &lt;code&gt;brew install openssl@3&lt;/code&gt;, then put &lt;code&gt;$(brew --prefix openssl@3)/bin&lt;/code&gt; first on your &lt;code&gt;PATH&lt;/code&gt;, because Homebrew doesn&amp;rsquo;t link it into its own &lt;code&gt;bin&lt;/code&gt;. On Linux, &lt;code&gt;openssl&lt;/code&gt; is OpenSSL, and Ubuntu&amp;rsquo;s images have it installed, as &lt;code&gt;ca-certificates&lt;/code&gt; needs it.&lt;/p&gt;
&lt;p&gt;Before it builds anything, the runner checks every command of this machine&amp;rsquo;s that the chosen sections use. It always checks &lt;code&gt;limactl&lt;/code&gt; and &lt;code&gt;pkill&lt;/code&gt;, and each section lists the others it needs in &lt;code&gt;tests/e2e/sections_test.go&lt;/code&gt;, such as &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;openssl&lt;/code&gt;, which must be OpenSSL and not LibreSSL, OpenSSH&amp;rsquo;s &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;ssh-agent&lt;/code&gt;, &lt;code&gt;ssh-add&lt;/code&gt; and &lt;code&gt;ssh-keygen&lt;/code&gt;, &lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;ps&lt;/code&gt;, &lt;code&gt;lsof&lt;/code&gt; on macOS or &lt;code&gt;ss&lt;/code&gt; on Linux, and &lt;code&gt;python3&lt;/code&gt;. When any of them is missing, e2e lists each one with the command that installs it, through Homebrew on macOS or &lt;code&gt;apt-get&lt;/code&gt; or &lt;code&gt;dnf&lt;/code&gt; on Linux, and stops. It needs Go too, or mise, which installs the repo&amp;rsquo;s pinned Go.&lt;/p&gt;
&lt;h2 data-hextra-search-id="linux-hosts"&gt;Linux hosts&lt;span class="hx:absolute hx:-mt-20" id="linux-hosts"&gt;&lt;/span&gt;
&lt;a href="#linux-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Test in a Lima VM with nested virtualization, which needs an M3 or newer and macOS 15 or newer. Give it a Lima home of its own, so its VMs stay apart from yours:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Make it from Lima&amp;rsquo;s Ubuntu template, with nested virtualization, room for nested VMs, its user at uid 1000, and only the repo mounted, read-only:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; /tmp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;LIMA_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/.lt-linux-go
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;limactl create --name&lt;span class="o"&gt;=&lt;/span&gt;linuxhost --tty&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; --vm-type&lt;span class="o"&gt;=&lt;/span&gt;vz --cpus&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt; --memory&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;16&lt;/span&gt; --disk&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;150&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --containerd&lt;span class="o"&gt;=&lt;/span&gt;none --set &lt;span class="s1"&gt;&amp;#39;.nestedVirtualization=true | .user.uid=1000&amp;#39;&lt;/span&gt; --mount &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; template:ubuntu-24.04
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;limactl edit --tty&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; --set &lt;span class="s1"&gt;&amp;#39;.mounts=[{&amp;#34;location&amp;#34;:&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$REPO&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#34;,&amp;#34;writable&amp;#34;:false}]&amp;#39;&lt;/span&gt; linuxhost
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;limactl start --tty&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt; linuxhost&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run it from the main checkout of the repo, which the VM mounts at the same path, and not from a git worktree. A worktree&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; is a file that points into the main checkout&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; folder, outside the mount, so git in the VM can&amp;rsquo;t read it, and the VM&amp;rsquo;s only mount goes when the worktree does. &lt;code&gt;--mount&lt;/code&gt; alone keeps the template&amp;rsquo;s home mount, hence the edit. Lima gives the VM&amp;rsquo;s user your Mac&amp;rsquo;s uid unless &lt;code&gt;user.uid&lt;/code&gt; sets another, and a Mac&amp;rsquo;s first user has uid 501. Most Linux hosts&amp;rsquo; first user has uid 1000, and so does the user that some container images ship, such as the &lt;code&gt;ubuntu&lt;/code&gt; user of Ubuntu&amp;rsquo;s images. With the VM&amp;rsquo;s user at uid 1000, the end-to-end tests&amp;rsquo; &lt;code&gt;from&lt;/code&gt; section meets that clash, as devvm does on most Linux hosts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Inside it, install the packages, then Lima and mise from their release tarballs, each checked against its release&amp;rsquo;s checksums (&lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHASUMS256.txt&lt;/code&gt;) with &lt;code&gt;sha256sum -c&lt;/code&gt;, and add yourself to the &lt;code&gt;kvm&lt;/code&gt; group:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt-get install -y qemu-system-arm qemu-utils qemu-efi-aarch64 virtiofsd build-essential git curl jq rsync
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo usermod -aG kvm &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$USER&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then restart the VM, so a fresh login has the group.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the repo into the VM&amp;rsquo;s home, so the read-only mount stays untouched, install the pinned tools and run the gate, then the end-to-end tests:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rsync -a --delete /path/to/your/checkout/ ~/devvm/ &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise trust &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise install
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run fmt &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise run lint &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --from&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The copy keeps the checkout&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; folder, which the gate needs, because &lt;code&gt;mise run lint&lt;/code&gt; finds the shell scripts it checks with &lt;code&gt;git ls-files&lt;/code&gt;, and the docs&amp;rsquo; build reads each page&amp;rsquo;s git information (&lt;code&gt;enableGitInfo&lt;/code&gt;). A copy without &lt;code&gt;.git&lt;/code&gt;, such as one that &lt;code&gt;git archive&lt;/code&gt; makes, fails the lint. To test a branch that a worktree has checked out, commit it, and clone that branch from the main checkout instead of copying the checkout, because a worktree&amp;rsquo;s branches are the main checkout&amp;rsquo;s too:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rm -rf ~/devvm &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git clone --branch BRANCH /path/to/your/checkout ~/devvm &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A clone has only what&amp;rsquo;s committed, so commit a change before you test it this way.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first &lt;code&gt;--from&lt;/code&gt; run builds every image and takes about half an hour on an M3 Max. Later ones reuse them, because every section but &lt;code&gt;tools&lt;/code&gt; uses the pinned shared tools&amp;rsquo; versions and &lt;code&gt;--from&lt;/code&gt; images, and those images stay valid until &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; or &lt;code&gt;scripts/bump.sh e2e-from&lt;/code&gt; moves a pin (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt;). Stop the VM when done (&lt;code&gt;limactl stop linuxhost&lt;/code&gt;); it keeps its images for the next run.&lt;/p&gt;
&lt;p&gt;Gotchas of this setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Linux host&amp;rsquo;s home and its VMs&amp;rsquo; homes are both &lt;code&gt;/home/&amp;lt;user&amp;gt;.guest&lt;/code&gt;, so a file under &lt;code&gt;$HOME&lt;/code&gt; in a VM isn&amp;rsquo;t proof of a mount: the end-to-end tests check the VM&amp;rsquo;s mounts list instead.&lt;/li&gt;
&lt;li&gt;A VM booting while another one works boots degraded and its downloads time out: the end-to-end tests stop a VM it&amp;rsquo;s done with before starting the next.&lt;/li&gt;
&lt;li&gt;minisign, for signing releases, has no linux/arm64 build, so mise skips it there.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="x86_64-hosts"&gt;x86_64 hosts&lt;span class="hx:absolute hx:-mt-20" id="x86_64-hosts"&gt;&lt;/span&gt;
&lt;a href="#x86_64-hosts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;These need real x86_64 hardware, or an x86_64 VM on such hardware with nested virtualization. An emulated x86_64 VM on a Mac (&lt;code&gt;--arch=x86_64&lt;/code&gt;, QEMU TCG; Lima needs its &lt;code&gt;lima-additional-guestagents&lt;/code&gt;) runs the unit tests, but VMs nested in it crash in their firmware.&lt;/p&gt;
&lt;p&gt;A bare-metal x86_64 Linux host, such as Fedora 43 with SELinux enforcing, runs the gate and &lt;code&gt;mise run e2e -- --from&lt;/code&gt; as the &lt;a href="#linux-hosts"&gt;Linux host above&lt;/a&gt; does, from a clone of the repo, and it can run &lt;code&gt;--slots 3&lt;/code&gt; (&lt;a href="#slots-for-each-host"&gt;slots for each host&lt;/a&gt;). Those runs check the x86_64 side of what devvm builds: the &lt;code&gt;_amd64&lt;/code&gt; pins of base, every layer and feature, the shared tools&amp;rsquo; &lt;code&gt;linux-x64&lt;/code&gt; lock entries and their checksums, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion, whose VM reads its scripts over 9p, and the confined tiers through &lt;code&gt;devvm _qemu&lt;/code&gt; and &lt;code&gt;qemu-system-x86_64&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The tests don&amp;rsquo;t cover the release itself, so check it by hand on that host. Build the archives with &lt;code&gt;scripts/release.sh --head&lt;/code&gt;, with &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt; and &lt;code&gt;DEVVM_MINISIGN_PUB&lt;/code&gt; naming a test key so the signature is checked too, and install &lt;code&gt;devvm-&amp;lt;version&amp;gt;-linux-amd64.tar.gz&lt;/code&gt; from them in a throwaway &lt;code&gt;HOME&lt;/code&gt;, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/"&gt;maintaining&lt;/a&gt; shows, with &lt;code&gt;main --yes&lt;/code&gt; in place of &lt;code&gt;main --no-deps&lt;/code&gt;. With only the system&amp;rsquo;s folders on &lt;code&gt;PATH&lt;/code&gt;, the script finds no Lima, so it installs Lima&amp;rsquo;s latest release into that &lt;code&gt;HOME&lt;/code&gt;&amp;rsquo;s &lt;code&gt;~/.local&lt;/code&gt;. When the host already has QEMU and access to &lt;code&gt;/dev/kvm&lt;/code&gt;, nothing it runs needs sudo. Then run the installed &lt;code&gt;devvm --version&lt;/code&gt; and &lt;code&gt;devvm doctor&lt;/code&gt;, and check with &lt;code&gt;file&lt;/code&gt; that the binary is statically linked.&lt;/p&gt;
&lt;p&gt;devvm hasn&amp;rsquo;t been tested on an Intel Mac. Its release has a &lt;code&gt;darwin-amd64&lt;/code&gt; archive, and that binary runs under Rosetta on Apple silicon, but nobody has run the tests or a VM on Intel hardware.&lt;/p&gt;
&lt;p&gt;GitHub&amp;rsquo;s Linux runners are x86_64 with KVM, and the E2E workflow (&lt;code&gt;.github/workflows/e2e.yml&lt;/code&gt;) runs &lt;code&gt;mise run e2e -- --only project&lt;/code&gt; on one as a trial. Start it from the repo&amp;rsquo;s Actions tab, with Run workflow on the E2E workflow, because it has no other trigger yet. It installs QEMU, gives the runner&amp;rsquo;s user &lt;code&gt;/dev/kvm&lt;/code&gt; as Lima&amp;rsquo;s own CI does, installs Lima at a pinned version checked against its checksum, and runs the section up to three times. It caches Ubuntu&amp;rsquo;s cloud image under the release that the end-to-end tests pin, and the built images under a hash of &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;, that release and Lima&amp;rsquo;s version, because devvm&amp;rsquo;s image keys are only known once it builds. When the run fails, it uploads the e2e logs, devvm&amp;rsquo;s run logs and each Lima instance&amp;rsquo;s serial logs as the &lt;code&gt;e2e-logs&lt;/code&gt; artifact.&lt;/p&gt;
&lt;h2 data-hextra-search-id="slots-for-each-host"&gt;Slots for each host&lt;span class="hx:absolute hx:-mt-20" id="slots-for-each-host"&gt;&lt;/span&gt;
&lt;a href="#slots-for-each-host" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;mise run e2e -- --slots N&lt;/code&gt; runs the end-to-end sections in N sandboxes at once (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#slots"&gt;slots&lt;/a&gt;), and each slot runs its own VMs, up to three at a time in the link section. How many slots a host can run depends on its cores and memory:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Host&lt;/th&gt;
&lt;th&gt;Slots&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A bare-metal Linux host with 32 cores and 124 GB of memory&lt;/td&gt;
&lt;td&gt;3 or 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A Mac&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A Linux host nested in a VM, such as &lt;a href="#linux-hosts"&gt;the Linux host above&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;1, the default: a VM booting while another one works boots degraded there&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A Mac clones the images it gives each slot, because &lt;code&gt;/tmp&lt;/code&gt; and your home folder are on the same APFS volume. A Linux host reflinks the Lima instances in your home folder when its file system can, as XFS made with &lt;code&gt;reflink=1&lt;/code&gt; and Btrfs can, but a &lt;code&gt;/tmp&lt;/code&gt; on tmpfs can&amp;rsquo;t reflink, so there each slot other than slot 0 builds its own tool images. Every slot keeps its images between runs, so only its first run builds them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="end-to-end-tests-in-go"&gt;End-to-end tests in Go&lt;span class="hx:absolute hx:-mt-20" id="end-to-end-tests-in-go"&gt;&lt;/span&gt;
&lt;a href="#end-to-end-tests-in-go" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The end-to-end tests are in Go, in &lt;code&gt;tests/e2e&lt;/code&gt;, a file for each section. That package builds only with the &lt;code&gt;e2e&lt;/code&gt; build tag, and its &lt;code&gt;TestE2E&lt;/code&gt; is the run.&lt;/p&gt;
&lt;h3 data-hextra-search-id="running-the-runner"&gt;Running the runner&lt;span class="hx:absolute hx:-mt-20" id="running-the-runner"&gt;&lt;/span&gt;
&lt;a href="#running-the-runner" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;mise run e2e&lt;/code&gt; runs &lt;code&gt;TestE2E&lt;/code&gt; from &lt;code&gt;tests/e2e&lt;/code&gt;, with the run&amp;rsquo;s flags after &lt;code&gt;--&lt;/code&gt;. You can also run &lt;code&gt;go test&lt;/code&gt; yourself from that folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --only gc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; tests/e2e &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; go &lt;span class="nb"&gt;test&lt;/span&gt; -tags e2e -count&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; -timeout &lt;span class="m"&gt;0&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^TestE2E$&amp;#39;&lt;/span&gt; -args --only gc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;go test&lt;/code&gt; from &lt;code&gt;tests/e2e&lt;/code&gt; without naming a package, because only then does &lt;code&gt;go test&lt;/code&gt; show the run&amp;rsquo;s lines as they come, and in a package list it holds them until the package ends. &lt;code&gt;TestE2E&lt;/code&gt; refuses any &lt;code&gt;-timeout&lt;/code&gt; but &lt;code&gt;0&lt;/code&gt;, because &lt;code&gt;go test&lt;/code&gt;&amp;rsquo;s default of 10 minutes would end a long section in the middle of a check, and &lt;code&gt;-count=1&lt;/code&gt; keeps &lt;code&gt;go test&lt;/code&gt; from showing a cached result. The run&amp;rsquo;s flags, which &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;Contributing&lt;/a&gt; lists, come after &lt;code&gt;-args&lt;/code&gt;. &lt;code&gt;--reuse&lt;/code&gt; keeps the VMs that a section makes with &lt;code&gt;Reuse&lt;/code&gt; for the next run, which takes each one as it finds it when it&amp;rsquo;s still running, so iterating on one check doesn&amp;rsquo;t launch its VM again.&lt;/p&gt;
&lt;p&gt;The runner uses a sandbox for each slot, with its own fixed ports, it refuses your real Lima home, and it builds devvm from the checkout into &lt;code&gt;src-go&lt;/code&gt; in the sandbox&amp;rsquo;s state folder, as a test build with its files embedded. It writes a &lt;code&gt;config.toml&lt;/code&gt; that chooses base&amp;rsquo;s features, so nothing asks, and puts the pinned tool lock in place, after checking the lock&amp;rsquo;s first line. Base starts from the dated Ubuntu release in &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; (&lt;code&gt;tests/e2e/sandbox_test.go&lt;/code&gt;), which &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; moves. The runner takes the slot&amp;rsquo;s lock, a symlink to its pid, and it deletes only the VMs, files and project folders that it made, which include any VM whose folder is in one of the run&amp;rsquo;s project folders, even one that a failed check made without registering it. Before the first section, it stops with a setup failure when the slot&amp;rsquo;s Lima home has a project VM that an earlier run left, unless &lt;code&gt;--reuse&lt;/code&gt; keeps them, and it prints the commands that delete each one and its state folder. Before anything else, it names each host command that the chosen sections need and this machine lacks, with what installs it. Its lines are each section&amp;rsquo;s &lt;code&gt;== name&lt;/code&gt; heading, then &lt;code&gt;PASS&lt;/code&gt;, &lt;code&gt;FAIL&lt;/code&gt;, &lt;code&gt;SKIP&lt;/code&gt; or &lt;code&gt;RETRY&lt;/code&gt; with &lt;code&gt;[n/N]&lt;/code&gt;, the check&amp;rsquo;s title, its time, the run&amp;rsquo;s time and the time left. A heartbeat every minute shows the newest line of the check&amp;rsquo;s output or devvm&amp;rsquo;s run log, and the run ends with a summary line. It keeps each section&amp;rsquo;s times in slot 0&amp;rsquo;s timings folder, under its tier, and beside them a checksum of &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s Go files, so a section&amp;rsquo;s check count is compared only with a run of the same Go files. With &lt;code&gt;--slots&lt;/code&gt;, it plans, seeds and runs the slots, each slot a run of the same test binary, and it adds up their results. On macOS it seeds each slot with APFS clones (&lt;code&gt;clonefile&lt;/code&gt;), and on Linux with reflinks. With &lt;code&gt;--newest-base&lt;/code&gt;, its last lines name the release Ubuntu lists as its newest and the one devvm pinned, and a failure is named as upstream drift.&lt;/p&gt;
&lt;p&gt;Each check&amp;rsquo;s time limit is three times its longest time in its section&amp;rsquo;s last complete run, and the steps between two checks get an hour. Each command a check runs is in a process group of its own, and when the check&amp;rsquo;s time runs out, the group gets TERM, then KILL 30 seconds later. The check then fails with the heartbeat&amp;rsquo;s last line, and the run goes on to the next check. The runner&amp;rsquo;s own tests, the &lt;code&gt;TestHarness&lt;/code&gt; tests, need no VM, and &lt;code&gt;mise run test&lt;/code&gt; runs them with the &lt;code&gt;e2e&lt;/code&gt; tag.&lt;/p&gt;
&lt;h3 data-hextra-search-id="writing-a-check"&gt;Writing a check&lt;span class="hx:absolute hx:-mt-20" id="writing-a-check"&gt;&lt;/span&gt;
&lt;a href="#writing-a-check" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A section is a function that takes the running section, &lt;code&gt;*S&lt;/code&gt;, and calls &lt;code&gt;s.Check&lt;/code&gt; once for each check:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;gc deletes a tool image no VM uses, with its record&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;Exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;old&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;.json&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;the old tool image or its record is still there&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The check passes when its function returns nil. Its title is its key in the timings, so a changed title starts its times again: give a new check a title that says what it proves. When a check fails, the runner prints its error, each line led by &lt;code&gt;failed:&lt;/code&gt;, and then the last 5 lines that its commands printed, or as many as &lt;code&gt;Tail(n)&lt;/code&gt; asks for. It also copies every proxy log in the sandbox that has lines, each VM&amp;rsquo;s and each build&amp;rsquo;s, into &lt;code&gt;proxy-logs/&lt;/code&gt; in the sandbox&amp;rsquo;s state folder, because the run deletes the VMs and builds that wrote them, and it prints that folder and the last 5 lines of each log written since the check began. The next run empties &lt;code&gt;proxy-logs/&lt;/code&gt; before its first check. A check that the run has nothing for is &lt;code&gt;s.Skip(title, why)&lt;/code&gt;, which counts it, so that runs compare their counts.&lt;/p&gt;
&lt;p&gt;The commands a check runs go through the section, so that they run in the sandbox&amp;rsquo;s environment and within the check&amp;rsquo;s time limit, and their output goes into the check&amp;rsquo;s log:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Helper&lt;/th&gt;
&lt;th&gt;What it runs or reads&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Devvm(dir, args…)&lt;/code&gt;, &lt;code&gt;s.DevvmNames(dir, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the run&amp;rsquo;s devvm in &lt;code&gt;dir&lt;/code&gt;, with no input; &lt;code&gt;DevvmNames&lt;/code&gt; in names mode (&lt;code&gt;DEVVM_MESSAGES=names&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Msg(name, &amp;quot;k=v&amp;quot;…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a message&amp;rsquo;s text, from &lt;code&gt;devvm _msg&lt;/code&gt;, so a check never repeats its wording&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Limactl(args…)&lt;/code&gt;, &lt;code&gt;s.InVM(vm, script)&lt;/code&gt;, &lt;code&gt;s.Status(vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl&lt;/code&gt; in the sandbox&amp;rsquo;s Lima home, a script in the VM&amp;rsquo;s login shell with no input, and a VM&amp;rsquo;s status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Run(Cmd{…})&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;any command, with its own folder, input or variables&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.NewProject(name)&lt;/code&gt;, &lt;code&gt;s.Launch(dir, input, args…)&lt;/code&gt;, &lt;code&gt;s.Reuse(name, input, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a new project folder, deleted at the end, and devvm launched in a folder, its VM recorded for the cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.State(vm)&lt;/code&gt;, &lt;code&gt;s.Paths.VMOf(dir)&lt;/code&gt;, &lt;code&gt;s.Paths.VMDir(vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt;, flattened as the CLI tests&amp;rsquo; &lt;code&gt;vm_state&lt;/code&gt; does, the VM a folder has, and its folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.KeysOf(image)&lt;/code&gt;, &lt;code&gt;s.Paths.Record(key, field)&lt;/code&gt;, &lt;code&gt;s.Own(image)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an image&amp;rsquo;s keys and records, and its images made the run&amp;rsquo;s to delete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Layer(name, script)&lt;/code&gt;, &lt;code&gt;s.Paths&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a layer of the run&amp;rsquo;s (&lt;code&gt;e2e*&lt;/code&gt;), deleted at the end, and the sandbox&amp;rsquo;s folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Golden(name, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;with &lt;code&gt;--golden&lt;/code&gt;, a &lt;a href="#golden-fixtures"&gt;golden fixture&lt;/a&gt; captured from what &lt;code&gt;args&lt;/code&gt; printed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.GoE2E(test, pkg, &amp;quot;VAR=value&amp;quot;…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a Go test in &lt;code&gt;internal/pkg&lt;/code&gt; that needs a real VM, such as &lt;code&gt;TestE2EExecQuoting&lt;/code&gt;, with its variables in its environment and never in a process&amp;rsquo;s arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Until(timeout, fn)&lt;/code&gt;, &lt;code&gt;Settle&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a wait for what the check looks for, trying each second, and the one fixed wait, before looking for something that must not have happened&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Port(p)&lt;/code&gt;, &lt;code&gt;s.Defer(fn)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;one of slot 0&amp;rsquo;s fixed ports as this slot has it, and a cleanup of the section&amp;rsquo;s own&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Three options change how a check runs. &lt;code&gt;Flaky(reason)&lt;/code&gt; marks a check that&amp;rsquo;s known to flake: when it fails, the runner shows its output and runs it once more, and only a second failure fails it. Its result says &lt;code&gt;retried once&lt;/code&gt;, and its timings line and the summary say so too, and every other check fails on its first failure. &lt;code&gt;Builds()&lt;/code&gt; marks a check whose own command can build base or a &lt;code&gt;--from&lt;/code&gt; base, so it gets at least an hour. &lt;code&gt;Needs(backend.FeatureLink)&lt;/code&gt; names the backend features that a check proves: on a backend that has one of them neither natively nor emulated and reviewed, as &lt;code&gt;devvm doctor --json&lt;/code&gt; shows its features, the check is skipped and counted, so a check is written once for every backend that has its features. A section whose every check proves a feature takes it once with &lt;code&gt;s.Needing(...)&lt;/code&gt;, as link takes &lt;code&gt;FeatureLink&lt;/code&gt;, nix &lt;code&gt;FeatureNixLayer&lt;/code&gt; and &lt;code&gt;--from&lt;/code&gt; &lt;code&gt;FeatureFrom&lt;/code&gt;, and a section&amp;rsquo;s own checks of the docker or nix layer and of ports name theirs with &lt;code&gt;Needs&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="adding-a-section"&gt;Adding a section&lt;span class="hx:absolute hx:-mt-20" id="adding-a-section"&gt;&lt;/span&gt;
&lt;a href="#adding-a-section" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each section is a file of its own in &lt;code&gt;tests/e2e&lt;/code&gt;, such as &lt;code&gt;gc_test.go&lt;/code&gt;, so sections can change at the same time without touching each other&amp;rsquo;s files. A new check goes in its section&amp;rsquo;s function, where its setup steps run, because a check&amp;rsquo;s time counts from the end of the one before it. To add a section:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Write &lt;code&gt;&amp;lt;section&amp;gt;Section(s *S)&lt;/code&gt; in &lt;code&gt;tests/e2e/&amp;lt;section&amp;gt;_test.go&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add it to &lt;code&gt;sections&lt;/code&gt; (&lt;code&gt;tests/e2e/sections_test.go&lt;/code&gt;), in the order the run runs it, with a guess of its time for &lt;code&gt;--slots&lt;/code&gt; to place it before it has run, and the host commands it needs beyond &lt;code&gt;limactl&lt;/code&gt; and &lt;code&gt;pkill&lt;/code&gt;, each with what installs it.&lt;/li&gt;
&lt;li&gt;Run it with &lt;code&gt;mise run e2e -- --only &amp;lt;section&amp;gt;&lt;/code&gt; on a Mac and on a Linux host, and check that each check passes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A helper that more than one section needs goes in the harness&amp;rsquo;s files, beside those above, so that every section shares one copy, and a fixture that two sections share, such as an image, stays in the sandbox&amp;rsquo;s cache. These are the ones the sections share so far, each with what it does in a shell&amp;rsquo;s terms:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Helper&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;In a shell&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Start(Cmd{…})&lt;/code&gt;, &lt;code&gt;Proc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs a command in the background, past the check that starts it, in a process group of its own, until &lt;code&gt;Stop&lt;/code&gt; or the run&amp;rsquo;s end, with its output in &lt;code&gt;Out&lt;/code&gt; and never in the check&amp;rsquo;s log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cmd &amp;amp;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;StartCorp(s)&lt;/code&gt;, &lt;code&gt;Corp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;starts a company proxy, a &lt;code&gt;devvm _proxy&lt;/code&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt; at slot 0&amp;rsquo;s port 18766 as the slot has it, with a password of its own, allowing any host, and waits for it to listen; &lt;code&gt;Env&lt;/code&gt; gives a command &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt; with its password, &lt;code&gt;Saw&lt;/code&gt; looks for one of its events, and &lt;code&gt;Addr&lt;/code&gt; is its address without the password&lt;/td&gt;
&lt;td&gt;&lt;code&gt;corp_start&lt;/code&gt;, &lt;code&gt;corp_stop&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WriteProxyConfig(s, file, proxy.Config{…})&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;writes a config for &lt;code&gt;devvm _proxy -config&lt;/code&gt;, mode 600, with the proxy&amp;rsquo;s own &lt;code&gt;Config&lt;/code&gt; type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;proxy_config&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NewCA(s)&lt;/code&gt;, &lt;code&gt;CA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;makes the run&amp;rsquo;s throwaway CA once, with a server certificate for &lt;code&gt;host.lima.internal&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt; and &lt;code&gt;127.0.0.1&lt;/code&gt;; &lt;code&gt;Trust&lt;/code&gt; and &lt;code&gt;Untrust&lt;/code&gt; put it in devvm&amp;rsquo;s CA folder and take the folder away, &lt;code&gt;Serve(port)&lt;/code&gt; serves HTTPS with it on every address until &lt;code&gt;StopServing&lt;/code&gt;, &lt;code&gt;Sign&lt;/code&gt; makes another server certificate, and &lt;code&gt;GoneFrom(s, vm)&lt;/code&gt; checks that a VM keeps none of devvm&amp;rsquo;s CA files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;e2e_ca&lt;/code&gt;, &lt;code&gt;ca_serve&lt;/code&gt;, &lt;code&gt;ca_stop&lt;/code&gt;, &lt;code&gt;ca_gone&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NoLeak(secrets, paths…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;fails when a regular file under the paths holds one of the secrets, or can&amp;rsquo;t be read, reading only where each file has data, as &lt;code&gt;SEEK_DATA&lt;/code&gt; and &lt;code&gt;SEEK_HOLE&lt;/code&gt; find it, so a VM&amp;rsquo;s sparse disk takes seconds, and naming the file but never the secret; every check that a secret is in no file on this machine uses it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;no_leak&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GuestHasNone(s, vm, secrets, dirs…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;fails when a file under the folders in the VM holds one of the secrets, searched as root, the secrets on &lt;code&gt;grep&lt;/code&gt;&amp;rsquo;s input&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sudo grep -rqsFf /dev/stdin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WatchProcs(s)&lt;/code&gt;, &lt;code&gt;ProcWatch&lt;/code&gt;, &lt;code&gt;ProcsHave(s, secret)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;samples every host process&amp;rsquo;s command line every 0.1 s until &lt;code&gt;Stop&lt;/code&gt;, into a file of the sandbox&amp;rsquo;s, and &lt;code&gt;Saw&lt;/code&gt; looks for a secret in the samples, while &lt;code&gt;ProcsHave&lt;/code&gt; looks in one sample taken now; a check that reads either is &lt;code&gt;ProcsFlaky()&lt;/code&gt;, as a listing can catch a short-lived process mid-start&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ps_watch&lt;/code&gt;, &lt;code&gt;ps_unwatch&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.ToolVersion(tool)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the tool&amp;rsquo;s version in the shared tools&amp;rsquo; lock&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lockv&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s.Paths.RunLogs()&lt;/code&gt;, &lt;code&gt;s.Paths.RunLogHas(line)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s run logs by name, the one reader of that folder, and whether one of them has the line, whole: what a build&amp;rsquo;s script printed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;logs/runs/*.log&lt;/code&gt;, &lt;code&gt;grep -qx&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MountLine(s, vm)&lt;/code&gt;, &lt;code&gt;MountsOf(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the host folders a VM&amp;rsquo;s Lima config mounts, each with a space after it, or one a line&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list --format '{{range .Config.Mounts}}…'&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HasLine&lt;/code&gt;, &lt;code&gt;CaptureLine&lt;/code&gt;, &lt;code&gt;ExitStatus&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether text has a line, whole; the first group of the first line a regular expression matches; the exit status a command&amp;rsquo;s error says&lt;/td&gt;
&lt;td&gt;&lt;code&gt;grep -qx&lt;/code&gt;, &lt;code&gt;sed -n 's/…/\1/p'&lt;/code&gt;, &lt;code&gt;$?&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;launchWith(s, dir, env, args…)&lt;/code&gt;, &lt;code&gt;devvmCmd(s, dir, input, env, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Launch&lt;/code&gt; and devvm with variables of their own in devvm&amp;rsquo;s environment, such as a fake token, a &lt;code&gt;HOME&lt;/code&gt; of the section&amp;rsquo;s or &lt;code&gt;NoDocker&lt;/code&gt;&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, never in its arguments&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HOME=… &amp;quot;$D&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vmHas(s, vm, login, script, secrets…)&lt;/code&gt;, &lt;code&gt;vmGrep(s, vm, script, re)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether what a script prints in the VM holds one of the secrets, or matches &lt;code&gt;re&lt;/code&gt;, looked for in the VM with the secrets on its shell&amp;rsquo;s input, so neither they nor what the script printed reach the check&amp;rsquo;s log&lt;/td&gt;
&lt;td&gt;&lt;code&gt;in_vm … | grep -qF&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limaListens(s, proto, port)&lt;/code&gt;, &lt;code&gt;loopbackOnly(s, port)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether Lima&amp;rsquo;s own processes listen on a port of this machine, and whether what listens on one listens on loopback alone, with &lt;code&gt;lsof&lt;/code&gt; on macOS and &lt;code&gt;ss&lt;/code&gt; on Linux&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lima_listens&lt;/code&gt;, &lt;code&gt;loopback_only&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DevvmIn(s, dir, input, env, args…)&lt;/code&gt;, &lt;code&gt;OwnVM(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs &lt;code&gt;devvmCmd&lt;/code&gt;&amp;rsquo;s command, and makes a VM that a step launched the run&amp;rsquo;s, so that the cleanup deletes it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(cd DIR &amp;amp;&amp;amp; VAR=… &amp;quot;$D&amp;quot; …)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SaidLine(out, msg)&lt;/code&gt;, &lt;code&gt;FirstLine&lt;/code&gt;, &lt;code&gt;LastLine&lt;/code&gt;, &lt;code&gt;tailLines(text, n)&lt;/code&gt;, &lt;code&gt;Trim&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether one of output&amp;rsquo;s lines is one of a message&amp;rsquo;s, a message&amp;rsquo;s first or last line, text&amp;rsquo;s last lines, and output without its trailing newlines&lt;/td&gt;
&lt;td&gt;&lt;code&gt;grep -qxF &amp;quot;$(m …)&amp;quot;&lt;/code&gt;, &lt;code&gt;head -1&lt;/code&gt;, &lt;code&gt;tail -n&lt;/code&gt;, &lt;code&gt;$(…)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Listed(s, vm)&lt;/code&gt;, &lt;code&gt;Locked(s, file)&lt;/code&gt;, &lt;code&gt;Procs(s)&lt;/code&gt;, &lt;code&gt;Forwarders(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether &lt;code&gt;limactl&lt;/code&gt; lists a VM, whether a file has macOS&amp;rsquo;s user immutable flag, every host process&amp;rsquo;s command line, which stays out of the check&amp;rsquo;s log as &lt;code&gt;WatchProcs&lt;/code&gt;&amp;rsquo;s samples do, and a VM&amp;rsquo;s port forwarders here&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list -q&lt;/code&gt;, &lt;code&gt;ls -lOd&lt;/code&gt;, &lt;code&gt;ps -axww&lt;/code&gt;, &lt;code&gt;pgrep -f '[_]ports -vm VM '&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Reaches(s, addr)&lt;/code&gt;, &lt;code&gt;ReachesWithin&lt;/code&gt;, &lt;code&gt;Answer(s, addr)&lt;/code&gt;, &lt;code&gt;Local(port)&lt;/code&gt;, &lt;code&gt;Local6(port)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether something takes a TCP connection on an address, at once or within a time, and what a connection reads before it closes, within 2 seconds&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nc -z&lt;/code&gt;, &lt;code&gt;nc -w 2&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;transparentRuns(s, vm, dir, title)&lt;/code&gt;, &lt;code&gt;fromTransparent(s, vm, dir, title, env)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the checks of &lt;a href="https://next.devvm.dev/docs/internals/network/#tools-that-skip-the-proxy"&gt;transparent mode&lt;/a&gt; in a confined VM on any base: its service and listeners, names, curl without proxy settings to an allowed host and a blocked one, another port refused; &lt;code&gt;fromTransparent&lt;/code&gt; puts a &lt;code&gt;--from&lt;/code&gt; VM on the allowlist tier for one start first&lt;/td&gt;
&lt;td&gt;&lt;code&gt;in_vm 'curl --noproxy …'&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;withoutTransparent(s, vm, fn)&lt;/code&gt;, &lt;code&gt;dnsAnswers(sentinel, servers…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs &lt;code&gt;fn&lt;/code&gt; with the VM&amp;rsquo;s transparent mode stopped, as root could stop it, checked first, then starts it again; a script that asks each server for &lt;code&gt;example.com&lt;/code&gt; over UDP and TCP and passes when none answers, or, with &lt;code&gt;sentinel&lt;/code&gt;, when the answer is the stand-in address with TTL 0&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl stop devvm-transparent&lt;/code&gt;, &lt;code&gt;python3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HostProgram(s, addr, answer)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a program on this machine that holds a port, every IPv4 address with &lt;code&gt;:port&lt;/code&gt;, and answers each connection with &lt;code&gt;host-program&lt;/code&gt; or accepts none&lt;/td&gt;
&lt;td&gt;&lt;code&gt;perl -MIO::Socket::INET&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LimaServe(s, vm, ports…)&lt;/code&gt;, &lt;code&gt;VMSay(s, vm, addr, port, word)&lt;/code&gt;, &lt;code&gt;LimaBoot(s, vm)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;starts servers in a VM, on every address or on one address with a word of their own, and reads the VM&amp;rsquo;s boot&amp;rsquo;s ID&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lima_serve&lt;/code&gt;, &lt;code&gt;vm_say&lt;/code&gt;, &lt;code&gt;lima_boot&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PortsLive(s, dir, vm, port, serve, boot)&lt;/code&gt;, &lt;code&gt;HostPortKept(s, dir, vm, port, control, serve)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;checks that &lt;code&gt;devvm ports add&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; apply to a running VM at once without a restart, and that a listed port a program here holds stays its own until it&amp;rsquo;s freed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ports_live&lt;/code&gt;, &lt;code&gt;host_port_kept&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TTYRun(s, dir, input, args…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs a command on a terminal of its own, &lt;code&gt;script&lt;/code&gt; on macOS and Python&amp;rsquo;s pty on Linux, and types the input once a &lt;code&gt;[y/N]&lt;/code&gt; or &lt;code&gt;[Y/n]&lt;/code&gt; question shows&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tty_run&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WatchSees(s, vm, dir, by, nested)&lt;/code&gt;, &lt;code&gt;WatchMisses(s, vm, dir)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs a file watcher in the VM and checks which changes, made in the VM or on this machine, it sees&lt;/td&gt;
&lt;td&gt;&lt;code&gt;watch_sees&lt;/code&gt;, &lt;code&gt;watch_misses&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SSHAgent(s, sock)&lt;/code&gt;, &lt;code&gt;KeyComments(out)&lt;/code&gt;, &lt;code&gt;RfwdLinks(s, host, sock, ssh…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;starts a throwaway &lt;code&gt;ssh-agent&lt;/code&gt;, reads the keys&amp;rsquo; comments from &lt;code&gt;ssh-add -l&lt;/code&gt;, and checks that a VM&amp;rsquo;s sshd binds remote forwards only on links&amp;rsquo; addresses&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ssh-agent -a&lt;/code&gt;, &lt;code&gt;awk '{ print $3 }'&lt;/code&gt;, &lt;code&gt;rfwd_links&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ExecQuoting(s, vm)&lt;/code&gt;, &lt;code&gt;ServeDesktop(s, dir, args…)&lt;/code&gt;, &lt;code&gt;Desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;runs &lt;code&gt;TestE2EExecQuoting&lt;/code&gt; on a VM, and runs &lt;code&gt;devvm desktop --no-open&lt;/code&gt; in the background until it says where the desktop is, which &lt;code&gt;View&lt;/code&gt; checks with &lt;code&gt;TestE2EDesktop&lt;/code&gt; and &lt;code&gt;End&lt;/code&gt; ends with Ctrl+C&lt;/td&gt;
&lt;td&gt;&lt;code&gt;go_e2e&lt;/code&gt;, &lt;code&gt;desktop_serve&lt;/code&gt;, &lt;code&gt;desktop_view&lt;/code&gt;, &lt;code&gt;desktop_end&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Note(s, format, …)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;adds a line of the check&amp;rsquo;s own to its log, which a failure shows among its last lines&lt;/td&gt;
&lt;td&gt;a check&amp;rsquo;s &lt;code&gt;echo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SetState(s.Paths, vm, key, json)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;sets a dotted key of a VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt; to a JSON value by hand, as nothing devvm runs would, keeping the rest&lt;/td&gt;
&lt;td&gt;&lt;code&gt;vm_set&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NoDocker(s)&lt;/code&gt;, &lt;code&gt;DockerCalls(s)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a &lt;code&gt;PATH&lt;/code&gt; with a docker first on it that&amp;rsquo;s installed but not running, which logs what devvm asked it to the file &lt;code&gt;DockerCalls&lt;/code&gt; names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NewestLog(s.Paths)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s newest run log, the last devvm&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;&lt;code&gt;newest_log&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A secret that a check looks for is never in a process&amp;rsquo;s arguments, where other users can see it. The company proxy&amp;rsquo;s password is in its config file and in the environment of the commands that &lt;code&gt;Env&lt;/code&gt; is given to, and each helper above takes a secret as a Go value, so it reaches &lt;code&gt;grep&lt;/code&gt; on its input and is never on a command line.&lt;/p&gt;
&lt;h2 data-hextra-search-id="test-builds"&gt;Test builds&lt;span class="hx:absolute hx:-mt-20" id="test-builds"&gt;&lt;/span&gt;
&lt;a href="#test-builds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The tests run a test build of devvm, which is one made with &lt;code&gt;-ldflags &amp;quot;-X github.com/devvmhq/devvm/internal/testbuild.testBuild=yes&amp;quot;&lt;/code&gt;, as the end-to-end tests and the CLI tests make theirs. Only a test build reads the environment variables that stand in for what devvm would find on this machine. Releases (GoReleaser, the Homebrew formula) don&amp;rsquo;t set the flag, so a release ignores every one of these variables, whatever its environment says. devvm reads them in one place, &lt;code&gt;readOverrides&lt;/code&gt; in &lt;code&gt;internal/cli/overrides.go&lt;/code&gt;, into an &lt;code&gt;Overrides&lt;/code&gt; struct, and passes each one to the package that uses it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Stands in for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s pinned and checked mise on the host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TOOL_SLOTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;backend.MaxToolSlots&lt;/code&gt;, the most tool images that build side by side, which the host&amp;rsquo;s memory, CPUs and free space lower further&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_KVM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Linux&amp;rsquo;s &lt;code&gt;/dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;https://cloud-images.ubuntu.com/releases/resolute&lt;/code&gt;, where devvm finds Ubuntu&amp;rsquo;s dated releases and downloads the cloud image from. A &lt;code&gt;file://&lt;/code&gt; address is read from disk, and devvm copies the image into its own folder as it does a download&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_LIMA_TEMPLATES&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder of Lima&amp;rsquo;s own templates beside &lt;code&gt;limactl&lt;/code&gt;, whose cloud images &lt;code&gt;devvm gc --caches&lt;/code&gt; never frees from Lima&amp;rsquo;s cache: the CLI tests&amp;rsquo; stub &lt;code&gt;limactl&lt;/code&gt; has none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UBUNTU_RELEASE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the newest dated release, which devvm pins base to: the end-to-end tests pin their own, &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, so its images stay cached between runs, and devvm checks it as it does the newest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UNREVIEWED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the refusal of unreviewed emulations (&lt;a href="#unreviewed-emulations"&gt;unreviewed emulations&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SSH_PORTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the 17 ports every browser refuses, which VMs&amp;rsquo; ssh comes from (&lt;code&gt;ports.SSHPorts&lt;/code&gt;). It&amp;rsquo;s a comma-separated list of the CLI test sandbox&amp;rsquo;s own ports, so sandboxes running at once never share them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_CPUS&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_MEMORY_GIB&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_FREE_GIB&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_LIST_TIMEOUT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;this machine&amp;rsquo;s size and how long devvm waits for a backend&amp;rsquo;s listings (&lt;a href="#a-host-of-any-size"&gt;a host of any size&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_PIPED_ANSWERS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a terminal to answer questions in: with &lt;code&gt;1&lt;/code&gt;, each question reads its answer as a line of input that isn&amp;rsquo;t a terminal, without its prompt, where devvm would refuse it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_VOLUME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the volume of every folder, such as &lt;code&gt;uuid:…&lt;/code&gt;, in place of &lt;code&gt;diskutil&lt;/code&gt;&amp;rsquo;s on macOS and the file system&amp;rsquo;s ID on Linux, as devvm records and matches it when it makes, launches, adopts, moves, deletes or lists a VM, so a script needn&amp;rsquo;t depend on the real one, and &lt;code&gt;fail&lt;/code&gt; makes each lookup fail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_HISTORY_MAX&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the 2 GiB that an export of agents&amp;rsquo; history holds at most, in bytes, so a script whose VM writes an export without end reaches the cap at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;where devvm paste finds the clipboard tools: macOS&amp;rsquo;s &lt;code&gt;/usr/bin/osascript&lt;/code&gt; and &lt;code&gt;/usr/bin/pbcopy&lt;/code&gt;, and &lt;code&gt;wl-paste&lt;/code&gt;, &lt;code&gt;wl-copy&lt;/code&gt; and &lt;code&gt;xclip&lt;/code&gt; in Linux&amp;rsquo;s system folders, so the tests&amp;rsquo; stand-ins run in their place&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_PASTE_WAIT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;how long devvm paste waits for its script in the VM, in seconds, in place of 10 minutes for a write and 2 for a count or a delete, so a script whose VM never answers reaches the limit at once&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The settings that the &lt;a href="https://next.devvm.dev/docs/using/settings/#environment"&gt;environment table&lt;/a&gt; lists, such as &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt; and &lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt;, are yours to set, so every build reads them. Sandboxes for manual runs that have data folders of their own but share one &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt; lock only their own shared tools, so don&amp;rsquo;t build shared tools or run &lt;code&gt;devvm gc&lt;/code&gt; in two of them at once: either can delete a build VM that the other is still using (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="tests-on-real-lima"&gt;Tests on real Lima&lt;span class="hx:absolute hx:-mt-20" id="tests-on-real-lima"&gt;&lt;/span&gt;
&lt;a href="#tests-on-real-lima" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Most Go tests run the &lt;code&gt;limactl&lt;/code&gt; stub, which can&amp;rsquo;t tell whether real Lima accepts what devvm gives it. The tests in &lt;code&gt;internal/backend/lima/real_test.go&lt;/code&gt; run the real &lt;code&gt;limactl&lt;/code&gt; instead, on dummy instances, as Lima&amp;rsquo;s own tests do. A dummy instance&amp;rsquo;s image is a small local file, so it can&amp;rsquo;t boot, but &lt;code&gt;limactl&lt;/code&gt; still creates, clones, edits, lists and deletes it. The tests run in a sandbox of their own, with a Lima home under &lt;code&gt;/tmp&lt;/code&gt; and a &lt;code&gt;HOME&lt;/code&gt; of their own, so they never touch your VMs or your Lima home, and they never start a VM. They run in &lt;code&gt;mise run test&lt;/code&gt; wherever &lt;code&gt;limactl&lt;/code&gt; is on &lt;code&gt;PATH&lt;/code&gt;, and where it isn&amp;rsquo;t, they skip and say why.&lt;/p&gt;
&lt;p&gt;Each test walks through &lt;code&gt;scenario&lt;/code&gt;, which makes every kind of Lima config devvm makes, through the same code devvm runs. It makes base from Ubuntu&amp;rsquo;s image and from a &lt;code&gt;--from&lt;/code&gt; conversion, a layer, the shared tools&amp;rsquo; build VM, the conversion&amp;rsquo;s VM, and a project VM with its mounts, ports, size and environment. Then it makes the edits that a build&amp;rsquo;s start makes, and those of the project VM&amp;rsquo;s starts: its first start, a confined start with the proxy&amp;rsquo;s password that changes its agents&amp;rsquo; folders, agent forwarding and size in the same edit, and an open start and one with no network. In the end it deletes everything. &lt;code&gt;TestLimaConfigsValid&lt;/code&gt; runs &lt;code&gt;limactl validate&lt;/code&gt; on every instance&amp;rsquo;s &lt;code&gt;lima.yaml&lt;/code&gt; after each step. That covers the proxy&amp;rsquo;s password too, which devvm writes into &lt;code&gt;lima.yaml&lt;/code&gt; itself, so &lt;code&gt;limactl edit&lt;/code&gt; never checks it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TestLimactlStubContract&lt;/code&gt; in &lt;code&gt;contract_test.go&lt;/code&gt; keeps the &lt;code&gt;limactl&lt;/code&gt; stub in &lt;code&gt;internal/stubtest/stub&lt;/code&gt; honest, because the CLI tests and most Go tests trust it to act as Lima does. It runs &lt;code&gt;scenario&lt;/code&gt; twice, once through the real &lt;code&gt;limactl&lt;/code&gt; and once through the stub, and after each step it compares every instance as devvm reads it from &lt;code&gt;limactl list --json&lt;/code&gt;. It compares the order of the instances, each one&amp;rsquo;s status, size, mounts, agent forwarding, ssh port and networks, and the edits each kind of start would make to it. When Lima and the stub differ, the test names the step and the fields that differ, and the stub gets fixed to match Lima.&lt;/p&gt;
&lt;h2 data-hextra-search-id="golden-fixtures"&gt;Golden fixtures&lt;span class="hx:absolute hx:-mt-20" id="golden-fixtures"&gt;&lt;/span&gt;
&lt;a href="#golden-fixtures" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The golden fixtures are what the real tools printed, kept in &lt;code&gt;testdata/golden/darwin/&lt;/code&gt; and &lt;code&gt;testdata/golden/linux/&lt;/code&gt;, so the tests can check both devvm&amp;rsquo;s parsers and the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#stubs"&gt;stubs&lt;/a&gt; against real output on any machine. Each system&amp;rsquo;s folder holds what its tools printed there:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fixture&lt;/th&gt;
&lt;th&gt;The real output of&lt;/th&gt;
&lt;th&gt;Captured from&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limactl-version.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl --version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestLimactlStubContract&lt;/code&gt;&amp;rsquo;s run on real Lima&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limactl-list-stopped.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list --json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the contract test&amp;rsquo;s dummy instances, after the step that leaves the most&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;limactl-list-running.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;limactl list --json&lt;/code&gt; of a running VM&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;project&lt;/code&gt; section&amp;rsquo;s first VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qemu-img-info.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;qemu-img info -U --output=json&lt;/code&gt; of base&amp;rsquo;s disk&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;images&lt;/code&gt; section, on Linux&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qemu-img-info-overlay.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the same, of a project VM&amp;rsquo;s overlay disk&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;project&lt;/code&gt; section, on Linux&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;security-missing.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;security find-generic-password&lt;/code&gt; for an item that isn&amp;rsquo;t there, and its exit status&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;images&lt;/code&gt; section, on macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tmutil-isexcluded.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tmutil isexcluded&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;images&lt;/code&gt; section, on macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;mise run e2e -- --golden&lt;/code&gt; captures them on a real machine, into the checkout, and you commit what changed. It runs the contract test with &lt;code&gt;STUB_GOLDEN&lt;/code&gt; set to the system&amp;rsquo;s folder for the dummy instances&amp;rsquo; fixtures, and runs the other commands itself, so a run needs the &lt;code&gt;images&lt;/code&gt; section, and the &lt;code&gt;project&lt;/code&gt; section for a running VM. Each fixture has this machine&amp;rsquo;s home folder replaced with &lt;code&gt;/home/me&lt;/code&gt;, the user&amp;rsquo;s name with &lt;code&gt;me&lt;/code&gt;, and the user&amp;rsquo;s full name, the timezone and a VM&amp;rsquo;s environment made up, so it holds nothing of yours. A capture isn&amp;rsquo;t a check, so a run with &lt;code&gt;--golden&lt;/code&gt; runs as many checks as one without, and a capture that fails says so and keeps the fixture it had. Run it on a Mac and on a &lt;a href="#linux-hosts"&gt;Linux host&lt;/a&gt; after Lima or QEMU changes what it prints.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TestGoldenLimactlVersion&lt;/code&gt;, &lt;code&gt;TestGoldenLimactlList&lt;/code&gt; and &lt;code&gt;TestGoldenQemuImgInfo&lt;/code&gt; in &lt;code&gt;internal/backend/lima/golden_test.go&lt;/code&gt; read every system&amp;rsquo;s fixtures with devvm&amp;rsquo;s own parsers, so a change in what the tools print that devvm would misread fails them on any machine. Each also runs the stub and checks that its output has the same form, or the same shape for JSON: every field the stub prints is one that the real tool prints, with a value of the same kind. For &lt;code&gt;limactl list --json&lt;/code&gt;, the stub&amp;rsquo;s output is its listing after the contract test&amp;rsquo;s scenario. &lt;code&gt;TestGoldenSecurityTmutil&lt;/code&gt; in &lt;code&gt;internal/platform&lt;/code&gt; checks the stub&amp;rsquo;s &lt;code&gt;security&lt;/code&gt; and &lt;code&gt;tmutil&lt;/code&gt; against macOS&amp;rsquo;s fixtures the same way, on macOS.&lt;/p&gt;
&lt;h2 data-hextra-search-id="unreviewed-emulations"&gt;Unreviewed emulations&lt;span class="hx:absolute hx:-mt-20" id="unreviewed-emulations"&gt;&lt;/span&gt;
&lt;a href="#unreviewed-emulations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm refuses an emulated feature until its review passes, yet the review needs end-to-end checks of it. In a &lt;a href="#test-builds"&gt;test build&lt;/a&gt;, &lt;code&gt;DEVVM_UNREVIEWED&lt;/code&gt; lets the ones it names through, as &lt;code&gt;backend:feature&lt;/code&gt; pairs, comma-separated, each time with a warning (&lt;code&gt;backend_unreviewed_used&lt;/code&gt;). A release ignores it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;DEVVM_UNREVIEWED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lima:ports-all devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It&amp;rsquo;s for tests only, of an emulation before its review: none needs it now, as every emulation is reviewed. It never makes a feature a backend lacks usable, and &lt;code&gt;devvm doctor&lt;/code&gt; still shows the feature &lt;code&gt;unreviewed&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-host-of-any-size"&gt;A host of any size&lt;span class="hx:absolute hx:-mt-20" id="a-host-of-any-size"&gt;&lt;/span&gt;
&lt;a href="#a-host-of-any-size" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm reads this machine&amp;rsquo;s CPUs, its memory and the free space on its disks when it fits base to the host, checks a size you give it, checks free space before a build or a new VM, and warns in &lt;code&gt;devvm doctor&lt;/code&gt;. All of these reads go through &lt;code&gt;platform.Host&lt;/code&gt;, so the CLI tests can stand in for a host of any size and pass the same way on a large Mac and on a small CI runner. In a test build, three environment variables replace what &lt;code&gt;platform.Host&lt;/code&gt; reads:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Replaces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_CPUS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the number of CPUs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_MEMORY_GIB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the memory, in GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_FREE_GIB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the free space in GiB, on every disk&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Only a &lt;a href="#test-builds"&gt;test build&lt;/a&gt; reads them, and a release ignores all three, so no variable can make devvm see more free space or more memory than this machine has. Each one that isn&amp;rsquo;t set leaves the machine&amp;rsquo;s own value. &lt;code&gt;internal/cli/script_test.go&lt;/code&gt; sets a large host in every script: 8 CPUs, 16 GiB of memory and 500 GiB free, which is more than base asks for and more than any build checks for. A script that tests a small host sets its own values with &lt;code&gt;env&lt;/code&gt;, as &lt;code&gt;small_host.txtar&lt;/code&gt; does with 2 CPUs, 7 GiB and 1 GiB free:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;env DEVVM_TEST_CPUS=2
env DEVVM_TEST_MEMORY_GIB=7
! exec devvm size -g --cpus 3
stderr &amp;#39;^devvm: too_many_cpus have=2 want=3$&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To go back to the large host later in the same script, set the large values again, because an empty value leaves the machine&amp;rsquo;s own. The fake host covers only size and free space. What differs between operating systems, such as Lima&amp;rsquo;s disk floors on Linux, ports already in use, Docker on &lt;code&gt;PATH&lt;/code&gt;, or tmpfs and 9p mounts, still differs, and the Linux CI job is what catches it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="any-time-zone"&gt;Any time zone&lt;span class="hx:absolute hx:-mt-20" id="any-time-zone"&gt;&lt;/span&gt;
&lt;a href="#any-time-zone" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The tests pass in any time zone and on any date, because a test that compares times counts them from an instant it parsed or fixed, or works in UTC, and never sets &lt;code&gt;time.Local&lt;/code&gt;. A testscript that needs an old file uses a date far in the past, such as &lt;code&gt;touch -t 202001010000&lt;/code&gt;, and one that needs a file that stays new uses a date far in the future, such as an export named &lt;code&gt;20991231-235959&lt;/code&gt;, so the scripts keep passing as the calendar moves on. CI runs &lt;code&gt;mise run test&lt;/code&gt; on macOS in UTC and on Linux with &lt;code&gt;TZ=America/Los_Angeles&lt;/code&gt;, which has daylight saving time, so a test that only passes in one zone fails in CI and not only on a laptop. To check a change the same way, run the tests with another zone, including one with an odd offset or a half-hour DST change:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;America/Los_Angeles mise run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Pacific/Chatham mise run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;TZ&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Australia/Lord_Howe mise run test&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="fuzzing"&gt;Fuzzing&lt;span class="hx:absolute hx:-mt-20" id="fuzzing"&gt;&lt;/span&gt;
&lt;a href="#fuzzing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s fuzz targets use Go&amp;rsquo;s built-in fuzzing, and each one checks a property of what it fuzzes, not only that nothing panics. &lt;code&gt;go test&lt;/code&gt; runs only each target&amp;rsquo;s seed inputs, the ones its &lt;code&gt;f.Add&lt;/code&gt; lines give and the files in its package&amp;rsquo;s &lt;code&gt;testdata/fuzz/&amp;lt;target&amp;gt;/&lt;/code&gt; folder, so every run of the tests checks them. To fuzz one target on your machine, or to run one failing input again:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^$&amp;#39;&lt;/span&gt; -fuzz &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy$&amp;#39;&lt;/span&gt; -fuzztime 2m ./internal/proxy &lt;span class="c1"&gt;# fuzz one target for two minutes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^$&amp;#39;&lt;/span&gt; -fuzz &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy$&amp;#39;&lt;/span&gt; -parallel &lt;span class="m"&gt;2&lt;/span&gt; ./internal/proxy &lt;span class="c1"&gt;# with two workers, on a busy machine&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^$&amp;#39;&lt;/span&gt; -fuzz &lt;span class="s1"&gt;&amp;#39;^FuzzUnpack$&amp;#39;&lt;/span&gt; -fuzzminimizetime 1000x ./internal/upgrade &lt;span class="c1"&gt;# minimizing each new input in 1,000 runs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy/e9e4d242dc7b413a$&amp;#39;&lt;/span&gt; ./internal/proxy &lt;span class="c1"&gt;# one input in testdata/fuzz/FuzzNoProxy/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When a target fails, &lt;code&gt;go test&lt;/code&gt; writes the input that broke it to the package&amp;rsquo;s &lt;code&gt;testdata/fuzz/&amp;lt;target&amp;gt;/&lt;/code&gt; folder. Fix the code, add a test of the fix beside the code&amp;rsquo;s other tests, and commit the input with them, because &lt;code&gt;go test&lt;/code&gt; then runs it as a seed every time.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-nightly-run"&gt;The nightly run&lt;span class="hx:absolute hx:-mt-20" id="the-nightly-run"&gt;&lt;/span&gt;
&lt;a href="#the-nightly-run" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Fuzz workflow (&lt;code&gt;.github/workflows/fuzz.yml&lt;/code&gt;) fuzzes every target for five minutes each night, eight targets at a time, and you can start it by hand from the Actions tab. It minimizes each new input in at most 1,000 runs (&lt;code&gt;-fuzzminimizetime 1000x&lt;/code&gt;), because by default &lt;code&gt;go test&lt;/code&gt; minimizes each one for up to a minute, and a target whose runs write files, such as &lt;code&gt;FuzzUnpack&lt;/code&gt;, would spend its five minutes doing that. It finds the targets by reading each &lt;code&gt;func Fuzz&lt;/code&gt; in the tests, so a new target is fuzzed without any change to the workflow, and the proxy&amp;rsquo;s targets run first. A target&amp;rsquo;s name must be its own across the packages, because the workflow names the target&amp;rsquo;s artifacts and its line in the issue after it, and two targets of one name fail the run.&lt;/p&gt;
&lt;p&gt;Each target starts from its corpus, the inputs that its earlier nights found reaching new code, so each night goes further than the last rather than starting again from the seeds. &lt;code&gt;go test&lt;/code&gt; keeps a target&amp;rsquo;s corpus in the &lt;code&gt;fuzz&lt;/code&gt; folder of &lt;code&gt;GOCACHE&lt;/code&gt;, and the workflow restores it from a cache of the target&amp;rsquo;s own before fuzzing and saves it afterwards, whether the target failed or not. When a target fails, the workflow uploads the input that broke it as an artifact named &lt;code&gt;crash-&amp;lt;target&amp;gt;&lt;/code&gt;, and it adds the input to the target&amp;rsquo;s corpus, so the target fails on it again each night until the fix is on &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The workflow keeps the failures in one issue, &amp;ldquo;Fuzzing found failing inputs&amp;rdquo;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It opens the issue&lt;/strong&gt; on the first night a target fails. The issue lists each failing target with its package and how its run ended, and links the night&amp;rsquo;s run, where the &lt;code&gt;crash-&amp;lt;target&amp;gt;&lt;/code&gt; artifacts are. A target whose job reported nothing also counts as failing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It comments on the issue&lt;/strong&gt; when the failing targets change, so a new failure notifies you, and otherwise it only updates the issue&amp;rsquo;s link to the latest run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It closes the issue&lt;/strong&gt; on the first night every target passes, the inputs that failed included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only a run on &lt;code&gt;main&lt;/code&gt; updates the issue,&lt;/strong&gt; so a run started on another branch never closes it. The fuzz jobs run the repo&amp;rsquo;s code with read access alone, and the issue job, the only one that can write issues, runs none of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="what-each-target-checks"&gt;What each target checks&lt;span class="hx:absolute hx:-mt-20" id="what-each-target-checks"&gt;&lt;/span&gt;
&lt;a href="#what-each-target-checks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The parsers of what a VM can write, its output and its files, and of what comes from the network fail closed, so they take only what their format allows, within its caps. A secret&amp;rsquo;s value goes only where it&amp;rsquo;s bound, and a redaction leaves no planted secret behind. The host readers&amp;rsquo; targets are differential, which means each one checks one reader against a frozen copy of how it read a host before devvm read every host in one form, and allows only the differences that &lt;a href="https://next.devvm.dev/docs/contributing/design/#one-form-of-a-host"&gt;One form of a host&lt;/a&gt; lists.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;What it checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzCursorFrames&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A reply from a Cursor host, of any type, encodings, body and trailers, read in reads of any size, passes only what came, from its start. A Connect or gRPC stream passes whole messages alone, none over &lt;code&gt;frameMax&lt;/code&gt; as it came or as it decompresses, so a gzip bomb is refused, and none holding a JWT&amp;rsquo;s start once decompressed and, in JSON, with its escapes undone. Another body passes no JWT&amp;rsquo;s start of up to &lt;code&gt;jwtWindow&lt;/code&gt; bytes, and a trailer holding one never lets the body end cleanly.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzInject&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever a request&amp;rsquo;s host, method, path and headers, each binding&amp;rsquo;s value goes in only for a host the binding names, judged apart from the policy&amp;rsquo;s matcher, in &lt;code&gt;NormHost&lt;/code&gt;&amp;rsquo;s form, for a path and methods it allows. It goes in its own header alone, once, and only when exactly one of that header&amp;rsquo;s values held its exact placeholder. Every other header stays as it came.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseBindings&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A bindings file is read only at a version the proxy knows, with each binding&amp;rsquo;s kind, path, methods and scheme ones it takes, and none of version 1 that a proxy of that version reads otherwise. A file that&amp;rsquo;s read reads back as itself from what &lt;code&gt;Encode&lt;/code&gt; writes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzLinkList&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A links list is read only at its version, and a host and port find only an entry that names them, at a link&amp;rsquo;s address in &lt;code&gt;127.77.0.0/16&lt;/code&gt; as &lt;code&gt;netip&lt;/code&gt; writes it, whose socket is this VM&amp;rsquo;s link&amp;rsquo;s for that address and port.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzBrokerFrames&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever frame a child sends, the broker&amp;rsquo;s read never panics, refuses a frame past 2 MiB without reading it, takes only a frame of a type the protocol&amp;rsquo;s version knows, with its fields alone, and answers a request only with what its own config names: a value looked up with its own binding, a file of its own list, no link its list lacks, a token exchange at its own endpoints for its own VM, a lookup of a host name alone, and a connection only to an address that its own floor allows, never this machine&amp;rsquo;s loopback or its own address, which no rule of its names.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzFrameStreams&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever stream of frames reaches either side, the broker answers each request with a frame of its ID and type and one of the protocol&amp;rsquo;s error codes alone, the child takes no reply to a request it never sent, nor a second start, and both end at the first frame that breaks the rules or at the stream&amp;rsquo;s end, never panicking or hanging.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseUpstream&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A company proxy&amp;rsquo;s URL is taken only as &lt;code&gt;http://&lt;/code&gt;, with a host, a port that is one or none, and no path but &lt;code&gt;/&lt;/code&gt; or query, and the upstream made of it has that host and port and Basic credentials only when it names a user. Its errors hold no more of the URL than its scheme.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzNoProxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Each &lt;code&gt;NO_PROXY&lt;/code&gt; entry sends directly only what it names: every host for &lt;code&gt;*&lt;/code&gt;, addresses alone for an address or a CIDR, a name and the names under it, only those after a leading &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;*.&lt;/code&gt;, and only the port an entry names. A list sends directly what any of its entries does.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseNarinfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A narinfo is taken only when &lt;code&gt;cache.nixos.org-1&lt;/code&gt; signed it, for the path asked for, and what the signature doesn&amp;rsquo;t cover keeps to its forms: a NAR&amp;rsquo;s URL named by its &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, and sizes from 1 byte to 1 TiB.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseTokenRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A token request is read only as a form, or with no type, or as one JSON object alone, with no field named twice however its name is written, and its fields are what it sent.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzRedact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No secret planted in an agent&amp;rsquo;s settings file, JSON or TOML, survives into the VM&amp;rsquo;s copy, which reads back: a known key&amp;rsquo;s shape as a value or among other words, a URL&amp;rsquo;s password or query value, a value under a secret-looking key, an env or headers table&amp;rsquo;s value, and a flag&amp;rsquo;s argument. Claude Code&amp;rsquo;s own settings in its top-level &lt;code&gt;env&lt;/code&gt; stay, as Redact keeps them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzCapture&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever an agent&amp;rsquo;s token endpoint replies to whatever request, for every agent whose login devvm captures, the VM&amp;rsquo;s reply is a JSON object holding none of the reply&amp;rsquo;s tokens, and a reply that isn&amp;rsquo;t captured leaves the store unwritten.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzSplit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/redact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A password that &lt;code&gt;String&lt;/code&gt; finds in a line, in a URL of at most the tail&amp;rsquo;s length, never reaches the log when the line comes in parts of any size and is written after each part as far as &lt;code&gt;Split&lt;/code&gt; lets it, as the run log writes it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzStrip&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/jsonc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Strip&lt;/code&gt; keeps every offset, blanking bytes with spaces and keeping newlines, leaves JSON as it is, and, against &lt;code&gt;encoding/json&lt;/code&gt;, makes JSON with comments, trailing commas and a byte order mark read as the same value as the JSON without them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParsePublicKey&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A minisign public key is read only from one base64 line, alone or after its untrusted comment, as exactly its key ID and its Ed25519 key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzCheck&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A signature checks out only for the data its key&amp;rsquo;s holder signed, and only with the trusted comment that was signed, exactly.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzKeysCheck&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A manifest checks out only as the one signed, for the subject signed, and when at least two roles&amp;rsquo; files are each a signature of it by that role&amp;rsquo;s own key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzSumOf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A file&amp;rsquo;s hash in &lt;code&gt;SHA256SUMS&lt;/code&gt; is the first field of the first line that is exactly a 64-character hash and the file&amp;rsquo;s name, and such a line is always found.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzEntryName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;An archive&amp;rsquo;s entry is taken only as the release&amp;rsquo;s folder or as a regular file right in it, which lands in the folder &lt;code&gt;unpack&lt;/code&gt; makes and nowhere else.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzUnpack&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;unpack&lt;/code&gt; writes only regular files right in the folder it makes, &lt;code&gt;devvm&lt;/code&gt; among them, each as the archive has it, &lt;code&gt;devvm&lt;/code&gt; executable and the rest not, at most &lt;code&gt;unpackCap&lt;/code&gt; in all and nothing outside the folder. An archive it refuses leaves no folder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseHostKeys&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Each host key taken from what a VM shows is of a type ssh has, with no certificate, marker or pattern, in strict base64 of at most &lt;code&gt;keyMax&lt;/code&gt; that names its own type, from a line of the VM&amp;rsquo;s own, in order. Its line in the record is three fields, which read back as that key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParsePorts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A forwarder&amp;rsquo;s record, which other VMs&amp;rsquo; forwarders read, gives only ports that are ones, each an entry of its line, in order, and the ports it writes read back as themselves.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseCloneState&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s answer to the check is taken only whole: every repo asked for is gone or has its branches and status, within &lt;code&gt;cloneRefsMax&lt;/code&gt; branches in all and &lt;code&gt;cloneWorktreesMax&lt;/code&gt; worktrees a repo, each worktree once, at a clean path below the project folder, with a commit&amp;rsquo;s name or none for its HEAD. Nothing taken is more than the answer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseInit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The VM&amp;rsquo;s answer to its repos&amp;rsquo; setup names a seed as landed, or of another format, only when a line names that seed&amp;rsquo;s path, and an old git only by what &lt;code&gt;git --version&lt;/code&gt; prints, else as unknown.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseKept&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;What a seed&amp;rsquo;s apply kept, which devvm only shows, is the VM&amp;rsquo;s own lines and names as it wrote them, none of them empty.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseLFSPointer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A blob is taken as a Git LFS pointer only as the spec writes one, with its version line first and each line ended, one oid of 64 lowercase hex digits, which names its object&amp;rsquo;s path, and one size of at least 0.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzHandshakeVM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The relay&amp;rsquo;s handshake with the VM&amp;rsquo;s VNC server succeeds only for version 3.8 or later, a list of security types that has None, and an OK result, and reads no more than those. It writes only version 3.8, then None, and None only from a list that has it, and its error, which goes in the log, stays short.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzHostSites&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Each of the proxy&amp;rsquo;s readers of a host reads it as its frozen copy did, except for the listed differences.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzClaudeHostSite&lt;/code&gt;, &lt;code&gt;FuzzPromisorHostSite&lt;/code&gt;, &lt;code&gt;FuzzPublicHostSite&lt;/code&gt;, &lt;code&gt;FuzzRiskSites&lt;/code&gt;, &lt;code&gt;FuzzCheckHostSite&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;, &lt;code&gt;internal/vm&lt;/code&gt;, &lt;code&gt;internal/from&lt;/code&gt;, &lt;code&gt;internal/netpolicy&lt;/code&gt;, &lt;code&gt;internal/secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The other readers of a host, an MCP server&amp;rsquo;s, a promisor remote&amp;rsquo;s, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry&amp;rsquo;s, &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s and a secret&amp;rsquo;s &lt;code&gt;--host&lt;/code&gt;, read it as their frozen copies did, except for the listed differences.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseRule&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A rule&amp;rsquo;s text parses back to the same rule, a host rule never holds a space or a slash, and &lt;code&gt;ParsePolicy&lt;/code&gt; marks a line a rule exactly when &lt;code&gt;ValidRule&lt;/code&gt; takes it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A request target the proxy accepts is a plain host, and the allow command it suggests allows exactly that host and port.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzDenyBypass&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A deny of &lt;code&gt;/gists/&lt;/code&gt; and of &lt;code&gt;POST&lt;/code&gt; holds however a request spells the path or the method.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzClientHello&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reading a tunnel&amp;rsquo;s first bytes never hangs, a stream whose first byte starts a TLS record counts as TLS, and only a whole record of TLS&amp;rsquo;s version is returned.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzTransparent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Whatever its first bytes, a transparent connection to a proxy whose policy allows nothing reaches nothing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzNixPath&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;What &lt;code&gt;nixPath&lt;/code&gt; takes is one of the cache&amp;rsquo;s exact forms and names a file inside its folder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParse&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;devcontainer.json&lt;/code&gt; refuses &lt;code&gt;${localEnv:…}&lt;/code&gt; and &lt;code&gt;${env:…}&lt;/code&gt;. The check reads each variable as devvm does, from &lt;code&gt;${&lt;/code&gt; to the first &lt;code&gt;}&lt;/code&gt; after it, so a nested one such as &lt;code&gt;${${localEnv:HOME}}&lt;/code&gt; is left as text. Its environment variables are names and shell words the environment file holds as they are, and nothing it keeps has a NUL.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzParseRef&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any image reference parses into a tag without &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;:&lt;/code&gt;, and a valid one parses the same once written out in full.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzRestrictNetdev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/backend/lima&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RestrictNetdev&lt;/code&gt; refuses, or returns at most one network, restricted, with nothing else changed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FuzzQuote&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/shell&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A string that &lt;code&gt;Quote&lt;/code&gt; quotes reaches a shell as itself.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="manual-checks"&gt;Manual checks&lt;span class="hx:absolute hx:-mt-20" id="manual-checks"&gt;&lt;/span&gt;
&lt;a href="#manual-checks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;What the end-to-end tests leave out, as it would change something of yours or needs something it doesn&amp;rsquo;t have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Screen Sharing on &lt;code&gt;devvm desktop&lt;/code&gt;:&lt;/strong&gt; e2e speaks VNC itself (&lt;code&gt;TestE2EDesktop&lt;/code&gt;), because it can&amp;rsquo;t drive a window. In a VM made with &lt;code&gt;--layers desktop&lt;/code&gt;, run &lt;code&gt;devvm desktop&lt;/code&gt;. Screen Sharing opens and asks for the password devvm shows, and the Xfce desktop answers the mouse and keys. A wrong password gets refused. With Edit &amp;gt; Use Shared Clipboard on, text you copy on this machine doesn&amp;rsquo;t paste in the VM, and with &lt;code&gt;devvm desktop --clipboard&lt;/code&gt; it does. &lt;code&gt;~/.local/share/devvm/logs/runs/&lt;/code&gt; has no line saying the relay doesn&amp;rsquo;t know a message (&lt;code&gt;which the relay doesn't know&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A VM&amp;rsquo;s clock after this machine sleeps:&lt;/strong&gt; e2e can&amp;rsquo;t sleep a Mac, and hosted CI can&amp;rsquo;t either. With an open VM and an allowlist VM running, compare each VM&amp;rsquo;s &lt;code&gt;date +%s.%N&lt;/code&gt; over ssh with this machine&amp;rsquo;s clock, halfway through the ssh round trip. Then sleep the Mac for over 30 minutes and compare again right after it wakes and 2 minutes later. Each VM stays within about 0.1 s of this machine, the same as before the sleep, and the clock catches up without NTP: chrony in the allowlist VM has never synced, yet it stays right, while chrony in each VM logs &lt;code&gt;Forward time jump detected!&lt;/code&gt; after the wake. Before you sleep the Mac, check that &lt;code&gt;pmset -g assertions&lt;/code&gt; shows &lt;code&gt;PreventSystemSleep 0&lt;/code&gt;. An app running &lt;code&gt;caffeinate -s&lt;/code&gt; on AC power turns a sleep into a dark wake where the CPU keeps running, so the VMs never pause and the check proves nothing. In a real sleep, a measurement you run every few minutes in the background leaves a gap.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;workerd under &lt;code&gt;wrangler dev&lt;/code&gt;, without proxy settings:&lt;/strong&gt; e2e stands in for it with curl and a static Go client, because npm&amp;rsquo;s download of workerd would make the run depend on it. In a node VM on the allowlist tier with &lt;code&gt;devvm network allow api.open-meteo.com&lt;/code&gt;, make a Worker whose &lt;code&gt;fetch&lt;/code&gt; handler returns &lt;code&gt;fetch(&amp;quot;https://api.open-meteo.com/v1/forecast?latitude=0&amp;amp;longitude=0&amp;amp;current=temperature_2m&amp;quot;)&lt;/code&gt;, then run &lt;code&gt;npx wrangler dev&lt;/code&gt; and &lt;code&gt;curl localhost:8787&lt;/code&gt; in the VM. It answers with the forecast, and &lt;code&gt;devvm network log&lt;/code&gt; has &lt;code&gt;api.open-meteo.com:443&lt;/code&gt; &lt;code&gt;without proxy settings&lt;/code&gt;. With the host taken out of the rules, the Worker&amp;rsquo;s &lt;code&gt;fetch&lt;/code&gt; fails with the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt; or a certificate error, as workerd may not trust the VM&amp;rsquo;s CA, and the log has the block. With &lt;code&gt;devvm network transparent off&lt;/code&gt; and a launch, the &lt;code&gt;fetch&lt;/code&gt; fails at once, and &lt;code&gt;wrangler dev&lt;/code&gt;&amp;rsquo;s output has &lt;code&gt;Temporary failure in name resolution&lt;/code&gt;. Run it from a folder in the VM&amp;rsquo;s home, such as a copy in &lt;code&gt;~/wk&lt;/code&gt;, because workerd&amp;rsquo;s SQLite fails with &lt;code&gt;SQLITE_IOERR_SHMMAP&lt;/code&gt; in the project folder on a Linux host&amp;rsquo;s 9p mount.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt; an image only Docker has&lt;/strong&gt; (built locally, never pushed): it would build an image in your Docker. Build a small one (&lt;code&gt;docker build -t devvm-local-test .&lt;/code&gt; from a &lt;code&gt;Dockerfile&lt;/code&gt; with &lt;code&gt;FROM alpine:3&lt;/code&gt;), run &lt;code&gt;devvm --from devvm-local-test&lt;/code&gt; in a new folder, check the VM boots from it, then &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;docker image rm devvm-local-test&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Maintaining</title><link>https://next.devvm.dev/docs/contributing/maintaining/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/maintaining/</guid><description>
&lt;p&gt;For maintainers: version bumps and releases. Run the scripts with mise, which puts the pinned minisign on &lt;code&gt;PATH&lt;/code&gt;: &lt;code&gt;mise exec -- scripts/release.sh&lt;/code&gt;. A release you build yourself builds in a container, so you also need podman or Docker for that, though not to push a release&amp;rsquo;s tag for CI.&lt;/p&gt;
&lt;h2 data-hextra-search-id="updating-pinned-versions"&gt;Updating pinned versions&lt;span class="hx:absolute hx:-mt-20" id="updating-pinned-versions"&gt;&lt;/span&gt;
&lt;a href="#updating-pinned-versions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;scripts/bump.sh&lt;/code&gt; moves every version pinned in the repo, so preparing a release&amp;rsquo;s pins is one command:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh --check &lt;span class="c1"&gt;# every pin, by group, against upstream; changes nothing&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh &lt;span class="c1"&gt;# every patch and minor bump, then a summary for the commit message&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh docker pele &lt;span class="c1"&gt;# only these tools, with a named images or e2e tool&amp;#39;s major&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--check&lt;/code&gt; prints each group&amp;rsquo;s pins under its name in brackets, such as &lt;code&gt;[go]&lt;/code&gt;, with each pin&amp;rsquo;s current version and upstream&amp;rsquo;s newest, and whether a bump would be a patch, a minor or a major, or a new digest, commit, checksum or release for a pin that isn&amp;rsquo;t a version. A held pin says which version holds it, and a line that the run wouldn&amp;rsquo;t apply says how to apply it. When upstream&amp;rsquo;s latest is older than a pin, as when a release marker hasn&amp;rsquo;t moved yet, &lt;code&gt;--check&lt;/code&gt; says the pin is newer and &lt;code&gt;bump.sh&lt;/code&gt; leaves it as it is.&lt;/li&gt;
&lt;li&gt;With no tools named, &lt;code&gt;bump.sh&lt;/code&gt; applies every patch and minor bump. It never applies a major, a held pin or a tool that it applies only when named. Naming an images or e2e tool also applies its major. &lt;code&gt;e2e-tools&lt;/code&gt; always applies one, because users get the shared tools&amp;rsquo; new majors as well, and &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; holds what stays.&lt;/li&gt;
&lt;li&gt;It writes a value only if it has the shape of a pin (a version, a 64-hex checksum, a dated release, a commit, an image digest), since some of the edited files run on the host, and it edits nothing unless every value is good. Then it runs the commands that finish a bump: &lt;code&gt;mise lock&lt;/code&gt; for Go and the dev tools, &lt;code&gt;go get&lt;/code&gt; and &lt;code&gt;go mod tidy&lt;/code&gt; for the modules, &lt;code&gt;go get&lt;/code&gt; and &lt;code&gt;hugo mod tidy&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt; for Hextra, &lt;code&gt;npm install --ignore-scripts&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt; and then &lt;code&gt;mise run docs:diagrams&lt;/code&gt; for pele, and actionlint and zizmor for the workflows. If one of those fails, the pins are already edited, and &lt;code&gt;bump.sh&lt;/code&gt; says so.&lt;/li&gt;
&lt;li&gt;It needs &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;jq&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt; for Go, the dev tools, the end-to-end lock and pele, &lt;code&gt;go&lt;/code&gt; to apply the modules and Hextra, and &lt;code&gt;gh&lt;/code&gt; for the actions.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bump.sh&lt;/code&gt; sends &lt;code&gt;GH_TOKEN&lt;/code&gt;, or else &lt;code&gt;GITHUB_TOKEN&lt;/code&gt;, when one is set, with its calls to GitHub&amp;rsquo;s API and to nothing else, through a header file rather than curl&amp;rsquo;s command line. Without a token, GitHub allows 60 calls an hour from one address, which a CI runner shares with other jobs, and once they&amp;rsquo;re spent it refuses the rest with a &lt;code&gt;403&lt;/code&gt;. A fetch that fails names its URL.&lt;/li&gt;
&lt;li&gt;Every Monday the Pins workflow (&lt;code&gt;.github/workflows/pins.yml&lt;/code&gt;) runs &lt;code&gt;scripts/bump.sh --check&lt;/code&gt; with the workflow&amp;rsquo;s token and opens or updates one issue, &amp;ldquo;Pinned versions to bump&amp;rdquo;, which lists the outdated pins under their groups and the shared tools that &lt;code&gt;e2e-tools&lt;/code&gt; waits for, and closes it once none is left. It never bumps anything, so you run &lt;code&gt;scripts/bump.sh&lt;/code&gt;, then the &lt;code&gt;--from&lt;/code&gt; tier of the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt; when an images or e2e pin moved, because those bumps change images.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tools, by group, as &lt;code&gt;--check&lt;/code&gt; prints them:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;th&gt;What they move&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;images&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;nix&lt;/code&gt;, &lt;code&gt;direnv&lt;/code&gt;, &lt;code&gt;nix-direnv&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt;, &lt;code&gt;git-lfs&lt;/code&gt;, &lt;code&gt;rustup&lt;/code&gt;, &lt;code&gt;crane&lt;/code&gt;, &lt;code&gt;omb&lt;/code&gt;, &lt;code&gt;eza&lt;/code&gt;, &lt;code&gt;tealdeer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the downloads pinned in &lt;code&gt;assets/&lt;/code&gt;, and devvm&amp;rsquo;s host mise, so &lt;code&gt;scripts/bump.sh nix direnv nix-direnv&lt;/code&gt; moves the &lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;nix layer&lt;/a&gt;&amp;rsquo;s three pins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;shared-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cursor&lt;/code&gt;, only when named&lt;/td&gt;
&lt;td&gt;Cursor&amp;rsquo;s CLI in &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;, the one shared tool pinned for users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;e2e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;e2e-tools&lt;/code&gt;, &lt;code&gt;e2e-from&lt;/code&gt;, &lt;code&gt;e2e-curl&lt;/code&gt;, &lt;code&gt;e2e-ubuntu&lt;/code&gt;, &lt;code&gt;e2e-lima&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the end-to-end tests&amp;rsquo; own pins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;go&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;go&lt;/code&gt;, &lt;code&gt;go-minor&lt;/code&gt; only when named, &lt;code&gt;go-mods&lt;/code&gt;, &lt;code&gt;deadcode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Go, its modules and the deadcode task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dev-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dev-tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s tools except Go, with their &lt;code&gt;mise.lock&lt;/code&gt; entries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ci&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ci-mise&lt;/code&gt;, &lt;code&gt;actions&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the mise the workflows install, and their actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;release&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;release-image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the container that every release is built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;docs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hextra&lt;/code&gt;, &lt;code&gt;pele&lt;/code&gt; only when named&lt;/td&gt;
&lt;td&gt;the docs site&amp;rsquo;s theme, and pele, which draws its diagrams&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;go&lt;/code&gt; moves Go to its newest patch release of the minor that &lt;code&gt;go.mod&lt;/code&gt; names, from &lt;code&gt;go.dev/dl&lt;/code&gt;. It edits the &lt;code&gt;go&lt;/code&gt; lines of &lt;code&gt;go.mod&lt;/code&gt; and &lt;code&gt;docs/go.mod&lt;/code&gt;, &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;go&lt;/code&gt;, and its &lt;code&gt;mise.lock&lt;/code&gt; entries. &lt;code&gt;--check&lt;/code&gt; reports a newer minor on the &lt;code&gt;go-minor&lt;/code&gt; line, and &lt;code&gt;scripts/bump.sh go-minor&lt;/code&gt; moves the same files to it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;go-mods&lt;/code&gt; moves &lt;code&gt;go.mod&lt;/code&gt;&amp;rsquo;s direct modules, the ones the depguard allowlist allows and the tests&amp;rsquo; own, to their newest patch or minor release from the Go module proxy, with &lt;code&gt;go get&lt;/code&gt; and &lt;code&gt;go mod tidy&lt;/code&gt;. The indirect ones move as &lt;code&gt;go mod tidy&lt;/code&gt; needs them. A module&amp;rsquo;s next major has a new path, so &lt;code&gt;--check&lt;/code&gt; reports it and you move it by hand. &lt;code&gt;deadcode&lt;/code&gt; moves the deadcode task&amp;rsquo;s version in &lt;code&gt;mise.toml&lt;/code&gt; to golang.org/x/tools&amp;rsquo; newest release.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dev-tools&lt;/code&gt; moves each of &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s tools except Go to mise&amp;rsquo;s newest version of it, edits its line and runs &lt;code&gt;mise lock&lt;/code&gt;, so &lt;code&gt;mise.lock&lt;/code&gt; keeps every platform&amp;rsquo;s checksum, and markdownlint-cli2&amp;rsquo;s lock folder in &lt;code&gt;.mise/locks/&lt;/code&gt; moves with it. nilaway has no releases, so its pin is a pseudo-version, which &lt;code&gt;mise latest&lt;/code&gt; prints nothing for. &lt;code&gt;dev-tools&lt;/code&gt; moves a Go tool pinned to a pseudo-version to its newest commit&amp;rsquo;s, from the Go module proxy&amp;rsquo;s &lt;code&gt;@latest&lt;/code&gt; for the module that holds the tool, the longest prefix of its path that the proxy has. A tool with no newest version stops the run with an error, never a change, and so does any failed request to the proxy, except its answer that a prefix isn&amp;rsquo;t a module.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ci-mise&lt;/code&gt; moves the &lt;code&gt;version&lt;/code&gt; that the workflows give jdx/mise-action to base&amp;rsquo;s mise, as the run leaves it, so &lt;code&gt;scripts/bump.sh mise ci-mise&lt;/code&gt; moves both. &lt;code&gt;actions&lt;/code&gt; moves each workflow&amp;rsquo;s &lt;code&gt;uses:&lt;/code&gt; to its newest release&amp;rsquo;s tag, as the tag&amp;rsquo;s commit from &lt;code&gt;gh api&lt;/code&gt;, with the tag in the comment after it, and reports a newer major without applying it. An action in a folder of its repo, such as &lt;code&gt;actions/cache/restore&lt;/code&gt;, moves with its repo&amp;rsquo;s releases.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;release-image&lt;/code&gt; moves &lt;code&gt;release_image&lt;/code&gt; in &lt;code&gt;scripts/release.sh&lt;/code&gt;, the container that every release is built in, to the digest of Docker Hub&amp;rsquo;s newest index of &lt;code&gt;buildpack-deps:trixie-scm&lt;/code&gt;. The digest is the SHA-256 of the index it fetched, which every pull checks the registry&amp;rsquo;s index against, and before it records the digest, it checks that the index has a &lt;code&gt;linux/amd64&lt;/code&gt; and a &lt;code&gt;linux/arm64&lt;/code&gt; image, the two that builders run. Every release trusts this image, because its git, awk, tar and gzip write the release&amp;rsquo;s files, so read what changed in it before you commit a bump (docker-library&amp;rsquo;s &lt;code&gt;repo-info&lt;/code&gt; repository lists each image&amp;rsquo;s packages), and run &lt;code&gt;scripts/repro-check.sh&lt;/code&gt; after it (&lt;a href="#reproducible-releases"&gt;Reproducible releases&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hextra&lt;/code&gt; moves the docs site&amp;rsquo;s theme in &lt;code&gt;docs/go.mod&lt;/code&gt;, and it reminds you to compare the copies of Hextra&amp;rsquo;s files in &lt;code&gt;docs/layouts/&lt;/code&gt; with the new release&amp;rsquo;s. &lt;code&gt;pele&lt;/code&gt; moves pele only when named, because the diagrams need a look on the built site. It runs &lt;code&gt;npm install&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt; with the exact version and no install scripts, which writes &lt;code&gt;docs/package.json&lt;/code&gt; and &lt;code&gt;docs/package-lock.json&lt;/code&gt;, and then draws the diagrams again with &lt;code&gt;mise run docs:diagrams&lt;/code&gt;. The drawing script&amp;rsquo;s self-check fails that step when the new pele no longer measures and writes its small text, such as edge labels, as the script expects (&lt;a href="https://next.devvm.dev/docs/contributing/docs/#writing-docs"&gt;diagrams&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cursor&lt;/code&gt; moves Cursor&amp;rsquo;s CLI only when named, to the release that Cursor&amp;rsquo;s install script fetches, with each platform&amp;rsquo;s SHA-256 computed from its download, because Cursor publishes no checksums. devvm&amp;rsquo;s login and proxy code was read against the pinned release, so read the new one where that code names it, then run &lt;code&gt;e2e-tools&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A hold keeps a pin below a version, and &lt;code&gt;--check&lt;/code&gt; shows the newest version beside it. Go modules and actions take Dependabot&amp;rsquo;s ignore list in &lt;code&gt;.github/dependabot.yml&lt;/code&gt;, which keeps pflag below 1.1.0, because pflag 1.1 prints every boolean flag with &lt;code&gt;[=true|false]&lt;/code&gt; in the help. The other holds are in &lt;code&gt;bump.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;holds&lt;/code&gt;, which keeps Node, the one in &lt;code&gt;mise.toml&lt;/code&gt;, on its major.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bump.sh&lt;/code&gt;&amp;rsquo;s header lists every pin with the tool that moves it, or with &lt;code&gt;-&lt;/code&gt; and the reason it&amp;rsquo;s left, as &lt;code&gt;# pin&lt;/code&gt; lines. &lt;code&gt;TestBumpCoversPins&lt;/code&gt; in &lt;code&gt;internal/structure&lt;/code&gt; finds the pins in &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;mise.toml&lt;/code&gt;, both &lt;code&gt;go.mod&lt;/code&gt; files, the workflows, &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;, &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s consts, &lt;code&gt;scripts/release.sh&lt;/code&gt;&amp;rsquo;s container, &lt;code&gt;docs/hugo.yaml&lt;/code&gt; and &lt;code&gt;docs/package.json&lt;/code&gt;&amp;rsquo;s dependencies, without the network, and fails on a pin that no line covers or on a line that covers nothing, so a new pin gets a tool or a reason. The header also says why the pins outside those files are left as they are, such as the Lima that &lt;code&gt;install.sh&lt;/code&gt; installs, which is the newest release checked against its &lt;code&gt;SHA256SUMS&lt;/code&gt;, and the Homebrew formula, whose URLs and checksums &lt;code&gt;release.sh&lt;/code&gt; fills in.&lt;/li&gt;
&lt;li&gt;base&amp;rsquo;s Ubuntu cloud image and its apt packages have nothing to bump: devvm pins the newest image on each machine at its first build of base, and records the newest packages for each key of base at its first build (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;Ubuntu&amp;rsquo;s cloud image&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;base&amp;rsquo;s packages&lt;/a&gt;). &lt;code&gt;docker&lt;/code&gt; moves Docker&amp;rsquo;s packages (&lt;code&gt;assets/layers/docker.sh&lt;/code&gt;), read from its repository for base&amp;rsquo;s Ubuntu release, and its signing key. Packages added to &lt;code&gt;assets/layers/base.sh&lt;/code&gt; or &lt;code&gt;assets/features/&lt;/code&gt; need no pin of their own: they change base&amp;rsquo;s key, whose first build records them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mise&lt;/code&gt; moves base&amp;rsquo;s mise (&lt;code&gt;assets/layers/base.sh&lt;/code&gt;) and devvm&amp;rsquo;s host mise (&lt;code&gt;internal/tools/mise.go&lt;/code&gt;) together: the host one writes the lock base&amp;rsquo;s installs from. &lt;code&gt;TestMisePins&lt;/code&gt; fails when their versions or Linux checksums differ, and base&amp;rsquo;s mise version is in the key of each tool image mise installs, so a bump builds them again.&lt;/li&gt;
&lt;li&gt;The shared tools aren&amp;rsquo;t pinned for users, except Cursor&amp;rsquo;s CLI. Holds go in &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; (&lt;code&gt;node = &amp;quot;24&amp;quot;&lt;/code&gt; stays on that major). &lt;code&gt;testdata/mise.lock&lt;/code&gt; is a fixed lock for the tests.&lt;/li&gt;
&lt;li&gt;Their backends are named in &lt;code&gt;mise.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[tool_alias]&lt;/code&gt; table, for every tool that isn&amp;rsquo;t one of mise&amp;rsquo;s own &lt;code&gt;core:&lt;/code&gt; tools, because mise&amp;rsquo;s registry can move a tool to another backend in any release (&lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;versions&lt;/a&gt;). A new shared tool gets its alias there, and &lt;code&gt;TestToolBackendsNamed&lt;/code&gt; fails when a tool that isn&amp;rsquo;t a &lt;code&gt;core:&lt;/code&gt; tool has none, or when its alias isn&amp;rsquo;t the backend that &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt; resolved.&lt;/li&gt;
&lt;li&gt;When opencode&amp;rsquo;s major version changes, or a bump of &lt;code&gt;e2e-tools&lt;/code&gt; moves opencode to a version that adds migrations, refresh &lt;code&gt;internal/vm/testdata/opencode-&amp;lt;version&amp;gt;.sql&lt;/code&gt;, the schema of opencode&amp;rsquo;s database that &lt;code&gt;TestOpencodeCleanSchema&lt;/code&gt; cleans. Print it with &lt;code&gt;sqlite3 ~/.local/share/opencode/opencode.db .schema&lt;/code&gt; in a VM with that opencode, after &lt;code&gt;opencode auth list&lt;/code&gt; has made the database, and copy only the schema, never rows. You can also make the file from the release&amp;rsquo;s &lt;code&gt;packages/core/src/database/schema.gen.ts&lt;/code&gt; in opencode&amp;rsquo;s repo: unwrap its SQL and add the &lt;code&gt;migration&lt;/code&gt; table&amp;rsquo;s line at the end, and it matches &lt;code&gt;.schema&lt;/code&gt; line for line. Name the file for the version, and in the test put each new table in its list of tables that devvm empties or keeps, which the test asks for. A table or a column that holds a login also goes into &lt;code&gt;opencodeLogins&lt;/code&gt; (&lt;code&gt;internal/vm/agents.go&lt;/code&gt;) and the design note&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/contributing/design/#opencodes-database-in-history-exports"&gt;opencode&amp;rsquo;s database in history exports&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e2e-tools&lt;/code&gt;, &lt;code&gt;e2e-from&lt;/code&gt;, &lt;code&gt;e2e-curl&lt;/code&gt; and &lt;code&gt;e2e-ubuntu&lt;/code&gt; move the end-to-end tests&amp;rsquo; own pins, which keep their cached images valid between runs. &lt;code&gt;e2e-tools&lt;/code&gt; resolves &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt; again, with devvm&amp;rsquo;s pinned host mise, for both architectures&amp;rsquo; glibc and musl VMs. &lt;code&gt;e2e-from&lt;/code&gt; moves the digests of &lt;code&gt;node:24&lt;/code&gt;, &lt;code&gt;alpine:3&lt;/code&gt; and &lt;code&gt;ubuntu:26.04&lt;/code&gt; in &lt;code&gt;tests/e2e/from_test.go&lt;/code&gt; to Docker Hub&amp;rsquo;s. &lt;code&gt;e2e-curl&lt;/code&gt; moves &lt;code&gt;curlImage&lt;/code&gt; in &lt;code&gt;tests/e2e/transparent_test.go&lt;/code&gt;, the curl image that the network checks run in containers, to curlimages/curl&amp;rsquo;s newest release, by its digest. &lt;code&gt;e2e-ubuntu&lt;/code&gt; moves &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; in &lt;code&gt;tests/e2e/sandbox_test.go&lt;/code&gt;, the dated release of Ubuntu&amp;rsquo;s cloud image that e2e pins base to in place of the newest, to the newest Ubuntu lists. Ubuntu removes dated releases after a few months, and e2e&amp;rsquo;s going stops its first builds of base: bump &lt;code&gt;e2e-ubuntu&lt;/code&gt; before that. Run &lt;code&gt;e2e-tools&lt;/code&gt; after any change to &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;, because the end-to-end tests refuse a lock resolved from another one (&lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt;). &lt;code&gt;mise run test&lt;/code&gt; catches it first: &lt;code&gt;TestE2ELockPins&lt;/code&gt; checks the lock&amp;rsquo;s first line against &lt;code&gt;mise.toml&lt;/code&gt; and that it locks each of its tools, and &lt;code&gt;TestE2EUbuntuPins&lt;/code&gt; checks that &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; is a dated release of base&amp;rsquo;s Ubuntu release, which &lt;code&gt;e2e-ubuntu&lt;/code&gt; lists, and that &lt;code&gt;scripts/bump.sh&lt;/code&gt; and &lt;code&gt;tests/e2e&lt;/code&gt; name only that release.&lt;/li&gt;
&lt;li&gt;A shared tool&amp;rsquo;s newest release isn&amp;rsquo;t always published for every platform at once, as when its files are still uploading, or for a few days after a Node release until its musl builds appear. &lt;code&gt;e2e-tools&lt;/code&gt; counts a version that is newer than the one in &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt; as unpublished on a platform when its lock entry has no download with a checksum there, or when &lt;code&gt;mise lock&lt;/code&gt; stops with a &lt;code&gt;404&lt;/code&gt; for that platform&amp;rsquo;s download. It then names the tool, the version and the platform, and stops without editing the lock, so you try again later. When devvm resolves the shared tools for users and a lock entry has no download for a platform, it steps back to an older version (&lt;a href="https://next.devvm.dev/docs/internals/images/#versions"&gt;versions&lt;/a&gt;), but &lt;code&gt;e2e-tools&lt;/code&gt; only waits, and its next run tries the newest version again. While a tool waits, &lt;code&gt;e2e-tools&lt;/code&gt; can&amp;rsquo;t resolve the lock again after a change to &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; either.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--check&lt;/code&gt; reports an unpublished version as waiting for upstream and goes on, so the Pins workflow still passes, and its issue lists the line under Waiting for upstream, so the issue stays open while a tool waits. &lt;code&gt;--check&lt;/code&gt; still reports the other shared tools. When &lt;code&gt;mise lock&lt;/code&gt; stopped on the &lt;code&gt;404&lt;/code&gt;, &lt;code&gt;--check&lt;/code&gt; holds that tool back, at the lock&amp;rsquo;s version or left out when the lock has none, and runs &lt;code&gt;mise lock&lt;/code&gt; again, so another tool&amp;rsquo;s failure still stops the run. Applying &lt;code&gt;e2e-tools&lt;/code&gt; prints mise&amp;rsquo;s output before it stops. A &lt;code&gt;404&lt;/code&gt; counts as unpublished only when it&amp;rsquo;s the only error &lt;code&gt;mise lock&lt;/code&gt; printed, apart from the version and &lt;code&gt;--verbose&lt;/code&gt; lines that end its output, and never when mise only warned about it, and only when the download&amp;rsquo;s file name names an architecture and its address holds the version of exactly one of the tools that mise resolved. A version no newer than the lock&amp;rsquo;s that has no download for a platform still stops the run, because upstream published it, and so does any other failure of &lt;code&gt;mise lock&lt;/code&gt;, with mise&amp;rsquo;s output, such as a checksum that doesn&amp;rsquo;t match, even beside a &lt;code&gt;404&lt;/code&gt;, or a network error.&lt;/li&gt;
&lt;li&gt;While a tool waits, a plain &lt;code&gt;scripts/bump.sh&lt;/code&gt; stops at &lt;code&gt;e2e-tools&lt;/code&gt; before it edits anything, so bump the other pins by name, with &lt;code&gt;scripts/bump.sh TOOL…&lt;/code&gt;. A wait usually ends within a few days. When a line has been under Waiting for upstream for two weeks, look at the tool&amp;rsquo;s release, because a wait that long rarely ends on its own: upstream may have renamed the download, mise&amp;rsquo;s registry may build the wrong address for it, or the tool may have stopped publishing checksums. Each of these needs a fix in mise or a hold on the tool in &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;, not more waiting.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e2e-lima&lt;/code&gt; moves the Lima release that CI&amp;rsquo;s end-to-end workflow installs, &lt;code&gt;LIMA_VERSION&lt;/code&gt; in &lt;code&gt;.github/workflows/e2e.yml&lt;/code&gt;, to Lima&amp;rsquo;s newest release, and &lt;code&gt;LIMA_SHA256&lt;/code&gt; to its &lt;code&gt;Linux-x86_64&lt;/code&gt; tarball&amp;rsquo;s line in that release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt;. Lima&amp;rsquo;s release notes print the SHA-256 of &lt;code&gt;SHA256SUMS&lt;/code&gt; itself, so &lt;code&gt;e2e-lima&lt;/code&gt; checks the downloaded file against that value first and edits nothing when they differ.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/layers/ubuntu-cloud.gpg&lt;/code&gt; is Ubuntu&amp;rsquo;s cloud image signing key (fingerprint &lt;code&gt;D2EB44626FDDC30B513D5BB71A5D6C4C7DB87C81&lt;/code&gt;), from keyserver.ubuntu.com. If Ubuntu changes it, pinning a new image (a first build of base, or &lt;code&gt;devvm rebuild base&lt;/code&gt;) stops with &lt;code&gt;ubuntu_bad_signature&lt;/code&gt;: fetch the new key, check its fingerprint against Ubuntu&amp;rsquo;s announcement, and replace the file (&lt;code&gt;gpg --export FPR&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/layers/ubuntu-archive.gpg&lt;/code&gt; is Ubuntu&amp;rsquo;s archive signing key, &amp;ldquo;Ubuntu Archive Automatic Signing Key (2018)&amp;rdquo; (fingerprint &lt;code&gt;F6ECB3762474EDA9D21B7022871920D1991BC93C&lt;/code&gt;), fetched from keyserver.ubuntu.com by that fingerprint, checked against the fingerprint that &lt;a href="https://wiki.ubuntu.com/SecurityTeam/FAQ" target="_blank" rel="noopener"&gt;Ubuntu&amp;rsquo;s security team lists&lt;/a&gt;, and exported with &lt;code&gt;gpg --export-options export-minimal --export FPR&lt;/code&gt;. devvm checks the &lt;code&gt;InRelease&lt;/code&gt; files of a first build of base against it (&lt;code&gt;ubuntu.ArchiveKeyring&lt;/code&gt;). If Ubuntu signs the archive with a new key, that build stops with &lt;code&gt;packages_refused&lt;/code&gt;: fetch the new key, check its fingerprint the same way, and replace the file. The key must be RSA, because &lt;code&gt;internal/ubuntu/pgp.go&lt;/code&gt; checks only RSA signatures. Moving base to a new Ubuntu release (&lt;code&gt;ubuntu.Series&lt;/code&gt;, &lt;code&gt;ubuntu.Version&lt;/code&gt;) also moves &lt;code&gt;ubuntu.Released&lt;/code&gt;, the day Ubuntu released it, which is the date of that release&amp;rsquo;s own &lt;code&gt;InRelease&lt;/code&gt; (&lt;code&gt;dists/&amp;lt;series&amp;gt;/InRelease&lt;/code&gt;), because devvm refuses a release pocket dated before it.&lt;/li&gt;
&lt;li&gt;Edited scripts change image keys, so the affected images rebuild on next use. An edit to &lt;code&gt;assets/prelude.sh&lt;/code&gt; changes the key of every image and every shared tool image. Build them in a sandbox of their own (&lt;code&gt;LIMA_HOME&lt;/code&gt;, &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;XDG_DATA_HOME&lt;/code&gt;, &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;) before committing (&lt;code&gt;devvm build docker&lt;/code&gt;, or a VM made with the tools whose build script changed), then &lt;code&gt;devvm gc&lt;/code&gt;, and run the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="known-vulnerabilities"&gt;Known vulnerabilities&lt;span class="hx:absolute hx:-mt-20" id="known-vulnerabilities"&gt;&lt;/span&gt;
&lt;a href="#known-vulnerabilities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;govulncheck checks devvm against the Go vulnerability database. &lt;code&gt;mise run vuln&lt;/code&gt; scans the code twice, once as built for Linux and once as built for macOS, because some files build for only one of them, and it reports a vulnerability only when devvm&amp;rsquo;s code calls the vulnerable function. Two workflows run it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CI&amp;rsquo;s &lt;code&gt;vuln&lt;/code&gt; job&lt;/strong&gt; runs &lt;code&gt;mise run vuln&lt;/code&gt; on every push and pull request that CI runs on, as a job of its own, so a vulnerability published since the last change fails that check alone, and &lt;code&gt;lint&lt;/code&gt; and &lt;code&gt;test&lt;/code&gt; still report.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Vulnerabilities workflow&lt;/strong&gt; (&lt;code&gt;.github/workflows/vuln.yml&lt;/code&gt;) runs every Monday, and you can start it by hand from the Actions tab. It scans &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s code for both systems, then downloads the archives of the latest release and of the newest release, prerelease or not, and checks that &lt;code&gt;SHA256SUMS&lt;/code&gt; lists each archive and matches it. Then it scans each platform&amp;rsquo;s binary with &lt;code&gt;govulncheck -mode=binary&lt;/code&gt;, because a release&amp;rsquo;s binaries keep the Go and modules they were built with.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A binary&amp;rsquo;s scan works differently from the code&amp;rsquo;s. It reports the vulnerable code that the binary holds rather than the calls into it, and it can name a package that isn&amp;rsquo;t linked into the binary at all. Before you release for a vulnerability that only a binary&amp;rsquo;s scan found, check that the binary has it, with &lt;code&gt;go version -m BINARY&lt;/code&gt; for its Go and modules and &lt;code&gt;govulncheck -mode=binary -show traces BINARY&lt;/code&gt; for the code it holds.&lt;/p&gt;
&lt;p&gt;The workflow keeps its findings in one issue, &amp;ldquo;Known vulnerabilities in devvm&amp;rdquo;, which lists each scan&amp;rsquo;s vulnerabilities with the version found and the version that fixes it, and links each one&amp;rsquo;s entry in the database. It comments on the issue whenever the findings change, so a new vulnerability notifies you, and closes the issue once every scan finds nothing. When govulncheck itself fails, the job fails and leaves the issue as it is. Only a scan job with read access runs govulncheck. A second job, the only one that can write issues, reads the scan&amp;rsquo;s findings and updates the issue, and it does so only in a run on &lt;code&gt;main&lt;/code&gt;, so a run started on another branch never closes it. The scans cover devvm&amp;rsquo;s Go code alone, not the packages in the VM images, the pinned tools, Lima, or releases older than the two they scan.&lt;/p&gt;
&lt;p&gt;To fix a vulnerability, move what it&amp;rsquo;s in to the version that fixes it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run vuln &lt;span class="c1"&gt;# what govulncheck finds in your checkout, and the calls that reach it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh go &lt;span class="c1"&gt;# Go&amp;#39;s newest patch release, for one in the standard library&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh go-minor &lt;span class="c1"&gt;# Go&amp;#39;s newest minor release, when only a newer minor has the fix&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/bump.sh go-mods &lt;span class="c1"&gt;# the direct modules&amp;#39; newest patches and minors, for one in a module&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A module that only &lt;code&gt;go.mod&lt;/code&gt;&amp;rsquo;s indirect requirements hold moves with &lt;code&gt;go get &amp;lt;module&amp;gt;@&amp;lt;fixed version&amp;gt;&lt;/code&gt; and &lt;code&gt;go mod tidy&lt;/code&gt;. Once &lt;code&gt;main&lt;/code&gt; is fixed, its scan passes, but the issue stays open while the latest release or the newest release still has the vulnerability, and it closes only when a release with the fix is the latest. A vulnerability that affects devvm&amp;rsquo;s users calls for a release (&lt;a href="#releasing"&gt;Releasing&lt;/a&gt;), and one that devvm&amp;rsquo;s code reaches only in a way that doesn&amp;rsquo;t matter can wait for the next one.&lt;/p&gt;
&lt;h2 data-hextra-search-id="fuzzing-failures"&gt;Fuzzing failures&lt;span class="hx:absolute hx:-mt-20" id="fuzzing-failures"&gt;&lt;/span&gt;
&lt;a href="#fuzzing-failures" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Fuzz workflow (&lt;code&gt;.github/workflows/fuzz.yml&lt;/code&gt;) fuzzes every target each night and keeps its failures in one issue, &amp;ldquo;Fuzzing found failing inputs&amp;rdquo;, which names each failing target and links the night&amp;rsquo;s run. For each target there, download its &lt;code&gt;crash-&amp;lt;target&amp;gt;&lt;/code&gt; artifact from that run, and fix it as &lt;a href="https://next.devvm.dev/docs/contributing/testing/#fuzzing"&gt;Fuzzing&lt;/a&gt; says:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp ~/Downloads/crash-FuzzNoProxy/* internal/proxy/testdata/fuzz/FuzzNoProxy/ &lt;span class="c1"&gt;# the input, in its target&amp;#39;s seeds&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; -run &lt;span class="s1"&gt;&amp;#39;^FuzzNoProxy$&amp;#39;&lt;/span&gt; ./internal/proxy &lt;span class="c1"&gt;# fails until the code is fixed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Commit the input with the fix and its test. The input stays in the target&amp;rsquo;s corpus, so the target fails on it each night until the fix is on &lt;code&gt;main&lt;/code&gt;, and the issue closes on the first night every target passes (&lt;a href="https://next.devvm.dev/docs/contributing/testing/#the-nightly-run"&gt;the nightly run&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="checking-base-against-ubuntus-newest"&gt;Checking base against Ubuntu&amp;rsquo;s newest&lt;span class="hx:absolute hx:-mt-20" id="checking-base-against-ubuntus-newest"&gt;&lt;/span&gt;
&lt;a href="#checking-base-against-ubuntus-newest" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The end-to-end tests pin base to &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, so they never build base the way a user&amp;rsquo;s first build does, from Ubuntu&amp;rsquo;s newest cloud image and the mirrors&amp;rsquo; newest packages. An upstream change can break those builds before any test sees it. For example, vz&amp;rsquo;s direct kernel boot needs an uncompressed arm64 kernel, and a VM shuts down only when its kernel has &lt;code&gt;gpio_keys&lt;/code&gt;. &lt;code&gt;mise run e2e -- --newest-base&lt;/code&gt; builds base as a user&amp;rsquo;s first build does and runs the checks that prove it works: &lt;code&gt;images&lt;/code&gt;, then &lt;code&gt;project&lt;/code&gt; (a VM that boots, stops, starts again and shuts down) and &lt;code&gt;tools&lt;/code&gt;. &lt;code&gt;--only&lt;/code&gt; chooses other sections in their place.&lt;/p&gt;
&lt;p&gt;The run gives devvm no release to pin. It reads the newest release from Ubuntu&amp;rsquo;s listing, as &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; does, and prints it at its start next to &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;. It runs in a sandbox of its own, which is slot 0&amp;rsquo;s with &lt;code&gt;-newest&lt;/code&gt; added to its Lima home, state folder, Keychain service and lock (&lt;code&gt;~/.lt-e2e-go-newest&lt;/code&gt;, &lt;code&gt;/tmp/devvm-go-e2e-newest&lt;/code&gt;, &lt;code&gt;devvm-go-e2e-newest&lt;/code&gt; and &lt;code&gt;/tmp/devvm-go-e2e-newest.lock&lt;/code&gt;), with each fixed port slot 0&amp;rsquo;s plus 1000. So the cached pinned images in the other sandboxes stay as they are. Each run first deletes its sandbox&amp;rsquo;s images, tool images and package cache, so base is built from nothing, with its packages from the mirrors. The images section checks that devvm pinned the release Ubuntu listed as its newest and that base booted from it. When the newest doesn&amp;rsquo;t boot, a user&amp;rsquo;s devvm falls back to the release before it (&lt;code&gt;origin_no_boot&lt;/code&gt;), so that check fails on the fallback. Its times go in &lt;code&gt;timings/plain-newest/&lt;/code&gt; in slot 0&amp;rsquo;s state folder, apart from the cached runs&amp;rsquo;. &lt;code&gt;--newest-base&lt;/code&gt; can&amp;rsquo;t be combined with &lt;code&gt;--slots&lt;/code&gt; or &lt;code&gt;--slot&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Run it before each release and every week or two between them, on an arm64 Mac (vz) and on a Linux host (QEMU) when you can, because the two boot base differently. At its end, it prints the release Ubuntu listed and the release devvm pinned. When a check fails, it says &lt;code&gt;UPSTREAM DRIFT&lt;/code&gt; and names the release, because a user&amp;rsquo;s first build of base gets the same failure now. Then:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Read the failed check&amp;rsquo;s output and the run log of base&amp;rsquo;s build, which the build&amp;rsquo;s output names (&lt;code&gt;log_details&lt;/code&gt;), in the sandbox&amp;rsquo;s state folder under &lt;code&gt;data/devvm/logs/runs/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;mise run e2e -- --only images&lt;/code&gt; on the pinned release. If it passes, the failure is upstream&amp;rsquo;s, from the newer image or its packages. If it fails too, the fault is devvm&amp;rsquo;s own, so fix that first.&lt;/li&gt;
&lt;li&gt;Fix devvm for the new release, such as a change to &lt;code&gt;assets/layers/base.sh&lt;/code&gt; or to the Lima template. Then run &lt;code&gt;--newest-base&lt;/code&gt; again until it passes.&lt;/li&gt;
&lt;li&gt;Bump &lt;code&gt;e2e-ubuntu&lt;/code&gt; to that release once it passes, so the other end-to-end runs test it too.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Until a fix ships, users can still build base, because devvm&amp;rsquo;s fallback to the release before covers a newest release that doesn&amp;rsquo;t boot. A package that breaks base has no fallback, so a fix for one goes in the next release.&lt;/p&gt;
&lt;h2 data-hextra-search-id="releasing"&gt;Releasing&lt;span class="hx:absolute hx:-mt-20" id="releasing"&gt;&lt;/span&gt;
&lt;a href="#releasing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Once, GitHub:&lt;/strong&gt; the release environment, the rulesets, immutable releases and the co-signer&amp;rsquo;s GitHub App, as &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/"&gt;Setting up GitHub for releases&lt;/a&gt; lists them in order. Until that&amp;rsquo;s done, releases go out with &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;, as &lt;a href="#publishing-from-this-machine"&gt;Publishing from this machine&lt;/a&gt; describes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Once, the keys:&lt;/strong&gt; the three release keys, as &lt;a href="#release-keys"&gt;Release keys&lt;/a&gt; describes, the old release key, a minisign key that signs each release while releases bridge from it, &lt;code&gt;minisign -G -p packaging/minisign.pub -s ~/.minisign/devvm.key&lt;/code&gt; (commit &lt;code&gt;packaging/minisign.pub&lt;/code&gt;; the secret key and its password never go in the repo), and a key git signs tags with (&lt;code&gt;git config user.signingkey&lt;/code&gt;, GPG, or SSH with &lt;code&gt;gpg.format ssh&lt;/code&gt;) that &lt;code&gt;git tag -v&lt;/code&gt; verifies on this machine. Commit its fingerprint in &lt;code&gt;packaging/release-signer&lt;/code&gt;, one per line (&lt;code&gt;#&lt;/code&gt; comments): the GPG fingerprint (&lt;code&gt;gpg --fingerprint&lt;/code&gt;, no spaces), or the SSH key&amp;rsquo;s &lt;code&gt;SHA256:…&lt;/code&gt; (&lt;code&gt;ssh-keygen -lf KEY.pub&lt;/code&gt;). &lt;code&gt;release.sh&lt;/code&gt; refuses a tag signed by any other key, even one git trusts. To rotate, add the new key&amp;rsquo;s line, tag with it, then remove the old one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Between releases,&lt;/strong&gt; each change on &lt;code&gt;main&lt;/code&gt; that someone could notice adds its line to the &lt;code&gt;## Unreleased&lt;/code&gt; section at the bottom of &lt;code&gt;CHANGELOG.md&lt;/code&gt;, in the group of the people who notice it, and its full story as a section of the next release&amp;rsquo;s page in &lt;code&gt;releases/&lt;/code&gt;, in the same commit. A line under the page&amp;rsquo;s title links Unreleased, so the top of the page shows the latest release. Unreleased has no Highlights, because they&amp;rsquo;re written at the release, and a change that affects nobody, such as a refactor, adds no line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Before the release commit, sort the lines by audience.&lt;/strong&gt; List every Unreleased line in a table for the maintainer, with the group it goes in, who notices it and the line itself, and name the close calls, the lines that could go in either of two groups, with the case for each. Once the maintainer approves the table, write the Highlights and the lines as it says. Then someone who didn&amp;rsquo;t write the lines, such as a fresh agent, reviews them with the docs-voice skill, reading the visible part as a user would on GitHub and then each collapsed group, and flags what&amp;rsquo;s vague, padded, repeated across groups or about the notes themselves. Fold in the fixes until the review finds nothing to change.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Each release:&lt;/strong&gt; bump &lt;code&gt;VERSION&lt;/code&gt;, move the Unreleased lines to the top as the release&amp;rsquo;s &lt;code&gt;## &amp;lt;version&amp;gt;&lt;/code&gt; entry, leaving the empty &lt;code&gt;## Unreleased&lt;/code&gt; section at the bottom, and commit it on &lt;code&gt;main&lt;/code&gt;. Then tag main&amp;rsquo;s HEAD and push it, and CI and the co-signer do the rest:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag -s v&amp;lt;version&amp;gt; &lt;span class="c1"&gt;# sign the tag with your SSH key&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/publish.sh &lt;span class="c1"&gt;# check the tag, then push main and the tag&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise &lt;span class="nb"&gt;exec&lt;/span&gt; -- scripts/publish.sh --sign-legacy &lt;span class="c1"&gt;# once the co-signer&amp;#39;s draft is there, while the bridge lasts&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Approve the Release workflow&amp;rsquo;s run in the Actions tab, and GitHub emails you when it waits. Approve only a run for the tag you just pushed, because the run is that tag&amp;rsquo;s own workflow, and approving it gives CI&amp;rsquo;s release key to the tag&amp;rsquo;s code. Within the hour, the co-signer rebuilds the release, signs it and makes its draft release, or tells you through its notify command why not. While releases bridge from the old release key, &lt;code&gt;--sign-legacy&lt;/code&gt; adds that key&amp;rsquo;s signature to the draft, asking for its password, and at its next run the co-signer publishes the release and updates the tap. The old key&amp;rsquo;s secret half never leaves this machine, and only minisign reads it, so no CI job and no GitHub secret ever has it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;If a final release changed the state format,&lt;/strong&gt; freeze &lt;code&gt;testdata/v&amp;lt;version&amp;gt;/&lt;/code&gt; once the tag exists: run its &lt;code&gt;generate.sh&lt;/code&gt; against the tag on a Mac and on Linux, and add its tests, as &lt;a href="https://next.devvm.dev/docs/contributing/structure/#freezing-a-releases-state"&gt;Freezing a release&amp;rsquo;s state&lt;/a&gt; says. A release that changes nothing on disk adds no fixture, and a release candidate adds none either, because its final release&amp;rsquo;s fixture holds the state it changed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A prerelease,&lt;/strong&gt; such as a release candidate or a beta, goes out the same way, with a version of the form &lt;code&gt;x.y.z-&amp;lt;word&amp;gt;.N&lt;/code&gt;: &lt;code&gt;VERSION&lt;/code&gt; holds &lt;code&gt;0.2.0-rc.1&lt;/code&gt;, &lt;code&gt;CHANGELOG.md&lt;/code&gt; gets an entry &lt;code&gt;## 0.2.0-rc.1&lt;/code&gt;, and the tag is &lt;code&gt;v0.2.0-rc.1&lt;/code&gt;. The word is lowercase letters, such as &lt;code&gt;rc&lt;/code&gt;, &lt;code&gt;beta&lt;/code&gt; or &lt;code&gt;alpha&lt;/code&gt;, and &lt;code&gt;release.sh&lt;/code&gt; refuses any other form of &lt;code&gt;VERSION&lt;/code&gt;. The co-signer, or &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;, marks a prerelease&amp;rsquo;s GitHub release as a prerelease, so GitHub&amp;rsquo;s latest release skips it, and so do the install script&amp;rsquo;s default, devvm upgrade and the daily release check. In the tap it changes only &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, the formula that follows prereleases, in a commit titled &lt;code&gt;devvm-rc &amp;lt;version&amp;gt;&lt;/code&gt;, so the formula &lt;code&gt;devvm&lt;/code&gt; stays on the last release. At the end, &lt;code&gt;--local&lt;/code&gt; prints how to check the prerelease with &lt;code&gt;brew upgrade devvm-rc&lt;/code&gt; or &lt;code&gt;brew install devvmhq/tap/devvm-rc&lt;/code&gt;, and the prerelease&amp;rsquo;s install script line.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The tap&amp;rsquo;s two formulas&lt;/strong&gt; are &lt;code&gt;devvm&lt;/code&gt;, the newest release&amp;rsquo;s, and &lt;code&gt;devvm-rc&lt;/code&gt;, the newest prerelease&amp;rsquo;s or release&amp;rsquo;s, whichever is newer. &lt;code&gt;devvm-rc&lt;/code&gt; only moves forward: each publish, a release&amp;rsquo;s or a prerelease&amp;rsquo;s, points &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt; at the version it publishes, unless the tap&amp;rsquo;s &lt;code&gt;devvm-rc&lt;/code&gt; already names a newer one. So a release moves &lt;code&gt;devvm-rc&lt;/code&gt; users onto it once it&amp;rsquo;s newer than their prerelease, and a patch release of an older line, or a prerelease older than the tap&amp;rsquo;s, leaves &lt;code&gt;devvm-rc&lt;/code&gt; where it is. The co-signer and &lt;code&gt;--local&lt;/code&gt; follow the same rule. &lt;code&gt;--local&lt;/code&gt;&amp;rsquo;s printout says which way it goes, and when nothing in the tap changes, as for such a prerelease, it has no tap step and prints the install script line and devvm upgrade &lt;code&gt;--to&lt;/code&gt; for checking it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The changelog&amp;rsquo;s entry is sorted by who notices each change.&lt;/strong&gt; Each line goes where a reader asking &amp;ldquo;does this affect me?&amp;rdquo; looks for it, so the question for a line is who notices it: everyone upgrading, the users of one feature, only a hostile VM, or nobody in practice. The entry starts with a paragraph that says which release it is and how to install it, then a line that links the release page, then its groups in this order, each one only when it has something:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Highlights:&lt;/strong&gt; three to five concrete lines on what the release means for you, such as what now works or which reported bugs are fixed. A highlight never refers to the notes themselves, such as by pointing at What to do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What to do:&lt;/strong&gt; numbered steps, each an action that someone upgrading takes, such as running &lt;code&gt;devvm update&lt;/code&gt; or restarting each running VM, with why when it isn&amp;rsquo;t plain. A breaking change goes here when it asks something of you.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fixed:&lt;/strong&gt; the bugs that users reported, with their issues, and the ones a typical user plausibly hit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;If you use…:&lt;/strong&gt; a collapsed block for each feature, such as &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;If you use a Linux host&amp;lt;/summary&amp;gt;&lt;/code&gt;, holding the changes that only that feature&amp;rsquo;s users notice.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security hardening:&lt;/strong&gt; a collapsed block whose summary starts &lt;code&gt;Security hardening:&lt;/code&gt; and says what the hardening means for you, such as &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;Security hardening: a VM that tries to attack your machine can now do much less&amp;lt;/summary&amp;gt;&lt;/code&gt;, with one line for each change that matters only when a VM is hostile.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internal changes:&lt;/strong&gt; a collapsed block, &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;Internal changes&amp;lt;/summary&amp;gt;&lt;/code&gt;, for rare conditions, limits nobody meets, pins, logs, status lines and the rest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A collapsed block renders its list on GitHub&lt;/strong&gt; only with a blank line after its &lt;code&gt;&amp;lt;details&amp;gt;&amp;lt;summary&amp;gt;…&amp;lt;/summary&amp;gt;&lt;/code&gt; line and another before its &lt;code&gt;&amp;lt;/details&amp;gt;&lt;/code&gt;. markdownlint allows &lt;code&gt;details&lt;/code&gt; and &lt;code&gt;summary&lt;/code&gt; and no other inline HTML.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each line is one outcome sentence, then its links.&lt;/strong&gt; The sentence says what changes for you and what to do, if anything, in at most 35 words, not counting its links or a credit, and how devvm does it goes on the release page. A step in What to do may run longer, but it says only what to do and why. A line that covers several changes keeps every link of each.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The links come in this form and order:&lt;/strong&gt; the user page to act on, for a step in What to do or a breaking change, then the change&amp;rsquo;s section on the release page, then its issue, then its commit, as in &lt;code&gt;([details](https://next.devvm.dev/docs/releases/0.2.0/#claude-codes-setup-token-login), [#57](https://github.com/devvmhq/devvm/issues/57), [6965efc](https://github.com/devvmhq/devvm/commit/6965efcc0a97f7f6334f00d0530007ecf459972c))&lt;/code&gt;. The issue is a full link, such as &lt;code&gt;[#57](https://github.com/devvmhq/devvm/issues/57)&lt;/code&gt;, or &lt;code&gt;/pull/N&lt;/code&gt; in place of &lt;code&gt;/issues/N&lt;/code&gt; for a pull request, because a bare &lt;code&gt;#57&lt;/code&gt; links only in GitHub&amp;rsquo;s view of the release&amp;rsquo;s notes, and not in &lt;code&gt;CHANGELOG.md&lt;/code&gt; or anywhere else the entry is read. &lt;code&gt;gh api repos/devvmhq/devvm/issues/N --jq .pull_request&lt;/code&gt; tells them apart: it prints nothing for an issue. Every reference to an issue or a pull request in the changelog is written this way, a credit&amp;rsquo;s included, and the release page writes them the same way. The commit is the one that made the change, or the main one of several, linked by its full SHA and shown by its first seven characters. Find each one with &lt;code&gt;git log v&amp;lt;last release&amp;gt;..main&lt;/code&gt; and its messages, and &lt;code&gt;git log -G&lt;/code&gt; on &lt;code&gt;CHANGELOG.md&lt;/code&gt; names the commit that added a line. Credits, such as thanks for a report, stay in the line&amp;rsquo;s text, after its sentence and before its links.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The links point at next.devvm.dev&lt;/strong&gt; in a release candidate&amp;rsquo;s entry, because devvm.dev shows the latest release&amp;rsquo;s docs, which don&amp;rsquo;t have its release page yet, and at devvm.dev in a release&amp;rsquo;s entry. Each anchor is the heading&amp;rsquo;s ID as Hugo makes it, such as &lt;code&gt;#a-no_proxy-entrys-port&lt;/code&gt; for A &lt;code&gt;NO_PROXY&lt;/code&gt; entry&amp;rsquo;s port, so check a new one against the built page. lychee checks the docs&amp;rsquo; links offline, so it doesn&amp;rsquo;t check these.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestChangelogShape&lt;/code&gt; keeps the shape,&lt;/strong&gt; in &lt;code&gt;internal/cli/docgen/changelog_test.go&lt;/code&gt;, which &lt;code&gt;mise run lint:docs&lt;/code&gt; and &lt;code&gt;mise run test&lt;/code&gt; run. For each entry from 0.2.0-rc.1 on, and for Unreleased once it has a line, it checks the groups and their order, three to five Highlights in a release&amp;rsquo;s entry, each collapsed group&amp;rsquo;s &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; and blank lines, each line&amp;rsquo;s 35 words outside What to do, its &lt;code&gt;details&lt;/code&gt; link to a &lt;code&gt;releases/&lt;/code&gt; page, and a full link for every issue and pull request. The entries before 0.2.0-rc.1 are history, and the test leaves them as they are.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The release page holds each change&amp;rsquo;s full story,&lt;/strong&gt; and it is &lt;code&gt;docs/content/docs/releases/&amp;lt;major&amp;gt;.&amp;lt;minor&amp;gt;.0.md&lt;/code&gt;, such as &lt;code&gt;releases/0.2.0.md&lt;/code&gt;, which covers the release and its release candidates. Each release candidate adds its changes there, in the same commit as its changelog entry, so the page is written as the release is made. Each change gets a section of its own with its full story, under Breaking changes, Changes, Fixes and Hardening, as &lt;a href="https://next.devvm.dev/docs/contributing/docs/#writing-docs"&gt;Writing docs&lt;/a&gt; describes, and the Releases section&amp;rsquo;s own page lists the page. Every fact a changelog line leaves out is in its section, so a line can stay one sentence. A change that two lines describe, such as a step in What to do and a line in Fixed, can share one section, which both link, and a line that covers several changes links each one&amp;rsquo;s section.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A prerelease&amp;rsquo;s changelog entry&lt;/strong&gt; lists what changed since the version before it, whether that&amp;rsquo;s a release or another prerelease, and it becomes that prerelease&amp;rsquo;s notes on GitHub. When the release itself goes out, its entry, such as &lt;code&gt;## 0.2.0&lt;/code&gt;, replaces its prereleases&amp;rsquo; entries and lists everything since the last release, so someone who upgrades from that release reads one entry. Each prerelease&amp;rsquo;s notes stay on its GitHub release.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;scripts/publish.sh&lt;/code&gt;&lt;/strong&gt;, with no flag, checks and stops with nothing done when a check fails. The working tree has to be clean. The tag &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt; has to pass &lt;code&gt;scripts/release.sh --check-tag&lt;/code&gt;, which runs &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s checks of the tag and the release keys and needs no container runtime, so the tag exists, is signed, and is signed by a key in &lt;code&gt;packaging/release-signer&lt;/code&gt;. Its commit has to hold the release keys in &lt;code&gt;packaging/keys&lt;/code&gt;, because CI&amp;rsquo;s workflow refuses one without, and without them it stops, pointing at &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#1-the-release-keys"&gt;step 1 of Setting up GitHub for releases&lt;/a&gt; and at &lt;code&gt;--local&lt;/code&gt;. &lt;code&gt;CHANGELOG.md&lt;/code&gt; has to have an entry for the version, which the co-signer makes the release&amp;rsquo;s notes from. The tag&amp;rsquo;s commit has to be &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s HEAD, &lt;code&gt;origin&lt;/code&gt;&amp;rsquo;s &lt;code&gt;main&lt;/code&gt; has to be an ancestor of it, and if &lt;code&gt;origin&lt;/code&gt; already has the tag, it has to be the same tag. Then it prints the version, the tag&amp;rsquo;s commit and its two steps, each marked done or to do, and asks &lt;code&gt;Push main and v&amp;lt;version&amp;gt; to origin? [y/N]&lt;/code&gt; on the terminal. It pushes &lt;code&gt;main&lt;/code&gt;, then the tag, and prints what comes next. &lt;code&gt;--dry-run&lt;/code&gt; stops before the question. It needs git alone, and it builds and publishes nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;&lt;/strong&gt; adds the old release key&amp;rsquo;s signature to the co-signer&amp;rsquo;s draft, while releases bridge from that key. It needs &lt;code&gt;gh&lt;/code&gt;, logged in, and minisign. It reads &lt;code&gt;VERSION&lt;/code&gt;&amp;rsquo;s GitHub release, which has to be a draft holding &lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt; and &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt;, and says so and stops when there&amp;rsquo;s no draft yet, when the co-signer&amp;rsquo;s signature isn&amp;rsquo;t on it yet, when it&amp;rsquo;s published, or when it holds &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; already. It downloads those three files, and &lt;code&gt;scripts/release.sh --sign-legacy DIR&lt;/code&gt; checks both signatures with this checkout&amp;rsquo;s &lt;code&gt;packaging/keys&lt;/code&gt;, refusing when it has no release keys, and the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, so the old key signs only what both builders built and signed. Then it signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with the old key, &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt; or &lt;code&gt;~/.minisign/devvm.key&lt;/code&gt;, as &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; with the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, which minisign asks the password for, and checks it with &lt;code&gt;packaging/minisign.pub&lt;/code&gt;. It prints &lt;code&gt;SHA256SUMS&lt;/code&gt;, asks &lt;code&gt;Upload SHA256SUMS.minisig to devvm &amp;lt;version&amp;gt;'s draft release? [y/N]&lt;/code&gt;, and uploads it with &lt;code&gt;gh release upload&lt;/code&gt;. &lt;code&gt;--dry-run&lt;/code&gt; signs it but uploads nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="publishing-from-this-machine"&gt;Publishing from this machine&lt;span class="hx:absolute hx:-mt-20" id="publishing-from-this-machine"&gt;&lt;/span&gt;
&lt;a href="#publishing-from-this-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;scripts/publish.sh --local&lt;/code&gt; builds, signs and publishes a release from this machine, as releases went out before CI and the co-signer. Its release carries the old key&amp;rsquo;s signature alone, which devvm accepts while the bridge lasts, and it needs no release keys in &lt;code&gt;packaging/keys&lt;/code&gt;, so it&amp;rsquo;s the way releases go out until they&amp;rsquo;re made. The tag it pushes still starts CI&amp;rsquo;s Release workflow, which stops at its first step while there are no keys, so that failed run is expected: reject it when it waits for your approval, or leave it. Use it until GitHub is set up and the first release through CI is published, and it goes when the bridge ends at the latest, because a release that only the old key signed is then one no devvm accepts. A release it publishes after the co-signer&amp;rsquo;s &lt;code&gt;init&lt;/code&gt; is one the co-signer alerts on, because the co-signer didn&amp;rsquo;t publish it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Before it builds,&lt;/strong&gt; &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; checks what it needs and stops with nothing done when a check fails. The tag &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt; has to pass &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s own checks, so it exists, is signed, and is signed by a key in &lt;code&gt;packaging/release-signer&lt;/code&gt;. The tag&amp;rsquo;s commit has to be &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s HEAD, and &lt;code&gt;origin&lt;/code&gt;&amp;rsquo;s &lt;code&gt;main&lt;/code&gt; has to be an ancestor of it, so that the push is a fast-forward. If &lt;code&gt;origin&lt;/code&gt; already has the tag, it has to be the same tag. The working tree has to be clean, &lt;code&gt;gh&lt;/code&gt; has to be installed and logged in (&lt;code&gt;gh auth status&lt;/code&gt;), and minisign, curl and podman or Docker have to be installed. A published GitHub release for the tag is refused unless it already has every file, which is the case when an earlier run stopped after it, and unless GitHub marks it as a prerelease exactly when the version is one. The refusal names the &lt;code&gt;gh release edit&lt;/code&gt; command that fixes the mark. The tap&amp;rsquo;s checkout, a clone of &lt;code&gt;devvmhq/homebrew-tap&lt;/code&gt;, has to exist, be clean and be on &lt;code&gt;main&lt;/code&gt;, for a prerelease too, and its &lt;code&gt;origin&lt;/code&gt; has to have no commits that its &lt;code&gt;main&lt;/code&gt; lacks. The checkout is &lt;code&gt;DEVVM_TAP_DIR&lt;/code&gt;, or &lt;code&gt;../homebrew-tap&lt;/code&gt; next to this repo by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Then it builds and shows the release.&lt;/strong&gt; It runs &lt;code&gt;scripts/release.sh&lt;/code&gt;, which builds &lt;code&gt;dist/&lt;/code&gt; and signs &lt;code&gt;SHA256SUMS&lt;/code&gt;, and where minisign asks for the password. It prints the version, the tag&amp;rsquo;s commit, each file with its size and SHA-256, the release notes, which are the &lt;code&gt;CHANGELOG.md&lt;/code&gt; entry for the version, and the tap&amp;rsquo;s changes as a &lt;code&gt;git diff&lt;/code&gt; of each formula it writes: &lt;code&gt;Formula/devvm.rb&lt;/code&gt; for a release, and &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, with a line saying when a release moves it too, or when it stays on a newer version. It lists the four steps, each marked done or to do, and when nothing in the tap changes, the fourth says so. Then it asks &lt;code&gt;Publish devvm &amp;lt;version&amp;gt;? [y/N]&lt;/code&gt; on the terminal, and any answer but y stops it with nothing published. &lt;code&gt;--dry-run&lt;/code&gt; stops before the question, so it pushes and publishes nothing and makes no commit in the tap, and &lt;code&gt;--help&lt;/code&gt; describes the script.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Then it publishes, in this order.&lt;/strong&gt; It pushes &lt;code&gt;main&lt;/code&gt; and then the tag to &lt;code&gt;origin&lt;/code&gt;. It makes the GitHub release &lt;code&gt;devvmhq/devvm&lt;/code&gt; &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt; with &lt;code&gt;gh release create --verify-tag&lt;/code&gt;, titled &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, with the release notes and the archives, the source tarball, &lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; and &lt;code&gt;install.sh&lt;/code&gt;. The release starts as a draft and is published only once every file is uploaded, so nobody sees a release that is missing files. Last, it copies &lt;code&gt;dist/devvm.rb&lt;/code&gt; to the tap&amp;rsquo;s &lt;code&gt;Formula/devvm.rb&lt;/code&gt; and &lt;code&gt;dist/devvm-rc.rb&lt;/code&gt; to its &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, each only when it&amp;rsquo;s one the tap gets and it differs, commits them in one commit, &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt; for a release or &lt;code&gt;devvm-rc &amp;lt;version&amp;gt;&lt;/code&gt; for a prerelease, with the tap&amp;rsquo;s own commit signing, and pushes the tap. It uses &lt;code&gt;gh&lt;/code&gt; for GitHub and never puts a GitHub token on a command line. At the end it prints how to check the release: &lt;code&gt;brew update &amp;amp;&amp;amp; brew upgrade devvm&lt;/code&gt;, or &lt;code&gt;brew trust --formula devvmhq/tap/devvm&lt;/code&gt; and then &lt;code&gt;brew install devvmhq/tap/devvm&lt;/code&gt;, with &lt;code&gt;devvm-rc&lt;/code&gt; in place of &lt;code&gt;devvm&lt;/code&gt; for a prerelease, and the install script&amp;rsquo;s &lt;code&gt;curl&lt;/code&gt; line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When a step fails,&lt;/strong&gt; it says which steps it published and which it didn&amp;rsquo;t. Fix what failed and run &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; again, because every step skips what&amp;rsquo;s already done: a pushed &lt;code&gt;main&lt;/code&gt; or tag, a published release whose &lt;code&gt;SHA256SUMS&lt;/code&gt; matches the new build&amp;rsquo;s, and a tap whose formulas are already this build&amp;rsquo;s. A draft release that an earlier run left gets this build&amp;rsquo;s files again before it&amp;rsquo;s published. A release published from another build, whose &lt;code&gt;SHA256SUMS&lt;/code&gt; doesn&amp;rsquo;t match, is refused. To finish by hand instead, run the steps it didn&amp;rsquo;t do in order: &lt;code&gt;git push origin main&lt;/code&gt;, &lt;code&gt;git push origin v&amp;lt;version&amp;gt;&lt;/code&gt;, the &lt;code&gt;gh release create&lt;/code&gt; above (or &lt;code&gt;gh release upload --clobber&lt;/code&gt; to a draft, then &lt;code&gt;gh release edit v&amp;lt;version&amp;gt; --draft=false&lt;/code&gt;), each with &lt;code&gt;--prerelease&lt;/code&gt; for a prerelease, and then copy the formulas the printout listed, &lt;code&gt;dist/devvm.rb&lt;/code&gt; and &lt;code&gt;dist/devvm-rc.rb&lt;/code&gt;, to the tap&amp;rsquo;s &lt;code&gt;Formula/&lt;/code&gt;, commit them and push it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="the-release-script"&gt;The release script&lt;span class="hx:absolute hx:-mt-20" id="the-release-script"&gt;&lt;/span&gt;
&lt;a href="#the-release-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh&lt;/code&gt; checks the tag with &lt;code&gt;git tag -v&lt;/code&gt; and its signer against this checkout&amp;rsquo;s &lt;code&gt;packaging/release-signer&lt;/code&gt;, then builds &lt;code&gt;dist/&lt;/code&gt; from the tagged commit with GoReleaser (&lt;code&gt;.goreleaser.yaml&lt;/code&gt;), in a repository of its own that holds only the commit and the tag, so only what&amp;rsquo;s committed goes in, with one &lt;code&gt;goreleaser release --skip=publish&lt;/code&gt;. The build runs in the release&amp;rsquo;s container, as &lt;a href="#reproducible-releases"&gt;Reproducible releases&lt;/a&gt; describes. In the container, it checks that the Linux binary for the container&amp;rsquo;s processor prints the version, writes &lt;code&gt;install.sh&lt;/code&gt; and adds its checksum to &lt;code&gt;SHA256SUMS&lt;/code&gt;. Then, outside the container, it signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with &lt;code&gt;~/.minisign/devvm.key&lt;/code&gt; (or &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt;) and verifies it with &lt;code&gt;packaging/minisign.pub&lt;/code&gt;. Nothing is published, because publishing is &lt;code&gt;scripts/publish.sh --local&lt;/code&gt;&amp;rsquo;s, or the co-signer&amp;rsquo;s for CI&amp;rsquo;s build. Before it builds anything, it checks the release keys in the tag&amp;rsquo;s commit, and so do &lt;code&gt;--check&lt;/code&gt; and &lt;code&gt;--tag&lt;/code&gt;, though a snapshot, such as &lt;code&gt;--head&lt;/code&gt;&amp;rsquo;s, skips the check (&lt;a href="#release-keys"&gt;Release keys&lt;/a&gt;). &lt;code&gt;packaging/keys&lt;/code&gt; must hold none of the three or all of them, because a devvm with one or two refuses every upgrade. When it holds none, the commit&amp;rsquo;s &lt;code&gt;install.sh&lt;/code&gt; must have no key in its &lt;code&gt;release_&amp;lt;role&amp;gt;_key&lt;/code&gt; lines. When it holds all three, each must be a minisign public key, a different one, not the old release key, not marked &lt;code&gt;PLACEHOLDER&lt;/code&gt; in its comment, and the same as the commit&amp;rsquo;s &lt;code&gt;install.sh&lt;/code&gt; has in its &lt;code&gt;release_&amp;lt;role&amp;gt;_key&lt;/code&gt; line. &lt;code&gt;scripts/release.sh --check&lt;/code&gt; runs only the tag&amp;rsquo;s checks and the build&amp;rsquo;s preconditions, prints the tag&amp;rsquo;s commit and builds nothing, and &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; runs it first. &lt;code&gt;scripts/release.sh --check-tag&lt;/code&gt; runs the tag&amp;rsquo;s and the keys&amp;rsquo; checks alone, needing no container runtime or signing key, and &lt;code&gt;scripts/publish.sh&lt;/code&gt; runs it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;dist/&lt;/code&gt; then holds:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm-&amp;lt;version&amp;gt;-&amp;lt;os&amp;gt;-&amp;lt;arch&amp;gt;.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the binary, its files (&lt;code&gt;assets/&lt;/code&gt;) embedded, with &lt;code&gt;README.md&lt;/code&gt;, &lt;code&gt;CHANGELOG.md&lt;/code&gt; and &lt;code&gt;LICENSE&lt;/code&gt;, for &lt;code&gt;darwin&lt;/code&gt; and &lt;code&gt;linux&lt;/code&gt;, &lt;code&gt;arm64&lt;/code&gt; and &lt;code&gt;amd64&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm-&amp;lt;version&amp;gt;.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the source, attached to the release for whoever wants to build devvm themselves&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;their checksums and &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s, and the signature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;install.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the install script, set to this release and to &lt;code&gt;packaging/minisign.pub&lt;/code&gt;&amp;rsquo;s key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm-rc.rb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the Homebrew formula &lt;code&gt;devvm-rc&lt;/code&gt;, which follows prereleases, set to each platform&amp;rsquo;s archive, its URL and its checksum from &lt;code&gt;SHA256SUMS&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;devvm.rb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for a release, not a prerelease, the Homebrew formula &lt;code&gt;devvm&lt;/code&gt;, set the same way&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --head&lt;/code&gt; builds from HEAD&amp;rsquo;s commit instead, for testing, with the version in that commit&amp;rsquo;s &lt;code&gt;VERSION&lt;/code&gt;, a release&amp;rsquo;s or a prerelease&amp;rsquo;s, and &lt;code&gt;scripts/release.sh --commit COMMIT&lt;/code&gt; does the same for any other commit. It&amp;rsquo;s unsigned unless &lt;code&gt;DEVVM_MINISIGN_KEY&lt;/code&gt; names a test key; &lt;code&gt;DEVVM_MINISIGN_PUB&lt;/code&gt; names its public key in place of &lt;code&gt;packaging/minisign.pub&lt;/code&gt;. A build signed with a test key never replaces a &lt;code&gt;dist/&lt;/code&gt; whose &lt;code&gt;SHA256SUMS&lt;/code&gt; verifies with this checkout&amp;rsquo;s &lt;code&gt;packaging/minisign.pub&lt;/code&gt;, the release key, and stops before it builds anything, so move the release&amp;rsquo;s &lt;code&gt;dist/&lt;/code&gt; first, or set &lt;code&gt;DEVVM_RELEASE_DIST&lt;/code&gt;. &lt;code&gt;DEVVM_RELEASE_URL&lt;/code&gt; points the formula at a test location. A commit without &lt;code&gt;install.sh&lt;/code&gt; is refused.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --tag TAG&lt;/code&gt; builds the tag &lt;code&gt;TAG&lt;/code&gt; as its release is built, with the same checks of the tag and its signer and the tag&amp;rsquo;s version, but doesn&amp;rsquo;t sign it, so another builder can build a release and compare its &lt;code&gt;SHA256SUMS&lt;/code&gt; with the published one. An unsigned build, such as this one, never replaces a &lt;code&gt;dist/&lt;/code&gt; that holds &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, and stops before it builds anything, so move the signed build&amp;rsquo;s &lt;code&gt;dist/&lt;/code&gt; first, or set &lt;code&gt;DEVVM_RELEASE_DIST&lt;/code&gt; to a folder that doesn&amp;rsquo;t exist yet for the unsigned one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --formula-from DIR&lt;/code&gt; writes only the formulas, for &lt;code&gt;VERSION&lt;/code&gt;&amp;rsquo;s release once it&amp;rsquo;s published, and builds nothing: &lt;code&gt;dist/devvm-rc.rb&lt;/code&gt;, and &lt;code&gt;dist/devvm.rb&lt;/code&gt; too when &lt;code&gt;VERSION&lt;/code&gt; isn&amp;rsquo;t a prerelease. Download the release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; and &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; into &lt;code&gt;DIR&lt;/code&gt; first. The script checks the signature against &lt;code&gt;packaging/minisign.pub&lt;/code&gt;, and that its trusted comment is &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt; for &lt;code&gt;VERSION&lt;/code&gt;&amp;rsquo;s version, so it refuses another release&amp;rsquo;s files. Then it fills in the formulas the same way a build does, from that &lt;code&gt;SHA256SUMS&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;scripts/release.sh --ci TAG DIR&lt;/code&gt; and &lt;code&gt;--ci-sign TAG DIR&lt;/code&gt; are CI&amp;rsquo;s release workflow&amp;rsquo;s build and signature, as &lt;a href="#cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;/a&gt; describes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To try &lt;code&gt;dist/install.sh&lt;/code&gt; on such a build, copy &lt;code&gt;dist/&lt;/code&gt; to &lt;code&gt;DIR/releases/download/v&amp;lt;version&amp;gt;/&lt;/code&gt;, then in a throwaway &lt;code&gt;HOME&lt;/code&gt; with &lt;code&gt;DEVVM_PREFIX&lt;/code&gt; under it: &lt;code&gt;DEVVM_INSTALL_TEST=1 source dist/install.sh&lt;/code&gt;, set &lt;code&gt;repo_url=file://DIR&lt;/code&gt; and &lt;code&gt;protos='=https,file'&lt;/code&gt; (it downloads over HTTPS only), and run &lt;code&gt;main --no-deps&lt;/code&gt;. Without &lt;code&gt;--no-deps&lt;/code&gt; it offers to install what the host lacks: answer no, or run it with no terminal.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Every build sets the version with &lt;code&gt;-X github.com/devvmhq/devvm/internal/cli.version=&amp;lt;version&amp;gt;&lt;/code&gt;: devvm doesn&amp;rsquo;t read &lt;code&gt;VERSION&lt;/code&gt;. The formula template (&lt;code&gt;packaging/homebrew/devvm.rb&lt;/code&gt;) is both formulas&amp;rsquo; one source, and it builds nothing. It has an archive for each of macOS and Linux on arm64 and Intel, the same archives the install script installs, and it installs the binary alone from the one for this machine. &lt;code&gt;release.sh&lt;/code&gt; fills in each formula&amp;rsquo;s class, &lt;code&gt;Devvm&lt;/code&gt; or &lt;code&gt;DevvmRc&lt;/code&gt;, and the other formula, which it conflicts with by its full name, &lt;code&gt;devvmhq/tap/devvm-rc&lt;/code&gt; or &lt;code&gt;devvmhq/tap/devvm&lt;/code&gt;, because both install the &lt;code&gt;devvm&lt;/code&gt; command. It also fills in each archive&amp;rsquo;s URL and its checksum, which it reads from the &lt;code&gt;SHA256SUMS&lt;/code&gt; it just wrote, on every line that isn&amp;rsquo;t a comment. Both generated formulas pass &lt;code&gt;brew audit --strict --online&lt;/code&gt; and &lt;code&gt;brew style&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Publishing is the maintainer&amp;rsquo;s call, so an agent asks first and never runs &lt;code&gt;scripts/publish.sh&lt;/code&gt;, in any mode, without &lt;code&gt;--dry-run&lt;/code&gt; on its own. The script&amp;rsquo;s tests run it against a local bare repo as &lt;code&gt;origin&lt;/code&gt; and a fake &lt;code&gt;gh&lt;/code&gt;: &lt;code&gt;testdata/script/publish_tag.txtar&lt;/code&gt; the default and &lt;code&gt;--sign-legacy&lt;/code&gt;, and &lt;code&gt;testdata/script/publish.txtar&lt;/code&gt; &lt;code&gt;--local&lt;/code&gt;, with a local bare tap. &lt;code&gt;testdata/script/release_ci.txtar&lt;/code&gt; runs CI&amp;rsquo;s &lt;code&gt;--ci&lt;/code&gt; and &lt;code&gt;--ci-sign&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="release-keys"&gt;Release keys&lt;span class="hx:absolute hx:-mt-20" id="release-keys"&gt;&lt;/span&gt;
&lt;a href="#release-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;devvm upgrade and the install script accept a release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; when any two of three release keys signed it, so one stolen key signs nothing and one lost key stops nothing. &lt;code&gt;internal/minisign&lt;/code&gt; makes the check, and the structure test keeps every other package from checking a signature itself (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;). Each key has a role, and each role signs into a file of its own beside &lt;code&gt;SHA256SUMS&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Who holds the key&lt;/th&gt;
&lt;th&gt;Its signature&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ci&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;GitHub&amp;rsquo;s CI, which builds the release&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cosign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the co-signer, a machine of the maintainer&amp;rsquo;s that builds the same bytes again&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;recovery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the maintainer, offline, to sign in place of a lost key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHA256SUMS.recovery.minisig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The names&lt;/strong&gt; keep &lt;code&gt;.minisig&lt;/code&gt; last, as minisign&amp;rsquo;s own &lt;code&gt;-x&lt;/code&gt; default does, so tools and readers take each file for a minisign signature, and &lt;code&gt;SHA256SUMS.*.minisig&lt;/code&gt; lists the three. The role, rather than the key&amp;rsquo;s ID, names the file, so the names stay the same when a key is replaced, and none of them is &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, the old release key&amp;rsquo;s, which devvm 0.1 and 0.2 read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The trusted comment&lt;/strong&gt; is &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, such as &lt;code&gt;devvm-release 0.3.0&lt;/code&gt;. minisign&amp;rsquo;s global signature covers it, and devvm compares it with the version it asked for exactly, so a &lt;code&gt;SHA256SUMS&lt;/code&gt; signed for one release can&amp;rsquo;t stand in for another&amp;rsquo;s, and a manifest of another kind can&amp;rsquo;t stand in for a release&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each check counts signers, not files.&lt;/strong&gt; Each file is checked only against its own role&amp;rsquo;s key, and &lt;code&gt;minisign.NewKeys&lt;/code&gt; refuses two roles with the same key or the same key ID, so two signatures are always two signers&amp;rsquo;. &lt;code&gt;TestReleaseKeys&lt;/code&gt; checks that the keys in &lt;code&gt;packaging/keys&lt;/code&gt;, once they&amp;rsquo;re made, are three such keys, and that none of them is the old release key, so the old key&amp;rsquo;s signature and one release key&amp;rsquo;s are never two of three.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each kind has keys of its own.&lt;/strong&gt; A kind is what a manifest describes, so &lt;code&gt;devvm-base&lt;/code&gt; has its own three keys, its own trusted comment and its own key files, &lt;code&gt;packaging/keys/base-&amp;lt;role&amp;gt;.pub&lt;/code&gt;, though devvm doesn&amp;rsquo;t read a published base yet. A key of one kind can&amp;rsquo;t sign another kind&amp;rsquo;s manifest.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The co-signer, &lt;code&gt;devvm-cosign&lt;/code&gt;, holds the &lt;code&gt;cosign&lt;/code&gt; keys. CI&amp;rsquo;s token can only read the repo, so CI hands its build and its signature over as a workflow artifact, and the co-signer signs it only when its own rebuild matches. Then the co-signer makes the release, publishes it once two of the three keys signed it, and updates the tap. Nothing else can make or publish a release but the maintainer, and the co-signer raises an alert for any release published without it since its state began, whatever its tag, as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/"&gt;The co-signer&lt;/a&gt; describes, with its setup.&lt;/p&gt;
&lt;p&gt;The public halves are in &lt;code&gt;packaging/keys&lt;/code&gt;, as &lt;code&gt;release-ci.pub&lt;/code&gt;, &lt;code&gt;release-cosign.pub&lt;/code&gt; and &lt;code&gt;release-recovery.pub&lt;/code&gt;, which &lt;code&gt;packaging.Key&lt;/code&gt; embeds in devvm, and in &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;release_ci_key&lt;/code&gt;, &lt;code&gt;release_cosign_key&lt;/code&gt; and &lt;code&gt;release_recovery_key&lt;/code&gt; lines, which &lt;code&gt;TestInstallScriptKeys&lt;/code&gt; keeps the same as the files. To make a key, run &lt;code&gt;minisign -G -p packaging/keys/release-&amp;lt;role&amp;gt;.pub -s &amp;lt;its secret key's file&amp;gt;&lt;/code&gt; where its holder keeps it, then commit the &lt;code&gt;.pub&lt;/code&gt; file and copy its key into &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s line. The co-signer&amp;rsquo;s key has no password, as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#making-its-keys"&gt;Making its keys&lt;/a&gt; says, because it signs unattended. A secret key never goes in the repo.&lt;/p&gt;
&lt;p&gt;Until the maintainer makes the keys, &lt;code&gt;packaging/keys&lt;/code&gt; has none of them and &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s three lines are empty. A devvm built then has no release keys, so devvm upgrade and its install script check each release with the old release key alone, through &lt;a href="#the-bridge-from-the-old-release-key"&gt;the bridge&lt;/a&gt;, and a release signed by the release keys but not by the old key is refused. &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; builds and signs each release with the old key, as &lt;a href="#publishing-from-this-machine"&gt;Publishing from this machine&lt;/a&gt; describes. CI&amp;rsquo;s Release workflow, &lt;code&gt;scripts/publish.sh&lt;/code&gt; without &lt;code&gt;--local&lt;/code&gt;, &lt;code&gt;--sign-legacy&lt;/code&gt; and the co-signer all need the keys and refuse to run without them, pointing at &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#1-the-release-keys"&gt;step 1 of Setting up GitHub for releases&lt;/a&gt;, which makes them. The keys go in together, all three in &lt;code&gt;packaging/keys&lt;/code&gt; and in &lt;code&gt;install.sh&lt;/code&gt; in one commit, because &lt;code&gt;release.sh&lt;/code&gt; refuses to build a release from a commit with one or two of them, as a devvm with only some of them would refuse every upgrade.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;release.sh&lt;/code&gt; checks the keys of each tag it builds: none, with &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s lines empty or missing, or all three, each a minisign key of its own, none of them the old release key, and each the same as its line in &lt;code&gt;install.sh&lt;/code&gt;. It also refuses a key whose comment holds &lt;code&gt;PLACEHOLDER&lt;/code&gt;, such as a stand-in made for a test, because a devvm built with a key nobody holds could never check a release. The Go tests check the same on the committed keys: &lt;code&gt;TestReleaseKeys&lt;/code&gt; that they&amp;rsquo;re none or three distinct keys and never the old one, &lt;code&gt;TestInstallScriptKeys&lt;/code&gt; that &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s lines match them, and &lt;code&gt;TestReleaseRefusesPlaceholders&lt;/code&gt; that none is marked &lt;code&gt;PLACEHOLDER&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-bridge-from-the-old-release-key"&gt;The bridge from the old release key&lt;span class="hx:absolute hx:-mt-20" id="the-bridge-from-the-old-release-key"&gt;&lt;/span&gt;
&lt;a href="#the-bridge-from-the-old-release-key" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While releases bridge from the old release key, devvm upgrade and the install script also accept &lt;code&gt;SHA256SUMS&lt;/code&gt; when the old key alone signed it, in &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, with the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, as 0.1 and 0.2&amp;rsquo;s releases are. That&amp;rsquo;s what lets 0.1 and 0.2, which know only that key, upgrade to a release that the new keys sign, as long as each such release carries the old key&amp;rsquo;s signature too, and it&amp;rsquo;s what lets devvm upgrade &lt;code&gt;--to&lt;/code&gt; and the install script&amp;rsquo;s &lt;code&gt;--version&lt;/code&gt; install a 0.1 or 0.2 release. While the bridge lasts, the old key alone is still enough to sign a release, as it is today, so the release keys protect a release only once the bridge ends. The bridge is in one place in each:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;devvm upgrade:&lt;/strong&gt; &lt;code&gt;internal/upgrade/legacy.go&lt;/code&gt;, which &lt;code&gt;checkSums&lt;/code&gt; calls when two of the release keys&amp;rsquo; signatures don&amp;rsquo;t check out, with &lt;code&gt;Source.Key&lt;/code&gt;, &lt;code&gt;packaging.MinisignKey&lt;/code&gt; and &lt;code&gt;DEVVM_RELEASE_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The install script:&lt;/strong&gt; &lt;code&gt;minisign_key&lt;/code&gt;, &lt;code&gt;check_legacy&lt;/code&gt; and the lines of &lt;code&gt;download_signatures&lt;/code&gt; and &lt;code&gt;check_signature&lt;/code&gt; that name them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each release through CI and the co-signer carries the old key&amp;rsquo;s signature beside the two new ones, which you add to the co-signer&amp;rsquo;s draft with &lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;, and the co-signer waits for it before it publishes, because its config&amp;rsquo;s &lt;code&gt;legacy_key&lt;/code&gt; names the old key (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#what-a-run-does"&gt;What a run does&lt;/a&gt;). A release from &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; carries the old key&amp;rsquo;s signature alone, so devvm upgrade and the install script check it through the bridge.&lt;/p&gt;
&lt;p&gt;The bridge ends with a release, the last one the old key signs, after at least two releases have gone out through CI and the co-signer, so that path is proven, and once 0.1 and 0.2&amp;rsquo;s daily release check has had a few weeks to offer users a release that checks two of three. That release takes out the bridge: devvm upgrade&amp;rsquo;s &lt;code&gt;legacy.go&lt;/code&gt; fallback, the install script&amp;rsquo;s &lt;code&gt;check_legacy&lt;/code&gt;, and &lt;code&gt;minisign_key&lt;/code&gt; with its lines, so its devvm and install script accept only two of the three release keys. It still carries &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; itself, so 0.1 and 0.2 can upgrade to it. Its changelog entry has a What to do step for anyone still on 0.1 or 0.2: upgrade to it by name, with &lt;code&gt;devvm upgrade --to &amp;lt;version&amp;gt;&lt;/code&gt;, before any later release, or install a later release with the install script, because a 0.1 or 0.2 devvm refuses every release after it. After it, the co-signer&amp;rsquo;s config drops &lt;code&gt;legacy_key&lt;/code&gt;, so it publishes without waiting, and &lt;code&gt;scripts/publish.sh&lt;/code&gt; drops &lt;code&gt;--sign-legacy&lt;/code&gt; and &lt;code&gt;--local&lt;/code&gt;, and &lt;code&gt;scripts/release.sh&lt;/code&gt; its old-key signing (&lt;code&gt;--sign-legacy&lt;/code&gt;, and the signature its default build makes).&lt;/p&gt;
&lt;h3 data-hextra-search-id="cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;span class="hx:absolute hx:-mt-20" id="cis-release-workflow"&gt;&lt;/span&gt;
&lt;a href="#cis-release-workflow" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Release workflow, &lt;code&gt;.github/workflows/release.yml&lt;/code&gt;, is CI&amp;rsquo;s half of each release. It runs for each pushed tag that starts with &lt;code&gt;v&lt;/code&gt;, in the &lt;code&gt;release&lt;/code&gt; environment, which waits for the maintainer to approve the run and holds the two things the workflow trusts: the variable &lt;code&gt;RELEASE_TAG_SIGNERS&lt;/code&gt;, the SSH keys that sign release tags, and the secret &lt;code&gt;RELEASE_CI_KEY&lt;/code&gt;, CI&amp;rsquo;s release key (&lt;a href="https://next.devvm.dev/docs/contributing/github-setup/"&gt;Setting up GitHub for releases&lt;/a&gt;). Its job&amp;rsquo;s token can read the repo and nothing else, but for what the attestation needs, so the workflow can&amp;rsquo;t make or publish a release. It takes these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;It checks the tag&lt;/strong&gt; with &lt;code&gt;scripts/release.sh --ci TAG DIR&lt;/code&gt;, against the signers in &lt;code&gt;RELEASE_TAG_SIGNERS&lt;/code&gt;, written to an allowed signers file for git, and never against the tagged commit&amp;rsquo;s &lt;code&gt;packaging/release-signer&lt;/code&gt;, because CI runs the workflow and &lt;code&gt;release.sh&lt;/code&gt; from the tagged commit. The tag has to be an annotated tag of a release&amp;rsquo;s version, signed by one of those keys, whose tag object names the tag itself, so a tag pushed under another name is refused, and its commit has to be on &lt;code&gt;main&lt;/code&gt;. The commit has to hold the three release keys in &lt;code&gt;packaging/keys&lt;/code&gt;, because its devvm checks CI&amp;rsquo;s and the co-signer&amp;rsquo;s signatures with them, and the workflow&amp;rsquo;s first step, before it installs anything, stops a tag without them and points at &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#1-the-release-keys"&gt;step 1 of Setting up GitHub for releases&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It builds the release&lt;/strong&gt; as &lt;code&gt;scripts/release.sh --tag&lt;/code&gt; does, with the same signers as git&amp;rsquo;s allowed signers, under the runner&amp;rsquo;s podman, then copies &lt;code&gt;SHA256SUMS&lt;/code&gt; and exactly the files it lists, each checked against its SHA-256, into &lt;code&gt;DIR&lt;/code&gt;. The formulas aren&amp;rsquo;t among them, because the co-signer renders them itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It signs &lt;code&gt;SHA256SUMS&lt;/code&gt;&lt;/strong&gt; with &lt;code&gt;scripts/release.sh --ci-sign TAG DIR&lt;/code&gt;, which reads CI&amp;rsquo;s release key on its standard input, from the environment&amp;rsquo;s secret through a pipe, so the key is never in a file or an argument. The key has to be an unencrypted minisign secret key, the signature&amp;rsquo;s trusted comment is &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, and the signature has to check out with the tag&amp;rsquo;s &lt;code&gt;packaging/keys/release-ci.pub&lt;/code&gt;, which can&amp;rsquo;t be marked &lt;code&gt;PLACEHOLDER&lt;/code&gt;. The signature is &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It adds an attestation&lt;/strong&gt;, GitHub&amp;rsquo;s signed record of which workflow run built each file &lt;code&gt;SHA256SUMS&lt;/code&gt; lists, which &lt;code&gt;gh attestation verify FILE --repo devvmhq/devvm&lt;/code&gt; checks. devvm doesn&amp;rsquo;t check attestations, and they&amp;rsquo;re a public audit trail.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It hands the build over&lt;/strong&gt; as the artifact &lt;code&gt;release&lt;/code&gt;, which holds &lt;code&gt;SHA256SUMS&lt;/code&gt;, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt; and the files, side by side, kept for 90 days. The co-signer finds it through the workflow&amp;rsquo;s runs for the tag, as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#what-ci-hands-over"&gt;The co-signer&lt;/a&gt; describes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The workflow installs only minisign, with mise and no cache, and pins every action by its commit. The published base&amp;rsquo;s workflow isn&amp;rsquo;t there yet: it comes with the published base, as a workflow of its own, &lt;code&gt;base.yml&lt;/code&gt;, beside this one, with its own environment, key and artifact, &lt;code&gt;base&lt;/code&gt;, which the co-signer already reads.&lt;/p&gt;
&lt;h3 data-hextra-search-id="reproducible-releases"&gt;Reproducible releases&lt;span class="hx:absolute hx:-mt-20" id="reproducible-releases"&gt;&lt;/span&gt;
&lt;a href="#reproducible-releases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The same commit or tag, built on any machine, gives byte-identical release files: every archive, the source tarball, &lt;code&gt;install.sh&lt;/code&gt;, &lt;code&gt;SHA256SUMS&lt;/code&gt; and the formulas. To check it, build twice and compare:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/repro-check.sh &lt;span class="c1"&gt;# build HEAD twice and compare every file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/repro-check.sh &amp;lt;commit&amp;gt; &lt;span class="c1"&gt;# the same for another commit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/repro-check.sh v&amp;lt;version&amp;gt; &lt;span class="c1"&gt;# a tag, built as its release is, to compare with its published SHA256SUMS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;repro-check.sh&lt;/code&gt; runs both builds with this checkout&amp;rsquo;s &lt;code&gt;scripts/release.sh&lt;/code&gt;, which runs the commit&amp;rsquo;s own code only in the build&amp;rsquo;s container, never on your machine directly. That code still runs, though, and the container is only as isolated as your container runtime keeps it, so building a commit is running its code. A commit from outside the project, such as a pull request&amp;rsquo;s, is built only with the maintainer&amp;rsquo;s go-ahead for that run, as any outside code is. A commit builds as &lt;code&gt;release.sh --commit&lt;/code&gt; builds it, unsigned. A tag builds as &lt;code&gt;release.sh --tag&lt;/code&gt; builds it, with the tag&amp;rsquo;s checks and version and without the signature, so its &lt;code&gt;SHA256SUMS&lt;/code&gt; matches the published one. A commit or tag whose &lt;code&gt;release.sh&lt;/code&gt; pins no &lt;code&gt;release_image&lt;/code&gt;, from before reproducible builds, is refused. The second build differs from the first in what the fixes below keep out of the bytes, so that losing one of them shows as a difference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A stray tag.&lt;/strong&gt; Build 2 fetches the commit from a repository with a tag, &lt;code&gt;v0.0.0-stray&lt;/code&gt;, at the commit, which Go would stamp into the binary as its version if the build saw it. It&amp;rsquo;s a v0 version because Go ignores a tag whose major version the module&amp;rsquo;s path doesn&amp;rsquo;t name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another user.&lt;/strong&gt; When podman and Docker are both installed, build 1 runs under podman, as root, and build 2 under Docker, as you, and the archives would record each. With one of them, both builds run as the same user, and the script says so.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The archives&amp;rsquo; headers.&lt;/strong&gt; Every file in each platform&amp;rsquo;s archive has to be root&amp;rsquo;s, with mode 0755 or 0644, as &lt;code&gt;tar -tv&lt;/code&gt; lists it, whichever user either build ran as.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It prints each file&amp;rsquo;s SHA-256, says &lt;code&gt;DIFFERS&lt;/code&gt; beside any file whose two builds differ, and exits 1 when one does or when an archive&amp;rsquo;s headers aren&amp;rsquo;t those. Both builds run on this machine, in the same image and on its processor, so to compare two machines, run it on both and diff the printouts, which list the files in the same order on every machine. CI&amp;rsquo;s &lt;code&gt;repro&lt;/code&gt; job runs it under the runner&amp;rsquo;s podman and Docker, on every push and pull request that CI runs on, so the runner needs cgroups v2, with the &lt;code&gt;pids&lt;/code&gt; and &lt;code&gt;memory&lt;/code&gt; controllers delegated to its user for podman. It needs podman or Docker, git and curl, and no mise.&lt;/p&gt;
&lt;p&gt;What makes the bytes the same:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One container.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; runs GoReleaser, writes &lt;code&gt;install.sh&lt;/code&gt; and the formulas, and adds &lt;code&gt;install.sh&lt;/code&gt; to &lt;code&gt;SHA256SUMS&lt;/code&gt; inside one container image, with no network, &lt;code&gt;release_image&lt;/code&gt; at the top of &lt;code&gt;release.sh&lt;/code&gt;: Debian&amp;rsquo;s &lt;code&gt;buildpack-deps:trixie-scm&lt;/code&gt;, pinned by its index&amp;rsquo;s digest, which &lt;code&gt;scripts/bump.sh release-image&lt;/code&gt; moves. So git, which writes the source tarball, and awk, tar and gzip are the same on every builder. The image and the code that runs in the container, &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s build, are the built commit&amp;rsquo;s copies, so a tag builds the same bytes from any checkout, even one whose pin has moved since. It uses podman when it&amp;rsquo;s installed and Docker otherwise, and &lt;code&gt;DEVVM_RELEASE_RUNTIME&lt;/code&gt; names one. The container runs this machine&amp;rsquo;s processor, &lt;code&gt;linux/arm64&lt;/code&gt; or &lt;code&gt;linux/amd64&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go and GoReleaser from the commit&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; reads the URL and SHA-256 of the &lt;code&gt;linux-arm64&lt;/code&gt; or &lt;code&gt;linux-x64&lt;/code&gt; download of each from the built commit&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt;, so a tag builds with its own pins. It keeps each download in &lt;code&gt;${XDG_CACHE_HOME:-~/.cache}/devvm-release&lt;/code&gt;, named by its SHA-256, and checks every copy against &lt;code&gt;mise.lock&lt;/code&gt; before the build uses it. A copy that doesn&amp;rsquo;t match stops the build and is deleted from the cache, so the next run downloads it again. A Go toolchain cross-compiles to the same bytes on either processor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Go&amp;rsquo;s modules as &lt;code&gt;go.sum&lt;/code&gt; pins them.&lt;/strong&gt; The modules the commit&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; needs are downloaded before the build, with this checkout&amp;rsquo;s Go, and Go checks each against the commit&amp;rsquo;s &lt;code&gt;go.sum&lt;/code&gt;, so every builder builds from the same module files, whichever Go downloaded them. They come from Go&amp;rsquo;s module proxy, &lt;code&gt;proxy.golang.org&lt;/code&gt;, so rebuilding an old tag needs the proxy to still serve its modules, which it does for good unless a module is taken down, for legal reasons for example.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The same environment inside.&lt;/strong&gt; The build runs with umask 022, &lt;code&gt;TZ=UTC&lt;/code&gt;, &lt;code&gt;LC_ALL=C.UTF-8&lt;/code&gt;, &lt;code&gt;CGO_ENABLED=0&lt;/code&gt;, &lt;code&gt;GOTOOLCHAIN=local&lt;/code&gt;, &lt;code&gt;-mod=readonly&lt;/code&gt;, and no git configuration but &lt;code&gt;safe.directory&lt;/code&gt;. Go&amp;rsquo;s caches, &lt;code&gt;HOME&lt;/code&gt; and the tools go in a folder of the container&amp;rsquo;s own, because Docker Desktop&amp;rsquo;s shared folders lose files that Go&amp;rsquo;s parallel module downloads rename, and &lt;code&gt;-trimpath&lt;/code&gt; keeps their paths out of the binaries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only the tag built from.&lt;/strong&gt; The build&amp;rsquo;s repository holds the commit and, for a tag, &lt;code&gt;v&amp;lt;version&amp;gt;&lt;/code&gt;, and no other tags, because Go stamps the binary with a version from the tags it finds, and every machine holds different ones.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fixed archive headers.&lt;/strong&gt; &lt;code&gt;.goreleaser.yaml&lt;/code&gt; sets each archive file&amp;rsquo;s owner and group to &lt;code&gt;root&lt;/code&gt;, its mode (0755 for the binary, 0644 for the rest) and its time to the commit&amp;rsquo;s (&lt;code&gt;builds_info&lt;/code&gt; and each file&amp;rsquo;s &lt;code&gt;info&lt;/code&gt;), in place of GoReleaser&amp;rsquo;s defaults, which copy them from the files on disk, and &lt;code&gt;mod_timestamp&lt;/code&gt; sets the binary&amp;rsquo;s own time to the commit&amp;rsquo;s. Without them, a build under Docker on a Mac records your user and group, and a build under podman records root, so the archives differ.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The signature, &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;, is made outside the container, after the build, so it never changes the bytes of the other files.&lt;/p&gt;
&lt;p&gt;What runs on your machine, outside the containers, is this checkout&amp;rsquo;s &lt;code&gt;release.sh&lt;/code&gt;: the tag&amp;rsquo;s checks, the downloads, the checks on what the build wrote, and the signature. It limits what the commit&amp;rsquo;s code, in the build&amp;rsquo;s container, can reach and leave behind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Downloads only from their publishers.&lt;/strong&gt; Each &lt;code&gt;mise.lock&lt;/code&gt; URL has to start with &lt;code&gt;https://dl.google.com/go/&lt;/code&gt; for Go, or &lt;code&gt;https://github.com/goreleaser/goreleaser/releases/download/&lt;/code&gt; for GoReleaser, and it goes to curl as &lt;code&gt;--url&lt;/code&gt;&amp;rsquo;s value, so a lock can&amp;rsquo;t pass curl an option. It can&amp;rsquo;t hold &lt;code&gt;..&lt;/code&gt;, or a &lt;code&gt;%&lt;/code&gt;, which curl would decode, so that &lt;code&gt;%2e%2e&lt;/code&gt; would be &lt;code&gt;..&lt;/code&gt;. curl follows redirects over HTTPS only, and gives up after 30 seconds connecting, after 15 minutes, or past 1 GiB. A lock with two entries for a tool, or two downloads of one for this platform, is refused. The tests&amp;rsquo; lock files use &lt;code&gt;file://&lt;/code&gt; URLs, which &lt;code&gt;release.sh&lt;/code&gt; allows only from the folder that &lt;code&gt;DEVVM_RELEASE_TEST_FILE_URLS&lt;/code&gt; names, and only when that folder exists and isn&amp;rsquo;t &lt;code&gt;/&lt;/code&gt;, so the variable set by mistake reads no other file of yours, and each download is still checked against &lt;code&gt;mise.lock&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repository of the build&amp;rsquo;s own.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; fetches the commit and the tag into a new repository, which has no hooks, none of this checkout&amp;rsquo;s other branches, tags or objects, and no files it shares with this one, as a local clone&amp;rsquo;s hardlinks would be. Its &lt;code&gt;origin&lt;/code&gt; is devvm&amp;rsquo;s repository on GitHub, which GoReleaser reads and nothing fetches from.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No network for the build.&lt;/strong&gt; The Go modules are downloaded first, in a container of their own, which is the only one with the network. Everything it runs is this checkout&amp;rsquo;s, never the commit&amp;rsquo;s: its &lt;code&gt;release_image&lt;/code&gt;, its &lt;code&gt;release.sh&lt;/code&gt;, and the Go that its &lt;code&gt;mise.lock&lt;/code&gt; pins, so the commit can&amp;rsquo;t choose an old Go with a known flaw for the one container with the network. It gets only the commit&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; and &lt;code&gt;go.sum&lt;/code&gt;, read-only, and a commit whose &lt;code&gt;go.mod&lt;/code&gt; needs a newer Go than this checkout&amp;rsquo;s is refused before anything runs, so build it from a checkout at least as new. Go downloads the modules from its module proxy alone, &lt;code&gt;proxy.golang.org&lt;/code&gt;, and checks each against &lt;code&gt;go.sum&lt;/code&gt;, or against Go&amp;rsquo;s checksum database for one that &lt;code&gt;go.sum&lt;/code&gt; lacks, and downloading runs none of the modules&amp;rsquo; code. So every module path that the commit&amp;rsquo;s &lt;code&gt;go.mod&lt;/code&gt; names is looked up on Google&amp;rsquo;s proxy and checksum database, even a private one, which fails there. The build&amp;rsquo;s container then runs with &lt;code&gt;--network none&lt;/code&gt; and reads the modules read-only, as a module proxy&amp;rsquo;s files, so the commit&amp;rsquo;s code can&amp;rsquo;t reach your network or the services on your machine, such as the ones that Docker Desktop and podman machine forward to the Mac&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No capabilities and no new privileges.&lt;/strong&gt; Every container runs with &lt;code&gt;--cap-drop ALL&lt;/code&gt; and &lt;code&gt;--security-opt no-new-privileges&lt;/code&gt;. So root in the container can&amp;rsquo;t give a file another owner or ignore a file&amp;rsquo;s mode, and a setuid file in the commit&amp;rsquo;s image gives no privileges, even under a rootful runtime, where root in the container would otherwise be root on your machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounded processes and memory.&lt;/strong&gt; Every container runs with &lt;code&gt;--pids-limit 8192&lt;/code&gt; and &lt;code&gt;--memory 8g&lt;/code&gt;, so a build that forks without end or keeps allocating stops at those limits rather than using up your machine&amp;rsquo;s, which matters most under rootful Docker on Linux, whose containers share your kernel and have no limit of their own. Rootless podman supports them only on cgroups v2, with the &lt;code&gt;pids&lt;/code&gt; and &lt;code&gt;memory&lt;/code&gt; controllers delegated to your user, as systemd does by default. Disk space has no limit that both runtimes support, so while a build runs, it can fill the disk that holds your temporary folder or the runtime&amp;rsquo;s storage, until the time limit stops it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The right user.&lt;/strong&gt; The container runs as root under a rootless runtime, rootless podman or Docker&amp;rsquo;s rootless mode, which maps root to you, and as you under a rootful one, Docker or Docker Desktop, so the files it writes are yours either way. The runtime&amp;rsquo;s info says which, never its name, so podman behind a &lt;code&gt;docker&lt;/code&gt; command runs as podman does, and a runtime that doesn&amp;rsquo;t answer, such as Docker Desktop when it isn&amp;rsquo;t running, stops the build before it starts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Only your own files back.&lt;/strong&gt; The build writes its files to a folder of their own, mounted at &lt;code&gt;/out&lt;/code&gt;, which the container can&amp;rsquo;t swap for a link, because a mount point can&amp;rsquo;t be renamed. Before &lt;code&gt;release.sh&lt;/code&gt; copies, signs or keeps any of them, it checks that the folder is still the one it made, not a link to another, that everything in it is a file or a folder, never a link, that each is yours and is neither setuid, setgid, sticky nor writable by anyone, and that they come to 2 GiB at most, which a release is far under. Then it copies the files to &lt;code&gt;dist/&lt;/code&gt; rather than moving them, so each copy is yours, with mode 0755 or 0644. So neither minisign, &lt;code&gt;publish.sh&lt;/code&gt; nor &lt;code&gt;gh&lt;/code&gt; follows a link that the container made, and no file the container wrote keeps its owner or its mode. &lt;code&gt;release.sh&lt;/code&gt; runs with umask 022 on your machine too, so the signature it adds to &lt;code&gt;dist/&lt;/code&gt; is 0644 as well, even under a umask such as Ubuntu&amp;rsquo;s 0002, which would leave it writable by your group.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A time limit, and no container left behind.&lt;/strong&gt; &lt;code&gt;release.sh&lt;/code&gt; names each container for its run alone and removes it from your machine once it has run for two hours, or for &lt;code&gt;DEVVM_RELEASE_TIMEOUT&lt;/code&gt; seconds, whatever its image does. It removes it too as soon as &lt;code&gt;release.sh&lt;/code&gt; stops early. Ctrl+C, a closed terminal and &lt;code&gt;kill&lt;/code&gt; stop it at once, and after &lt;code&gt;kill -9&lt;/code&gt; a watchdog that outlives &lt;code&gt;release.sh&lt;/code&gt; removes the container and the build&amp;rsquo;s temporary folder within a few seconds. The container&amp;rsquo;s first process is &lt;code&gt;bash&lt;/code&gt;, so the image&amp;rsquo;s own entrypoint never runs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-docs-sites"&gt;The docs sites&lt;span class="hx:absolute hx:-mt-20" id="the-docs-sites"&gt;&lt;/span&gt;
&lt;a href="#the-docs-sites" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The docs have two sites, and the Docs workflow (&lt;code&gt;.github/workflows/docs.yml&lt;/code&gt;) deploys both. devvm.dev shows the docs of the latest release, so what users read matches the devvm they install. next.devvm.dev shows the docs on &lt;code&gt;main&lt;/code&gt;, for the next release, which is what someone trying a prerelease reads. A pull request that touches the docs gets their lints and a build, and it deploys nothing, so a pull request from a fork never reaches either site or its keys.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;devvm.dev&lt;/strong&gt; is GitHub Pages, in the repo&amp;rsquo;s &lt;code&gt;github-pages&lt;/code&gt; environment, which accepts deployments from &lt;code&gt;main&lt;/code&gt; and from &lt;code&gt;v*&lt;/code&gt; tags, and only admins can create a &lt;code&gt;v*&lt;/code&gt; tag. When a release is published, and it isn&amp;rsquo;t a prerelease, the workflow builds the docs in that release&amp;rsquo;s tag and deploys them. A release event runs the workflow file that the tag has, so a release whose tag predates this workflow doesn&amp;rsquo;t deploy on its own. Pushes to &lt;code&gt;main&lt;/code&gt; never change devvm.dev.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To deploy a release&amp;rsquo;s docs by hand,&lt;/strong&gt; for a release that didn&amp;rsquo;t deploy on its own or to put devvm.dev back on a release, run the Docs workflow from &lt;code&gt;main&lt;/code&gt; in the repo&amp;rsquo;s Actions tab, or with &lt;code&gt;gh workflow run docs.yml --repo devvmhq/devvm -f site=devvm.dev -f ref=v0.1.0&lt;/code&gt;. The site is &lt;code&gt;devvm.dev&lt;/code&gt; unless you choose another one, and the ref is the release&amp;rsquo;s tag, which has to look like &lt;code&gt;v0.1.0&lt;/code&gt;, so a prerelease&amp;rsquo;s tag is refused. Without a ref, the workflow deploys the latest release, as &lt;code&gt;gh release view&lt;/code&gt; names it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;next.devvm.dev&lt;/strong&gt; is Cloudflare Pages, serving the files on the &lt;code&gt;main&lt;/code&gt; branch of the repo &lt;code&gt;devvmhq/docs-next&lt;/code&gt;, and Cloudflare builds nothing. On each push to &lt;code&gt;main&lt;/code&gt; that touches the docs, the workflow lints and builds &lt;code&gt;main&lt;/code&gt;&amp;rsquo;s docs for next.devvm.dev, then replaces everything in &lt;code&gt;devvmhq/docs-next&lt;/code&gt; but its &lt;code&gt;README.md&lt;/code&gt; with the build, and commits it as &lt;code&gt;Build from devvm &amp;lt;short sha&amp;gt;&lt;/code&gt;. When the build is the same as the last one, it commits nothing. &lt;code&gt;gh workflow run docs.yml --repo devvmhq/devvm -f site=next.devvm.dev&lt;/code&gt; runs it by hand. Nobody edits &lt;code&gt;devvmhq/docs-next&lt;/code&gt; by hand, because the next build replaces it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every build draws the diagrams first,&lt;/strong&gt; with &lt;code&gt;mise run docs:diagrams&lt;/code&gt;, so each of the workflow&amp;rsquo;s jobs installs Node through mise. A release whose tag predates the drawing script, &lt;code&gt;docs/render-diagrams.mjs&lt;/code&gt;, loads Mermaid in its pages instead, so the release job draws them only when the tag has that script.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The deploy key&lt;/strong&gt; that pushes to &lt;code&gt;devvmhq/docs-next&lt;/code&gt; is the secret &lt;code&gt;DOCS_NEXT_DEPLOY_KEY&lt;/code&gt; in the &lt;code&gt;docs-next&lt;/code&gt; environment, which only &lt;code&gt;main&lt;/code&gt; can deploy from. It&amp;rsquo;s an ed25519 key with write access to &lt;code&gt;devvmhq/docs-next&lt;/code&gt; and to nothing else. The workflow checks that repo out with it only after the site is built, so the build never sees the key. To rotate it, make a new key, add its public half to &lt;code&gt;devvmhq/docs-next&lt;/code&gt; as a deploy key with write access, put its private half in the secret, then delete the old deploy key.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The next build&lt;/strong&gt; is &lt;code&gt;hugo -s docs --minify --config hugo.yaml,next.yaml&lt;/code&gt;, which reads &lt;code&gt;docs/next.yaml&lt;/code&gt; over &lt;code&gt;docs/hugo.yaml&lt;/code&gt;. It sets the site&amp;rsquo;s address to &lt;code&gt;https://next.devvm.dev/&lt;/code&gt; and puts a banner on every page that says these docs are for the next devvm and links to devvm.dev. It also sets &lt;code&gt;noindex&lt;/code&gt;, so Hextra gives every page a &lt;code&gt;noindex, nofollow&lt;/code&gt; robots meta tag, and &lt;code&gt;docs/layouts/robots.txt&lt;/code&gt; disallows everything, so search engines don&amp;rsquo;t index the site. devvm.dev&amp;rsquo;s build, &lt;code&gt;hugo -s docs --minify&lt;/code&gt;, never reads &lt;code&gt;docs/next.yaml&lt;/code&gt;, so it has no banner, its pages say &lt;code&gt;index, follow&lt;/code&gt;, and its &lt;code&gt;robots.txt&lt;/code&gt; allows everything.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Setting up GitHub for releases</title><link>https://next.devvm.dev/docs/contributing/github-setup/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/github-setup/</guid><description>
&lt;p&gt;Releases go through CI and the co-signer only once GitHub is set up for them, and until then &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; publishes them from the maintainer&amp;rsquo;s machine, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; says. This page is the setup, in the order to do it. Each step gives the clicks in GitHub&amp;rsquo;s settings and, where GitHub&amp;rsquo;s API can do it, the &lt;code&gt;gh api&lt;/code&gt; command that does the same. Read each command before you run it, check it against GitHub&amp;rsquo;s documentation, and replace each &lt;code&gt;&amp;lt;…&amp;gt;&lt;/code&gt; with its value. The commands assume the repos are &lt;code&gt;devvmhq/devvm&lt;/code&gt; and &lt;code&gt;devvmhq/homebrew-tap&lt;/code&gt;, under the organization &lt;code&gt;devvmhq&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Step 4 needs your user ID, which &lt;code&gt;gh api user --jq .id&lt;/code&gt; prints, and step 7 the App ID from step 2.&lt;/p&gt;
&lt;h2 data-hextra-search-id="1-the-release-keys"&gt;1. The release keys&lt;span class="hx:absolute hx:-mt-20" id="1-the-release-keys"&gt;&lt;/span&gt;
&lt;a href="#1-the-release-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm checks a release with three release keys once they&amp;rsquo;re built into it (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;Release keys&lt;/a&gt;). Until you make them, &lt;code&gt;packaging/keys&lt;/code&gt; has none and &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s three key lines are empty, so devvm and the install script check each release with the old release key alone, and &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; publishes it signed with that key, as before. CI&amp;rsquo;s Release workflow, &lt;code&gt;scripts/publish.sh&lt;/code&gt; without &lt;code&gt;--local&lt;/code&gt;, &lt;code&gt;--sign-legacy&lt;/code&gt; and the co-signer refuse to run without the keys, and each refusal points here. Make each key where its holder keeps it, and never two on one machine:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;minisign -G -W -p packaging/keys/release-ci.pub -s ci.key &lt;span class="c1"&gt;# CI&amp;#39;s, with no password: step 4 puts it in GitHub&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo minisign -G -W -p release-cosign.pub -s /etc/devvm-cosign/release.key &lt;span class="c1"&gt;# on the co-signer&amp;#39;s machine (step 3)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;minisign -G -p release-recovery.pub -s /path/on/an/offline/drive/recovery.key &lt;span class="c1"&gt;# the recovery key, with a password, kept offline&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Commit the three &lt;code&gt;.pub&lt;/code&gt; files to &lt;code&gt;packaging/keys/&lt;/code&gt; as &lt;code&gt;release-ci.pub&lt;/code&gt;, &lt;code&gt;release-cosign.pub&lt;/code&gt; and &lt;code&gt;release-recovery.pub&lt;/code&gt;, and copy each key into &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;release_ci_key&lt;/code&gt;, &lt;code&gt;release_cosign_key&lt;/code&gt; and &lt;code&gt;release_recovery_key&lt;/code&gt; lines, all in one commit, because a devvm with one or two of the keys can&amp;rsquo;t upgrade. &lt;code&gt;TestReleaseKeys&lt;/code&gt; checks that the keys are all three, each a different minisign key and none of them the old release key, and &lt;code&gt;TestInstallScriptKeys&lt;/code&gt; checks that &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s lines match them. &lt;code&gt;scripts/release.sh --check-tag&lt;/code&gt; refuses a tag with one or two of the keys, a key marked &lt;code&gt;PLACEHOLDER&lt;/code&gt; in its comment, or lines in &lt;code&gt;install.sh&lt;/code&gt; that differ. The first release built with the keys still carries the old key&amp;rsquo;s signature, so every devvm before it, which has no release keys, upgrades to it. Keep &lt;code&gt;ci.key&lt;/code&gt; only until step 4, then delete it, because a lost CI key is replaced by a release that the other two keys sign.&lt;/p&gt;
&lt;h2 data-hextra-search-id="2-the-github-app"&gt;2. The GitHub App&lt;span class="hx:absolute hx:-mt-20" id="2-the-github-app"&gt;&lt;/span&gt;
&lt;a href="#2-the-github-app" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The co-signer calls GitHub as an app of its own, never with your GitHub token, and the app can read the repo, write releases and the tap, and read workflow runs&amp;rsquo; artifacts, and nothing else (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#the-github-app"&gt;The GitHub App&lt;/a&gt;).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;https://github.com/organizations/devvmhq/settings/apps/new&lt;/code&gt; (for a user account, Settings, then Developer settings, then GitHub Apps, then New GitHub App).&lt;/li&gt;
&lt;li&gt;Name it, such as &lt;code&gt;devvm-cosign&lt;/code&gt;, with &lt;code&gt;https://devvm.dev&lt;/code&gt; as its homepage, and clear &lt;strong&gt;Webhook: Active&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Repository permissions&lt;/strong&gt;, set &lt;strong&gt;Contents&lt;/strong&gt; to Read and write and &lt;strong&gt;Actions&lt;/strong&gt; to Read-only. GitHub adds &lt;strong&gt;Metadata&lt;/strong&gt;, Read-only. Leave every other permission, and every organization and account permission, at No access.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Where can this GitHub App be installed?&lt;/strong&gt;, choose &lt;strong&gt;Only on this account&lt;/strong&gt;, then &lt;strong&gt;Create GitHub App&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Note the &lt;strong&gt;App ID&lt;/strong&gt; and the &lt;strong&gt;Client ID&lt;/strong&gt; at the top of its page: the config&amp;rsquo;s &lt;code&gt;[app] id&lt;/code&gt; takes either, and step 7 needs the App ID.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Private keys&lt;/strong&gt;, choose &lt;strong&gt;Generate a private key&lt;/strong&gt;, and copy the &lt;code&gt;.pem&lt;/code&gt; file to the co-signer&amp;rsquo;s machine as &lt;code&gt;/etc/devvm-cosign/app.pem&lt;/code&gt;, root&amp;rsquo;s, mode 0600. Delete the downloaded copy.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Install App&lt;/strong&gt;, then the &lt;code&gt;devvmhq&lt;/code&gt; account, then &lt;strong&gt;Only select repositories&lt;/strong&gt;, and select &lt;code&gt;devvm&lt;/code&gt; and &lt;code&gt;homebrew-tap&lt;/code&gt; alone. The installation&amp;rsquo;s ID is the number at the end of the page&amp;rsquo;s URL afterwards, &lt;code&gt;…/installations/&amp;lt;ID&amp;gt;&lt;/code&gt;, which is the config&amp;rsquo;s &lt;code&gt;[app] installation&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Check it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api orgs/devvmhq/installations --jq &lt;span class="s1"&gt;&amp;#39;.installations[] | {id, app_slug, repository_selection, permissions}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api orgs/devvmhq/installations/&amp;lt;installation ID&amp;gt;/repositories --jq &lt;span class="s1"&gt;&amp;#39;.repositories[].full_name&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;# devvm and homebrew-tap alone&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 data-hextra-search-id="3-the-co-signers-machine"&gt;3. The co-signer&amp;rsquo;s machine&lt;span class="hx:absolute hx:-mt-20" id="3-the-co-signers-machine"&gt;&lt;/span&gt;
&lt;a href="#3-the-co-signers-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Set it up as &lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#setting-it-up"&gt;Setting it up&lt;/a&gt; says, with the release key from step 1 and the app&amp;rsquo;s key from step 2, then step 7 below for its notify command. Its &lt;code&gt;init&lt;/code&gt; records what GitHub has published, so run &lt;code&gt;devvm-cosign@init&lt;/code&gt; once the setup on this page is done and before the first release goes through it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="4-the-release-environment"&gt;4. The release environment&lt;span class="hx:absolute hx:-mt-20" id="4-the-release-environment"&gt;&lt;/span&gt;
&lt;a href="#4-the-release-environment" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;CI&amp;rsquo;s Release workflow runs in the environment &lt;code&gt;release&lt;/code&gt;, which waits for your approval on each run and holds CI&amp;rsquo;s release key and the tag signers (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#cis-release-workflow"&gt;CI&amp;rsquo;s release workflow&lt;/a&gt;). Only runs for &lt;code&gt;v*&lt;/code&gt; tags may use it, and administrators can&amp;rsquo;t skip the approval.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, open &lt;strong&gt;Environments&lt;/strong&gt;, then &lt;strong&gt;New environment&lt;/strong&gt;, and name it &lt;code&gt;release&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Tick &lt;strong&gt;Required reviewers&lt;/strong&gt; and add yourself. Leave &lt;strong&gt;Prevent self-review&lt;/strong&gt; clear, because you push the tags you approve. Approve only a run for a tag you just pushed: the run is that tag&amp;rsquo;s own workflow, so approving it gives CI&amp;rsquo;s release key to the tag&amp;rsquo;s code, and the tag&amp;rsquo;s signature check runs inside it.&lt;/li&gt;
&lt;li&gt;Clear &lt;strong&gt;Allow administrators to bypass configured protection rules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Deployment branches and tags&lt;/strong&gt;, choose &lt;strong&gt;Selected branches and tags&lt;/strong&gt;, then &lt;strong&gt;Add deployment branch or tag rule&lt;/strong&gt;, choose &lt;strong&gt;Tag&lt;/strong&gt;, and enter &lt;code&gt;v*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Environment secrets&lt;/strong&gt;, add &lt;code&gt;RELEASE_CI_KEY&lt;/code&gt;, the whole of &lt;code&gt;ci.key&lt;/code&gt; from step 1, both lines, then delete &lt;code&gt;ci.key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Environment variables&lt;/strong&gt;, add &lt;code&gt;RELEASE_TAG_SIGNERS&lt;/code&gt;: the SSH public keys that sign release tags, one per line, each after a name, as git&amp;rsquo;s allowed signers file has them, such as &lt;code&gt;cj ssh-ed25519 AAAA…&lt;/code&gt;. The key is the one &lt;code&gt;packaging/release-signer&lt;/code&gt; pins the fingerprint of, and &lt;code&gt;git config user.signingkey&lt;/code&gt; names.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The same with &lt;code&gt;gh&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method PUT repos/devvmhq/devvm/environments/release --input - &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;wait_timer&amp;#34;: 0,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;prevent_self_review&amp;#34;: false,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;can_admins_bypass&amp;#34;: false,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;reviewers&amp;#34;: [{ &amp;#34;type&amp;#34;: &amp;#34;User&amp;#34;, &amp;#34;id&amp;#34;: &amp;lt;your user ID&amp;gt; }],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;deployment_branch_policy&amp;#34;: { &amp;#34;protected_branches&amp;#34;: false, &amp;#34;custom_branch_policies&amp;#34;: true }
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method POST repos/devvmhq/devvm/environments/release/deployment-branch-policies -f &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;v*&amp;#39;&lt;/span&gt; -f &lt;span class="nv"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tag
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh secret &lt;span class="nb"&gt;set&lt;/span&gt; RELEASE_CI_KEY --env release --repo devvmhq/devvm &amp;lt; ci.key
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;cj %s\n&amp;#39;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;cat ~/.ssh/&amp;lt;your signing key&amp;gt;.pub&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; gh variable &lt;span class="nb"&gt;set&lt;/span&gt; RELEASE_TAG_SIGNERS --env release --repo devvmhq/devvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Check it with &lt;code&gt;gh api repos/devvmhq/devvm/environments/release&lt;/code&gt;: &lt;code&gt;can_admins_bypass&lt;/code&gt; is false, &lt;code&gt;protection_rules&lt;/code&gt; lists you as the reviewer, and &lt;code&gt;gh api repos/devvmhq/devvm/environments/release/deployment-branch-policies&lt;/code&gt; lists &lt;code&gt;v*&lt;/code&gt; as a tag.&lt;/p&gt;
&lt;h2 data-hextra-search-id="5-the-tag-ruleset"&gt;5. The tag ruleset&lt;span class="hx:absolute hx:-mt-20" id="5-the-tag-ruleset"&gt;&lt;/span&gt;
&lt;a href="#5-the-tag-ruleset" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Only you can create, move or delete a &lt;code&gt;v*&lt;/code&gt; tag, so nobody else can start a release build, or retag a release. GitHub&amp;rsquo;s rulesets take roles, teams and apps as bypasses, not a single user, so the bypass is the repository&amp;rsquo;s admin role, which is you while you&amp;rsquo;re the only admin. Check that first, &lt;code&gt;gh api repos/devvmhq/devvm/collaborators --jq '.[] | select(.permissions.admin) | .login'&lt;/code&gt;, which lists organization owners too, and check &lt;code&gt;gh api repos/devvmhq/devvm/rulesets&lt;/code&gt; for a tag ruleset there already, to edit rather than add.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, open &lt;strong&gt;Rules&lt;/strong&gt;, then &lt;strong&gt;Rulesets&lt;/strong&gt;, then &lt;strong&gt;New ruleset&lt;/strong&gt;, then &lt;strong&gt;New tag ruleset&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Name it &lt;code&gt;Release tags&lt;/code&gt;, and set &lt;strong&gt;Enforcement status&lt;/strong&gt; to Active.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Bypass list&lt;/strong&gt;, add &lt;strong&gt;Repository admin&lt;/strong&gt;, with &lt;strong&gt;Always allow&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Target tags&lt;/strong&gt;, add the pattern &lt;code&gt;v*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Tag rules&lt;/strong&gt;, tick &lt;strong&gt;Restrict creations&lt;/strong&gt;, &lt;strong&gt;Restrict updates&lt;/strong&gt;, &lt;strong&gt;Restrict deletions&lt;/strong&gt; and &lt;strong&gt;Block force pushes&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The same with &lt;code&gt;gh&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method POST repos/devvmhq/devvm/rulesets --input - &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;name&amp;#34;: &amp;#34;Release tags&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;target&amp;#34;: &amp;#34;tag&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;enforcement&amp;#34;: &amp;#34;active&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;conditions&amp;#34;: { &amp;#34;ref_name&amp;#34;: { &amp;#34;include&amp;#34;: [&amp;#34;refs/tags/v*&amp;#34;], &amp;#34;exclude&amp;#34;: [] } },
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;rules&amp;#34;: [{ &amp;#34;type&amp;#34;: &amp;#34;creation&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;update&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;deletion&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;non_fast_forward&amp;#34; }],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;bypass_actors&amp;#34;: [{ &amp;#34;actor_id&amp;#34;: 5, &amp;#34;actor_type&amp;#34;: &amp;#34;RepositoryRole&amp;#34;, &amp;#34;bypass_mode&amp;#34;: &amp;#34;always&amp;#34; }]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;actor_id&lt;/code&gt; 5 is the repository admin role.&lt;/p&gt;
&lt;h2 data-hextra-search-id="6-immutable-releases"&gt;6. Immutable releases&lt;span class="hx:absolute hx:-mt-20" id="6-immutable-releases"&gt;&lt;/span&gt;
&lt;a href="#6-immutable-releases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Once a release is published, nobody can change its files or move its tag, so the files the co-signer checked are the ones users download. A draft can still change, which is how the co-signer and &lt;code&gt;--sign-legacy&lt;/code&gt; add their files before it&amp;rsquo;s published.&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, under &lt;strong&gt;General&lt;/strong&gt;, then &lt;strong&gt;Releases&lt;/strong&gt;, tick &lt;strong&gt;Enable release immutability&lt;/strong&gt;. With &lt;code&gt;gh&lt;/code&gt;, &lt;code&gt;gh api --method PUT repos/devvmhq/devvm/immutable-releases&lt;/code&gt;, and &lt;code&gt;gh api repos/devvmhq/devvm/immutable-releases&lt;/code&gt; checks it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="7-the-taps-ruleset"&gt;7. The tap&amp;rsquo;s ruleset&lt;span class="hx:absolute hx:-mt-20" id="7-the-taps-ruleset"&gt;&lt;/span&gt;
&lt;a href="#7-the-taps-ruleset" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Only the co-signer&amp;rsquo;s app writes the tap&amp;rsquo;s &lt;code&gt;main&lt;/code&gt;, so nobody else can point Homebrew at other archives.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;homebrew-tap&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;Settings&lt;/strong&gt;, open &lt;strong&gt;Rules&lt;/strong&gt;, then &lt;strong&gt;Rulesets&lt;/strong&gt;, then &lt;strong&gt;New ruleset&lt;/strong&gt;, then &lt;strong&gt;New branch ruleset&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Name it &lt;code&gt;main&lt;/code&gt;, and set &lt;strong&gt;Enforcement status&lt;/strong&gt; to Active.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Bypass list&lt;/strong&gt;, add the app from step 2, with &lt;strong&gt;Always allow&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Target branches&lt;/strong&gt;, choose &lt;strong&gt;Include default branch&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Branch rules&lt;/strong&gt;, tick &lt;strong&gt;Restrict updates&lt;/strong&gt;, &lt;strong&gt;Restrict deletions&lt;/strong&gt; and &lt;strong&gt;Block force pushes&lt;/strong&gt;, then &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The same with &lt;code&gt;gh&lt;/code&gt;, with the App ID from step 2:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh api --method POST repos/devvmhq/homebrew-tap/rulesets --input - &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;name&amp;#34;: &amp;#34;main&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;target&amp;#34;: &amp;#34;branch&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;enforcement&amp;#34;: &amp;#34;active&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;conditions&amp;#34;: { &amp;#34;ref_name&amp;#34;: { &amp;#34;include&amp;#34;: [&amp;#34;~DEFAULT_BRANCH&amp;#34;], &amp;#34;exclude&amp;#34;: [] } },
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;rules&amp;#34;: [{ &amp;#34;type&amp;#34;: &amp;#34;update&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;deletion&amp;#34; }, { &amp;#34;type&amp;#34;: &amp;#34;non_fast_forward&amp;#34; }],
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt; &amp;#34;bypass_actors&amp;#34;: [{ &amp;#34;actor_id&amp;#34;: &amp;lt;App ID&amp;gt;, &amp;#34;actor_type&amp;#34;: &amp;#34;Integration&amp;#34;, &amp;#34;bypass_mode&amp;#34;: &amp;#34;always&amp;#34; }]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To fix the tap by hand, turn the ruleset&amp;rsquo;s enforcement off, make the change, and turn it on again, which admins can do. The co-signer raises an alert for a tap formula it didn&amp;rsquo;t write.&lt;/p&gt;
&lt;h2 data-hextra-search-id="8-where-the-co-signer-tells-you"&gt;8. Where the co-signer tells you&lt;span class="hx:absolute hx:-mt-20" id="8-where-the-co-signer-tells-you"&gt;&lt;/span&gt;
&lt;a href="#8-where-the-co-signer-tells-you" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A run that fails, a refusal and an alert reach you through the config&amp;rsquo;s &lt;code&gt;notify&lt;/code&gt; command (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/#refusals-and-alerts"&gt;Refusals and alerts&lt;/a&gt;). A script that posts over HTTPS works under the co-signer&amp;rsquo;s units, such as this one to ntfy, saved as &lt;code&gt;/usr/local/bin/devvm-cosign-notify&lt;/code&gt;, root&amp;rsquo;s, mode 0755, with &lt;code&gt;notify = [&amp;quot;/usr/local/bin/devvm-cosign-notify&amp;quot;]&lt;/code&gt; in the config:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# What failed comes on standard input.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;exec&lt;/span&gt; curl -fsS --max-time &lt;span class="m"&gt;30&lt;/span&gt; -H &lt;span class="s1"&gt;&amp;#39;Title: devvm co-signer&amp;#39;&lt;/span&gt; --data-binary @- https://ntfy.sh/&amp;lt;a long random topic&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;An ntfy.sh topic is readable by anyone who knows its name, so use a long random one, or a server of your own with an ntfy access token. GitHub tells you the rest: it emails you when the Release workflow waits for your approval, and when a run fails.&lt;/p&gt;
&lt;h2 data-hextra-search-id="9-the-first-release-through-ci"&gt;9. The first release through CI&lt;span class="hx:absolute hx:-mt-20" id="9-the-first-release-through-ci"&gt;&lt;/span&gt;
&lt;a href="#9-the-first-release-through-ci" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Make it a release candidate, so a mistake costs little:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag -s v&amp;lt;version&amp;gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; scripts/publish.sh &lt;span class="c1"&gt;# push main and the tag&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh run watch --repo devvmhq/devvm &lt;span class="c1"&gt;# approve the run in the Actions tab first&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;scripts/publish.sh --sign-legacy &lt;span class="c1"&gt;# once the co-signer&amp;#39;s draft is there&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh release view v&amp;lt;version&amp;gt; --repo devvmhq/devvm &lt;span class="c1"&gt;# published, with SHA256SUMS and its three signatures&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The three signatures are CI&amp;rsquo;s, the co-signer&amp;rsquo;s and the old key&amp;rsquo;s, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, &lt;code&gt;SHA256SUMS.cosign.minisig&lt;/code&gt; and &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; isn&amp;rsquo;t needed any more, and a release it published would be one the co-signer alerts on.&lt;/p&gt;</description></item><item><title>The co-signer</title><link>https://next.devvm.dev/docs/contributing/cosigner/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/cosigner/</guid><description>
&lt;p&gt;The co-signer, &lt;code&gt;devvm-cosign&lt;/code&gt;, is the second of the two builders that sign each devvm release and each published base. It runs on a Linux machine of the maintainer&amp;rsquo;s, and a systemd timer starts it every hour. CI builds each release and hands its files and its signature over as a workflow artifact, because CI&amp;rsquo;s token can only read the repo. Each run, the co-signer downloads what CI handed over, rebuilds it with its own copy of devvm, and signs the manifest only when its build matches CI&amp;rsquo;s byte for byte. Then it makes the GitHub release itself, uploads CI&amp;rsquo;s files and both signatures, and publishes the release once two of the three keys signed it, then updates the Homebrew tap. CI can&amp;rsquo;t make or publish a release, so only the co-signer, and the maintainer by hand, can, and the co-signer raises an alert for any release published since its state began that it didn&amp;rsquo;t make, whatever its tag. Its code is &lt;code&gt;cmd/devvm-cosign&lt;/code&gt; and &lt;code&gt;internal/cosign&lt;/code&gt;, and its systemd units and install script are in &lt;code&gt;packaging/cosign&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Releases go through CI and the co-signer once GitHub is set up for them, as &lt;a href="https://next.devvm.dev/docs/contributing/github-setup/"&gt;Setting up GitHub for releases&lt;/a&gt; lists, and until then &lt;code&gt;scripts/publish.sh --local&lt;/code&gt; publishes them from the maintainer&amp;rsquo;s machine, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; describes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-ci-hands-over"&gt;What CI hands over&lt;span class="hx:absolute hx:-mt-20" id="what-ci-hands-over"&gt;&lt;/span&gt;
&lt;a href="#what-ci-hands-over" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;CI&amp;rsquo;s release workflow, &lt;code&gt;.github/workflows/release.yml&lt;/code&gt; by default (&lt;code&gt;release_workflow&lt;/code&gt; in the config), runs for each pushed release tag, and uploads one artifact named &lt;code&gt;release&lt;/code&gt;. The artifact holds &lt;code&gt;SHA256SUMS&lt;/code&gt;, CI&amp;rsquo;s signature of it, &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt;, and every file &lt;code&gt;SHA256SUMS&lt;/code&gt; lists, and nothing else, side by side, with no folders. The base workflow, &lt;code&gt;.github/workflows/base.yml&lt;/code&gt; by default, uploads one artifact named &lt;code&gt;base&lt;/code&gt; in the same way, with &lt;code&gt;base-index.json&lt;/code&gt;, &lt;code&gt;base-index.json.ci.minisig&lt;/code&gt; and the files the index lists.&lt;/p&gt;
&lt;p&gt;The co-signer reads the workflow&amp;rsquo;s successful runs of this repo&amp;rsquo;s own, never a fork&amp;rsquo;s, through the Actions API. For a release, it takes each tag&amp;rsquo;s newest run that the tag&amp;rsquo;s push started, and for a base, the newest run on &lt;code&gt;main&lt;/code&gt;. What a run hands over isn&amp;rsquo;t trusted for being CI&amp;rsquo;s: CI&amp;rsquo;s key has to have signed the manifest, and the co-signer&amp;rsquo;s own build has to match it.&lt;/p&gt;
&lt;h2 data-hextra-search-id="what-a-run-does"&gt;What a run does&lt;span class="hx:absolute hx:-mt-20" id="what-a-run-does"&gt;&lt;/span&gt;
&lt;a href="#what-a-run-does" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For each release CI handed over that the co-signer hasn&amp;rsquo;t published, oldest version first, though a run builds only one release or base, and the next waits for the next run:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Its version is newer&lt;/strong&gt; than every release the co-signer has signed, or it&amp;rsquo;s one it signed already, with the same &lt;code&gt;SHA256SUMS&lt;/code&gt;, because the run that signed it stopped before publishing. An older version, or a second &lt;code&gt;SHA256SUMS&lt;/code&gt; for a version it signed, is refused, because that&amp;rsquo;s an old or another release replayed, and an older version is an alert until you ack it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CI&amp;rsquo;s artifact checks out.&lt;/strong&gt; The co-signer downloads the artifact into &lt;code&gt;/var/lib/devvm-cosign/stage/&lt;/code&gt;, which no build can write, checked against GitHub&amp;rsquo;s digest of it, and unzips it there, taking only plain files with names a manifest can list, each written new and hashed as it&amp;rsquo;s written, within the artifact&amp;rsquo;s limits. It checks &lt;code&gt;SHA256SUMS.ci.minisig&lt;/code&gt; with CI&amp;rsquo;s release key and the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;, exactly, through &lt;code&gt;internal/minisign&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Keys.CheckRole&lt;/code&gt;. The artifact has to hold exactly the files &lt;code&gt;SHA256SUMS&lt;/code&gt; lists, each with its SHA-256, and nothing else. Before the build, the co-signer deletes those files from the stage and keeps only &lt;code&gt;SHA256SUMS&lt;/code&gt; and CI&amp;rsquo;s signature, so none of CI&amp;rsquo;s files is on disk while its own build runs, and nothing can have the build copy CI&amp;rsquo;s bytes in place of its own unless it has them from CI itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its tag checks out.&lt;/strong&gt; The co-signer clones its own devvm checkout, which is at the commit its config pins, into &lt;code&gt;/var/lib/devvm-cosign/src/&lt;/code&gt;, where no build&amp;rsquo;s container can reach it, fetches the tag and &lt;code&gt;main&lt;/code&gt; from GitHub, and checks the tag&amp;rsquo;s SSH signature against the tag signers its config pins, never a list read from GitHub or from the tag&amp;rsquo;s commit. The tag&amp;rsquo;s commit has to be on &lt;code&gt;main&lt;/code&gt;, and it has to be the commit CI&amp;rsquo;s run built, and the co-signer records the tag object&amp;rsquo;s ID. Before anything of the tag&amp;rsquo;s runs, the co-signer reads two files from the tag&amp;rsquo;s commit: the Homebrew formulas&amp;rsquo; template, &lt;code&gt;packaging/homebrew/devvm.rb&lt;/code&gt;, and &lt;code&gt;CHANGELOG.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its own build matches.&lt;/strong&gt; The co-signer runs its clone&amp;rsquo;s &lt;code&gt;scripts/release.sh --tag &amp;lt;tag&amp;gt;&lt;/code&gt;, with its temporary files in &lt;code&gt;/var/lib/devvm-cosign-build/work/&lt;/code&gt;, the one folder its containers write, and its finished files copied to a folder of &lt;code&gt;src/&lt;/code&gt;, where the co-signer reads them, which checks the tag again with git and the same signers, and builds the release in its pinned container. No code of the tag&amp;rsquo;s runs outside that container, though the tag does choose the container&amp;rsquo;s image and its Go and GoReleaser downloads, each pinned by its hash, so a tag that a pinned signer signed is what the co-signer trusts (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#reproducible-releases"&gt;Reproducible releases&lt;/a&gt;). git and &lt;code&gt;release.sh&lt;/code&gt; run with an environment of their own, the machine&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;, locale and container runtime&amp;rsquo;s variables alone, and no git config but the command line&amp;rsquo;s, so a repository&amp;rsquo;s own config runs no hook or fsmonitor, and git reaches files and HTTPS alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On a match, it signs.&lt;/strong&gt; Every file that &lt;code&gt;SHA256SUMS&lt;/code&gt; lists has to have the same SHA-256 in both builds, and the two &lt;code&gt;SHA256SUMS&lt;/code&gt; have to be the same bytes. The co-signer renders the tap&amp;rsquo;s formulas itself, from the tag&amp;rsquo;s template and the signed &lt;code&gt;SHA256SUMS&lt;/code&gt;, as &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;formula&lt;/code&gt; function does, and its build&amp;rsquo;s formulas have to be the same bytes, so neither builder&amp;rsquo;s container decides what Homebrew installs. It keeps the formulas and the release notes, the tag&amp;rsquo;s &lt;code&gt;CHANGELOG.md&lt;/code&gt; entry for the version, in &lt;code&gt;kept/&amp;lt;version&amp;gt;/&lt;/code&gt;, and records their SHA-256s and the version as signed in its state. Then it signs &lt;code&gt;SHA256SUMS&lt;/code&gt; with its own key and the trusted comment &lt;code&gt;devvm-release &amp;lt;version&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On a mismatch, it signs nothing.&lt;/strong&gt; It writes a report to &lt;code&gt;/var/lib/devvm-cosign/reports/&amp;lt;tag&amp;gt;-&amp;lt;time&amp;gt;.txt&lt;/code&gt;, with each file that differs and both builds&amp;rsquo; SHA-256s, files nothing publicly, and records the &lt;code&gt;SHA256SUMS&lt;/code&gt; as refused, so it isn&amp;rsquo;t built or downloaded again. Every run fails until you clear it, as &lt;a href="#refusals-and-alerts"&gt;Refusals and alerts&lt;/a&gt; says. A build that fails rather than differs, such as one cut short by a full disk or a download that failed, is built again at the next run, but the third failure in a row refuses it in the same way, with a report that holds the last failure. A build that keeps failing would otherwise take every run&amp;rsquo;s one build, and hold up each newer release and base behind it. A build stopped with its run, at its time limit or by &lt;code&gt;systemctl stop&lt;/code&gt;, isn&amp;rsquo;t counted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It makes the release.&lt;/strong&gt; The co-signer downloads CI&amp;rsquo;s artifact again, checked as before, with the same &lt;code&gt;SHA256SUMS&lt;/code&gt;. It makes a draft release of the tag, titled &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, with the notes it kept, as a prerelease for a version such as &lt;code&gt;0.3.0-rc.1&lt;/code&gt;. It uploads &lt;code&gt;SHA256SUMS&lt;/code&gt;, both signatures and CI&amp;rsquo;s files from the stage, hashing each file as it&amp;rsquo;s sent, so a file that changed on disk after its check is deleted again rather than published. An asset it didn&amp;rsquo;t upload, such as a half-finished upload&amp;rsquo;s, is deleted, and one with the bytes it should have, by size and GitHub&amp;rsquo;s digest, is kept, so a run that stops can run again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It checks the draft, then publishes.&lt;/strong&gt; The draft&amp;rsquo;s signatures have to pass &lt;code&gt;Keys.Check&lt;/code&gt;, so two of CI&amp;rsquo;s, its own and the recovery key&amp;rsquo;s. While releases bridge from the old release key, it waits until you upload &lt;code&gt;SHA256SUMS.minisig&lt;/code&gt; to the draft, with &lt;code&gt;scripts/publish.sh --sign-legacy&lt;/code&gt;, and checks it with that key and the trusted comment &lt;code&gt;devvm &amp;lt;version&amp;gt;&lt;/code&gt;, because devvm 0.1 and 0.2 check only that key, so while the bridge lasts, that key alone still signs a release for them. Each run fails while it waits, so you hear that the draft is waiting for you. Then it reads the draft again: its tag, title and notes have to be the ones it wrote, and its assets exactly the ones it uploaded, by GitHub&amp;rsquo;s ID, size and digest, with nothing added. The tag has to name the same tag object its rebuild checked, so a tag deleted or pushed again while the draft waited isn&amp;rsquo;t published. Only then does it publish the release, as GitHub&amp;rsquo;s latest release unless it&amp;rsquo;s a prerelease or older than a release it published, which happens when the old key signs a newer release&amp;rsquo;s draft first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It checks the release again.&lt;/strong&gt; When the published release differs from what it checked, the co-signer raises an alert and stops there, without updating the tap. devvm and the install script refuse a file that doesn&amp;rsquo;t match &lt;code&gt;SHA256SUMS&lt;/code&gt;, and Homebrew one that doesn&amp;rsquo;t match its formula, but compare the files by hand. With immutable releases on, the fix is a newer release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Then the tap.&lt;/strong&gt; It commits the formulas it kept, each checked against the SHA-256 its state recorded, to the tap&amp;rsquo;s &lt;code&gt;Formula/devvm.rb&lt;/code&gt; and &lt;code&gt;Formula/devvm-rc.rb&lt;/code&gt;, with GitHub&amp;rsquo;s contents API, as &lt;code&gt;scripts/publish.sh&lt;/code&gt; does: &lt;code&gt;devvm.rb&lt;/code&gt; only for a release, not a prerelease, and each only when the tap&amp;rsquo;s formula is for an older version. A tap formula for a version newer than any the co-signer signed isn&amp;rsquo;t one it wrote, so that&amp;rsquo;s an alert. A run that stopped after publishing finishes the tap on the next run, without building again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before any of that, the co-signer looks at each published release it hasn&amp;rsquo;t finished. Its own draft, published without it seeing the answer, such as when GitHub&amp;rsquo;s answer to the publish was lost, is checked as a published release: its &lt;code&gt;SHA256SUMS&lt;/code&gt; has to be the one it signed, both signatures and every file have to check out, downloaded, and its title and notes have to be its own. Only then does the co-signer finish the tap, and otherwise it raises an alert. &lt;code&gt;init&lt;/code&gt; records the highest release ID GitHub showed, and the drafts there were then, and GitHub&amp;rsquo;s IDs only go up, so any other release published since, whatever its tag or version, is an alert too. Each run also reads GitHub&amp;rsquo;s latest release, the one &lt;code&gt;/releases/latest/download/&lt;/code&gt; serves to the install script, wherever the list puts it. &lt;code&gt;init&lt;/code&gt; records which release that was, and the latest has to stay that one or become one the co-signer published: an older release made the latest again, such as one with a known flaw, is an alert, by &lt;code&gt;latest:&amp;lt;tag&amp;gt;#&amp;lt;ID&amp;gt;&lt;/code&gt;, and so is the one &lt;code&gt;init&lt;/code&gt; saw, or one of the co-signer&amp;rsquo;s own, once it&amp;rsquo;s older than a release the co-signer published.&lt;/p&gt;
&lt;p&gt;Each step that fails is logged, and the run goes on to the next release, then exits 1. A run that stops at any step can run again safely, and since an Ed25519 signature of the same bytes and comment is always the same, a signature made again is the one the first run would have made.&lt;/p&gt;
&lt;h3 data-hextra-search-id="refusals-and-alerts"&gt;Refusals and alerts&lt;span class="hx:absolute hx:-mt-20" id="refusals-and-alerts"&gt;&lt;/span&gt;
&lt;a href="#refusals-and-alerts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A refused build and an alert each fail every run, exit 1, until you deal with them, so the journal and the notify command keep saying so:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;journalctl -u &lt;span class="s1"&gt;&amp;#39;devvm-cosign@*&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;# what each run did, and why it failed&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo -u devvm-cosign devvm-cosign retry v0.3.0 &lt;span class="c1"&gt;# build CI&amp;#39;s v0.3.0 again, though it didn&amp;#39;t match before&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo -u devvm-cosign devvm-cosign ack v0.3.0 &lt;span class="c1"&gt;# clear v0.3.0&amp;#39;s alert, once you&amp;#39;ve dealt with it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A refusal&lt;/strong&gt; is a rebuild that didn&amp;rsquo;t match CI&amp;rsquo;s, or one that failed three times in a row. Read its report, and find out why, such as a full disk or a download cut short on the co-signer, or a build that isn&amp;rsquo;t reproducible. A new CI build of the same tag gives the same &lt;code&gt;SHA256SUMS&lt;/code&gt;, because builds are reproducible, so it stays refused. Once the cause is fixed, &lt;code&gt;devvm-cosign retry &amp;lt;tag&amp;gt;&lt;/code&gt; lets the next run rebuild it once more. The co-signer never retries a refusal on its own. Once a newer release is signed, a refused older one can&amp;rsquo;t be signed any more, because versions only go up, so a retry of it raises the older-version alert, and its fix is a newer release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An alert&lt;/strong&gt; is something wrong that the co-signer can&amp;rsquo;t fix: a release someone else published, one of its own whose published files differ from what it checked, an older version CI handed over, a tap formula it didn&amp;rsquo;t write, or an older release made GitHub&amp;rsquo;s latest. Find out what happened and fix it by hand, such as by deleting a release that isn&amp;rsquo;t CI&amp;rsquo;s and the co-signer&amp;rsquo;s build, then ack it with what the alert names: the tag for its own release or base, &lt;code&gt;&amp;lt;tag&amp;gt;#&amp;lt;ID&amp;gt;&lt;/code&gt; for a release someone else published, so another release of that tag is alerted on again, &lt;code&gt;tap:&amp;lt;formula&amp;gt;@&amp;lt;version&amp;gt;&lt;/code&gt; for a tap formula, and &lt;code&gt;latest:&amp;lt;tag&amp;gt;#&amp;lt;ID&amp;gt;&lt;/code&gt; for the latest release. After an ack, the next run checks its own release again, and raises the alert again if it still differs, and it leaves the rest alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A draft the co-signer didn&amp;rsquo;t make&lt;/strong&gt;, for a tag CI handed over, stops that release every run. A run that stopped between making a draft and recording it leaves one too. Delete it by hand, and the next run makes its own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both commands take the state&amp;rsquo;s lock and fail at once when a run holds it, so run one again then. Neither reads a key file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The notify command&lt;/strong&gt;, &lt;code&gt;notify&lt;/code&gt; in the config, is how you hear of a run that failed: a program and its arguments. Every unit of the co-signer&amp;rsquo;s that fails, a run killed at its time limit or one whose config won&amp;rsquo;t load included, starts &lt;code&gt;devvm-cosign-failed.service&lt;/code&gt; (&lt;code&gt;OnFailure=&lt;/code&gt;), which runs &lt;code&gt;devvm-cosign failed&lt;/code&gt;. That runs the notify command with a line saying a run failed and the last run&amp;rsquo;s record, which says when it started and what failed, or that it never finished, on its standard input, at most 64 KiB, with an environment of its own, &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;LANG&lt;/code&gt; and &lt;code&gt;DEVVM_COSIGN_EVENT=failed&lt;/code&gt; alone, in &lt;code&gt;/&lt;/code&gt;, for a minute at most, so it gets none of the co-signer&amp;rsquo;s credentials. Use a script that posts over HTTPS, such as &lt;code&gt;curl&lt;/code&gt; to ntfy: a local mail server&amp;rsquo;s &lt;code&gt;sendmail&lt;/code&gt; doesn&amp;rsquo;t work under the units&amp;rsquo; &lt;code&gt;NoNewPrivileges&lt;/code&gt;. A co-signer that&amp;rsquo;s down sends nothing, so a release tag that&amp;rsquo;s still not published a day on is the sign to look at it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="bases"&gt;Bases&lt;span class="hx:absolute hx:-mt-20" id="bases"&gt;&lt;/span&gt;
&lt;a href="#bases" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A base is a release of its own, &lt;code&gt;base-&amp;lt;serial&amp;gt;&lt;/code&gt;, whose manifest is &lt;code&gt;base-index.json&lt;/code&gt; and whose trusted comment is &lt;code&gt;devvm-base &amp;lt;format&amp;gt; &amp;lt;serial&amp;gt; &amp;lt;expiry&amp;gt;&lt;/code&gt;, with each of those the same as the index&amp;rsquo;s fields. The co-signer checks a base CI handed over as it checks a release, with the base keys, and with these differences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Only CI&amp;rsquo;s newest base counts,&lt;/strong&gt; as each base replaces the last. A run that the co-signer has published is never downloaded again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The serial only goes up,&lt;/strong&gt; and the index has to be in date. Its expiry is the last day devvm takes it, in UTC, and it may be at most 31 days ahead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The snapshot can&amp;rsquo;t be old.&lt;/strong&gt; An index whose Ubuntu snapshot is more than 60 days old (&lt;code&gt;max_snapshot_days&lt;/code&gt; in &lt;code&gt;[base]&lt;/code&gt;) is refused, whether or not it needs a rebuild. The expiry alone can&amp;rsquo;t keep users off an old base, because the co-signer re-signs an unchanged base with a new serial and expiry, so whoever holds CI&amp;rsquo;s base key could otherwise keep users on one snapshot, missing every update since, for as long as they sign. Ubuntu&amp;rsquo;s archive changes every day, so a base that&amp;rsquo;s two months old has missed security updates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An unchanged base is signed without a rebuild.&lt;/strong&gt; The co-signer records the SHA-256 of every base file that a rebuild of its own matched, and the last index it signed. A base that&amp;rsquo;s that index again, with a new serial and expiry, and whose files are all ones it has checked, is re-signed at once, which keeps the published base inside its 30 days while nothing changes. Any other index is rebuilt, so an older base&amp;rsquo;s files can&amp;rsquo;t come back with a new serial.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its release&lt;/strong&gt; is made at the index&amp;rsquo;s commit, titled &lt;code&gt;devvm's base &amp;lt;serial&amp;gt;&lt;/code&gt;, with notes the co-signer writes from the index, and it&amp;rsquo;s never GitHub&amp;rsquo;s latest release, which stays devvm&amp;rsquo;s newest release.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No rebuild yet.&lt;/strong&gt; Bases are built from the signing design&amp;rsquo;s fifth phase on, and until then a base with a file the co-signer hasn&amp;rsquo;t checked isn&amp;rsquo;t signed, and its log says why. &lt;code&gt;BaseBuilder&lt;/code&gt; is the seam for that build.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Without base keys in the config, the co-signer leaves bases alone.&lt;/p&gt;
&lt;h2 data-hextra-search-id="its-files"&gt;Its files&lt;span class="hx:absolute hx:-mt-20" id="its-files"&gt;&lt;/span&gt;
&lt;a href="#its-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/usr/local/bin/devvm-cosign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the program, built from a release tag the maintainer checked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/etc/devvm-cosign/config.toml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;everything it trusts and signs with, root&amp;rsquo;s, readable by its group, &lt;code&gt;devvm-cosign&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/etc/devvm-cosign/*.key&lt;/code&gt;, &lt;code&gt;app.pem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;its minisign secret keys and the GitHub App&amp;rsquo;s private key, root&amp;rsquo;s, mode 0600, which reach the service as systemd&amp;rsquo;s credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/state.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what it signed, made, published, refused and alerted on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/kept/&amp;lt;version&amp;gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each signed release&amp;rsquo;s formulas and notes, which it renders and checks before publishing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/reports/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the reports of rebuilds that didn&amp;rsquo;t match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/stage/&lt;/code&gt;, &lt;code&gt;src/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;CI&amp;rsquo;s artifacts, unzipped, and each build&amp;rsquo;s clone of the checkout, which &lt;code&gt;release.sh&lt;/code&gt; runs from, and its finished files, both emptied at the start of each run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/cache/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s downloads, which only it, on the host, reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign/last-failure.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the last run&amp;rsquo;s record for the notify command: when it started, and what failed or that it never finished; removed when a run succeeds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/lib/devvm-cosign-build/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the build folder, the one the builds&amp;rsquo; containers write: &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s temporary files in &lt;code&gt;work/&lt;/code&gt;, and rootless podman&amp;rsquo;s config, images and containers, all deleted each time the podman service starts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The config:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;repo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvmhq/devvm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;tap&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;devvmhq/homebrew-tap&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# The SSH public keys whose signed tags it builds, as their .pub files have them.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;tag_signers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ssh-ed25519 AAAA… cj@mini&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# podman or docker, for release.sh; podman by default.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;runtime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;podman&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Run after each run that failed, with what failed on its stdin; none by default.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;notify&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/usr/local/bin/devvm-cosign-notify&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# devvm&amp;#39;s checkout that the release.sh it builds with is from: a release tag you checked.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;devvm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/opt/devvm-cosign/devvm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;commit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;the tag&amp;#39;s commit, all 40 characters&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;secret_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/etc/devvm-cosign/release.key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;keys&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cosign&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;recovery&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# While releases bridge from the old release key: packaging/minisign.pub&amp;#39;s key.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;legacy_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Optional, until bases are published.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;secret_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/etc/devvm-cosign/base.key&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;keys&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ci&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cosign&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;recovery&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;RW…&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;lt;the app&amp;#39;s client ID or app ID&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;installation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345678&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;private_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/etc/devvm-cosign/app.pem&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The keys&lt;/strong&gt; are each kind&amp;rsquo;s three public keys, the same as &lt;code&gt;packaging/keys&lt;/code&gt;&amp;rsquo; &lt;code&gt;&amp;lt;kind&amp;gt;-&amp;lt;role&amp;gt;.pub&lt;/code&gt;, and the secret key&amp;rsquo;s public half has to be the &lt;code&gt;cosign&lt;/code&gt; key, or the config is refused. A config with a key it doesn&amp;rsquo;t know is refused too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The key files&lt;/strong&gt; are read from systemd&amp;rsquo;s credentials folder, &lt;code&gt;$CREDENTIALS_DIRECTORY&lt;/code&gt;, when the service runs, by the name each path in the config ends with, so those names have to be the units&amp;rsquo; credential names: &lt;code&gt;release.key&lt;/code&gt;, &lt;code&gt;app.pem&lt;/code&gt; and &lt;code&gt;base.key&lt;/code&gt;. Run by hand, outside the units, they&amp;rsquo;re read from where the config says. Each has to be a regular file that only its owner can read, mode 0600 or 0400, or the config is refused, but for a credential, which systemd makes root&amp;rsquo;s, mode 0440, with an ACL for the service&amp;rsquo;s user, in a folder only that service sees, and which only has to be unreadable by others.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;git_url&lt;/code&gt;, &lt;code&gt;api_url&lt;/code&gt; and &lt;code&gt;uploads_url&lt;/code&gt;&lt;/strong&gt; default to &lt;code&gt;https://github.com/&amp;lt;repo&amp;gt;.git&lt;/code&gt;, &lt;code&gt;https://api.github.com&lt;/code&gt; and &lt;code&gt;https://uploads.github.com&lt;/code&gt;, and each has to be HTTPS. &lt;strong&gt;&lt;code&gt;state_dir&lt;/code&gt;&lt;/strong&gt; defaults to &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; and &lt;strong&gt;&lt;code&gt;build_dir&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt;, and neither may be in the other, so the podman service&amp;rsquo;s unit can hide the state folder whole. The units name both folders, so change them only with the units changed to match.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;release_workflow&lt;/code&gt;&lt;/strong&gt; and &lt;code&gt;[base]&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;&lt;code&gt;workflow&lt;/code&gt;&lt;/strong&gt; are the workflow files&amp;rsquo; names, &lt;code&gt;release.yml&lt;/code&gt; and &lt;code&gt;base.yml&lt;/code&gt; by default, and &lt;code&gt;[base]&lt;/code&gt;&amp;rsquo;s &lt;strong&gt;&lt;code&gt;max_snapshot_days&lt;/code&gt;&lt;/strong&gt; is from 1 to 365, 60 by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The tap&lt;/strong&gt; has to be under the same owner as the repo, as the app&amp;rsquo;s one installation covers both.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;state.json&lt;/code&gt; records, for releases and for bases, the newest version or serial it signed, the SHA-256 of each manifest it signed and of each it refused with how often it was retried, how many of a manifest&amp;rsquo;s builds in a row failed, the draft releases it made, what it published, each alert and how often it was acked, the CI runs it signed, the SHA-256 of each file it kept, each release&amp;rsquo;s tag object, and each base file a rebuild matched, and the highest release ID GitHub showed and its latest release when &lt;code&gt;init&lt;/code&gt; wrote it. It&amp;rsquo;s written whole, through a temp file that&amp;rsquo;s synced and renamed, and the folder is synced after, and a write that would record less than the file on disk, such as an older version or a dropped draft, is refused. At the start of each run the co-signer also compares it with GitHub: when a release or base, a draft or published, has a signature that checks out with the co-signer&amp;rsquo;s key and is newer than the state&amp;rsquo;s newest, which a state it wrote never is, the state was restored from an old backup or replaced, and the run stops before signing anything, so restore the newest backup. Only one run runs at a time, through a lock in the state folder.&lt;/p&gt;
&lt;p&gt;GitHub lists releases and runs newest first, so the co-signer reads them a page at a time until a page holds only ones it&amp;rsquo;s finished with: published, and either from before its state began, its own and finished, or someone else&amp;rsquo;s that it has alerted on. Years of releases and bases never make it read more. Ten pages it hasn&amp;rsquo;t finished with are an error, never a list cut short.&lt;/p&gt;
&lt;h2 data-hextra-search-id="setting-it-up"&gt;Setting it up&lt;span class="hx:absolute hx:-mt-20" id="setting-it-up"&gt;&lt;/span&gt;
&lt;a href="#setting-it-up" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The co-signer runs on any Linux machine with systemd, about 4 cores and 20 GB free, podman (or Docker), git, bash, curl and &lt;code&gt;ssh-keygen&lt;/code&gt;. Nothing reaches it from outside: it calls GitHub&amp;rsquo;s API, fetches from GitHub, and its builds download Go, GoReleaser and Go&amp;rsquo;s modules.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install what it runs,&lt;/strong&gt; such as &lt;code&gt;sudo dnf install podman git curl openssh-clients&lt;/code&gt; on Fedora or &lt;code&gt;sudo apt install podman git curl openssh-client&lt;/code&gt; on Debian or Ubuntu, and &lt;a href="https://mise.jdx.dev" target="_blank" rel="noopener"&gt;mise&lt;/a&gt;, for the Go the tag pins.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Register qemu-user with binfmt,&lt;/strong&gt; once, on an x86_64 machine, so it can rebuild arm64&amp;rsquo;s base: &lt;code&gt;sudo dnf install qemu-user-static&lt;/code&gt; on Fedora, or &lt;code&gt;sudo apt install qemu-user-static binfmt-support&lt;/code&gt; on Debian or Ubuntu, then check that &lt;code&gt;/proc/sys/fs/binfmt_misc/qemu-aarch64&lt;/code&gt; exists. Releases don&amp;rsquo;t need it, because Go cross-compiles them, and an arm64 machine doesn&amp;rsquo;t need it at all.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check out devvm at a release tag&lt;/strong&gt; and build the co-signer from it, with the Go that the tag&amp;rsquo;s &lt;code&gt;mise.lock&lt;/code&gt; pins:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone https://github.com/devvmhq/devvm.git ~/devvm-cosign &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/devvm-cosign
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag -v v&amp;lt;version&amp;gt; &lt;span class="c1"&gt;# signed by your key: compare its fingerprint&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git checkout v&amp;lt;version&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise trust &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; mise install go &lt;span class="c1"&gt;# the Go the tag&amp;#39;s mise.lock pins&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; mise &lt;span class="nb"&gt;exec&lt;/span&gt; -- go build -trimpath -o /tmp/devvm-cosign ./cmd/devvm-cosign &lt;span class="c1"&gt;# outside the checkout, which must stay clean&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo packaging/cosign/install.sh /tmp/devvm-cosign
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mkdir -p /opt/devvm-cosign &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo mv ~/devvm-cosign /opt/devvm-cosign/devvm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo chown -R root:root /opt/devvm-cosign/devvm &lt;span class="c1"&gt;# the checkout config.toml names, root&amp;#39;s&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;install.sh&lt;/code&gt; installs the program and the systemd units, makes the user &lt;code&gt;devvm-cosign&lt;/code&gt; with 65536 subordinate IDs for rootless podman, above every other user&amp;rsquo;s range so no two users&amp;rsquo; containers share an ID, and makes &lt;code&gt;/etc/devvm-cosign&lt;/code&gt;, &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; and &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt; with the folders the units need. It installs no package and starts nothing, and it warns when there&amp;rsquo;s no &lt;code&gt;qemu-aarch64&lt;/code&gt; handler.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Write the config and copy the keys&lt;/strong&gt; into &lt;code&gt;/etc/devvm-cosign&lt;/code&gt;: the config root&amp;rsquo;s, readable by the co-signer&amp;rsquo;s group, and each key file root&amp;rsquo;s alone, &lt;code&gt;sudo chown root:devvm-cosign /etc/devvm-cosign/config.toml &amp;amp;&amp;amp; sudo chmod 640 /etc/devvm-cosign/config.toml &amp;amp;&amp;amp; sudo chown root:root /etc/devvm-cosign/*.key /etc/devvm-cosign/app.pem &amp;amp;&amp;amp; sudo chmod 600 /etc/devvm-cosign/*.key /etc/devvm-cosign/app.pem&lt;/code&gt;. With a base key, run &lt;code&gt;install.sh&lt;/code&gt; again, which then installs the drop-in that loads it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check it, write its first state and start the timer:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start devvm-cosign@check &lt;span class="c1"&gt;# the config, the keys and the checkout, offline&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start devvm-cosign@init &lt;span class="c1"&gt;# state.json, from the newest release and base published&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;journalctl -u devvm-cosign@check -u devvm-cosign@init
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now devvm-cosign.timer&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;init&lt;/code&gt; writes the first &lt;code&gt;state.json&lt;/code&gt; from what GitHub has published, so the co-signer signs only newer releases and bases and alerts on any release published after it, and it refuses to replace a state there is.&lt;/p&gt;
&lt;p&gt;The units:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;[email protected]&lt;/code&gt;&lt;/strong&gt; runs &lt;code&gt;devvm-cosign &amp;lt;instance&amp;gt;&lt;/code&gt; as &lt;code&gt;devvm-cosign&lt;/code&gt;, once per start: &lt;code&gt;devvm-cosign@run&lt;/code&gt; for the timer, and &lt;code&gt;@check&lt;/code&gt; and &lt;code&gt;@init&lt;/code&gt; for setting up. It loads the release key and the app&amp;rsquo;s key as systemd&amp;rsquo;s credentials (&lt;code&gt;LoadCredential=&lt;/code&gt;), and the base key through the drop-in &lt;code&gt;devvm-cosign-base.conf&lt;/code&gt;, because a credential that isn&amp;rsquo;t there fails the service. It runs with &lt;code&gt;NoNewPrivileges&lt;/code&gt;, &lt;code&gt;ProtectSystem=strict&lt;/code&gt;, &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; and &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt; its only writable folders, &lt;code&gt;ProtectHome&lt;/code&gt;, a private &lt;code&gt;/tmp&lt;/code&gt;, a PID namespace of its own, no capabilities, and a 3-hour limit, and when it fails it starts &lt;code&gt;devvm-cosign-failed.service&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-cosign.timer&lt;/code&gt;&lt;/strong&gt; starts &lt;code&gt;devvm-cosign@run&lt;/code&gt; hourly, and at boot for a run the machine was off for.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-cosign-podman.service&lt;/code&gt;&lt;/strong&gt; is the rootless podman service, as the same user, that the builds&amp;rsquo; containers run in, through &lt;code&gt;CONTAINER_HOST&lt;/code&gt;. podman can&amp;rsquo;t map a user namespace for its containers under &lt;code&gt;NoNewPrivileges&lt;/code&gt;, because &lt;code&gt;newuidmap&lt;/code&gt; gets its privilege from a file capability, so the containers run in this service, which has no &lt;code&gt;NoNewPrivileges&lt;/code&gt; and whose cgroup is delegated to the user, so &lt;code&gt;release.sh&lt;/code&gt;&amp;rsquo;s process and memory limits apply. Its &lt;code&gt;HOME&lt;/code&gt; is the build folder, where podman keeps its config and storage. Each time it starts, it deletes the user&amp;rsquo;s &lt;code&gt;libpod*&lt;/code&gt; files in &lt;code&gt;/dev/shm&lt;/code&gt;, podman&amp;rsquo;s locks, which outlive the service, then everything in the build folder, its images and containers with &lt;code&gt;podman system reset&lt;/code&gt;, so each run pulls its build&amp;rsquo;s image again, and a start that fails starts &lt;code&gt;devvm-cosign-failed.service&lt;/code&gt;. A start fails when a build left files the co-signer&amp;rsquo;s user can&amp;rsquo;t delete, and until root deletes them, &lt;code&gt;sudo rm -rf /var/lib/devvm-cosign-build/*&lt;/code&gt;, no run starts. It runs only while a run needs it (&lt;code&gt;StopWhenUnneeded=&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm-cosign-failed.service&lt;/code&gt;&lt;/strong&gt; runs &lt;code&gt;devvm-cosign failed&lt;/code&gt;, which runs the notify command, and reads no key.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="what-a-builds-container-can-reach"&gt;What a build&amp;rsquo;s container can reach&lt;span class="hx:absolute hx:-mt-20" id="what-a-builds-container-can-reach"&gt;&lt;/span&gt;
&lt;a href="#what-a-builds-container-can-reach" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The builds&amp;rsquo; containers run as the same user as the co-signer, because rootless podman maps a container&amp;rsquo;s root to it, and they have no capabilities and no network, but for the one that downloads Go&amp;rsquo;s modules, and run only code from a tag a pinned signer signed. A process that escapes a container lands in the podman service, and the units keep these from it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The keys and the config.&lt;/strong&gt; The keys are root&amp;rsquo;s, and the co-signer gets them only as credentials, in a folder of its own service&amp;rsquo;s while it runs. The podman service sees neither &lt;code&gt;/etc/devvm-cosign&lt;/code&gt; nor any service&amp;rsquo;s credentials (&lt;code&gt;InaccessiblePaths=&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The co-signer&amp;rsquo;s processes.&lt;/strong&gt; The podman service and the run&amp;rsquo;s service each have a PID namespace of their own (&lt;code&gt;PrivatePIDs=&lt;/code&gt;), so an escaped process can&amp;rsquo;t see the co-signer, &lt;code&gt;release.sh&lt;/code&gt; or git, nor reach their files through &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/root&lt;/code&gt;. &lt;code&gt;devvm-cosign&lt;/code&gt; also makes itself non-dumpable when it starts, so no other process of its user can read its memory, where the keys and the GitHub token are, or trace it, though the programs it starts are dumpable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The state and what the co-signer runs.&lt;/strong&gt; The podman service can&amp;rsquo;t see &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; at all: the state, the kept formulas, CI&amp;rsquo;s staged files, the download cache, the clone whose &lt;code&gt;release.sh&lt;/code&gt; and git config the co-signer runs, and the folder &lt;code&gt;release.sh&lt;/code&gt; copies the finished build to, which the co-signer reads. It writes only the build folder. The co-signer runs nothing from there, and the one thing &lt;code&gt;release.sh&lt;/code&gt; reads from it once a container has run is the build&amp;rsquo;s output, which it copies to that private folder: a link there can only change what the co-signer compares, and none of CI&amp;rsquo;s files is on disk then, so a build it changed differs from CI&amp;rsquo;s and is refused. That holds unless CI is compromised too: whoever controls CI knows its files&amp;rsquo; bytes, so an escape that downloads them into the build counts as the co-signer&amp;rsquo;s compromise, and both builders are then compromised, which two of three keys can&amp;rsquo;t stop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Later builds.&lt;/strong&gt; Each run builds once, and the podman service runs only while the run does, so a process that escaped a build is gone before the next build&amp;rsquo;s &lt;code&gt;release.sh&lt;/code&gt; and git run. Each start of the service deletes the user&amp;rsquo;s podman files in &lt;code&gt;/dev/shm&lt;/code&gt; and the whole build folder, podman&amp;rsquo;s config and images with it, so nothing a build left behind, such as a lock, a link or a config pointing podman at another runtime, reaches the next.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What&amp;rsquo;s still shared is the user and the machine. An escaped process can slow the build it&amp;rsquo;s in, or change it, which then doesn&amp;rsquo;t match CI&amp;rsquo;s, and use the machine&amp;rsquo;s network while that run lasts. An escape through the kernel, rather than podman or crun, gets past all of it, so keep the machine for the co-signer alone. Running podman as a build user of its own would take away the shared user, though that isn&amp;rsquo;t set up yet.&lt;/p&gt;
&lt;p&gt;With Docker instead, set &lt;code&gt;runtime = &amp;quot;docker&amp;quot;&lt;/code&gt;, drop &lt;code&gt;CONTAINER_HOST&lt;/code&gt; and the podman unit from the service, and add &lt;code&gt;devvm-cosign&lt;/code&gt; to the &lt;code&gt;docker&lt;/code&gt; group. Membership of that group is as good as root on the machine, so podman is the better choice.&lt;/p&gt;
&lt;h3 data-hextra-search-id="making-its-keys"&gt;Making its keys&lt;span class="hx:absolute hx:-mt-20" id="making-its-keys"&gt;&lt;/span&gt;
&lt;a href="#making-its-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The co-signer&amp;rsquo;s keys are minisign keys with no password, because nobody is there to type one, so the machine&amp;rsquo;s disk is what protects them:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo minisign -G -W -p release-cosign.pub -s /etc/devvm-cosign/release.key
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo minisign -G -W -p base-cosign.pub -s /etc/devvm-cosign/base.key&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Commit each public key to &lt;code&gt;packaging/keys/&amp;lt;kind&amp;gt;-cosign.pub&lt;/code&gt;, and copy the release key into &lt;code&gt;install.sh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;release_cosign_key&lt;/code&gt; line (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;Release keys&lt;/a&gt;). Keep an encrypted copy of each secret key offline, such as on a USB drive kept apart, and never on a machine you develop on, because that machine and CI would then hold two of the three keys.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-github-app"&gt;The GitHub App&lt;span class="hx:absolute hx:-mt-20" id="the-github-app"&gt;&lt;/span&gt;
&lt;a href="#the-github-app" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The co-signer calls GitHub with a GitHub App&amp;rsquo;s installation token, never a personal token. Each run signs a JSON Web Token with the app&amp;rsquo;s private key (RS256, issued a minute in the past and valid for nine minutes), trades it for an installation token, which lasts an hour, and asks for that token to reach only &lt;code&gt;devvm&lt;/code&gt; and the tap, with Contents read and write and Actions read, and nothing else. The app&amp;rsquo;s actor isn&amp;rsquo;t the maintainer, so it has none of the maintainer&amp;rsquo;s bypasses of rulesets.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/contributing/github-setup/#2-the-github-app"&gt;Setting up GitHub for releases&lt;/a&gt; has the clicks and the commands that check them.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create the app under the account that owns devvm, with no webhook, and the repository permissions Contents: read and write, Actions: read, and Metadata: read, which GitHub adds.&lt;/li&gt;
&lt;li&gt;Install it on &lt;code&gt;devvm&lt;/code&gt; and &lt;code&gt;homebrew-tap&lt;/code&gt; alone, and note the installation&amp;rsquo;s ID, the number at the end of its settings page&amp;rsquo;s URL.&lt;/li&gt;
&lt;li&gt;Generate a private key, and copy the &lt;code&gt;.pem&lt;/code&gt; file to &lt;code&gt;/etc/devvm-cosign/app.pem&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Let the app through the tap&amp;rsquo;s ruleset, as a bypass for its &lt;code&gt;main&lt;/code&gt;, or the co-signer can&amp;rsquo;t update the formulas, and every run fails.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Every GitHub call goes through &lt;code&gt;Client&lt;/code&gt; in &lt;code&gt;internal/cosign/github.go&lt;/code&gt; and &lt;code&gt;actions.go&lt;/code&gt;: listing releases, reading one, making a draft, uploading, deleting and downloading an asset, publishing, reading and writing the tap&amp;rsquo;s files, and listing a workflow&amp;rsquo;s runs and a run&amp;rsquo;s artifacts and downloading one. A download redirects to GitHub&amp;rsquo;s storage, and the token is never sent to a host other than the one it called.&lt;/p&gt;
&lt;h2 data-hextra-search-id="moving-it-to-another-machine"&gt;Moving it to another machine&lt;span class="hx:absolute hx:-mt-20" id="moving-it-to-another-machine"&gt;&lt;/span&gt;
&lt;a href="#moving-it-to-another-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Set up the new machine as above, with the same config and keys, then stop the old one&amp;rsquo;s timer (&lt;code&gt;sudo systemctl disable --now devvm-cosign.timer&lt;/code&gt;) and copy its &lt;code&gt;/var/lib/devvm-cosign&lt;/code&gt; whole, but for &lt;code&gt;stage/&lt;/code&gt;, &lt;code&gt;src/&lt;/code&gt; and &lt;code&gt;cache/&lt;/code&gt;, which the new machine makes again, as it does the build folder, &lt;code&gt;/var/lib/devvm-cosign-build&lt;/code&gt;, which isn&amp;rsquo;t copied. &lt;code&gt;state.json&lt;/code&gt; alone isn&amp;rsquo;t enough, because a release signed on the old machine and not yet in the tap needs its &lt;code&gt;kept/&lt;/code&gt; files. Two machines with the same keys must never run at once, because each would publish.&lt;/p&gt;
&lt;p&gt;A lost machine, or a co-signer key you no longer trust, needs new keys instead: make them on the new machine, then publish a release that embeds the new public key, signed by CI and the recovery key, which are two of three without the old key. From that release on, devvm checks the new key.&lt;/p&gt;
&lt;h2 data-hextra-search-id="its-tests"&gt;Its tests&lt;span class="hx:absolute hx:-mt-20" id="its-tests"&gt;&lt;/span&gt;
&lt;a href="#its-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;internal/cosign&lt;/code&gt;&amp;rsquo;s tests run the co-signer against a fake GitHub in memory (&lt;code&gt;fakegithub_test.go&lt;/code&gt;), which checks each call&amp;rsquo;s token and the app&amp;rsquo;s JWT, serves workflow runs and their artifacts, makes drafts, serves downloads from a storage server of its own, and can fail a call, leave a half-finished upload, lose a publish&amp;rsquo;s answer, or swap an asset. The rebuild is a stub in most tests, and &lt;code&gt;build_test.go&lt;/code&gt; runs &lt;code&gt;ReleaseBuild&lt;/code&gt; with real git repositories and a stub &lt;code&gt;release.sh&lt;/code&gt;. The cases include a rebuild that doesn&amp;rsquo;t match and its retry, a build that keeps failing, an older release made the latest, a formula of the build&amp;rsquo;s own, a bad CI signature, an artifact with a file too many or too few, a zip with a link, a folder or a size that lies, a tag signed by an unpinned key, an older version replayed, a file swapped before or as it&amp;rsquo;s published, a release someone else published, a failure mid-upload and its retry, the release list past ten pages, a base on an old snapshot, and a state that would go backwards, and the parsers of outside input have fuzz tests.&lt;/p&gt;</description></item><item><title>The structure test and owners</title><link>https://next.devvm.dev/docs/contributing/structure/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/structure/</guid><description>
&lt;h2 data-hextra-search-id="the-structure-test"&gt;The structure test&lt;span class="hx:absolute hx:-mt-20" id="the-structure-test"&gt;&lt;/span&gt;
&lt;a href="#the-structure-test" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;internal/structure&lt;/code&gt; parses every Go file in the repo, tests and every platform&amp;rsquo;s included, generated files left out, and checks what linters don&amp;rsquo;t. &lt;code&gt;mise run test&lt;/code&gt; runs it. Each failure starts with its rule and the file and line:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;th&gt;Checks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;max-methods&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;no type has more than 24 methods, value and pointer receivers together, and no interface declares more than 24, not counting the interfaces it embeds; a larger one splits by what its methods do&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;no-init&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;no &lt;code&gt;func init()&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;package-vars&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a package-level &lt;code&gt;var&lt;/code&gt; is a blank interface check, an &lt;code&gt;Err*&lt;/code&gt;/&lt;code&gt;err*&lt;/code&gt; sentinel from &lt;code&gt;errors.New&lt;/code&gt; or &lt;code&gt;fmt.Errorf&lt;/code&gt;, a &lt;code&gt;regexp.MustCompile&lt;/code&gt;, &lt;code&gt;template.Must&lt;/code&gt; or &lt;code&gt;sync.Once*&lt;/code&gt; result, a &lt;code&gt;//go:embed&lt;/code&gt; file, or listed in &lt;code&gt;allowedVars&lt;/code&gt;; anything else becomes a field, a const or a local&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;layers&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;which packages import which, in non-test files (tests may wire packages together)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;owners&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, only its owner runs a host command that &lt;code&gt;commands&lt;/code&gt; lists, only the files &lt;code&gt;execSites&lt;/code&gt; lists make a host command, only &lt;code&gt;guardOwner&lt;/code&gt; asserts a backend package&amp;rsquo;s type, only &lt;code&gt;envOwner&lt;/code&gt; reads a &lt;code&gt;DEVVM_&lt;/code&gt; variable, but the settings &lt;code&gt;envSettings&lt;/code&gt; lists, only its file in &lt;code&gt;envOwners&lt;/code&gt; reads &lt;code&gt;HOME&lt;/code&gt;, only its owner&amp;rsquo;s string literals hold a text that &lt;code&gt;literals&lt;/code&gt; lists, only its owner&amp;rsquo;s string literals are, whole, a name that &lt;code&gt;names&lt;/code&gt; lists, only its owner&amp;rsquo;s calls to package &lt;code&gt;strings&lt;/code&gt; split or join on a separator that &lt;code&gt;separators&lt;/code&gt; lists, only &lt;code&gt;pathsOwner&lt;/code&gt; builds a path in devvm&amp;rsquo;s data or config folder, and only its file in &lt;code&gt;callers&lt;/code&gt; calls a function that &lt;code&gt;callers&lt;/code&gt; lists (&lt;a href="#the-checks-on-owners"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;goroutines&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, a function that starts a goroutine, with a &lt;code&gt;go&lt;/code&gt; statement, a wait group&amp;rsquo;s &lt;code&gt;Go&lt;/code&gt; or &lt;code&gt;time&lt;/code&gt;&amp;rsquo;s or &lt;code&gt;context&lt;/code&gt;&amp;rsquo;s &lt;code&gt;AfterFunc&lt;/code&gt;, is in &lt;code&gt;goroutineSites&lt;/code&gt;, with what waits for its goroutines to end, or &lt;code&gt;detached:&lt;/code&gt; and why nothing does, and a package that starts one calls &lt;code&gt;leaktest.Main&lt;/code&gt; in its tests&amp;rsquo; &lt;code&gt;TestMain&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dropped-errors&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, no function assigns a &lt;code&gt;Wait&lt;/code&gt;&amp;rsquo;s error, or a &lt;code&gt;strconv&lt;/code&gt; parse&amp;rsquo;s, to &lt;code&gt;_&lt;/code&gt;, such as &lt;code&gt;_ = cmd.Wait()&lt;/code&gt; or &lt;code&gt;n, _ := strconv.Atoi(s)&lt;/code&gt;, unless &lt;code&gt;droppedErrors&lt;/code&gt; lists it with why, because a failed wait would read as a clean exit and text that isn&amp;rsquo;t a number as 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;read-limits&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files, every &lt;code&gt;io.ReadAll&lt;/code&gt; reads through an &lt;code&gt;io.LimitReader&lt;/code&gt; made in its call, such as &lt;code&gt;io.ReadAll(io.LimitReader(r, limit+1))&lt;/code&gt;, unless &lt;code&gt;unboundedReads&lt;/code&gt; lists its function with why, so a peer or a file that never ends can&amp;rsquo;t fill the memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;folder-ids&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files outside &lt;code&gt;internal/platform&lt;/code&gt;, no function compares a folder&amp;rsquo;s identity or its volume with &lt;code&gt;==&lt;/code&gt; or &lt;code&gt;!=&lt;/code&gt;, except with &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;, switches on one, passes one to &lt;code&gt;strings.EqualFold&lt;/code&gt;, &lt;code&gt;strings.Compare&lt;/code&gt;, &lt;code&gt;slices.Contains&lt;/code&gt; or &lt;code&gt;slices.Index&lt;/code&gt;, or keys a map by one, whether indexed or in a map&amp;rsquo;s literal, with its type written out or as a named map type of the module&amp;rsquo;s. A folder&amp;rsquo;s identity is a field named &lt;code&gt;Folder&lt;/code&gt; or &lt;code&gt;GitID&lt;/code&gt;, a call of a state&amp;rsquo;s &lt;code&gt;Folder&lt;/code&gt; or &lt;code&gt;FolderVolume&lt;/code&gt;, a call of &lt;code&gt;FolderID&lt;/code&gt;, &lt;code&gt;folderID&lt;/code&gt; or &lt;code&gt;FolderDevice&lt;/code&gt;, or a name in the same function that one of those, or such a name, was assigned to. A function passes when &lt;code&gt;exactFolderIDs&lt;/code&gt; lists it with why. The rule is there because a boot can number an unchanged folder&amp;rsquo;s device anew, which only &lt;code&gt;platform.SameFolder&lt;/code&gt; and &lt;code&gt;platform.SameOpenFolder&lt;/code&gt; allow for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;status-lines&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;in non-test files outside the folders &lt;code&gt;statusFree&lt;/code&gt; lists, a function that does slow work shows a status line itself, with a Reporter&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt;, a &lt;code&gt;LoggedCmd&lt;/code&gt; step or its &lt;code&gt;Runner&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Run&lt;/code&gt;, unless &lt;code&gt;statusSites&lt;/code&gt; lists it with why, so the user sees what devvm waits for (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#status-lines"&gt;status lines&lt;/a&gt;). Slow work is making a host command with &lt;code&gt;exec.Command&lt;/code&gt; or &lt;code&gt;exec.CommandContext&lt;/code&gt;, running host git through &lt;code&gt;internal/hostgit&lt;/code&gt;, walking a folder with &lt;code&gt;fs.WalkDir&lt;/code&gt;, &lt;code&gt;filepath.Walk&lt;/code&gt;, &lt;code&gt;filepath.WalkDir&lt;/code&gt;, &lt;code&gt;hostsafety.Walk&lt;/code&gt; or &lt;code&gt;safefile.Walk&lt;/code&gt;, looking up a volume with &lt;code&gt;platform.VolumeUUID&lt;/code&gt;, making a request with &lt;code&gt;internal/fetch&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Open&lt;/code&gt;, &lt;code&gt;Resolve&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt; or &lt;code&gt;Download&lt;/code&gt;, a &lt;code&gt;fetch.Resumable{…}.Download&lt;/code&gt; or &lt;code&gt;ubuntu.Download&lt;/code&gt;, waiting for a lock with &lt;code&gt;platform.LockFile&lt;/code&gt;, &lt;code&gt;LockFileShared&lt;/code&gt; or &lt;code&gt;LockDir&lt;/code&gt; whose waiting is &lt;code&gt;nil&lt;/code&gt; or &lt;code&gt;platform.NoWait&lt;/code&gt;, or running a backend&amp;rsquo;s command outside a step with its &lt;code&gt;Runner&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Output&lt;/code&gt; or &lt;code&gt;Attach&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The layers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Only &lt;code&gt;cmd/devvm&lt;/code&gt; and &lt;code&gt;internal/cli&lt;/code&gt; import &lt;code&gt;internal/ui&lt;/code&gt;; only &lt;code&gt;internal/cli&lt;/code&gt; imports &lt;code&gt;internal/vm&lt;/code&gt;; only &lt;code&gt;cmd/devvm&lt;/code&gt; imports &lt;code&gt;internal/cli&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;internal/backend/...&lt;/code&gt; imports none of &lt;code&gt;internal/vm&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;tools&lt;/code&gt;, &lt;code&gt;netpolicy&lt;/code&gt;, &lt;code&gt;secrets&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;, &lt;code&gt;gitprotect&lt;/code&gt;, &lt;code&gt;sshconfig&lt;/code&gt;, &lt;code&gt;sshagent&lt;/code&gt;, &lt;code&gt;trust&lt;/code&gt; or &lt;code&gt;vmssh&lt;/code&gt;, so the port forwarder and the link sessions stay devvm&amp;rsquo;s on every backend.&lt;/li&gt;
&lt;li&gt;Only &lt;code&gt;internal/backend/registry&lt;/code&gt; and &lt;code&gt;internal/cli&lt;/code&gt; import a backend (&lt;code&gt;lima&lt;/code&gt;); only tests import &lt;code&gt;backendtest&lt;/code&gt;, &lt;code&gt;internal/leaktest&lt;/code&gt;, &lt;code&gt;internal/memnet&lt;/code&gt;, and &lt;code&gt;internal/stubtest&lt;/code&gt; and the packages below it, which import only &lt;code&gt;internal/msg&lt;/code&gt; and each other. The stubs&amp;rsquo; binary, &lt;code&gt;internal/stubtest/stub&lt;/code&gt;, and its state, &lt;code&gt;internal/stubtest/stubstate&lt;/code&gt;, import nothing else of devvm&amp;rsquo;s, because the binary stands in for the tools devvm runs and is built apart from it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;internal/proxy&lt;/code&gt; imports no other devvm package except &lt;code&gt;internal/daemon&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets&lt;/code&gt;, &lt;code&gt;locales&lt;/code&gt;, &lt;code&gt;internal/platform&lt;/code&gt;, &lt;code&gt;internal/msg/gen&lt;/code&gt;, &lt;code&gt;internal/testbuild&lt;/code&gt;, &lt;code&gt;internal/hostgit&lt;/code&gt;, &lt;code&gt;internal/shell&lt;/code&gt;, &lt;code&gt;internal/vmname&lt;/code&gt;, &lt;code&gt;internal/daemon&lt;/code&gt;, &lt;code&gt;internal/fetch&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt;, &lt;code&gt;internal/leaktest&lt;/code&gt; and &lt;code&gt;internal/memnet&lt;/code&gt; import no devvm package; &lt;code&gt;internal/agentlogin&lt;/code&gt; only &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/fetch&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/platform&lt;/code&gt;, &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt; and &lt;code&gt;internal/state&lt;/code&gt;, because it holds agents&amp;rsquo; logins; &lt;code&gt;internal/msg&lt;/code&gt; only &lt;code&gt;locales&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;; &lt;code&gt;internal/paths&lt;/code&gt; only &lt;code&gt;internal/msg&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;; &lt;code&gt;internal/state&lt;/code&gt; only &lt;code&gt;internal/msg&lt;/code&gt;, &lt;code&gt;internal/paths&lt;/code&gt;, &lt;code&gt;internal/platform&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt;; &lt;code&gt;internal/image&lt;/code&gt; only &lt;code&gt;assets&lt;/code&gt;, &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/msg&lt;/code&gt;, &lt;code&gt;internal/paths&lt;/code&gt; and &lt;code&gt;internal/shell&lt;/code&gt;; &lt;code&gt;internal/devcontainer&lt;/code&gt; only &lt;code&gt;internal/image&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/msg&lt;/code&gt; and &lt;code&gt;internal/shell&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everything it holds the code to is in &lt;code&gt;devvm()&lt;/code&gt; in &lt;code&gt;internal/structure/structure_test.go&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;largeTypes&lt;/code&gt;&lt;/strong&gt; lists the types allowed more methods, which are &lt;code&gt;paths.Dirs&lt;/code&gt; and &lt;code&gt;ui.UI&lt;/code&gt;, each with its count as its maximum and why. A backend isn&amp;rsquo;t one of them, because its methods are split by &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s roles (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;). One that grows fails; one that shrinks fails until its maximum is lowered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;allowedVars&lt;/code&gt;&lt;/strong&gt; lists the other package-level vars, by package folder and name, each with why: values set by &lt;code&gt;-ldflags&lt;/code&gt;, fixed tables, test fixtures. An entry whose var is gone fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;layers&lt;/code&gt;&lt;/strong&gt; is the layering table: a layer&amp;rsquo;s packages (&lt;code&gt;from&lt;/code&gt;, but not &lt;code&gt;exceptFrom&lt;/code&gt;) import none of &lt;code&gt;to&lt;/code&gt; (but &lt;code&gt;exceptTo&lt;/code&gt;); &lt;code&gt;x/...&lt;/code&gt; is &lt;code&gt;x&lt;/code&gt; and the packages below it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;commands&lt;/code&gt;&lt;/strong&gt; maps a host command to the one package that runs it. &lt;strong&gt;&lt;code&gt;execSites&lt;/code&gt;&lt;/strong&gt; lists the files that make a host command with &lt;code&gt;exec.Command&lt;/code&gt; or &lt;code&gt;exec.CommandContext&lt;/code&gt;, each with why, and a listed file that no longer makes one fails. &lt;strong&gt;&lt;code&gt;guardOwner&lt;/code&gt;&lt;/strong&gt; names &lt;code&gt;internal/backend/guard.go&lt;/code&gt;, the one file that asserts a backend&amp;rsquo;s type. &lt;strong&gt;&lt;code&gt;envOwner&lt;/code&gt;&lt;/strong&gt; names the one file that reads devvm&amp;rsquo;s &lt;code&gt;DEVVM_&lt;/code&gt; variables. &lt;strong&gt;&lt;code&gt;envSettings&lt;/code&gt;&lt;/strong&gt; lists the variables read elsewhere, each with the files that read it and why. A listed file that no longer reads its variable fails. &lt;strong&gt;&lt;code&gt;envOwners&lt;/code&gt;&lt;/strong&gt; maps another variable to the one file that reads it, which for &lt;code&gt;HOME&lt;/code&gt; is &lt;code&gt;internal/paths/dirs.go&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;literals&lt;/code&gt;&lt;/strong&gt; maps a text that only one package&amp;rsquo;s string literals may hold to that package and what the others use instead. &lt;strong&gt;&lt;code&gt;names&lt;/code&gt;&lt;/strong&gt; maps a name that only one package&amp;rsquo;s string literals may be, whole, to that package and what the others use, and &lt;strong&gt;&lt;code&gt;namesFree&lt;/code&gt;&lt;/strong&gt; lists the folders whose literals may be one anyway: &lt;code&gt;internal/stubtest&lt;/code&gt;, whose stubs are named after the commands they stand in for.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;goroutineSites&lt;/code&gt;&lt;/strong&gt; lists every function outside tests that starts a goroutine, as its file and its name (&lt;code&gt;internal/proxy/splice.go: splice&lt;/code&gt;, or &lt;code&gt;Type.Method&lt;/code&gt; for a method). A function literal&amp;rsquo;s goroutine counts in the function it&amp;rsquo;s in, or in the package-level var whose value it is. A goroutine starts with a &lt;code&gt;go&lt;/code&gt; statement, a wait group&amp;rsquo;s &lt;code&gt;Go&lt;/code&gt;, or &lt;code&gt;time&lt;/code&gt;&amp;rsquo;s or &lt;code&gt;context&lt;/code&gt;&amp;rsquo;s &lt;code&gt;AfterFunc&lt;/code&gt;, whose function runs in a goroutine of its own. Goroutines that the standard library starts otherwise, such as an HTTP server&amp;rsquo;s for each connection, are for the leak checks to find, not the registry. Each entry says what waits for the goroutines to end, such as &lt;code&gt;scanAll's wg.Wait&lt;/code&gt;, or starts with &lt;code&gt;detached:&lt;/code&gt; and says why nothing does and what ends them anyway, such as a look at a folder whose disk may hang, which &lt;code&gt;folderWithin&lt;/code&gt; leaves to finish on its own. A new goroutine fails until its function is listed, and a listed function that no longer starts one fails, so the list stays current. A package that starts a goroutine also fails until a test file of its calls &lt;code&gt;leaktest.Main&lt;/code&gt;. The tests&amp;rsquo; own goroutines are the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#goroutine-leaks"&gt;leak checks&amp;rsquo;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;droppedErrors&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests that assign a &lt;code&gt;Wait&lt;/code&gt;&amp;rsquo;s or a &lt;code&gt;strconv&lt;/code&gt; parse&amp;rsquo;s error to &lt;code&gt;_&lt;/code&gt;, each named as in &lt;code&gt;goroutineSites&lt;/code&gt; and with why, and none does today. The check reads no types, so a call of any method named &lt;code&gt;Wait&lt;/code&gt; counts, and the parses are &lt;code&gt;Atoi&lt;/code&gt;, the &lt;code&gt;Parse&lt;/code&gt; functions, &lt;code&gt;Unquote&lt;/code&gt;, &lt;code&gt;UnquoteChar&lt;/code&gt; and &lt;code&gt;QuotedPrefix&lt;/code&gt;. A listed function that no longer drops one fails, so the list stays current.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;unboundedReads&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests whose &lt;code&gt;io.ReadAll&lt;/code&gt; reads with no limit, in the same way, each with why its reader ends: the status line&amp;rsquo;s look at the end of the run&amp;rsquo;s own log, which only that run writes, and the test stubs&amp;rsquo; reads of the standard input that devvm under test writes and closes. A reader limited before the call, held in a variable, counts as unlimited, so the limit goes in the call itself. A listed function that no longer reads with no limit fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;exactFolderIDs&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests and &lt;code&gt;internal/platform&lt;/code&gt; that compare a field named &lt;code&gt;Folder&lt;/code&gt; or &lt;code&gt;GitID&lt;/code&gt; with &lt;code&gt;==&lt;/code&gt; or &lt;code&gt;!=&lt;/code&gt;, in the same way, each with why: the agents&amp;rsquo; and exports&amp;rsquo; fields of that name, which are paths, &lt;code&gt;recordMove&lt;/code&gt;&amp;rsquo;s check that the state is as it was read, and &lt;code&gt;folderChanged&lt;/code&gt;, which runs after a start recorded the folder&amp;rsquo;s identity as it is now. The check reads no types, so any field by those names counts. A listed function that no longer compares one fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;statusSites&lt;/code&gt;&lt;/strong&gt; lists the functions outside tests that do slow work and show no status line of their own, in the same way, each with why: the status line of the caller it runs under, named by its message, such as &lt;code&gt;checking_vm&lt;/code&gt; for a launch&amp;rsquo;s checks of the project folder, work that takes the terminal, such as &lt;code&gt;ssh-add&lt;/code&gt; asking for a passphrase, a process with no UI, such as a forwarder or a link session, or a command made for its caller to run. &lt;strong&gt;&lt;code&gt;statusFree&lt;/code&gt;&lt;/strong&gt; lists the folders whose code shows none, each with why: &lt;code&gt;internal/ui&lt;/code&gt;, which draws the status line, the proxy&amp;rsquo;s and devvm&amp;rsquo;s background processes, &lt;code&gt;internal/hostgit&lt;/code&gt; and &lt;code&gt;internal/fetch&lt;/code&gt;, whose callers&amp;rsquo; functions are the sites, and the tests&amp;rsquo; stubs. The check reads no types, so it doesn&amp;rsquo;t see a backend&amp;rsquo;s methods, such as &lt;code&gt;Exec&lt;/code&gt;, which &lt;code&gt;TestLaunchStatusLines&lt;/code&gt; checks for a launch, and a caller&amp;rsquo;s status line is only named, so a reviewer checks that it covers the call. A listed function that no longer does slow work without one fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;callers&lt;/code&gt;&lt;/strong&gt; maps a function to the one file outside its package that calls it, and a listed file that no longer calls it fails. A method is listed as &lt;code&gt;pkg.Type.Name&lt;/code&gt;, such as &lt;code&gt;internal/paths.Dirs.AgentSettings&lt;/code&gt;, and any call of a method by that name outside its package counts, because the check reads no types, so a listed method&amp;rsquo;s name is its type&amp;rsquo;s alone.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;TestRulesFail&lt;/code&gt; breaks each rule, and each layer, on small sources and checks the failure names it.&lt;/p&gt;
&lt;p&gt;Shell scripts that live in Go strings get shellcheck too, since lint&amp;rsquo;s shellcheck only finds files with a shebang. &lt;code&gt;TestEmbeddedScripts&lt;/code&gt; in &lt;code&gt;internal/structure&lt;/code&gt; finds every call site that runs a script as &lt;code&gt;sh -c&lt;/code&gt;, &lt;code&gt;/bin/sh -c&lt;/code&gt; or &lt;code&gt;bash -c&lt;/code&gt; (or &lt;code&gt;-lc&lt;/code&gt;), in a &lt;code&gt;[]string&lt;/code&gt; literal or a call&amp;rsquo;s arguments, outside tests and the stubs. When the script is a constant, a literal, or a sum of them, such as &lt;code&gt;seedApply&lt;/code&gt; with &lt;code&gt;seedMarker&lt;/code&gt; in it, the test writes it to a file and runs &lt;code&gt;shellcheck -s sh&lt;/code&gt; or &lt;code&gt;-s bash&lt;/code&gt;, as its shell reads it, at &lt;code&gt;-S warning&lt;/code&gt;, skipping when shellcheck isn&amp;rsquo;t installed. A script built at run time can&amp;rsquo;t be read there, so the test fails on one until &lt;code&gt;dynamicScripts&lt;/code&gt; lists its file and expression with why: a fixed command around quoted paths, a devcontainer&amp;rsquo;s own command, or a builder that a test of its package checks, as &lt;code&gt;internal/vm&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TestBuiltScriptsShellcheck&lt;/code&gt; does for the scripts built from the agents&amp;rsquo; registry. A listed site that&amp;rsquo;s gone fails too, so the list stays current. A shell given any other flag, such as &lt;code&gt;sh -ec&lt;/code&gt; or &lt;code&gt;sh -e -c&lt;/code&gt;, fails as well, because the test would miss its script: put options such as &lt;code&gt;set -e&lt;/code&gt; in the script instead. &lt;code&gt;-s&lt;/code&gt;, for a script on standard input, is fine.&lt;/p&gt;
&lt;h2 data-hextra-search-id="one-owner-for-each-concern"&gt;One owner for each concern&lt;span class="hx:absolute hx:-mt-20" id="one-owner-for-each-concern"&gt;&lt;/span&gt;
&lt;a href="#one-owner-for-each-concern" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each concern in devvm has one owner, the package or function that does it, such as &lt;code&gt;internal/hostgit&lt;/code&gt; for every git command devvm runs on the host, &lt;code&gt;internal/paths&lt;/code&gt; for every folder and file devvm uses, &lt;code&gt;internal/settings&lt;/code&gt; for every default (&lt;code&gt;settings.Read&lt;/code&gt; and &lt;code&gt;settings.Save&lt;/code&gt;, over &lt;code&gt;config.toml&lt;/code&gt; and &lt;code&gt;settings.json&lt;/code&gt;, with each value&amp;rsquo;s parser), and &lt;code&gt;locales/en.toml&lt;/code&gt; for every message. Before you add a helper, a parser, a path, a file reader, a message or a table, find its owner and extend it. A second copy drifts from the first, and then one of them is wrong. Code with no owner yet can have a second copy, because a copy can be cheaper than the wrong shared helper, so extract an owner at the third copy. A judge, such as &lt;code&gt;proxy.Public&lt;/code&gt; or &lt;code&gt;NormHost&lt;/code&gt;, gets its owner at once, because its two copies would disagree on what&amp;rsquo;s allowed. &lt;a href="#the-packages"&gt;The packages&lt;/a&gt; says what each package owns, and the failures of the checks below name the owners too.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-packages"&gt;The packages&lt;span class="hx:absolute hx:-mt-20" id="the-packages"&gt;&lt;/span&gt;
&lt;a href="#the-packages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Each package owns these concerns, and a package&amp;rsquo;s &lt;code&gt;doc.go&lt;/code&gt;, where it has one, maps the package itself. &lt;code&gt;internal/fetch&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/agents&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/shell&lt;/code&gt;, &lt;code&gt;internal/vmname&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt; and &lt;code&gt;internal/daemon&lt;/code&gt; use the standard library alone, and &lt;code&gt;internal/proxy&lt;/code&gt; uses it with &lt;code&gt;internal/daemon&lt;/code&gt;, &lt;code&gt;internal/landlock&lt;/code&gt;, &lt;code&gt;internal/redact&lt;/code&gt;, &lt;code&gt;internal/safefile&lt;/code&gt; and &lt;code&gt;internal/vmname&lt;/code&gt; and nothing else. &lt;code&gt;internal/devcontainer&lt;/code&gt; imports no module from outside devvm, but it uses &lt;code&gt;internal/image&lt;/code&gt;, &lt;code&gt;internal/jsonc&lt;/code&gt;, &lt;code&gt;internal/msg&lt;/code&gt; and &lt;code&gt;internal/shell&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Owns&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cmd/devvm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the entry point: &lt;code&gt;ui.Main&lt;/code&gt; makes the run&amp;rsquo;s UI and runs the root command with it, and it&amp;rsquo;s the only &lt;code&gt;os.Exit&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/cli&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the command line. Each Cobra command has a file of its own, and its &lt;code&gt;about&lt;/code&gt; holds its docs page, its help group and the reason it has no &lt;code&gt;--json&lt;/code&gt;. The package also holds the run&amp;rsquo;s services (&lt;code&gt;app.go&lt;/code&gt;), the argument and flag checks, whose failures are usage errors, help, &lt;code&gt;--json&lt;/code&gt;, the CLI tests, &lt;code&gt;docgen/&lt;/code&gt;, which writes the CLI reference, and doctor&amp;rsquo;s check of Linux&amp;rsquo;s pins (&lt;code&gt;pins.go&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;what each command does to a folder&amp;rsquo;s VM, below the command line: &lt;code&gt;Env&lt;/code&gt; and its parts, the one start, the finder, the inventory, &lt;code&gt;Launch&lt;/code&gt;, the agents&amp;rsquo; store, logins and saves, &lt;code&gt;Lifecycle&lt;/code&gt; and the one remake, &lt;code&gt;Housekeeping&lt;/code&gt;, &lt;code&gt;Settings&lt;/code&gt;, &lt;code&gt;Net&lt;/code&gt; and &lt;code&gt;Links&lt;/code&gt;, which its &lt;code&gt;doc.go&lt;/code&gt; maps with their owners. A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s copy is &lt;code&gt;cloneseed.go&lt;/code&gt;&amp;rsquo;s: its in-VM scripts &lt;code&gt;initRepos&lt;/code&gt;, &lt;code&gt;seedStage&lt;/code&gt; and &lt;code&gt;seedApply&lt;/code&gt;, sent through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt;, with the shallow file read through &lt;code&gt;internal/safefile&lt;/code&gt; and the pack made by &lt;code&gt;internal/hostgit&lt;/code&gt;&amp;rsquo;s git. Its uncommitted changes are &lt;code&gt;cloneworktree.go&lt;/code&gt;&amp;rsquo;s &lt;code&gt;seedTree&lt;/code&gt;: the index read through &lt;code&gt;internal/safefile&lt;/code&gt; and normalised by &lt;code&gt;internal/hostgit&lt;/code&gt;&amp;rsquo;s git, &lt;code&gt;hostgit.DiffFiles&lt;/code&gt; for what differs, and each working copy read through a &lt;code&gt;safefile.Root&lt;/code&gt;, opening each folder from its parent with &lt;code&gt;OpenDir&lt;/code&gt;, so no link on the way is followed, then the record of what went, which &lt;code&gt;clonecheck.go&lt;/code&gt; reads back. An operation in progress, the &lt;code&gt;info&lt;/code&gt; files and the stash are &lt;code&gt;clonestate.go&lt;/code&gt;&amp;rsquo;s &lt;code&gt;seedState&lt;/code&gt;, each file read through &lt;code&gt;internal/safefile&lt;/code&gt;, and only the files its &lt;code&gt;stateIDs&lt;/code&gt; lists are read for object ids. The settings and hooks are &lt;code&gt;cloneconfig.go&lt;/code&gt;&amp;rsquo;s &lt;code&gt;seedConfig&lt;/code&gt;, an allowlist of config keys whose URLs &lt;code&gt;cleanURL&lt;/code&gt; takes the credentials out of, and a VM&amp;rsquo;s stash entry is saved by &lt;code&gt;clonesave.go&lt;/code&gt;, without its untracked files. &lt;code&gt;Tools.update&lt;/code&gt; is the step devvm tools update takes, which devvm update takes first, and &lt;code&gt;filePorts&lt;/code&gt; works out a VM&amp;rsquo;s ports again from its &lt;code&gt;devcontainer.json&lt;/code&gt;&amp;rsquo;s, with the rules of devvm ports add and devvm ports rm (&lt;a href="https://next.devvm.dev/docs/internals/overview/#reading-the-devcontainerjson-again"&gt;reading the devcontainer.json again&lt;/a&gt;). &lt;code&gt;vm.AgentImport&lt;/code&gt; reads each agent&amp;rsquo;s folder through that folder as an &lt;code&gt;os.Root&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#links-out-of-an-agents-folder"&gt;links out of an agent&amp;rsquo;s folder&lt;/a&gt;). &lt;code&gt;Launch.buildTools&lt;/code&gt; builds the tool images that a VM&amp;rsquo;s shared tools need and the share lacks, and &lt;code&gt;retainTools&lt;/code&gt; is retention&amp;rsquo;s &lt;code&gt;tools.unused-age&lt;/code&gt;. &lt;code&gt;Inventory.GitKeeper&lt;/code&gt; names the VM that keeps a path locked, and &lt;code&gt;cloneState&lt;/code&gt; is the script that reads a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s state back, its stash entries included. A Git LFS object file is opened beneath the common dir through an &lt;code&gt;os.Root&lt;/code&gt;, each folder on the way checked first, because an &lt;code&gt;os.Root&lt;/code&gt; still follows a link that stays inside it. &lt;code&gt;confinementFor&lt;/code&gt; chooses a start&amp;rsquo;s confinement from the tier, &lt;code&gt;starter.start&lt;/code&gt; registers the interrupt&amp;rsquo;s cleanup around the backend&amp;rsquo;s &lt;code&gt;Start&lt;/code&gt;, &lt;code&gt;vm.Env.Terminal&lt;/code&gt; gives an agent&amp;rsquo;s login the terminal&amp;rsquo;s files (&lt;code&gt;ui.Terminal&lt;/code&gt;), and &lt;code&gt;AgentLogin.endLogin&lt;/code&gt; ends the login in the VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/shell&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;quoting for a POSIX shell (&lt;code&gt;Quote&lt;/code&gt;, &lt;code&gt;QuoteJoin&lt;/code&gt;), a word on one line for bash (&lt;code&gt;QuoteLine&lt;/code&gt;, ANSI-C quoting) and a shell variable&amp;rsquo;s names (&lt;code&gt;EnvName&lt;/code&gt;), with the standard library alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vmname&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the name of every machine devvm runs on a backend, &lt;code&gt;VM&lt;/code&gt;, which a field or a parameter holds instead of a string, and the parsers that make one where it&amp;rsquo;s read. &lt;code&gt;Parse&lt;/code&gt; reads a project VM&amp;rsquo;s name from an argument or a file name, and it also reads &lt;code&gt;vm.json&lt;/code&gt;&amp;rsquo;s name and runs in &lt;code&gt;project.Nth&lt;/code&gt;. &lt;code&gt;ParseListed&lt;/code&gt; reads one that a backend lists. &lt;code&gt;VM&lt;/code&gt;&amp;rsquo;s &lt;code&gt;UnmarshalText&lt;/code&gt; reads one in a JSON file, which may be any machine&amp;rsquo;s, so a field that must hold a project VM&amp;rsquo;s is still checked with &lt;code&gt;IsProject&lt;/code&gt;. &lt;code&gt;Image&lt;/code&gt; names an image&amp;rsquo;s machine, and &lt;code&gt;VM.Aside&lt;/code&gt; a remake&amp;rsquo;s old one. &lt;code&gt;msg.M.VM&lt;/code&gt; reads back the VM a message&amp;rsquo;s function took. It also holds a project VM&amp;rsquo;s name grammar (&lt;code&gt;Prefix&lt;/code&gt;, &lt;code&gt;HashLen&lt;/code&gt;, &lt;code&gt;IsVM&lt;/code&gt;, and &lt;code&gt;VM&lt;/code&gt;&amp;rsquo;s &lt;code&gt;IsProject&lt;/code&gt;, &lt;code&gt;Hash&lt;/code&gt;, &lt;code&gt;Slug&lt;/code&gt;, &lt;code&gt;Short&lt;/code&gt;, &lt;code&gt;ImageKey&lt;/code&gt; and a remake&amp;rsquo;s &lt;code&gt;Aside&lt;/code&gt;), with the standard library alone, so the proxy uses it too (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/project&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a project folder: its VM&amp;rsquo;s name, the hash that names its VM&amp;rsquo;s state folder (&lt;code&gt;project.Hash&lt;/code&gt;), its link targets, the folders that aren&amp;rsquo;t safe to use and its parents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/gitprotect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.git&lt;/code&gt; protection: one &lt;code&gt;scan&lt;/code&gt; for each check, a &lt;code&gt;Locker&lt;/code&gt; for each host, which is &lt;code&gt;Flags&lt;/code&gt; on macOS, &lt;code&gt;Binds&lt;/code&gt; on Linux, whose pins the start sets, or else &lt;code&gt;Watch&lt;/code&gt;, and the table of its reports. A nested repo is left to another only when that repo&amp;rsquo;s scan locks its git folder whole (&lt;code&gt;snapshot.covered&lt;/code&gt;). &lt;code&gt;gitprotect.Protector.Check&lt;/code&gt; is the check of a stopped VM, and for a VM that devvm 0.1.0 or 0.1.1-rc.1 made strict, the &lt;code&gt;converter&lt;/code&gt;&amp;rsquo;s &lt;code&gt;unstrict&lt;/code&gt; then takes &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; out of its repos&amp;rsquo; configs, on a context that an interrupt doesn&amp;rsquo;t cancel (&lt;code&gt;context.WithoutCancel&lt;/code&gt;), and &lt;code&gt;strictLeft&lt;/code&gt; does the same for &lt;code&gt;devvm git-protect on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt;, without the warning. &lt;code&gt;gitprotect.Keeps&lt;/code&gt; says whether another VM&amp;rsquo;s protection still covers a path. The configs it reads, the watch&amp;rsquo;s hashed files and git&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt;, &lt;code&gt;commondir&lt;/code&gt; and &lt;code&gt;gitdir&lt;/code&gt; files all go through &lt;code&gt;internal/safefile&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/"&gt;.git protection&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/hostsafety&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder&amp;rsquo;s other checks on the host: one &lt;code&gt;Walk&lt;/code&gt; once the VM is stopped, which skips &lt;code&gt;.git&lt;/code&gt; and finds set-id files and nested repos (&lt;code&gt;hostsafety.Walk&lt;/code&gt;, which only &lt;code&gt;starter.walk&lt;/code&gt; calls), git&amp;rsquo;s own test for a bare repo&amp;rsquo;s shape (&lt;code&gt;hostsafety.IsGitDir&lt;/code&gt;), doctor&amp;rsquo;s read of &lt;code&gt;safe.bareRepository&lt;/code&gt; (&lt;code&gt;hostsafety.BareExplicit&lt;/code&gt;), and an SSH origin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/hostgit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every git command devvm runs on the host, with no fsmonitor, hooks, filters or signing programs, ssh only, none of the environment&amp;rsquo;s &lt;code&gt;GIT_*&lt;/code&gt; variables and no prompts, and with &lt;code&gt;GIT_NO_REPLACE_OBJECTS=1&lt;/code&gt; and &lt;code&gt;GIT_GRAFT_FILE=/dev/null&lt;/code&gt;, so it sees a repo&amp;rsquo;s real history. &lt;code&gt;hostgit.UserConfig&lt;/code&gt; reads one key of git&amp;rsquo;s global and system config by the files&amp;rsquo; names, the files that &lt;code&gt;GIT_CONFIG_GLOBAL&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_SYSTEM&lt;/code&gt; name included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/sshconfig&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the ssh config that reaches running VMs by name, and its Include line in &lt;code&gt;~/.ssh/config&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/sshagent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each VM&amp;rsquo;s choice of SSH agent, devvm&amp;rsquo;s own agent and its keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;building and rebuilding images, and their records. &lt;code&gt;build.Names&lt;/code&gt; checks an image name&amp;rsquo;s layers and refuses a shared tool&amp;rsquo;s name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;image keys and names, with no side effects, and the shared tools&amp;rsquo; registry, &lt;code&gt;SharedTools&lt;/code&gt;: one entry for each toolchain, with its members, its detection, its installer, its guest environment, its &lt;code&gt;PATH&lt;/code&gt; folders and its version files (the structure test&amp;rsquo;s &lt;code&gt;names&lt;/code&gt;), and whether it&amp;rsquo;s built for glibc alone (&lt;code&gt;image.ToolDef.GlibcOnly&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/fetch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every HTTP client, with the standard library alone: &lt;code&gt;NewClient&lt;/code&gt;, with a timeout and &lt;code&gt;HTTPSOnly&lt;/code&gt; or &lt;code&gt;SameScheme&lt;/code&gt;, &lt;code&gt;Retry&lt;/code&gt; and &lt;code&gt;Transient&lt;/code&gt;, the failures callers tell apart (&lt;code&gt;Gone&lt;/code&gt;, &lt;code&gt;Untrusted&lt;/code&gt;, &lt;code&gt;BadCertificate&lt;/code&gt; and &lt;code&gt;Unverified&lt;/code&gt;), &lt;code&gt;ReadCapped&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt;, &lt;code&gt;Resolve&lt;/code&gt;, which finds where a HEAD&amp;rsquo;s redirects end, &lt;code&gt;Download&lt;/code&gt;, which checks the SHA-256 and caps the size, and &lt;code&gt;Resumable&lt;/code&gt;, a large download that goes on from where a cut or a stall stopped it, in this run or the next. &lt;code&gt;fetch.Client.Trust&lt;/code&gt; adds your CAs to a client&amp;rsquo;s roots, for the download of devvm&amp;rsquo;s own mise and an agent&amp;rsquo;s OAuth refresh&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm upgrade: how this devvm was installed (&lt;code&gt;Detect&lt;/code&gt;), the releases (&lt;code&gt;Source&lt;/code&gt;, with the newest, &lt;code&gt;Check&lt;/code&gt; for a notice, and &lt;code&gt;Fetch&lt;/code&gt;, which checks &lt;code&gt;SHA256SUMS&lt;/code&gt; with &lt;code&gt;checkSums&lt;/code&gt;, two of the three built-in release keys&amp;rsquo; signatures through &lt;code&gt;internal/minisign&lt;/code&gt;, or while releases bridge from it, the old release key&amp;rsquo;s in &lt;code&gt;legacy.go&lt;/code&gt;, then the SHA-256), the unpack, the link&amp;rsquo;s switch and its rollback, and Homebrew. &lt;code&gt;upgradetest/&lt;/code&gt;, for tests only, has a TLS release server and the release&amp;rsquo;s signers (&lt;code&gt;Signers&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every check of a signature of devvm&amp;rsquo;s own, with the standard library and &lt;code&gt;x/crypto&lt;/code&gt;&amp;rsquo;s &lt;code&gt;blake2b&lt;/code&gt; alone (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;): minisign&amp;rsquo;s keys and signatures (&lt;code&gt;ParsePublicKey&lt;/code&gt;, and &lt;code&gt;PublicKey.Check&lt;/code&gt;, which takes only the prehashed &lt;code&gt;ED&lt;/code&gt; signature and compares its trusted comment exactly), a key&amp;rsquo;s &lt;code&gt;Role&lt;/code&gt; (&lt;code&gt;CI&lt;/code&gt;, &lt;code&gt;Cosign&lt;/code&gt;, &lt;code&gt;Recovery&lt;/code&gt;) and the &lt;code&gt;Kind&lt;/code&gt; it signs (&lt;code&gt;Release&lt;/code&gt;, &lt;code&gt;Base&lt;/code&gt;), the names of each role&amp;rsquo;s signature and key files (&lt;code&gt;SigName&lt;/code&gt;, &lt;code&gt;KeyFile&lt;/code&gt;) and a kind&amp;rsquo;s trusted comment (&lt;code&gt;Kind.Comment&lt;/code&gt;), and &lt;code&gt;Keys&lt;/code&gt;, a kind&amp;rsquo;s three different keys, whose &lt;code&gt;Check&lt;/code&gt; accepts a manifest that two of them signed and whose &lt;code&gt;CheckRole&lt;/code&gt; checks one role&amp;rsquo;s signature. It also signs, for the co-signer: &lt;code&gt;SecretKey&lt;/code&gt;, a minisign secret key made with no password (&lt;code&gt;ParseSecretKey&lt;/code&gt;), whose &lt;code&gt;Sign&lt;/code&gt; writes the signature file minisign would. &lt;code&gt;minisigntest/&lt;/code&gt;, for tests only, signs as minisign does&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/cosign&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the co-signer, &lt;code&gt;devvm-cosign&lt;/code&gt;, a program of its own (&lt;code&gt;cmd/devvm-cosign&lt;/code&gt;), which imports the standard library, BurntSushi/toml and &lt;code&gt;internal/minisign&lt;/code&gt; alone, and which nothing of devvm&amp;rsquo;s imports (&lt;a href="https://next.devvm.dev/docs/contributing/cosigner/"&gt;The co-signer&lt;/a&gt;): its config (&lt;code&gt;LoadConfig&lt;/code&gt;, and &lt;code&gt;ReadConfig&lt;/code&gt; without the keys), a run (&lt;code&gt;Cosigner.Run&lt;/code&gt;) and the maintainer&amp;rsquo;s &lt;code&gt;retry&lt;/code&gt; and &lt;code&gt;ack&lt;/code&gt; (&lt;code&gt;Cosigner.Clear&lt;/code&gt;), CI&amp;rsquo;s artifacts, unzipped into its stage (&lt;code&gt;unzip&lt;/code&gt;), the rebuild (&lt;code&gt;ReleaseBuild&lt;/code&gt;, and &lt;code&gt;BaseBuilder&lt;/code&gt; for bases), the tap&amp;rsquo;s formulas, rendered from the signed &lt;code&gt;SHA256SUMS&lt;/code&gt; (&lt;code&gt;renderFormula&lt;/code&gt;), the SSH tag check (&lt;code&gt;VerifyTag&lt;/code&gt;), &lt;code&gt;state.json&lt;/code&gt; (&lt;code&gt;Store&lt;/code&gt;), the GitHub client (&lt;code&gt;Client&lt;/code&gt;, with the Actions API&amp;rsquo;s runs and artifacts) and the app&amp;rsquo;s token (&lt;code&gt;AppToken&lt;/code&gt;); &lt;code&gt;doc.go&lt;/code&gt; maps its files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--from&lt;/code&gt;: references, registry digests with an anonymous token, Docker&amp;rsquo;s IDs and the recorded digests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/redact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;passwords out of logs, with the standard library alone, and &lt;code&gt;Secret&lt;/code&gt;, the type of the values that let whoever holds them act as you or as a VM (&lt;a href="#secrets-in-the-code"&gt;Secrets in the code&lt;/a&gt;). &lt;code&gt;String&lt;/code&gt; redacts the run log&amp;rsquo;s lines, taking out proxy keys and URL passwords. &lt;code&gt;In&lt;/code&gt; redacts another program&amp;rsquo;s log as it grows, in place and keeping its length. It reads a line not yet ended again from its start when the line is within &lt;code&gt;MatchMax&lt;/code&gt; of what an earlier look read, and otherwise from &lt;code&gt;MatchMax&lt;/code&gt; back, starring what runs on to an &lt;code&gt;@&lt;/code&gt; there, and &lt;code&gt;Look.Cut&lt;/code&gt; does the same after a rotation&amp;rsquo;s cut. &lt;code&gt;Unended&lt;/code&gt; redacts a copy&amp;rsquo;s cut end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vmlog&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every log a VM can drive, except the proxy&amp;rsquo;s own. &lt;code&gt;Limit&lt;/code&gt; is the rate and length of what a VM makes devvm&amp;rsquo;s background processes write. The port forwarder and the link session write through it, and the link session&amp;rsquo;s warnings take their turns from its &lt;code&gt;Allow&lt;/code&gt;. &lt;code&gt;Capped&lt;/code&gt; is a background process&amp;rsquo;s log, held to its cap as it appends, with &lt;code&gt;Trim&lt;/code&gt; at its next start. &lt;code&gt;KeepVM&lt;/code&gt; is what the VM&amp;rsquo;s proxy (through &lt;code&gt;proxy.IO.KeepLogs&lt;/code&gt;) and a build run on the logs the backend writes as the VM runs (&lt;code&gt;backend.Run.Logs&lt;/code&gt;), the serial consoles&amp;rsquo; among them. It watches each log in a goroutine of its own, redacts what each one gained every second (&lt;code&gt;redact.In&lt;/code&gt;), so a reboot in place can&amp;rsquo;t leave the proxy&amp;rsquo;s password there, and skips a log that hasn&amp;rsquo;t grown. &lt;code&gt;Redact&lt;/code&gt; is Lima&amp;rsquo;s redaction at the end of a start. Each rotation copies the log&amp;rsquo;s end to its &lt;code&gt;.1&lt;/code&gt; file, redacting only what the last look didn&amp;rsquo;t reach and masking a secret cut at its end, and empties it with &lt;code&gt;f.Truncate&lt;/code&gt;, counting a log by what it holds past the hole its writer left, as Lima&amp;rsquo;s programs write at their own offset. Every log is opened through &lt;code&gt;safefile&lt;/code&gt; (&lt;code&gt;Opts.Write&lt;/code&gt;), never through a link or waiting on a FIFO. The proxy, which imports only the standard library and a few of devvm&amp;rsquo;s leaves, rotates its own logs itself (&lt;code&gt;proxy.rotating&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/safefile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every read of a file a VM can write or swap, with the standard library alone, so the proxy uses it too (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;). It refuses a file that isn&amp;rsquo;t regular with &lt;code&gt;safefile.ErrNotRegular&lt;/code&gt; and one past its cap with &lt;code&gt;safefile.ErrTooLong&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/landlock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the proxy&amp;rsquo;s child&amp;rsquo;s confinement on Linux, with the standard library alone, behind its own build tags: &lt;code&gt;Self&lt;/code&gt;, which confines every thread of the process to its folders with &lt;code&gt;no_new_privs&lt;/code&gt;, Landlock and the hand-written seccomp filter (&lt;code&gt;filter&lt;/code&gt;), checks that it holds, and returns what it got (&lt;code&gt;Result&lt;/code&gt;), which the proxy&amp;rsquo;s &lt;code&gt;confineSelf&lt;/code&gt; turns into its line in &lt;code&gt;run/proxy.confined&lt;/code&gt; (&lt;code&gt;proxy.Confinement&lt;/code&gt;) (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;). It makes each call on every thread through &lt;code&gt;syscall.AllThreadsSyscall&lt;/code&gt;, which works only without cgo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/devcontainer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a project&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt;, with no side effects: finding it, mapping it to a new VM&amp;rsquo;s plan, its refusals, and what devvm update&amp;rsquo;s second reading replaces (&lt;code&gt;Reread&lt;/code&gt;): &lt;code&gt;devcontainer.Reread&lt;/code&gt; drops the parts the file gave that it no longer calls for and adds the ones it now calls for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/jsonc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;JSON with comments (&lt;code&gt;jsonc.Strip&lt;/code&gt;), with the standard library alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/tools&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the shared tools: the lock, mise on the host, the daily check, the tool images&amp;rsquo; builds and the share. &lt;code&gt;Share.Build&lt;/code&gt; builds a VM&amp;rsquo;s tool images under the making lock, which &lt;code&gt;tools.Making&lt;/code&gt; holds, and &lt;code&gt;tools.HasBuilds&lt;/code&gt; refuses a glibc-only tool, such as pi, for a musl VM. &lt;code&gt;ShareBusy&lt;/code&gt; says whether another devvm holds the share&amp;rsquo;s lock, so retention skips the tool images that day. &lt;code&gt;Share.NoVM&lt;/code&gt; lists the current tool images that no VM&amp;rsquo;s state lists, and &lt;code&gt;Versions.StaleMise&lt;/code&gt; the folders of mise&amp;rsquo;s other versions, which gc deletes. &lt;code&gt;withSDKDownloads&lt;/code&gt; in &lt;code&gt;internal/tools/dotnet.go&lt;/code&gt; adds each platform&amp;rsquo;s dotnet SDK archive to the lock (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/netpolicy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;network policy: the choice of tier, learning the hosts a VM reached, &lt;code&gt;RiskOf&lt;/code&gt;, the VM&amp;rsquo;s proxy and the self-check. &lt;code&gt;netpolicy.Policies&lt;/code&gt; lists a VM&amp;rsquo;s policies for its tier, the built-in ones and yours, and &lt;code&gt;netpolicy.PolicyWarnings&lt;/code&gt; warns of the lines that aren&amp;rsquo;t rules. &lt;code&gt;netpolicy.Proxy.Prepare&lt;/code&gt; readies a VM&amp;rsquo;s proxy at each launch, its policy warnings and the CA bundle included, &lt;code&gt;netpolicy.Proxy.PrepareRunning&lt;/code&gt; checks what could refuse a running VM&amp;rsquo;s new proxy before the old one stops, and &lt;code&gt;netpolicy.Proxy.Refusal&lt;/code&gt; runs the company proxy&amp;rsquo;s check with the check of your CAs. The event log&amp;rsquo;s readers are &lt;code&gt;netpolicy.Log.Blocks&lt;/code&gt;, which gives a quiet block no &lt;code&gt;Allow&lt;/code&gt;, &lt;code&gt;netpolicy.Log.Learned&lt;/code&gt;, with &lt;code&gt;Learned.NoProxy&lt;/code&gt; for the hosts that only transparent mode reached and &lt;code&gt;agentWord&lt;/code&gt; for a &lt;code&gt;User-Agent&lt;/code&gt;&amp;rsquo;s first word, &lt;code&gt;Log.Countable&lt;/code&gt; and &lt;code&gt;netpolicy.Log.MarkLearning&lt;/code&gt;. &lt;code&gt;netpolicy.Judge.Quiet&lt;/code&gt; keeps quiet hosts out of what devvm network lock offers, &lt;code&gt;netpolicy.Tickable&lt;/code&gt;, with its list &lt;code&gt;tickable&lt;/code&gt;, and &lt;code&gt;netpolicy.RiskOf&lt;/code&gt; mark the hosts it offers, and &lt;code&gt;quietMark&lt;/code&gt; and &lt;code&gt;RuleFile.Quiet&lt;/code&gt; show the quiet lines in devvm network (&lt;a href="https://next.devvm.dev/docs/internals/network/"&gt;network policy&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/secrets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;tokens on the host and the VM&amp;rsquo;s bindings to them, and your own secrets (&lt;code&gt;custom.go&lt;/code&gt;, with their checks, &lt;code&gt;Yours&lt;/code&gt; and &lt;code&gt;custom-secrets.json&lt;/code&gt;). &lt;code&gt;secrets.BoundSecret&lt;/code&gt; records in a VM&amp;rsquo;s state the definition and hosts a secret of yours was bound with, and the store&amp;rsquo;s lookup (&lt;code&gt;Store.Get&lt;/code&gt;, &lt;code&gt;secrets.Store.Get&lt;/code&gt;) checks every binding against that record. &lt;code&gt;secrets.Store.Save&lt;/code&gt; saves a secret, &lt;code&gt;secrets.ClaudeOf(store).Login&lt;/code&gt; picks the one Claude Code login devvm keeps, and &lt;code&gt;secrets.ClaudeOf(store).Sums&lt;/code&gt; gives that login&amp;rsquo;s checksums&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/trust&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;your CAs in &lt;code&gt;~/.config/devvm/ca&lt;/code&gt;, read and checked, sent to VMs, the build VMs&amp;rsquo; &lt;code&gt;Trust&lt;/code&gt; scripts and the guest environment, and each VM&amp;rsquo;s own CA and its next one (&lt;code&gt;InitCA&lt;/code&gt;, in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt;). &lt;code&gt;trust.Env&lt;/code&gt; holds the CAs&amp;rsquo; variables that a build&amp;rsquo;s scripts and every project VM start with. &lt;code&gt;trust.Read&lt;/code&gt; reads your CA folder, looking at each file with &lt;code&gt;os.Lstat&lt;/code&gt; and following no link, &lt;code&gt;trust.CAs.Host&lt;/code&gt; writes the bundle for the host&amp;rsquo;s mise on Linux, and &lt;code&gt;trust.InitCA&lt;/code&gt; readies each VM&amp;rsquo;s CA and its next one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/agents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the coding agents&amp;rsquo; registry, with the standard library alone: one &lt;code&gt;Def&lt;/code&gt; for each agent, with its shared tool, settings, logins, history, guest environment, ways to log in and &lt;code&gt;[pass-keys]&lt;/code&gt;, which every list of the agents comes from. Code about one agent names it by its constant (the structure test&amp;rsquo;s &lt;code&gt;names&lt;/code&gt;). &lt;code&gt;agents.Def&lt;/code&gt;&amp;rsquo;s &lt;code&gt;PassKeys&lt;/code&gt; says whether an agent&amp;rsquo;s keys are withheld by default, and &lt;code&gt;agents.Providers&lt;/code&gt; lists the providers whose keys the proxy puts in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/agentlogin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;agents&amp;rsquo; login and settings files on the host: the VM&amp;rsquo;s copies with placeholders, the bindings, the values and the OAuth refresh (&lt;code&gt;File&lt;/code&gt;, with a &lt;code&gt;format&lt;/code&gt; for each kind of login), the shape of every placeholder (&lt;code&gt;Placeholder&lt;/code&gt;), &lt;code&gt;Redact&lt;/code&gt;, and &lt;code&gt;Restore&lt;/code&gt;, which puts the store&amp;rsquo;s values back for a VM&amp;rsquo;s placeholders. The package &lt;code&gt;agentlogin&lt;/code&gt; saves a captured login (&lt;code&gt;agentlogin.File.Capture&lt;/code&gt;), refreshes and reads one (&lt;code&gt;agentlogin.File.Get&lt;/code&gt;) and makes the VM&amp;rsquo;s copy (&lt;code&gt;agentlogin.File.VMCopy&lt;/code&gt;), whose &lt;code&gt;VMFile&lt;/code&gt; reports &lt;code&gt;PassBound&lt;/code&gt;, the bound providers that &lt;code&gt;[pass-keys]&lt;/code&gt; lists. &lt;code&gt;agentlogin.Pick&lt;/code&gt; tells whose login a request is by its &lt;code&gt;User-Agent&lt;/code&gt;, &lt;code&gt;agentlogin.Endpoints&lt;/code&gt; lists every format&amp;rsquo;s endpoints, &lt;code&gt;agentlogin.SetupToken&lt;/code&gt; recognises claude setup-token&amp;rsquo;s request, &lt;code&gt;agentlogin.ClaudeOAuthBindings&lt;/code&gt; makes the Claude login&amp;rsquo;s bindings, &lt;code&gt;agentlogin.OpencodeImport&lt;/code&gt; makes opencode&amp;rsquo;s import entries, and &lt;code&gt;agentlogin.PiSettings&lt;/code&gt; drops the pi settings that would undo devvm&amp;rsquo;s. The formats&amp;rsquo; field lists are &lt;code&gt;codexKeep&lt;/code&gt;, &lt;code&gt;claudeAccountKeep&lt;/code&gt; and &lt;code&gt;cursorFormat&lt;/code&gt;, &lt;code&gt;internal/agentlogin/logins.go&lt;/code&gt; holds &lt;code&gt;opencodeVM&lt;/code&gt; and &lt;code&gt;withheldEntry&lt;/code&gt;, and &lt;code&gt;internal/agentlogin/pi.go&lt;/code&gt; holds pi&amp;rsquo;s format (&lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;agents&amp;rsquo; logins and settings&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the proxy, as its &lt;code&gt;README.md&lt;/code&gt; describes. It runs as two processes, its broker, &lt;code&gt;devvm _proxy&lt;/code&gt; (&lt;code&gt;broker.go&lt;/code&gt;, &lt;code&gt;process.go&lt;/code&gt;), and its child, &lt;code&gt;devvm _proxy-child&lt;/code&gt; (&lt;code&gt;child.go&lt;/code&gt;), which talk over a socketpair in the broker&amp;rsquo;s protocol (&lt;code&gt;wire.go&lt;/code&gt;). The package also holds the relay of a VM&amp;rsquo;s SSH agent on &lt;code&gt;paths.Dirs.AgentRelay&lt;/code&gt; (&lt;code&gt;Config.Agent&lt;/code&gt;, &lt;code&gt;agent.go&lt;/code&gt;), which is the only socket of an agent that a VM&amp;rsquo;s backend forwards. And it holds the one form of a host that every package judges and compares hosts in (&lt;code&gt;Host&lt;/code&gt;, &lt;code&gt;NormHost&lt;/code&gt;, &lt;code&gt;HostOK&lt;/code&gt;), which the structure test holds every package to (&lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;). The desktop&amp;rsquo;s local proxy listens in the VM at &lt;code&gt;proxy.LocalProxyAddr&lt;/code&gt; and &lt;code&gt;proxy.LocalProxyPort&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;the local proxy&lt;/a&gt;). The package &lt;code&gt;proxy&lt;/code&gt; reads policies in &lt;code&gt;policy.go&lt;/code&gt;: &lt;code&gt;proxy.ParsePolicy&lt;/code&gt; is the one parser of every policy file, which returns each line with its number and whether it&amp;rsquo;s a rule, &lt;code&gt;proxy.ValidRule&lt;/code&gt; decides what&amp;rsquo;s a rule, &lt;code&gt;proxy.BrokenDeny&lt;/code&gt; marks a broken &lt;code&gt;!&lt;/code&gt; line, and &lt;code&gt;proxy.ReadPolicy&lt;/code&gt; reads a file through &lt;code&gt;internal/safefile&lt;/code&gt;. &lt;code&gt;readBuiltins&lt;/code&gt; keeps a built-in policy&amp;rsquo;s &lt;code&gt;quiet&lt;/code&gt; lines (&lt;code&gt;PolicyLine.Quiet&lt;/code&gt;), and &lt;code&gt;loadPolicy&lt;/code&gt; drops any other file&amp;rsquo;s. &lt;code&gt;proxy.NarrowRule&lt;/code&gt; writes a rule by method and path in its canonical form, in &lt;code&gt;proxy.Methods&lt;/code&gt;&amp;rsquo; order, and &lt;code&gt;proxy.ExactRule&lt;/code&gt; the exact rule for one host and port. &lt;code&gt;proxy.ReadAllowlist&lt;/code&gt; reads the allowlist tier&amp;rsquo;s policies, whose &lt;code&gt;Allowlist.Allows&lt;/code&gt;, &lt;code&gt;Allowlist.Denies&lt;/code&gt; and &lt;code&gt;Allowlist.Quiet&lt;/code&gt; are the proxy&amp;rsquo;s own decisions. A decision reads the rules that cover a host and port in one read (&lt;code&gt;policy.rulesFor&lt;/code&gt;, a &lt;code&gt;hostRules&lt;/code&gt;), &lt;code&gt;policy.all&lt;/code&gt; leaves the quiet rules out and &lt;code&gt;policy.quiet&lt;/code&gt; matches them. &lt;code&gt;hostRules.byRequest&lt;/code&gt; says when requests are judged one by one, by &lt;code&gt;policy.judge&lt;/code&gt;, and &lt;code&gt;hostRules.unjudgeable&lt;/code&gt; covers a request that names a method outside &lt;code&gt;proxy.Methods&lt;/code&gt;. &lt;code&gt;request.go&lt;/code&gt; judges each request in an intercepted tunnel (&lt;code&gt;server.judgeRequest&lt;/code&gt;) with the one matcher of rules and bindings, &lt;code&gt;proxy.match&lt;/code&gt;, which uses &lt;code&gt;plainPath&lt;/code&gt;, &lt;code&gt;proxy.PathOK&lt;/code&gt; and &lt;code&gt;matchPath&lt;/code&gt; for paths and patterns, &lt;code&gt;overrides&lt;/code&gt; and &lt;code&gt;overrideLike&lt;/code&gt; for the methods a request names, and &lt;code&gt;match.allows&lt;/code&gt;, &lt;code&gt;match.denies&lt;/code&gt; and &lt;code&gt;trimDots&lt;/code&gt;, and Go&amp;rsquo;s &lt;code&gt;url.ParseQuery&lt;/code&gt;, whose &lt;code&gt;ParseQuery&lt;/code&gt; reads a query differently from some servers (&lt;a href="https://next.devvm.dev/docs/internals/network/#requests-by-method-and-path"&gt;requests by method and path&lt;/a&gt;). In &lt;code&gt;proxy.go&lt;/code&gt;, &lt;code&gt;server.blocked&lt;/code&gt; marks a block&amp;rsquo;s event &lt;code&gt;Quiet&lt;/code&gt; only for the reason &lt;code&gt;notAllowed&lt;/code&gt;, &lt;code&gt;blockPage&lt;/code&gt; writes the block page, and &lt;code&gt;proxy.Public&lt;/code&gt; is the one judge of a public address. &lt;code&gt;secrets.go&lt;/code&gt; holds the bindings file (&lt;code&gt;proxy.BindingList.Encode&lt;/code&gt;), how a &lt;code&gt;secret&lt;/code&gt; binding&amp;rsquo;s value goes in (&lt;code&gt;Binding.secretValue&lt;/code&gt;) and a &lt;code&gt;login&lt;/code&gt; binding&amp;rsquo;s (&lt;code&gt;Binding.takes&lt;/code&gt;), and the refusals &lt;code&gt;githubMinting&lt;/code&gt; and &lt;code&gt;cursorMints&lt;/code&gt;. &lt;code&gt;cursor.go&lt;/code&gt; holds Cursor&amp;rsquo;s routes and refusals (&lt;code&gt;cursorRoutes&lt;/code&gt;, &lt;code&gt;cursorPersists&lt;/code&gt;, &lt;code&gt;cursorStore&lt;/code&gt;, &lt;code&gt;cursorChanges&lt;/code&gt;) and the reply scanners (&lt;code&gt;frameScanner&lt;/code&gt;, &lt;code&gt;jwtScanner&lt;/code&gt;). &lt;code&gt;upstream.go&lt;/code&gt; holds the route to a company proxy (&lt;code&gt;proxy.Upstream.WithPassword&lt;/code&gt;, &lt;code&gt;proxy.Upstream.Route&lt;/code&gt;), which a lookup&amp;rsquo;s context carries with &lt;code&gt;proxy.WithRoute&lt;/code&gt; and gives back with &lt;code&gt;proxy.RouteOf&lt;/code&gt;, and the CAs a lookup trusts (&lt;code&gt;proxy.WithRoots&lt;/code&gt;, &lt;code&gt;proxy.RootsOf&lt;/code&gt;). The config is &lt;code&gt;proxy.Config&lt;/code&gt;, and &lt;code&gt;proxy.Config.Sum&lt;/code&gt; tells devvm whether a running proxy must start again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/seatbelt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;macOS&amp;rsquo;s sandbox as devvm uses it: &lt;code&gt;sandbox-exec&lt;/code&gt;&amp;rsquo;s path (&lt;code&gt;Exec&lt;/code&gt;), a Seatbelt string and a real path in a profile (&lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Path&lt;/code&gt;), the links a sandboxed lookup goes through (&lt;code&gt;Links&lt;/code&gt;), and the profile of a VM&amp;rsquo;s proxy&amp;rsquo;s child (&lt;code&gt;ChildProfile&lt;/code&gt;), which &lt;code&gt;Sandbox.ProxyChild&lt;/code&gt; gives the broker through &lt;code&gt;proxy.IO.Seatbelt&lt;/code&gt;, because the proxy imports the standard library alone. Lima&amp;rsquo;s profile for its hostagent (&lt;code&gt;lima/seatbelt.go&lt;/code&gt;) is written with the same strings and paths. How the child is confined, its report in &lt;code&gt;run/proxy.confined&lt;/code&gt; (&lt;code&gt;proxy.Confinement&lt;/code&gt;), the check that it holds (&lt;code&gt;checkConfined&lt;/code&gt;) and the hook where a platform confines the child in the process (&lt;code&gt;confineSelf&lt;/code&gt;) are &lt;code&gt;internal/proxy&lt;/code&gt;&amp;rsquo;s &lt;code&gt;confine.go&lt;/code&gt;, which every platform&amp;rsquo;s confinement shares&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/daemon&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s background processes, with the standard library alone: detached starts in a session of their own (&lt;code&gt;daemon.Detach&lt;/code&gt;), pid files checked against the process&amp;rsquo;s arguments before any signal (&lt;code&gt;daemon.Proc&lt;/code&gt;), stopping with TERM and then KILL, each sent to the process&amp;rsquo;s group (&lt;code&gt;daemon.SignalGroup&lt;/code&gt;), readiness by a status file, the lifeline, and an accept loop&amp;rsquo;s wait after an error that leaves its listener open (&lt;code&gt;AcceptRetry&lt;/code&gt;), which the port forwarder, the link session, a login&amp;rsquo;s forward, the proxy&amp;rsquo;s SSH agent relay and the desktop relay share. It&amp;rsquo;s the only place that signals a process by its pid. &lt;a href="https://next.devvm.dev/docs/internals/processes/"&gt;Processes&lt;/a&gt; has what each of those processes holds, reads, writes and is confined by&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/desktop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm desktop&amp;rsquo;s relay on the host, which checks VNC&amp;rsquo;s password, then opens an ssh channel to the VM&amp;rsquo;s socket and drops the viewer&amp;rsquo;s clipboard, and the desktop&amp;rsquo;s passwords&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/backend&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Backend&lt;/code&gt; and its roles, &lt;code&gt;Caps&lt;/code&gt;, &lt;code&gt;Require&lt;/code&gt;, &lt;code&gt;Check&lt;/code&gt;, the registry and its guard (&lt;code&gt;As&lt;/code&gt;), as &lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt; describes. Below it are &lt;code&gt;backendtest/&lt;/code&gt;, the fake, &lt;code&gt;registry/&lt;/code&gt;, which holds every backend, and &lt;code&gt;lima/&lt;/code&gt;, whose &lt;code&gt;pins.go&lt;/code&gt; has QEMU&amp;rsquo;s user and mount namespace on Linux, its pins, their events and the probe, while &lt;code&gt;platform&lt;/code&gt;&amp;rsquo;s &lt;code&gt;pinrun_linux.go&lt;/code&gt; is the namespace&amp;rsquo;s side. A build&amp;rsquo;s &lt;code&gt;ImageSpec.Trust&lt;/code&gt;, a &lt;code&gt;Trust&lt;/code&gt;, holds the &lt;code&gt;Add&lt;/code&gt; and &lt;code&gt;Remove&lt;/code&gt; scripts made from &lt;code&gt;ca.sh&lt;/code&gt; and the &lt;code&gt;Env&lt;/code&gt; each script gets, and a tools build runs &lt;code&gt;ToolsSpec.Trust.Add&lt;/code&gt; alone. A backend runs &lt;code&gt;Add&lt;/code&gt; before anything downloads and &lt;code&gt;Remove&lt;/code&gt; once the scripts are done: Lima runs &lt;code&gt;Add&lt;/code&gt; right after the start and &lt;code&gt;Remove&lt;/code&gt; before the final sync, and a tools build needs no &lt;code&gt;Remove&lt;/code&gt;. &lt;code&gt;backend.NetProxy&lt;/code&gt; confines a VM to its proxy and &lt;code&gt;backend.NetDirect&lt;/code&gt; puts it on its backend&amp;rsquo;s own network, &lt;code&gt;Confinement.GuestProxy&lt;/code&gt; says whether the guest&amp;rsquo;s proxy settings name devvm&amp;rsquo;s proxy, and Lima&amp;rsquo;s clone sets the VM&amp;rsquo;s environment from &lt;code&gt;VMSpec.Env&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;a company&amp;rsquo;s CA in builds&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s own use of a VM&amp;rsquo;s ssh, on every backend. &lt;code&gt;Checked&lt;/code&gt; is the one way to a VM&amp;rsquo;s ssh (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#how-a-backend-plugs-in"&gt;how a backend plugs in&lt;/a&gt;), and &lt;code&gt;Forwards&lt;/code&gt; is the port forwarder&amp;rsquo;s one owner, which locks, stops and starts it with its ports from &lt;code&gt;vm.json&lt;/code&gt;. The package also holds a login&amp;rsquo;s forward of this machine&amp;rsquo;s loopback ports, in devvm&amp;rsquo;s own process (&lt;code&gt;ForwardLoopback&lt;/code&gt;), the links&amp;rsquo; sessions, and each VM&amp;rsquo;s one record of its host keys for each start (&lt;code&gt;PinHostKeys&lt;/code&gt;, in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/known_hosts&lt;/code&gt;), which every ssh of devvm&amp;rsquo;s checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the only package that prints: &lt;code&gt;ui.UI&lt;/code&gt;, with messages, prompts, the status line, the run log and the cleanups, and &lt;code&gt;ui.Main&lt;/code&gt;, which handles signals. It has no package state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/msg&lt;/code&gt;, &lt;code&gt;locales&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;messages: &lt;code&gt;en.toml&lt;/code&gt;, the generated functions, the doc links (&lt;code&gt;docs.go&lt;/code&gt;), the generator (&lt;code&gt;gen/&lt;/code&gt;), &lt;code&gt;Reporter&lt;/code&gt; and &lt;code&gt;Question&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#messages"&gt;messages&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/ports&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s ports section, with the forwards asked for and the host ports chosen, and the one allocator of host ports, under the claims lock, which puts VMs&amp;rsquo; ssh only on the ports browsers refuse (&lt;code&gt;SSHPorts&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/paths&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every folder and file devvm uses, a VM&amp;rsquo;s in its folder (&lt;code&gt;Dirs.VM&lt;/code&gt;, and a project VM&amp;rsquo;s folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, from &lt;code&gt;Dirs.VMDir&lt;/code&gt;), and host paths resolved and compared (&lt;code&gt;Physical&lt;/code&gt;, &lt;code&gt;PhysicalParent&lt;/code&gt;, &lt;code&gt;Within&lt;/code&gt;, &lt;code&gt;Below&lt;/code&gt;, &lt;code&gt;In&lt;/code&gt; and &lt;code&gt;Under&lt;/code&gt;, where &lt;code&gt;resolve.go&lt;/code&gt; says which one is for what). Among the locks, &lt;code&gt;paths.Dirs.GitLock&lt;/code&gt; is the host&amp;rsquo;s lock of &lt;code&gt;.git&lt;/code&gt; protection, taken before any VM&amp;rsquo;s own, and &lt;code&gt;Dirs.MakingLock&lt;/code&gt; is the tool images&amp;rsquo; making lock&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a VM&amp;rsquo;s state, &lt;code&gt;vm.json&lt;/code&gt;, with its core fields and one section for each package, which changes only in &lt;code&gt;VM.Update&lt;/code&gt; under the VM&amp;rsquo;s lock. It also owns the layout version (&lt;code&gt;CheckLayout&lt;/code&gt; and &lt;code&gt;migrations&lt;/code&gt;, while &lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; lists every file), every file written whole (&lt;code&gt;WriteFile&lt;/code&gt;, &lt;code&gt;WriteFileMode&lt;/code&gt;) and private folders (&lt;code&gt;PrivateDir&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/settings&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the defaults (&lt;code&gt;Defaults&lt;/code&gt;, &lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Save&lt;/code&gt;), with your &lt;code&gt;config.toml&lt;/code&gt;, read strictly, over devvm&amp;rsquo;s &lt;code&gt;settings.json&lt;/code&gt;, and each value&amp;rsquo;s check (&lt;code&gt;ParsePorts&lt;/code&gt;, &lt;code&gt;ParseCPUs&lt;/code&gt;, &lt;code&gt;ParseGiB&lt;/code&gt; and the retention settings). &lt;code&gt;settings.CompanyProxy.Upstream&lt;/code&gt; checks the company proxy&amp;rsquo;s settings and its password, &lt;code&gt;settings.CompanyProxy.Route&lt;/code&gt; is the route devvm&amp;rsquo;s own clients take through it, and &lt;code&gt;settings.PassKeys&lt;/code&gt; is &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/platform&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the code for each system, behind build tags, such as &lt;code&gt;platform.SameFolder&lt;/code&gt;, which tells whether a project folder whose device number changed after a restart is still the VM&amp;rsquo;s (&lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;an existing VM&lt;/a&gt;), and &lt;code&gt;platform.FoldsCase&lt;/code&gt;, whether the system&amp;rsquo;s file systems fold case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/ubuntu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;finding Ubuntu&amp;rsquo;s cloud image and verifying it, and its download (&lt;code&gt;ubuntu.Download&lt;/code&gt;, a &lt;code&gt;fetch.Resumable&lt;/code&gt;), which the backend calls, the release pocket&amp;rsquo;s date (&lt;code&gt;ubuntu.Released&lt;/code&gt;), and versions ordered as &lt;code&gt;dpkg --compare-versions&lt;/code&gt; orders them (&lt;code&gt;ubuntu.CompareVersions&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/testbuild&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;whether this is a test build, which ldflags set: only a test build reads the test overrides (&lt;code&gt;cli&lt;/code&gt;&amp;rsquo;s &lt;code&gt;readOverrides&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;assets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the files devvm ships, embedded as &lt;code&gt;assets.FS&lt;/code&gt;, which &lt;code&gt;cli&lt;/code&gt; passes to constructors. &lt;code&gt;base.yaml&lt;/code&gt; is base&amp;rsquo;s Lima template, and &lt;code&gt;prelude.sh&lt;/code&gt;, with &lt;code&gt;$devvm_arch&lt;/code&gt;, &lt;code&gt;$devvm_libc&lt;/code&gt; and &lt;code&gt;devvm_sha&lt;/code&gt;, comes first in each build script run with bash, the user&amp;rsquo;s layers included, and is put in place of a script&amp;rsquo;s &lt;code&gt;#!&lt;/code&gt; line, as one &lt;code&gt;eval&lt;/code&gt; line quoted by &lt;code&gt;shell.QuoteLine&lt;/code&gt;, by &lt;code&gt;image.WithPrelude&lt;/code&gt;, which &lt;code&gt;image.OwnScript&lt;/code&gt; calls for devvm&amp;rsquo;s own. &lt;code&gt;layers/&lt;/code&gt; holds base&amp;rsquo;s scripts, its policy and Ubuntu&amp;rsquo;s signing keys, and the built-in layers, &lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt; and &lt;code&gt;nix&lt;/code&gt;, each with its policy. &lt;code&gt;network/&lt;/code&gt; holds the network tiers&amp;rsquo; own policies, &lt;code&gt;features/&lt;/code&gt; base&amp;rsquo;s optional features, and &lt;code&gt;shared-tools/&lt;/code&gt; its &lt;code&gt;mise.toml&lt;/code&gt;, &lt;code&gt;build.sh&lt;/code&gt; and &lt;code&gt;*.policy&lt;/code&gt; files. &lt;code&gt;guest/&lt;/code&gt; holds the scripts in the VM that every launch sends, and the port forwarder&amp;rsquo;s &lt;code&gt;ports.sh&lt;/code&gt;, and &lt;code&gt;oci/&lt;/code&gt; is &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion, as its &lt;code&gt;README.md&lt;/code&gt; describes. So the How it works pages&amp;rsquo; scripts are, in the repo, &lt;code&gt;assets/base.yaml&lt;/code&gt;, &lt;code&gt;assets/prelude.sh&lt;/code&gt;, &lt;code&gt;assets/layers/apt.sh&lt;/code&gt;, whose first step is &lt;code&gt;assets/layers/apt.sh begin&lt;/code&gt;, &lt;code&gt;assets/layers/base.sh&lt;/code&gt;, &lt;code&gt;assets/layers/&amp;lt;name&amp;gt;.sh&lt;/code&gt; for each built-in layer, which are &lt;code&gt;assets/layers/desktop.sh&lt;/code&gt;, &lt;code&gt;assets/layers/docker.sh&lt;/code&gt; and &lt;code&gt;assets/layers/nix.sh&lt;/code&gt;, with &lt;code&gt;assets/layers/desktop.policy&lt;/code&gt;, &lt;code&gt;assets/layers/docker.policy&lt;/code&gt; and &lt;code&gt;assets/layers/nix.policy&lt;/code&gt;, Ubuntu&amp;rsquo;s keys, &lt;code&gt;assets/layers/ubuntu-cloud.gpg&lt;/code&gt; and &lt;code&gt;assets/layers/ubuntu-archive.gpg&lt;/code&gt;, base&amp;rsquo;s features, &lt;code&gt;assets/features/&amp;lt;name&amp;gt;.sh&lt;/code&gt;, the shared tools&amp;rsquo; &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; and &lt;code&gt;assets/shared-tools/build.sh&lt;/code&gt;, the conversion&amp;rsquo;s &lt;code&gt;assets/oci/build.sh&lt;/code&gt; and &lt;code&gt;assets/oci/bootify.sh&lt;/code&gt;, and the CA script, &lt;code&gt;assets/guest/ca.sh&lt;/code&gt;, which &lt;code&gt;assets/guest/ca.sh DIR&lt;/code&gt; runs to install the CAs in a VM. The built-in policies are paths in &lt;code&gt;assets/&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/images/"&gt;images&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/structure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="#the-structure-test"&gt;structure test&lt;/a&gt;, for tests only, and &lt;code&gt;owners_doc_test.go&lt;/code&gt;, which writes &lt;a href="#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/stubtest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the test &lt;a href="https://next.devvm.dev/docs/contributing/tests/#stubs"&gt;stubs&lt;/a&gt;, for tests only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/leaktest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#goroutine-leaks"&gt;goroutine leak checks&lt;/a&gt;, &lt;code&gt;Main&lt;/code&gt; for a package&amp;rsquo;s &lt;code&gt;TestMain&lt;/code&gt; and &lt;code&gt;Check&lt;/code&gt; for one test, for tests only, and the standard library only, so the proxy&amp;rsquo;s tests use it too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;internal/memnet&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the network in memory for &lt;a href="https://next.devvm.dev/docs/contributing/tests/#time-and-lifecycles"&gt;tests in a synctest bubble&lt;/a&gt;: connections (&lt;code&gt;Pipe&lt;/code&gt;) that close their writing side alone, hold a buffer&amp;rsquo;s worth and have deadlines, and listeners by address (&lt;code&gt;Network&lt;/code&gt;), for tests only, and the standard library only, so the proxy&amp;rsquo;s tests use it too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;testdata&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the CLI tests (&lt;code&gt;script/*.txtar&lt;/code&gt;), the &lt;a href="https://next.devvm.dev/docs/contributing/testing/#golden-fixtures"&gt;golden fixtures&lt;/a&gt; (&lt;code&gt;golden/&amp;lt;os&amp;gt;/&lt;/code&gt;), a lock to test with (&lt;code&gt;mise.lock&lt;/code&gt;), each package&amp;rsquo;s &lt;a href="https://next.devvm.dev/docs/contributing/tests/#coverage"&gt;coverage baseline&lt;/a&gt; on each system (&lt;code&gt;coverage/&amp;lt;os&amp;gt;.txt&lt;/code&gt;), each release&amp;rsquo;s &lt;a href="#released-state"&gt;state fixture&lt;/a&gt; (&lt;code&gt;v&amp;lt;release&amp;gt;/&amp;lt;os&amp;gt;/&lt;/code&gt;), and the lines that break each forbidigo rule (&lt;code&gt;lint/&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/contributing/#go-lint-rules"&gt;Go lint rules&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;a href="https://next.devvm.dev/docs/contributing/tests/#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt; on real VMs, in Go with the tag &lt;code&gt;e2e&lt;/code&gt; and a file for each section. &lt;code&gt;TestE2E&lt;/code&gt; is the run, &lt;code&gt;sandbox_test.go&lt;/code&gt; has the sandbox, its slot&amp;rsquo;s paths and lock and &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, and &lt;code&gt;slots_test.go&lt;/code&gt; runs the slots. The lock file holds the shared tools&amp;rsquo; versions that every section but &lt;code&gt;tools&lt;/code&gt; uses (&lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;scripts&lt;/code&gt;, &lt;code&gt;packaging&lt;/code&gt;, &lt;code&gt;.goreleaser.yaml&lt;/code&gt;, &lt;code&gt;VERSION&lt;/code&gt;, &lt;code&gt;CHANGELOG.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;bump.sh&lt;/code&gt; updates the pins. &lt;code&gt;release.sh&lt;/code&gt; runs the signed tag&amp;rsquo;s checks, then GoReleaser in its pinned container, then minisign, and CI&amp;rsquo;s build and signature (&lt;code&gt;--ci&lt;/code&gt;, &lt;code&gt;--ci-sign&lt;/code&gt;), &lt;code&gt;repro-check.sh&lt;/code&gt; builds a release twice and compares the bytes, and &lt;code&gt;publish.sh&lt;/code&gt; checks the tag and pushes it for CI and the co-signer, signs their draft with the old key while the bridge lasts (&lt;code&gt;--sign-legacy&lt;/code&gt;), or makes the release itself (&lt;code&gt;--local&lt;/code&gt;), with its checks, &lt;code&gt;release.sh&lt;/code&gt;, one yes, then the pushes, &lt;code&gt;gh release&lt;/code&gt; and the tap. The &lt;code&gt;test&lt;/code&gt; and &lt;code&gt;coverage&lt;/code&gt; tasks run &lt;code&gt;test.sh&lt;/code&gt;, which runs &lt;code&gt;coverage.sh&lt;/code&gt; to check each package&amp;rsquo;s coverage against its baseline. &lt;code&gt;packaging/&lt;/code&gt; holds the Homebrew formula and &lt;code&gt;key.go&lt;/code&gt;, which embeds its folder, so devvm upgrade&amp;rsquo;s release keys are those in &lt;code&gt;keys/&lt;/code&gt; (&lt;code&gt;release-ci.pub&lt;/code&gt;, &lt;code&gt;release-cosign.pub&lt;/code&gt; and &lt;code&gt;release-recovery.pub&lt;/code&gt;) and its old release key is &lt;code&gt;minisign.pub&lt;/code&gt;&amp;rsquo;s, and a build without a file has no such key (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#release-keys"&gt;release keys&lt;/a&gt;). Only the scripts read &lt;code&gt;VERSION&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;releasing&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;install.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;curl | bash&lt;/code&gt;: it installs the host&amp;rsquo;s archive, with the binary, the README, the changelog and the license, checked, into &lt;code&gt;~/.local/lib/devvm/&amp;lt;version&amp;gt;&lt;/code&gt;, then runs doctor&amp;rsquo;s fixes, asking first. Tests source it (&lt;code&gt;DEVVM_INSTALL_TEST&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="the-checks-on-owners"&gt;The checks on owners&lt;span class="hx:absolute hx:-mt-20" id="the-checks-on-owners"&gt;&lt;/span&gt;
&lt;a href="#the-checks-on-owners" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;An owner gets a check only when a second copy would be a bug or a security hole, and only when the check is exact, so that it never fails on code that&amp;rsquo;s right. Each check&amp;rsquo;s failure names the owner. The table is written from &lt;code&gt;ownerDocs&lt;/code&gt; in &lt;code&gt;internal/structure/owners_doc_test.go&lt;/code&gt;, which &lt;code&gt;TestOwnersDoc&lt;/code&gt; checks it against and &lt;code&gt;TestOwnersAgree&lt;/code&gt; checks against the structure test&amp;rsquo;s own tables, so a change to a check changes its row there, and &lt;code&gt;go test ./internal/structure -run TestOwnersDoc -update&lt;/code&gt; writes the table again:&lt;/p&gt;
&lt;!-- The table is generated from ownerDocs in internal/structure/owners_doc_test.go: go test ./internal/structure -run TestOwnersDoc -update --&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Owner&lt;/th&gt;
&lt;th&gt;Allowed elsewhere&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;testbuild.On&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/cli&lt;/code&gt;, whose &lt;code&gt;readOverrides&lt;/code&gt; is the only code that asks whether this is a test build&lt;/td&gt;
&lt;td&gt;nowhere: other packages take the overrides as fields&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.FindProcess&lt;/code&gt;, &lt;code&gt;syscall.Kill&lt;/code&gt;, &lt;code&gt;unix.Kill&lt;/code&gt; and &lt;code&gt;os.Process&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Kill&lt;/code&gt; and &lt;code&gt;Signal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/daemon&lt;/code&gt;, which signals a background process only while its pid file and its arguments say it&amp;rsquo;s still that process (&lt;code&gt;Proc&lt;/code&gt;), or through the process it started (&lt;code&gt;Handle&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/platform&lt;/code&gt;; tests, which signal the children they started; and a child that hasn&amp;rsquo;t been waited for yet, whose pid is still its own, with a &lt;code&gt;nolint&lt;/code&gt; saying so&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;unicode.IsGraphic&lt;/code&gt;, &lt;code&gt;IsPrint&lt;/code&gt;, &lt;code&gt;IsControl&lt;/code&gt; and &lt;code&gt;Bidi_Control&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;msg.Safe&lt;/code&gt; in &lt;code&gt;internal/msg/safe.go&lt;/code&gt;, the one rule for which characters reach the terminal, which &lt;code&gt;msg.Printable&lt;/code&gt;, &lt;code&gt;msg.OneLine&lt;/code&gt;, the UI&amp;rsquo;s renderers and devvm agent save&amp;rsquo;s diff follow, so a second rule can&amp;rsquo;t let through what this one refuses (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#colors"&gt;Colors&lt;/a&gt; says what it refuses)&lt;/td&gt;
&lt;td&gt;a check that isn&amp;rsquo;t about the terminal, such as a path one line long, with a &lt;code&gt;//nolint:forbidigo&lt;/code&gt; saying so&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, HTTP clients&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/fetch&lt;/code&gt;, whose &lt;code&gt;NewClient&lt;/code&gt; sets each client&amp;rsquo;s timeout and redirect policy (&lt;code&gt;HTTPSOnly&lt;/code&gt; or &lt;code&gt;SameScheme&lt;/code&gt;), and whose &lt;code&gt;Retry&lt;/code&gt;, &lt;code&gt;Transient&lt;/code&gt;, &lt;code&gt;ReadCapped&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt;, &lt;code&gt;Resolve&lt;/code&gt; and &lt;code&gt;Download&lt;/code&gt; try again after the failures that may pass, cap what a body or a download may hold, follow a HEAD&amp;rsquo;s redirects to where they end and check a download&amp;rsquo;s SHA-256 before anything uses it. &lt;code&gt;fetch.Client&lt;/code&gt; is its own type, so a client that &lt;code&gt;NewClient&lt;/code&gt; didn&amp;rsquo;t make, such as &lt;code&gt;&amp;amp;fetch.Client{}&lt;/code&gt;, fails every request, and a caller changes a client&amp;rsquo;s transport through its &lt;code&gt;Transport&lt;/code&gt; method&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;, which is the standard library only, and tests, which make their own servers&amp;rsquo; clients&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;x509&lt;/code&gt;&amp;rsquo;s &lt;code&gt;UnknownAuthorityError&lt;/code&gt;, &lt;code&gt;HostnameError&lt;/code&gt; and &lt;code&gt;CertificateInvalidError&lt;/code&gt; and &lt;code&gt;tls.CertificateVerificationError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fetch.Untrusted&lt;/code&gt;, &lt;code&gt;fetch.BadCertificate&lt;/code&gt; and &lt;code&gt;fetch.Unverified&lt;/code&gt; in &lt;code&gt;internal/fetch/fetch.go&lt;/code&gt;, beside &lt;code&gt;fetch.Gone&lt;/code&gt;: a server&amp;rsquo;s certificate that no CA this machine trusts signed, which the user&amp;rsquo;s CA mends, one a trusted CA signed that&amp;rsquo;s for another host, out of date or not valid yet, which no CA mends, and any failure to verify one, with its reason. &lt;code&gt;Transient&lt;/code&gt; asks &lt;code&gt;Unverified&lt;/code&gt;, so none is tried again. Ubuntu&amp;rsquo;s lookups and the cloud image&amp;rsquo;s download ask all three, so each names the same cause, and host mise&amp;rsquo;s asks &lt;code&gt;Untrusted&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;tests, which make those errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;netip.Addr&lt;/code&gt;&amp;rsquo;s &lt;code&gt;IsPrivate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;proxy.Public&lt;/code&gt; in &lt;code&gt;internal/proxy/proxy.go&lt;/code&gt;, the one judge of whether an address is on the internet: netip&amp;rsquo;s classes, the table of the other ranges that aren&amp;rsquo;t (&lt;code&gt;notPublic&lt;/code&gt;), and the IPv4 address in a NAT64 or 6to4 address. The proxy&amp;rsquo;s floor, &lt;code&gt;devvm network lock&lt;/code&gt;, a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s partial-clone remotes and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registries all ask it, so a range added to it holds for each&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;redact.Secret&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Reveal&lt;/code&gt;; the structure test, a struct that embeds &lt;code&gt;redact.Secret&lt;/code&gt; and an interface that declares &lt;code&gt;Reveal() string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;redact.Secret&lt;/code&gt; in &lt;code&gt;internal/redact/secret.go&lt;/code&gt;, the type of the values that let whoever holds them act as the user or a VM, but for those &lt;a href="#secrets-in-the-code"&gt;Secrets in the code&lt;/a&gt; names: a VM&amp;rsquo;s proxy password, a secret&amp;rsquo;s value, a login&amp;rsquo;s keys and tokens once they leave its file, and the company proxy&amp;rsquo;s password and its &lt;code&gt;Proxy-Authorization&lt;/code&gt;. Every way of printing one shows &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; or, in an unexported field, an address, and encoding one as JSON or text is an error, never a stand-in, so a file that holds the real value writes it through its own wire type, and a value can&amp;rsquo;t be lost by going somewhere it isn&amp;rsquo;t meant to&lt;/td&gt;
&lt;td&gt;where the value is used, each call to &lt;code&gt;Reveal&lt;/code&gt; with a &lt;code&gt;//nolint:forbidigo&lt;/code&gt; that says why: the proxy&amp;rsquo;s password check, its config file, the headers it puts values in, the company proxy&amp;rsquo;s credentials, the VM&amp;rsquo;s CA key as it signs and the broker&amp;rsquo;s frames to its child; the store&amp;rsquo;s file and Keychain; the VM&amp;rsquo;s proxy URL and its key in &lt;code&gt;vm.json&lt;/code&gt;; a login&amp;rsquo;s file, its refresh and its claims; and tests. No struct embeds &lt;code&gt;redact.Secret&lt;/code&gt; and no interface declares &lt;code&gt;Reveal() string&lt;/code&gt; outside &lt;code&gt;internal/redact&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.WriteFile&lt;/code&gt;, &lt;code&gt;os.Create&lt;/code&gt; and &lt;code&gt;os.O_TRUNC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;, whose &lt;code&gt;WriteFile&lt;/code&gt; and &lt;code&gt;WriteFileMode&lt;/code&gt; write a file whole through a temporary file in its folder, renamed over it, so a reader never sees half of it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy&lt;/code&gt;, which imports only the standard library and has its own writer, &lt;code&gt;writeAtomic&lt;/code&gt;; &lt;code&gt;internal/msg/gen&lt;/code&gt;, which imports no devvm package; &lt;code&gt;internal/stubtest&lt;/code&gt;; tests; and, with a &lt;code&gt;nolint&lt;/code&gt; saying why, a file written another way: a log that a process writes as it runs, a download that streams into its file, and &lt;code&gt;internal/daemon&lt;/code&gt;&amp;rsquo;s pid and status files, each written in one write that a reader takes as missing until its line ends&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.Open&lt;/code&gt;, &lt;code&gt;os.OpenFile&lt;/code&gt;, &lt;code&gt;os.ReadFile&lt;/code&gt;, &lt;code&gt;os.OpenRoot&lt;/code&gt;, &lt;code&gt;os.OpenInRoot&lt;/code&gt;, &lt;code&gt;os.DirFS&lt;/code&gt; and &lt;code&gt;os.Root&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Open&lt;/code&gt;, &lt;code&gt;OpenFile&lt;/code&gt;, &lt;code&gt;ReadFile&lt;/code&gt; and &lt;code&gt;FS&lt;/code&gt;, in the code that reads files a VM can write or swap: &lt;code&gt;internal/gitprotect&lt;/code&gt;, &lt;code&gt;internal/agentlogin&lt;/code&gt;, &lt;code&gt;internal/vm&lt;/code&gt;&amp;rsquo;s &lt;code&gt;devcontainer.go&lt;/code&gt;, &lt;code&gt;detect.go&lt;/code&gt;, &lt;code&gt;paste.go&lt;/code&gt; and &lt;code&gt;agentsave*.go&lt;/code&gt;, &lt;code&gt;internal/netpolicy/rules.go&lt;/code&gt;, &lt;code&gt;internal/vmlog&lt;/code&gt;, and &lt;code&gt;internal/proxy&lt;/code&gt;&amp;rsquo;s &lt;code&gt;config.go&lt;/code&gt;, &lt;code&gt;policy.go&lt;/code&gt;, &lt;code&gt;rotate.go&lt;/code&gt; and &lt;code&gt;nixcache.go&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/safefile&lt;/code&gt;, which imports only the standard library, so the proxy reads with it too. Its &lt;code&gt;Read&lt;/code&gt; and &lt;code&gt;Open&lt;/code&gt; open a file without blocking and, unless the caller passes &lt;code&gt;Follow&lt;/code&gt;, without following a symbolic link at the path&amp;rsquo;s end. They then check the file they opened, not its name, so a FIFO, a device or a folder is refused with &lt;code&gt;ErrNotRegular&lt;/code&gt;, a file past its cap with &lt;code&gt;ErrTooLong&lt;/code&gt;, and, with &lt;code&gt;OneLink&lt;/code&gt;, a file with another hard link with &lt;code&gt;ErrLinked&lt;/code&gt;. A FIFO that the VM swaps in after a check can&amp;rsquo;t hold devvm, and a link to &lt;code&gt;/dev/zero&lt;/code&gt; can&amp;rsquo;t flood it. &lt;code&gt;Checked&lt;/code&gt; checks a file its caller opened another way in the same way, such as devvm paste&amp;rsquo;s copied file, which &lt;code&gt;platform.OpenNoLinks&lt;/code&gt; opens following no link but the system&amp;rsquo;s, through &lt;code&gt;openat&lt;/code&gt;, which the standard library doesn&amp;rsquo;t have on macOS. &lt;code&gt;OpenRoot&lt;/code&gt; opens beneath a folder through &lt;code&gt;os.Root&lt;/code&gt;, never through a link out of it, and its &lt;code&gt;FS&lt;/code&gt; lists and stats what&amp;rsquo;s there but opens only regular files and, never through a link at the name&amp;rsquo;s end, folders to list. &lt;code&gt;Walk&lt;/code&gt; walks a folder that a VM can fill, reading each folder in batches and stopping at its bound on the entries it reads, as &lt;code&gt;devvm agent import&lt;/code&gt; walks an agent&amp;rsquo;s folder&lt;/td&gt;
&lt;td&gt;every other file, which is devvm&amp;rsquo;s own or the user&amp;rsquo;s; tests, which make their own fixtures; and, with a &lt;code&gt;nolint&lt;/code&gt; saying why, what opens a file to write it or a folder to lock it, such as the proxy&amp;rsquo;s logs and the Nix cache&amp;rsquo;s lock, each opened never through a link or waiting on a FIFO and checked once open&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.Chmod&lt;/code&gt;, &lt;code&gt;os.Chtimes&lt;/code&gt;, &lt;code&gt;os.Chown&lt;/code&gt;, &lt;code&gt;os.Lchown&lt;/code&gt; and &lt;code&gt;os.Truncate&lt;/code&gt;, in the code that changes files a VM can write or swap: &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;internal/vmlog&lt;/code&gt; and &lt;code&gt;internal/vmssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the file&amp;rsquo;s own descriptor, from &lt;code&gt;internal/safefile&lt;/code&gt;, an &lt;code&gt;os.Root&lt;/code&gt; or the proxy&amp;rsquo;s &lt;code&gt;OpenLog&lt;/code&gt;: &lt;code&gt;os.File&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Chmod&lt;/code&gt;, &lt;code&gt;Chown&lt;/code&gt; and &lt;code&gt;Truncate&lt;/code&gt;, an &lt;code&gt;os.Root&lt;/code&gt;&amp;rsquo;s methods, and the proxy&amp;rsquo;s &lt;code&gt;touchFile&lt;/code&gt; (&lt;code&gt;futimes&lt;/code&gt;, or &lt;code&gt;utimensat&lt;/code&gt; with no path), because a VM can swap a name for a link between the open and the change, which would then reach a file of yours&lt;/td&gt;
&lt;td&gt;every other package, whose files are devvm&amp;rsquo;s own or the user&amp;rsquo;s; tests, which make their own fixtures; and, with a &lt;code&gt;nolint&lt;/code&gt; saying why, a unix socket devvm has just made in its own folder (the proxy&amp;rsquo;s SSH agent relay and the link session&amp;rsquo;s sockets), whose mode only its path can set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.Setenv&lt;/code&gt;, &lt;code&gt;os.Unsetenv&lt;/code&gt;, &lt;code&gt;os.Clearenv&lt;/code&gt; and &lt;code&gt;syscall&lt;/code&gt;&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;each command&amp;rsquo;s own environment, its &lt;code&gt;exec.Cmd&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Env&lt;/code&gt;, because every command and background process devvm starts inherits devvm&amp;rsquo;s. A VM&amp;rsquo;s SSH agent is one: the finder&amp;rsquo;s &lt;code&gt;target&lt;/code&gt; carries its socket, its proxy&amp;rsquo;s relay (&lt;code&gt;netpolicy.Proxy.Prepare&lt;/code&gt;), which goes to the backend in &lt;code&gt;backend.ExecOpts.Agent&lt;/code&gt;, &lt;code&gt;backend.ShellOpts.Agent&lt;/code&gt; and &lt;code&gt;Confinement.AgentSocket&lt;/code&gt;, and Lima sets &lt;code&gt;SSH_AUTH_SOCK&lt;/code&gt; on that VM&amp;rsquo;s &lt;code&gt;limactl&lt;/code&gt; commands alone, so a run that reaches several VMs never gives one another&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;&lt;code&gt;daemon.Ready&lt;/code&gt; in &lt;code&gt;internal/daemon/status.go&lt;/code&gt;, which takes the status file&amp;rsquo;s name out of a background process&amp;rsquo;s own environment; &lt;code&gt;stubtest.NoGitRepo&lt;/code&gt;, which takes git&amp;rsquo;s variables that pick a repo out of a test&amp;rsquo;s environment until the test ends; and tests, which use &lt;code&gt;t.Setenv&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, host commands&lt;/td&gt;
&lt;td&gt;the runners: the UI&amp;rsquo;s &lt;code&gt;LoggedCmd&lt;/code&gt;, which a package takes as a field and which runs a command into the run log, a backend&amp;rsquo;s &lt;code&gt;Runner&lt;/code&gt;, and &lt;code&gt;internal/hostgit&lt;/code&gt;. A host command that one of them doesn&amp;rsquo;t run is made only in the files &lt;code&gt;execSites&lt;/code&gt; lists: those that make the command a runner then runs, such as Lima&amp;rsquo;s &lt;code&gt;limactl&lt;/code&gt; and mise&amp;rsquo;s, and those whose command can&amp;rsquo;t go into the run log, because it streams for as long as a link, the port forwarder or the desktop&amp;rsquo;s relay lasts, asks on the terminal, outlives the run, or carries a secret&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, a backend&amp;rsquo;s other interfaces&lt;/td&gt;
&lt;td&gt;&lt;code&gt;backend.As&lt;/code&gt; in &lt;code&gt;internal/backend/guard.go&lt;/code&gt;, because the registry&amp;rsquo;s backends are behind its guard, whose type has only &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s methods, so a type assertion to &lt;code&gt;backend.Forgetter&lt;/code&gt; or &lt;code&gt;*lima.Lima&lt;/code&gt; on one is always false&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, git&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/hostgit&lt;/code&gt;, which runs git without the repo&amp;rsquo;s fsmonitor, hooks, filters or signing programs, over ssh only, without the environment&amp;rsquo;s &lt;code&gt;GIT_*&lt;/code&gt; variables, prompts, replace refs or grafts. It&amp;rsquo;s also the only package whose string literals may be &lt;code&gt;&amp;quot;push&amp;quot;&lt;/code&gt;, whole (&lt;code&gt;names&lt;/code&gt;), and none is: a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s copy goes through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; (&lt;code&gt;internal/vm/cloneseed.go&lt;/code&gt;), never git&amp;rsquo;s transport, whose receive-pack refuses shallow and SHA-256 repos. Nor may any other package&amp;rsquo;s be &lt;code&gt;&amp;quot;diff-files&amp;quot;&lt;/code&gt;, which enters each submodule, where that repo&amp;rsquo;s own config can name a filter: &lt;code&gt;hostgit.DiffFiles&lt;/code&gt; doesn&amp;rsquo;t. In tests, which run plain git to make their repos, it&amp;rsquo;s &lt;code&gt;internal/stubtest&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Git&lt;/code&gt;, which leaves out git&amp;rsquo;s variables that pick a repo, its files or its config (&lt;code&gt;GitEnv&lt;/code&gt;), so a git that runs the tests, such as a hook&amp;rsquo;s or &lt;code&gt;git rebase --exec&lt;/code&gt;&amp;rsquo;s, never sends a test&amp;rsquo;s git to the checkout itself&lt;/td&gt;
&lt;td&gt;the files &lt;code&gt;commandsFree&lt;/code&gt; lists for git, which may run no other guarded command: the co-signer&amp;rsquo;s &lt;code&gt;internal/cosign/build.go&lt;/code&gt;, a program of its own that imports none of devvm&amp;rsquo;s packages but &lt;code&gt;internal/minisign&lt;/code&gt;, whose git fetches a release&amp;rsquo;s tag over HTTPS into repositories it makes, with no config but its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;forbidigo, &lt;code&gt;os.UserHomeDir&lt;/code&gt;, and the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;paths.FromEnv&lt;/code&gt; in &lt;code&gt;internal/paths/dirs.go&lt;/code&gt;, which reads &lt;code&gt;HOME&lt;/code&gt; once into &lt;code&gt;paths.Dirs.Home&lt;/code&gt;, so a test or an e2e run that sets its own &lt;code&gt;HOME&lt;/code&gt; moves every path devvm takes from it&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;DEVVM_&lt;/code&gt; variables&lt;/td&gt;
&lt;td&gt;&lt;code&gt;readOverrides&lt;/code&gt; in &lt;code&gt;internal/cli/overrides.go&lt;/code&gt;, which reads a test build&amp;rsquo;s stand-ins, while a release reads none&lt;/td&gt;
&lt;td&gt;the settings in &lt;code&gt;envSettings&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, signatures&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign&lt;/code&gt;, whose &lt;code&gt;PublicKey.Check&lt;/code&gt; checks a minisign signature and its trusted comment, exactly, and whose &lt;code&gt;Keys.Check&lt;/code&gt; checks a manifest, such as a release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt;, against any two of a kind&amp;rsquo;s three keys, by role, each signer counted once. A call of &lt;code&gt;ed25519&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Verify&lt;/code&gt; or &lt;code&gt;VerifyWithOptions&lt;/code&gt;, &lt;code&gt;rsa&lt;/code&gt;&amp;rsquo;s &lt;code&gt;VerifyPKCS1v15&lt;/code&gt; or &lt;code&gt;VerifyPSS&lt;/code&gt;, or &lt;code&gt;ecdsa&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Verify&lt;/code&gt; or &lt;code&gt;VerifyASN1&lt;/code&gt;, an import of one of those packages with a dot, a call of a method named &lt;code&gt;CheckSignature&lt;/code&gt;, &lt;code&gt;CheckSignatureFrom&lt;/code&gt; or &lt;code&gt;CheckCRLSignature&lt;/code&gt;, as &lt;code&gt;crypto/x509&lt;/code&gt;&amp;rsquo;s are, and an import of &lt;code&gt;golang.org/x/crypto/blake2b&lt;/code&gt;, fail, so devvm&amp;rsquo;s own signatures are checked in one place, with the key&amp;rsquo;s role and kind&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/minisign/minisigntest&lt;/code&gt;, which signs for tests; the files in &lt;code&gt;signatureFree&lt;/code&gt;, which check other projects&amp;rsquo; formats, Ubuntu&amp;rsquo;s OpenPGP signatures (&lt;code&gt;internal/ubuntu/pgp.go&lt;/code&gt;), cache.nixos.org&amp;rsquo;s (&lt;code&gt;internal/proxy/nixcache.go&lt;/code&gt;) and git&amp;rsquo;s SSH signatures on release tags, which the co-signer checks against its pinned signers (&lt;code&gt;internal/cosign/sshsig.go&lt;/code&gt;); and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, shell quoting&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/shell&lt;/code&gt;, whose &lt;code&gt;Quote&lt;/code&gt; and &lt;code&gt;QuoteJoin&lt;/code&gt; quote words for a POSIX shell, so a value never runs as a command, and &lt;code&gt;QuoteLine&lt;/code&gt; a word on one line for bash&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, the VM-name grammar&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmname&lt;/code&gt;, whose &lt;code&gt;IsVM&lt;/code&gt; tells a project VM&amp;rsquo;s name from an image&amp;rsquo;s, so gc never takes a project VM for an image&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, VM names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/vmname&lt;/code&gt;, whose &lt;code&gt;VM&lt;/code&gt; is the name of every machine devvm runs on a backend: a project VM, an image&amp;rsquo;s machine, a build VM, or a VM&amp;rsquo;s old machine while a remake makes the new one. A name is made a &lt;code&gt;VM&lt;/code&gt; only where it&amp;rsquo;s read: &lt;code&gt;Parse&lt;/code&gt; takes a project VM&amp;rsquo;s name from an argument or a file name, and also reads &lt;code&gt;vm.json&lt;/code&gt;&amp;rsquo;s name and runs in &lt;code&gt;project.Nth&lt;/code&gt;, &lt;code&gt;ParseListed&lt;/code&gt; one a backend lists, &lt;code&gt;VM.UnmarshalText&lt;/code&gt; one in a JSON file (one path element that doesn&amp;rsquo;t start with &lt;code&gt;-&lt;/code&gt;, or none, and any machine&amp;rsquo;s, so a field that must hold a project VM&amp;rsquo;s is still checked with &lt;code&gt;IsProject&lt;/code&gt;), &lt;code&gt;Image&lt;/code&gt; names an image&amp;rsquo;s machine and &lt;code&gt;VM.Aside&lt;/code&gt; a remake&amp;rsquo;s old one, and a backend&amp;rsquo;s build VMs are typed constants. A struct field, a parameter or a result named for a VM (&lt;code&gt;vm&lt;/code&gt;, &lt;code&gt;vms&lt;/code&gt;, &lt;code&gt;otherVM&lt;/code&gt;, &lt;code&gt;vmName&lt;/code&gt;) whose type is a string, a pointer to one, a list of them or a map keyed on them fails, and so do a conversion of anything but a literal to &lt;code&gt;vmname.VM&lt;/code&gt; and a type alias of it, so a path, an alias or a folder&amp;rsquo;s name is never passed for a VM&amp;rsquo;s name. The check goes by names, so it doesn&amp;rsquo;t see a VM&amp;rsquo;s name in a string named otherwise (&lt;code&gt;target&lt;/code&gt;, &lt;code&gt;client&lt;/code&gt;, &lt;code&gt;parent&lt;/code&gt;, &lt;code&gt;to&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;), &lt;code&gt;vmname&lt;/code&gt; imported with a dot or reached through a type parameter, or a VM joined to a string constant, whose type is still &lt;code&gt;vmname.VM&lt;/code&gt; (&lt;code&gt;l.VM+lineNoLinks&lt;/code&gt; in &lt;code&gt;internal/vmssh/links.go&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;msg.M.VM&lt;/code&gt; in &lt;code&gt;internal/msg/msg.go&lt;/code&gt;, which reads back the VM a message&amp;rsquo;s function took; &lt;code&gt;internal/stubtest&lt;/code&gt;, whose stubs stand in for &lt;code&gt;limactl&lt;/code&gt; and &lt;code&gt;ssh&lt;/code&gt;, whose arguments are strings; the names &lt;code&gt;notNames&lt;/code&gt; lists that aren&amp;rsquo;t a VM&amp;rsquo;s, such as &lt;code&gt;backend.Registry.NewVMs&lt;/code&gt;, a backend&amp;rsquo;s name; and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, hosts&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/proxy/host.go&lt;/code&gt;, whose &lt;code&gt;NormHost&lt;/code&gt; reads a host as the proxy judges it, the one form every judge of a host compares: a host of printable ASCII lowercased, in ASCII alone, and its one trailing dot dropped unless it&amp;rsquo;s an address, whose dot can only be its IPv6 zone&amp;rsquo;s, and any other host left as it is, which &lt;code&gt;HostOK&lt;/code&gt; refuses, so no Unicode fold makes another name match. An address is bare, or an IPv6 address in one pair of brackets, never one with a stray bracket. Its &lt;code&gt;Host&lt;/code&gt; is what a matcher takes, such as a rule&amp;rsquo;s &lt;code&gt;matchHost&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt;&amp;rsquo;s. A call to package &lt;code&gt;strings&lt;/code&gt; that drops a dot (&lt;code&gt;Trim&lt;/code&gt;, &lt;code&gt;TrimLeft&lt;/code&gt; or &lt;code&gt;TrimRight&lt;/code&gt; with a cutset that holds &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;TrimSuffix&lt;/code&gt; or &lt;code&gt;CutSuffix&lt;/code&gt; with &lt;code&gt;&amp;quot;.&amp;quot;&lt;/code&gt;), or that folds or trims an argument named for a host (&lt;code&gt;ToLower&lt;/code&gt;, &lt;code&gt;ToUpper&lt;/code&gt;, &lt;code&gt;EqualFold&lt;/code&gt;, &lt;code&gt;TrimFunc&lt;/code&gt;, &lt;code&gt;TrimLeftFunc&lt;/code&gt; or &lt;code&gt;TrimRightFunc&lt;/code&gt; of &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;sni&lt;/code&gt; or &lt;code&gt;u.Hostname()&lt;/code&gt;), fails, and so does a conversion to &lt;code&gt;proxy.Host&lt;/code&gt; of anything but a literal. The check goes by names and calls, so it doesn&amp;rsquo;t see a host&amp;rsquo;s case folded in a variable named otherwise, a dot dropped by slicing, or a host mapped rune by rune (&lt;code&gt;strings.Map&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the functions &lt;code&gt;free&lt;/code&gt; lists by file and name, each with why: &lt;code&gt;trimDots&lt;/code&gt; in &lt;code&gt;internal/proxy/request.go&lt;/code&gt;, which drops a path&amp;rsquo;s segments&amp;rsquo; trailing dots; &lt;code&gt;urlHost&lt;/code&gt; in &lt;code&gt;internal/vm/cloneseed.go&lt;/code&gt;, which reads a remote&amp;rsquo;s ssh host as ssh does, to find a VM&amp;rsquo;s alias, its case folded and its trailing dot kept; &lt;code&gt;safeIndexPath&lt;/code&gt; in &lt;code&gt;internal/vm/cloneworktree.go&lt;/code&gt;, which drops a path segment&amp;rsquo;s trailing dots and spaces as Windows does; and &lt;code&gt;machines.fillPassword&lt;/code&gt; in &lt;code&gt;internal/backend/lima/start.go&lt;/code&gt; and &lt;code&gt;transportHelper&lt;/code&gt; in &lt;code&gt;internal/vm/cloneconfig.go&lt;/code&gt;, which check that a string has only the characters of a set that holds &lt;code&gt;.&lt;/code&gt;; and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, the coding agents&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/agents&lt;/code&gt;, whose &lt;code&gt;Defs&lt;/code&gt; hold every fact devvm keeps of each agent, so no copy of an agent&amp;rsquo;s list or paths goes stale when one is added. A string literal that is an agent&amp;rsquo;s name or a login file&amp;rsquo;s kind, whole, or that holds an agent&amp;rsquo;s folder below the home folder, fails, and code of one agent&amp;rsquo;s own names the agent by its constant there. Comparing with that constant, or with one named after it such as &lt;code&gt;secrets.ClaudeToken&lt;/code&gt;, a &lt;code&gt;case&lt;/code&gt; for it, looking for it with &lt;code&gt;slices.Contains&lt;/code&gt; or &lt;code&gt;slices.Index&lt;/code&gt;, looking it up in a map, a map literal keyed on it and &lt;code&gt;strings.HasPrefix&lt;/code&gt;, &lt;code&gt;HasSuffix&lt;/code&gt;, &lt;code&gt;EqualFold&lt;/code&gt; or &lt;code&gt;Contains&lt;/code&gt; with it fail too, outside the files named for the agent, such as &lt;code&gt;claude.go&lt;/code&gt;, so the rest of devvm asks the agent&amp;rsquo;s &lt;code&gt;Def&lt;/code&gt; and a new agent changes none of it. A list that holds every agent&amp;rsquo;s name, tests included, fails as a copy of &lt;code&gt;agents.Names()&lt;/code&gt;, and so does a CLI test script&amp;rsquo;s line that lists agents as a message does, for which the runner gives &lt;code&gt;$AGENT_CHOICES&lt;/code&gt;, &lt;code&gt;$LOGIN_AGENTS&lt;/code&gt; and &lt;code&gt;$KEY_AGENTS&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-coding-agent"&gt;adding a coding agent&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/stubtest&lt;/code&gt;, whose stubs are named after the commands they stand in for, and tests; for a name, the value of a constant that &lt;code&gt;devvmNameFree&lt;/code&gt; lists with its reason and the only files that may use it: &lt;code&gt;vm.CursorCommand&lt;/code&gt;, the Cursor editor&amp;rsquo;s &lt;code&gt;cursor&lt;/code&gt; command, which &lt;code&gt;devvm cursor&lt;/code&gt; runs and isn&amp;rsquo;t the agent&amp;rsquo;s, used in &lt;code&gt;internal/vm/ssh.go&lt;/code&gt; and &lt;code&gt;internal/cli/cursor.go&lt;/code&gt; alone and compared with as an agent&amp;rsquo;s constant is; for the comparisons, the files whose names hold the agent&amp;rsquo;s name as a word, and the constants &lt;code&gt;devvmSwitchFree&lt;/code&gt; lists in one file each with its reason: the claude secret&amp;rsquo;s own checks, which are a secret&amp;rsquo;s, and Codex&amp;rsquo;s binding name in &lt;code&gt;logins.go&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, the toolchains&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/image&lt;/code&gt;, whose &lt;code&gt;SharedTools&lt;/code&gt; holds every fact devvm keeps of each toolchain: its members, the files that call for it, its installer, its guest environment, its &lt;code&gt;PATH&lt;/code&gt; folders and its version files. A string literal that is a toolchain&amp;rsquo;s name or a member&amp;rsquo;s, whole, fails, so code elsewhere asks the table, and a new toolchain is an entry there (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-toolchain"&gt;adding a toolchain&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/stubtest&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, image names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/image&lt;/code&gt;, whose &lt;code&gt;Name&lt;/code&gt; is an image&amp;rsquo;s name and splits it into its layers (&lt;code&gt;Layers&lt;/code&gt;, &lt;code&gt;Parent&lt;/code&gt;, &lt;code&gt;Has&lt;/code&gt;), whose &lt;code&gt;NameOf&lt;/code&gt; joins layers into one, and whose &lt;code&gt;ParseName&lt;/code&gt; reads the name the user gives, which &lt;code&gt;build.Names&lt;/code&gt;&amp;rsquo; &lt;code&gt;Parse&lt;/code&gt; checks against the layers there are. &lt;code&gt;devvm build&lt;/code&gt;, &lt;code&gt;devvm rebuild&lt;/code&gt; and &lt;code&gt;devvm images rm&lt;/code&gt; read their names there once, and the rest of devvm passes the &lt;code&gt;image.Name&lt;/code&gt; on&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;state.ReadHash&lt;/code&gt; and &lt;code&gt;project.Parents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the finder in &lt;code&gt;internal/vm/finder.go&lt;/code&gt;, whose &lt;code&gt;target&lt;/code&gt; finds the VM every command acts on: the folder&amp;rsquo;s own, the nearest parent folder&amp;rsquo;s under &lt;code&gt;--here&lt;/code&gt; and &lt;code&gt;--parent&lt;/code&gt; (&lt;code&gt;resolveFolder&lt;/code&gt;), or one named (&lt;code&gt;devvm rm VM&lt;/code&gt;). It finds a folder&amp;rsquo;s VM by the state that records the folder (&lt;code&gt;finder.state&lt;/code&gt;, by the path&amp;rsquo;s hash first, then &lt;code&gt;recorded&lt;/code&gt;), offers to move a VM whose folder moved there (&lt;code&gt;moveHere&lt;/code&gt; in &lt;code&gt;internal/vm/move.go&lt;/code&gt;, the match &lt;code&gt;here.movedFrom&lt;/code&gt;), and names a new VM by the first of the folder&amp;rsquo;s names whose VM folder is free (&lt;code&gt;newName&lt;/code&gt;, &lt;code&gt;project.Nth&lt;/code&gt;). Its &lt;code&gt;need&lt;/code&gt; says what the command needs of the VM, and &lt;code&gt;need.check&lt;/code&gt; is the one place that refuses one that isn&amp;rsquo;t there, one made for an earlier folder at its path, one whose remake didn&amp;rsquo;t finish and one whose creation didn&amp;rsquo;t, the last with &lt;code&gt;refuseUnfinished&lt;/code&gt;, which every start (&lt;code&gt;starter.bringUp&lt;/code&gt; in &lt;code&gt;internal/vm/start.go&lt;/code&gt;) makes too. It reads the folder devvm runs in only then, so the commands that act on no folder&amp;rsquo;s VM run in a folder that&amp;rsquo;s gone. The VM it finds is a &lt;code&gt;target&lt;/code&gt; (&lt;code&gt;internal/vm/target.go&lt;/code&gt;). It holds what the VM&amp;rsquo;s backend told the finder, which each start and stop of the VM then updates, and it runs what a command does with that VM: &lt;code&gt;exec&lt;/code&gt;, &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;stop&lt;/code&gt;, &lt;code&gt;running&lt;/code&gt;, &lt;code&gt;ownSSH&lt;/code&gt; and the name of its ssh config entry&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;hostsafety.Walk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the start in &lt;code&gt;internal/vm/start.go&lt;/code&gt;, whose &lt;code&gt;starter.walk&lt;/code&gt; walks a VM&amp;rsquo;s project folder once for each check of the folder on the host, for the git repos nested in it, which &lt;code&gt;.git&lt;/code&gt; protection goes by (&lt;code&gt;gitprotect.Protector.Nested&lt;/code&gt;), and on Linux hosts its set-id files, so a check never walks the folder twice. It walks when a VM is made and when a check finds it stopped, at a launch or at &lt;code&gt;devvm stop&lt;/code&gt; (&lt;code&gt;starter.hostChecks&lt;/code&gt;), and at &lt;code&gt;devvm git-protect&lt;/code&gt; on a stopped VM, never at a launch into a running VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/hostsafety&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;state.ReadAll&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the inventory in &lt;code&gt;internal/vm/inventory.go&lt;/code&gt;, which reads every VM&amp;rsquo;s state (&lt;code&gt;ReadStates&lt;/code&gt;), and with &lt;code&gt;ReadInventory&lt;/code&gt; the backends&amp;rsquo; lists too, each within its wait, for every listing of VMs: &lt;code&gt;devvm ls&lt;/code&gt;, &lt;code&gt;devvm space&lt;/code&gt;, &lt;code&gt;devvm images&lt;/code&gt; and &lt;code&gt;devvm gc&lt;/code&gt;, the ssh config, &lt;code&gt;devvm gc --orphans&lt;/code&gt;, the links, &lt;code&gt;devvm secret&lt;/code&gt;&amp;rsquo;s list, finding a VM by its name and the mounts that devvm&amp;rsquo;s SSH agent checks a key against. Its one failure policy is that a backend that can&amp;rsquo;t list fails a listing (&lt;code&gt;Inventory.Err&lt;/code&gt;) only when some VM&amp;rsquo;s state names it, and that a state that can&amp;rsquo;t be read is a row of its own, which the readers leave out and &lt;code&gt;ToolsInUse&lt;/code&gt; and &lt;code&gt;Mounts&lt;/code&gt; fail on. &lt;code&gt;state.VMNames&lt;/code&gt;, which fails on such a state, stays for the readers below &lt;code&gt;internal/vm&lt;/code&gt; that must count every VM: &lt;code&gt;netpolicy&lt;/code&gt;&amp;rsquo;s secrets, &lt;code&gt;ports&lt;/code&gt; and &lt;code&gt;sshconfig.ChooseAlias&lt;/code&gt;; &lt;code&gt;state.ReadableVMs&lt;/code&gt;, which leaves such a state out, is for those that only warn: &lt;code&gt;netpolicy&lt;/code&gt;&amp;rsquo;s warnings of every VM and doctor&amp;rsquo;s policy warnings&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/state&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, &lt;code&gt;paths.Dirs.AgentSettings&lt;/code&gt; and &lt;code&gt;paths.Dirs.AgentLogins&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s agent store: &lt;code&gt;agentStore&lt;/code&gt; in &lt;code&gt;internal/vm/agents.go&lt;/code&gt; for the agents&amp;rsquo; settings, which the mounts, the setup&amp;rsquo;s copies, a remake&amp;rsquo;s home and &lt;code&gt;devvm agent import&lt;/code&gt; take, and &lt;code&gt;secrets.LoginFile&lt;/code&gt; in &lt;code&gt;internal/secrets/secrets.go&lt;/code&gt; for their logins, which the setup&amp;rsquo;s copies and the proxy read, so nothing reads an agent&amp;rsquo;s files from the home folder but &lt;code&gt;vm.AgentImport&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/paths&lt;/code&gt;, and tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the structure test&amp;rsquo;s &lt;code&gt;owners&lt;/code&gt;, paths in devvm&amp;rsquo;s folders&lt;/td&gt;
&lt;td&gt;&lt;code&gt;internal/paths&lt;/code&gt;, whose &lt;code&gt;Dirs&lt;/code&gt; and &lt;code&gt;VM&lt;/code&gt; name every file and folder devvm keeps, so the layout, its golden listing in &lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; and a VM&amp;rsquo;s teardown miss none. A &lt;code&gt;filepath.Join&lt;/code&gt; onto a &lt;code&gt;Data&lt;/code&gt; or &lt;code&gt;Config&lt;/code&gt; field fails, and so does an &lt;code&gt;os.MkdirTemp&lt;/code&gt; or &lt;code&gt;os.CreateTemp&lt;/code&gt; there whose name is a literal; a name from &lt;code&gt;paths&lt;/code&gt;, such as &lt;code&gt;paths.ToolsBuildPrefix&lt;/code&gt;, passes&lt;/td&gt;
&lt;td&gt;tests&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;!-- end of the generated table --&gt;
&lt;p&gt;forbidigo matches only the function a call names, so the checks that look at a call&amp;rsquo;s arguments are in the &lt;a href="#the-structure-test"&gt;structure test&lt;/a&gt;. It finds a host command in an &lt;code&gt;exec.Command&lt;/code&gt; or &lt;code&gt;exec.CommandContext&lt;/code&gt; call that names it, as a literal or as a constant, whatever name the file imports &lt;code&gt;os/exec&lt;/code&gt; under. It finds a &lt;code&gt;DEVVM_&lt;/code&gt; variable in a call to any function or field named &lt;code&gt;Getenv&lt;/code&gt; or &lt;code&gt;LookupEnv&lt;/code&gt;, in any case, so &lt;code&gt;t.Getenv&lt;/code&gt; and a &lt;code&gt;getenv&lt;/code&gt; parameter count as well as &lt;code&gt;os.Getenv&lt;/code&gt;, and it finds &lt;code&gt;HOME&lt;/code&gt; the same way. The settings &lt;code&gt;envSettings&lt;/code&gt; lists are the ones users set, &lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt;, &lt;code&gt;DEVVM_NO_RELEASE_CHECK&lt;/code&gt;, &lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt; and &lt;code&gt;DEVVM_FROM&lt;/code&gt;; names mode, &lt;code&gt;DEVVM_MESSAGES&lt;/code&gt;, which any build has; and the variables devvm sets for its own processes, &lt;code&gt;DEVVM_GUESTFWD&lt;/code&gt; for &lt;code&gt;devvm _qemu&lt;/code&gt; and &lt;code&gt;DEVVM_DAEMON_STATUS&lt;/code&gt; for each background process &lt;code&gt;internal/daemon&lt;/code&gt; starts.&lt;/p&gt;
&lt;p&gt;The structure test also finds a copy of an owner&amp;rsquo;s code by its text, in &lt;code&gt;literals&lt;/code&gt;. A string literal outside tests that holds &lt;code&gt;'\''&lt;/code&gt;, the escaped quote a shell quoter writes, belongs in &lt;code&gt;internal/shell&lt;/code&gt;, and one that holds &lt;code&gt;[0-9a-f]{14}&lt;/code&gt;, the hash at the end of a project VM&amp;rsquo;s name, belongs in &lt;code&gt;internal/vmname&lt;/code&gt;. A quote written as a rune, such as &lt;code&gt;'\''&lt;/code&gt; in Go, isn&amp;rsquo;t a string literal, so it doesn&amp;rsquo;t count. One that holds a coding agent&amp;rsquo;s folder below the home folder, such as &lt;code&gt;.codex/&lt;/code&gt; or &lt;code&gt;.pi/agent&lt;/code&gt;, belongs in &lt;code&gt;internal/agents&lt;/code&gt;, and so does one that is an agent&amp;rsquo;s name or a login file&amp;rsquo;s kind, whole, such as &lt;code&gt;&amp;quot;opencode&amp;quot;&lt;/code&gt; (&lt;code&gt;names&lt;/code&gt;), so code of one agent&amp;rsquo;s own names it by its constant there, such as &lt;code&gt;agents.Opencode&lt;/code&gt;, and a longer text that mentions an agent, such as a command&amp;rsquo;s example, doesn&amp;rsquo;t count. A literal that is a toolchain&amp;rsquo;s name or one of its members&amp;rsquo;, whole, such as &lt;code&gt;&amp;quot;dotnet&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;pnpm&amp;quot;&lt;/code&gt;, belongs in &lt;code&gt;internal/image&lt;/code&gt; in the same way, so code elsewhere finds a toolchain&amp;rsquo;s facts in its &lt;code&gt;image.SharedTools&lt;/code&gt; entry. A literal that is &lt;code&gt;&amp;quot;push&amp;quot;&lt;/code&gt;, whole, belongs only in &lt;code&gt;internal/hostgit&lt;/code&gt;, which holds none, so no package passes &lt;code&gt;push&lt;/code&gt; to git: a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s copy goes through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; instead (&lt;code&gt;internal/vm/cloneseed.go&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-copy-into-a-clone-vm"&gt;the copy into a clone VM&lt;/a&gt;), because git&amp;rsquo;s receive-pack refuses shallow and SHA-256 repos, and a second transport would drift. A literal that is &lt;code&gt;&amp;quot;diff-files&amp;quot;&lt;/code&gt;, whole, belongs only in &lt;code&gt;internal/hostgit&lt;/code&gt; too, whose &lt;code&gt;DiffFiles&lt;/code&gt; adds &lt;code&gt;--ignore-submodules=all&lt;/code&gt;, because git diff-files otherwise runs git status in each submodule or embedded repo, where that repo&amp;rsquo;s own config can name a filter that devvm&amp;rsquo;s git doesn&amp;rsquo;t turn off. In the same way, &lt;code&gt;separators&lt;/code&gt; finds a copy of a parser by what it splits on: a call to any function of package &lt;code&gt;strings&lt;/code&gt; with &lt;code&gt;+&lt;/code&gt; as an argument, as a literal or as a constant, splits or joins an image&amp;rsquo;s layers, so it belongs in &lt;code&gt;internal/image&lt;/code&gt;. A call with another argument that holds a &lt;code&gt;+&lt;/code&gt;, such as &lt;code&gt;strings.ContainsAny(arg, &amp;quot;+,&amp;quot;)&lt;/code&gt;, doesn&amp;rsquo;t count.&lt;/p&gt;
&lt;p&gt;The shared tools have one owner too, the table &lt;code&gt;image.SharedTools&lt;/code&gt; in &lt;code&gt;internal/image/tool.go&lt;/code&gt;, whose agents&amp;rsquo; entries it makes from the coding agents&amp;rsquo; registry, &lt;code&gt;agents.Defs&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-coding-agent"&gt;adding a coding agent&lt;/a&gt;). Each entry, an &lt;code&gt;image.ToolDef&lt;/code&gt;, holds a tool&amp;rsquo;s name, its kind (a toolchain or an agent), its members (the tools in the lock that its name stands for, such as pnpm and bun for node), the files in a project folder that call for it, and its installer, which is mise for every tool but rust, which rustup installs, and dotnet, which &lt;code&gt;assets/shared-tools/build.sh&lt;/code&gt; unpacks from Microsoft&amp;rsquo;s SDK archive. A toolchain&amp;rsquo;s entry also holds the environment that every VM&amp;rsquo;s shells get for it, such as &lt;code&gt;NPM_CONFIG_PREFIX&lt;/code&gt; and .NET&amp;rsquo;s telemetry switch (&lt;code&gt;Env&lt;/code&gt;), the folders of the VM&amp;rsquo;s home that go on every VM&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, where its global installs go (&lt;code&gt;PathDirs&lt;/code&gt;), and the members whose version files mise reads in a project (&lt;code&gt;VersionFiles&lt;/code&gt;). mise locks dotnet&amp;rsquo;s version without a download, because its own installer runs Microsoft&amp;rsquo;s install script, which checks nothing, so devvm adds each platform&amp;rsquo;s archive and its SHA-512 from Microsoft&amp;rsquo;s release metadata to the lock (&lt;code&gt;withSDKDownloads&lt;/code&gt; in &lt;code&gt;internal/tools/dotnet.go&lt;/code&gt;), and &lt;code&gt;Share.Build&lt;/code&gt; passes them to build.sh (&lt;code&gt;image.OwnDownload&lt;/code&gt;), which checks the archive with &lt;code&gt;devvm-fetch&lt;/code&gt;. &lt;code&gt;image.Toolchains&lt;/code&gt;, &lt;code&gt;image.Agents&lt;/code&gt;, &lt;code&gt;image.GroupTools&lt;/code&gt;, the files that make devvm choose a toolchain for a new VM, the lock&amp;rsquo;s check for downloads (&lt;code&gt;image.NoDownload&lt;/code&gt;) and the &lt;code&gt;devcontainer.json&lt;/code&gt; features that devvm maps to a toolchain all come from it. So do the files that every launch&amp;rsquo;s setup writes for the toolchains: &lt;code&gt;/etc/devvm/toolchains.sh&lt;/code&gt;, with every toolchain&amp;rsquo;s environment and &lt;code&gt;PATH&lt;/code&gt; folders (&lt;code&gt;image.GuestEnv&lt;/code&gt; and &lt;code&gt;image.GuestPath&lt;/code&gt;), which base&amp;rsquo;s &lt;code&gt;/etc/profile.d/devvm-tools.sh&lt;/code&gt; reads in every shell, as it reads the agents&amp;rsquo; &lt;code&gt;/etc/devvm/agents.sh&lt;/code&gt;, and the VM&amp;rsquo;s mise setting that names the tools whose version files it reads (&lt;code&gt;image.VersionFileTools&lt;/code&gt;). The image builds read none of them, so a toolchain&amp;rsquo;s environment changes no image. The structure test fails on a string literal outside &lt;code&gt;internal/image&lt;/code&gt; that is a toolchain&amp;rsquo;s name or a member&amp;rsquo;s, whole, so code elsewhere asks the table, through &lt;code&gt;image.Def&lt;/code&gt;, an entry&amp;rsquo;s &lt;code&gt;Installer&lt;/code&gt; or its other fields, rather than naming a toolchain. &lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-toolchain"&gt;Adding a toolchain&lt;/a&gt; and &lt;a href="https://next.devvm.dev/docs/contributing/extending/#adding-a-coding-agent"&gt;adding a coding agent&lt;/a&gt; list the files a new shared tool needs, and the &lt;a href="#agreement-tests"&gt;agreement tests&lt;/a&gt; fail until the table and those files match.&lt;/p&gt;
&lt;p&gt;The scripts that devvm&amp;rsquo;s builds run with bash have one owner for the machine they run on, &lt;code&gt;assets/prelude.sh&lt;/code&gt;, whose &lt;code&gt;$devvm_arch&lt;/code&gt;, &lt;code&gt;$devvm_libc&lt;/code&gt; and &lt;code&gt;devvm_sha&lt;/code&gt; give each script its architecture, its C library and its pinned checksum for each download (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-scripts-prelude"&gt;the scripts&amp;rsquo; prelude&lt;/a&gt;). A script reads them rather than run &lt;code&gt;uname -m&lt;/code&gt; or look for &lt;code&gt;apk&lt;/code&gt; itself, and checks that the prelude came first with &lt;code&gt;: &amp;quot;${devvm_arch:?}&amp;quot;&lt;/code&gt; for each variable it reads, which also tells shellcheck that the variable is set. Go reads each of those scripts through &lt;code&gt;image.OwnScript&lt;/code&gt;, which puts the prelude before it, so a recipe, a tool image&amp;rsquo;s key and the conversion&amp;rsquo;s copy of &lt;code&gt;oci/build.sh&lt;/code&gt; all hold the two together. &lt;code&gt;TestPreludeUsers&lt;/code&gt; in &lt;code&gt;internal/image&lt;/code&gt; fails when a script that doesn&amp;rsquo;t get the prelude, such as &lt;code&gt;assets/oci/bootify.sh&lt;/code&gt; or &lt;code&gt;assets/guest/&lt;/code&gt;&amp;rsquo;s, uses it, or when a script reads a variable without that check. &lt;code&gt;testdata/script/prelude.txtar&lt;/code&gt; checks which pin &lt;code&gt;devvm_sha&lt;/code&gt; picks from each script&amp;rsquo;s pins on arm64 and amd64, with glibc and with musl. A CLI test or a Go test that sources one of these scripts sources &lt;code&gt;assets/prelude.sh&lt;/code&gt; first.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;internal/paths&lt;/code&gt; also owns how a path on the host is resolved and compared with a folder, in &lt;code&gt;resolve.go&lt;/code&gt;, whose comment says which resolver each question takes. &lt;code&gt;paths.Physical&lt;/code&gt; resolves every symlink as far as the path exists, for where a folder or file really is, such as a project folder against devvm&amp;rsquo;s own folders or an SSH key against the folders VMs mount. &lt;code&gt;paths.PhysicalParent&lt;/code&gt; resolves only the folder&amp;rsquo;s symlinks and keeps the last element as named, for a path that may itself be a symlink devvm mustn&amp;rsquo;t follow, such as a key&amp;rsquo;s recorded path or a Seatbelt rule. &lt;code&gt;filepath.EvalSymlinks&lt;/code&gt; itself, which fails when the path doesn&amp;rsquo;t exist, is for a path that must exist, such as the folder devvm runs in, or a stopped VM&amp;rsquo;s project folder, which each of a start&amp;rsquo;s three checks resolves with &lt;code&gt;filepath.EvalSymlinks&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/overview/#an-existing-vm"&gt;an existing VM&lt;/a&gt;). Then &lt;code&gt;paths.Within&lt;/code&gt; tells whether a path is a folder or inside it, and &lt;code&gt;paths.Below&lt;/code&gt; whether it&amp;rsquo;s inside it only. Both compare names, so both paths are resolved the same way first. A check that keeps a VM away from a folder, such as &lt;code&gt;project.Unsafe&lt;/code&gt;&amp;rsquo;s, an SSH key against the folders VMs mount, or a project folder against an agent&amp;rsquo;s folder, uses &lt;code&gt;paths.In&lt;/code&gt; or &lt;code&gt;paths.Under&lt;/code&gt; instead, which also compare the folders themselves and match when the path, or a folder above it, is the same folder as the other, by device and inode. On a volume that ignores case, as macOS&amp;rsquo;s do by default, &lt;code&gt;~/.Config/devvm&lt;/code&gt; is &lt;code&gt;~/.config/devvm&lt;/code&gt;, which a comparison of names alone misses.&lt;/p&gt;
&lt;p&gt;A VM&amp;rsquo;s state, &lt;code&gt;vm.json&lt;/code&gt;, has one owner too, &lt;code&gt;internal/state&lt;/code&gt;, which reads and writes the whole file and knows only its core fields. Every other package that keeps something of a VM&amp;rsquo;s owns one section of it, with its own type, its name (&lt;code&gt;Section&lt;/code&gt;), and an &lt;code&gt;Of&lt;/code&gt; that reads it through &lt;code&gt;state.Section&lt;/code&gt;: &lt;code&gt;internal/netpolicy&lt;/code&gt; owns &lt;code&gt;net&lt;/code&gt;, &lt;code&gt;internal/gitprotect&lt;/code&gt; &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;internal/ports&lt;/code&gt; &lt;code&gt;ports&lt;/code&gt;, &lt;code&gt;internal/sshagent&lt;/code&gt; &lt;code&gt;agent&lt;/code&gt;, &lt;code&gt;internal/tools&lt;/code&gt; &lt;code&gt;tools&lt;/code&gt;, &lt;code&gt;internal/secrets&lt;/code&gt; &lt;code&gt;secrets&lt;/code&gt;, and &lt;code&gt;internal/vm&lt;/code&gt; &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;clone&lt;/code&gt;, &lt;code&gt;devcontainer&lt;/code&gt;, &lt;code&gt;desktop&lt;/code&gt; and &lt;code&gt;links&lt;/code&gt; (&lt;code&gt;internal/vm/state.go&lt;/code&gt;). A section&amp;rsquo;s type keeps what the user asked for at its top level and what devvm made under &lt;code&gt;made&lt;/code&gt;. A change goes through &lt;code&gt;state.VM.Update&lt;/code&gt;, which takes the VM&amp;rsquo;s lock, reads the file again, runs the change and writes the file once: the change sets its section with &lt;code&gt;state.SetSection&lt;/code&gt; and works out a list&amp;rsquo;s new value from the file as it is then, never from what the command read earlier, so a change another devvm made meanwhile is kept. A change that fails writes nothing. &lt;code&gt;Update&lt;/code&gt; holds one VM&amp;rsquo;s lock, so a change takes no other lock inside it, and a change to several VMs updates each in turn. Test builds and the tests panic on a lock taken out of that order (&lt;a href="https://next.devvm.dev/docs/contributing/design/#the-state-layout"&gt;the lock rule&lt;/a&gt;). &lt;code&gt;state.VM.Claim&lt;/code&gt; is &lt;code&gt;Update&lt;/code&gt; that also holds the claims lock, for what no two VMs may have (&lt;code&gt;ports.Allocator&lt;/code&gt; chooses every VM&amp;rsquo;s host port through it), and &lt;code&gt;state.VM.Create&lt;/code&gt; writes a new VM&amp;rsquo;s whole state once, its ssh alias chosen under the claims lock. A build VM has no state, so &lt;code&gt;ports.Allocator.Build&lt;/code&gt; chooses its ssh port through &lt;code&gt;state.Claims&lt;/code&gt;, which holds the claims lock alone. A VM&amp;rsquo;s alias is one &lt;code&gt;vmname.IsAlias&lt;/code&gt; accepts, or devvm doesn&amp;rsquo;t use it. &lt;code&gt;internal/vm&lt;/code&gt;&amp;rsquo;s &lt;code&gt;checkState&lt;/code&gt; reads every section of the folder&amp;rsquo;s VM&amp;rsquo;s state as the VM is found, so a section that can&amp;rsquo;t be read stops the command instead of reading as empty. A new section adds its check there.&lt;/p&gt;
&lt;h3 data-hextra-search-id="agreement-tests"&gt;Agreement tests&lt;span class="hx:absolute hx:-mt-20" id="agreement-tests"&gt;&lt;/span&gt;
&lt;a href="#agreement-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When two places must agree but can&amp;rsquo;t be one, a test checks that they agree. &lt;code&gt;TestEveryPartHasAPolicy&lt;/code&gt; checks that every image part has its policy, &lt;code&gt;TestSharedToolsPolicies&lt;/code&gt; that the policies in &lt;code&gt;assets/shared-tools/&lt;/code&gt; are one for each shared tool in &lt;code&gt;image.SharedTools&lt;/code&gt;, &lt;code&gt;TestConfigTools&lt;/code&gt; that &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; lists each shared tool&amp;rsquo;s members and nothing else, &lt;code&gt;TestBuiltinPolicies&lt;/code&gt; that every policy devvm ships parses, &lt;code&gt;TestEveryMessageIsUsed&lt;/code&gt; that every message has a caller, &lt;code&gt;TestDocLinks&lt;/code&gt; that every doc link is a message and a heading, &lt;code&gt;TestPreludeUsers&lt;/code&gt; that only the scripts that get the prelude use it, &lt;code&gt;TestDefsComplete&lt;/code&gt; that every coding agent has its &lt;code&gt;[tool_alias]&lt;/code&gt; line and its row in the docs&amp;rsquo; Supported agents table, &lt;code&gt;TestProvidersComplete&lt;/code&gt; that every provider in &lt;code&gt;agents.Providers&lt;/code&gt; has its row in the docs&amp;rsquo; table of the API keys the proxy puts in, &lt;code&gt;TestToolchainsComplete&lt;/code&gt; that every toolchain has files that call for it and its row and section on the toolchains page, which names those files and its &lt;code&gt;PATH&lt;/code&gt; folders, &lt;code&gt;TestFormatsCoverLogins&lt;/code&gt; that every agent&amp;rsquo;s login file has its format in &lt;code&gt;internal/agentlogin&lt;/code&gt;, &lt;code&gt;TestBumpCoversPins&lt;/code&gt; that &lt;code&gt;scripts/bump.sh&lt;/code&gt; moves every pin it finds, or says why it&amp;rsquo;s left (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#updating-pinned-versions"&gt;updating pinned versions&lt;/a&gt;), and &lt;code&gt;TestReferenceIsCurrent&lt;/code&gt; that the CLI reference matches the commands. A new pair of places that must agree gets such a test.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-consolidation-pass"&gt;The consolidation pass&lt;span class="hx:absolute hx:-mt-20" id="the-consolidation-pass"&gt;&lt;/span&gt;
&lt;a href="#the-consolidation-pass" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A review of a body of work, and the review before a release, look across the code for copies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;two parsers of one format&lt;/li&gt;
&lt;li&gt;a path built outside &lt;code&gt;internal/paths&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;a list of files kept beside the folder that holds them&lt;/li&gt;
&lt;li&gt;a value encoded in a string&lt;/li&gt;
&lt;li&gt;two messages that say one thing&lt;/li&gt;
&lt;li&gt;a comment that says to keep two places in sync&lt;/li&gt;
&lt;li&gt;a test that copies a constant&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each copy gets one of three outcomes: extend the owner, make one owner, or leave it. Leave it when the only shared helper would be the wrong one, because a copy costs less than the wrong helper, and wait for a third copy before making one. The pass is part of those reviews, not a step every change runs.&lt;/p&gt;
&lt;h3 data-hextra-search-id="secrets-in-the-code"&gt;Secrets in the code&lt;span class="hx:absolute hx:-mt-20" id="secrets-in-the-code"&gt;&lt;/span&gt;
&lt;a href="#secrets-in-the-code" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A value that lets whoever holds it act as you or as a VM is a &lt;code&gt;redact.Secret&lt;/code&gt;, from the moment devvm reads it until the place it&amp;rsquo;s used. That covers a VM&amp;rsquo;s proxy password (&lt;code&gt;netpolicy.Key&lt;/code&gt;, &lt;code&gt;proxy.Config.Password&lt;/code&gt;, &lt;code&gt;backend.Confinement.ProxyPassword&lt;/code&gt;) and a build proxy&amp;rsquo;s, a secret&amp;rsquo;s value (&lt;code&gt;secrets.Store.Value&lt;/code&gt;, &lt;code&gt;Get&lt;/code&gt; and &lt;code&gt;Save&lt;/code&gt;, and what &lt;code&gt;ui.UI.Secret&lt;/code&gt; reads), the company proxy&amp;rsquo;s password and the &lt;code&gt;Proxy-Authorization&lt;/code&gt; the proxy sends it, the values the proxy caches for a VM&amp;rsquo;s bindings (&lt;code&gt;proxy.Lookup&lt;/code&gt;), and an agent&amp;rsquo;s API keys and tokens once they leave its login file (&lt;code&gt;agentlogin.File.Get&lt;/code&gt; and &lt;code&gt;SetKey&lt;/code&gt;, and the tokens a capture or a refresh brings). Two such values stay strings, as &lt;a href="https://next.devvm.dev/docs/contributing/design/#where-secret-values-live"&gt;where secret values live&lt;/a&gt; explains: the value on its way through &lt;code&gt;platform.KeychainGet&lt;/code&gt; and &lt;code&gt;KeychainSet&lt;/code&gt;, which &lt;code&gt;secrets.Store&lt;/code&gt; makes a &lt;code&gt;Secret&lt;/code&gt; at once, and devvm desktop&amp;rsquo;s VNC password, which you must see. A &lt;code&gt;Secret&lt;/code&gt; prints as &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; with &lt;code&gt;%v&lt;/code&gt;, &lt;code&gt;%s&lt;/code&gt;, &lt;code&gt;%q&lt;/code&gt;, &lt;code&gt;%x&lt;/code&gt;, &lt;code&gt;%#v&lt;/code&gt; and every other verb, so a log line, an error or a struct printed with &lt;code&gt;%+v&lt;/code&gt; never shows it. Its value is behind a pointer, because &lt;code&gt;fmt&lt;/code&gt; prints a value in an unexported field without calling its &lt;code&gt;Format&lt;/code&gt;, and such a field then shows only an address. Two &lt;code&gt;Secret&lt;/code&gt;s are equal with &lt;code&gt;==&lt;/code&gt; only when they&amp;rsquo;re the same one, so compare their values with &lt;code&gt;Reveal&lt;/code&gt;, or the structs that hold them with &lt;code&gt;reflect.DeepEqual&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Reveal&lt;/code&gt; is the only way to the value, and forbidigo refuses every call to it except in tests. So each place that must use a value says why in a &lt;code&gt;//nolint:forbidigo // &amp;lt;why&amp;gt;&lt;/code&gt; on that line. Those places are the proxy&amp;rsquo;s password check and the headers it puts values in, the store&amp;rsquo;s file and the Keychain, the VM&amp;rsquo;s proxy URL and a login&amp;rsquo;s file, its refresh and its claims. Anywhere else, pass the &lt;code&gt;Secret&lt;/code&gt; on. &lt;code&gt;testdata/lint/forbidigo.go&lt;/code&gt; keeps a call to &lt;code&gt;Reveal&lt;/code&gt; that the rule must report. The structure test refuses a struct that embeds &lt;code&gt;redact.Secret&lt;/code&gt; outside &lt;code&gt;internal/redact&lt;/code&gt;, which would take on its methods, and an interface that declares &lt;code&gt;Reveal() string&lt;/code&gt;, whose calls forbidigo wouldn&amp;rsquo;t see. It reads the source alone, so it doesn&amp;rsquo;t see a &lt;code&gt;Secret&lt;/code&gt; embedded through another type or reached through reflection.&lt;/p&gt;
&lt;p&gt;Encoding a &lt;code&gt;Secret&lt;/code&gt; as JSON or as text is an error (&lt;code&gt;redact.ErrEncode&lt;/code&gt;), never &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt;, so a value written somewhere by accident fails at once rather than losing your login. A file that must hold the real value therefore writes it through its own wire type, a struct with the value as a string that only that file&amp;rsquo;s reader and writer use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s config,&lt;/strong&gt; &lt;code&gt;proxy.json&lt;/code&gt;, is &lt;code&gt;configFile&lt;/code&gt;, with &lt;code&gt;Config&lt;/code&gt;&amp;rsquo;s fields in &lt;code&gt;Config&lt;/code&gt;&amp;rsquo;s order, so its bytes, and the &lt;code&gt;Sum&lt;/code&gt; that decides whether a running VM&amp;rsquo;s proxy starts again, match what earlier releases wrote. &lt;code&gt;TestConfigFile&lt;/code&gt; holds the two types together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s key in &lt;code&gt;vm.json&lt;/code&gt;&lt;/strong&gt; is &lt;code&gt;netpolicy.NetMade&lt;/code&gt;&amp;rsquo;s own &lt;code&gt;MarshalJSON&lt;/code&gt; and &lt;code&gt;UnmarshalJSON&lt;/code&gt;, through &lt;code&gt;netMade&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A secret&amp;rsquo;s file without a Keychain&lt;/strong&gt; is the value and a line&amp;rsquo;s end, which &lt;code&gt;secrets.Store.save&lt;/code&gt; writes and &lt;code&gt;saved&lt;/code&gt; reads.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A login&amp;rsquo;s file&lt;/strong&gt; is the agent&amp;rsquo;s own format, read and written whole as a map so that fields devvm doesn&amp;rsquo;t know stay, and a key or token leaves the map through &lt;code&gt;agentlogin&lt;/code&gt;&amp;rsquo;s &lt;code&gt;token&lt;/code&gt; and goes into it through &lt;code&gt;setToken&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To add a field that holds a secret, give it the type &lt;code&gt;redact.Secret&lt;/code&gt;. If a struct with it is written to a file, add the field to that file&amp;rsquo;s wire type, and check that a frozen release&amp;rsquo;s files still read and write the same bytes: &lt;code&gt;TestV010ProxyConfigs&lt;/code&gt; does it for &lt;code&gt;proxy.json&lt;/code&gt;, &lt;code&gt;TestFixtureVMStates&lt;/code&gt; for &lt;code&gt;vm.json&lt;/code&gt;&amp;rsquo;s sections, &lt;code&gt;TestFixtureStoreGet&lt;/code&gt; for a secret&amp;rsquo;s file on Linux, and &lt;code&gt;TestFixtureAgentStore&lt;/code&gt; for the agents&amp;rsquo; login files, which every read leaves as they were.&lt;/p&gt;
&lt;h2 data-hextra-search-id="changing-the-state-layout"&gt;Changing the state layout&lt;span class="hx:absolute hx:-mt-20" id="changing-the-state-layout"&gt;&lt;/span&gt;
&lt;a href="#changing-the-state-layout" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/internals/overview/#state-files"&gt;State files&lt;/a&gt; describes the layout, and &lt;a href="https://next.devvm.dev/docs/contributing/design/#the-state-layout"&gt;the design note&lt;/a&gt; says why it&amp;rsquo;s built that way. Every path in it comes from &lt;code&gt;internal/paths&lt;/code&gt;. &lt;code&gt;paths.Dirs&lt;/code&gt; names the shared folders and files, and &lt;code&gt;Dirs.VM(name)&lt;/code&gt; gives a VM&amp;rsquo;s &lt;code&gt;paths.VM&lt;/code&gt;, whose methods name each file in the VM&amp;rsquo;s folder: &lt;code&gt;Dirs.VMDir(hash)&lt;/code&gt;, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, for a project VM, and &lt;code&gt;run/builds/&amp;lt;name&amp;gt;/&lt;/code&gt; for a build VM. A new file of a VM&amp;rsquo;s gets a method on &lt;code&gt;paths.VM&lt;/code&gt;, so it lands in the VM&amp;rsquo;s folder, and &lt;code&gt;vmFolders.teardown&lt;/code&gt; in &lt;code&gt;internal/vm/teardown.go&lt;/code&gt; deletes it with the folder, with no list of files to update. A new socket goes in &lt;code&gt;Dirs.Run()&lt;/code&gt;, named by a hash, and &lt;code&gt;TestSocketsFit&lt;/code&gt; checks the longest path against &lt;code&gt;paths.SocketMax&lt;/code&gt;. A new record that only devvm writes is JSON, read with &lt;code&gt;encoding/json&lt;/code&gt;, which ignores fields it doesn&amp;rsquo;t know, and written whole with &lt;code&gt;state.WriteFile&lt;/code&gt;. A new default goes in &lt;code&gt;internal/settings&lt;/code&gt;, which reads &lt;code&gt;config.toml&lt;/code&gt; strictly and saves &lt;code&gt;settings.json&lt;/code&gt;, and a new lock is an OS file lock (&lt;code&gt;platform.LockFile&lt;/code&gt; and its kin) on a file that &lt;code&gt;paths&lt;/code&gt; names.&lt;/p&gt;
&lt;p&gt;The data folder and the config folder each hold a &lt;code&gt;version&lt;/code&gt; file with their layout version, &lt;code&gt;state.Layout&lt;/code&gt; in &lt;code&gt;internal/state/layout.go&lt;/code&gt;. Before each command that reads them, &lt;code&gt;state.CheckLayout&lt;/code&gt; takes &lt;code&gt;version.lock&lt;/code&gt; in the data folder and compares both files with &lt;code&gt;state.Layout&lt;/code&gt;. A folder without the file gets this devvm&amp;rsquo;s version, the same version goes on, and a newer one stops the command with &lt;code&gt;layout_newer&lt;/code&gt;, because a newer devvm changed the folders. An older one runs the migrations from that version to this one, in order, and then writes &lt;code&gt;state.Layout&lt;/code&gt; into both files. &lt;code&gt;skipsLayout&lt;/code&gt; in &lt;code&gt;internal/cli/root.go&lt;/code&gt; lists the commands that skip the check: help, completion, the version and devvm&amp;rsquo;s own hidden commands.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; makes two VMs on the allowlist tier, a forwarded port, a link and a secret, lists every file and folder under the data and config folders, and compares the lists with the ones at the end of the script, one for macOS and one for Linux. A change to the layout, such as a new file, a renamed folder or a file that moves, changes a listing, so the test fails until you update it. When it does, decide whether the change needs a new layout version:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A change that an older devvm would read wrongly, or a file that moves, raises &lt;code&gt;state.Layout&lt;/code&gt; by one.&lt;/li&gt;
&lt;li&gt;It adds a &lt;code&gt;state.Migration&lt;/code&gt; at the end of &lt;code&gt;migrations()&lt;/code&gt;, which changes the folders from the version before to the new one. A migration takes &lt;code&gt;paths.Dirs&lt;/code&gt;, and a run that it fails stops before the versions change, so the next run tries it again. &lt;code&gt;TestMigrations&lt;/code&gt; checks that there&amp;rsquo;s one migration for each version before this one, and &lt;code&gt;TestCheckLayout&lt;/code&gt; runs fake ones.&lt;/li&gt;
&lt;li&gt;It updates the listings in &lt;code&gt;layout.txtar&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A new file that an older devvm doesn&amp;rsquo;t need to know about, or a field added to a JSON file, which an older devvm ignores, keeps the version and changes only the listings.&lt;/p&gt;
&lt;h3 data-hextra-search-id="released-state"&gt;Released state&lt;span class="hx:absolute hx:-mt-20" id="released-state"&gt;&lt;/span&gt;
&lt;a href="#released-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Someone who upgrades devvm keeps their VMs, defaults, agent store and secrets as the release they came from left them. Until 1.0, an upgrade from every release since 0.1.0 has to work. Each final release that changed what devvm writes on disk has a frozen copy of the state it left, called its fixture, and the tests run today&amp;rsquo;s devvm on every fixture, so a change that breaks an older release&amp;rsquo;s state fails the gate.&lt;/p&gt;
&lt;h4 data-hextra-search-id="what-a-fixture-holds"&gt;What a fixture holds&lt;span class="hx:absolute hx:-mt-20" id="what-a-fixture-holds"&gt;&lt;/span&gt;
&lt;a href="#what-a-fixture-holds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;A release&amp;rsquo;s fixture is the folder &lt;code&gt;testdata/v&amp;lt;release&amp;gt;/&lt;/code&gt;. Its &lt;code&gt;darwin/&lt;/code&gt; folder holds the state that the release left on a Mac, and its &lt;code&gt;linux/&lt;/code&gt; folder the state it left on Linux. For 0.1.0, that&amp;rsquo;s four VMs&amp;rsquo; states, its defaults, its agent store and logins, the stubs&amp;rsquo; record of the VMs, and what its &lt;code&gt;--json&lt;/code&gt; printed for them, and the folder&amp;rsquo;s &lt;code&gt;README.md&lt;/code&gt; lists what each VM has. The release made these files itself. Its &lt;code&gt;generate.sh&lt;/code&gt; checks out the release&amp;rsquo;s tag in a temporary folder and runs &lt;code&gt;generate.txtar&lt;/code&gt; with that version&amp;rsquo;s own CLI test harness, then copies what the run left, with each file&amp;rsquo;s mode in &lt;code&gt;modes&lt;/code&gt;, because git doesn&amp;rsquo;t keep modes.&lt;/p&gt;
&lt;p&gt;A fixture is frozen. It&amp;rsquo;s generated once, from the release&amp;rsquo;s own binary, and never edited or generated again, so never run its &lt;code&gt;generate.sh&lt;/code&gt; from a newer devvm and never change its files. A release whose state is the same as the one before it adds no fixture, and neither does a release candidate, such as 0.1.1-rc.1, because only a final release that changes the state gets one.&lt;/p&gt;
&lt;h4 data-hextra-search-id="the-tests-on-every-fixture"&gt;The tests on every fixture&lt;span class="hx:absolute hx:-mt-20" id="the-tests-on-every-fixture"&gt;&lt;/span&gt;
&lt;a href="#the-tests-on-every-fixture" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The unit tests read every fixture&amp;rsquo;s files with today&amp;rsquo;s readers. &lt;code&gt;stateFixtures&lt;/code&gt; in &lt;code&gt;internal/vm/fixture_test.go&lt;/code&gt; lists each release&amp;rsquo;s expectations: its VMs, the version of their &lt;code&gt;vm.json&lt;/code&gt;, its layout version, its clones of one repo, and functions that check its VMs, its defaults and its agent store. 0.1.0&amp;rsquo;s entry is &lt;code&gt;v010Fixture&lt;/code&gt; in &lt;code&gt;fixture_v010_test.go&lt;/code&gt;. &lt;code&gt;TestFixtureVMStates&lt;/code&gt;, &lt;code&gt;TestFixtureVMsRead&lt;/code&gt;, &lt;code&gt;TestFixtureSettings&lt;/code&gt;, &lt;code&gt;TestFixtureAgentStore&lt;/code&gt; and &lt;code&gt;TestFixtureClonesReadAsOneRepo&lt;/code&gt; run once for each release and system, and they check that each field the release wrote reads and writes back unchanged. &lt;code&gt;TestStateFixturesListed&lt;/code&gt; fails when a folder in &lt;code&gt;testdata&lt;/code&gt; has no entry, or an entry has no folder. Two packages keep a table of their own for what only they read. In &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;fixtureBinaries&lt;/code&gt; records the SHA-256 of the binary that made each release&amp;rsquo;s state, which its proxy configs name, and &lt;code&gt;TestFixtureBindings&lt;/code&gt; and &lt;code&gt;TestFixtureProxyConfig&lt;/code&gt; read every release&amp;rsquo;s bindings files and proxy configs. In &lt;code&gt;internal/secrets&lt;/code&gt;, &lt;code&gt;storeFixtures&lt;/code&gt; names a secret that each release&amp;rsquo;s store on Linux keeps as a file, which &lt;code&gt;TestFixtureStoreGet&lt;/code&gt; reads through a VM&amp;rsquo;s binding. &lt;code&gt;TestV010Rules&lt;/code&gt; is a copy of 0.1.0&amp;rsquo;s own tests of the proxy&amp;rsquo;s rules, kept apart from today&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;The CLI tests run today&amp;rsquo;s commands on each fixture. A release&amp;rsquo;s scripts are in &lt;code&gt;testdata/script/&lt;/code&gt;, named &lt;code&gt;fixture_v&lt;/code&gt; and the release&amp;rsquo;s version without its dots, such as &lt;code&gt;fixture_v010.txtar&lt;/code&gt;, &lt;code&gt;fixture_v010_clone.txtar&lt;/code&gt; and &lt;code&gt;fixture_v010_network.txtar&lt;/code&gt; for 0.1.0. Each one puts the state into a sandbox with &lt;code&gt;fixture v&amp;lt;release&amp;gt;&lt;/code&gt;, which moves it to the sandbox&amp;rsquo;s folder: the folder&amp;rsquo;s path, each VM&amp;rsquo;s name hash, its folder&amp;rsquo;s and &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identities and its backend&amp;rsquo;s place become what they are there, each host port, and each port that a VM or the defaults forward, becomes one of the sandbox&amp;rsquo;s own that nothing on this host listens on, and nothing else changes. The ports change because a launch that finds a VM&amp;rsquo;s port taken, by a program of yours or by another run of the tests, rightly chooses another one and edits the VM&amp;rsquo;s Lima config. It also warns that it can&amp;rsquo;t forward a port that a program has, such as a web server of yours on 3000. A script names a forwarded port by what it was, as &lt;code&gt;$FIXTURE_PORT_3000&lt;/code&gt;. The script then runs today&amp;rsquo;s devvm on it. Each &lt;code&gt;--json&lt;/code&gt; must have everything the release&amp;rsquo;s had (&lt;code&gt;json_superset&lt;/code&gt;), the read-only commands must change no file, and a launch must start each VM as it is, without a Lima edit. The scripts stay separate for each release, because their checks name that release&amp;rsquo;s VMs and what each one has, and &lt;code&gt;TestFixtureScripts&lt;/code&gt; in &lt;code&gt;internal/cli&lt;/code&gt; fails when a fixture has no script or a script names a fixture that isn&amp;rsquo;t there.&lt;/p&gt;
&lt;h4 data-hextra-search-id="changing-what-devvm-does-with-state"&gt;Changing what devvm does with state&lt;span class="hx:absolute hx:-mt-20" id="changing-what-devvm-does-with-state"&gt;&lt;/span&gt;
&lt;a href="#changing-what-devvm-does-with-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;A change that reads or writes state, such as a new command, a new section in &lt;code&gt;vm.json&lt;/code&gt; or a new field in a record, runs its new commands on every fixture in the same commit, and reading the files isn&amp;rsquo;t enough. Add the steps to each release&amp;rsquo;s scripts, as &lt;code&gt;fixture_v010_network.txtar&lt;/code&gt; runs rules by method and path on 0.1.0&amp;rsquo;s app VM and &lt;code&gt;fixture_v010_clone.txtar&lt;/code&gt; runs devvm clone add on its web VM. When a fixture&amp;rsquo;s test fails, today&amp;rsquo;s devvm breaks the state that the release&amp;rsquo;s users have. Fix devvm, or add a migration, but never change the fixture.&lt;/p&gt;
&lt;p&gt;A change in what devvm does with existing state gets a line in &lt;code&gt;CHANGELOG.md&lt;/code&gt;, in the Unreleased section at the bottom until its release moves it to the top: a step in What to do when the user has to act on it, and otherwise a line in the group of the people who notice it, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; says. When the user has to do something about it, such as run a command, devvm also tells them once, at the first launch after the upgrade.&lt;/p&gt;
&lt;h4 data-hextra-search-id="freezing-a-releases-state"&gt;Freezing a release&amp;rsquo;s state&lt;span class="hx:absolute hx:-mt-20" id="freezing-a-releases-state"&gt;&lt;/span&gt;
&lt;a href="#freezing-a-releases-state" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;At release time, after the tag exists, a final release that changed the state format gets its fixture. A release candidate gets none, even when it changed the state, and its final release&amp;rsquo;s fixture holds that state:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy the newest fixture&amp;rsquo;s &lt;code&gt;generate.sh&lt;/code&gt;, &lt;code&gt;generate.txtar&lt;/code&gt; and &lt;code&gt;README.md&lt;/code&gt; into &lt;code&gt;testdata/v&amp;lt;release&amp;gt;/&lt;/code&gt;. Set the tag, the version and the script&amp;rsquo;s name in &lt;code&gt;generate.sh&lt;/code&gt;, and add the VMs and commands to &lt;code&gt;generate.txtar&lt;/code&gt; that make the state the release added.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;generate.sh&lt;/code&gt; on a Mac and on Linux, which writes &lt;code&gt;darwin/&lt;/code&gt; and &lt;code&gt;linux/&lt;/code&gt;. 0.1.0&amp;rsquo;s were made on an arm64 Mac and on x86_64 Fedora.&lt;/li&gt;
&lt;li&gt;Add the release&amp;rsquo;s entries in &lt;code&gt;stateFixtures&lt;/code&gt;, &lt;code&gt;fixtureBinaries&lt;/code&gt; and &lt;code&gt;storeFixtures&lt;/code&gt;, and its scripts, made from the newest release&amp;rsquo;s scripts with checks of its own VMs.&lt;/li&gt;
&lt;li&gt;Commit the folder as the run left it. The older fixtures stay as they are.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 data-hextra-search-id="the-support-window"&gt;The support window&lt;span class="hx:absolute hx:-mt-20" id="the-support-window"&gt;&lt;/span&gt;
&lt;a href="#the-support-window" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;An upgrade from every release since 0.1.0 works until 1.0. When a release leaves the window, its fixture and the code that only its state needs, such as a reader of a field that only that release wrote, go together, in one commit that says which release left and why. The commit deletes &lt;code&gt;testdata/v&amp;lt;release&amp;gt;/&lt;/code&gt;, its scripts and its entries in the tables above.&lt;/p&gt;</description></item><item><title>Backends, toolchains and agents</title><link>https://next.devvm.dev/docs/contributing/extending/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/extending/</guid><description>
&lt;h2 data-hextra-search-id="how-a-backend-plugs-in"&gt;How a backend plugs in&lt;span class="hx:absolute hx:-mt-20" id="how-a-backend-plugs-in"&gt;&lt;/span&gt;
&lt;a href="#how-a-backend-plugs-in" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm runs every VM on Lima, but the rest of devvm reaches Lima only through the &lt;code&gt;backend.Backend&lt;/code&gt; interface in &lt;code&gt;internal/backend&lt;/code&gt;, so another backend is an addition rather than a change to the callers. A backend lives in a package of its own under &lt;code&gt;internal/backend&lt;/code&gt;, and it does four things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It implements &lt;code&gt;backend.Backend&lt;/code&gt;&lt;/strong&gt; and returns its errors instead of ending the run: a &lt;code&gt;msg.M&lt;/code&gt;, or &lt;code&gt;backend.Logged(m)&lt;/code&gt; once a logged command failed, so the command shows the run log&amp;rsquo;s end before the message. &lt;code&gt;Backend&lt;/code&gt; is the backend&amp;rsquo;s &lt;code&gt;Name&lt;/code&gt; and &lt;code&gt;Caps&lt;/code&gt; and four roles, each an interface of its own that every backend implements in full:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;backend.Host&lt;/code&gt; is what the backend needs of this machine and where it keeps its VMs there. &lt;code&gt;Problems&lt;/code&gt; lists what the host lacks for it, and &lt;code&gt;backend.Check(ctx, b)&lt;/code&gt; returns the first of them, so a backend doesn&amp;rsquo;t write a check of its own. &lt;code&gt;NameMax&lt;/code&gt; is the longest VM name it takes, &lt;code&gt;Location&lt;/code&gt; is where its VMs live when that can change between runs (&lt;code&gt;backend.LocationOf&lt;/code&gt;), and &lt;code&gt;DiskDirs&lt;/code&gt; and &lt;code&gt;Floors&lt;/code&gt; are the folders its disks are in and the free space it wants there (&lt;code&gt;backend.Space&lt;/code&gt;). A backend whose VMs can&amp;rsquo;t move returns &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt; from &lt;code&gt;Location&lt;/code&gt;, and one whose disks aren&amp;rsquo;t on this machine returns no &lt;code&gt;DiskDirs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backend.Images&lt;/code&gt; builds images and the shared tools&amp;rsquo; images and keeps the images. &lt;code&gt;BuildImage&lt;/code&gt; runs the spec&amp;rsquo;s &lt;code&gt;Recipe&lt;/code&gt; (&lt;code&gt;image.Recipe&lt;/code&gt;, which &lt;code&gt;internal/build&lt;/code&gt; puts together and &lt;code&gt;image.Input&lt;/code&gt; hashes) as it is, each &lt;code&gt;image.Step&lt;/code&gt; with its arguments and as root when it says so. &lt;code&gt;Origin&lt;/code&gt; is the backend&amp;rsquo;s own steps that base starts with, such as the Ubuntu image Lima pinned on this machine, a &lt;code&gt;--from&lt;/code&gt; image&amp;rsquo;s conversion, base&amp;rsquo;s disk size (&lt;code&gt;backend.BaseDiskGiB&lt;/code&gt;) and &lt;code&gt;base.yaml&lt;/code&gt;. Base&amp;rsquo;s size is &lt;code&gt;backend.BaseCPUs&lt;/code&gt;, &lt;code&gt;backend.BaseMemoryGiB&lt;/code&gt; and &lt;code&gt;backend.BaseDiskGiB&lt;/code&gt;, never read from a backend&amp;rsquo;s files. &lt;code&gt;internal/build&lt;/code&gt; puts them first in base&amp;rsquo;s recipe, as its &lt;code&gt;Origin&lt;/code&gt;, so base&amp;rsquo;s key hashes them, and &lt;code&gt;BuildImage&lt;/code&gt; is given them back and runs those rather than reading its own files again. &lt;code&gt;PinOrigin&lt;/code&gt; pins what base starts from on this machine, which &lt;code&gt;internal/build&lt;/code&gt; asks for before it keys a build (&lt;code&gt;backend.PinFirst&lt;/code&gt;): on Lima, that&amp;rsquo;s the newest Ubuntu cloud image (&lt;code&gt;state.UbuntuPin&lt;/code&gt;, found by &lt;code&gt;ubuntu.Finder&lt;/code&gt;). A base build&amp;rsquo;s &lt;code&gt;ImageSpec.Packages&lt;/code&gt;, a &lt;code&gt;backend.Packages&lt;/code&gt;, sends its packages into the VM&amp;rsquo;s &lt;code&gt;backend.PackagesDir&lt;/code&gt; before the steps and takes them out after, which &lt;code&gt;internal/build/packages.go&lt;/code&gt; records or replays and checks, and a step that exits &lt;code&gt;backend.ExitUnreachable&lt;/code&gt; fails as &lt;code&gt;build_sources_unreachable&lt;/code&gt;. &lt;code&gt;DeleteToolsLeft&lt;/code&gt; deletes the throwaway VMs that &lt;code&gt;BuildTools&lt;/code&gt; left, such as a killed run&amp;rsquo;s, and never another VM or an image, and it returns the ones it deleted, which devvm gc names. devvm gc asks for it while it holds the share&amp;rsquo;s lock, so no build of this data folder&amp;rsquo;s is using them, but a devvm with another data folder and the same Lima home holds a lock of its own (&lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;), so the two mustn&amp;rsquo;t build tools or run gc at once. A backend whose builds leave none does nothing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backend.Machines&lt;/code&gt; makes, starts, stops, renames and deletes VMs, lists them, and runs commands and shells in them. A stopped VM changes only at &lt;code&gt;Start&lt;/code&gt;, which first checks with &lt;code&gt;backend.Validate&lt;/code&gt; that it can apply the VM&amp;rsquo;s &lt;code&gt;backend.Want&lt;/code&gt;, such as a disk no smaller than the VM&amp;rsquo;s own, and then applies what the &lt;code&gt;Want&lt;/code&gt; asks where it differs from the VM. &lt;code&gt;Start&lt;/code&gt; leaves a running VM as it is, and the callers, not the backend, warn that a change waits for the VM&amp;rsquo;s next start. On Lima, &lt;code&gt;Start&lt;/code&gt; owns the config&amp;rsquo;s &lt;code&gt;env:&lt;/code&gt;, &lt;code&gt;propagateProxyEnv&lt;/code&gt;, &lt;code&gt;dns&lt;/code&gt; and &lt;code&gt;hostResolver&lt;/code&gt;, and a project VM&amp;rsquo;s size, agent mounts and &lt;code&gt;forwardAgent&lt;/code&gt;, which it compares with the VM&amp;rsquo;s before its one edit (&lt;a href="https://next.devvm.dev/docs/internals/lima/#what-devvm-sets-on-a-vm"&gt;what devvm sets on a VM&lt;/a&gt;). Ports are never the backend&amp;rsquo;s: &lt;code&gt;vmssh.Forwards&lt;/code&gt; forwards them over the backend&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt;. &lt;code&gt;Running&lt;/code&gt; says how a VM runs now, in one &lt;code&gt;backend.Run&lt;/code&gt;: the ID of its current start, whether it&amp;rsquo;s confined to its proxy, and its lifeline, the file that the VM&amp;rsquo;s proxy and port forwarder follow. The backend runs no port forwarder of its own, and &lt;code&gt;SSH&lt;/code&gt; says how ssh, links and devvm&amp;rsquo;s forwarder (&lt;code&gt;vmssh.Forwards&lt;/code&gt;) reach a running VM&amp;rsquo;s sshd, a target that &lt;code&gt;vmssh.FromTarget&lt;/code&gt; checks. Every ssh of devvm&amp;rsquo;s to a VM, its port forwarder&amp;rsquo;s included, refuses a target that isn&amp;rsquo;t on this machine&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;, with &lt;code&gt;vmssh.FromTarget&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/backends/#what-each-backend-emulates"&gt;what each backend emulates&lt;/a&gt;). All three get it through &lt;code&gt;vmssh.Checked&lt;/code&gt;, which checks the review lets the backend&amp;rsquo;s ssh through, checks the target, and adds the VM&amp;rsquo;s host keys for its current start, reading the record (&lt;code&gt;vmssh.ReadKeys&lt;/code&gt;) or pinning the keys first (&lt;code&gt;vmssh.PinKeys&lt;/code&gt;). A VM whose ssh isn&amp;rsquo;t usable fails with a &lt;code&gt;*vmssh.UnusableError&lt;/code&gt; and one without host keys with &lt;code&gt;vmssh.ErrNoHostKeys&lt;/code&gt;, which the ssh config skips on. &lt;code&gt;Exec&lt;/code&gt; passes its &lt;code&gt;backend.ExecOpts&lt;/code&gt; streams on as they are. When they&amp;rsquo;re a terminal&amp;rsquo;s files, the command must get a terminal in the VM, as a shell does, because an agent&amp;rsquo;s login that draws full-screen needs one, and any other streams are pipes (&lt;code&gt;TestExecStreamsAsGiven&lt;/code&gt; on Lima).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;backend.Housekeeping&lt;/code&gt; is what devvm space and devvm gc ask: &lt;code&gt;Usage&lt;/code&gt;, &lt;code&gt;Strays&lt;/code&gt;, and &lt;code&gt;DevvmCache&lt;/code&gt; and &lt;code&gt;DeleteCache&lt;/code&gt; for its own caches. A backend that can&amp;rsquo;t tell returns none. devvm gc also asks &lt;code&gt;backend.Images&lt;/code&gt; for &lt;code&gt;DeleteToolsLeft&lt;/code&gt;, which sits beside &lt;code&gt;BuildTools&lt;/code&gt;, whose VMs it deletes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;backend.Forgetter&lt;/code&gt; is the one role a backend may leave out, for the files it keeps for a VM besides the VM. Lima keeps none. Lima&amp;rsquo;s type, &lt;code&gt;lima.Lima&lt;/code&gt;, holds the backend&amp;rsquo;s fields, &lt;code&gt;Name&lt;/code&gt;, &lt;code&gt;Caps&lt;/code&gt; and the helpers its roles share, and it embeds one type for each role, &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;images&lt;/code&gt;, &lt;code&gt;machines&lt;/code&gt; and &lt;code&gt;housekeeping&lt;/code&gt;, each over the &lt;code&gt;Lima&lt;/code&gt; it&amp;rsquo;s part of. &lt;code&gt;backendtest.Fake&lt;/code&gt; is split the same way. So no type has more methods than the structure test allows, and a new method goes on the type of its role.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It declares &lt;code&gt;Caps&lt;/code&gt;&lt;/strong&gt;, saying for each of &lt;code&gt;backend.Features&lt;/code&gt; whether it has the feature natively, emulates it, or lacks it (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;). It lists every feature by hand, &lt;code&gt;None&lt;/code&gt; included, and &lt;code&gt;Registry.Register&lt;/code&gt; refuses &lt;code&gt;Caps&lt;/code&gt; that leave one out or rate a feature better than the one &lt;code&gt;Feature.BuiltOn&lt;/code&gt; says it&amp;rsquo;s built on (&lt;code&gt;Caps.Check&lt;/code&gt;). The callers, not the backend, decide what a VM needs, and they check it with the registry&amp;rsquo;s &lt;code&gt;Review.Require(b, vm, spec.Features()...)&lt;/code&gt; before they act. A feature the backend lacks fails in one line that names the VM and what to do, and devvm never falls back to something weaker. An emulation stays refused until its review passes: a design note in &lt;a href="https://next.devvm.dev/docs/contributing/design/"&gt;the design notes&lt;/a&gt;, a threat check with the security-audit skill, and end-to-end checks that prove its guarantee.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It&amp;rsquo;s registered in &lt;code&gt;registry.New&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;internal/backend/registry&lt;/code&gt;), the only place besides &lt;code&gt;internal/cli&lt;/code&gt; that imports a backend. The registry hands the backend out behind its guard, which checks every &lt;code&gt;CreateVM&lt;/code&gt;, &lt;code&gt;Start&lt;/code&gt;, &lt;code&gt;BuildImage&lt;/code&gt; and &lt;code&gt;BuildTools&lt;/code&gt; call before the backend sees it. The guard refuses a spec that needs a feature &lt;code&gt;Review.Require&lt;/code&gt; would refuse, using the specs&amp;rsquo; own &lt;code&gt;Features&lt;/code&gt;, and a build spec whose &lt;code&gt;ImageSpec.Validate&lt;/code&gt; or &lt;code&gt;ToolsSpec.Validate&lt;/code&gt; fails, such as one with a network that isn&amp;rsquo;t a build&amp;rsquo;s or a key that isn&amp;rsquo;t one. So a caller that forgets &lt;code&gt;Require&lt;/code&gt; still can&amp;rsquo;t reach a backend with a feature it lacks, and the backend doesn&amp;rsquo;t check those specs itself. The guard has every role&amp;rsquo;s methods, its own in place of the backend&amp;rsquo;s for those calls, so a guarded backend handed on as a &lt;code&gt;backend.Images&lt;/code&gt; or a &lt;code&gt;backend.Machines&lt;/code&gt; is still guarded. The guard&amp;rsquo;s type has only &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s methods, so code that looks for an optional role, such as &lt;code&gt;backend.Forgetter&lt;/code&gt;, uses &lt;code&gt;backend.As&lt;/code&gt; instead of a type assertion, and the structure test fails on a type assertion to a backend package&amp;rsquo;s type anywhere but the guard.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It names its images by key&lt;/strong&gt;, and an image&amp;rsquo;s key hashes the backend&amp;rsquo;s name, so two backends never share an image.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It passes the conformance suite&lt;/strong&gt;, &lt;code&gt;backendtest.Conformance(t, factory)&lt;/code&gt;, which checks the contract that &lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s documentation gives. The backend&amp;rsquo;s tests call it with a factory that returns a new &lt;code&gt;backendtest.Subject&lt;/code&gt; for each check, and each check runs as a subtest. The subject is the backend, holding one image, whose key is &lt;code&gt;Image&lt;/code&gt;, and no VMs. &lt;code&gt;Dir&lt;/code&gt; is a folder of the check&amp;rsquo;s own for the folders its VMs mount, &lt;code&gt;Boots&lt;/code&gt; says whether its VMs start, and &lt;code&gt;Restart&lt;/code&gt; starts a running VM again outside &lt;code&gt;Start&lt;/code&gt;, as a command of the user&amp;rsquo;s own would. The suite checks every role&amp;rsquo;s answers and the empty answers each role allows, that a VM is made, renamed and deleted as its spec says, and that a missing VM is &lt;code&gt;backend.ErrNotFound&lt;/code&gt;. It also checks that &lt;code&gt;Running&lt;/code&gt; gives a stopped VM its lifeline with an empty &lt;code&gt;ID&lt;/code&gt;, that every start gets another &lt;code&gt;ID&lt;/code&gt;, that a VM is &lt;code&gt;Confined&lt;/code&gt; only while it runs on a start &lt;code&gt;Start&lt;/code&gt; made with &lt;code&gt;NetProxy&lt;/code&gt;, and that the registry&amp;rsquo;s guard still refuses what the backend lacks when the backend is used as &lt;code&gt;backend.Images&lt;/code&gt; or &lt;code&gt;backend.Machines&lt;/code&gt; alone. &lt;code&gt;checkProxyURL&lt;/code&gt; checks what the open tier needs of every backend, which has no feature of its own (&lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;features&lt;/a&gt;): a VM on the backend&amp;rsquo;s own network (&lt;code&gt;NetDirect&lt;/code&gt;) reaches a port on the host&amp;rsquo;s loopback, and the guest&amp;rsquo;s proxy settings come from the confinement (&lt;code&gt;Confinement.GuestProxy&lt;/code&gt;, &lt;code&gt;ProxyURL&lt;/code&gt;). When &lt;code&gt;Boots&lt;/code&gt; is false, the checks that need a running VM are skipped with the reason, and when &lt;code&gt;Restart&lt;/code&gt; is nil, so is the one that needs it. &lt;code&gt;backendtest.Fake&lt;/code&gt; runs the suite in &lt;code&gt;internal/backend/backendtest&lt;/code&gt;, and &lt;code&gt;TestConformance&lt;/code&gt; in &lt;code&gt;internal/backend/lima&lt;/code&gt; runs it on Lima twice: on the limactl stub, whose VMs start, and on real Lima&amp;rsquo;s dummy instances, which can&amp;rsquo;t boot, so the checks that need a running VM are left to the end-to-end tests. The real Lima run skips when limactl isn&amp;rsquo;t on &lt;code&gt;PATH&lt;/code&gt;. &lt;code&gt;TestConformanceFinds&lt;/code&gt; checks the suite itself: each of a set of fakes that breaks the contract in one method fails the check meant to catch it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The registry&amp;rsquo;s &lt;code&gt;For&lt;/code&gt; chooses a VM&amp;rsquo;s backend: a VM that exists gets the one its state records in &lt;code&gt;backend=&lt;/code&gt;, and a new VM gets &lt;code&gt;backend.Default&lt;/code&gt;, which is &lt;code&gt;lima&lt;/code&gt;. Tests set the registry&amp;rsquo;s &lt;code&gt;NewVMs&lt;/code&gt; to give new VMs a fake backend (&lt;code&gt;backendtest.Fake&lt;/code&gt;). The command line has no way to choose a backend, so a second backend would also add one, following the &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/cli/SKILL.md" target="_blank" rel="noopener"&gt;cli skill&lt;/a&gt;, together with its column in the tables that list VMs, images and caches. &lt;code&gt;--json&lt;/code&gt; output already names each VM&amp;rsquo;s, image&amp;rsquo;s and shared tool&amp;rsquo;s backend.&lt;/p&gt;
&lt;p&gt;A new backend gets a design note and a threat check with the security-audit skill before any of its emulations is marked reviewed, and that check covers what Lima gets from its VMs&amp;rsquo; design. A VM started outside devvm must not forward an agent devvm didn&amp;rsquo;t choose, a VM whose root can change its own network must not count as confined, a secret the proxy needs goes in a private file and never in a command&amp;rsquo;s arguments, and a socket on this machine goes in a private folder.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-a-toolchain"&gt;Adding a toolchain&lt;span class="hx:absolute hx:-mt-20" id="adding-a-toolchain"&gt;&lt;/span&gt;
&lt;a href="#adding-a-toolchain" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each toolchain is one &lt;code&gt;image.ToolDef&lt;/code&gt; entry in &lt;code&gt;image.SharedTools&lt;/code&gt;, in &lt;code&gt;internal/image/tool.go&lt;/code&gt;, and the rest of devvm reads every list of the toolchains and every fact of one from there: its members in the lock, the files in a project folder that call for it, its installer, the environment that every VM&amp;rsquo;s shells get, the folders of the VM&amp;rsquo;s home that go on every VM&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;, and the members whose version files mise reads. &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;devvm tools&lt;/code&gt;, the picker, shell completion, the new VM&amp;rsquo;s summary and the &lt;code&gt;devcontainer.json&lt;/code&gt; features that devvm maps list the toolchains from the table too, and every launch writes the environment, the &lt;code&gt;PATH&lt;/code&gt; folders and the version files into the VM, so a new toolchain changes no image. A new toolchain that mise installs from the lock&amp;rsquo;s checked downloads, as it installs node, python and go, needs these files and nothing else:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;internal/image/tool.go&lt;/code&gt;: its entry, with its &lt;code&gt;Env&lt;/code&gt;, &lt;code&gt;PathDirs&lt;/code&gt; and &lt;code&gt;VersionFiles&lt;/code&gt; when it has them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;: a line in &lt;code&gt;[tools]&lt;/code&gt; for each member, with its hold, and a line in &lt;code&gt;[tool_alias]&lt;/code&gt; for each member that isn&amp;rsquo;t one of mise&amp;rsquo;s own (&lt;code&gt;core:&lt;/code&gt;), naming the backend it comes from.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/&amp;lt;name&amp;gt;.policy&lt;/code&gt;: the hosts its allowlist allows, such as its package registry and the downloads of the versions a project asks for.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;testdata/mise.lock&lt;/code&gt; and &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;: each member&amp;rsquo;s lock entry, which &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; writes into the second.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docs/content/docs/using/toolchains.md&lt;/code&gt;: its row in the table, in the registry&amp;rsquo;s order, its section, with what it brings, the files that call for it, its version files, its global installs and its allowlist, and its row in the glibc table of Which bases they run on.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tests/e2e/tools_test.go&lt;/code&gt;: its checks, such as a project&amp;rsquo;s VM that its files call for, a global install and a version file&amp;rsquo;s own version.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then the golden files in &lt;code&gt;internal/vm/testdata/golden&lt;/code&gt; take its environment, its &lt;code&gt;PATH&lt;/code&gt; folders and its version files with &lt;code&gt;UPDATE_GOLDEN=1 go test ./internal/vm -run Golden&lt;/code&gt;, and a reviewer reads their diff. &lt;code&gt;TestToolchainsComplete&lt;/code&gt;, &lt;code&gt;TestToolchainGuest&lt;/code&gt;, &lt;code&gt;TestSharedToolsPolicies&lt;/code&gt; and &lt;code&gt;TestConfigTools&lt;/code&gt; fail until those files match the table, and the structure test fails on a string literal elsewhere that is its name or a member&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;A toolchain that needs more than mise&amp;rsquo;s install gets code of its own, which the table can&amp;rsquo;t hold. A step in each VM, such as rust&amp;rsquo;s rustup in &lt;code&gt;~/.cargo&lt;/code&gt;, go&amp;rsquo;s telemetry switch or dotnet&amp;rsquo;s &lt;code&gt;/etc/dotnet/install_location&lt;/code&gt;, is a block of &lt;code&gt;assets/guest/sync.sh&lt;/code&gt; that reads the toolchain&amp;rsquo;s version from the VM&amp;rsquo;s tool list. An install that mise can&amp;rsquo;t check, such as rust&amp;rsquo;s, which rustup checks against its own signed manifest, or dotnet&amp;rsquo;s, whose SDK archive devvm adds to the lock with its SHA-512, is an &lt;code&gt;Installer&lt;/code&gt; of its own, with its branch in &lt;code&gt;assets/shared-tools/build.sh&lt;/code&gt; and its handling of the lock in &lt;code&gt;internal/tools&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="adding-a-coding-agent"&gt;Adding a coding agent&lt;span class="hx:absolute hx:-mt-20" id="adding-a-coding-agent"&gt;&lt;/span&gt;
&lt;a href="#adding-a-coding-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each coding agent is one &lt;code&gt;agents.Def&lt;/code&gt; in &lt;code&gt;internal/agents/agents.go&lt;/code&gt;, and the rest of devvm reads every list of the agents and every fact of one from there: its shared tool (&lt;code&gt;image.SharedTools&lt;/code&gt; makes its entry, glibc-only or not), its settings folders and files with each file&amp;rsquo;s format, its &lt;code&gt;Seeds&lt;/code&gt;, its &lt;code&gt;Names&lt;/code&gt; and &lt;code&gt;NamedValues&lt;/code&gt;, the folder that &lt;code&gt;devvm agent import&lt;/code&gt; copies from, which of that folder&amp;rsquo;s entries are each machine&amp;rsquo;s own (its &lt;code&gt;FolderOwn&lt;/code&gt;), which neither the import nor the save copies and no VM gets, its login files and their kinds, its history and what an export leaves out of it (its logins, and what&amp;rsquo;s the VM&amp;rsquo;s own as a machine, its &lt;code&gt;HistoryOwn&lt;/code&gt;, which a VM made again keeps), where in that history it makes git worktrees, which &lt;code&gt;devvm rm&lt;/code&gt; and a remake with &lt;code&gt;--clean-home&lt;/code&gt; check for uncommitted changes first (its &lt;code&gt;Worktrees&lt;/code&gt;), the environment that every VM&amp;rsquo;s shells get, which turns off its self-update and telemetry, the secret every VM with it uses, how &lt;code&gt;devvm agent login&lt;/code&gt; logs it in (its &lt;code&gt;Login&lt;/code&gt;: the command lines of its own login, with a code and for a setup token, and whether the login comes back to a forwarded port or you paste a code back; or API keys alone), whether &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; takes it, and its row in the docs&amp;rsquo; Supported agents table (its &lt;code&gt;Docs&lt;/code&gt;). Its &lt;code&gt;Seeds&lt;/code&gt; are the folders it reads in a VM as a seed of a folder of the VM&amp;rsquo;s own, such as Claude Code&amp;rsquo;s plugins. Each one has the link that the VM&amp;rsquo;s home puts the store&amp;rsquo;s folder at and the entries that &lt;code&gt;devvm agent import&lt;/code&gt; and &lt;code&gt;devvm agent save&lt;/code&gt; copy, which &lt;code&gt;agents.MachineOwn&lt;/code&gt; judges. Its &lt;code&gt;Names&lt;/code&gt; and &lt;code&gt;NamedValues&lt;/code&gt; are the tables in its settings files whose keys are names you choose, such as its MCP servers&amp;rsquo;, which &lt;code&gt;agentlogin.Redact&lt;/code&gt; doesn&amp;rsquo;t judge as keys, read from the agent&amp;rsquo;s own docs. The commands&amp;rsquo; help, &lt;code&gt;--agents&lt;/code&gt;, the picker, shell completion, the messages and the CLI tests&amp;rsquo; lists of the agents all come from the registry too. A new agent that works like one devvm has needs these files and nothing else:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;internal/agents/agents.go&lt;/code&gt;: its &lt;code&gt;Def&lt;/code&gt; and its name&amp;rsquo;s constant.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt;: its line in &lt;code&gt;[tool_alias]&lt;/code&gt;, the backend it comes from, and in &lt;code&gt;[tools]&lt;/code&gt;, its version.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/shared-tools/&amp;lt;name&amp;gt;.policy&lt;/code&gt;: the hosts its allowlist allows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;testdata/mise.lock&lt;/code&gt; and &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;: its lock entry, which &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; writes into the second.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docs/content/docs/using/coding-agents.md&lt;/code&gt;: a section on its login when it has one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CHANGELOG.md&lt;/code&gt;: its entry.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tests/e2e/network_test.go&lt;/code&gt;: its name in the network section&amp;rsquo;s &lt;code&gt;--agents&lt;/code&gt; list, which launches one VM with every agent, and the checks of its allowlist, its login and its copies there.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;assets/guest/sync.sh&lt;/code&gt;, only when it needs setup in the VM beyond its settings and logins, as Claude Code&amp;rsquo;s link in &lt;code&gt;~/.local/bin&lt;/code&gt; and Codex&amp;rsquo;s lines in its &lt;code&gt;config.toml&lt;/code&gt; do.&lt;/li&gt;
&lt;li&gt;When it keeps a login file: a format for each of its kinds in a file of its own in &lt;code&gt;internal/agentlogin&lt;/code&gt;, named for the agent, with the &lt;code&gt;format&lt;/code&gt; interface&amp;rsquo;s methods, &lt;code&gt;kind&lt;/code&gt; naming its kind (and &lt;code&gt;keyFormat&lt;/code&gt; or &lt;code&gt;chatGPTFormat&lt;/code&gt; when its &lt;code&gt;Def&lt;/code&gt; says it saves API keys or holds a ChatGPT login, and &lt;code&gt;captureFormat&lt;/code&gt; when the VM&amp;rsquo;s proxy captures its logins: its token endpoints, the start of its &lt;code&gt;User-Agent&lt;/code&gt; when another agent shares an endpoint, its capture and its reply to the VM&amp;rsquo;s own refresh), added to the list in &lt;code&gt;formats&lt;/code&gt; in &lt;code&gt;format.go&lt;/code&gt;, with its fixture in &lt;code&gt;goldenLogins&lt;/code&gt; (&lt;code&gt;internal/agentlogin/golden_test.go&lt;/code&gt;) and its golden file, and its format&amp;rsquo;s section in &lt;code&gt;internals/network.md&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then &lt;code&gt;mise run cli-docs&lt;/code&gt; writes the agent&amp;rsquo;s row in the Supported agents table, its name in the README&amp;rsquo;s list and the CLI pages whose help lists the agents, and the golden files in &lt;code&gt;internal/vm/testdata/golden&lt;/code&gt; take its paths with &lt;code&gt;UPDATE_GOLDEN=1 go test ./internal/vm -run Golden&lt;/code&gt;. &lt;code&gt;TestDefsComplete&lt;/code&gt;, &lt;code&gt;TestFormatsCoverLogins&lt;/code&gt;, &lt;code&gt;TestSharedToolsPolicies&lt;/code&gt;, &lt;code&gt;TestConfigTools&lt;/code&gt; and &lt;code&gt;TestReferenceIsCurrent&lt;/code&gt; fail until those files match the registry. Code of the agent&amp;rsquo;s own, such as a settings filter or a login of its own, goes in a file named for the agent, such as &lt;code&gt;claude.go&lt;/code&gt; or &lt;code&gt;agentlogin_claude.go&lt;/code&gt;, and names the agent by its constant in &lt;code&gt;internal/agents&lt;/code&gt;, so the code for every agent calls a hook there rather than asking which agent it has. The structure test fails on a string literal elsewhere that is the agent&amp;rsquo;s name or holds its folder, on code outside the agent&amp;rsquo;s own files that compares with its constant, has a &lt;code&gt;case&lt;/code&gt; for it, looks for it or keys a map on it, on a list in Go that names every agent, tests included, and on a CLI test script&amp;rsquo;s line that lists agents as a message does, which &lt;code&gt;$AGENT_CHOICES&lt;/code&gt;, &lt;code&gt;$LOGIN_AGENTS&lt;/code&gt; and &lt;code&gt;$KEY_AGENTS&lt;/code&gt; stand in for. The network section of the e2e tests drives every agent, so the new one gets its checks there.&lt;/p&gt;
&lt;h3 data-hextra-search-id="adding-a-provider"&gt;Adding a provider&lt;span class="hx:absolute hx:-mt-20" id="adding-a-provider"&gt;&lt;/span&gt;
&lt;a href="#adding-a-provider" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The model providers whose API keys the VM&amp;rsquo;s proxy puts in for the agents with a key for each provider, opencode and pi, are one table, &lt;code&gt;agents.Providers&lt;/code&gt; in &lt;code&gt;internal/agents/agents.go&lt;/code&gt;. Each &lt;code&gt;agents.Provider&lt;/code&gt; holds the provider&amp;rsquo;s ID, which is its entry&amp;rsquo;s name in both agents&amp;rsquo; &lt;code&gt;auth.json&lt;/code&gt;, its name as people know it, the hosts the agents send its key to, its &lt;code&gt;Path&lt;/code&gt; when the agents send the key below one path of those hosts alone, such as OpenRouter&amp;rsquo;s &lt;code&gt;/api/&lt;/code&gt;, the &lt;code&gt;Headers&lt;/code&gt; they send it in, most often one but two for OpenRouter, whose Anthropic models take the key in &lt;code&gt;x-api-key&lt;/code&gt;, and its &lt;code&gt;Prefix&lt;/code&gt;, which starts the key&amp;rsquo;s placeholder when an agent checks how the provider&amp;rsquo;s keys start: pi takes an OpenAI key that doesn&amp;rsquo;t start with &lt;code&gt;sk-&lt;/code&gt; for a Sign in with ChatGPT login, so OpenAI&amp;rsquo;s is &lt;code&gt;sk-&lt;/code&gt;. The opencode and pi formats&amp;rsquo; bindings, &lt;code&gt;agentlogin.KeyProviders&lt;/code&gt;, which &lt;code&gt;devvm agent login --provider&lt;/code&gt; takes and its help lists, and the allowlist lines of each binding&amp;rsquo;s hosts all come from it. A new provider is its entry there, in the order of its ID, and its row in the table in &lt;code&gt;using/coding-agents.md&lt;/code&gt;&amp;rsquo;s API keys the proxy puts in, which &lt;code&gt;TestProvidersComplete&lt;/code&gt; checks against the registry. Read the hosts, the paths, the headers and any check of how a key starts in both agents&amp;rsquo; own source first, and in the SDK that each one sends its requests with, because a header that differs from the agents&amp;rsquo;, or one that an agent uses for some models alone, leaves the key&amp;rsquo;s placeholder in the request, and a host that the agents never send the key to would get the key anyway. The proxy puts a provider&amp;rsquo;s key in only when the header&amp;rsquo;s value is the placeholder alone, or &lt;code&gt;Bearer&lt;/code&gt; and the placeholder in &lt;code&gt;Authorization&lt;/code&gt;, so check that both agents send the key that way too. A &lt;code&gt;Path&lt;/code&gt; starts and ends with &lt;code&gt;/&lt;/code&gt;, is clean, and goes into each binding as its &lt;code&gt;Path&lt;/code&gt;, below which &lt;code&gt;pathWithin&lt;/code&gt; takes a request&amp;rsquo;s path, so set one only when every request of both agents with the key goes below it. Then &lt;code&gt;mise run cli-docs&lt;/code&gt; writes the CLI page whose help lists the providers, and &lt;code&gt;UPDATE_GOLDEN=1 go test ./internal/agentlogin -run Golden&lt;/code&gt; writes the golden files that list them.&lt;/p&gt;</description></item><item><title>The CLI and its messages</title><link>https://next.devvm.dev/docs/contributing/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/cli/</guid><description>
&lt;h2 data-hextra-search-id="cli-conventions"&gt;CLI conventions&lt;span class="hx:absolute hx:-mt-20" id="cli-conventions"&gt;&lt;/span&gt;
&lt;a href="#cli-conventions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s commands follow one set of rules, so that a user who knows a few of them can guess the rest. A bare verb acts on this folder&amp;rsquo;s VM, anything else goes under its noun, and a bare noun shows or lists. A setting shows bare, changes with a value and takes &lt;code&gt;-g&lt;/code&gt; for what new VMs get. The &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/cli/SKILL.md" target="_blank" rel="noopener"&gt;cli skill&lt;/a&gt; holds every rule, with a checklist for adding a command and a review for changing one, and its &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/cli/judgment.md" target="_blank" rel="noopener"&gt;judgment.md&lt;/a&gt; explains, with examples, the rules that only a reviewer can check. The reasoning behind most of them is in the &lt;a href="https://clig.dev/" target="_blank" rel="noopener"&gt;Command Line Interface Guidelines&lt;/a&gt;, and Cobra&amp;rsquo;s own mechanics are in &lt;a href="https://cobra.dev/docs/" target="_blank" rel="noopener"&gt;Cobra&amp;rsquo;s docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The tests check every rule that a machine can, and &lt;code&gt;mise run test&lt;/code&gt; runs them. The cli skill says which test checks each rule and which rules a reviewer checks by hand, and &lt;a href="#the-cli-rule-tests"&gt;The CLI rule tests&lt;/a&gt; says what each test checks. After changing a command&amp;rsquo;s &lt;code&gt;Use&lt;/code&gt;, &lt;code&gt;Short&lt;/code&gt;, &lt;code&gt;Long&lt;/code&gt;, &lt;code&gt;Example&lt;/code&gt; or flags, run &lt;code&gt;mise run cli-docs&lt;/code&gt; and commit the &lt;a href="https://next.devvm.dev/docs/contributing/docs/#the-cli-reference"&gt;CLI reference&lt;/a&gt; it writes.&lt;/p&gt;
&lt;p&gt;Each command gets the run&amp;rsquo;s services from one &lt;code&gt;app&lt;/code&gt;, in &lt;code&gt;internal/cli/app.go&lt;/code&gt;, which &lt;code&gt;NewRoot&lt;/code&gt; makes for the run&amp;rsquo;s UI and hands to every command&amp;rsquo;s constructor. The app holds devvm&amp;rsquo;s folders (&lt;code&gt;dirs&lt;/code&gt;), a test build&amp;rsquo;s overrides, the secrets store, the backends&amp;rsquo; registry, the shared tools, the environment of the commands on this folder&amp;rsquo;s VM (&lt;code&gt;vmEnv&lt;/code&gt;) and the image builder of the backend new VMs get (&lt;code&gt;builder&lt;/code&gt;, the VM environment&amp;rsquo;s &lt;code&gt;Builder&lt;/code&gt;). It makes each one the first time a command asks for it and keeps that one, or its error, for the rest of the run, so the retention that runs before a command and the command itself share them. A command on this folder&amp;rsquo;s VM runs in &lt;code&gt;a.env&lt;/code&gt;, which returns the command&amp;rsquo;s failure with its message for an error that isn&amp;rsquo;t one. A new command takes its services from the app rather than making its own.&lt;/p&gt;
&lt;p&gt;A command fails by returning its error from &lt;code&gt;RunE&lt;/code&gt;, as &lt;code&gt;failed(err, what)&lt;/code&gt; when the error may not be a message: &lt;code&gt;what&lt;/code&gt; makes the message from the error&amp;rsquo;s text, such as &lt;code&gt;msg.LsFailed&lt;/code&gt;. &lt;code&gt;execute&lt;/code&gt; shows what the command returned in &lt;code&gt;showFailure&lt;/code&gt;, and it&amp;rsquo;s the one place a failure is printed. A &lt;code&gt;backend.LoggedError&lt;/code&gt; shows the end of the run log, then its message (&lt;code&gt;ErrorLogged&lt;/code&gt;). A message, or an error that carries one, shows as it is, and any other error shows in &lt;code&gt;what&lt;/code&gt;&amp;rsquo;s message, or in &lt;code&gt;output_failed&lt;/code&gt; when the command didn&amp;rsquo;t say what failed. The run then exits with 1, and &lt;code&gt;ui.Main&lt;/code&gt; runs the cleanups. Once the run is interrupted, a failure prints nothing, because the interrupt is the reason. The root&amp;rsquo;s layout check (&lt;code&gt;checkLayout&lt;/code&gt;) returns its failure the same way, from &lt;code&gt;PersistentPreRunE&lt;/code&gt;. Only the UI ends a run itself, in &lt;code&gt;die&lt;/code&gt;, where no command can return: a question that gets no answer, and a run log that can&amp;rsquo;t be opened.&lt;/p&gt;
&lt;p&gt;INT, TERM and HUP cancel the run&amp;rsquo;s context in &lt;code&gt;ui.Main&lt;/code&gt;, which then waits for the logged command that&amp;rsquo;s running to end. When there are cleanups to run, it also waits for the command&amp;rsquo;s own code to return, for up to 2 seconds (&lt;code&gt;returnGrace&lt;/code&gt;), before it runs them and exits with 130. So a cleanup never undoes a command&amp;rsquo;s work while that command still runs, and a command that can&amp;rsquo;t stop delays the exit by no more than those 2 seconds. A question waiting for its answer isn&amp;rsquo;t waited for at all, because reading its answer doesn&amp;rsquo;t end at Ctrl+C, and an answer read once the run is interrupted is refused, so nothing goes ahead after it. A run with no cleanups exits at once, because nothing could undo its work, so the proxy and devvm&amp;rsquo;s other background processes stop as soon as they&amp;rsquo;re told to. A second signal during the cleanups is ignored, so they aren&amp;rsquo;t stopped halfway.&lt;/p&gt;
&lt;p&gt;Ctrl+C reaches every process in the terminal&amp;rsquo;s group, so it can end a command that devvm runs before devvm itself sees the interrupt. When a command ends by a signal, or exits with a code of 128 or more, devvm waits up to 1 second for its own interrupt (&lt;code&gt;interruptGrace&lt;/code&gt;), so that the run ends as interrupted, printing nothing, instead of showing the command&amp;rsquo;s failure.&lt;/p&gt;
&lt;p&gt;Whatever a failure would leave behind, such as a build VM or a temporary file, registers a cleanup with the UI&amp;rsquo;s &lt;code&gt;AddCleanup&lt;/code&gt; and removes it, with the function &lt;code&gt;AddCleanup&lt;/code&gt; returns, once there&amp;rsquo;s nothing left to clean up. The cleanups run when the run ends, last added first, whether it ended normally, failed or was interrupted. They run after the command returned and the run&amp;rsquo;s context is canceled, so each one gets a fresh context of its own. A cleanup that only undoes unfinished work after an interrupt checks &lt;code&gt;Interrupted()&lt;/code&gt;, and the command leaves it registered once the run is interrupted, because the cleanups run only after the command returns.&lt;/p&gt;
&lt;p&gt;devvm runs every external command through the UI&amp;rsquo;s &lt;code&gt;LoggedCmd(ctx, step, cmd)&lt;/code&gt;, which a backend gets as its &lt;code&gt;Runner&lt;/code&gt;. The command&amp;rsquo;s output goes to the run log, a terminal&amp;rsquo;s status line shows &lt;code&gt;step&lt;/code&gt;, and a failure after it is returned as &lt;code&gt;backend.Logged(m)&lt;/code&gt;, which shows the end of the log with the message. &lt;code&gt;WithSteps(ctx, n)&lt;/code&gt; starts a phase of &lt;code&gt;n&lt;/code&gt; steps, and each &lt;code&gt;LoggedCmd&lt;/code&gt; with the context it returns is numbered, as &lt;code&gt;[2/5] running base.sh&lt;/code&gt;, on its status line and in the log.&lt;/p&gt;
&lt;h3 data-hextra-search-id="status-lines"&gt;Status lines&lt;span class="hx:absolute hx:-mt-20" id="status-lines"&gt;&lt;/span&gt;
&lt;a href="#status-lines" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Any work that can take noticeable time runs under a status line, so that the user sees what devvm is waiting for. Such work is a host command, host git, a command in a VM, a backend&amp;rsquo;s own commands, such as &lt;code&gt;limactl list&lt;/code&gt;, a request over the network, a walk of a folder the user owns, a lookup of a folder&amp;rsquo;s disk with macOS&amp;rsquo;s &lt;code&gt;diskutil&lt;/code&gt;, and a wait for a lock, a timeout or another process. A logged command shows its step on its own. Other slow work shows one with the Reporter&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt;, whose label is a message in &lt;code&gt;locales/en.toml&lt;/code&gt;: a lowercase phrase in &lt;code&gt;-ing&lt;/code&gt;, such as &lt;code&gt;reading_vms&lt;/code&gt;, with a &lt;code&gt;description&lt;/code&gt; that says what runs under it. For example:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;ListAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;Env&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="nx"&gt;Listed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="nx"&gt;Known&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;defer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadingVMs&lt;/span&gt;&lt;span class="p"&gt;())()&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;ReadInventory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Dirs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Registry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;AllBackends&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The status line shows only in a terminal, without &lt;code&gt;-v&lt;/code&gt; and until the run is interrupted, because nothing would clear one started after that. The UI keeps status lines as a stack. A logged command or a &lt;code&gt;Status&lt;/code&gt; inside another shows its own line until it ends, and then the UI draws the outer one again, so a phase can show one line around steps that show their own. A message said under a status line, whether &lt;code&gt;Info&lt;/code&gt;, &lt;code&gt;Warn&lt;/code&gt;, &lt;code&gt;Note&lt;/code&gt; or data on &lt;code&gt;Stdout()&lt;/code&gt;, clears the line, prints, and draws the line again below it, so a warning never lands on the status line. A question, the picker and &lt;code&gt;ui.Terminal&lt;/code&gt;, which a command in the VM that draws on the terminal gets, hold the status line until they&amp;rsquo;re done, so its redraw never goes over a prompt or what the user types.&lt;/p&gt;
&lt;p&gt;A wait for a lock that another devvm holds shows a status line only while it waits, never when the lock is free. &lt;code&gt;platform.LockFile&lt;/code&gt;, &lt;code&gt;platform.LockFileShared&lt;/code&gt; and &lt;code&gt;platform.LockDir&lt;/code&gt; take a &lt;code&gt;platform.Waiting&lt;/code&gt;, which they call once they find the lock held, and they call its end once the wait ends. &lt;code&gt;msg.Waiting(status, label)&lt;/code&gt; makes one from a Reporter&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt; and a label, such as &lt;code&gt;vm_state_waiting&lt;/code&gt;. &lt;code&gt;internal/state&lt;/code&gt;, for a VM&amp;rsquo;s lock or the layout&amp;rsquo;s, and &lt;code&gt;internal/trust&lt;/code&gt; take no Reporter, so they alone take the run&amp;rsquo;s &lt;code&gt;Status&lt;/code&gt; from the context (&lt;code&gt;msg.StatusOf&lt;/code&gt;), which the run&amp;rsquo;s root sets (&lt;code&gt;msg.WithStatus&lt;/code&gt;), and forbidigo keeps it to them. The layout&amp;rsquo;s migration shows &lt;code&gt;layout_migrating&lt;/code&gt; while it runs. An agent&amp;rsquo;s login file is locked by its folder&amp;rsquo;s lock (&lt;code&gt;platform.LockDir&lt;/code&gt;), which the proxy holds while it refreshes the login, so it takes its wait as &lt;code&gt;agentlogin.File&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Waiting&lt;/code&gt; (&lt;code&gt;agent_login_waiting&lt;/code&gt;), and its wait ends with the caller&amp;rsquo;s context, as every lock&amp;rsquo;s does. Only a lock that never waits, such as one on a file just made, passes &lt;code&gt;platform.NoWait&lt;/code&gt;, which shows nothing, and the structure test&amp;rsquo;s &lt;code&gt;status-lines&lt;/code&gt; rule holds it to &lt;code&gt;statusSites&lt;/code&gt;, as it does a &lt;code&gt;nil&lt;/code&gt;. &lt;code&gt;msg.Waiting&lt;/code&gt; with no status, as in a process with no UI, gives a wait that shows nothing, never &lt;code&gt;nil&lt;/code&gt;. A test build&amp;rsquo;s locks panic on a &lt;code&gt;nil&lt;/code&gt; one (&lt;code&gt;platform.CheckWaiting&lt;/code&gt;, which the root&amp;rsquo;s run calls in every test build), so the CLI tests and the end-to-end tests catch one that the rule can&amp;rsquo;t see, such as a zero &lt;code&gt;agentlogin.File&lt;/code&gt;&amp;rsquo;s. They don&amp;rsquo;t catch a &lt;code&gt;msg.Waiting&lt;/code&gt; given a nil status, which only a review finds. A forbidigo rule refuses &lt;code&gt;syscall.Flock&lt;/code&gt; and &lt;code&gt;unix.Flock&lt;/code&gt; outside &lt;code&gt;internal/platform&lt;/code&gt;, the proxy&amp;rsquo;s log rotation, the stubs and tests, so every lock goes through &lt;code&gt;internal/platform&lt;/code&gt;&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;Work that takes the terminal never runs under a status line, because its redraw would go over what the work shows. That work is a VM&amp;rsquo;s shell, &lt;code&gt;ssh-add&lt;/code&gt; asking for a key&amp;rsquo;s passphrase (&lt;code&gt;checkAgent&lt;/code&gt;, &lt;code&gt;Agent.Ensure&lt;/code&gt;) and an agent&amp;rsquo;s login in the VM. A launch shows its status lines around those steps rather than across them. A background process, such as the proxy, a forwarder or a link session, has no terminal and shows none.&lt;/p&gt;
&lt;p&gt;Tests check the label rather than a terminal. A &lt;code&gt;msg.Fake&lt;/code&gt; gives each status line&amp;rsquo;s label, and each logged command&amp;rsquo;s step, to its &lt;code&gt;OnStatus&lt;/code&gt;, and &lt;code&gt;Showing&lt;/code&gt; returns the one showing. So a seam that the slow work goes through records what showed meanwhile, as &lt;code&gt;TestAgentImportStatus&lt;/code&gt; does with the &lt;code&gt;Opencode&lt;/code&gt; and &lt;code&gt;ExcludeFromBackup&lt;/code&gt; seams, and a &lt;code&gt;backendtest.Fake&lt;/code&gt; gives each call to its &lt;code&gt;OnCall&lt;/code&gt;. &lt;code&gt;TestLaunchStatusLines&lt;/code&gt; runs a new, a running and a stopped VM&amp;rsquo;s launch and fails on any backend call made with no status line showing, except the shell&amp;rsquo;s, which takes the terminal, and &lt;code&gt;Running&lt;/code&gt;&amp;rsquo;s, which reads the VM&amp;rsquo;s pid files. &lt;code&gt;TestCommandStatusLines&lt;/code&gt; does the same for the commands that show, list, change, export, stop and delete a running or a stopped VM, including devvm network lock&amp;rsquo;s picker, devvm restart, the restart that devvm mount-cache asks for, links, and a group with a second VM that runs, stops and goes. It answers their questions in a terminal through the &lt;code&gt;msg.Fake&lt;/code&gt;, checks that the picker and the restart are asked, and fails on a question asked under a status line, or a proxy or link session started with none. &lt;code&gt;testProxy&lt;/code&gt; runs each link session as a sleep that says each of its links is carried, as its links change. &lt;code&gt;TestVMLockWaits&lt;/code&gt;, &lt;code&gt;TestCheckLayoutWaits&lt;/code&gt; and each lock&amp;rsquo;s own test check a wait&amp;rsquo;s status line. &lt;code&gt;TestSSHAddOffStatusLine&lt;/code&gt; fails on an &lt;code&gt;ssh-add&lt;/code&gt; that runs under one, on the user&amp;rsquo;s agent or devvm&amp;rsquo;s own, and &lt;code&gt;chflagsCalls&lt;/code&gt; fails a clone test on a lock or unlock of &lt;code&gt;.git&lt;/code&gt; with none. The structure test&amp;rsquo;s &lt;code&gt;status-lines&lt;/code&gt; rule fails on a function that does slow work it knows by name and shows no status line of its own. That slow work is a host command, host git, a walk of a folder, a volume&amp;rsquo;s lookup, a request through &lt;code&gt;internal/fetch&lt;/code&gt;, a wait for a lock that shows nothing, or a backend&amp;rsquo;s command outside a step. The rule passes a function when &lt;code&gt;statusSites&lt;/code&gt; lists it with why, such as the status line of the caller it runs under (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-structure-test"&gt;The structure test&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="command-arguments"&gt;Command arguments&lt;span class="hx:absolute hx:-mt-20" id="command-arguments"&gt;&lt;/span&gt;
&lt;a href="#command-arguments" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each command checks its arguments and flags before it does anything else, so a usage error never looks for a VM, applies the retention settings or changes a file. &lt;code&gt;internal/cli/args.go&lt;/code&gt; holds the checks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A command&amp;rsquo;s &lt;code&gt;Args&lt;/code&gt;&lt;/strong&gt; is one of &lt;code&gt;noArgs&lt;/code&gt;, &lt;code&gt;exactArgs(n)&lt;/code&gt;, &lt;code&gt;maxArgs(n)&lt;/code&gt; and &lt;code&gt;minArgs(n)&lt;/code&gt;, never Cobra&amp;rsquo;s own validators, whose errors are in English. Each one names the arguments the command&amp;rsquo;s &lt;code&gt;Use&lt;/code&gt; shows (&lt;code&gt;KEY_FILE&lt;/code&gt;, &lt;code&gt;[all|none|LIST]&lt;/code&gt;), and with &lt;code&gt;ValidArgs&lt;/code&gt; set, it refuses any other value. &lt;code&gt;noArgs&lt;/code&gt; on a command with commands of its own says the word isn&amp;rsquo;t one of them and lists them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Values are checked in &lt;code&gt;Args&lt;/code&gt; too.&lt;/strong&gt; A command adds its own check with &lt;code&gt;cobra.MatchAll&lt;/code&gt;, such as &lt;code&gt;settings.ParsePorts&lt;/code&gt; for devvm ports or &lt;code&gt;netpolicy.Rule&lt;/code&gt; for devvm network allow, returning the same message the command would fail with later.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flag values are checked by name&lt;/strong&gt; in &lt;code&gt;checkFlagValue&lt;/code&gt;, because one flag name has one meaning: &lt;code&gt;--cpus&lt;/code&gt;, &lt;code&gt;--memory&lt;/code&gt;, &lt;code&gt;--disk&lt;/code&gt;, &lt;code&gt;--ports&lt;/code&gt;, &lt;code&gt;--lifetime&lt;/code&gt;, &lt;code&gt;--older-than&lt;/code&gt;, &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt;. Flags that can&amp;rsquo;t be given together are marked with &lt;code&gt;exclusive(cmd, a, b)&lt;/code&gt;, which &lt;code&gt;checkFlags&lt;/code&gt; checks first, in place of Cobra&amp;rsquo;s &lt;code&gt;MarkFlagsMutuallyExclusive&lt;/code&gt; alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The parser&amp;rsquo;s own flag errors&lt;/strong&gt; (an unknown flag, one without its value, a value its type refuses) become messages in &lt;code&gt;flagError&lt;/code&gt;, set as the root&amp;rsquo;s &lt;code&gt;SetFlagErrorFunc&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;checkCommands&lt;/code&gt; wraps every command&amp;rsquo;s &lt;code&gt;Args&lt;/code&gt; in these checks when &lt;code&gt;NewRoot&lt;/code&gt; builds the tree. A message one of them returns is a usage error: &lt;code&gt;Execute&lt;/code&gt; prints it, then &lt;code&gt;usage_help&lt;/code&gt; naming the command&amp;rsquo;s own &lt;code&gt;--help&lt;/code&gt;, and exits with 2. &lt;code&gt;usage_error&lt;/code&gt; is only the fallback for a parser error devvm doesn&amp;rsquo;t know. What a command&amp;rsquo;s &lt;code&gt;RunE&lt;/code&gt; returns once it ran is a failure, which &lt;code&gt;execute&lt;/code&gt; shows and exits with 1. &lt;code&gt;TestUsageErrorsEveryCommand&lt;/code&gt; runs every command with an unknown flag, without the argument it needs, with too many and with each flag&amp;rsquo;s value blank, and checks that each is a usage error and nothing runs.&lt;/p&gt;
&lt;p&gt;devvm itself takes no arguments, so a layer may have a command&amp;rsquo;s name. The root&amp;rsquo;s &lt;code&gt;Args&lt;/code&gt; is &lt;code&gt;noArgs&lt;/code&gt;, which for the root runs &lt;code&gt;checkWord&lt;/code&gt; (&lt;code&gt;internal/cli/word.go&lt;/code&gt;): a word that isn&amp;rsquo;t a command is a usage error. When the word, or each name in it joined with &lt;code&gt;+&lt;/code&gt; or a comma, is a part&amp;rsquo;s name, from the same &lt;code&gt;partNames&lt;/code&gt; that &lt;code&gt;checkPartFlag&lt;/code&gt; reads (&lt;code&gt;image.Toolchains&lt;/code&gt;, &lt;code&gt;image.Agents&lt;/code&gt; and the build env&amp;rsquo;s layers), the error is &lt;code&gt;no_command_part&lt;/code&gt;, with the flags that choose them. Any other word gets the closest command, from Cobra&amp;rsquo;s &lt;code&gt;SuggestionsFor&lt;/code&gt; with &lt;code&gt;SuggestionsMinimumDistance&lt;/code&gt; 2 (&lt;code&gt;msg.SuggestDistance&lt;/code&gt;, which &lt;code&gt;msg.Closest&lt;/code&gt; also uses). devvm&amp;rsquo;s own help command and the root&amp;rsquo;s help func run the same check, so &lt;code&gt;devvm help WORD&lt;/code&gt; and &lt;code&gt;devvm WORD --help&lt;/code&gt; fail as &lt;code&gt;devvm WORD&lt;/code&gt; does. The help func can&amp;rsquo;t return an error, so it panics with a &lt;code&gt;wordPanic&lt;/code&gt; that &lt;code&gt;execute&lt;/code&gt; recovers. &lt;code&gt;--tools&lt;/code&gt;, &lt;code&gt;--agents&lt;/code&gt; and &lt;code&gt;--layers&lt;/code&gt; are checked in &lt;code&gt;checkFlagValue&lt;/code&gt; through &lt;code&gt;checkPartFlag&lt;/code&gt;: &lt;code&gt;none&lt;/code&gt; alone, or a list of the part&amp;rsquo;s names. A name of another part&amp;rsquo;s is refused with that part&amp;rsquo;s flag (&lt;code&gt;part_other_flag&lt;/code&gt;), and any other name it doesn&amp;rsquo;t know with the closest name (&lt;code&gt;vm.CheckPart&lt;/code&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-cli-rule-tests"&gt;The CLI rule tests&lt;span class="hx:absolute hx:-mt-20" id="the-cli-rule-tests"&gt;&lt;/span&gt;
&lt;a href="#the-cli-rule-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Go tests in &lt;code&gt;internal/cli&lt;/code&gt; walk the command tree, so a command that breaks one of the command line&amp;rsquo;s rules fails &lt;code&gt;mise run test&lt;/code&gt;, whether it&amp;rsquo;s new or changed. Each exception says why, in its test&amp;rsquo;s list or in the command&amp;rsquo;s own &lt;code&gt;about&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestEveryCommandsHelp&lt;/code&gt;&lt;/strong&gt; checks that every command users see has a &lt;code&gt;Short&lt;/code&gt; in sentence case without a full stop, a &lt;code&gt;Long&lt;/code&gt; of one to three sentences, an &lt;code&gt;Example&lt;/code&gt; and a docs page in its &lt;code&gt;about&lt;/code&gt;, and that each of the root&amp;rsquo;s commands is in a group. devvm help is the exception, as Cobra lists it apart and the CLI reference leaves it out. &lt;code&gt;TestAboutGroupsAreHelpGroups&lt;/code&gt; checks that each group a command names is one of &lt;code&gt;helpGroups&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestPersistentFlags&lt;/code&gt;&lt;/strong&gt; checks that every command takes &lt;code&gt;-h/--help&lt;/code&gt;, &lt;code&gt;--no-input&lt;/code&gt; and &lt;code&gt;-v/--verbose&lt;/code&gt; and has no other persistent flag. &lt;strong&gt;&lt;code&gt;TestFlagNames&lt;/code&gt;&lt;/strong&gt; checks that each shorthand is in its list, &lt;code&gt;-h&lt;/code&gt;, &lt;code&gt;-v&lt;/code&gt;, &lt;code&gt;-f&lt;/code&gt;, &lt;code&gt;-g&lt;/code&gt; and &lt;code&gt;-n&lt;/code&gt;, for one flag only, that no command takes &lt;code&gt;--yes&lt;/code&gt;, and that a flag has one help text wherever it appears, except the names in &lt;code&gt;manyUses&lt;/code&gt;. &lt;code&gt;TestFlagNamesHaveOneMeaning&lt;/code&gt; checks that a flag name has the same shorthand, type and value everywhere. &lt;strong&gt;&lt;code&gt;TestDurationFlags&lt;/code&gt;&lt;/strong&gt; checks that a flag whose value is a &lt;code&gt;DURATION&lt;/code&gt; is read with &lt;code&gt;state.ParseDuration&lt;/code&gt; in &lt;code&gt;checkFlagValue&lt;/code&gt;, and that no flag is a Go &lt;code&gt;time.Duration&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestShowCommandsTakeJSON&lt;/code&gt;&lt;/strong&gt; checks that every command users see takes &lt;code&gt;--json&lt;/code&gt; or says why not in its &lt;code&gt;about&lt;/code&gt;&amp;rsquo;s &lt;code&gt;noJSON&lt;/code&gt;, and &lt;code&gt;TestJSONShapes&lt;/code&gt; checks that every command with &lt;code&gt;--json&lt;/code&gt; has a shape.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestCommandNames&lt;/code&gt;&lt;/strong&gt; checks that command names are lower case without aliases, that no command is named &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;show&lt;/code&gt;, &lt;code&gt;get&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt;, &lt;code&gt;remove&lt;/code&gt; or &lt;code&gt;ls&lt;/code&gt; but devvm ls, that a command named unX has a sibling X, and that each argument in a &lt;code&gt;Use&lt;/code&gt; is a &lt;code&gt;PLACEHOLDER&lt;/code&gt; or a word, with &lt;code&gt;|&lt;/code&gt;, &lt;code&gt;[]&lt;/code&gt; and &lt;code&gt;...&lt;/code&gt; only. &lt;strong&gt;&lt;code&gt;TestUseMatchesArgs&lt;/code&gt;&lt;/strong&gt; runs every command with the arguments its &lt;code&gt;Use&lt;/code&gt; shows, from &lt;code&gt;argSamples&lt;/code&gt;, and with none when they&amp;rsquo;re optional, and checks that it runs, so its &lt;code&gt;Args&lt;/code&gt; takes what its help shows. &lt;code&gt;TestUnknownWord&lt;/code&gt; checks that &lt;code&gt;devvm WORD&lt;/code&gt;, &lt;code&gt;devvm WORD --help&lt;/code&gt; and &lt;code&gt;devvm help WORD&lt;/code&gt; fail alike for a word that isn&amp;rsquo;t a command, and that a toolchain&amp;rsquo;s, an agent&amp;rsquo;s or a layer&amp;rsquo;s name, alone or joined with others, points to its flag while any other word gets the closest command.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestCommandLines&lt;/code&gt;&lt;/strong&gt; reads every devvm command line in the repo: the docs, the generated CLI reference among them, the README, AGENTS.md, &lt;code&gt;locales/en.toml&lt;/code&gt;, Go&amp;rsquo;s comments and strings, &lt;code&gt;assets/&lt;/code&gt;, &lt;code&gt;install.sh&lt;/code&gt;, the CLI tests and their stubs, the scripts, the workflows and the skills. It checks that each one&amp;rsquo;s command exists, that each flag is one that command takes, that a placeholder is one its &lt;code&gt;Use&lt;/code&gt; shows and a flag&amp;rsquo;s value the one its help shows, such as &lt;code&gt;DURATION&lt;/code&gt;, and that a word after a command with commands of its own isn&amp;rsquo;t a command from elsewhere in the tree. A command line written to be typed, in a code block, a code span or a CLI test&amp;rsquo;s &lt;code&gt;exec&lt;/code&gt;, also has its values checked with &lt;code&gt;checkFlagValue&lt;/code&gt;, and when it has nothing to fill in, it runs in a tree whose commands do nothing, where it mustn&amp;rsquo;t be a usage error. Prose has only its command and its flags checked, because its words after the command are English. The lines written to show a refusal are in &lt;code&gt;refused&lt;/code&gt;, each with why, and a CLI test&amp;rsquo;s &lt;code&gt;! exec&lt;/code&gt; lines are left out, as they&amp;rsquo;re meant to fail. &lt;code&gt;mise run lint:docs&lt;/code&gt; runs it too, so a docs change that names a command that doesn&amp;rsquo;t exist fails there. &lt;code&gt;TestCheckCommandLine&lt;/code&gt; checks that it finds each kind of stale line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TestQuestionsDeclareAnswers&lt;/code&gt;&lt;/strong&gt; in &lt;code&gt;internal/cli&lt;/code&gt; finds every question the code makes, outside tests. A question is a &lt;code&gt;msg.Question&lt;/code&gt;, which &lt;code&gt;Ask&lt;/code&gt;, &lt;code&gt;Confirm&lt;/code&gt;, &lt;code&gt;Answer&lt;/code&gt; and &lt;code&gt;Secret&lt;/code&gt; take, and only two methods of a message make one: &lt;code&gt;AnsweredBy(&amp;quot;--force&amp;quot;)&lt;/code&gt; names the flag or command that answers it, and &lt;code&gt;RefusedWith(msg.X(...))&lt;/code&gt; gives a question that no flag answers the refusal that says what to do instead. The test checks that each &lt;code&gt;AnsweredBy&lt;/code&gt; names a string, that each flag in it is one its command takes and each command one devvm has, and that each &lt;code&gt;RefusedWith&lt;/code&gt; gives a message, so no question is asked without its answer declared. &lt;code&gt;TestCheckAnswer&lt;/code&gt; checks that it finds each kind of wrong answer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="messages"&gt;Messages&lt;span class="hx:absolute hx:-mt-20" id="messages"&gt;&lt;/span&gt;
&lt;a href="#messages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every message devvm prints is a table in &lt;code&gt;locales/en.toml&lt;/code&gt;, and Go code calls it through a function generated from it. &lt;code&gt;internal/msg&lt;/code&gt; renders messages but never prints them; the run&amp;rsquo;s &lt;code&gt;ui.UI&lt;/code&gt; does. Only &lt;code&gt;cmd/devvm&lt;/code&gt; and &lt;code&gt;internal/cli&lt;/code&gt; hold it. Every other package prints and asks through the one &lt;code&gt;msg.Reporter&lt;/code&gt; interface, which &lt;code&gt;ui.UI&lt;/code&gt; implements: a package&amp;rsquo;s type embeds it, its constructor takes it, and cli gives it the run&amp;rsquo;s UI. A package that takes no Reporter gets the answer instead, because cli asks the question first and passes the answer in. Where a package&amp;rsquo;s warnings also say where the run log is, as Lima&amp;rsquo;s and the shared tools&amp;rsquo; do, its type has its own &lt;code&gt;Warn&lt;/code&gt; method over the Reporter&amp;rsquo;s. A Go test gives a package a &lt;code&gt;msg.Fake&lt;/code&gt; instead, a Reporter that prints nothing and refuses every question unless the test sets its fields, and records what it says with a &lt;code&gt;msg.Recorder&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Prose is never built with &lt;code&gt;fmt&lt;/code&gt;: every sentence devvm shows the user is a message. A message made from an error carries that error with &lt;code&gt;.Because(err)&lt;/code&gt;, rather than only its text from &lt;code&gt;err.Error()&lt;/code&gt;. Data output, such as a table or &lt;code&gt;--json&lt;/code&gt;, isn&amp;rsquo;t a message, and neither is text in a script that runs somewhere else. Data goes to the UI&amp;rsquo;s &lt;code&gt;Stdout()&lt;/code&gt;, and a log line that isn&amp;rsquo;t a message goes to its &lt;code&gt;Stderr()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The locale files are in &lt;a href="https://github.com/nicksnyder/go-i18n" target="_blank" rel="noopener"&gt;go-i18n&lt;/a&gt;&amp;rsquo;s TOML format, with only go-i18n&amp;rsquo;s own message fields, so go-i18n&amp;rsquo;s loader reads them as they are and its &lt;code&gt;goi18n&lt;/code&gt; tools work on them:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;no_vm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;other&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;There&amp;#39;s no VM for {{.dir}}. Run devvm to make one.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;gc_tools&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} shared tool image is unused ({{.size}}).&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;other&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} shared tool images are unused ({{.size}}).&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;gc_tools_no_vm&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tools lists the tool images, as \&amp;#34;node 24.21.0, claude 2.1.295\&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} current shared tool image no VM has ({{.size}}): {{.tools}}.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;other&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{{.count}} current shared tool images no VM has ({{.size}}): {{.tools}}.&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The ID&lt;/strong&gt; is the table&amp;rsquo;s name, in snake_case.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;other&lt;/code&gt;&lt;/strong&gt; is the text: a Go template whose fields are snake_case (&lt;code&gt;{{.vm_name}}&lt;/code&gt;). Only plain fields are allowed, no logic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fields&amp;rsquo; types:&lt;/strong&gt; the generator makes each field a &lt;code&gt;string&lt;/code&gt; parameter of the message&amp;rsquo;s function, except &lt;code&gt;count&lt;/code&gt;, which is an &lt;code&gt;int&lt;/code&gt;, and &lt;code&gt;vm&lt;/code&gt; and &lt;code&gt;vm_name&lt;/code&gt;, which are &lt;code&gt;vmname.VM&lt;/code&gt;. A field that may hold something other than a VM&amp;rsquo;s name, such as an image&amp;rsquo;s name or a VM&amp;rsquo;s name as the user typed it, is named &lt;code&gt;what&lt;/code&gt; or &lt;code&gt;name&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;one&lt;/code&gt;&lt;/strong&gt; is the text for a count of 1, when the wording changes with the count. Both texts then take &lt;code&gt;{{.count}}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;description&lt;/code&gt;&lt;/strong&gt; is an optional note for translators.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing else:&lt;/strong&gt; the generator refuses keys go-i18n doesn&amp;rsquo;t know, nested tables, plural forms English doesn&amp;rsquo;t use (&lt;code&gt;zero&lt;/code&gt;, &lt;code&gt;two&lt;/code&gt;, &lt;code&gt;few&lt;/code&gt;, &lt;code&gt;many&lt;/code&gt;) and &lt;code&gt;leftDelim&lt;/code&gt;/&lt;code&gt;rightDelim&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Voice:&lt;/strong&gt; a message&amp;rsquo;s text follows the docs-voice skill&amp;rsquo;s &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/docs-voice/SKILL.md#messages" target="_blank" rel="noopener"&gt;Messages&lt;/a&gt; rules, which set its length (an error or a warning has at most two sentences, and a prompt at most two lines of context), and the mechanism goes in its doc link rather than its text.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One line:&lt;/strong&gt; a value renders on one line without control, bidi or invisible characters, because &lt;code&gt;msg.OneLine&lt;/code&gt; cleans every value as the message renders. Text from a VM that devvm shows as data goes through &lt;code&gt;msg.Printable&lt;/code&gt; instead, which keeps its newlines and tabs. &lt;a href="#colors"&gt;Colors&lt;/a&gt; says what the two drop.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="doc-links"&gt;Doc links&lt;span class="hx:absolute hx:-mt-20" id="doc-links"&gt;&lt;/span&gt;
&lt;a href="#doc-links" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A message links a docs page through the &lt;code&gt;docs&lt;/code&gt; map in &lt;code&gt;internal/msg/docs.go&lt;/code&gt;, from message ID to a page in &lt;code&gt;docs/content/docs&lt;/code&gt; and a heading on it. The page is its path without &lt;code&gt;.md&lt;/code&gt;, and a section&amp;rsquo;s own page, its &lt;code&gt;_index.md&lt;/code&gt;, is the section&amp;rsquo;s folder:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;docs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;vm_outdated&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;using/images#outdated-vms&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;backend_lacks&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;backends#when-a-backend-lacks-something&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;devvm prints the page&amp;rsquo;s address on the docs site on the line after the text.&lt;/p&gt;
&lt;p&gt;After editing &lt;code&gt;en.toml&lt;/code&gt;, run:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise &lt;span class="nb"&gt;exec&lt;/span&gt; -- go generate ./internal/msg&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It writes &lt;code&gt;internal/msg/messages_gen.go&lt;/code&gt;, with one function per message. The parameters are the template&amp;rsquo;s fields in sorted order, in camelCase, and &lt;code&gt;count int&lt;/code&gt; for plural messages: &lt;code&gt;[no_vm]&lt;/code&gt; becomes &lt;code&gt;msg.NoVM(dir string) msg.M&lt;/code&gt;, and a value that&amp;rsquo;s missing or extra is a compile error. &lt;code&gt;msg.M&lt;/code&gt; is also an &lt;code&gt;error&lt;/code&gt;: one made from another error carries it with &lt;code&gt;.Because(err)&lt;/code&gt;, so &lt;code&gt;errors.Is&lt;/code&gt; and &lt;code&gt;errors.As&lt;/code&gt; see through it, while the text stays the message&amp;rsquo;s own.&lt;/p&gt;
&lt;p&gt;The tests fail when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;messages_gen.go&lt;/code&gt; is stale;&lt;/li&gt;
&lt;li&gt;a message doesn&amp;rsquo;t render with sample values, or shows &lt;code&gt;&amp;lt;no value&amp;gt;&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;a generated function is never called outside the generated file and the tests;&lt;/li&gt;
&lt;li&gt;a doc link names a message that isn&amp;rsquo;t in &lt;code&gt;en.toml&lt;/code&gt;, or a page or heading that doesn&amp;rsquo;t exist. &lt;code&gt;mise run lint&lt;/code&gt; runs this check too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="questions"&gt;Questions&lt;span class="hx:absolute hx:-mt-20" id="questions"&gt;&lt;/span&gt;
&lt;a href="#questions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A prompt asks a &lt;code&gt;msg.Question&lt;/code&gt;, never a bare message, so every question declares what answers it where devvm can&amp;rsquo;t ask: without a terminal, with &lt;code&gt;--no-input&lt;/code&gt;, or once the input ends. A message becomes a question in one of two ways. &lt;code&gt;msg.X(...).AnsweredBy(&amp;quot;--force&amp;quot;)&lt;/code&gt; names the flag or command that answers it, and its refusal is &lt;code&gt;no_input&lt;/code&gt;, which names that answer and shows the question first when the prompt wasn&amp;rsquo;t printed. &lt;code&gt;RefusedWith(msg.Y(...))&lt;/code&gt; makes a question that no flag answers, and its refusal is the message given, which says what to do instead. &lt;code&gt;About(...)&lt;/code&gt; adds the messages said before the question, which devvm shows only when it asks.&lt;/p&gt;
&lt;p&gt;The Reporter&amp;rsquo;s &lt;code&gt;Ask&lt;/code&gt;, &lt;code&gt;Confirm&lt;/code&gt;, &lt;code&gt;Answer&lt;/code&gt; and &lt;code&gt;Secret&lt;/code&gt; take the question and, where devvm can&amp;rsquo;t ask it, return its &lt;code&gt;*msg.Refusal&lt;/code&gt;, an error whose &lt;code&gt;Msg&lt;/code&gt; is the refusal&amp;rsquo;s message. A command returns it as it would any failure, and a caller with something to fall back on does that instead, so no caller checks for a terminal itself. &lt;code&gt;TestQuestionsDeclareAnswers&lt;/code&gt; checks every question in the code, as &lt;a href="#the-cli-rule-tests"&gt;The CLI rule tests&lt;/a&gt; says, and a CLI test answers one with &lt;code&gt;ttyin&lt;/code&gt; or &lt;code&gt;DEVVM_PIPED_ANSWERS=1&lt;/code&gt;, as &lt;a href="https://next.devvm.dev/docs/contributing/tests/#cli-tests"&gt;CLI tests&lt;/a&gt; says.&lt;/p&gt;
&lt;h3 data-hextra-search-id="names-mode"&gt;Names mode&lt;span class="hx:absolute hx:-mt-20" id="names-mode"&gt;&lt;/span&gt;
&lt;a href="#names-mode" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;With &lt;code&gt;DEVVM_MESSAGES=names&lt;/code&gt;, a message prints as its ID and its values in sorted key order, so tests check which message devvm printed and with what, never its wording or language:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;! exec devvm _msg nope
stderr &amp;#39;msg_unknown name=nope$&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Every CLI test runs in names mode unless it sets &lt;code&gt;env DEVVM_MESSAGES=&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Names mode belongs to &lt;code&gt;internal/ui&lt;/code&gt;, which reads it once, with the rest of a stream&amp;rsquo;s style, in &lt;code&gt;New&lt;/code&gt;: a &lt;code&gt;msg.M&lt;/code&gt; itself always renders as its text, so its &lt;code&gt;String&lt;/code&gt; and &lt;code&gt;Error&lt;/code&gt; are the same whatever the environment says. Whatever shows a message as data, a table&amp;rsquo;s cell or a &lt;code&gt;--json&lt;/code&gt; field, goes through the UI&amp;rsquo;s &lt;code&gt;Text&lt;/code&gt;, or a &lt;code&gt;Table&lt;/code&gt;&amp;rsquo;s, to get the names in names mode. &lt;code&gt;New&lt;/code&gt; takes the function it reads the environment with, &lt;code&gt;os.Getenv&lt;/code&gt; for devvm&amp;rsquo;s own UI, so a Go test makes a UI in names mode without setting the environment and can run in parallel; cli&amp;rsquo;s &lt;code&gt;testUI&lt;/code&gt; does. A Go test that checks a message without a UI compares &lt;code&gt;Names&lt;/code&gt;, &lt;code&gt;msg.IDOf&lt;/code&gt; or &lt;code&gt;msg.NamesOf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devvm _msg NAME key=value…&lt;/code&gt; prints a message&amp;rsquo;s text (never its names), for end-to-end tests that look for it in a VM&amp;rsquo;s output. It&amp;rsquo;s hidden from the help.&lt;/p&gt;
&lt;h3 data-hextra-search-id="colors"&gt;Colors&lt;span class="hx:absolute hx:-mt-20" id="colors"&gt;&lt;/span&gt;
&lt;a href="#colors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Only &lt;code&gt;internal/ui&lt;/code&gt; adds color, through a &lt;code&gt;style&lt;/code&gt; for each stream that &lt;code&gt;onTerminal&lt;/code&gt; makes, and &lt;code&gt;colorOn&lt;/code&gt; decides each one: &lt;code&gt;NO_COLOR&lt;/code&gt; or &lt;code&gt;DEVVM_MESSAGES=names&lt;/code&gt; turns it off, then &lt;code&gt;FORCE_COLOR&lt;/code&gt; or &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt; (but &lt;code&gt;0&lt;/code&gt;) turns it on, then &lt;code&gt;TERM=dumb&lt;/code&gt; turns it off, and otherwise the stream gets color only when it&amp;rsquo;s a terminal. Names mode stays plain in a terminal too, so end-to-end checks that run devvm under &lt;code&gt;script&lt;/code&gt; read the names as they are. A &lt;code&gt;UI&lt;/code&gt; from &lt;code&gt;New&lt;/code&gt;, as tests make, has no terminal, so it&amp;rsquo;s plain unless the environment it reads sets &lt;code&gt;FORCE_COLOR&lt;/code&gt; or &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;, which is how cli&amp;rsquo;s tests get a colored one.&lt;/p&gt;
&lt;p&gt;The colors are SGR codes from the 16 base colors only, which the theme maps to its own shades. devvm uses no bright colors (90–97), because Solarized maps them to greys and bright black is Solarized Dark&amp;rsquo;s background, and it uses no backgrounds, 256 colors or truecolor. The codes go on labels, links, log text and a message&amp;rsquo;s values, never on the template&amp;rsquo;s own words:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A message&amp;rsquo;s values are bold (&lt;code&gt;1&lt;/code&gt;), on the status line and in prompts too. &lt;code&gt;msg.M.Segments&lt;/code&gt; renders the template with each value between two private-use runes, &lt;code&gt;U+E000&lt;/code&gt; and &lt;code&gt;U+E001&lt;/code&gt;, after dropping those runes from the values, so a value can&amp;rsquo;t start or end a marking of its own. It returns the text cut into segments, each one the template&amp;rsquo;s words or a value, beside the doc link. Joined, the segments are &lt;code&gt;Text&lt;/code&gt;, and &lt;code&gt;String&lt;/code&gt; and names mode don&amp;rsquo;t change. Every value goes through &lt;code&gt;msg.OneLine&lt;/code&gt; as the message renders, in &lt;code&gt;Text&lt;/code&gt;, &lt;code&gt;Segments&lt;/code&gt; and &lt;code&gt;Names&lt;/code&gt; alike, so a value has no newline or other control character, whoever made it, bold or not. The log end that &lt;code&gt;ErrorLogged&lt;/code&gt; prints is the message on one line without bold, because bold inside dim would cancel it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Error&lt;/code&gt;&amp;rsquo;s &lt;code&gt;devvm:&lt;/code&gt; label is bold red (&lt;code&gt;1;31&lt;/code&gt;), and &lt;code&gt;Warn&lt;/code&gt;&amp;rsquo;s is bold yellow (&lt;code&gt;1;33&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A doc link is underlined blue (&lt;code&gt;4;34&lt;/code&gt;). &lt;code&gt;msg.M.Segments&lt;/code&gt; gives the doc link apart from the text, so &lt;code&gt;ui&lt;/code&gt; colors the link alone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Info&lt;/code&gt;&amp;rsquo;s &lt;code&gt;==&amp;gt;&lt;/code&gt; is bold (&lt;code&gt;1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The run log&amp;rsquo;s end that &lt;code&gt;ErrorLogged&lt;/code&gt; prints, with its &lt;code&gt;---&lt;/code&gt; lines, the log text on the status line, and the log&amp;rsquo;s lines that &lt;code&gt;-v&lt;/code&gt; streams (&lt;code&gt;SetVerbose&lt;/code&gt;: &lt;code&gt;LoggedCmd&lt;/code&gt; and &lt;code&gt;LogWriter&lt;/code&gt; copy the log to stderr through &lt;code&gt;msg.Printable&lt;/code&gt;, with no status line) are dim (&lt;code&gt;2&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The done mark that a slow step leaves is green (&lt;code&gt;32&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The codes are added after &lt;code&gt;msg.Printable&lt;/code&gt; and &lt;code&gt;msg.OneLine&lt;/code&gt;, so they&amp;rsquo;re the only ones devvm prints. Those two are devvm&amp;rsquo;s one cleaner, and &lt;code&gt;msg.Safe&lt;/code&gt; is its one rule for which characters reach the terminal. They drop every character that &lt;code&gt;msg.Safe&lt;/code&gt; refuses but newline and tab (which &lt;code&gt;OneLine&lt;/code&gt; drops too), and a lone C1 byte. &lt;code&gt;msg.Safe&lt;/code&gt; takes a graphic character in any script, such as an accented letter, a CJK character or an emoji, so a VM&amp;rsquo;s file names still read as they are. It refuses the control characters (C0, DEL and C1), the bidi controls such as U+202E, which reorder the text after them so a name could read as another, the format characters, such as the zero-width space and joiners, the word joiner, the soft hyphen and the tag characters, the variation selectors, and the fillers that show as nothing, such as U+3164 and the braille blank U+2800, which could hide or fake text in a prompt. The diff of devvm agent save writes each character that &lt;code&gt;msg.Safe&lt;/code&gt; refuses as its code instead, and the names of the files it saves must hold none. The status line, the run log&amp;rsquo;s end, &lt;code&gt;Pick&lt;/code&gt;, &lt;code&gt;devvm network log&lt;/code&gt; and the port forwarder&amp;rsquo;s log use them as well. The status line cuts and counts its plain text with &lt;code&gt;style.fit&lt;/code&gt; before painting it, so it still fits the terminal&amp;rsquo;s width and clears the right number of rows. The run log is never colored.&lt;/p&gt;
&lt;p&gt;Tables on &lt;code&gt;Stdout()&lt;/code&gt; are colored as stdout is. A command gets a &lt;code&gt;ui.Table&lt;/code&gt; from &lt;code&gt;u.Table()&lt;/code&gt; and adds a header, rows of &lt;code&gt;ui.Cell&lt;/code&gt;s and a totals row, and cli never reads the environment itself. Each cell has a &lt;code&gt;ui.Role&lt;/code&gt;: &lt;code&gt;Good&lt;/code&gt; is green (&lt;code&gt;32&lt;/code&gt;), &lt;code&gt;Attention&lt;/code&gt; yellow (&lt;code&gt;33&lt;/code&gt;), &lt;code&gt;Bad&lt;/code&gt; red (&lt;code&gt;31&lt;/code&gt;), &lt;code&gt;Secondary&lt;/code&gt; dim (&lt;code&gt;2&lt;/code&gt;), and &lt;code&gt;Plain&lt;/code&gt; stays in the default color, while the header and totals rows are bold. &lt;code&gt;Table&lt;/code&gt; pads each cell on its plain text before painting it, because &lt;code&gt;text/tabwriter&lt;/code&gt; counts the codes&amp;rsquo; bytes as width, and a plain table is byte for byte what &lt;code&gt;text/tabwriter&lt;/code&gt; writes with a padding of 2 (&lt;code&gt;TestTableLikeTabwriter&lt;/code&gt;). The roles for each table&amp;rsquo;s values are next to the code that writes it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;devvm images: &lt;code&gt;current&lt;/code&gt; is good, &lt;code&gt;stale&lt;/code&gt;, &lt;code&gt;unfinished&lt;/code&gt;, &lt;code&gt;unused&lt;/code&gt; and &lt;code&gt;not built&lt;/code&gt; need attention, and digests and keys are secondary.&lt;/li&gt;
&lt;li&gt;devvm ls: &lt;code&gt;Running&lt;/code&gt; and the &lt;code&gt;.git&lt;/code&gt; protections &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;clone&lt;/code&gt; are good, &lt;code&gt;Stopped&lt;/code&gt; needs attention, and any other status, such as &lt;code&gt;Broken&lt;/code&gt;, is bad, as is the tier &lt;code&gt;unenforced&lt;/code&gt;, while a confined tier, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, is good and &lt;code&gt;open&lt;/code&gt; stays plain.&lt;/li&gt;
&lt;li&gt;devvm space: &lt;code&gt;only copy&lt;/code&gt; and &lt;code&gt;leftover&lt;/code&gt; in KEPT need attention.&lt;/li&gt;
&lt;li&gt;devvm doctor: &lt;code&gt;native&lt;/code&gt; is good, &lt;code&gt;emulated&lt;/code&gt; needs attention, and &lt;code&gt;unreviewed&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt; are bad.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every command&amp;rsquo;s &lt;code&gt;--json&lt;/code&gt; output is for scripts and stays plain.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mise run test&lt;/code&gt; unsets &lt;code&gt;NO_COLOR&lt;/code&gt;, &lt;code&gt;FORCE_COLOR&lt;/code&gt; and &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;, and the end-to-end tests unset the last two, so your own settings never change what they check.&lt;/p&gt;
&lt;h3 data-hextra-search-id="translations"&gt;Translations&lt;span class="hx:absolute hx:-mt-20" id="translations"&gt;&lt;/span&gt;
&lt;a href="#translations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A translation is &lt;code&gt;locales/&amp;lt;language&amp;gt;.toml&lt;/code&gt; (&lt;code&gt;de.toml&lt;/code&gt;) with the same tables, &lt;code&gt;one&lt;/code&gt; and &lt;code&gt;other&lt;/code&gt; translated (and the language&amp;rsquo;s other plural forms, such as &lt;code&gt;few&lt;/code&gt;), loaded by go-i18n the same way. Doc links are the same in every language: the docs site is English. devvm picks the language from the first of &lt;code&gt;LC_ALL&lt;/code&gt;, &lt;code&gt;LC_MESSAGES&lt;/code&gt; and &lt;code&gt;LANG&lt;/code&gt; that is set (&lt;code&gt;de_DE.UTF-8&lt;/code&gt; is German); &lt;code&gt;C&lt;/code&gt; and &lt;code&gt;POSIX&lt;/code&gt; are English. A message missing from a translation is shown in English.&lt;/p&gt;
&lt;h2 data-hextra-search-id="json-output"&gt;JSON output&lt;span class="hx:absolute hx:-mt-20" id="json-output"&gt;&lt;/span&gt;
&lt;a href="#json-output" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every command that shows or lists something takes &lt;code&gt;--json&lt;/code&gt;, which &lt;code&gt;jsonFlag&lt;/code&gt; in &lt;code&gt;internal/cli/json.go&lt;/code&gt; adds. The command builds a struct of its own with snake_case &lt;code&gt;json&lt;/code&gt; tags, next to the code that writes its table, and writes it with &lt;code&gt;printJSON&lt;/code&gt;, which puts &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt; (&lt;code&gt;jsonVersion&lt;/code&gt;) first, writes HTML characters as they are and refuses anything but an object. A list it prints is never &lt;code&gt;nil&lt;/code&gt;, so it&amp;rsquo;s &lt;code&gt;[]&lt;/code&gt; rather than &lt;code&gt;null&lt;/code&gt;, and a field that doesn&amp;rsquo;t apply is &lt;code&gt;omitempty&lt;/code&gt;. Sizes are bytes unless the field&amp;rsquo;s name gives the unit, as in &lt;code&gt;memory_gib&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The root command&amp;rsquo;s &lt;code&gt;PersistentPreRun&lt;/code&gt; calls &lt;code&gt;u.DataOnly()&lt;/code&gt; for any command given &lt;code&gt;--json&lt;/code&gt;, so &lt;code&gt;Say&lt;/code&gt;, &lt;code&gt;Info&lt;/code&gt; and &lt;code&gt;LogNote&lt;/code&gt; print to stderr from then on, and stdout gets only the JSON. A settings command that also changes its setting with a value wraps its &lt;code&gt;Args&lt;/code&gt; in &lt;code&gt;showsOnly&lt;/code&gt;, which refuses the value with &lt;code&gt;--json&lt;/code&gt; (&lt;code&gt;json_shows_only&lt;/code&gt;) before anything else runs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;TestJSONShapes&lt;/code&gt; in &lt;code&gt;internal/cli/json_test.go&lt;/code&gt; holds each command&amp;rsquo;s shape, a &lt;code&gt;path: type&lt;/code&gt; line for each field of a sample with every field set. A field renamed, removed or given another type fails it. Shapes only gain fields, so a new field goes into the sample and the test, and any other change raises &lt;code&gt;jsonVersion&lt;/code&gt;. A new command that shows or lists something gets &lt;code&gt;--json&lt;/code&gt;, a row in that test, a CLI test and a section on its page with an example, which &lt;a href="https://next.devvm.dev/docs/using/command-line/#output-for-scripts"&gt;output for scripts&lt;/a&gt; links to.&lt;/p&gt;</description></item><item><title>Tests</title><link>https://next.devvm.dev/docs/contributing/tests/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/tests/</guid><description>
&lt;h2 data-hextra-search-id="go-test-helpers"&gt;Go test helpers&lt;span class="hx:absolute hx:-mt-20" id="go-test-helpers"&gt;&lt;/span&gt;
&lt;a href="#go-test-helpers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every change to devvm&amp;rsquo;s logic comes with a test, and Go tests are table tests next to the code they test. Neither the Go tests nor the &lt;a href="#cli-tests"&gt;CLI tests&lt;/a&gt; touch the Keychain, real VMs or your own folders. A Go test that writes state points the XDG folders at &lt;code&gt;t.TempDir()&lt;/code&gt;, and a Go test makes VMs only on the fake backend, &lt;code&gt;backendtest&lt;/code&gt;. The CLI tests run the built devvm against the &lt;a href="#stubs"&gt;stubs&lt;/a&gt;, so only the &lt;a href="#end-to-end-tests"&gt;end-to-end tests&lt;/a&gt; make real VMs. The Go tests share a few helpers, so each one reads the same way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stubtest.New(t)&lt;/code&gt;&lt;/strong&gt; puts the &lt;a href="#stubs"&gt;stubs&lt;/a&gt; first on &lt;code&gt;PATH&lt;/code&gt; for one test, as the CLI tests have them, with a new folder under &lt;code&gt;/tmp&lt;/code&gt; as their &lt;code&gt;STUB_DIR&lt;/code&gt; and its &lt;code&gt;calls&lt;/code&gt; file as their &lt;code&gt;STUB_LOG&lt;/code&gt;. The folder goes when the test ends. &lt;code&gt;stubtest.New(t, &amp;quot;ssh&amp;quot;)&lt;/code&gt; puts only the stubs it names on &lt;code&gt;PATH&lt;/code&gt;, so the host&amp;rsquo;s other commands, such as git, stay. Its &lt;code&gt;Calls&lt;/code&gt; returns the calls the stubs logged, &lt;code&gt;Reset&lt;/code&gt; forgets them, and &lt;code&gt;Touch&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt; and &lt;code&gt;Read&lt;/code&gt; work on the files the stubs read, such as a switch, a file whose presence makes a stub fail. &lt;code&gt;VM&lt;/code&gt;, &lt;code&gt;Size&lt;/code&gt; and &lt;code&gt;VMs&lt;/code&gt; set and read Lima&amp;rsquo;s instances in the stubs&amp;rsquo; state, and &lt;code&gt;Keychain&lt;/code&gt; and &lt;code&gt;SetKeychain&lt;/code&gt; the Keychain&amp;rsquo;s items. &lt;code&gt;stubtest.Command(t, &amp;quot;mise&amp;quot;)&lt;/code&gt; returns the path of one stub, for a test that runs it by its path, as &lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt; does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stubtest.Git(ctx, args...)&lt;/code&gt;&lt;/strong&gt; is plain git for a test&amp;rsquo;s own repo, and a test runs git only through it, which the structure test checks. Its environment is the test&amp;rsquo;s without git&amp;rsquo;s variables that pick a repo, its files or its config, such as &lt;code&gt;GIT_DIR&lt;/code&gt;, &lt;code&gt;GIT_WORK_TREE&lt;/code&gt; and &lt;code&gt;GIT_CONFIG_PARAMETERS&lt;/code&gt; (&lt;code&gt;stubtest.GitEnv&lt;/code&gt;), and it reads no global or system config. A git that runs the tests, such as a hook&amp;rsquo;s or &lt;code&gt;git rebase --exec&lt;/code&gt;&amp;rsquo;s, sets some of those variables, and a test&amp;rsquo;s git that kept them would work on the checkout itself, writing its config and commits there. A test that runs something else that runs git, such as a script or a stub, calls &lt;code&gt;stubtest.NoGitRepo(t)&lt;/code&gt; first, which takes the same variables out of the test&amp;rsquo;s environment until it ends, and &lt;code&gt;stubtest.New&lt;/code&gt; calls it for the stubs. The CLI tests&amp;rsquo; environment leaves them out too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stubtest.ExecRunner&lt;/code&gt;&lt;/strong&gt; is a backend&amp;rsquo;s runner that runs each command as it is, with no run log, so a backend under test runs the stubs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;msg.IDOf(err)&lt;/code&gt;&lt;/strong&gt; returns the ID of the message an error carries, or &amp;quot;&amp;quot; when it carries none, and &lt;strong&gt;&lt;code&gt;msg.NamesOf(err)&lt;/code&gt;&lt;/strong&gt; returns the message&amp;rsquo;s names, as names mode prints them, or the error&amp;rsquo;s own text when it isn&amp;rsquo;t a message. A test compares either with what it expects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;msg.Fake&lt;/code&gt;&lt;/strong&gt; is the &lt;code&gt;msg.Reporter&lt;/code&gt; a package under test prints and asks through. Its zero value is quiet: it prints nothing, has no terminal, so it refuses every question as the UI does where it can&amp;rsquo;t ask, and runs a logged command as it is. Its fields change that: &lt;code&gt;OnInfo&lt;/code&gt;, &lt;code&gt;OnWarn&lt;/code&gt; and the other &lt;code&gt;On&lt;/code&gt; funcs are given each message or question of their kind, with a question&amp;rsquo;s context going to &lt;code&gt;OnNote&lt;/code&gt; first, &lt;code&gt;OnAny&lt;/code&gt; every message, and &lt;code&gt;Terminal&lt;/code&gt;, &lt;code&gt;Picks&lt;/code&gt;, &lt;code&gt;Interrupt&lt;/code&gt; and the writers stand for the terminal, the picker, an interrupt and the output. &lt;code&gt;OnStatus&lt;/code&gt; is given each status line&amp;rsquo;s label and each logged command&amp;rsquo;s step, and &lt;code&gt;Showing&lt;/code&gt; returns the one showing now, for a test that checks slow work runs under its status line (&lt;a href="https://next.devvm.dev/docs/contributing/cli/#status-lines"&gt;status lines&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;msg.Recorder&lt;/code&gt;&lt;/strong&gt; keeps the messages it&amp;rsquo;s given. Set a &lt;code&gt;msg.Fake&lt;/code&gt;&amp;rsquo;s &lt;code&gt;OnInfo&lt;/code&gt; or &lt;code&gt;OnWarn&lt;/code&gt; to the recorder&amp;rsquo;s &lt;code&gt;Add&lt;/code&gt;, then compare its &lt;code&gt;Names&lt;/code&gt; or its &lt;code&gt;IDs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;backendtest.Stored&lt;/code&gt;&lt;/strong&gt; is the fake backend with its disks on the host, for the free-space checks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s child in a test&amp;rsquo;s process&lt;/strong&gt; gets &lt;code&gt;IO&lt;/code&gt;&amp;rsquo;s &lt;code&gt;confine&lt;/code&gt;, a confinement that confines nothing (&lt;code&gt;noConfine&lt;/code&gt;), because &lt;code&gt;confineChild&lt;/code&gt; would confine the test&amp;rsquo;s whole process on Linux. &lt;code&gt;ChildMain&lt;/code&gt; uses &lt;code&gt;confineChild&lt;/code&gt; only when the field is nil, and &lt;code&gt;runChildOn&lt;/code&gt; refuses to start without one. A test of &lt;code&gt;confineChild&lt;/code&gt;&amp;rsquo;s own logic calls &lt;code&gt;confineWith&lt;/code&gt; with a confinement of its own. A test&amp;rsquo;s server made with &lt;code&gt;newServer&lt;/code&gt; looks up its names and connects in the test&amp;rsquo;s process, because &lt;code&gt;newChildServer&lt;/code&gt; gives it the broker itself. The tests that run the child over a real socketpair (&lt;code&gt;inProcess&lt;/code&gt;) send every lookup and connection through the broker instead, and a broker in a test connects through a seam of its own (&lt;code&gt;broker.net&lt;/code&gt;&amp;rsquo;s &lt;code&gt;connect&lt;/code&gt;) wherever it could reach the internet. &lt;code&gt;internal/landlock&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TestSelf&lt;/code&gt; runs the test binary again as a child that confines itself and logs what it could still do. It runs only without cgo (&lt;code&gt;CGO_ENABLED=0&lt;/code&gt;), as CI&amp;rsquo;s &lt;code&gt;nocgo&lt;/code&gt; job and a hand run on a Linux host do, and skips under the race detector, whose cgo keeps Go from reaching every thread. The CLI tests&amp;rsquo; devvm is built without cgo, so on Linux their VMs&amp;rsquo; proxies&amp;rsquo; children run confined too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="goroutine-leaks"&gt;Goroutine leaks&lt;span class="hx:absolute hx:-mt-20" id="goroutine-leaks"&gt;&lt;/span&gt;
&lt;a href="#goroutine-leaks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A goroutine that outlives its test is one that would outlive its command in devvm, such as a tunnel the proxy carries after it has closed, or a goroutine that passes signals on after its child has ended. &lt;code&gt;internal/leaktest&lt;/code&gt; finds them in every package that starts goroutines: &lt;code&gt;internal/proxy&lt;/code&gt;, &lt;code&gt;vmssh&lt;/code&gt;, &lt;code&gt;daemon&lt;/code&gt;, &lt;code&gt;desktop&lt;/code&gt;, &lt;code&gt;ui&lt;/code&gt;, &lt;code&gt;vm&lt;/code&gt;, &lt;code&gt;backend/lima&lt;/code&gt;, &lt;code&gt;platform&lt;/code&gt;, &lt;code&gt;cli&lt;/code&gt;, &lt;code&gt;gitprotect&lt;/code&gt;, &lt;code&gt;vmlog&lt;/code&gt; and &lt;code&gt;memnet&lt;/code&gt;. It imports only the standard library, so the proxy&amp;rsquo;s and the daemon&amp;rsquo;s tests use it too.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;leaktest.Main(m)&lt;/code&gt;&lt;/strong&gt;, in a package&amp;rsquo;s &lt;code&gt;TestMain&lt;/code&gt;, runs the tests and, once they&amp;rsquo;ve passed, reads every goroutine&amp;rsquo;s stack. It gives the goroutines that are still ending, such as a closed listener&amp;rsquo;s accept loop, five seconds, then fails the test binary with the stacks of any still running. It leaves out the standard library&amp;rsquo;s own goroutines that outlive every test and that no test can end, which &lt;code&gt;allowed&lt;/code&gt; lists with why: &lt;code&gt;signal.Notify&lt;/code&gt;&amp;rsquo;s loop and an HTTP client&amp;rsquo;s idle connections. It then reads Go&amp;rsquo;s &lt;code&gt;goroutineleak&lt;/code&gt; profile, which names each goroutine blocked for good on a channel, a lock or a wait group that nothing still running can reach, and fails on any it names. A &lt;code&gt;TestMain&lt;/code&gt; that makes the test binary a helper process runs the helper first and calls &lt;code&gt;leaktest.Main&lt;/code&gt; last.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;leaktest.Check(t)&lt;/code&gt;&lt;/strong&gt;, called first in a test, fails that test when a goroutine started while it ran is still running once it has ended, its context cancelled and its cleanups run, after the same five seconds. It counts the goroutines the test started, and theirs, followed through those still running, so a test running in parallel doesn&amp;rsquo;t count. Nor does a goroutine that a server shared between tests starts for the test, such as a server that &lt;code&gt;TestMain&lt;/code&gt; or a &lt;code&gt;sync.Once&lt;/code&gt; started. That goroutine leads back to the server&amp;rsquo;s own goroutine, which ran before the test, and &lt;code&gt;Main&lt;/code&gt; finds such goroutines at the end. &lt;code&gt;Check&lt;/code&gt;&amp;rsquo;s failure names the test, where &lt;code&gt;Main&lt;/code&gt;&amp;rsquo;s names only the binary, so a test of something that starts and stops goroutines, such as a link session, the port forwarder or the desktop&amp;rsquo;s relay, calls it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Anything &lt;code&gt;Main&lt;/code&gt; or &lt;code&gt;Check&lt;/code&gt; finds is a leak to fix, with a test that fails without the fix. Only a goroutine that the standard library starts and that outlives every test goes in &lt;code&gt;allowed&lt;/code&gt;. A new package that starts goroutines gets a &lt;code&gt;main_test.go&lt;/code&gt; that calls &lt;code&gt;leaktest.Main&lt;/code&gt;, which the structure test checks, and the structure test also lists every goroutine devvm&amp;rsquo;s code starts, with what waits for it to end (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-structure-test"&gt;&lt;code&gt;goroutineSites&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;
&lt;h2 data-hextra-search-id="time-and-lifecycles"&gt;Time and lifecycles&lt;span class="hx:absolute hx:-mt-20" id="time-and-lifecycles"&gt;&lt;/span&gt;
&lt;a href="#time-and-lifecycles" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A test of a timeout, a grace or a close, such as the relay&amp;rsquo;s grace, the forwarder&amp;rsquo;s close or the proxy&amp;rsquo;s ClientHello deadline, runs in a &lt;a href="https://pkg.go.dev/testing/synctest" target="_blank" rel="noopener"&gt;&lt;code&gt;testing/synctest&lt;/code&gt;&lt;/a&gt; bubble, &lt;code&gt;synctest.Test(t, func(t *testing.T) { … })&lt;/code&gt;, rather than sleeping on the real clock. Inside the bubble, time is fake and moves only when every goroutine of the test is blocked, so &lt;code&gt;time.Sleep(30 * time.Second)&lt;/code&gt; returns at once, and &lt;code&gt;synctest.Wait()&lt;/code&gt; returns once every other goroutine has done what it can. Such a test takes no time, and a loaded CI machine can&amp;rsquo;t make it fail, so it never needs the margins a real-clock test does.&lt;/p&gt;
&lt;p&gt;A test checks that something happens at the moment it&amp;rsquo;s due and not a nanosecond before. It sleeps to just short of the moment, calls &lt;code&gt;synctest.Wait()&lt;/code&gt; and checks, then sleeps the last nanosecond and checks again. A goroutine that never ends fails the bubble as a deadlock, and a test of something that starts and stops goroutines calls &lt;a href="#goroutine-leaks"&gt;&lt;code&gt;leaktest.Check(t)&lt;/code&gt;&lt;/a&gt; before the bubble as well.&lt;/p&gt;
&lt;p&gt;Time moves only while each goroutine waits on something inside the bubble: a channel, a timer, &lt;code&gt;time.Sleep&lt;/code&gt;, a &lt;code&gt;sync.Cond&lt;/code&gt; or a wait group. A socket&amp;rsquo;s read, a process&amp;rsquo;s wait or any system call that blocks keeps it from moving, so the code under test gets seams. Like every test seam, each one is a field that a test sets to a stand-in in memory:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;internal/memnet&lt;/code&gt;&lt;/strong&gt; is a network in memory for tests. &lt;code&gt;memnet.Pipe()&lt;/code&gt; makes a connection, and a &lt;code&gt;memnet.Network&lt;/code&gt; holds listeners by address, whose &lt;code&gt;Listen&lt;/code&gt;, &lt;code&gt;Dial&lt;/code&gt; and &lt;code&gt;DialContext&lt;/code&gt; stand in for a socket&amp;rsquo;s. Its connections close their writing side alone (&lt;code&gt;CloseWrite&lt;/code&gt;), as TCP&amp;rsquo;s do and &lt;code&gt;net.Pipe&lt;/code&gt;&amp;rsquo;s don&amp;rsquo;t. They hold up to 64 KiB that the other end hasn&amp;rsquo;t read before a write waits, as a socket&amp;rsquo;s buffer does. They have deadlines on the bubble&amp;rsquo;s clock, and so do its listeners, through &lt;code&gt;SetDeadline&lt;/code&gt;. It uses only the standard library, so the proxy&amp;rsquo;s tests use it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The forwarder and the link sessions&lt;/strong&gt; take their listeners from their &lt;code&gt;Listen&lt;/code&gt; fields, so a test gives them a &lt;code&gt;memnet.Network&lt;/code&gt;&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The relays&lt;/strong&gt; carry each connection through an &lt;code&gt;sshRelay&lt;/code&gt;, whose &lt;code&gt;start&lt;/code&gt; field starts its &lt;code&gt;ssh -W&lt;/code&gt;. In production it&amp;rsquo;s &lt;code&gt;execSSH&lt;/code&gt;, and a test&amp;rsquo;s stand-in, &lt;code&gt;memSSH&lt;/code&gt;, is a VM in memory that sends what the test tells it and ends only when its context does, as &lt;code&gt;exec.CommandContext&lt;/code&gt; kills ssh.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&lt;/strong&gt; connects to the far ends through its egress&amp;rsquo;s &lt;code&gt;connect&lt;/code&gt; field, which &lt;code&gt;memServe&lt;/code&gt; points at a &lt;code&gt;memnet.Network&lt;/code&gt; while it serves the proxy on a listener in memory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;daemon.Proc&lt;/code&gt;&lt;/strong&gt; asks its &lt;code&gt;Alive&lt;/code&gt;, &lt;code&gt;Args&lt;/code&gt; and &lt;code&gt;Signal&lt;/code&gt; fields about its process, so a test of &lt;code&gt;Stop&lt;/code&gt; gives it a process table of its own (&lt;code&gt;fakeProc&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A test&amp;rsquo;s own HTTP server&lt;/strong&gt;, when the test sends the requests itself, is &lt;code&gt;httptest.NewTestServer&lt;/code&gt;&amp;rsquo;s, which serves in memory, and the test sends through its &lt;code&gt;Client()&lt;/code&gt;, which reaches it whatever the request&amp;rsquo;s host.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A stand-in can&amp;rsquo;t show what the real thing does with a kernel&amp;rsquo;s buffers, a real ssh or a real process, so each kind of lifecycle keeps one test that runs the real one, on the real clock: &lt;code&gt;TestPipeSSHGrace&lt;/code&gt;, &lt;code&gt;TestPipeSSHGraceSlowClient&lt;/code&gt; and &lt;code&gt;TestPipeSSHGraceWriteError&lt;/code&gt; run the relay with an ssh stand-in on &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;TestForwarderEndsStuckRelay&lt;/code&gt; closes a forward whose relay&amp;rsquo;s ssh never ends, &lt;code&gt;TestLinksBurst&lt;/code&gt; fills a link&amp;rsquo;s real Unix socket, &lt;code&gt;TestSpliceKeepsAnEarlyAnswer&lt;/code&gt; splices over TCP and &lt;code&gt;TestProcStop&lt;/code&gt; stops real processes. A new seam keeps the real test of its kind.&lt;/p&gt;
&lt;p&gt;The proxy&amp;rsquo;s tests that start a whole proxy, such as &lt;code&gt;TestMainRuns&lt;/code&gt; and &lt;code&gt;TestAgentRelay&lt;/code&gt;, run its child in the test&amp;rsquo;s process (&lt;code&gt;inProcess&lt;/code&gt;), on real sockets, so they can&amp;rsquo;t run in a bubble. Their broker waits &lt;code&gt;testStartWait&lt;/code&gt;, 30 seconds, for the child to say it&amp;rsquo;s ready, through &lt;code&gt;IO&lt;/code&gt;&amp;rsquo;s &lt;code&gt;startWait&lt;/code&gt; field, where devvm&amp;rsquo;s own proxy waits 4 seconds, and each test waits as long for the proxy to listen (&lt;code&gt;retryFor&lt;/code&gt;). Under the race detector on a loaded Linux host, those starts can take more than 4 seconds, most of it spent hashing the test&amp;rsquo;s executable, which each broker does as it starts, so a wait of 4 seconds would fail them.&lt;/p&gt;
&lt;h2 data-hextra-search-id="cli-tests"&gt;CLI tests&lt;span class="hx:absolute hx:-mt-20" id="cli-tests"&gt;&lt;/span&gt;
&lt;a href="#cli-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;CLI tests are &lt;a href="https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript" target="_blank" rel="noopener"&gt;testscript&lt;/a&gt; scripts in &lt;code&gt;testdata/script/*.txtar&lt;/code&gt;, run by &lt;code&gt;internal/cli/script_test.go&lt;/code&gt; against a freshly built &lt;code&gt;devvm&lt;/code&gt;. Call it with &lt;code&gt;exec devvm …&lt;/code&gt;:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;# An unknown flag fails.
! exec devvm --nope
stderr &amp;#39;^devvm: flag_unknown command=devvm flag=--nope$&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Scripts see messages by their &lt;a href="https://next.devvm.dev/docs/contributing/cli/#names-mode"&gt;names&lt;/a&gt;, so the example checks which message devvm printed, not its wording. A script that checks a message&amp;rsquo;s text sets &lt;code&gt;env DEVVM_MESSAGES=&lt;/code&gt; first.&lt;/p&gt;
&lt;p&gt;Run one script with &lt;code&gt;mise exec -- go test ./internal/cli -run TestScript/&amp;lt;name&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Each script runs in a sandbox under &lt;code&gt;/tmp&lt;/code&gt;, never the real folders:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Points to&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;home/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;XDG_DATA_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;data/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;config/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_LIMA_HOME&lt;/code&gt;, &lt;code&gt;LIMA_HOME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lima/&lt;/code&gt; (short, for Lima&amp;rsquo;s socket paths)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DATA&lt;/code&gt;, &lt;code&gt;VMS&lt;/code&gt;, &lt;code&gt;RUN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s data folder, &lt;code&gt;data/devvm/&lt;/code&gt;, and its &lt;code&gt;vms/&lt;/code&gt; and &lt;code&gt;run/&lt;/code&gt; folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CFG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s config folder, &lt;code&gt;config/devvm/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_MESSAGES&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;names&lt;/code&gt;, so messages print as their &lt;a href="https://next.devvm.dev/docs/contributing/cli/#names-mode"&gt;names&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_DIR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stub/&lt;/code&gt;, for stubs&amp;rsquo; state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_LOG&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stub/calls&lt;/code&gt;, the stubs&amp;rsquo; call log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm-test&lt;/code&gt;, the Keychain service name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ubuntu/&lt;/code&gt;, with a dated release as Ubuntu signed it. Its cloud image is a gigabyte, so the sandbox has a stand-in for this host&amp;rsquo;s in &lt;code&gt;data/devvm/images/ubuntu/&lt;/code&gt;, named for its SHA-256 in the release&amp;rsquo;s checksums, as if devvm had downloaded it, and a script that tests the download or the import from Lima&amp;rsquo;s cache removes it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TOOL_SLOTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1, so tool images build one at a time and the stubs&amp;rsquo; calls keep their order, and &lt;code&gt;tools_side_by_side.txtar&lt;/code&gt; sets 3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_KVM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;stub/kvm&lt;/code&gt;, a file standing in for Linux&amp;rsquo;s &lt;code&gt;/dev/kvm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_TEST_CPUS&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_MEMORY_GIB&lt;/code&gt;, &lt;code&gt;DEVVM_TEST_FREE_GIB&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;8, 16 and 500: a large host, whatever runs the tests (&lt;a href="https://next.devvm.dev/docs/contributing/testing/#a-host-of-any-size"&gt;details&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the &lt;code&gt;mise&lt;/code&gt; stub, which resolves the shared tools in place of devvm&amp;rsquo;s own mise&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the stubs&amp;rsquo; folder, so devvm paste runs the clipboard stubs in place of the system&amp;rsquo;s tools, such as macOS&amp;rsquo;s &lt;code&gt;/usr/bin/osascript&lt;/code&gt;, and no script reaches the real clipboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MISE_STUB_LOCK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;testdata/mise.lock&lt;/code&gt;, the lock the &lt;code&gt;mise&lt;/code&gt; stub writes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TOOLCHAINS&lt;/code&gt;, &lt;code&gt;AGENTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the toolchains&amp;rsquo; and the coding agents&amp;rsquo; names, in the registries&amp;rsquo; order and joined with spaces, as devvm&amp;rsquo;s messages list them, so a script that checks a list names no toolchain or agent itself (&lt;code&gt;stderr 'names='$TOOLCHAINS'$'&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENT_CHOICES&lt;/code&gt;, &lt;code&gt;LOGIN_AGENTS&lt;/code&gt;, &lt;code&gt;KEY_AGENTS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;every agent&amp;rsquo;s name, those that &lt;code&gt;devvm agent login&lt;/code&gt; logs in, and those with a key for each provider, in the registry&amp;rsquo;s order and joined with a comma and a space, as a message of choices lists them (&lt;code&gt;stderr 'choices='$AGENT_CHOICES' command='&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_BIN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the folder of the built &lt;code&gt;devvm&lt;/code&gt;, alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_REPO&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the checkout, for the scripts in &lt;code&gt;scripts/&lt;/code&gt;, which tests copy into a throwaway repo before running, and the scripts in &lt;code&gt;assets/&lt;/code&gt;, which tests source to check their pieces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DEVVM_SSH_PORTS&lt;/code&gt;, &lt;code&gt;SANDBOX_PORT_NEXT&lt;/code&gt;, &lt;code&gt;SANDBOX_PORT_END&lt;/code&gt;, &lt;code&gt;DEVVM_PORT_RANGE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the sandbox&amp;rsquo;s own ports, as the next paragraph says&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Each sandbox has a block of 160 ports of its own, between 10000 and 19999, below both the range devvm chooses ports from and the system&amp;rsquo;s ephemeral range, so neither a devvm that a script runs nor an outgoing connection takes one. The sandbox holds the block&amp;rsquo;s lock file in &lt;code&gt;/tmp/devvm-test-ports-&amp;lt;uid&amp;gt;/&lt;/code&gt;, a folder of your user&amp;rsquo;s alone, while it lasts, so no other sandbox has the same block, whether it&amp;rsquo;s in the same test process or in another one running at once, such as a second worktree&amp;rsquo;s gate. While every block is held, a new sandbox waits for one, up to 5 minutes. The block&amp;rsquo;s first 60 ports are for the scripts. The VMs&amp;rsquo; ssh ports (&lt;code&gt;DEVVM_SSH_PORTS&lt;/code&gt;) come first, and then the ports for &lt;code&gt;free_port VAR…&lt;/code&gt; and the fixtures. Each of those is taken in turn from &lt;code&gt;SANDBOX_PORT_NEXT&lt;/code&gt; up to &lt;code&gt;SANDBOX_PORT_END&lt;/code&gt;, and it&amp;rsquo;s free on every address, &lt;code&gt;127.0.0.1&lt;/code&gt; included, when it&amp;rsquo;s taken (&lt;code&gt;free_port -range FIRST LAST&lt;/code&gt; takes two in a row). The other 100 are the range the sandbox&amp;rsquo;s devvm chooses its VMs&amp;rsquo; proxy and desktop ports from (&lt;code&gt;DEVVM_PORT_RANGE&lt;/code&gt;, which only a test build reads), so two sandboxes&amp;rsquo; devvms never choose the same port.&lt;/p&gt;
&lt;p&gt;The built &lt;code&gt;devvm&lt;/code&gt; is a &lt;a href="https://next.devvm.dev/docs/contributing/testing/#test-builds"&gt;test build&lt;/a&gt;, so it reads the stand-ins above that a release ignores, such as &lt;code&gt;DEVVM_KVM&lt;/code&gt; and &lt;code&gt;DEVVM_HOST_MISE&lt;/code&gt;. A script answers a question in one of two ways: &lt;code&gt;ttyin -stdin FILE&lt;/code&gt; gives the next &lt;code&gt;exec&lt;/code&gt; a terminal whose input is the file, so devvm asks as it does in yours, and &lt;code&gt;env DEVVM_PIPED_ANSWERS=1&lt;/code&gt; with &lt;code&gt;stdin FILE&lt;/code&gt; has each question read its answer as a line of the file instead, without its prompt. Without either, devvm has no terminal, so it refuses every question, as a script&amp;rsquo;s devvm does. It has the checkout&amp;rsquo;s &lt;code&gt;assets/&lt;/code&gt; embedded, as a release has, and no test build reads them from elsewhere: a script that needs other files for devvm (layers, features, policies) puts them in the user&amp;rsquo;s folders in the sandbox, as a user would.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$WORK&lt;/code&gt;, the script&amp;rsquo;s own folder, is the current folder. &lt;code&gt;project NAME&lt;/code&gt; makes the folder &lt;code&gt;$WORK/NAME&lt;/code&gt; and goes to it, as a project&amp;rsquo;s folder, and &lt;code&gt;project NAME git&lt;/code&gt; makes it a git repo too. Once devvm has made the folder&amp;rsquo;s VM, &lt;code&gt;vm_name VAR NAME&lt;/code&gt; finds it among the states in &lt;code&gt;$VMS&lt;/code&gt; and sets &lt;code&gt;$VAR&lt;/code&gt; to the VM&amp;rsquo;s name, which ends in an ID the test can&amp;rsquo;t know, so a script can pass it to a stub (&lt;code&gt;exec limactl stop $WEB&lt;/code&gt;). It also sets &lt;code&gt;$VAR_dir&lt;/code&gt; to the VM&amp;rsquo;s folder, &lt;code&gt;$VMS/&amp;lt;hash&amp;gt;&lt;/code&gt;, so a script reads the VM&amp;rsquo;s state as &lt;code&gt;$WEB_dir/vm.json&lt;/code&gt; and its network log as &lt;code&gt;$WEB_dir/logs/network.jsonl&lt;/code&gt;. &lt;code&gt;catg GLOB&lt;/code&gt; prints the one file a glob matches, and fails when the glob matches none or more than one, so a check never reads two files by mistake. &lt;code&gt;vm_state GLOB&lt;/code&gt; prints the one VM state a glob matches as sorted &lt;code&gt;KEY=VALUE&lt;/code&gt; lines for &lt;code&gt;stdout&lt;/code&gt; to match: a section&amp;rsquo;s fields are dotted (&lt;code&gt;net.on=true&lt;/code&gt;, &lt;code&gt;ports.host.ssh=23456&lt;/code&gt;), a list of strings is joined with spaces (&lt;code&gt;tools.names=node claude&lt;/code&gt;), a list of objects is indexed (&lt;code&gt;links.links.0.name=db&lt;/code&gt;), and anything but a string is JSON. Negated, &lt;code&gt;! catg GLOB&lt;/code&gt; and &lt;code&gt;! vm_name VAR NAME&lt;/code&gt; pass when there isn&amp;rsquo;t exactly one. &lt;code&gt;json_set GLOB KEY=VALUE…&lt;/code&gt; sets string fields in each JSON file the glob matches and keeps the rest, or makes the file when a glob without wildcards matches none. &lt;code&gt;KEY:=JSON&lt;/code&gt; sets any JSON value, and a dotted key sets a field of an object, which it makes when it&amp;rsquo;s missing. Scripts write devvm&amp;rsquo;s JSON records with it, such as a tool image&amp;rsquo;s record (&lt;code&gt;json_set $SHARE/node-*.json built=2020-01-01T00:00:00Z&lt;/code&gt;), because a record&amp;rsquo;s times are in the file, where &lt;code&gt;touch&lt;/code&gt; can&amp;rsquo;t change them. &lt;code&gt;renumber FILE&lt;/code&gt; changes a VM&amp;rsquo;s state as a boot that numbered the disks&amp;rsquo; devices anew leaves it, as macOS does. The folder&amp;rsquo;s identity and each &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s &lt;code&gt;git_id&lt;/code&gt; get another device, with their inodes and birth times as they were, and &lt;code&gt;$FOLDER_ID&lt;/code&gt; and &lt;code&gt;$GIT_ID&lt;/code&gt; hold the folder&amp;rsquo;s and its own &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s identities from before the change. &lt;code&gt;fixture VERSION&lt;/code&gt; puts a release&amp;rsquo;s state into the sandbox, and &lt;code&gt;json_superset [-shape] [-changes PATH] WANT GOT&lt;/code&gt; checks that one JSON file has everything another has, as &lt;a href="https://next.devvm.dev/docs/contributing/structure/#released-state"&gt;Released state&lt;/a&gt; says. A VM state a script writes as a fixture needs &lt;code&gt;version&lt;/code&gt;, &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;image&lt;/code&gt;, &lt;code&gt;dir&lt;/code&gt; and &lt;code&gt;backend&lt;/code&gt;, &lt;code&gt;created&lt;/code&gt; for a VM whose creation finished, and a hash of its own for its folder (&lt;code&gt;json_set $VMS/12345612345601/vm.json version:=1 id=x name=devvm-live-12345612345601 image=base dir=/p/live backend=lima created=2020-01-01T00:00:00Z net.on:=false&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Tests never touch the network. Downloads are served from a test server (&lt;code&gt;net/http/httptest&lt;/code&gt;) or read from a &lt;code&gt;file://&lt;/code&gt; folder. &lt;code&gt;DEVVM_UBUNTU_URL&lt;/code&gt; replaces &lt;code&gt;https://cloud-images.ubuntu.com/releases/resolute&lt;/code&gt;, where devvm finds Ubuntu&amp;rsquo;s dated releases: point it at a folder of &lt;code&gt;release-YYYYMMDD/&lt;/code&gt; folders, each with its &lt;code&gt;SHA256SUMS&lt;/code&gt; and &lt;code&gt;SHA256SUMS.gpg&lt;/code&gt;, as &lt;code&gt;file:///path/to/folder&lt;/code&gt;. The CLI tests serve &lt;code&gt;internal/ubuntu/testdata/resolute&lt;/code&gt;, a release as Ubuntu published and signed it, and Go tests sign their own releases with a key they make (&lt;code&gt;internal/ubuntu/pgp_test.go&lt;/code&gt;). devvm&amp;rsquo;s own releases, which &lt;code&gt;devvm upgrade&lt;/code&gt; installs, come from &lt;code&gt;internal/upgrade/upgradetest&lt;/code&gt;: a TLS test server laid out as GitHub&amp;rsquo;s releases, with keys of the test&amp;rsquo;s own (&lt;code&gt;Signers&lt;/code&gt;, which &lt;code&gt;internal/minisign/minisigntest&lt;/code&gt; makes) that sign each release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; as minisign does, as a release is signed while releases bridge from the old release key: by CI&amp;rsquo;s and the co-signer&amp;rsquo;s keys, and by the old key. A script starts one with &lt;code&gt;release_server [-badsig] [-legacy|-keys] LATEST [VERSION...]&lt;/code&gt;, which serves a release of each version, the first the newest, each devvm in it a script that prints its version. &lt;code&gt;-legacy&lt;/code&gt; has only the old key sign them, as 0.1 and 0.2&amp;rsquo;s releases are, &lt;code&gt;-keys&lt;/code&gt; only the release keys, and &lt;code&gt;-badsig&lt;/code&gt; other keys. It points a test build at the server with &lt;code&gt;DEVVM_REPO_URL&lt;/code&gt;, at the release keys with &lt;code&gt;DEVVM_RELEASE_KEYS&lt;/code&gt;, as &lt;code&gt;ci=KEY cosign=KEY recovery=KEY&lt;/code&gt;, at the old key with &lt;code&gt;DEVVM_RELEASE_KEY&lt;/code&gt; and at its certificate with &lt;code&gt;DEVVM_RELEASE_CA&lt;/code&gt;, and &lt;code&gt;DEVVM_TEST_VERSION&lt;/code&gt; gives the test build a release&amp;rsquo;s version. Container registries (&lt;code&gt;--from&lt;/code&gt;) are a TLS test server in Go tests; scripts use pinned digests, which need no lookup, or set &lt;code&gt;HTTPS_PROXY&lt;/code&gt; to a closed port, so lookups fail as offline ones do.&lt;/p&gt;
&lt;p&gt;A command left running in the background (&lt;code&gt;exec devvm … &amp;amp;name&amp;amp;&lt;/code&gt;) can be interrupted with &lt;code&gt;kill -INT name&lt;/code&gt;. &lt;code&gt;wait_file FILE&lt;/code&gt; waits up to 60 seconds for a file to appear, such as one a stub writes when it gets somewhere, and fails at once when every background command has ended. For anything else, &lt;code&gt;wait_until SCRIPT&lt;/code&gt; runs &lt;code&gt;sh -c SCRIPT&lt;/code&gt; every 100 ms until it succeeds, for up to 90 seconds. It fails at once when every background command has ended, or when SCRIPT exits 100, which is how a check that can no longer succeed says so, as when it waits on a session that ended. Wait with these two rather than a loop of your own. A script that runs a copy of devvm makes it with &lt;code&gt;cp_exe SRC DST&lt;/code&gt;, not &lt;code&gt;cp&lt;/code&gt;: on Linux, a command another script starts while the copy is being written keeps the file open for writing until it runs, so running the copy then fails with &amp;ldquo;text file busy&amp;rdquo;, and &lt;code&gt;cp_exe&lt;/code&gt; writes the file while no command can start.&lt;/p&gt;
&lt;h3 data-hextra-search-id="stubs"&gt;Stubs&lt;span class="hx:absolute hx:-mt-20" id="stubs"&gt;&lt;/span&gt;
&lt;a href="#stubs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The stubs stand in for every host command devvm runs, so tests never run the real tools: &lt;code&gt;limactl&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;security&lt;/code&gt;, &lt;code&gt;ssh&lt;/code&gt;, &lt;code&gt;ssh-add&lt;/code&gt;, &lt;code&gt;ssh-agent&lt;/code&gt;, &lt;code&gt;ssh-keygen&lt;/code&gt;, &lt;code&gt;qemu-img&lt;/code&gt;, &lt;code&gt;qemu-system-aarch64&lt;/code&gt;, &lt;code&gt;qemu-system-x86_64&lt;/code&gt;, &lt;code&gt;chflags&lt;/code&gt;, &lt;code&gt;tmutil&lt;/code&gt;, &lt;code&gt;sw_vers&lt;/code&gt;, &lt;code&gt;uname&lt;/code&gt;, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;code&lt;/code&gt;, &lt;code&gt;mise&lt;/code&gt;, and the clipboard tools &lt;code&gt;wl-paste&lt;/code&gt;, &lt;code&gt;wl-copy&lt;/code&gt;, &lt;code&gt;xclip&lt;/code&gt;, &lt;code&gt;osascript&lt;/code&gt; and &lt;code&gt;pbcopy&lt;/code&gt;, which read a clipboard the test lays out in &lt;code&gt;$STUB_DIR&lt;/code&gt; (&lt;code&gt;clip-types&lt;/code&gt;, &lt;code&gt;clip&lt;/code&gt;, &lt;code&gt;clip-file&lt;/code&gt;) and write what&amp;rsquo;s copied to &lt;code&gt;$STUB_DIR/copied&lt;/code&gt;. They are one Go program, &lt;code&gt;internal/stubtest/stub&lt;/code&gt;, which does what the command it&amp;rsquo;s run as would do: the binary is named &lt;code&gt;stub&lt;/code&gt;, each command&amp;rsquo;s name is a link to it, and it reads its name from its &lt;code&gt;argv[0]&lt;/code&gt;. &lt;code&gt;internal/stubtest&lt;/code&gt; builds it once, into &lt;code&gt;$TMPDIR/devvm-stubs-&amp;lt;hash&amp;gt;&lt;/code&gt; with its links, where the hash covers the stub&amp;rsquo;s sources and Go&amp;rsquo;s version. Every test process, and every later run until the sources change, finds that folder and uses it, so the binary builds only once, and a folder of an older build is removed once it&amp;rsquo;s a day old. &lt;code&gt;TestScript&lt;/code&gt; puts that folder on &lt;code&gt;PATH&lt;/code&gt; right after &lt;code&gt;devvm&lt;/code&gt;&amp;rsquo;s, ahead of the real commands.&lt;/p&gt;
&lt;p&gt;Each stub logs its call to &lt;code&gt;$STUB_LOG&lt;/code&gt; as one line, its name and its arguments joined by spaces. The stub writes the line itself, in one write to the log opened for appending, so lines from stubs running at once never mix, and its arguments never go to another process&amp;rsquo;s command line. That matters because endpoint security tools such as CrowdStrike Falcon kill a process whose arguments look like an ssh option next to a proxy URL with a password, which is what a start&amp;rsquo;s &lt;code&gt;limactl edit&lt;/code&gt; passes. &lt;code&gt;stub_calls&lt;/code&gt; prints the log for &lt;code&gt;stdout&lt;/code&gt; or &lt;code&gt;cmp&lt;/code&gt; to check, &lt;code&gt;! stub_calls&lt;/code&gt; fails if anything was logged, and &lt;code&gt;stub_reset&lt;/code&gt; empties the log, so the next check sees only the calls after it:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;exec devvm …
stub_calls
cmp stdout calls
-- calls --
limactl list&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;uname&lt;/code&gt; and &lt;code&gt;sw_vers&lt;/code&gt; pretend to be another host when these are set, and run the real command otherwise:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Printed by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_UNAME_S&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;uname -s&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_UNAME_M&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;uname -m&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;STUB_SW_VERS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sw_vers -productVersion&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;What the stubs keep between their calls is their state, &lt;code&gt;$STUB_DIR/state.json&lt;/code&gt;, which &lt;code&gt;internal/stubtest/stubstate&lt;/code&gt; reads and writes as typed JSON under a file lock, so stubs running at once never lose each other&amp;rsquo;s changes. It holds Lima&amp;rsquo;s instances, each with its status, size and config, the Keychain&amp;rsquo;s items, the SSH agent and its keys, and Time Machine&amp;rsquo;s exclusions. Scripts read and change it with the &lt;code&gt;stub&lt;/code&gt; command, and Go tests with the &lt;code&gt;stubtest.Stubs&lt;/code&gt; methods &lt;code&gt;VM&lt;/code&gt;, &lt;code&gt;Size&lt;/code&gt;, &lt;code&gt;VMs&lt;/code&gt;, &lt;code&gt;Keychain&lt;/code&gt; and &lt;code&gt;SetKeychain&lt;/code&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub vm NAME STATUS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lima lists the instance &lt;code&gt;NAME&lt;/code&gt; in &lt;code&gt;STATUS&lt;/code&gt;, such as &lt;code&gt;Stopped&lt;/code&gt;, &lt;code&gt;Running&lt;/code&gt; or &lt;code&gt;Broken&lt;/code&gt;, with Lima&amp;rsquo;s default size when it&amp;rsquo;s new&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub vms&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints Lima&amp;rsquo;s instances, one &lt;code&gt;NAME STATUS&lt;/code&gt; line each, sorted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub size NAME CPUS MEMORY DISK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gives an instance its size, with the memory and disk in bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub keychain ACCOUNT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints the Keychain&amp;rsquo;s item for &lt;code&gt;ACCOUNT&lt;/code&gt;, and fails when there&amp;rsquo;s none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub keychain-set ACCOUNT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;saves the item for &lt;code&gt;ACCOUNT&lt;/code&gt; from its input, so the value is in no process&amp;rsquo;s arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints the SSH agent&amp;rsquo;s keys as &lt;code&gt;ssh-add -l&lt;/code&gt; lists them, and fails when no agent runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub agent-stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;stops the SSH agent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;stub names&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;prints every stub&amp;rsquo;s name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A switch is a file a test makes in &lt;code&gt;$STUB_DIR&lt;/code&gt; to change what a stub does, such as &lt;code&gt;start-fails&lt;/code&gt;, which makes &lt;code&gt;limactl start&lt;/code&gt; fail. The comment above each stub&amp;rsquo;s function lists its switches, and every switch is named for the command and what happens to it: &lt;code&gt;-fails&lt;/code&gt;, &lt;code&gt;-hangs&lt;/code&gt;, &lt;code&gt;-fails-on&lt;/code&gt; and &lt;code&gt;-waits-on&lt;/code&gt;, where an &lt;code&gt;-on&lt;/code&gt; switch holds the text that a call&amp;rsquo;s arguments must contain. A stub that hangs touches &lt;code&gt;$STUB_DIR/hanging&lt;/code&gt; first, so &lt;code&gt;wait_file&lt;/code&gt; can wait for it. The files a stub writes in &lt;code&gt;$STUB_DIR&lt;/code&gt; are what a test checks, such as &lt;code&gt;$STUB_DIR/sync.tar&lt;/code&gt;, what a VM&amp;rsquo;s setup was sent.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;limactl&lt;/code&gt; keeps its instances in the state and fails or hangs on request. It keeps each instance&amp;rsquo;s size and config as &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;clone&lt;/code&gt; and &lt;code&gt;edit&lt;/code&gt; set them, and a &lt;a href="https://next.devvm.dev/docs/contributing/testing/#tests-on-real-lima"&gt;contract test&lt;/a&gt; checks that it does so as real Lima does. Its &lt;code&gt;shell&lt;/code&gt; reaches the guest, the VM the stubs make believe in, which &lt;code&gt;ssh&lt;/code&gt; reaches too. One module, &lt;code&gt;guest.go&lt;/code&gt;, answers whatever devvm runs in a VM, with one set of switches whichever way devvm gets there. &lt;code&gt;limactl shell&lt;/code&gt; is also the shell devvm opens in a VM, which then ends, so a script sees it as devvm&amp;rsquo;s last call. In the shared tools&amp;rsquo; build VM, its &lt;code&gt;shell&lt;/code&gt; writes the images &lt;code&gt;build.sh&lt;/code&gt; is asked for into the build&amp;rsquo;s folder (or, on request, a symlink instead), and it keeps what a VM&amp;rsquo;s setup is sent as &lt;code&gt;$STUB_DIR/sync.tar&lt;/code&gt;. A base build&amp;rsquo;s packages go in as &lt;code&gt;$STUB_DIR/packages-in.tar&lt;/code&gt;, and what the build gives back is &lt;code&gt;$STUB_DIR/packages-out.tar&lt;/code&gt;, or no packages. In the &lt;code&gt;--from&lt;/code&gt; build VM, its &lt;code&gt;shell&lt;/code&gt; writes what &lt;code&gt;oci/build.sh&lt;/code&gt; would (or, on request, a hostile disk, command line, C library or symlink), and a call naming &lt;code&gt;$STUB_DIR/interrupt-on&lt;/code&gt;&amp;rsquo;s text interrupts devvm, as Ctrl+C would. The VM&amp;rsquo;s ssh host keys are one made-up key for each VM, unless &lt;code&gt;$STUB_DIR/hostkeys-fails&lt;/code&gt; exists.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;docker&lt;/code&gt; stands in only for what &lt;code&gt;--from&lt;/code&gt; asks of it. It has an image only when &lt;code&gt;$STUB_DIR/docker-image&lt;/code&gt; holds its ID, its &lt;code&gt;save&lt;/code&gt; writes a tarball naming that image (or &lt;code&gt;$STUB_DIR/docker-saved&lt;/code&gt;&amp;rsquo;s, a tag that moved), and it isn&amp;rsquo;t running when &lt;code&gt;$STUB_DIR/docker-down&lt;/code&gt; exists. &lt;code&gt;ssh&lt;/code&gt; answers a port forwarder&amp;rsquo;s master with &lt;code&gt;$STUB_DIR/guest-ports&lt;/code&gt;, and a link session&amp;rsquo;s master listens on its control socket. Either master outlives the process that started it, as ssh&amp;rsquo;s does, until the sandbox&amp;rsquo;s cleanup stops it or 5 minutes pass. A direct connection from a VM (the self-check&amp;rsquo;s) fails, as a confined VM&amp;rsquo;s does, unless &lt;code&gt;$STUB_DIR/net-direct&lt;/code&gt; exists. A &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s git and its seed&amp;rsquo;s scripts run on the host, with real bash, git and tar, on &lt;code&gt;$STUB_DIR/vmfs/&amp;lt;folder&amp;gt;&lt;/code&gt;, and &lt;code&gt;ssh&lt;/code&gt; fetches from there (it fails with &lt;code&gt;$STUB_DIR/ssh-fails&lt;/code&gt;). A clone&amp;rsquo;s command fails, as any shell does, when &lt;code&gt;$STUB_DIR/shell-fails-on&lt;/code&gt; holds text its arguments hold, such as &lt;code&gt;index-pack&lt;/code&gt; for the seed&amp;rsquo;s apply. &lt;code&gt;security&lt;/code&gt; stands in for the Keychain and &lt;code&gt;tmutil&lt;/code&gt; for Time Machine, both keeping their items in the state, never in the real ones. &lt;code&gt;mise&lt;/code&gt; writes &lt;code&gt;$MISE_STUB_LOCK&lt;/code&gt; as the lock (&lt;code&gt;$MISE_STUB_OLDER_LOCK&lt;/code&gt; for a list of versions), lists &lt;code&gt;$MISE_STUB_VERSIONS&lt;/code&gt;, and fails like mise offline with &lt;code&gt;MISE_STUB_FAIL&lt;/code&gt; set. With &lt;code&gt;MISE_STUB_FAIL=404&lt;/code&gt;, it fails like mise when node&amp;rsquo;s newest version, and one of the older versions a step back locks together, have no musl download yet. A lock of named tools then adds only their entries, for the platforms it names, to the lock that&amp;rsquo;s there, and a lock naming &lt;code&gt;$MISE_STUB_OFFLINE_TOOL&lt;/code&gt; fails like mise offline. &lt;code&gt;chflags&lt;/code&gt; sets no flags, so &lt;code&gt;.git&lt;/code&gt; protection leaves test folders deletable. &lt;code&gt;qemu-img&lt;/code&gt; and QEMU are there so Linux hosts pass devvm&amp;rsquo;s checks.&lt;/p&gt;
&lt;p&gt;To add a stub, write its function in &lt;code&gt;internal/stubtest/stub&lt;/code&gt;, with a comment that says what it does and lists its switches, and add it to &lt;code&gt;stubs()&lt;/code&gt; under the command&amp;rsquo;s name. It logs its call with &lt;code&gt;c.log()&lt;/code&gt; first, keeps what it must remember in the state through &lt;code&gt;c.update&lt;/code&gt;, and reads its switches with &lt;code&gt;c.on&lt;/code&gt; and &lt;code&gt;c.text&lt;/code&gt;. A new command the state needs goes in &lt;code&gt;control&lt;/code&gt;. To add a switch, read it in the stub&amp;rsquo;s function, name it for what it does as above, and add it to that function&amp;rsquo;s comment. Each stub has unit tests in &lt;code&gt;stub_test.go&lt;/code&gt;, which run it in the test&amp;rsquo;s own process. Where a stub prints what devvm parses, such as &lt;code&gt;limactl list --json&lt;/code&gt;, the &lt;a href="https://next.devvm.dev/docs/contributing/testing/#golden-fixtures"&gt;golden fixtures&lt;/a&gt; check that it prints what the real tool prints.&lt;/p&gt;
&lt;p&gt;devvm runs in &lt;code&gt;$WORK&lt;/code&gt; or a folder made in it (&lt;code&gt;mkdir&lt;/code&gt;, then &lt;code&gt;cd&lt;/code&gt;), never in &lt;code&gt;HOME&lt;/code&gt; or devvm&amp;rsquo;s own folders, which it refuses as project folders.&lt;/p&gt;
&lt;h2 data-hextra-search-id="coverage"&gt;Coverage&lt;span class="hx:absolute hx:-mt-20" id="coverage"&gt;&lt;/span&gt;
&lt;a href="#coverage" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;mise run test&lt;/code&gt; measures each package&amp;rsquo;s test coverage, then fails when a package&amp;rsquo;s coverage is more than a point below its line in the baseline, so coverage only goes up. That point of room is there because the same tests can cover a little less from one run to the next, with timing or the tools a machine has installed. A package inside it passes and keeps its line. Each system has a baseline of its own, &lt;code&gt;testdata/coverage/darwin.txt&lt;/code&gt; and &lt;code&gt;testdata/coverage/linux.txt&lt;/code&gt;, because macOS and Linux run different code and skip different tests. On a system without one, &lt;code&gt;mise run test&lt;/code&gt; says so and checks nothing. A package&amp;rsquo;s coverage counts its own Go tests and the CLI tests together. &lt;code&gt;scripts/test.sh&lt;/code&gt; sets &lt;code&gt;CLI_GOCOVERDIR&lt;/code&gt;, so &lt;code&gt;TestScript&lt;/code&gt; builds &lt;code&gt;devvm&lt;/code&gt; with &lt;code&gt;-cover&lt;/code&gt; for every package of devvm&amp;rsquo;s, and each &lt;code&gt;devvm&lt;/code&gt; a script runs writes its counters to that script&amp;rsquo;s own folder inside it. Scripts run in parallel, and &lt;code&gt;devvm&lt;/code&gt; runs that started at the same moment in one folder would race to write the same meta-data file, so one of them would print &lt;code&gt;coverage meta-data emit failed&lt;/code&gt; on stderr and fail any script that checks it. &lt;code&gt;go tool covdata&lt;/code&gt; then merges every script&amp;rsquo;s folder with the Go tests&amp;rsquo; own counters. That way &lt;code&gt;internal/cli&lt;/code&gt;, and code that only the CLI tests reach, such as a backend&amp;rsquo;s real runner, count as tested. The end-to-end tests don&amp;rsquo;t count.&lt;/p&gt;
&lt;p&gt;When a change raises a package&amp;rsquo;s coverage, raise its baseline in the same commit. Run &lt;code&gt;mise run coverage&lt;/code&gt;, which runs the tests as &lt;code&gt;mise run test&lt;/code&gt; does, then writes each package&amp;rsquo;s coverage to this system&amp;rsquo;s baseline where it went up, and commit the file. A change that raises coverage on both systems raises both baselines, so run it on a &lt;a href="https://next.devvm.dev/docs/contributing/testing/#linux-hosts"&gt;Linux host&lt;/a&gt; too. It never lowers a line: a package within a point below its baseline keeps the line it has, and when a package is more than a point below, it fails and writes nothing. A new package gets its line from &lt;code&gt;mise run coverage&lt;/code&gt; too, and a package that&amp;rsquo;s gone loses its line there, because &lt;code&gt;mise run test&lt;/code&gt; fails on both until then. &lt;code&gt;coverage.txtar&lt;/code&gt; checks &lt;code&gt;scripts/coverage.sh&lt;/code&gt;, which compares the coverage with the baseline.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s no target percentage: a package is judged by what&amp;rsquo;s untested in it, not by its number.&lt;/p&gt;
&lt;h2 data-hextra-search-id="end-to-end-tests"&gt;End-to-end tests&lt;span class="hx:absolute hx:-mt-20" id="end-to-end-tests"&gt;&lt;/span&gt;
&lt;a href="#end-to-end-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;mise run e2e&lt;/code&gt; runs devvm against real VMs, so it needs Lima and takes minutes: run it in the background. It runs &lt;code&gt;TestE2E&lt;/code&gt; in &lt;code&gt;tests/e2e&lt;/code&gt;, with the run&amp;rsquo;s flags after &lt;code&gt;--&lt;/code&gt;. First it checks that this machine has every command the chosen sections use, and it names each one that&amp;rsquo;s missing with what installs it (&lt;a href="https://next.devvm.dev/docs/contributing/testing/#whats-platform-specific"&gt;the list&lt;/a&gt;). Then it builds &lt;code&gt;devvm&lt;/code&gt; from the checkout into its sandbox, its files embedded, and runs every check through that binary:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lima home&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.lt-e2e-go&lt;/code&gt; (or &lt;code&gt;$DEVVM_E2E_LIMA_HOME&lt;/code&gt;); it refuses &lt;code&gt;~/.lima&lt;/code&gt; and devvm&amp;rsquo;s own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/tmp/devvm-go-e2e&lt;/code&gt; (&lt;code&gt;XDG_DATA_HOME&lt;/code&gt;, &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keychain&lt;/td&gt;
&lt;td&gt;service &lt;code&gt;devvm-go-e2e&lt;/code&gt; (&lt;code&gt;DEVVM_SECRET_SERVICE&lt;/code&gt;), fake tokens only, deleted at the end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lock&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/tmp/devvm-go-e2e.lock&lt;/code&gt;, a symlink to the pid of the run that holds it, so only one run uses the sandbox at a time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git identity&lt;/td&gt;
&lt;td&gt;&lt;code&gt;GIT_AUTHOR_*&lt;/code&gt; and &lt;code&gt;GIT_COMMITTER_*&lt;/code&gt; of its own, so the harness&amp;rsquo;s commits and tags work on a machine with no git config, and yours never goes into them; devvm&amp;rsquo;s own git ignores them&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e &lt;span class="c1"&gt;# every section but desktop and from&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --from &lt;span class="c1"&gt;# every section, from too, and base with every feature: the longest&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --only images,gc &lt;span class="c1"&gt;# just these sections&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --clean &lt;span class="c1"&gt;# delete the sandbox&amp;#39;s cached images and tool images first&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --every-feature &lt;span class="c1"&gt;# base with every feature, as a run with from builds it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --slots &lt;span class="m"&gt;3&lt;/span&gt; &lt;span class="c1"&gt;# the sections spread over 3 sandboxes that run at once&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --slot &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="c1"&gt;# run in slot 1&amp;#39;s sandbox, its images as it has them&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --newest-base &lt;span class="c1"&gt;# base from Ubuntu&amp;#39;s newest image and packages, in a sandbox of its own&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run e2e -- --golden &lt;span class="c1"&gt;# also capture the stubs&amp;#39; golden fixtures from the real tools&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/contributing/testing/#end-to-end-tests-in-go"&gt;End-to-end tests in Go&lt;/a&gt; says how to run &lt;code&gt;go test&lt;/code&gt; yourself, write a check and add a section.&lt;/p&gt;
&lt;p&gt;A change that touches VMs passes the sections for what it changed, with &lt;code&gt;--only&lt;/code&gt;, and a run with &lt;code&gt;--only&lt;/code&gt; that names &lt;code&gt;from&lt;/code&gt; builds base with every feature, as &lt;code&gt;--from&lt;/code&gt; does. Before you merge a change to &lt;code&gt;assets/&lt;/code&gt; or to &lt;code&gt;--from&lt;/code&gt;, run &lt;code&gt;--from&lt;/code&gt;, because only it runs every section on base with every feature. GitHub&amp;rsquo;s hosted runners can&amp;rsquo;t run the end-to-end tests on macOS, so a Mac of your own runs them there.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--newest-base&lt;/code&gt; builds base as a user&amp;rsquo;s first build does, in place of the pinned release that the other runs use, and &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#checking-base-against-ubuntus-newest"&gt;Maintaining&lt;/a&gt; says when to run it and what to do when it fails. &lt;code&gt;--golden&lt;/code&gt; writes the &lt;a href="https://next.devvm.dev/docs/contributing/testing/#golden-fixtures"&gt;golden fixtures&lt;/a&gt; of this system into the checkout, for you to commit.&lt;/p&gt;
&lt;p&gt;The sections so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;images&lt;/code&gt;: building base and fixture layers, rebuilds, a failed script and Ctrl+C during a build, then base&amp;rsquo;s recorded packages, each in the cache under its SHA-256, and base built again under the same key with &lt;code&gt;ubuntu-mirror&lt;/code&gt; set to an address nothing answers on, whose apt reads only the build&amp;rsquo;s own folder of packages.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;project&lt;/code&gt;: devvm in a new project folder (under &lt;code&gt;/tmp/devvm-go-e2e/p&lt;/code&gt;) makes a VM from base and opens a shell there, which reads its commands from devvm&amp;rsquo;s input. The folder and the shared tools are mounted and nothing else is, there&amp;rsquo;s no SSH agent, no Docker (no docker layer) and the hostname is the folder&amp;rsquo;s. The ssh config lists it as &lt;code&gt;devvm-web&lt;/code&gt; with its host keys pinned; through an &lt;code&gt;~/.ssh/config&lt;/code&gt; of the run&amp;rsquo;s own that includes it under a &lt;code&gt;Host *&lt;/code&gt; forwarding the agent, &lt;code&gt;ssh devvm-web&lt;/code&gt; works, forwards no agent (a throwaway one), and refuses a changed host key. &lt;code&gt;.git&lt;/code&gt; is locked (macOS) and git in the VM can still commit. &lt;code&gt;devvm stop&lt;/code&gt; stops it and drops its entry, and on macOS reports and locks a submodule git folder the VM added. With stand-in clipboard tools in &lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;, &lt;code&gt;devvm paste --json&lt;/code&gt; puts the copied image into the running VM&amp;rsquo;s paste folder, where its SHA-256 matches, mode 600 in a folder of mode 700, and the stand-in copier got the path; &lt;code&gt;devvm paste rm --force&lt;/code&gt; deletes it and leaves a file of the user&amp;rsquo;s; and a stopped VM is refused before the clipboard is read. &lt;code&gt;TestE2EExecQuoting&lt;/code&gt; in &lt;code&gt;internal/backend/registry&lt;/code&gt;, which runs only there (&lt;code&gt;DEVVM_E2E_VM&lt;/code&gt; names the VM), checks that arguments with spaces, quotes, &lt;code&gt;$&lt;/code&gt;, newlines and globs, a folder and input reach the guest as given, through the &lt;code&gt;Exec&lt;/code&gt; of the backend the VM&amp;rsquo;s state records, so one test covers every backend. Then a VM from a &lt;code&gt;devcontainer.json&lt;/code&gt;, with no ports by default: its &lt;code&gt;forwardPorts&lt;/code&gt; said and not forwarded, none reaching this machine, its &lt;code&gt;containerEnv&lt;/code&gt; in the shell and its commands, its &lt;code&gt;postCreateCommand&lt;/code&gt; run once in the folder, its &lt;code&gt;postStartCommand&lt;/code&gt; at each start (again after &lt;code&gt;devvm restart&lt;/code&gt;), nothing written to the folder, and a changed file warned about without changing the VM. Then a claude VM with a fake agent config, history, git identity and token in a home of its own: &lt;code&gt;devvm agent import&lt;/code&gt; copies the agent&amp;rsquo;s settings into the sandbox&amp;rsquo;s agent store without the history or the links out of its folder, naming each link it leaves out, and with &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;follow-links&lt;/code&gt; naming a dotfiles folder, it copies the skill folder a link leads to there as a folder, never a link, and still none of the links to a file outside it. The store&amp;rsquo;s folder is mounted read-only and linked into the VM&amp;rsquo;s home, the linked skill&amp;rsquo;s copy with it, which root can&amp;rsquo;t write either, and the home folder&amp;rsquo;s isn&amp;rsquo;t mounted, its settings are copied and its history isn&amp;rsquo;t, the VM gets the git identity, the timezone and its hostname, and, open as it is, the token&amp;rsquo;s placeholder and never the token. &lt;code&gt;devvm agent save&lt;/code&gt; without a terminal shows the VM&amp;rsquo;s changed &lt;code&gt;settings.json&lt;/code&gt; as a diff and its new &lt;code&gt;commands&lt;/code&gt; folder&amp;rsquo;s file, then refuses and saves nothing, and after a yes it saves both into the store, but neither the VM&amp;rsquo;s fake login beside them nor the folder&amp;rsquo;s link out of it. Then SSH agents, with a home of their own and throwaway keys: a &lt;code&gt;--ssh-agent&lt;/code&gt; VM uses a throwaway agent standing for yours; after &lt;code&gt;devvm ssh-agent add&lt;/code&gt; and &lt;code&gt;devvm ssh-agent devvm&lt;/code&gt; it keeps yours, in its shell and by name, until a restart, then uses only devvm&amp;rsquo;s own agent&amp;rsquo;s key, in its shells and by name; after &lt;code&gt;devvm ssh-agent off&lt;/code&gt;, none.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;clone&lt;/code&gt;: &lt;code&gt;--clone&lt;/code&gt; with a throwaway repo, and host git and devvm run with a home of the section&amp;rsquo;s own, so neither reads your &lt;code&gt;~/.ssh/config&lt;/code&gt; or your git settings, and the Include line isn&amp;rsquo;t offered. The VM has its own clone with every branch, even though the repo&amp;rsquo;s &lt;code&gt;url.*.insteadOf&lt;/code&gt; sends its URL elsewhere, only the shared tools are mounted, and its shell opens in the clone. The repo gets a &lt;code&gt;devvm&lt;/code&gt; remote named after the VM, and nothing of &lt;code&gt;.git&lt;/code&gt; is locked or watched. Without a terminal, &lt;code&gt;devvm rm --force&lt;/code&gt; refuses while the clone has commits that weren&amp;rsquo;t fetched and keeps the VM. Once &lt;code&gt;git fetch devvm&lt;/code&gt; through devvm&amp;rsquo;s ssh config has brought the VM&amp;rsquo;s commit, &lt;code&gt;devvm rm&lt;/code&gt; refuses for uncommitted changes in the clone, and then for those in a worktree in the clone, shown under its path, and &lt;code&gt;devvm rm --no-clone-check&lt;/code&gt; deletes the VM after a warning, the worktree&amp;rsquo;s change with it, and removes the remote, while the fetched work stays as a local branch. A git worktree&amp;rsquo;s VM gets a clone of only its branch and that branch&amp;rsquo;s upstream. On a VM that mounts its folder, &lt;code&gt;devvm clone on&lt;/code&gt; without a terminal is refused, and &lt;code&gt;devvm clone&lt;/code&gt; shows off. &lt;code&gt;devvm clone on --force&lt;/code&gt; then makes it again with its own clone of every branch, only the shared tools mounted and &lt;code&gt;.git&lt;/code&gt; unlocked, and it keeps its home and its ID. &lt;code&gt;devvm clone off --force&lt;/code&gt; without a terminal refuses while the clone has commits that weren&amp;rsquo;t fetched and keeps the clone, and once they&amp;rsquo;re fetched, it mounts the folder again with &lt;code&gt;.git&lt;/code&gt; protected, keeps the VM&amp;rsquo;s home and ID, removes the remote and leaves the work as a local branch. Last, &lt;code&gt;devvm --clone --repos all&lt;/code&gt; in a folder of repos gives one VM a clone of each repo at its path, with every branch, the folder&amp;rsquo;s own file, and nothing mounted but the shared tools. &lt;code&gt;devvm clone fetch&lt;/code&gt; brings both repos&amp;rsquo; work back and lists the branch with both repos, &lt;code&gt;devvm clone add&lt;/code&gt; copies a third repo into the VM at its path, with a remote, &lt;code&gt;devvm rm&lt;/code&gt; without a terminal refuses for the work in one repo that wasn&amp;rsquo;t fetched, naming that repo, and &lt;code&gt;devvm rm --no-clone-check&lt;/code&gt; deletes the VM and removes each repo&amp;rsquo;s remote. A repo with a detached &lt;code&gt;HEAD&lt;/code&gt;, an annotated tag, origin&amp;rsquo;s branches and an older VM&amp;rsquo;s remote gets a clone detached at the same commit, with the tag still annotated and origin&amp;rsquo;s branches, and none of the VM remote&amp;rsquo;s. The same repo&amp;rsquo;s staged, unstaged and intent-to-add changes and a tracked file turned into a folder give the same &lt;code&gt;git status&lt;/code&gt; in the VM, which has neither the untracked &lt;code&gt;.env&lt;/code&gt; nor the folder, and devvm names the folder. Its clone has origin&amp;rsquo;s URL, another remote&amp;rsquo;s https URL without the user and token it has here, a branch as far ahead of its upstream as here, and the repo&amp;rsquo;s &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt;, which a commit there takes with no identity given, none of its credential settings, and its pre-commit hook, which runs there. &lt;code&gt;devvm clone fetch&lt;/code&gt; brings back a commit only the VM&amp;rsquo;s detached &lt;code&gt;HEAD&lt;/code&gt; has, as &lt;code&gt;saved/devvm/HEAD&lt;/code&gt;, and &lt;code&gt;devvm rm&lt;/code&gt; names another, but not the uncommitted changes copied in, which the VM left as they came. A repo whose rebase, started with &lt;code&gt;--autostash&lt;/code&gt;, stopped on a conflict, after a reset, with a stash of a plain entry and a &lt;code&gt;--all&lt;/code&gt; one, gets a clone in the same rebase, which &lt;code&gt;git rebase --continue&lt;/code&gt; finishes there, bringing the autostash back; its stash is the repo&amp;rsquo;s but for the &lt;code&gt;--all&lt;/code&gt; entry, which devvm names, the commit only the reset&amp;rsquo;s &lt;code&gt;ORIG_HEAD&lt;/code&gt; reached isn&amp;rsquo;t there, and &lt;code&gt;devvm rm&lt;/code&gt; names a stash entry the VM made, not the one copied in. A &lt;code&gt;blob:none&lt;/code&gt; clone of a small public repo, on the internet tier, gets a promisor clone whose git fetches a blob it lacks from the repo&amp;rsquo;s origin. Work in the VM that names another blob neither side has doesn&amp;rsquo;t come back, and &lt;code&gt;devvm clone fetch&lt;/code&gt; says so with &lt;code&gt;clone_fetch_partial&lt;/code&gt;, then brings it back once git in the VM has read the blob. Both checks are skipped when github.com can&amp;rsquo;t be reached. A repo with a submodule that has one of its own, both initialised, gets clones of them in the VM, where &lt;code&gt;git submodule status --recursive&lt;/code&gt; is as here; a VM commit in the submodule comes back into its repo here with &lt;code&gt;devvm clone fetch&lt;/code&gt;, and &lt;code&gt;devvm rm&lt;/code&gt; without a terminal names a commit in the nested one that wasn&amp;rsquo;t fetched, and keeps the VM. A repo that uses Git LFS, made without &lt;code&gt;git-lfs&lt;/code&gt; on this machine, has its LFS file&amp;rsquo;s content in the VM, whose &lt;code&gt;git status&lt;/code&gt; is clean, with git-lfs&amp;rsquo;s filter in the clone&amp;rsquo;s own config and not in the VM&amp;rsquo;s system or global config; a file the VM&amp;rsquo;s &lt;code&gt;git-lfs&lt;/code&gt; adds comes back with &lt;code&gt;devvm clone fetch&lt;/code&gt;, its object in the repo here, and an object in the VM that isn&amp;rsquo;t what its pointer names stays out, named with &lt;code&gt;clone_lfs_kept&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gc&lt;/code&gt;: a VM from a folder named &lt;code&gt;img-keep&lt;/code&gt;, which is named like an image, and a fixture layer edited after its build: &lt;code&gt;devvm gc&lt;/code&gt; deletes the stale image and its record and an old tool image no VM lists (once there&amp;rsquo;s a tools lock), and keeps base and the VM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tools&lt;/code&gt;: first, the shared tools resolve to upstream&amp;rsquo;s newest versions, with devvm&amp;rsquo;s pinned mise (downloaded once), each download with its checksum. This section is the only one that uses the newest versions, and no other step checks for them (&lt;code&gt;DEVVM_NO_TOOL_CHECK&lt;/code&gt;). At the section&amp;rsquo;s end, e2e puts the pinned lock back. Then a node project&amp;rsquo;s VM: node, npm, pnpm, bun and yarn at the locked versions, each a read-only EROFS image, the share read-only even for root, &lt;code&gt;npm i -g&lt;/code&gt; into the VM&amp;rsquo;s home, a non-login shell over SSH, an &lt;code&gt;.nvmrc&lt;/code&gt;&amp;rsquo;s own version, the tools mounted at boot without devvm, and a second node VM that builds nothing. Last, a .NET project&amp;rsquo;s VM on the allowlist tier, chosen by its solution file: the shared SDK at the locked version from the share, a console project that restores a package from NuGet, builds and runs, &lt;code&gt;dotnet tool install -g&lt;/code&gt; into &lt;code&gt;~/.dotnet/tools&lt;/code&gt; with the tool run from a non-login shell, every toolchain&amp;rsquo;s environment and &lt;code&gt;PATH&lt;/code&gt; folders in a login shell and a non-login one, a workload installed into &lt;code&gt;~/.dotnet&lt;/code&gt;, nothing of it blocked, and a &lt;code&gt;global.json&lt;/code&gt;&amp;rsquo;s own SDK installed into the VM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;network&lt;/code&gt;: a VM with Claude Code, Codex, opencode and pi and &lt;code&gt;--network allowlist&lt;/code&gt;, a fake token in devvm&amp;rsquo;s environment and a fake &lt;code&gt;~/.claude.json&lt;/code&gt; and Codex login in a home of its own, which &lt;code&gt;devvm agent import&lt;/code&gt; copies into the sandbox&amp;rsquo;s agent store, only yours to read. Its proxy runs and the self-check passed; its password was in no host process&amp;rsquo;s arguments while devvm launched it (&lt;code&gt;ps&lt;/code&gt;, sampled), and the guest has it; &lt;code&gt;ssh devvm-net&lt;/code&gt; reaches it; with transparent mode stopped, direct connections fail, even as root, to an address and to other ports, TCP to a public server&amp;rsquo;s port 53 included, and with it running a public DNS server and Lima&amp;rsquo;s DNS addresses answer only with the stand-in address, TTL 0, or nothing; an allowed host works and others, or other ports, are blocked; a line in the VM&amp;rsquo;s policy file that reads as a deny but isn&amp;rsquo;t a rule makes the running proxy refuse an allowed host, with no allow command in &lt;code&gt;devvm network log --blocked&lt;/code&gt;, &lt;code&gt;devvm network rm&lt;/code&gt; warns of it, and the host works again once it&amp;rsquo;s gone; with transparent mode stopped, DNS fails at once, &lt;code&gt;/etc/resolv.conf&lt;/code&gt; names &lt;code&gt;127.0.0.1&lt;/code&gt; alone, and Lima&amp;rsquo;s DNS addresses answer nothing. Transparent mode runs: its service, the stand-in address on &lt;code&gt;lo&lt;/code&gt; and dnsmasq and socat on that address alone; names with a dot resolve to it, a name without a dot to nothing, IPv6 has none at once, and &lt;code&gt;/etc/hosts&lt;/code&gt;&amp;rsquo; names keep theirs; curl without proxy settings and a static Go client with its own resolver reach github.com with its own certificate, logged &lt;code&gt;without proxy settings&lt;/code&gt;; a blocked host gets the &lt;code&gt;403&lt;/code&gt; over the VM&amp;rsquo;s CA; port 5432 of a name is refused at once and &lt;code&gt;devvm-why&lt;/code&gt; names it, while an IPv6 connection on loopback that works isn&amp;rsquo;t listed as refused; a port a rule names, on a TLS server on this machine, is redirected while the rule is there and refused at once after &lt;code&gt;devvm network rm&lt;/code&gt;; servers of the VM&amp;rsquo;s own bind &lt;code&gt;0.0.0.0:443&lt;/code&gt; and &lt;code&gt;:80&lt;/code&gt;; the service comes back when it&amp;rsquo;s killed or its table flushed; &lt;code&gt;devvm network transparent off&lt;/code&gt; takes it out at the next launch and &lt;code&gt;on&lt;/code&gt; puts it back. In a VM of the docker layer, containers without proxy settings reach github.com on the default bridge and on a network of their own, a blocked host is logged, no other port of the stand-in address answers them, a container&amp;rsquo;s published 5432 isn&amp;rsquo;t reached through the stand-in address from the VM or another container while its published 443 keeps the VM&amp;rsquo;s connections off it, and an &lt;code&gt;--internal&lt;/code&gt; network reaches nothing. The host&amp;rsquo;s loopback services are out of reach, directly or through the proxy. Behind the run&amp;rsquo;s company proxy on this machine&amp;rsquo;s loopback, named in the shell&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, the VM&amp;rsquo;s proxy sends an allowed host there by name and refuses a blocked one before it gets there. Then &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; names the same company proxy with its user alone, and the shell sets no proxy: the launch is refused until &lt;code&gt;devvm secret set proxy --stdin&lt;/code&gt; saves the password, and once it&amp;rsquo;s saved, the VM&amp;rsquo;s proxy config names the secret and holds no password, and the company proxy, which refuses any request without that password, carries GitHub. After each launch, the password is in no process&amp;rsquo;s arguments, in no log and nowhere in the guest, and after the &lt;code&gt;config.toml&lt;/code&gt; launch it isn&amp;rsquo;t in the VM&amp;rsquo;s proxy config either. The launch after that, with neither setting, goes directly. The section&amp;rsquo;s leak scan, run once its secrets are used and again at its end, looks for each company proxy&amp;rsquo;s password as it is, as a URL&amp;rsquo;s &lt;code&gt;user:password&lt;/code&gt;, as Basic&amp;rsquo;s base64 and as the whole &lt;code&gt;Proxy-Authorization&lt;/code&gt; value, in devvm&amp;rsquo;s logs, the VMs&amp;rsquo; proxies&amp;rsquo; logs and Lima&amp;rsquo;s. Before the section starts, it deletes any of its secrets that a killed run left behind. The proxy refuses requests without the VM&amp;rsquo;s password; the token is nowhere in the VM, which has its own CA and the next one, its own placeholder and logins&amp;rsquo; copies with placeholders only; the proxy puts the token in for its host (for the VM&amp;rsquo;s own placeholder only), an MCP server&amp;rsquo;s header and Codex&amp;rsquo;s key for theirs, over TLS the VM verifies; a second allowlist VM has CAs of its own, each VM trusts only its own and has no key, each proxy serves and presents only its own VM&amp;rsquo;s CAs, and &lt;code&gt;devvm rm&lt;/code&gt; deletes one VM&amp;rsquo;s CAs and leaves the other&amp;rsquo;s; the home folder&amp;rsquo;s and the store&amp;rsquo;s login files are unchanged. &lt;code&gt;devvm agent save&lt;/code&gt; saves the VM&amp;rsquo;s changed &lt;code&gt;~/.claude.json&lt;/code&gt; with the store&amp;rsquo;s MCP header in place of its placeholder, and once the VM changes that server&amp;rsquo;s URL it leaves the file out, so the store keeps the server as it was. &lt;code&gt;devvm secret set github --stdin&lt;/code&gt; saves a fake token (in the Keychain on macOS, under the run&amp;rsquo;s service, found through a link to &lt;code&gt;~/Library/Keychains&lt;/code&gt; in the VM&amp;rsquo;s home), read from a file so it&amp;rsquo;s in no process&amp;rsquo;s arguments, and &lt;code&gt;devvm secret&lt;/code&gt; lists it saved, while asking &lt;code&gt;devvm secret&lt;/code&gt; for a &lt;code&gt;get&lt;/code&gt; subcommand is refused without printing it; &lt;code&gt;secret use github&lt;/code&gt; binds it to the running proxy at once, and on the next launch the VM has its own placeholder in &lt;code&gt;GH_TOKEN&lt;/code&gt;, never the token, which the proxy puts in for &lt;code&gt;api.github.com&lt;/code&gt;; &lt;code&gt;secret unuse&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; take the binding and the token away. &lt;code&gt;TestE2ESelfCheck&lt;/code&gt; in &lt;code&gt;internal/netpolicy&lt;/code&gt; runs the self-check on the VM: it passes, then, once the VM is started outside devvm, it fails and stops the VM. &lt;code&gt;devvm stop&lt;/code&gt; stops the VM and its proxy at once. &lt;code&gt;devvm network open&lt;/code&gt; makes its next start direct, its proxy set in the guest and answering, and the open VM holds no real secret either: the token is nowhere in it, its environment and Codex&amp;rsquo;s login hold only its placeholders, its proxy puts the token in over TLS the VM verifies with its own CA, and a request that goes around the proxy carries only the placeholder and gets a 401 from the token&amp;rsquo;s host. Then &lt;code&gt;devvm network internet&lt;/code&gt; and &lt;code&gt;devvm network none&lt;/code&gt; change its tier at once, the VM running on. Restarted behind the run&amp;rsquo;s company proxy on this machine&amp;rsquo;s loopback, named in the shell&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt; with a fake password that the check reads from a file, the guest has the proxy and reaches GitHub through it, while devvm&amp;rsquo;s run logs hold the password only as &lt;code&gt;&amp;lt;password&amp;gt;&lt;/code&gt; and Lima&amp;rsquo;s &lt;code&gt;ha.stderr.log&lt;/code&gt; only as stars. &lt;code&gt;devvm network allowlist&lt;/code&gt; while it runs open shows it &lt;code&gt;unenforced&lt;/code&gt; until &lt;code&gt;devvm restart&lt;/code&gt; starts it confined; &lt;code&gt;devvm network open&lt;/code&gt; while it runs confined keeps it on its proxy until it next starts. Behind a company proxy of the run&amp;rsquo;s own that fakes OpenAI&amp;rsquo;s token endpoint with a certificate from the run&amp;rsquo;s CA, a login made in the VM is captured: the store gets the fake tokens and API key, and the VM gets placeholders. Then &lt;code&gt;devvm agent login codex&lt;/code&gt; runs the real Codex&amp;rsquo;s login in the VM, curl on this machine opens its callback with the state Codex&amp;rsquo;s address names, through the forward of &lt;code&gt;localhost:1455&lt;/code&gt;, devvm names the account the store saved, the VM&amp;rsquo;s Codex holds only placeholders, and the forward is gone once the login ends, and gone too after an interrupted login. &lt;code&gt;devvm agent login opencode --device-code&lt;/code&gt; runs the real opencode 2&amp;rsquo;s Codex device code login in the VM, which the fake endpoint answers too, devvm says the store saved the login, and &lt;code&gt;opencode auth export&lt;/code&gt; in the VM shows only placeholders. A second VM with opencode has &lt;code&gt;OPENCODE_DISABLE_AUTOUPDATE=1&lt;/code&gt; in its login shell, makes its database and imports a credential of its own, then &lt;code&gt;devvm agent login opencode --api-key --provider openrouter --stdin&lt;/code&gt; saves a fake key from the first VM, and at the second VM&amp;rsquo;s next launch its opencode has devvm&amp;rsquo;s entry with the key&amp;rsquo;s placeholder, never the key, beside its own credential, and once its database is deleted and made again, the next launch gives it the key&amp;rsquo;s placeholder again. With a local server&amp;rsquo;s fake key and a Copilot Enterprise login added to the store&amp;rsquo;s opencode login, its next launch warns that both are withheld, and neither the VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; nor its opencode holds the key or the tokens. Once &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[pass-keys]&lt;/code&gt; lists both providers under &lt;code&gt;opencode&lt;/code&gt;, the launch notes the key as passed, the VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt; and its opencode&amp;rsquo;s database have it, and the login&amp;rsquo;s tokens still stay out. pi runs in the network VM with &lt;code&gt;PI_SKIP_VERSION_CHECK=1&lt;/code&gt; and &lt;code&gt;PI_TELEMETRY=0&lt;/code&gt;, in a login shell and in a non-login &lt;code&gt;bash -c&lt;/code&gt; alike, and an install it can&amp;rsquo;t write to, and its policy reaches its catalog at &lt;code&gt;pi.dev&lt;/code&gt;. Its terminal UI, started in a terminal of &lt;code&gt;script&lt;/code&gt;&amp;rsquo;s, finds base&amp;rsquo;s &lt;code&gt;fdfind&lt;/code&gt; and &lt;code&gt;rg&lt;/code&gt; and downloads nothing into &lt;code&gt;~/.pi/agent/bin&lt;/code&gt;, while with a &lt;code&gt;PATH&lt;/code&gt; that has no &lt;code&gt;fdfind&lt;/code&gt; the same start downloads &lt;code&gt;fd&lt;/code&gt;, which shows the start reached that check. The same company proxy fakes Claude&amp;rsquo;s token endpoint and Anthropic&amp;rsquo;s API, which logs the token each request brings, or the &lt;code&gt;x-api-key&lt;/code&gt;: &lt;code&gt;devvm agent login pi --api-key --provider anthropic --stdin&lt;/code&gt; saves a fake key, the VM&amp;rsquo;s pi holds only its placeholder, and pi&amp;rsquo;s own request reaches the API with the key the proxy put in, which no log holds. The same company proxy fakes Groq&amp;rsquo;s API too, and &lt;code&gt;devvm agent login pi --api-key --provider groq --stdin&lt;/code&gt; saves a fake Groq key, the VM&amp;rsquo;s pi holds only its placeholder, and pi&amp;rsquo;s own request reaches Groq&amp;rsquo;s API with the key in its &lt;code&gt;Authorization&lt;/code&gt;, which no log holds. It fakes OpenAI&amp;rsquo;s API as well, and after &lt;code&gt;devvm agent login pi --api-key --provider openai --stdin&lt;/code&gt; saves a fake OpenAI key, the VM&amp;rsquo;s pi holds only its placeholder, which starts with &lt;code&gt;sk-&lt;/code&gt;, and pi&amp;rsquo;s own request reaches OpenAI&amp;rsquo;s API as an API key&amp;rsquo;s, asking for &lt;code&gt;max_output_tokens&lt;/code&gt;, with the key in its &lt;code&gt;Authorization&lt;/code&gt;, which no log holds. The same company proxy fakes Gemini&amp;rsquo;s API, and after &lt;code&gt;devvm agent login pi --api-key --provider google --stdin&lt;/code&gt; saves a fake Gemini key, the VM&amp;rsquo;s pi holds only its placeholder, and pi&amp;rsquo;s own request reaches Gemini&amp;rsquo;s API with the key in its &lt;code&gt;x-goog-api-key&lt;/code&gt; and no key in its URL, which no log holds. Then &lt;code&gt;devvm agent login opencode --api-key --provider groq --stdin&lt;/code&gt; saves a fake Groq key for opencode, the VM&amp;rsquo;s opencode holds only its placeholder, and the request that &lt;code&gt;opencode run&lt;/code&gt; makes reaches Groq&amp;rsquo;s API with the key in its &lt;code&gt;Authorization&lt;/code&gt;, which no log holds. Then &lt;code&gt;claude setup-token&lt;/code&gt;&amp;rsquo;s request, as curl, makes the fake token the &lt;code&gt;claude&lt;/code&gt; secret and gives the VM its placeholder, and the API gets the token for it, while the claude.ai connectors&amp;rsquo; host, &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt;, gets only the placeholder. The OAuth login&amp;rsquo;s placeholder also gets the token at the API, and the connectors&amp;rsquo; host gets only that placeholder too. &lt;code&gt;devvm agent login claude --setup-token&lt;/code&gt;, run in a terminal of its own (&lt;code&gt;script&lt;/code&gt; on macOS, Python&amp;rsquo;s &lt;code&gt;pty&lt;/code&gt; on Linux), shows Claude Code&amp;rsquo;s address there, and the check stops it before any login. Then &lt;code&gt;devvm agent login claude&lt;/code&gt; runs the real Claude Code&amp;rsquo;s &lt;code&gt;claude auth login&lt;/code&gt; in the VM, its code pasted on devvm&amp;rsquo;s input with the state its address names, the store keeps the fake login and the &lt;code&gt;claude&lt;/code&gt; secret is gone, the VM&amp;rsquo;s &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; holds only placeholders and its environment no token, and once the store&amp;rsquo;s access token is due, the VM&amp;rsquo;s next request makes the host refresh it at Claude&amp;rsquo;s endpoint through the company proxy. The refresh trusts the VM&amp;rsquo;s proxy&amp;rsquo;s CAs, the run&amp;rsquo;s among them, so it succeeds. The store keeps the refreshed login, the VM&amp;rsquo;s requests to the API and to &lt;code&gt;mcp-proxy.anthropic.com&lt;/code&gt; go on with the refreshed access token, and no log holds a value. &lt;code&gt;TestClaudeOAuthGet&lt;/code&gt; checks the refresh too. Last, a VM made with &lt;code&gt;--network learn&lt;/code&gt; runs on the internet tier, shown as &lt;code&gt;internet (learning)&lt;/code&gt;, and reaches example.com and example.org; &lt;code&gt;devvm network lock --json&lt;/code&gt; lists both, each with its port, and its next launch counts what it learned; &lt;code&gt;devvm network lock --all&lt;/code&gt; adds exactly the hosts it learned to its own rules and gives it the allowlist tier at once, the VM running on, so example.com still works on 443, while its port 80 and example.net get a &lt;code&gt;403&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;desktop&lt;/code&gt;: a VM of base has none of the desktop&amp;rsquo;s programs, and devvm desktop refuses it, naming the layer. &lt;code&gt;--layers desktop&lt;/code&gt; makes a VM of the desktop image, and devvm desktop serves its desktop on this machine&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; alone, keeping its port and its password from one run to the next. A viewer with a wrong password is refused, and one with the password gets the VM&amp;rsquo;s desktop. The VM&amp;rsquo;s server listens on its user&amp;rsquo;s own socket and on no TCP port, with the clipboard off, and the password is in no file of the VM&amp;rsquo;s, in no run log and in no host process&amp;rsquo;s arguments while devvm desktop starts. With network policy, the VM still reaches only its proxy and not the desktop&amp;rsquo;s port on this machine, the desktop&amp;rsquo;s browsers use the VM&amp;rsquo;s local proxy without a password, a blocked host still gets a &lt;code&gt;403&lt;/code&gt;, and the local proxy isn&amp;rsquo;t forwarded to this machine. When root in the VM runs a server of its own without a password, a viewer with a wrong password is still refused and one with the password gets in, and the refused viewer never reaches the VM, nor does the viewer&amp;rsquo;s clipboard, only its key event. Ctrl+C ends devvm desktop and closes its port, and &lt;code&gt;devvm desktop --clipboard&lt;/code&gt; starts the server again on the same port with the clipboard on, which a viewer with the password gets.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nix&lt;/code&gt;: the nix layer. A copy of &lt;code&gt;assets/layers/nix.sh&lt;/code&gt; as a layer of the run&amp;rsquo;s own, built behind a company proxy of the run&amp;rsquo;s own, reaches Nix&amp;rsquo;s releases through it and leaves no proxy settings for &lt;code&gt;nix-daemon&lt;/code&gt; (and not the company proxy&amp;rsquo;s password) anywhere on its image&amp;rsquo;s disk. Then a folder with &lt;code&gt;package.json&lt;/code&gt;, &lt;code&gt;flake.nix&lt;/code&gt; and &lt;code&gt;.envrc&lt;/code&gt; gets a VM with node on the nix layer (&lt;code&gt;--layers nix&lt;/code&gt;) on the allowlist tier: Nix and direnv at their pins, a store that&amp;rsquo;s root&amp;rsquo;s, &lt;code&gt;sandbox&lt;/code&gt; on with no fallback, &lt;code&gt;trusted-users&lt;/code&gt; root alone and an untrusted user&amp;rsquo;s &lt;code&gt;--option substituters&lt;/code&gt; ignored, &lt;code&gt;nix-daemon&lt;/code&gt; with the VM&amp;rsquo;s own proxy in devvm&amp;rsquo;s drop-in alone, &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; from Nix&amp;rsquo;s cache, a build in Nix&amp;rsquo;s sandbox, &lt;code&gt;sudo nix&lt;/code&gt; and &lt;code&gt;nix&lt;/code&gt; over ssh, the flake&amp;rsquo;s dev shell (nixpkgs at a pinned revision) loaded by direnv in an interactive shell, its &lt;code&gt;node&lt;/code&gt; ahead of the shared node prompt after prompt and gone outside the folder, nix-direnv&amp;rsquo;s cache in the VM&amp;rsquo;s home with no &lt;code&gt;.direnv&lt;/code&gt; in the folder, a fixed-output download from a host that isn&amp;rsquo;t allowed refused with &lt;code&gt;403&lt;/code&gt; and named by &lt;code&gt;devvm-why&lt;/code&gt;, and after &lt;code&gt;devvm network open&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt;, no drop-in and no proxy for the daemon.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from&lt;/code&gt;: run with a &lt;code&gt;docker&lt;/code&gt; that isn&amp;rsquo;t running, so nothing comes from Docker. Its container images go by their pinned digests, as &lt;code&gt;node:24@sha256:…&lt;/code&gt;, so devvm looks them up nowhere, except the company proxy&amp;rsquo;s &lt;code&gt;alpine:3.21&lt;/code&gt;, which keeps its tag so that devvm&amp;rsquo;s registry lookup is checked too. A VM from &lt;code&gt;node:24&lt;/code&gt; with node, python and Claude Code on the docker and nix layers (Debian 12, in a home of its own) boots, with its base keyed by the pinned digest, its node, python and claude at the locked versions, GNU &lt;code&gt;tar&lt;/code&gt; as its commands find it, its tool images built in a clone of devvm&amp;rsquo;s own Ubuntu base when the run builds them, the docker layer&amp;rsquo;s Docker from Docker&amp;rsquo;s Debian repository, and the nix layer&amp;rsquo;s Nix under systemd running &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; and a build in Nix&amp;rsquo;s sandbox, then, after &lt;code&gt;devvm network allowlist&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt;, transparent mode&amp;rsquo;s checks as the network section has them, and with its service stopped, Lima&amp;rsquo;s DNS and a public server answering nothing; a VM from &lt;code&gt;alpine:3&lt;/code&gt; with node and dotnet, which its &lt;code&gt;package.json&lt;/code&gt; and &lt;code&gt;global.json&lt;/code&gt; call for, on the docker, nix and desktop layers runs node and pnpm from musl tool images, and dotnet&amp;rsquo;s musl SDK with ICU, which makes and runs a console project, built in its own base and keyed and recorded by its digest, the docker layer&amp;rsquo;s Docker on OpenRC, the desktop layer&amp;rsquo;s programs from Alpine&amp;rsquo;s packages, with no crashed services, and the nix layer&amp;rsquo;s Nix as an OpenRC service, with &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; and a sandboxed build, then after &lt;code&gt;devvm network allowlist&lt;/code&gt; and &lt;code&gt;devvm restart&lt;/code&gt; transparent mode&amp;rsquo;s checks on OpenRC and musl, as for Debian 12, and a download only its daemon makes from a host that isn&amp;rsquo;t allowed refused with the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, and with GNU &lt;code&gt;tar&lt;/code&gt; as its commands find it, &lt;code&gt;devvm history import&lt;/code&gt; puts an export into it, while an export with a path outside the agents&amp;rsquo; history imports nothing there, and on a Linux host, given Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; with no mode chosen, &lt;code&gt;devvm mount-cache none&lt;/code&gt; gives it &lt;code&gt;none&lt;/code&gt; at its next start, through the restart that a remount Alpine refuses gets, which devvm&amp;rsquo;s portable check of the folder confirms; base builds from &lt;code&gt;ubuntu:26.04&lt;/code&gt;; and the build VM and its temporary folders are gone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;link&lt;/code&gt;: links between VMs, each check the end-to-end proof of a row of the threat check in &lt;a href="https://next.devvm.dev/docs/contributing/design/#links-between-vms"&gt;the design note&lt;/a&gt;. It runs devvm with a soft limit of 256 open files, macOS&amp;rsquo;s default, as the link sessions it starts get that limit too, and it makes two small open targets, each forwarding no port and running servers on its own &lt;code&gt;127.0.0.1&lt;/code&gt; (&lt;code&gt;/var/tmp/e2e-link.pl&lt;/code&gt;, in perl, which every base has), and a client that forwards every port. Each of the three reserves the link checks&amp;rsquo; ports (&lt;code&gt;ip_local_reserved_ports&lt;/code&gt;), so Linux never gives one to a connection&amp;rsquo;s own end, where a connection that just ended would hold it for a minute and a later server or &lt;code&gt;ssh -R&lt;/code&gt; couldn&amp;rsquo;t bind it. &lt;code&gt;sshd -T&lt;/code&gt; in each VM shows remote forwards allowed on &lt;code&gt;127.77.*:*&lt;/code&gt; alone, at the address the host asks for, and the client&amp;rsquo;s own Lima rules ignore every port. A port the target doesn&amp;rsquo;t publish is refused by &lt;code&gt;devvm link add&lt;/code&gt;, and once a port is published, &lt;code&gt;devvm link add&lt;/code&gt; on the running client reaches it within seconds as &lt;code&gt;NAME:PORT&lt;/code&gt; and &lt;code&gt;NAME.devvm.internal:PORT&lt;/code&gt;, by curl and by a raw TCP client (bash&amp;rsquo;s &lt;code&gt;/dev/tcp&lt;/code&gt;), while with &lt;code&gt;--as NAME&lt;/code&gt; the target&amp;rsquo;s folder name doesn&amp;rsquo;t resolve. Two targets on one port are each reached by their own name, port 80 is linked on port 80, &lt;code&gt;devvm link&lt;/code&gt; and &lt;code&gt;devvm link publish&lt;/code&gt; list what they hold with &lt;code&gt;&amp;quot;version&amp;quot;: 1&lt;/code&gt; in their &lt;code&gt;--json&lt;/code&gt;, and &lt;code&gt;devvm network allowlist&lt;/code&gt; is refused for the client while it links to open targets. A published port that isn&amp;rsquo;t linked has nothing listening for it, &lt;code&gt;devvm link unpublish&lt;/code&gt; refuses the link&amp;rsquo;s next connection, logs it and names the client, and &lt;code&gt;devvm link rm&lt;/code&gt; takes the listener away within seconds. In the client, sshd listens only on its own port and the links&amp;rsquo; addresses, and nothing from a link listens on &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt; or every address, so this machine gets no forward of a link, while a server of the client&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with a link&amp;rsquo;s port is forwarded as usual. Each link&amp;rsquo;s socket is mode 600 in the run folder of mode 700, and the link session and every process it starts listen on no TCP port and connect only to the VMs&amp;rsquo; ssh ports. &lt;code&gt;ssh -R&lt;/code&gt; into the client binds nothing outside &lt;code&gt;127.77.0.0/16&lt;/code&gt; (&lt;code&gt;rfwd_links&lt;/code&gt;). A program in the client that holds a link&amp;rsquo;s address first fails that link alone with &lt;code&gt;link_port_taken&lt;/code&gt;, 256 connections at once, past the socket&amp;rsquo;s backlog of 128 on macOS, are all carried, and a 257th is refused and logged as &lt;code&gt;link_limit&lt;/code&gt;. Root in the client then loosens its sshd and the link session connects again: with &lt;code&gt;PermitListen any&lt;/code&gt; the client binds only the links&amp;rsquo; addresses, because the host asks for nothing else, and with &lt;code&gt;GatewayPorts yes&lt;/code&gt; too, the link session still listens on no TCP port of this machine and connects only to the VMs&amp;rsquo; sshd. &lt;code&gt;devvm network log&lt;/code&gt; shows the links&amp;rsquo; connections and refusals. A stopped target refuses the connection, logs &lt;code&gt;link_target_stopped&lt;/code&gt; and stays stopped, and the client&amp;rsquo;s launch warns of it. Once it&amp;rsquo;s restarted, the link works again. &lt;code&gt;devvm rm&lt;/code&gt; of the target removes the client&amp;rsquo;s link, names the client and removes its sockets, and a VM made again in that folder isn&amp;rsquo;t linked. Then the client and one target get the allowlist tier, the target while it runs. Until the target restarts, &lt;code&gt;devvm ls&lt;/code&gt; shows it &lt;code&gt;unenforced&lt;/code&gt;, the client&amp;rsquo;s next connection is refused and logged as &lt;code&gt;unenforced&lt;/code&gt; while the target&amp;rsquo;s server runs, and &lt;code&gt;devvm link add&lt;/code&gt; and the client&amp;rsquo;s launch warn of it (&lt;code&gt;link_target_unenforced&lt;/code&gt;). Once both have restarted, the client reaches its link by curl through its proxy settings and by a raw TCP client while a direct connection fails. A link added while the client runs is reached at once by curl through its proxy, by &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;CONNECT&lt;/code&gt;, with no link name in &lt;code&gt;NO_PROXY&lt;/code&gt; and the client&amp;rsquo;s boot and host keys unchanged, and the client&amp;rsquo;s proxy refuses names, ports and addresses that aren&amp;rsquo;t on its own list, while the target&amp;rsquo;s proxy refuses the client&amp;rsquo;s link name. &lt;code&gt;devvm link add&lt;/code&gt; refuses an open target, &lt;code&gt;devvm network open&lt;/code&gt; is refused for the target, and with the rule broken by hand in the target&amp;rsquo;s state the next connection is refused and the client&amp;rsquo;s launch warns and runs without the link until the rule holds again. In the &lt;code&gt;--from&lt;/code&gt; tier, an Alpine client reaches its link to port 80. &lt;code&gt;devvm rm&lt;/code&gt; of the client leaves no link session, socket, pid file, log or link state.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every section but &lt;code&gt;tools&lt;/code&gt; uses the shared tools&amp;rsquo; versions pinned in &lt;code&gt;tests/e2e-mise.lock&lt;/code&gt;, for both architectures&amp;rsquo; glibc and musl VMs, and the &lt;code&gt;--from&lt;/code&gt; checks start from container images pinned by digest in &lt;code&gt;tests/e2e/from_test.go&lt;/code&gt; (&lt;code&gt;fromNodeDigest&lt;/code&gt;, &lt;code&gt;fromAlpineDigest&lt;/code&gt; and &lt;code&gt;fromUbuntuDigest&lt;/code&gt;). The images built from them stay valid until a pin moves. base starts from the dated release of Ubuntu&amp;rsquo;s cloud image that &lt;code&gt;e2eUbuntuRelease&lt;/code&gt; in &lt;code&gt;tests/e2e/sandbox_test.go&lt;/code&gt; names, given to devvm as &lt;code&gt;DEVVM_UBUNTU_RELEASE&lt;/code&gt;, in place of the newest that a user&amp;rsquo;s devvm pins, so base&amp;rsquo;s key stays the same between runs and on every machine of one architecture. devvm keeps a release it has pinned, so when the sandbox&amp;rsquo;s pin names another release, as it does after &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; moves &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;, the run deletes that pin before its first section, and the next build pins &lt;code&gt;e2eUbuntuRelease&lt;/code&gt;. Its packages are those its key recorded at its first build in the sandbox, which stay in the sandbox&amp;rsquo;s package cache through &lt;code&gt;--clean&lt;/code&gt;, so base built again under the same key installs the same packages until &lt;code&gt;assets/&lt;/code&gt; or the release changes its key. &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; moves the lock to upstream&amp;rsquo;s newest versions, resolved with devvm&amp;rsquo;s pinned host mise, &lt;code&gt;scripts/bump.sh e2e-from&lt;/code&gt; moves the digests to what Docker Hub has for each tag, and &lt;code&gt;scripts/bump.sh e2e-ubuntu&lt;/code&gt; moves the release to the newest Ubuntu lists; &lt;code&gt;scripts/bump.sh --check&lt;/code&gt; shows them against upstream. The lock&amp;rsquo;s first line is the SHA-256 of the &lt;code&gt;assets/shared-tools/mise.toml&lt;/code&gt; it was resolved from, and a run stops at once when that file has changed since, until &lt;code&gt;scripts/bump.sh e2e-tools&lt;/code&gt; resolves the lock again.&lt;/p&gt;
&lt;p&gt;base, the &lt;code&gt;--from&lt;/code&gt; bases and the shared tool images stay cached between runs, except what a rebuild or gc deletes: every stale image in the sandbox (other selections&amp;rsquo; bases, whose features differ, among them) and every unused tool image (an earlier &lt;code&gt;from&lt;/code&gt; run&amp;rsquo;s musl ones, and the &lt;code&gt;tools&lt;/code&gt; section&amp;rsquo;s newest versions where they differ from the pins); every other VM a run makes is deleted at its end, and its project folders are unlocked and deleted. Each check prints &lt;code&gt;[n/N]&lt;/code&gt;, how long it took and the time left as the last complete run of each of its sections measured it, and a heartbeat every minute shows the latest output. e2e keeps each section&amp;rsquo;s times in a file of its own in slot 0&amp;rsquo;s state folder, &lt;code&gt;timings/plain/SECTION&lt;/code&gt;, or &lt;code&gt;timings/features/SECTION&lt;/code&gt; for a run whose base has every feature, because that run also checks base&amp;rsquo;s features. So a run of any selection, in any slot, estimates from and compares with the sections it runs. A check fails on its first failure, except the few marked &lt;code&gt;Flaky&lt;/code&gt;, which flake on timing, such as the network section&amp;rsquo;s check that the proxy&amp;rsquo;s password was in no host process&amp;rsquo;s arguments, and the link section&amp;rsquo;s 256-connection check and its stopped-target check. When one of these fails, e2e shows its output and runs it once more, and a second failure fails it. Its result says &lt;code&gt;retried once&lt;/code&gt;, its line in the timings has a third field, &lt;code&gt;retried&lt;/code&gt;, and the summary counts the retried checks and names each one. A check a run has nothing for is counted as &lt;code&gt;SKIP&lt;/code&gt;: base&amp;rsquo;s features, with base cached. A section that runs fewer checks than its last complete run with the same &lt;code&gt;tests/e2e&lt;/code&gt; Go files fails the run, because an error ended it early, and e2e keeps the times it had. After you edit those files, each section&amp;rsquo;s first complete run sets the count the next runs compare with. Checks look for devvm&amp;rsquo;s messages with &lt;code&gt;devvm _msg&lt;/code&gt;, never by their wording. The Go tests that need a real VM or desktop, &lt;code&gt;TestE2EExecQuoting&lt;/code&gt;, &lt;code&gt;TestE2ESelfCheck&lt;/code&gt; and &lt;code&gt;TestE2EDesktop&lt;/code&gt;, skip unless their &lt;code&gt;DEVVM_E2E_*&lt;/code&gt; variables are set, and e2e runs each of them through &lt;code&gt;s.GoE2E&lt;/code&gt;, which sets those variables in the test&amp;rsquo;s environment, so a value such as the desktop&amp;rsquo;s password is in no process&amp;rsquo;s arguments.&lt;/p&gt;
&lt;p&gt;Each check&amp;rsquo;s command has a time limit, counted from when it starts: three times the check&amp;rsquo;s longest time in its section&amp;rsquo;s last complete run, at least 2 minutes, or 10 minutes for a check with no time yet. The checks that build base or a &lt;code&gt;--from&lt;/code&gt; base, which &lt;code&gt;Builds()&lt;/code&gt; marks, get at least an hour, because their last time may have been a cached build. The steps between two checks, such as the launches that build tool images, get an hour too. When a check runs past its limit, the heartbeat stops the processes it started, with TERM as Ctrl+C would and then KILL 30 seconds later, and the check fails with the heartbeat&amp;rsquo;s last line in its output. When the steps before a check run past their limit, the heartbeat stops their processes the same way, and that check fails without running. Either way, the run goes on to the next check and then to its usual cleanup.&lt;/p&gt;
&lt;h3 data-hextra-search-id="slots"&gt;Slots&lt;span class="hx:absolute hx:-mt-20" id="slots"&gt;&lt;/span&gt;
&lt;a href="#slots" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A host with spare cores and memory can run the sections at once, each set in a sandbox of its own called a slot. &lt;code&gt;mise run e2e -- --slots N&lt;/code&gt; spreads the chosen sections over N slots, from 1 to 9, and runs each slot as a &lt;code&gt;--slot K&lt;/code&gt; run of its own, all at the same time. The default is one slot, which is the run described above. Slot 0 is the sandbox in the table, and slot K adds &lt;code&gt;-K&lt;/code&gt; to its Lima home, state folder, Keychain service and lock, as &lt;code&gt;~/.lt-e2e-go-1&lt;/code&gt;, &lt;code&gt;/tmp/devvm-go-e2e-1&lt;/code&gt;, &lt;code&gt;devvm-go-e2e-1&lt;/code&gt; and &lt;code&gt;/tmp/devvm-go-e2e-1.lock&lt;/code&gt;. Each fixed port the checks use is slot 0&amp;rsquo;s plus 100 times the slot, so slot 1&amp;rsquo;s servers use 47260 where slot 0&amp;rsquo;s use 47160. Slot 0&amp;rsquo;s ports run from 47160 to 47199, from 47240 to 47249, and 47613, 18765 and 18766, so no two slots ever share one.&lt;/p&gt;
&lt;p&gt;e2e places the longest sections first, each in the slot with the least time so far, using each section&amp;rsquo;s time from its last complete run. A section that has never run gets a guess, from 2 minutes for gc and clone to 30 minutes for from. link always goes in the same slot as from when both run, because in the &lt;code&gt;--from&lt;/code&gt; tier link&amp;rsquo;s Alpine client starts from the image that from builds. Each slot runs its own sections in the usual order, and a slot left without a section isn&amp;rsquo;t started. When &lt;code&gt;go&lt;/code&gt; isn&amp;rsquo;t on your &lt;code&gt;PATH&lt;/code&gt;, e2e finds mise&amp;rsquo;s Go once and puts its folder first on the slots&amp;rsquo; &lt;code&gt;PATH&lt;/code&gt;, because slots that each ran &lt;code&gt;mise exec&lt;/code&gt; at the same time would each install the repo&amp;rsquo;s tools over one another. With &lt;code&gt;--from&lt;/code&gt;, e2e passes &lt;code&gt;--every-feature&lt;/code&gt; to every slot, so each slot&amp;rsquo;s base has every feature, as a single &lt;code&gt;--from&lt;/code&gt; run&amp;rsquo;s has.&lt;/p&gt;
&lt;p&gt;Before the slots start, e2e takes every slot&amp;rsquo;s lock and gives each other slot what slot 0 has and it lacks: every image&amp;rsquo;s Lima instance and record, every tool image and its record, and devvm&amp;rsquo;s caches. It clones the large files and never copies them whole: on macOS each one is an APFS clone, which needs both folders on one APFS volume, and on Linux a reflink. The records and the &lt;code&gt;--from&lt;/code&gt; digests are small files, so e2e copies them. When a file can&amp;rsquo;t be cloned, as on a Linux host whose &lt;code&gt;/tmp&lt;/code&gt; is tmpfs, e2e says so and that slot builds its own. With &lt;code&gt;--clean&lt;/code&gt;, nothing is cloned, and each slot deletes its own cached images instead. A &lt;code&gt;--slot K&lt;/code&gt; run of your own uses that slot&amp;rsquo;s images as they are.&lt;/p&gt;
&lt;p&gt;Each slot&amp;rsquo;s output appears as it comes, each line led by its slot&amp;rsquo;s number, such as &lt;code&gt;[1]&lt;/code&gt;, and stays in the slot&amp;rsquo;s &lt;code&gt;e2e.log&lt;/code&gt;. When every slot has ended, e2e prints each slot&amp;rsquo;s sections, results and time, then the sums: checks passed, failed, skipped and retried, the failed checks by name, and the time the whole run took. The run fails when any slot fails or ends without its results. TERM or Ctrl+C stops every slot with TERM, and each one cleans up as a single run does.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://next.devvm.dev/docs/contributing/testing/#slots-for-each-host"&gt;Testing on other hosts&lt;/a&gt; says how many slots each kind of host runs. &lt;a href="https://next.devvm.dev/docs/contributing/testing/"&gt;Testing on other hosts&lt;/a&gt; also covers Linux hosts, x86_64 and the checks to run by hand.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-tests-behind-how-it-works"&gt;The tests behind How it works&lt;span class="hx:absolute hx:-mt-20" id="the-tests-behind-how-it-works"&gt;&lt;/span&gt;
&lt;a href="#the-tests-behind-how-it-works" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The How it works pages say in words what the tests of a mechanism check, and this section names those tests, so you can find the one to extend when you change the mechanism. Each unit test is named with its package, the CLI tests are files in &lt;code&gt;testdata/script/&lt;/code&gt;, and the end-to-end checks are in &lt;code&gt;tests/e2e&lt;/code&gt;, in the section the page names. The design notes name the tests of each emulation themselves (&lt;a href="https://next.devvm.dev/docs/contributing/design/"&gt;design notes&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#how-the-proxy-puts-them-in"&gt;How the proxy puts secrets in&lt;/a&gt;:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TestCheckName&lt;/code&gt;, &lt;code&gt;TestCheckHost&lt;/code&gt;, &lt;code&gt;TestCheckHeader&lt;/code&gt;, &lt;code&gt;TestCheckEnv&lt;/code&gt;, &lt;code&gt;TestCheckPrefix&lt;/code&gt;, &lt;code&gt;TestDefine&lt;/code&gt; and &lt;code&gt;TestChangeApply&lt;/code&gt;, in &lt;code&gt;internal/secrets&lt;/code&gt;, check what a secret of yours may be and what devvm secret set&amp;rsquo;s flags change.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestReservedEnvAssets&lt;/code&gt; and &lt;code&gt;TestEnvReservedForSecrets&lt;/code&gt;, in &lt;code&gt;internal/netpolicy&lt;/code&gt;, check the variables a secret can&amp;rsquo;t take.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestInjectSecretShapes&lt;/code&gt; and &lt;code&gt;TestSchemeOK&lt;/code&gt;, in &lt;code&gt;internal/proxy&lt;/code&gt;, check each shape a value goes in and each that keeps the placeholder, and &lt;code&gt;TestPathWithin&lt;/code&gt;, &lt;code&gt;TestForRequestMethods&lt;/code&gt; and &lt;code&gt;TestInterceptSecretMethods&lt;/code&gt; that a binding&amp;rsquo;s path and methods let it in only for the requests they match.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestGetChecksTheBinding&lt;/code&gt; checks that a binding that isn&amp;rsquo;t the secret&amp;rsquo;s as it&amp;rsquo;s saved gets nothing, &lt;code&gt;TestValueMax&lt;/code&gt; and &lt;code&gt;TestKeychainLine&lt;/code&gt;, in &lt;code&gt;internal/platform&lt;/code&gt;, that a value too long for the Keychain&amp;rsquo;s line is refused, and &lt;code&gt;TestPlaceholders&lt;/code&gt; the placeholders&amp;rsquo; one shape.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestCustomStore&lt;/code&gt;, &lt;code&gt;TestCustomsUnreadable&lt;/code&gt; and &lt;code&gt;TestWriteFilesCustom&lt;/code&gt; check the list, its mode and its checks, &lt;code&gt;TestValuesCachedByBinding&lt;/code&gt;, in &lt;code&gt;internal/proxy&lt;/code&gt;, that two bindings of one name are cached apart, and &lt;code&gt;TestCustomSecrets&lt;/code&gt;, in &lt;code&gt;internal/vm&lt;/code&gt;, use, a new value and the question before a delete.&lt;/li&gt;
&lt;li&gt;The CLI tests are &lt;code&gt;secret_custom.txtar&lt;/code&gt; and &lt;code&gt;layout.txtar&lt;/code&gt;, and the end-to-end checks are in &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s &lt;code&gt;network&lt;/code&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;The VM&amp;rsquo;s CA&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;TestInitCA&lt;/code&gt;, &lt;code&gt;TestInitCASwitch&lt;/code&gt;, &lt;code&gt;TestInitCAReplaced&lt;/code&gt;, &lt;code&gt;TestInitCATogether&lt;/code&gt; and &lt;code&gt;TestInitCACancelled&lt;/code&gt;, in &lt;code&gt;internal/trust&lt;/code&gt;, &lt;code&gt;TestPrepareOpen&lt;/code&gt;, in &lt;code&gt;internal/netpolicy&lt;/code&gt;, and &lt;code&gt;TestNextCASigns&lt;/code&gt;, &lt;code&gt;TestLoadCA&lt;/code&gt; and &lt;code&gt;TestServersApart&lt;/code&gt;. The CLI tests are &lt;code&gt;network.txtar&lt;/code&gt;, &lt;code&gt;sync.txtar&lt;/code&gt; and &lt;code&gt;layout.txtar&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;Logins made in a VM&lt;/a&gt;:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TestCaptureLogin&lt;/code&gt;, &lt;code&gt;TestCapturePaths&lt;/code&gt;, &lt;code&gt;TestCaptureEarlyHintsAnswerAndSaved&lt;/code&gt;, &lt;code&gt;TestCaptureErrorPasses&lt;/code&gt;, &lt;code&gt;TestCaptureRefuses&lt;/code&gt; and &lt;code&gt;TestCaptureGet&lt;/code&gt;, in &lt;code&gt;internal/proxy&lt;/code&gt;, check what goes out, what the VM gets and what&amp;rsquo;s refused.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestCodexCapture&lt;/code&gt;, &lt;code&gt;TestOpencodeCapture&lt;/code&gt;, &lt;code&gt;TestClaudeCapture&lt;/code&gt;, &lt;code&gt;TestClaudeSetupToken&lt;/code&gt;, &lt;code&gt;TestClaudeOAuthGet&lt;/code&gt;, &lt;code&gt;TestCaptureRefuses&lt;/code&gt;, &lt;code&gt;TestEndpoints&lt;/code&gt; and &lt;code&gt;TestPick&lt;/code&gt;, in &lt;code&gt;internal/agentlogin&lt;/code&gt;, check each agent&amp;rsquo;s file, its placeholders and copies, and its refresh.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestOneClaudeLogin&lt;/code&gt;, &lt;code&gt;TestClaudeBindings&lt;/code&gt; and &lt;code&gt;TestClaudeOAuthVMCopy&lt;/code&gt;, in &lt;code&gt;internal/secrets&lt;/code&gt;, check the one Claude Code login and its bindings, and &lt;code&gt;TestCapturer&lt;/code&gt; and &lt;code&gt;TestCaptureOwnAgents&lt;/code&gt;, in &lt;code&gt;internal/netpolicy&lt;/code&gt;, the endpoints in every VM&amp;rsquo;s config and which agent a capture is.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TestAgentLoginTerminal&lt;/code&gt;, in &lt;code&gt;internal/vm&lt;/code&gt;, and &lt;code&gt;TestTerminal&lt;/code&gt;, in &lt;code&gt;internal/ui&lt;/code&gt;, check that an agent&amp;rsquo;s login gets the terminal&amp;rsquo;s files only when devvm&amp;rsquo;s input and output are both terminals. The end-to-end checks are in &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s &lt;code&gt;network&lt;/code&gt; section.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#agents-logins-and-settings"&gt;Agents&amp;rsquo; logins and settings&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;TestFormatsWithholdUnknown&lt;/code&gt; plants a field that no format knows in every login file, &lt;code&gt;~/.claude.json&lt;/code&gt; included, and checks that no VM&amp;rsquo;s copy holds it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/network/#learning-from-the-log"&gt;Learning from the log&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;TestTickable&lt;/code&gt; checks that no name devvm network lock ticks is a shared-hosting domain or under one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://next.devvm.dev/docs/internals/images/#a-companys-ca-in-builds"&gt;A company&amp;rsquo;s CA in builds&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;tests/e2e&lt;/code&gt;&amp;rsquo;s &lt;code&gt;images&lt;/code&gt; section checks that a layer built with a test CA trusts it while its script runs and keeps its key once the folder is emptied, and that a copy of its image booted without devvm has none of devvm&amp;rsquo;s CA files. Its &lt;code&gt;project&lt;/code&gt; and &lt;code&gt;tools&lt;/code&gt; sections check &lt;a href="https://next.devvm.dev/docs/internals/network/#a-companys-ca"&gt;a company&amp;rsquo;s CA&lt;/a&gt; in a VM, which &lt;code&gt;tests/e2e&lt;/code&gt; runs on real VMs.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Writing docs</title><link>https://next.devvm.dev/docs/contributing/docs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/docs/</guid><description>
&lt;h2 data-hextra-search-id="writing-docs"&gt;Writing docs&lt;span class="hx:absolute hx:-mt-20" id="writing-docs"&gt;&lt;/span&gt;
&lt;a href="#writing-docs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The site is &lt;a href="https://gohugo.io" target="_blank" rel="noopener"&gt;Hugo&lt;/a&gt; with the &lt;a href="https://imfing.github.io/hextra/" target="_blank" rel="noopener"&gt;Hextra&lt;/a&gt; theme, built from &lt;code&gt;docs/&lt;/code&gt;. Hextra is a Hugo module pinned in &lt;code&gt;docs/go.mod&lt;/code&gt;; update it with &lt;code&gt;hugo mod get github.com/imfing/hextra@&amp;lt;version&amp;gt;&lt;/code&gt; in &lt;code&gt;docs/&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pages&lt;/strong&gt; are Markdown files in &lt;code&gt;docs/content/docs/&lt;/code&gt;, one per topic, in a folder per section of the sidebar. The sections run in the order a new user needs them: &lt;code&gt;getting-started/&lt;/code&gt;, &lt;code&gt;using/&lt;/code&gt;, &lt;code&gt;releases/&lt;/code&gt;, &lt;code&gt;safety/&lt;/code&gt;, &lt;code&gt;backends/&lt;/code&gt;, &lt;code&gt;compared/&lt;/code&gt;, &lt;code&gt;cli/&lt;/code&gt;, &lt;code&gt;internals/&lt;/code&gt;, then &lt;code&gt;contributing/&lt;/code&gt;. Each folder&amp;rsquo;s &lt;code&gt;_index.md&lt;/code&gt; is the section&amp;rsquo;s own page, which lists its pages. Update the page for any behavior you change, in the same change. The README stays high level: it says what devvm is and links to the pages for the rest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What goes where:&lt;/strong&gt; the user pages, in &lt;code&gt;getting-started/&lt;/code&gt;, &lt;code&gt;using/&lt;/code&gt;, &lt;code&gt;safety/&lt;/code&gt;, &lt;code&gt;backends/&lt;/code&gt; and &lt;code&gt;compared/&lt;/code&gt;, say what devvm does, what you type and what you see, and they name no repo paths, Go identifiers or message names. How it works, in &lt;code&gt;internals/&lt;/code&gt;, explains how devvm does it, for readers who want to check a claim, and it holds the mechanisms and the message names that come from them. Contributing, in &lt;code&gt;contributing/&lt;/code&gt;, covers changing devvm, so repo paths, Go identifiers, version bumps, releases and tests go there, and so do the &lt;a href="https://next.devvm.dev/docs/contributing/design/"&gt;design notes&lt;/a&gt;, which say why devvm is built as it is and hold each emulation&amp;rsquo;s design note and threat check. A user page links once to its How it works page where there is one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Current behavior, but for releases:&lt;/strong&gt; every page describes how devvm works now, and none mentions older behavior, what changed or what moved, because that goes in the changelog and on the release pages. Releases, in &lt;code&gt;releases/&lt;/code&gt;, is the one place the docs describe history. It has a page for each minor release, such as &lt;code&gt;releases/0.2.0.md&lt;/code&gt;, which covers the release and its release candidates and is written as the release is made. Each change there has a section of its own, under Breaking changes, Changes, Fixes or Hardening, that tells its full story: what was wrong or missing, how it showed, how devvm works now, at the level of the user pages, and what you do, with links to the user or How it works pages for anything deeper. The changelog&amp;rsquo;s entry links each section, as &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; says. These pages follow the docs voice, but they aren&amp;rsquo;t user pages, so the rules for leading with a command don&amp;rsquo;t apply.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;User pages lead with doing:&lt;/strong&gt; a task on a user page, in &lt;code&gt;getting-started/&lt;/code&gt;, &lt;code&gt;using/&lt;/code&gt;, &lt;code&gt;safety/&lt;/code&gt;, &lt;code&gt;backends/&lt;/code&gt; or &lt;code&gt;compared/&lt;/code&gt;, shows its command, in a copyable block or numbered steps, and a short explanation follows. One paragraph of why next to its command is fine, but two or more paragraphs back to back mean the mechanism belongs on the How it works page, under a heading that the user page links to, with every fact moved rather than dropped. The docs-voice skill&amp;rsquo;s &lt;a href="https://github.com/devvmhq/devvm/blob/main/.agents/skills/docs-voice/SKILL.md" target="_blank" rel="noopener"&gt;SKILL.md&lt;/a&gt; has the rule, under Commands first on user pages, with an example, and its &lt;code&gt;scan.sh -p paras&lt;/code&gt; and &lt;code&gt;scan.sh -p long&lt;/code&gt; list the runs and the long paragraphs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Front matter&lt;/strong&gt; sets &lt;code&gt;title&lt;/code&gt;, shown as the page&amp;rsquo;s heading, &lt;code&gt;weight&lt;/code&gt;, the page&amp;rsquo;s place in its section, or a section&amp;rsquo;s place in the sidebar for an &lt;code&gt;_index.md&lt;/code&gt;, and &lt;code&gt;explainer&lt;/code&gt;, the line under the title on the page&amp;rsquo;s social card, which Social cards below describes. Start the body at &lt;code&gt;##&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Links&lt;/strong&gt; to other pages point at their files (&lt;code&gt;[Contributing](_index.md)&lt;/code&gt;), so the linters can check them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Diagrams&lt;/strong&gt; are Mermaid code blocks, fenced with &lt;code&gt;mermaid&lt;/code&gt;, which a script draws as SVGs before Hugo builds the site, so no page loads Mermaid or any other diagram JavaScript. A diagram goes where it helps the reader follow the text, with at most one sentence to introduce it, and the text keeps every fact the diagram shows.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Drawing them:&lt;/strong&gt; &lt;code&gt;mise run docs:diagrams&lt;/code&gt; installs &lt;a href="https://pele.run" target="_blank" rel="noopener"&gt;pele&lt;/a&gt; with &lt;code&gt;npm ci --ignore-scripts&lt;/code&gt;, at the version and integrity that &lt;code&gt;docs/package.json&lt;/code&gt; and &lt;code&gt;docs/package-lock.json&lt;/code&gt; pin, and then runs &lt;code&gt;docs/render-diagrams.mjs&lt;/code&gt;. The script draws each block in &lt;code&gt;docs/content&lt;/code&gt; as an SVG in &lt;code&gt;docs/.build/diagrams/&lt;/code&gt;, which git ignores, with a JSON file of the diagram&amp;rsquo;s size beside it. It names both files for the block&amp;rsquo;s key, which is a hash of the salt and the block&amp;rsquo;s text. The salt is a hash of pele&amp;rsquo;s version and the script itself, and the script writes it to that folder too. &lt;code&gt;mise run docs&lt;/code&gt; and &lt;code&gt;mise run lint:docs&lt;/code&gt; run it first, and so do the Docs workflow&amp;rsquo;s builds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching:&lt;/strong&gt; a run with nothing changed takes a few hundredths of a second. mise skips the task when the drawings&amp;rsquo; folder is newer than every page in &lt;code&gt;docs/content&lt;/code&gt;, the script, &lt;code&gt;docs/package.json&lt;/code&gt; and the lock, so the script updates the folder&amp;rsquo;s time on every run. The task runs &lt;code&gt;npm ci&lt;/code&gt; only when the lock&amp;rsquo;s SHA-256 differs from the one it wrote to &lt;code&gt;docs/node_modules/.devvm-lock-sha256&lt;/code&gt; after its last install. The script keeps every drawing that&amp;rsquo;s already there, draws only the blocks it has no drawing of, and deletes the files no block&amp;rsquo;s key names, so a changed diagram is drawn again on its own, and a new pele or a change to the script draws them all again. The CI workflow&amp;rsquo;s check job caches npm&amp;rsquo;s downloads, keyed on the lock, and the Docs workflow, which publishes, keeps no cache and draws every diagram.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Putting them in pages:&lt;/strong&gt; &lt;code&gt;hugo.yaml&lt;/code&gt; mounts that folder at &lt;code&gt;assets/diagrams&lt;/code&gt;, and the render hook, &lt;code&gt;docs/layouts/_markup/render-codeblock-mermaid.html&lt;/code&gt;, which takes the place of Hextra&amp;rsquo;s, reads the salt, computes each block&amp;rsquo;s key from it and the block&amp;rsquo;s text, and puts the SVG in the page. A block without its SVG fails the build, so run &lt;code&gt;mise run docs:diagrams&lt;/code&gt; again after you change a diagram, even while &lt;code&gt;mise run docs&lt;/code&gt; serves the site, because the server doesn&amp;rsquo;t redraw them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The theme&lt;/strong&gt; is in &lt;code&gt;custom.css&lt;/code&gt;, which sets pele&amp;rsquo;s &lt;code&gt;--pele-*&lt;/code&gt; variables from the site&amp;rsquo;s palette, so a diagram never sets its own colors or font. Panels are on the surface color with blue borders, lines and arrows are lime, subgraphs, lifelines and notes use the border color, and text is in Departure Mono at 14px, larger than the home page&amp;rsquo;s art so labels read easily.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The layout&lt;/strong&gt; is pele&amp;rsquo;s own, with the Mermaid settings that &lt;code&gt;render-diagrams.mjs&lt;/code&gt; passes, such as right-angled edges. A diagram can set its own layout in front matter, as Staying safe&amp;rsquo;s three columns set &lt;code&gt;minNodeWidth&lt;/code&gt;, but never its own colors or font. pele lays subgraphs out from left to right in the order they&amp;rsquo;re written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Measuring labels:&lt;/strong&gt; the script measures each label by Departure Mono&amp;rsquo;s metrics, where every character is 350/550 of the font size wide, so labels fit their boxes. pele draws edge labels, messages and notes at seven-eighths of the size, 12px, and has no option to change it, so the measurer gives that text its width at 14px and the script then writes it at 14px. A self-check, before anything is drawn, fails the run when pele no longer measures and writes that text as the script expects, and every group of small text that pele draws must carry the 12px size the script replaces. The script also puts a newline after each label, where the SVG draws nothing, so the site&amp;rsquo;s search sees one label&amp;rsquo;s last word apart from the next label&amp;rsquo;s first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Size:&lt;/strong&gt; each diagram is drawn at its own size and never scaled to fit. The hook sets each diagram&amp;rsquo;s width on it, and a diagram wider than the text reaches into the page&amp;rsquo;s right margin, the article&amp;rsquo;s padding, as far as it needs, and into the padding on the left for whatever the right margin can&amp;rsquo;t hold, so it never covers the table of contents. A diagram wider than the text and both paddings scrolls sideways, as the widest ones do on a narrow screen. &lt;code&gt;custom.css&lt;/code&gt; gives each one &lt;code&gt;content-visibility: auto&lt;/code&gt;, so the browser draws it only when it nears the screen, and the hook sets the diagram&amp;rsquo;s height as its &lt;code&gt;contain-intrinsic-block-size&lt;/code&gt;, so the page doesn&amp;rsquo;t jump while you scroll.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility:&lt;/strong&gt; every diagram has an &lt;code&gt;accTitle&lt;/code&gt; and a one-line &lt;code&gt;accDescr&lt;/code&gt;, which become the SVG&amp;rsquo;s title and description that screen readers read, and the script fails on a diagram without them. The description says in full sentences what the diagram shows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Labels:&lt;/strong&gt; keep labels short, and break a long one with &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;. In a label, write &lt;code&gt;&amp;lt;&lt;/code&gt; as &lt;code&gt;#lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; as &lt;code&gt;#gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pele&amp;rsquo;s version&lt;/strong&gt; is pinned exactly, and &lt;code&gt;scripts/bump.sh pele&lt;/code&gt; moves it (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#updating-pinned-versions"&gt;updating pinned versions&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Style:&lt;/strong&gt; succinct and direct. Commands are written as devvm x or in backticks, never in quotes. No &lt;code&gt;please&lt;/code&gt;, &lt;code&gt;simply&lt;/code&gt; or &lt;code&gt;note that&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The home page&lt;/strong&gt; is &lt;code&gt;docs/content/_index.md&lt;/code&gt;, on Hextra&amp;rsquo;s &lt;code&gt;hextra-home&lt;/code&gt; layout: its hero shortcodes, then plain Markdown. &lt;code&gt;custom.css&lt;/code&gt; styles it through the one &lt;code&gt;div&lt;/code&gt; that the layout wraps its content in. After the hero, the page has a quick start, what&amp;rsquo;s supported, why to use devvm with its feature cards, a short FAQ, and a closing call to action with the hero&amp;rsquo;s buttons. It keeps a marketing tone, but each of its claims matches the docs page it links to, it uses the same terms, and it says each thing once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The quick start&lt;/strong&gt; shows the three commands to run first, each after a comment short enough to fit a phone&amp;rsquo;s width, because a comment after its command would scroll out of view there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Feature cards&lt;/strong&gt; on the home page come from two shortcodes in &lt;code&gt;docs/layouts/_shortcodes/&lt;/code&gt;, which make a &lt;code&gt;{{&amp;lt; features &amp;gt;}}&lt;/code&gt; grid of &lt;code&gt;{{&amp;lt; feature title=&amp;quot;Ready in seconds&amp;quot; icon=&amp;quot;high-voltage&amp;quot; art=&amp;quot;copies&amp;quot; &amp;gt;}}&lt;/code&gt; cards, each closed with &lt;code&gt;{{&amp;lt; /feature &amp;gt;}}&lt;/code&gt;. A card shows its title as a heading, after the pixel icon its &lt;code&gt;icon&lt;/code&gt; names, drawn in the title&amp;rsquo;s own color at 24px, then the Markdown inside it, then its illustration, which is optional. The cards are in one centered column on smaller screens. From 1024px wide, they go into two columns, the first, third and so on on the left and the rest on the right, and each card is as tall as its content, so no card leaves a gap under it. &lt;code&gt;features&lt;/code&gt; places them: &lt;code&gt;feature&lt;/code&gt; renders its card through &lt;code&gt;docs/layouts/_partials/feature-card.html&lt;/code&gt; and hands it over, and each card&amp;rsquo;s &lt;code&gt;order&lt;/code&gt; style keeps the page&amp;rsquo;s order when the columns stack. What&amp;rsquo;s supported uses the same cards with smaller illustrations, and Quick start uses them with a terminal in each card. &lt;code&gt;{{&amp;lt; features columns=&amp;quot;3&amp;quot; &amp;gt;}}&lt;/code&gt; puts three in a row from 1024px wide, and &lt;code&gt;level=&amp;quot;3&amp;quot;&lt;/code&gt; on a card makes its title an &lt;code&gt;h3&lt;/code&gt;, under the section&amp;rsquo;s own heading.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Art beside a section&amp;rsquo;s text&lt;/strong&gt; comes from &lt;code&gt;{{&amp;lt; beside art=&amp;quot;blast-radius&amp;quot; &amp;gt;}}&lt;/code&gt;, closed with &lt;code&gt;{{&amp;lt; /beside &amp;gt;}}&lt;/code&gt;, in &lt;code&gt;docs/layouts/_shortcodes/beside.html&lt;/code&gt;. It renders the Markdown inside it, then the illustration it names. From 1024px wide, the text and the drawing each take half the column, with the drawing on the right, centered on the text. On narrower screens, the drawing goes below the text. Why use devvm? uses it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install commands&lt;/strong&gt; come from &lt;code&gt;{{&amp;lt; install &amp;gt;}}&lt;/code&gt; in &lt;code&gt;docs/layouts/_shortcodes/install.html&lt;/code&gt;, which the home page and Installing use. The commands are written in one place, &lt;code&gt;docs/layouts/_partials/install-tabs.html&lt;/code&gt;, which the tabs and the pages&amp;rsquo; Markdown copies both read. It renders Hextra&amp;rsquo;s tabs with a macOS tab, which has the Homebrew command, and a Linux tab, which has the install script. The macOS tab is selected in the HTML, so it shows when JavaScript is off. A small script in &lt;code&gt;docs/layouts/_partials/install-os.html&lt;/code&gt; selects the Linux tab as the page loads when the browser&amp;rsquo;s platform or user agent string says Linux, apart from Android. To check the Linux tab in headless Chrome, pass &lt;code&gt;--user-agent=&lt;/code&gt; with a Linux user agent string. &lt;code&gt;custom.css&lt;/code&gt; styles the tabs on a blue line, with the selected tab in lime.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other content per operating system&lt;/strong&gt; goes in &lt;code&gt;{{&amp;lt; os-tabs &amp;gt;}}&lt;/code&gt;, with a &lt;code&gt;{{&amp;lt; os-tab name=&amp;quot;macOS&amp;quot; &amp;gt;}}&lt;/code&gt; and then a &lt;code&gt;{{&amp;lt; os-tab name=&amp;quot;Linux&amp;quot; &amp;gt;}}&lt;/code&gt; inside it, each holding Markdown, as Installing&amp;rsquo;s requirements tables do. It uses the same tabs, styles and script as the install commands, so the visitor&amp;rsquo;s system is selected, and the build fails unless the tabs are macOS&amp;rsquo;s, then Linux&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Colors:&lt;/strong&gt; the site is dark only (&lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;params.theme&lt;/code&gt;). Its palette is in &lt;code&gt;docs/assets/css/custom.css&lt;/code&gt;: a black background and one lime accent, &lt;code&gt;#7fff00&lt;/code&gt;, which sets Hextra&amp;rsquo;s primary color. The home page&amp;rsquo;s illustrations also use &lt;code&gt;#0086b3&lt;/code&gt;, the blue that Hextra&amp;rsquo;s syntax highlighting gives commands like &lt;code&gt;cd&lt;/code&gt;, and &lt;code&gt;#ff5370&lt;/code&gt; (&lt;code&gt;--devvm-red&lt;/code&gt;), the JustBlack theme&amp;rsquo;s red, which marks only what an attack has compromised. The red&amp;rsquo;s contrast is 6.7:1 on the black and 6.0:1 on the surface color, and it&amp;rsquo;s much darker than the lime, so the two stay apart for readers who can&amp;rsquo;t tell red from green.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fonts:&lt;/strong&gt; the site uses Instrument Sans for text, Martian Mono for code, and Departure Mono, a pixel font, for the logo and the home page&amp;rsquo;s headings, badge and buttons. All three are in &lt;code&gt;docs/static/fonts/&lt;/code&gt;, each in its own folder with its license, and &lt;code&gt;docs/layouts/_partials/custom/head-end.html&lt;/code&gt; declares them. Instrument Sans and Martian Mono are upstream&amp;rsquo;s variable WOFF2 files, so one file holds every weight, and the partial&amp;rsquo;s comment records where each font came from, at which commit or release, and its SHA-256. To update a font, download the new version from the same place, check its SHA-256, and update the comment. Departure Mono is sharp at multiples of 11px and has one weight.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No third-party requests:&lt;/strong&gt; devvm.dev and next.devvm.dev load every script, stylesheet, font and image from the site itself, so a visitor&amp;rsquo;s browser asks no other host for anything. &lt;code&gt;mise run lint:docs&lt;/code&gt; checks this after it builds the site: &lt;code&gt;TestNoThirdPartyLoads&lt;/code&gt; in &lt;code&gt;internal/cli/docgen/site_test.go&lt;/code&gt; reads every page and stylesheet and fails on a link, script, image, frame or CSS &lt;code&gt;url()&lt;/code&gt; that points at a host other than the ones in &lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s and &lt;code&gt;next.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;baseURL&lt;/code&gt;. Hugo fetches FlexSearch, which Hextra&amp;rsquo;s search uses, when it builds the site, and the site serves it itself, so it passes. Diagrams are SVGs inside the pages, so they load nothing. Links that a visitor clicks, such as GitHub&amp;rsquo;s, aren&amp;rsquo;t loads, and the check ignores them. The social cards draw it from &lt;code&gt;docs/assets/fonts/departure-mono/&lt;/code&gt;, which has the same release&amp;rsquo;s OTF and license, because Hugo can&amp;rsquo;t draw text from a WOFF2.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The logo&lt;/strong&gt; in the navbar is the branding page&amp;rsquo;s &lt;code&gt;devvm-logo-on-dark.svg&lt;/code&gt; at its own size, which &lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;params.navbar.logo&lt;/code&gt; names, with the site&amp;rsquo;s title as its alt text. Right-clicking it opens the branding page instead of the browser&amp;rsquo;s menu, through a script in &lt;code&gt;docs/layouts/_partials/custom/footer.html&lt;/code&gt;. A left click, or Enter on the focused logo, still goes to the home page.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The branding page&lt;/strong&gt; is &lt;code&gt;docs/content/branding.md&lt;/code&gt;, at &lt;code&gt;/branding/&lt;/code&gt;, on its own layout, &lt;code&gt;docs/layouts/branding.html&lt;/code&gt;, which is Hextra&amp;rsquo;s home layout with the home page&amp;rsquo;s look and the script that copies a swatch&amp;rsquo;s hex. Its front matter keeps it out of the sidebar. It has the logo as box-drawing text in a code block, the logo&amp;rsquo;s SVGs and PNGs, the icons, the social card, the palette, the fonts, how to use the logo and the credits.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its downloads&lt;/strong&gt; are in &lt;code&gt;docs/static/branding/&lt;/code&gt;, and &lt;code&gt;{{&amp;lt; brand-asset &amp;gt;}}&lt;/code&gt; tiles inside &lt;code&gt;{{&amp;lt; brand-assets &amp;gt;}}&lt;/code&gt; show each one on its background, with a link to each file. The build fails when a file doesn&amp;rsquo;t exist, and it reads each PNG&amp;rsquo;s size for its link. &lt;code&gt;devvm-logo-on-dark.svg&lt;/code&gt; and &lt;code&gt;devvm-logo-on-light.svg&lt;/code&gt; are the logo, drawn on a pixel grid as the favicon is, made from Departure Mono&amp;rsquo;s 11px glyphs. The prompt and devvm are at twice the glyphs&amp;rsquo; size, the box is in 1-pixel lines, and the lock, a block with a keyhole under a 2-pixel arch, sits on the box&amp;rsquo;s bottom-right corner, with the box&amp;rsquo;s lines stopping short of it so that the arch stands clear. The version for light backgrounds is black, with its prompt in the dark lime, &lt;code&gt;#408000&lt;/code&gt; (&lt;code&gt;--devvm-accent-dark&lt;/code&gt;), which is the lime&amp;rsquo;s hue at half its lightness, with a contrast of 4.9:1 on white, where the lime has 1.2:1. Each logo&amp;rsquo;s PNG is its SVG at four times its size on a transparent background, and &lt;code&gt;devvm-icon-64.png&lt;/code&gt; to &lt;code&gt;devvm-icon-1024.png&lt;/code&gt; are &lt;code&gt;docs/static/favicon.svg&lt;/code&gt; at 4 to 64 times its size. After changing an SVG, render its PNGs again with headless Chrome&amp;rsquo;s &lt;code&gt;--screenshot&lt;/code&gt; at the exact size, passing &lt;code&gt;--default-background-color=00000000&lt;/code&gt; for the logos&amp;rsquo; transparency, and look at each one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The palette&lt;/strong&gt; comes from &lt;code&gt;{{&amp;lt; palette &amp;gt;}}&lt;/code&gt;, which reads the colors that &lt;code&gt;docs/data/palette.yaml&lt;/code&gt; lists, with each one&amp;rsquo;s name and use, and takes each hex from its variable in &lt;code&gt;custom.css&lt;/code&gt;, so the page always shows the site&amp;rsquo;s colors. The build fails when a variable isn&amp;rsquo;t there. A new color goes in both files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The fonts&lt;/strong&gt; each come from &lt;code&gt;{{&amp;lt; font-sample &amp;gt;}}&lt;/code&gt;, which shows a line of text in the font, with a link to the license the site serves for it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The favicon&lt;/strong&gt; is the same mark drawn on a 16-pixel grid in &lt;code&gt;docs/static/favicon.svg&lt;/code&gt;: the box, a lime prompt in its middle and a small lock centered on its bottom-right corner, overhanging it by 2 pixels each way, its shackle a closed arch, with the box&amp;rsquo;s lines stopping a pixel short of the lock, on black, with a pixel of black around the whole mark. Hextra links its icons by name, and the ones in &lt;code&gt;docs/static/&lt;/code&gt; take the place of its own: &lt;code&gt;favicon-16x16.png&lt;/code&gt; and &lt;code&gt;favicon-32x32.png&lt;/code&gt;, &lt;code&gt;favicon.ico&lt;/code&gt;, which holds those two PNGs, &lt;code&gt;apple-touch-icon.png&lt;/code&gt;, which is the grid at 160px with 10px of black around it, and the two &lt;code&gt;android-chrome-*.png&lt;/code&gt; icons that &lt;code&gt;site.webmanifest&lt;/code&gt; lists. Each PNG is the SVG at a whole multiple of its size, so its pixels stay sharp. &lt;strong&gt;The social card&lt;/strong&gt; in &lt;code&gt;docs/static/images/social-card.png&lt;/code&gt; is the 1200x630 card that the branding page offers for links to devvm. It has &lt;code&gt;devvm-logo-on-dark.svg&lt;/code&gt; at twice its size, the home page&amp;rsquo;s headline and tagline in Departure Mono, and the site&amp;rsquo;s colors. After changing the SVG or the card&amp;rsquo;s text, render the PNGs again with headless Chrome&amp;rsquo;s &lt;code&gt;--screenshot&lt;/code&gt; at the image&amp;rsquo;s exact size, and look at each one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Social cards:&lt;/strong&gt; every page gets a 1200x630 card of its own, which Hugo draws when it builds the site, and which sites and chat apps show when someone shares the page&amp;rsquo;s link.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The card&lt;/strong&gt; is &lt;code&gt;docs/assets/images/og-template.png&lt;/code&gt;, which is &lt;code&gt;social-card.png&lt;/code&gt; with the headline and tagline painted out in the background&amp;rsquo;s black, so it has the logo, devvm.dev and the lime bar, in the same four colors and nothing else. &lt;code&gt;docs/layouts/_partials/og-image.html&lt;/code&gt; draws three things on it with Hugo&amp;rsquo;s &lt;code&gt;images.Text&lt;/code&gt;, in Departure Mono: the page&amp;rsquo;s section in lime capitals at 22px, its title in white at 66px, or at 55px or 44px when a smaller size fits it in two lines, and its explainer in gray at 33px. A docs page&amp;rsquo;s section is its section&amp;rsquo;s title, such as Using devvm, a section&amp;rsquo;s own page has Docs, and the home page and the branding page have none. The text is centered between the logo and devvm.dev. Each size is a multiple of 11px and each line starts at a whole pixel, so the text is as sharp as the logo, and the card keeps only the template&amp;rsquo;s four colors. &lt;code&gt;docs/layouts/_partials/og-wrap.html&lt;/code&gt; wraps the lines at spaces, and because the font is monospaced, a line&amp;rsquo;s width is its length.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The explainer&lt;/strong&gt; is the &lt;code&gt;explainer&lt;/code&gt; in each page&amp;rsquo;s front matter: a few plain words on what the reader gets from the page, such as &lt;code&gt;Install devvm and check what it needs&lt;/code&gt;, without a full stop. It isn&amp;rsquo;t the page&amp;rsquo;s &lt;code&gt;description&lt;/code&gt;, which search engines and &lt;code&gt;llms.txt&lt;/code&gt; show, because that&amp;rsquo;s a sentence or two, and most pages have none. The home page&amp;rsquo;s card shows its &lt;code&gt;cardTitle&lt;/code&gt;, the hero&amp;rsquo;s headline, in place of its title, because the logo already says devvm. The CLI reference&amp;rsquo;s pages get their command&amp;rsquo;s &lt;code&gt;Short&lt;/code&gt; as their explainer when &lt;code&gt;mise run cli-docs&lt;/code&gt; writes them. &lt;code&gt;TestExplainers&lt;/code&gt; in &lt;code&gt;internal/cli/docgen&lt;/code&gt; fails when a page has no explainer, or when its explainer takes more than two lines of 48 characters or its title more than two lines of 36, which are the card&amp;rsquo;s lines at 33px and 44px.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The tags:&lt;/strong&gt; &lt;code&gt;docs/layouts/_partials/custom/head-end.html&lt;/code&gt; writes &lt;code&gt;og:image&lt;/code&gt; with its type, width, height and &lt;code&gt;og:image:alt&lt;/code&gt;, and &lt;code&gt;twitter:image:alt&lt;/code&gt;, whose text is devvm docs, the title and the explainer. &lt;code&gt;docs/layouts/_partials/_funcs/get-page-images.html&lt;/code&gt; takes the place of Hugo&amp;rsquo;s own, which its Twitter card and schema templates call for a page&amp;rsquo;s images, so &lt;code&gt;twitter:image&lt;/code&gt; and the schema&amp;rsquo;s image are the same card. &lt;code&gt;hugo.yaml&lt;/code&gt; names no &lt;code&gt;params.images&lt;/code&gt;, so Hextra&amp;rsquo;s Open Graph template writes no second &lt;code&gt;og:image&lt;/code&gt;. A card&amp;rsquo;s address is the site&amp;rsquo;s, so next.devvm.dev&amp;rsquo;s pages show next.devvm.dev&amp;rsquo;s cards.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The illustrations&lt;/strong&gt; on the home page are SVGs in &lt;code&gt;docs/assets/home/&lt;/code&gt;, and &lt;code&gt;{{&amp;lt; art &amp;quot;name&amp;quot; &amp;gt;}}&lt;/code&gt; inlines one into the page, so that it gets the page&amp;rsquo;s fonts and colors. A feature card&amp;rsquo;s &lt;code&gt;art&lt;/code&gt; parameter inlines one the same way, through &lt;code&gt;docs/layouts/_partials/art.html&lt;/code&gt;. Each one is drawn on Departure Mono&amp;rsquo;s 11px cell, 7 pixels wide and 14 tall, so its text and shapes are sharpest at its own size or at twice its size. The &lt;code&gt;art&lt;/code&gt; shortcode shows it at twice its size, 728px wide. A card shows it as wide as the card, at whatever scale that takes.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each card&amp;rsquo;s drawing shows what its text says, and nothing more.&lt;/strong&gt; The big cards&amp;rsquo; drawings are 364 by 140 pixels, or 168 for &lt;code&gt;isolated.svg&lt;/code&gt;: &lt;code&gt;zero-config.svg&lt;/code&gt; shows a dev server&amp;rsquo;s forwarded port, &lt;code&gt;devvm code&lt;/code&gt; and a commit authored by you, &lt;code&gt;copies.svg&lt;/code&gt; the base image and its copies, &lt;code&gt;isolated.svg&lt;/code&gt; the mount and the proxy, &lt;code&gt;agents.svg&lt;/code&gt; the agents&amp;rsquo; mounts, the history that stays and the token, and &lt;code&gt;make-it-yours.svg&lt;/code&gt; the stack of base, your layer and the VM, with &lt;code&gt;--from&lt;/code&gt;. The What&amp;rsquo;s supported cards&amp;rsquo; drawings are 224 by 70 pixels: &lt;code&gt;toolchains.svg&lt;/code&gt;, &lt;code&gt;coding-agents.svg&lt;/code&gt; and &lt;code&gt;layers.svg&lt;/code&gt;, which shows the image &lt;code&gt;docker+nix&lt;/code&gt; as a stack and the built-in layers beside it. The Quick start cards&amp;rsquo; drawings are terminals of 254 by 181 pixels, which a card shows at most twice their size: &lt;code&gt;step-cd.svg&lt;/code&gt; types &lt;code&gt;cd ~/some-project&lt;/code&gt; on your machine, &lt;code&gt;step-pick.svg&lt;/code&gt; types devvm, shows a short version of the new VM&amp;rsquo;s summary and presses enter at Customize it? [y/N], and &lt;code&gt;step-agent.svg&lt;/code&gt; types claude in the VM&amp;rsquo;s shell. Why use devvm?&amp;rsquo;s drawing, &lt;code&gt;blast-radius.svg&lt;/code&gt;, is 364 by 210 pixels and shows the same four attacks as its text on two machines. Without devvm, they light up on your machine, and the project, &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/.ssh&lt;/code&gt; and another project turn red one after another. With devvm, they light up in the VM, each one&amp;rsquo;s path toward your machine ends at the VM&amp;rsquo;s border with a cross, and your machine&amp;rsquo;s folders stay as they are.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every text element holds one run of characters at its own &lt;code&gt;x&lt;/code&gt;,&lt;/strong&gt; because Hugo&amp;rsquo;s &lt;code&gt;--minify&lt;/code&gt; removes the spaces between &lt;code&gt;tspan&lt;/code&gt; elements. A gap of a cell is 7 pixels added to &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Animations&lt;/strong&gt; are CSS keyframes in &lt;code&gt;custom.css&lt;/code&gt;, which classes in the SVGs turn on. &lt;code&gt;pulse&lt;/code&gt; dims and brightens a lime arrow every 3 seconds, and &lt;code&gt;pulse-2&lt;/code&gt; and &lt;code&gt;pulse-3&lt;/code&gt; start a part of the arrow 0.3 and 0.6 seconds later, so the pulse runs along it. &lt;code&gt;pulse-slow&lt;/code&gt; does the same every 4 seconds. &lt;code&gt;lit&lt;/code&gt; lights a text&amp;rsquo;s fill and &lt;code&gt;lit-chip&lt;/code&gt; a chip&amp;rsquo;s opacity for most of a 4-second loop, and &lt;code&gt;lit-2&lt;/code&gt;, &lt;code&gt;lit-3&lt;/code&gt; and &lt;code&gt;lit-4&lt;/code&gt; start them 0.5, 1 and 1.5 seconds later, so they light one after another. &lt;code&gt;blink&lt;/code&gt; turns a cursor on and off every 2 seconds. &lt;code&gt;mover&lt;/code&gt; marks a block that travels a path, &lt;code&gt;mover-token&lt;/code&gt; along the token&amp;rsquo;s line, under the proxy and down to the API in 3 seconds, and &lt;code&gt;mover-egress&lt;/code&gt; under the proxy, down to the allowlist and back, then out to the internet in 4 seconds. A block is drawn before the shapes it passes under. &lt;code&gt;attack-1&lt;/code&gt; to &lt;code&gt;attack-4&lt;/code&gt;, &lt;code&gt;path-1&lt;/code&gt; to &lt;code&gt;path-4&lt;/code&gt; and &lt;code&gt;reach-1&lt;/code&gt; to &lt;code&gt;reach-4&lt;/code&gt; tell &lt;code&gt;blast-radius.svg&lt;/code&gt;&amp;rsquo;s story in an 8-second loop, and every part of the drawing stays in place all along, so the story only changes colours and draws lines. Each attack&amp;rsquo;s chip turns from gray to lime at 0.4, 1.6, 2.8 and 4 seconds. In the VM, its path then draws itself down to the VM&amp;rsquo;s border, and when it gets there, the cross at the border turns lime and, on the machine without devvm, the folder it reaches turns red. Everything holds from 5.2 seconds, and from 6.6 seconds the colours go back and the paths draw back up, so the drawing rests from 7.2 seconds until the story starts again. Each step has its own keyframes, so that all of them end together. The SVG draws each part in its end colour, and &lt;code&gt;--rest&lt;/code&gt; in &lt;code&gt;custom.css&lt;/code&gt; gives the colour it has before its step, so a drawing without animation shows the end of the story. The Quick start terminals each loop on their own. &lt;code&gt;type&lt;/code&gt; marks a cover over a command, which shrinks from the right one cell at a time while &lt;code&gt;caret&lt;/code&gt; moves the cursor along, both in &lt;code&gt;--chars&lt;/code&gt; steps across &lt;code&gt;--width&lt;/code&gt;, and &lt;code&gt;caret-blink&lt;/code&gt; keeps the cursor solid while it types and makes it blink after. In &lt;code&gt;step-pick.svg&lt;/code&gt;, &lt;code&gt;pick-summary&lt;/code&gt; shows the summary once devvm is typed, &lt;code&gt;pick-ask&lt;/code&gt; shows the question after it, and &lt;code&gt;key&lt;/code&gt; lights enter as it&amp;rsquo;s pressed. Their styles in &lt;code&gt;custom.css&lt;/code&gt; are each part&amp;rsquo;s end state too, and their keyframes start from the beginning. When the visitor&amp;rsquo;s system asks for reduced motion, &lt;code&gt;prefers-reduced-motion&lt;/code&gt; turns every animation off and hides the blocks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;To see an animation&amp;rsquo;s state in a screenshot,&lt;/strong&gt; pause the animations with a stylesheet of your own and set each class&amp;rsquo;s &lt;code&gt;animation-delay&lt;/code&gt; to minus the time you want, because headless Chrome&amp;rsquo;s &lt;code&gt;--virtual-time-budget&lt;/code&gt; barely moves CSS animations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Icons&lt;/strong&gt; are pixel icons in &lt;code&gt;docs/assets/icons/&lt;/code&gt;, one SVG per icon. Most come from &lt;a href="https://github.com/atelier-anchor/dinkie-icons" target="_blank" rel="noopener"&gt;Dinkie Icons&lt;/a&gt;, which is MIT licensed, and the folder keeps its license and a README that names the version they were copied from. The penguin, prompt, warning and light bulb icons are drawn for devvm in the same style. &lt;code&gt;{{&amp;lt; icon &amp;quot;rocket&amp;quot; &amp;gt;}}&lt;/code&gt; inlines one through &lt;code&gt;docs/layouts/_partials/icon.html&lt;/code&gt;, so it takes the text&amp;rsquo;s color, and the build fails when no icon has that name. An icon is 0.75em square, which makes each of its pixels one screen pixel in 16px text, and it sits on the text&amp;rsquo;s baseline. Screen readers skip it, unless a second argument gives it a label, as in &lt;code&gt;{{&amp;lt; icon &amp;quot;warning&amp;quot; &amp;quot;Warning&amp;quot; &amp;gt;}}&lt;/code&gt;, for an icon that says something the text doesn&amp;rsquo;t. To add a Dinkie icon, copy its path data from the same version of the &lt;code&gt;@dinkie-icons/react&lt;/code&gt; npm package into a new file named after the icon in kebab case, with the same &lt;code&gt;svg&lt;/code&gt; attributes as the others. A new icon of your own uses the same 12-pixel grid and 1-pixel lines, and the README lists it.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each section&amp;rsquo;s icon&lt;/strong&gt; is chosen once, in &lt;code&gt;docs/data/sections.yaml&lt;/code&gt;, which maps a section&amp;rsquo;s folder under &lt;code&gt;docs/&lt;/code&gt; to an icon&amp;rsquo;s name, as in &lt;code&gt;getting-started: rocket&lt;/code&gt;. A new section gets a line there. The section cards and the sidebar both read it, so they always show the same icon, and the build fails when the list names a section or an icon that doesn&amp;rsquo;t exist.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Section cards&lt;/strong&gt; on the docs&amp;rsquo; first page are Hextra&amp;rsquo;s &lt;code&gt;{{&amp;lt; cards &amp;gt;}}&lt;/code&gt; holding a &lt;code&gt;{{&amp;lt; section-card path=&amp;quot;getting-started&amp;quot; &amp;gt;}}&lt;/code&gt; for each section, with its one-line description inside, closed with &lt;code&gt;{{&amp;lt; /section-card &amp;gt;}}&lt;/code&gt;. The shortcode takes the section&amp;rsquo;s title and link from its page under &lt;code&gt;docs/&lt;/code&gt;, and its icon from &lt;code&gt;sections.yaml&lt;/code&gt;, and the build fails when there&amp;rsquo;s no such page. Hextra&amp;rsquo;s card takes an icon only from Hextra&amp;rsquo;s own set, so the shortcode puts ours in the card&amp;rsquo;s title, at 24px. It&amp;rsquo;s dimmed as Hextra dims its own cards&amp;rsquo; icons, and it turns lime on hover.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sidebar&amp;rsquo;s top-level items&lt;/strong&gt; show their section&amp;rsquo;s icon at 12px, in the link&amp;rsquo;s color, so it&amp;rsquo;s gray, and lime for the section you&amp;rsquo;re in. Hextra&amp;rsquo;s sidebar has no icons, so &lt;code&gt;docs/layouts/_partials/custom/head-end.html&lt;/code&gt; writes a CSS rule for each section when the site builds, keyed to the section page&amp;rsquo;s address, with the icon from &lt;code&gt;docs/assets/icons/&lt;/code&gt; as a mask. Nothing is generated into the repo, so there&amp;rsquo;s no step to rerun.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The OS tabs&lt;/strong&gt; of &lt;code&gt;install&lt;/code&gt; and &lt;code&gt;os-tabs&lt;/code&gt; show the Apple icon before macOS and the penguin before Linux, which &lt;code&gt;docs/layouts/_partials/os-tab-name.html&lt;/code&gt; adds to each tab&amp;rsquo;s name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;✓ and ✗&lt;/strong&gt; go before a table cell&amp;rsquo;s word: &lt;code&gt;{{&amp;lt; yes &amp;gt;}} yes&lt;/code&gt; puts a lime check before it, and &lt;code&gt;{{&amp;lt; no &amp;gt;}} doesn't&lt;/code&gt; a gray cross. They go only in cells that are a plain yes or no, or what stands for one, such as the install script&amp;rsquo;s offers it, never in cells that are sentences, and the word stays, because screen readers skip the icon. Icons in tables are 12px, because a table&amp;rsquo;s text is smaller than 16px.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buttons&lt;/strong&gt; take an icon before their text: &lt;code&gt;docs/layouts/_shortcodes/hextra/hero-button.html&lt;/code&gt; is Hextra&amp;rsquo;s &lt;code&gt;hero-button&lt;/code&gt; with an &lt;code&gt;icon&lt;/code&gt; parameter, as in &lt;code&gt;{{&amp;lt; hextra/hero-button text=&amp;quot;Install&amp;quot; link=&amp;quot;docs/getting-started/install/&amp;quot; icon=&amp;quot;download&amp;quot; &amp;gt;}}&lt;/code&gt;, drawn at 24px like the headings&amp;rsquo; icons. The 404 page&amp;rsquo;s two buttons have their icons in its layout, a rocket for Getting started and the open book for the docs, as the home page&amp;rsquo;s Read the docs has it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The navbar&amp;rsquo;s GitHub link&lt;/strong&gt; uses Dinkie&amp;rsquo;s GitHub icon, which &lt;code&gt;docs/data/icons.yaml&lt;/code&gt; adds to Hextra&amp;rsquo;s own icons as &lt;code&gt;dinkie-github&lt;/code&gt;, and &lt;code&gt;hugo.yaml&lt;/code&gt;&amp;rsquo;s menu names. Hextra&amp;rsquo;s icon partial reads only that data, so an icon for the navbar goes there as its SVG, not in &lt;code&gt;docs/assets/icons/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Heading icons:&lt;/strong&gt; a heading gets an icon before its text with an &lt;code&gt;icon&lt;/code&gt; attribute, as in &lt;code&gt;## Quick start {icon=&amp;quot;rocket&amp;quot;}&lt;/code&gt;, which the home page&amp;rsquo;s section headings use. &lt;code&gt;docs/layouts/_markup/render-heading.html&lt;/code&gt; takes the place of Hextra&amp;rsquo;s heading render hook and adds the icon after Hugo makes the heading&amp;rsquo;s anchor, so the anchor comes from the text alone, such as &lt;code&gt;quick-start&lt;/code&gt;. On the home page, &lt;code&gt;custom.css&lt;/code&gt; draws these icons in lime at 24px, so each icon pixel is two screen pixels, as each of Departure Mono&amp;rsquo;s pixels is at 22px.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Callouts&lt;/strong&gt; are GitHub&amp;rsquo;s alerts: a blockquote whose first line is &lt;code&gt;[!NOTE]&lt;/code&gt;, &lt;code&gt;[!TIP]&lt;/code&gt; or &lt;code&gt;[!WARNING]&lt;/code&gt;, which GitHub shows the same way. &lt;code&gt;docs/layouts/_markup/render-blockquote-alert.html&lt;/code&gt; takes the place of Hextra&amp;rsquo;s alerts and draws each one on the surface color with a line down its left side, and a title with its icon: information-circled in blue for a note, the light bulb in the soft lime for a tip, and warning in lime for a warning. Any other type fails the build. Hextra&amp;rsquo;s own &lt;code&gt;callout&lt;/code&gt; shortcode isn&amp;rsquo;t used. Use a callout only for a real warning, such as what the VM&amp;rsquo;s boundary rests on, or a tip that saves the reader trouble, such as keeping a VM on a strict tier, and move the sentence into it instead of repeating it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For agents and other tools that read the site,&lt;/strong&gt; &lt;code&gt;hugo.yaml&lt;/code&gt; turns on three things that Hextra has. The site&amp;rsquo;s root has &lt;code&gt;llms.txt&lt;/code&gt;, which lists every section and its pages. Each page has a Markdown copy beside its HTML, such as &lt;code&gt;/docs/using/clone.md&lt;/code&gt; beside &lt;code&gt;/docs/using/clone/&lt;/code&gt;, and a section&amp;rsquo;s copy is &lt;code&gt;index.md&lt;/code&gt; in its folder, such as &lt;code&gt;/docs/using/index.md&lt;/code&gt;. Each docs page has a Copy page menu beside its title, which copies the page&amp;rsquo;s Markdown or opens it. &lt;code&gt;hugo.yaml&lt;/code&gt; lists every output for the home page, the sections and the pages, so the home page and the sections keep their RSS feeds, and the search index is built apart from these outputs.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;llms.txt&lt;/code&gt;&lt;/strong&gt; comes from &lt;code&gt;docs/layouts/llms.txt&lt;/code&gt;, which takes the place of Hextra&amp;rsquo;s. It has the site&amp;rsquo;s title and description, then each section under its title, with the section&amp;rsquo;s own page first and its pages after it. Each one is a link to its Markdown copy, as the llms.txt convention prefers, which &lt;code&gt;docs/layouts/_partials/llms-link.txt&lt;/code&gt; writes, and a line of plain text, which &lt;code&gt;docs/layouts/_partials/llms-summary.txt&lt;/code&gt; writes. A page without a copy gets a link to its HTML page instead. The line is the page&amp;rsquo;s &lt;code&gt;description&lt;/code&gt; from its front matter when it has one, and otherwise its first paragraph, cut at 200 characters. A &lt;code&gt;description&lt;/code&gt; is also the page&amp;rsquo;s description for search engines and link previews, so give a page one when its first paragraph doesn&amp;rsquo;t say what the page covers, as Coding agents has. &lt;code&gt;llms.txt&lt;/code&gt; also lists the CLI reference, with each command&amp;rsquo;s one-line summary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Markdown copies&lt;/strong&gt; come from &lt;code&gt;docs/layouts/page.markdown.md&lt;/code&gt; and &lt;code&gt;section.markdown.md&lt;/code&gt;, which take the place of Hextra&amp;rsquo;s and both use &lt;code&gt;docs/layouts/_partials/markdown-copy.md&lt;/code&gt;. A copy is the page&amp;rsquo;s title as a heading, then its Markdown with its shortcodes rendered. In a copy, a link to a section&amp;rsquo;s &lt;code&gt;_index.md&lt;/code&gt; points at &lt;code&gt;index.md&lt;/code&gt;, the section copy&amp;rsquo;s name, so the links work between the copies, and a link written in code stays as it is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each shortcode that docs pages use has a Markdown version&lt;/strong&gt; beside its HTML one in &lt;code&gt;docs/layouts/_shortcodes/&lt;/code&gt;, named after it with &lt;code&gt;.markdown.md&lt;/code&gt;, which renders it in the copies. &lt;code&gt;install&lt;/code&gt; writes each system&amp;rsquo;s name in bold, then its commands, which come from &lt;code&gt;docs/layouts/_partials/install-tabs.html&lt;/code&gt;, the same partial its tabs use. &lt;code&gt;os-tabs&lt;/code&gt; writes its tabs the same way, through &lt;code&gt;docs/layouts/_partials/os-sections.md&lt;/code&gt;. &lt;code&gt;section-card&lt;/code&gt; makes a list item that links the section&amp;rsquo;s copy, and Hextra&amp;rsquo;s &lt;code&gt;cards&lt;/code&gt; keeps only what&amp;rsquo;s inside it. &lt;code&gt;yes&lt;/code&gt; and &lt;code&gt;no&lt;/code&gt; become ✓ and ✗. A shortcode without a Markdown version puts its HTML into the copy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The home page and the branding page&lt;/strong&gt; are mostly shortcodes, and neither layout shows the menu. &lt;code&gt;hugo.yaml&lt;/code&gt; gives the home page no Markdown copy, and its front matter sets &lt;code&gt;contextMenu: false&lt;/code&gt;. The branding page&amp;rsquo;s front matter sets &lt;code&gt;outputs: [html]&lt;/code&gt;, &lt;code&gt;contextMenu: false&lt;/code&gt; and &lt;code&gt;llms: false&lt;/code&gt;, so it has no copy, no menu and no line in &lt;code&gt;llms.txt&lt;/code&gt;. Any other page can set &lt;code&gt;llms: false&lt;/code&gt; to stay out of &lt;code&gt;llms.txt&lt;/code&gt;, or &lt;code&gt;contextMenu: false&lt;/code&gt; to have no menu.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;After you add a page or a shortcode,&lt;/strong&gt; build the site and read the page&amp;rsquo;s line in &lt;code&gt;llms.txt&lt;/code&gt; and its Markdown copy. The line should say what the page covers, and the copy should have no shortcode left in it, such as &lt;code&gt;{{&amp;lt; os-tabs &amp;gt;}}&lt;/code&gt;, and no HTML from one. A shortcode that docs pages use gets its Markdown version. To try the menu, serve the site with &lt;code&gt;mise run docs&lt;/code&gt; and open a docs page. &lt;code&gt;custom.css&lt;/code&gt; gives the menu the site&amp;rsquo;s border and secondary text, lime on hover, and its list the surface color.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The 404 page&lt;/strong&gt; is &lt;code&gt;docs/layouts/404.html&lt;/code&gt;, which takes the place of Hextra&amp;rsquo;s and uses the site&amp;rsquo;s navbar and footer. It shows a VM&amp;rsquo;s terminal answering &lt;code&gt;cd ./this-page&lt;/code&gt; with &amp;ldquo;no such page&amp;rdquo;, drawn like the home page&amp;rsquo;s art in &lt;code&gt;docs/assets/home/not-found.svg&lt;/code&gt; with the &lt;code&gt;blink&lt;/code&gt; cursor, then Hextra&amp;rsquo;s search box and links to Getting started and the docs. Build the site and open &lt;code&gt;/404.html&lt;/code&gt; to see it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;mise run lint:docs&lt;/code&gt;, which &lt;code&gt;mise run lint&lt;/code&gt; includes, checks &lt;code&gt;docs/&lt;/code&gt; with:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Linter&lt;/th&gt;
&lt;th&gt;Checks&lt;/th&gt;
&lt;th&gt;Config&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;markdownlint-cli2&lt;/td&gt;
&lt;td&gt;Markdown&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.markdownlint-cli2.yaml&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vale&lt;/td&gt;
&lt;td&gt;the style rules&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.vale.ini&lt;/code&gt;, &lt;code&gt;.vale/styles/devvm/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lychee (&lt;code&gt;--offline&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;links to pages and files&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;It also builds the site with Hugo&amp;rsquo;s &lt;code&gt;--panicOnWarning&lt;/code&gt;, into a temporary folder it removes, so any warning fails it. That includes a deprecation, such as a template that reads &lt;code&gt;site.Data&lt;/code&gt; where Hugo wants &lt;code&gt;hugo.Data&lt;/code&gt;, so a Hugo upgrade that deprecates something the templates use fails here before the feature is removed. It runs &lt;code&gt;TestExplainers&lt;/code&gt; too, so a page without an explainer fails it, and &lt;code&gt;TestUserPageProse&lt;/code&gt; (&lt;code&gt;internal/cli/docgen/prose_test.go&lt;/code&gt;), which holds the user pages to &lt;a href="#writing-docs"&gt;lead with doing&lt;/a&gt;: it fails a run of three or more paragraphs back to back where two are over 80 words, and any paragraph or list item over 150 words. It counts words as &lt;code&gt;scan.sh&lt;/code&gt; does, a code span as one word and a link by its text, and a paragraph of 40 words or fewer that ends with a colon introduces what follows, so it isn&amp;rsquo;t in a run. &lt;code&gt;proseExempt&lt;/code&gt; names the pages that another branch is rewriting, each with why, until that branch lands. &lt;code&gt;TestChangelogShape&lt;/code&gt; (&lt;code&gt;internal/cli/docgen/changelog_test.go&lt;/code&gt;) holds &lt;code&gt;CHANGELOG.md&lt;/code&gt; to the shape that &lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#releasing"&gt;Releasing&lt;/a&gt; gives an entry, and &lt;code&gt;TestChangelogProblems&lt;/code&gt; checks that each of its rules fails an entry that breaks it.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-cli-reference"&gt;The CLI reference&lt;span class="hx:absolute hx:-mt-20" id="the-cli-reference"&gt;&lt;/span&gt;
&lt;a href="#the-cli-reference" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The &lt;a href="https://next.devvm.dev/docs/cli/"&gt;CLI reference&lt;/a&gt; in &lt;code&gt;docs/content/docs/cli/&lt;/code&gt; is generated from devvm&amp;rsquo;s commands with Cobra&amp;rsquo;s docs generator, and checked in. Don&amp;rsquo;t edit it: change the command&amp;rsquo;s &lt;code&gt;Use&lt;/code&gt;, &lt;code&gt;Short&lt;/code&gt;, &lt;code&gt;Long&lt;/code&gt;, &lt;code&gt;Example&lt;/code&gt; or flags, or its docs page in &lt;code&gt;internal/msg/docs.go&lt;/code&gt;, then run:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mise run cli-docs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It runs &lt;code&gt;internal/cli/docgen&lt;/code&gt;, which replaces every page in that folder: &lt;code&gt;_index.md&lt;/code&gt;, listing the commands, and a page per command named after its path (&lt;code&gt;devvm_build.md&lt;/code&gt;), with &lt;code&gt;title&lt;/code&gt; and &lt;code&gt;explainer&lt;/code&gt; front matter, the explainer being the command&amp;rsquo;s &lt;code&gt;Short&lt;/code&gt;, and links to the other pages as files. Each page has the command&amp;rsquo;s examples, and a Docs section before See also that links to the command&amp;rsquo;s docs page on the site. Hidden commands (&lt;code&gt;_msg&lt;/code&gt;, &lt;code&gt;_qemu&lt;/code&gt;) and Cobra&amp;rsquo;s help command are left out. The pages carry no dates, so the same commands give the same files. They carry no weight either, so Hugo sorts the section by title, and a new command adds its own page and changes only &lt;code&gt;_index.md&lt;/code&gt; and the root&amp;rsquo;s &lt;code&gt;devvm.md&lt;/code&gt;; &lt;code&gt;TestPagesHaveNoWeight&lt;/code&gt; checks this. The &lt;code&gt;.gitattributes&lt;/code&gt; file marks the pages as generated, so GitHub collapses them in a diff.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mise run cli-docs&lt;/code&gt; also writes the generated blocks of hand-written pages, which &lt;code&gt;cli.DocBlocks&lt;/code&gt; in &lt;code&gt;internal/cli/docblocks.go&lt;/code&gt; lists: the Supported agents table in &lt;code&gt;using/coding-agents.md&lt;/code&gt;, and the README&amp;rsquo;s list of the agents. Each block sits between two HTML comments that name it, and docgen replaces only the text between them, from the registry of agents, &lt;code&gt;agents.Defs&lt;/code&gt;, and each agent&amp;rsquo;s policy in &lt;code&gt;assets/shared-tools/&lt;/code&gt;. So don&amp;rsquo;t edit a block by hand: change the agent&amp;rsquo;s &lt;code&gt;Def&lt;/code&gt;, its &lt;code&gt;Docs&lt;/code&gt; included, or its policy, then run &lt;code&gt;mise run cli-docs&lt;/code&gt;.&lt;/p&gt;
&lt;h3 data-hextra-search-id="a-commands-help"&gt;A command&amp;rsquo;s help&lt;span class="hx:absolute hx:-mt-20" id="a-commands-help"&gt;&lt;/span&gt;
&lt;a href="#a-commands-help" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Every command&amp;rsquo;s help, which its reference page also shows, has the same shape. &lt;code&gt;Short&lt;/code&gt; is an action in sentence case without a full stop, such as &lt;code&gt;List the project VMs&lt;/code&gt;. &lt;code&gt;Long&lt;/code&gt; is one to three short sentences on what the command does, and the rules and edge cases go on its docs page. &lt;code&gt;Example&lt;/code&gt; comes from &lt;code&gt;examples&lt;/code&gt; in &lt;code&gt;internal/cli/help.go&lt;/code&gt;, which takes each command line with a short comment and lines the comments up, the most common invocation first. A flag&amp;rsquo;s description is short, and its long explanation goes on the page.&lt;/p&gt;
&lt;p&gt;Each command describes itself where it&amp;rsquo;s made, so its docs page and group are in its own file, not in tables elsewhere. Its &lt;code&gt;Annotations&lt;/code&gt; come from an &lt;code&gt;about&lt;/code&gt; in &lt;code&gt;internal/cli/help.go&lt;/code&gt;: &lt;code&gt;docs&lt;/code&gt;, the user page that covers it as &lt;code&gt;page#anchor&lt;/code&gt;; &lt;code&gt;group&lt;/code&gt;, its section of the root&amp;rsquo;s help; and &lt;code&gt;noJSON&lt;/code&gt;, why a command without &lt;code&gt;--json&lt;/code&gt; has none. &lt;code&gt;addDocs&lt;/code&gt; gives the root Cobra&amp;rsquo;s usage template with a Docs section at the end, which shows the address of the command&amp;rsquo;s page, and the root&amp;rsquo;s help also ends with the issue tracker, &lt;code&gt;msg.IssuesURL&lt;/code&gt;. The CLI reference links each command&amp;rsquo;s page too, and &lt;code&gt;TestDocLinks&lt;/code&gt; in &lt;code&gt;internal/msg&lt;/code&gt; reads those links from the reference and checks that each page and heading exists and is a user page. &lt;code&gt;helpGroups&lt;/code&gt; in the same file lists the root&amp;rsquo;s sections, in order, and &lt;code&gt;addGroups&lt;/code&gt; adds each group that has a command and sets its commands&amp;rsquo; &lt;code&gt;GroupID&lt;/code&gt;, so a group whose commands don&amp;rsquo;t exist yet stays out of the help. A subcommand can name a group too, such as layer add in Change your VM, when it belongs in another group than its parent. &lt;code&gt;addGroups&lt;/code&gt; then adds that group to the parent, so the parent&amp;rsquo;s own help groups its subcommands the same way, and the usage template lists the subcommand by both names in the root&amp;rsquo;s group, after the group&amp;rsquo;s own commands. Cobra lists a group&amp;rsquo;s commands in alphabetical order, and &lt;code&gt;help&lt;/code&gt; goes in Cobra&amp;rsquo;s own Additional Commands.&lt;/p&gt;
&lt;p&gt;The tests fail when the checked-in pages are stale: &lt;code&gt;TestReferenceIsCurrent&lt;/code&gt; in &lt;code&gt;internal/cli/docgen&lt;/code&gt; generates the reference into a temporary folder and compares it with &lt;code&gt;docs/content/docs/cli/&lt;/code&gt;, and it checks each generated block against its page too, which &lt;code&gt;TestStaleBlockIsCaught&lt;/code&gt; proves it catches. &lt;code&gt;mise run docs&lt;/code&gt; regenerates it before serving the site.&lt;/p&gt;
&lt;h3 data-hextra-search-id="building-the-site"&gt;Building the site&lt;span class="hx:absolute hx:-mt-20" id="building-the-site"&gt;&lt;/span&gt;
&lt;a href="#building-the-site" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;mise run docs&lt;/code&gt; draws the diagrams, then serves the site at &lt;code&gt;http://localhost:1313/&lt;/code&gt; and reloads on every change except a diagram&amp;rsquo;s, which needs &lt;code&gt;mise run docs:diagrams&lt;/code&gt; again. After you run &lt;code&gt;mise run docs:diagrams&lt;/code&gt;, &lt;code&gt;mise exec -- hugo -s docs --minify&lt;/code&gt; builds the site into &lt;code&gt;docs/public/&lt;/code&gt;, as the Docs workflow does for devvm.dev, and &lt;code&gt;mise exec -- hugo -s docs --minify --config hugo.yaml,next.yaml&lt;/code&gt; builds the site as next.devvm.dev has it, with its banner and its noindex (&lt;a href="https://next.devvm.dev/docs/contributing/maintaining/#the-docs-sites"&gt;the docs sites&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Design notes</title><link>https://next.devvm.dev/docs/contributing/design/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://next.devvm.dev/docs/contributing/design/</guid><description>
&lt;p&gt;For contributors: why devvm is built the way it is, what was tried and dropped, and what&amp;rsquo;s still open. How each part works is on its own page in &lt;a href="https://next.devvm.dev/docs/internals/"&gt;How it works&lt;/a&gt;, and the rest of &lt;a href="https://next.devvm.dev/docs/contributing/"&gt;Contributing&lt;/a&gt; has the repo&amp;rsquo;s layout and rules. Why devvm is written in Go is under &lt;a href="https://next.devvm.dev/docs/internals/processes/#why-go"&gt;Why Go&lt;/a&gt;, with the processes it runs.&lt;/p&gt;
&lt;h2 data-hextra-search-id="emulated-features"&gt;Emulated features&lt;span class="hx:absolute hx:-mt-20" id="emulated-features"&gt;&lt;/span&gt;
&lt;a href="#emulated-features" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When devvm builds a backend feature from other parts of the backend, the feature is &lt;a href="https://next.devvm.dev/docs/internals/backends/#features"&gt;emulated&lt;/a&gt;, and it gets a note here before its review. The note says what the feature is built from, the guarantee it keeps, what could break it, and which end-to-end checks prove it. The threat check comes next, and only then is the feature marked reviewed. Every feature Lima has is native except its ports, which devvm&amp;rsquo;s forwarder emulates (&lt;a href="#ports-on-lima"&gt;below&lt;/a&gt;).&lt;/p&gt;
&lt;h3 data-hextra-search-id="ssh-into-vms"&gt;ssh into VMs&lt;span class="hx:absolute hx:-mt-20" id="ssh-into-vms"&gt;&lt;/span&gt;
&lt;a href="#ssh-into-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;ssh for editors is native on Lima, so it isn&amp;rsquo;t an emulation, but its sessions keep a guarantee of devvm&amp;rsquo;s own: ssh and editors reach a VM by name through the entries devvm writes (&lt;a href="https://next.devvm.dev/docs/internals/security/#ssh-into-vms"&gt;security model&lt;/a&gt;), and a session gives the VM no way out it doesn&amp;rsquo;t already have, on a confined tier nothing past its proxy, whatever the VM runs as sshd.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What keeps a session from carrying the VM out.&lt;/strong&gt; An ssh session can carry the VM&amp;rsquo;s traffic only through channels the host&amp;rsquo;s ssh asks for: remote forwards (&lt;code&gt;-R&lt;/code&gt;, &lt;code&gt;RemoteForward&lt;/code&gt;, a remote SOCKS forward), X11, a tunnel and the agent; OpenSSH&amp;rsquo;s client refuses a channel the server opens unasked. Root in the VM runs whatever sshd it likes, so the guarantee is the host&amp;rsquo;s ssh&amp;rsquo;s: devvm&amp;rsquo;s entry (first in &lt;code&gt;~/.ssh/config&lt;/code&gt;, so its options win over a &lt;code&gt;Host *&lt;/code&gt;) sets &lt;code&gt;ForwardX11 no&lt;/code&gt;, &lt;code&gt;ForwardX11Trusted no&lt;/code&gt;, &lt;code&gt;Tunnel no&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen none&lt;/code&gt; (so devvm needs OpenSSH 8.7 or newer; no &lt;code&gt;IgnoreUnknown&lt;/code&gt; for older ones, as its first value wins and would replace a user&amp;rsquo;s &lt;code&gt;Host *&lt;/code&gt; one, such as macOS&amp;rsquo;s for &lt;code&gt;UseKeychain&lt;/code&gt;), &lt;code&gt;ForwardAgent&lt;/code&gt; as the agent choice the VM&amp;rsquo;s current start was made with says, &lt;code&gt;AddKeysToAgent no&lt;/code&gt; (no key of the host&amp;rsquo;s lands in an agent the session forwards), &lt;code&gt;ProxyJump none&lt;/code&gt; and &lt;code&gt;ProxyCommand none&lt;/code&gt; (no hop through something else), &lt;code&gt;UpdateHostKeys no&lt;/code&gt; (the VM can&amp;rsquo;t add host keys; devvm reads them itself) and &lt;code&gt;HashKnownHosts no&lt;/code&gt;. A &lt;code&gt;RemoteForward&lt;/code&gt; can&amp;rsquo;t be turned off without refusing &lt;code&gt;ssh -R&lt;/code&gt; on the command line too, so it isn&amp;rsquo;t (Not covered). VS Code&amp;rsquo;s Remote-SSH uses local and dynamic forwards (&lt;code&gt;-L&lt;/code&gt;, &lt;code&gt;-D&lt;/code&gt;) and is unaffected. Then sshd&amp;rsquo;s own settings, a defence for an honest VM (&lt;code&gt;assets/layers/base.sh&lt;/code&gt;, &lt;code&gt;/etc/ssh/sshd_config.d/00-devvm.conf&lt;/code&gt;, first so it wins; Lima&amp;rsquo;s own forwards are local; it applies only where the image&amp;rsquo;s &lt;code&gt;sshd_config&lt;/code&gt; includes &lt;code&gt;sshd_config.d&lt;/code&gt;, as Ubuntu&amp;rsquo;s and Debian&amp;rsquo;s do, so for some &lt;code&gt;--from&lt;/code&gt; images not at all, which only an honest VM&amp;rsquo;s defence loses):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Local forwarding&lt;/strong&gt; (&lt;code&gt;-L&lt;/code&gt;, &lt;code&gt;-D&lt;/code&gt;, &lt;code&gt;-W&lt;/code&gt;) is allowed: the VM itself connects, from its own network, which its tier confines like any other connection of the VM&amp;rsquo;s (checked). VS Code&amp;rsquo;s Remote-SSH reaches its server this way.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remote forwards bind only &lt;code&gt;127.77.0.0/16&lt;/code&gt;,&lt;/strong&gt; the range devvm keeps for links between VMs, and remote socket forwards are refused. A remote forward makes the host connect on the VM&amp;rsquo;s behalf, so one the host&amp;rsquo;s ssh asked for by mistake could reach anything the host reaches, its loopback services and sockets (&lt;code&gt;docker.sock&lt;/code&gt;, agents) included, around the VM&amp;rsquo;s confinement. &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; binds the address a request names, and &lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt; matches that address as text, so a request for &lt;code&gt;localhost&lt;/code&gt; (ssh&amp;rsquo;s default), &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;0.0.0.0&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt; is refused. Only devvm on the host asks for a forward in that range, always by number. X11 and tunnels are refused too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent forwarding&lt;/strong&gt; is allowed: the entry decides it from the SSH agent choice the VM&amp;rsquo;s current start was made with (&lt;code&gt;ForwardAgent&lt;/code&gt; and &lt;code&gt;IdentityAgent&lt;/code&gt; naming the VM&amp;rsquo;s proxy&amp;rsquo;s relay of that agent, yours or devvm&amp;rsquo;s own, which passes on only listing keys, signing and &lt;code&gt;[email protected]&lt;/code&gt;, so the VM can&amp;rsquo;t remove, lock or add the agent&amp;rsquo;s keys, as &lt;a href="https://next.devvm.dev/docs/internals/processes/#the-ssh-agents"&gt;the SSH agents&lt;/a&gt; says). Refusing it would break &lt;code&gt;devvm ssh-agent on&lt;/code&gt; in editors.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These settings guard against the host&amp;rsquo;s ssh asking for a forward that devvm&amp;rsquo;s entry doesn&amp;rsquo;t pin (a &lt;code&gt;RemoteForward&lt;/code&gt; under &lt;code&gt;Host *&lt;/code&gt;, &lt;code&gt;ssh -R&lt;/code&gt;), and only while root in the VM leaves sshd as it is. They&amp;rsquo;re a safeguard for an honest VM, and the boundary is the host&amp;rsquo;s ssh, which accepts a channel only for a forward it asked for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; OpenSSH&amp;rsquo;s client refusing unrequested channels, and devvm&amp;rsquo;s &lt;code&gt;Include&lt;/code&gt; line first in &lt;code&gt;~/.ssh/config&lt;/code&gt;, so its entries&amp;rsquo; options win.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; host ssh settings that come before devvm&amp;rsquo;s entries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A remote forward you ask for (&lt;code&gt;ssh -R&lt;/code&gt;, a &lt;code&gt;RemoteForward&lt;/code&gt; of yours): &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;remote forwards you add&lt;/a&gt; lists what it leaves open.&lt;/li&gt;
&lt;li&gt;Sessions see the proxy&amp;rsquo;s password, as devvm&amp;rsquo;s own shells do, and VS Code and Cursor relay what &lt;a href="https://next.devvm.dev/docs/using/ssh/#vs-code-and-cursor"&gt;VS Code and Cursor&lt;/a&gt; describes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-hextra-search-id="ports-on-lima"&gt;Ports on Lima&lt;span class="hx:absolute hx:-mt-20" id="ports-on-lima"&gt;&lt;/span&gt;
&lt;a href="#ports-on-lima" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; when a VM forwards every port, each TCP port from 1024 up that a server in it listens on, on its loopback or on all its addresses, is forwarded to the same port on the host&amp;rsquo;s loopback, and only to its loopback. When a VM lists its ports, only those are forwarded, however many it lists, by the same rules. The forwarder never takes a port that a program on the host has on any address when the forward is made, or a port devvm records for another VM. Forwarding gives the VM no way out that it doesn&amp;rsquo;t already have, because every connection starts on the host. Lima&amp;rsquo;s own forwards listen with &lt;code&gt;SO_REUSEADDR&lt;/code&gt;, so on macOS, whenever a server in the VM starts, Lima takes &lt;code&gt;127.0.0.1:PORT&lt;/code&gt; while a program on the host has &lt;code&gt;*:PORT&lt;/code&gt;, and that program&amp;rsquo;s loopback connections go with it. That&amp;rsquo;s why Lima forwards nothing and devvm&amp;rsquo;s forwarder forwards the VM&amp;rsquo;s ports instead. On macOS, a confined VM doesn&amp;rsquo;t depend on Lima for that, because its hostagent&amp;rsquo;s sandbox refuses it every port but its ssh port, so Lima can&amp;rsquo;t forward a port of the VM&amp;rsquo;s even if it ignored its rules. The emulation is reviewed, with the threat check&amp;rsquo;s findings fixed or listed below, which is why the host key read is capped, reports are paced and the log is limited, and the end-to-end checks prove the rest.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima&amp;rsquo;s forwards off.&lt;/strong&gt; Each VM&amp;rsquo;s &lt;code&gt;portForwards&lt;/code&gt; holds three ignore rules, each for every guest port and protocol (&lt;code&gt;any&lt;/code&gt;, which is TCP and UDP). They&amp;rsquo;re on &lt;code&gt;127.0.0.1&lt;/code&gt;, which Lima also matches for &lt;code&gt;::1&lt;/code&gt;, on &lt;code&gt;0.0.0.0&lt;/code&gt; and on &lt;code&gt;::&lt;/code&gt;, which together match servers on all addresses. They come ahead of Lima&amp;rsquo;s own last rule, which forwards everything. &lt;code&gt;CreateVM&lt;/code&gt; sets them with &lt;code&gt;limactl clone --set&lt;/code&gt;. &lt;code&gt;Start&lt;/code&gt; sets them only where &lt;code&gt;limactl list&lt;/code&gt; shows other rules, because an edit gives the VM new host keys at its next boot. Lima&amp;rsquo;s ssh is its VM driver&amp;rsquo;s forward (&lt;code&gt;ssh.localPort&lt;/code&gt;), not a rule, so the ignore rules leave it alone, and they cover the guest&amp;rsquo;s own ssh port like any other.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sandbox&amp;rsquo;s binds (macOS, confined tiers).&lt;/strong&gt; The hostagent of a confined VM runs under a Seatbelt profile (&lt;a href="https://next.devvm.dev/docs/internals/lima/#confinement"&gt;confinement&lt;/a&gt;) that denies every network bind but two kinds. It may bind the VM&amp;rsquo;s ssh port over TCP, which devvm chooses and records in the VM&amp;rsquo;s state (the &lt;code&gt;ports&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;host.ssh&lt;/code&gt;), and unix sockets in the VM&amp;rsquo;s Lima folder, which hold the hostagent&amp;rsquo;s own socket (&lt;code&gt;ha.sock&lt;/code&gt;), the VM&amp;rsquo;s network (&lt;code&gt;default_ep.sock&lt;/code&gt;, &lt;code&gt;default_fd.sock&lt;/code&gt;) and ssh&amp;rsquo;s control socket. Seatbelt matches a bind by its port alone, on any address, even when the rule names &lt;code&gt;localhost&lt;/code&gt;, and it can&amp;rsquo;t allow an ephemeral bind (port 0) without allowing every port. It matches a unix socket by its path with links resolved, so a link in the Lima folder doesn&amp;rsquo;t let the hostagent bind a socket elsewhere. Lima&amp;rsquo;s host resolver binds two ephemeral ports for its DNS server, so a confined VM starts with the resolver off and &lt;code&gt;127.0.0.1&lt;/code&gt; as its DNS server, as on Linux, where nothing listens and lookups fail at once. The hostagent reaches the guest agent over vsock, which needs no bind. This list comes from starting a VM under a profile that reported every bind, then under one that denied the rest: Lima logs a forward it&amp;rsquo;s refused (&lt;code&gt;failed to listen&lt;/code&gt;) and carries on, while a refused resolver ends the start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which ports.&lt;/strong&gt; Which ports each VM forwards, all, none or a list, is in its state (&lt;code&gt;ports.forward&lt;/code&gt;), and the backend never hears of them: neither &lt;code&gt;Start&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Want&lt;/code&gt; nor any other call of the backend&amp;rsquo;s has them. &lt;code&gt;vmssh.Forwards.Start&lt;/code&gt;, the one owner of the forwarder, reads them from the VM&amp;rsquo;s state each time it starts one, after a start of the VM and when &lt;code&gt;devvm ports&lt;/code&gt; changes a running VM&amp;rsquo;s ports, without editing Lima&amp;rsquo;s config. A stopped VM&amp;rsquo;s change is its state&amp;rsquo;s alone, because its next start reads it. When the VM lists ports, the forwarder forwards those less the ports a program on the host has, which the owner leaves out with a &lt;code&gt;ports_taken&lt;/code&gt; warning. When none is left, no forwarder runs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forwarder per VM, on the host.&lt;/strong&gt; The forwarder is &lt;code&gt;vmssh.Forwarder&lt;/code&gt;, which isn&amp;rsquo;t a backend&amp;rsquo;s. Its owner, &lt;code&gt;vmssh.Forwards&lt;/code&gt;, runs it detached as &lt;code&gt;devvm _ports&lt;/code&gt;, one per VM, for project VMs alone, because only a project VM&amp;rsquo;s start goes through it, and builds&amp;rsquo; starts don&amp;rsquo;t. The owner starts it once the backend&amp;rsquo;s &lt;code&gt;Start&lt;/code&gt; returns, and again on a running VM when its ports change, each after stopping any forwarder the VM had, which ends the connections open through it. devvm finds that one by its pid file, which it checks against the process&amp;rsquo;s arguments, as it does for the proxy. It sends that forwarder SIGTERM and kills it if it hasn&amp;rsquo;t ended within 2 s, so its ports are free before devvm asks which listed ports a host program has. devvm holds a lock of the VM&amp;rsquo;s own (&lt;code&gt;ports.lock&lt;/code&gt;, beside its pid file &lt;code&gt;ports.pid&lt;/code&gt; in the VM&amp;rsquo;s run folder) from stopping the old forwarder until the new one has started, so two devvm runs at once, such as a start and &lt;code&gt;devvm ports&lt;/code&gt;, leave one forwarder, the one its pid file names. The owner waits up to 10 s for the forwarder to say it forwards while it runs. The forwarder says so in a status file of its own beside its pid file (&lt;code&gt;ports.status&lt;/code&gt;), which holds its pid and which devvm removes before each start. If it doesn&amp;rsquo;t, devvm warns with &lt;code&gt;ports_forward_failed&lt;/code&gt;, naming its log, and leaves it to keep trying while the VM runs on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reaching the VM.&lt;/strong&gt; The forwarder makes one ssh connection, a master (&lt;code&gt;ssh -F none -M -S &amp;lt;socket&amp;gt;&lt;/code&gt;), to the VM&amp;rsquo;s sshd on Lima&amp;rsquo;s ssh port on the host&amp;rsquo;s loopback. Lima&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt; gives the port with the user and the key, the first &lt;code&gt;IdentityFile&lt;/code&gt; of Lima&amp;rsquo;s ssh config, and devvm refuses that target unless the config names &lt;code&gt;127.0.0.1&lt;/code&gt; (&lt;code&gt;vmssh.FromTarget&lt;/code&gt;, the check links and the ssh config use too). It logs in as Lima&amp;rsquo;s user with Lima&amp;rsquo;s key alone (&lt;code&gt;IdentitiesOnly&lt;/code&gt;, &lt;code&gt;IdentityAgent=none&lt;/code&gt;), &lt;code&gt;_config/user&lt;/code&gt; in devvm&amp;rsquo;s Lima home, which every VM there authorizes, and never with the user&amp;rsquo;s agent. The master reads none of the user&amp;rsquo;s configuration and forwards nothing either way, with &lt;code&gt;ClearAllForwardings&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen none&lt;/code&gt;, &lt;code&gt;ProxyCommand none&lt;/code&gt;, and no agent, X11 or tunnel. The VM&amp;rsquo;s sshd allows local forwarding, and remote forwards only to &lt;code&gt;127.77.0.0/16&lt;/code&gt; for &lt;a href="#links-between-vms"&gt;links&lt;/a&gt; (&lt;code&gt;base.sh&lt;/code&gt;), and &lt;code&gt;-W&lt;/code&gt; is local forwarding. Its control socket is in &lt;code&gt;~/.local/share/devvm/run&lt;/code&gt; (mode 700) and is named by a hash of the VM&amp;rsquo;s name, because a socket&amp;rsquo;s path has fewer than 104 characters. When the connection is lost, the forwarder closes its forwards and makes the connection again every 2 s while the lifeline holds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What listens.&lt;/strong&gt; The master&amp;rsquo;s session runs &lt;code&gt;ports.sh&lt;/code&gt; (&lt;code&gt;assets/guest/ports.sh&lt;/code&gt;) as the VM&amp;rsquo;s user (&lt;code&gt;sh -s&lt;/code&gt;). It prints the local addresses of the VM&amp;rsquo;s listening TCP sockets, which are the state &lt;code&gt;0A&lt;/code&gt; lines of &lt;code&gt;/proc/net/tcp&lt;/code&gt; and &lt;code&gt;tcp6&lt;/code&gt;, whenever they change and every 10 s regardless, so it ends soon after the connection does. The forwarder treats the report as untrusted. A line over 128 bytes or a report over 4096 lines ends the connection, and anything that isn&amp;rsquo;t a hex address and port is skipped. Reports are applied at least 500 ms apart, and one that comes sooner waits, holding up the VM&amp;rsquo;s ssh channel with it, so the VM can&amp;rsquo;t make the forwarder bind, dial and read devvm&amp;rsquo;s state at its own pace. The VM can make the forwarder write to its log, with ports coming and going and with the session&amp;rsquo;s stderr, so the log takes 200 writes at once and then one every 10 s. Each write is at most 512 bytes, without control characters other than newlines and tabs, C1 included, and the log is rotated before it passes 1 MiB, its end kept in &lt;code&gt;ports.log.1&lt;/code&gt;. A forwarded port&amp;rsquo;s connections go to &lt;code&gt;127.0.0.1&lt;/code&gt; for a server on all IPv4 addresses or on that address, and to &lt;code&gt;::1&lt;/code&gt; for a server on all IPv6 addresses or on that address. A server on another &lt;code&gt;127.x&lt;/code&gt; address alone gets its connections there. Servers on other addresses alone aren&amp;rsquo;t forwarded.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How many.&lt;/strong&gt; With every port, the forwarder takes ports from 1024 up, because the ports below are the host&amp;rsquo;s system services. With listed ports, it takes those alone (&lt;code&gt;-only&lt;/code&gt;), a listed port below 1024 included, because the user asked for it, and a bind the host refuses is logged. Either way the forwarder takes at most 256 ports at once (&lt;code&gt;vmssh.MaxForwards&lt;/code&gt;). It records why it couldn&amp;rsquo;t take each port in &lt;code&gt;ports.forwarded&lt;/code&gt;, by the bind&amp;rsquo;s error: in use (&lt;code&gt;EADDRINUSE&lt;/code&gt;), past its limit, or refused (&lt;code&gt;EACCES&lt;/code&gt; or &lt;code&gt;EPERM&lt;/code&gt;, such as below 1024 on Linux), and &lt;code&gt;devvm ports&lt;/code&gt; warns each with its own message (&lt;code&gt;ports_taken&lt;/code&gt;, &lt;code&gt;ports_limit&lt;/code&gt;, &lt;code&gt;ports_refused&lt;/code&gt;). Any other error, such as &lt;code&gt;EMFILE&lt;/code&gt;, &lt;code&gt;ENOBUFS&lt;/code&gt; or &lt;code&gt;EADDRNOTAVAIL&lt;/code&gt;, says nothing about the port, so it&amp;rsquo;s logged, not recorded, and the port is tried again at the next report, the log&amp;rsquo;s limit capping the repeats. A port past the limit is tried again at the next report once the forwarder forwards fewer. A record from before the reasons, whose third line holds every port it couldn&amp;rsquo;t take, is read as giving no reason, so it warns of none rather than call a refused port in use. It reads the reserved ports (below) again with each report, and while it can&amp;rsquo;t read them, it takes no new port and keeps those it has. A port it has that has since become reserved, such as one another VM&amp;rsquo;s start has chosen, is given up at that report, though the VM still listens on it, and also within 10 s on the host&amp;rsquo;s own clock (&lt;code&gt;Forwarder.Recheck&lt;/code&gt;), whether or not the VM reports, so a VM that holds its session open and stays silent can&amp;rsquo;t keep it. A reserved port the VM listens on waits and is tried again at each report until it&amp;rsquo;s no longer reserved. A port that a host program has, or that the host refused, is tried again only once the VM&amp;rsquo;s server on it goes and comes back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Listening.&lt;/strong&gt; The forwarder listens on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;, or on IPv4 alone on a host without IPv6, which a bind on &lt;code&gt;::1&lt;/code&gt; reports as &lt;code&gt;EADDRNOTAVAIL&lt;/code&gt;, &lt;code&gt;EAFNOSUPPORT&lt;/code&gt; or &lt;code&gt;EPROTONOSUPPORT&lt;/code&gt;. &lt;code&gt;EACCES&lt;/code&gt; or &lt;code&gt;EPERM&lt;/code&gt; on &lt;code&gt;::1&lt;/code&gt; alone, with &lt;code&gt;127.0.0.1&lt;/code&gt; bound, also gives IPv4 alone, with a line in the log, because that&amp;rsquo;s a host denying IPv6 rather than a port it refuses. Any other error on &lt;code&gt;::1&lt;/code&gt; closes the port&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; listener and counts as that bind&amp;rsquo;s error would on &lt;code&gt;127.0.0.1&lt;/code&gt;, recorded or tried again at the next report as the bullet above says, so a passing error such as &lt;code&gt;EMFILE&lt;/code&gt; never leaves a forward on IPv4 alone until its port is opened again. It binds without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; (&lt;code&gt;platform.ListenExclusive&lt;/code&gt;). With that option, which Go and Lima set, macOS lets a socket take &lt;code&gt;127.0.0.1:PORT&lt;/code&gt; while a program has &lt;code&gt;*:PORT&lt;/code&gt;, and that program&amp;rsquo;s loopback connections go with it. Without the option, the bind is refused when another program has the port on any address. This was checked on macOS for a program on &lt;code&gt;0.0.0.0&lt;/code&gt;, on &lt;code&gt;::&lt;/code&gt; (IPv4 and IPv6 at once, as Node&amp;rsquo;s and Go&amp;rsquo;s servers listen), on IPv6 alone and on &lt;code&gt;127.0.0.1&lt;/code&gt;, each with and without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; of its own. A port held only by ended connections (&lt;code&gt;TIME_WAIT&lt;/code&gt;, with nothing answering on it) is taken as usual, so a server that restarts gets its forward back. When a bind is refused, the forwarder dials the port and takes it only if the dial is refused. A full backlog times out, which counts as taken. A port the forwarder took on &lt;code&gt;127.0.0.1&lt;/code&gt; but finds in use on &lt;code&gt;::1&lt;/code&gt; is given up, so &lt;code&gt;localhost&lt;/code&gt; never reaches two programs. On Linux, &lt;code&gt;SO_REUSEADDR&lt;/code&gt; stays on. Linux refuses that bind with the option too while another socket listens on the port, and without it, the forwarder&amp;rsquo;s own ended connections (&lt;code&gt;TIME_WAIT&lt;/code&gt;) would keep anyone from listening on the port for a minute, its next forwarder included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each connection.&lt;/strong&gt; Each forwarded connection is a channel of the master&amp;rsquo;s (&lt;code&gt;ssh -S &amp;lt;socket&amp;gt; -W HOST:PORT&lt;/code&gt;), with one process per connection and at most 256 at once. The VM&amp;rsquo;s sshd opens it to the VM&amp;rsquo;s own loopback from inside the VM. The channel&amp;rsquo;s ssh has the master&amp;rsquo;s options. If the master is gone, ssh connects on its own, and it then reaches the VM&amp;rsquo;s sshd the same way, never the host&amp;rsquo;s. Each relay&amp;rsquo;s ssh runs with a context of its own, which closing its forward cancels, so the ssh is killed with the forward even when the VM never ends its channel. &lt;code&gt;pipeSSH&lt;/code&gt;, which carries every relay of the forwarder&amp;rsquo;s, the link sessions&amp;rsquo; and a login&amp;rsquo;s callback, also cancels that context once the client on the host has closed its side and the VM has sent nothing for 30 seconds (&lt;code&gt;relayGrace&lt;/code&gt;), and once the client can take nothing more and the ssh hasn&amp;rsquo;t exited within 30 seconds. Each write of the VM&amp;rsquo;s bytes to the client starts the grace again once it&amp;rsquo;s done, and the grace doesn&amp;rsquo;t run while that write waits for the client, so a client that closes for writing alone and waits still gets an answer the VM keeps sending, however slowly it reads. The VM must send something at least every 30 seconds, its first byte included, so a client that half-closes and waits longer than that for a first byte, such as &lt;code&gt;nc -N&lt;/code&gt; in front of a slow query, is cut. The timer (&lt;code&gt;graceTimer&lt;/code&gt;) runs only once the client&amp;rsquo;s side has closed, or once the copy to the client has ended, with a write that failed or the VM&amp;rsquo;s EOF, and a relay that ends stops it for good, so the client&amp;rsquo;s goroutine, which can outlive the relay, never starts it again. The relay&amp;rsquo;s own context, its owner&amp;rsquo;s, also closes the client&amp;rsquo;s connection when it ends, so a write that waits on a client that stopped reading ends with its forward, its link or &lt;code&gt;LoopbackForward.Close&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reserved ports.&lt;/strong&gt; The forwarder never takes the VM&amp;rsquo;s own Lima ssh port, which Lima&amp;rsquo;s &lt;code&gt;SSH&lt;/code&gt; names, or its proxy port, which its state records, and the owner passes both as &lt;code&gt;-reserve&lt;/code&gt;. It also never takes the ssh, proxy and desktop ports devvm chooses and records in any VM&amp;rsquo;s state, the ports another VM&amp;rsquo;s running forwarder forwards now, as its &lt;code&gt;ports.forwarded&lt;/code&gt; record says, or the ports another VM lists while it has a claim on them, which is while its forwarder runs or while devvm holds its &lt;code&gt;ports.lock&lt;/code&gt; to start one again, unless this VM lists them too (&lt;code&gt;ports.Reserved&lt;/code&gt;). A stopped VM&amp;rsquo;s listed ports aren&amp;rsquo;t reserved from other VMs&amp;rsquo; forwarders, but the ports devvm chooses still avoid them (&lt;code&gt;ports.Used&lt;/code&gt;). Every Lima VM&amp;rsquo;s ssh port is one of those, whatever its tier: devvm chooses it when it makes the VM, sets it with &lt;code&gt;limactl clone --set .ssh.localPort&lt;/code&gt;, and records it in the VM&amp;rsquo;s &lt;code&gt;ports&lt;/code&gt; section before the clone (&lt;code&gt;ports.Allocator.SSH&lt;/code&gt;). One allocator, &lt;code&gt;ports.Allocator&lt;/code&gt;, chooses every host port devvm chooses, the ssh, proxy and desktop ports, and records it while it holds the VM&amp;rsquo;s lock and then the claims lock (&lt;code&gt;run/claims.lock&lt;/code&gt;, &lt;code&gt;state.VM.Claim&lt;/code&gt;) until the VM&amp;rsquo;s state is written, so two devvm commands making or starting VMs at once never choose the same one. A build VM has no state, so devvm chooses its ssh port too, on every host, through the same allocator (&lt;code&gt;ports.Allocator.Build&lt;/code&gt;), under the claims lock alone (&lt;code&gt;state.Claims&lt;/code&gt;), and on macOS the build&amp;rsquo;s Seatbelt profile names that port. It records the port by the build VM&amp;rsquo;s name (&lt;code&gt;run/build-ports/&amp;lt;name&amp;gt;&lt;/code&gt;), where &lt;code&gt;ports.Used&lt;/code&gt; reads it, until &lt;code&gt;limactl start&lt;/code&gt; returns, and by then Lima has bound the port or the start has failed. The devvm that starts the build holds a file lock on that record until then, and the kernel lets go of the lock when that devvm ends, even when it&amp;rsquo;s killed. Each time devvm chooses a port, under the claims lock, it first deletes the records whose lock no process holds and that are over 15 minutes old. The age matters because a killed devvm leaves its &lt;code&gt;limactl start&lt;/code&gt; running, which may still bind the port for up to Lima&amp;rsquo;s 10 minutes of waiting for the VM&amp;rsquo;s ssh. So a devvm killed while its build VM starts reserves that port for 15 minutes, and then only until the next port is chosen. A stopped VM gets a new one only when a program on the host has its port on any address, even one that accepts no connections, or when the VM lists it to forward, and its start then sets it with an edit. Lima binds the port only once the VM boots, a few seconds after its start, so a port Lima picked itself would be free for another VM&amp;rsquo;s forwarder in that window, and Lima&amp;rsquo;s own ssh, which checks no host key, would then reach the other VM (the threat check below).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The host key.&lt;/strong&gt; devvm keeps one record of a VM&amp;rsquo;s host keys for each of its starts, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/known_hosts&lt;/code&gt; (&lt;code&gt;vmssh.PinHostKeys&lt;/code&gt;). It removes the record before each start and reads the keys once the VM runs, whatever ports the VM forwards, and a command that finds the VM running without a record of its current start reads them too (&lt;code&gt;starter.pinHostKeys&lt;/code&gt;). It reads them through &lt;code&gt;limactl shell&lt;/code&gt;, at most 64 KiB for at most 30 s, keeping only lines whose key decodes and names its own type (&lt;code&gt;vmssh.ParseHostKeys&lt;/code&gt;). The record&amp;rsquo;s first line names the start it was read for (&lt;code&gt;backend.Run.ID&lt;/code&gt;), so a record of another start, such as one before a &lt;code&gt;limactl start&lt;/code&gt; outside devvm, is read again, and keys read while the VM started again aren&amp;rsquo;t recorded. The forwarder checks the VM against that record, with &lt;code&gt;HostKeyAlias&lt;/code&gt; and &lt;code&gt;StrictHostKeyChecking yes&lt;/code&gt;, as the ssh config, links&amp;rsquo; sessions and a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s git do. All of them reach the VM through one function, &lt;code&gt;vmssh.Checked&lt;/code&gt;, which checks the backend&amp;rsquo;s ssh and adds the record: the forwarder and the ssh config pin the keys when the record is another start&amp;rsquo;s, and links&amp;rsquo; sessions and git take only a record of the current start. The pin keeps the forwarder from talking to a program on the host that takes the ssh port. It doesn&amp;rsquo;t guard against the VM itself, which is already the other end of the connection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its lifeline.&lt;/strong&gt; The forwarder follows the hostagent&amp;rsquo;s pid file (&lt;code&gt;ha.pid&lt;/code&gt;, the lifeline Lima&amp;rsquo;s &lt;code&gt;Running&lt;/code&gt; gives), as the proxy does, and exits once the file is gone, holds anything else, or its process is gone. &lt;code&gt;devvm stop&lt;/code&gt; stops it with the VM, and &lt;code&gt;devvm rm&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop it before they delete its files with the VM&amp;rsquo;s folder. A VM that stops some other way, such as when its self-check fails or a restart stops it, ends its forwarder through the lifeline, and the next start stops any forwarder that&amp;rsquo;s left before it starts its own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What keeps a forward from carrying the VM out:&lt;/strong&gt; every connection starts on the host. A program connects to the forwarder&amp;rsquo;s port, and the forwarder asks the VM&amp;rsquo;s sshd to connect to the VM&amp;rsquo;s loopback. The VM opens nothing to the host through the forwarder, because the master asks for no remote forward, agent, X11 or tunnel, and OpenSSH&amp;rsquo;s client refuses a channel that the server opens unasked, whatever sshd root in the VM runs. The only remote forwards devvm asks a VM for are a client&amp;rsquo;s links, on a link session that is a connection of its own, never the forwarder&amp;rsquo;s master (&lt;a href="#links-between-vms"&gt;links&lt;/a&gt;). What the VM sends back goes to the program that connected, as with any forward. On a confined tier, the VM&amp;rsquo;s own connections stay confined by Seatbelt or QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt;, while the forwarder runs on the host as devvm, outside the hostagent&amp;rsquo;s sandbox.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; OpenSSH&amp;rsquo;s client refusing unrequested channels and honoring &lt;code&gt;-F none&lt;/code&gt;, the kernel refusing a bind without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; where another socket has the port (checked on macOS), devvm&amp;rsquo;s state listing every VM&amp;rsquo;s ports, each running forwarder&amp;rsquo;s record of the ports it forwards, and the forwarders&amp;rsquo; pid files and locks saying which VMs have a claim on their listed ports. It also relies on Lima binding its ssh forward on the host&amp;rsquo;s loopback alone, on the host key that devvm pins at the start, and on Lima honoring the ignore rules ahead of its own rule. On macOS, a confined VM relies on Seatbelt refusing the hostagent&amp;rsquo;s binds instead of on the rules, and on the Virtualization framework&amp;rsquo;s own process, which runs outside the profile, binding nothing: the VM&amp;rsquo;s network goes through the hostagent&amp;rsquo;s unix sockets.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a Lima release that forwards despite the ignore rules, or that forwards from somewhere other than &lt;code&gt;portForwards&lt;/code&gt;. On macOS, a confined VM keeps the guarantee even then, because its sandbox refuses the binds. An open VM, and every VM on Linux, where QEMU&amp;rsquo;s &lt;code&gt;restrict=on&lt;/code&gt; doesn&amp;rsquo;t cover the hostagent&amp;rsquo;s own binds, still relies on Lima honoring the rules. A Lima release that needs a new bind for a confined VM, such as a resolver that can&amp;rsquo;t be turned off, fails its start closed, and Lima&amp;rsquo;s log names the refused bind. The end-to-end checks look at the rules, and use &lt;code&gt;lsof&lt;/code&gt; or &lt;code&gt;ss&lt;/code&gt; to check that the hostagent has no TCP or UDP port of the VM&amp;rsquo;s and that a host program keeps its port. A program on the host could take Lima&amp;rsquo;s ssh port while the VM is stopped, and the pinned host key refuses it. Lima&amp;rsquo;s key logs in to every VM in devvm&amp;rsquo;s Lima home, as it does for Lima&amp;rsquo;s own ssh, but public key authentication never sends the key to the VM.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion; the sandbox&amp;rsquo;s binds and the ssh port). Leads, each confirmed and fixed, ruled out, or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Another VM answering for this one&amp;rsquo;s ssh:&lt;/strong&gt; confirmed, fixed. An ssh port that Lima picks at a VM&amp;rsquo;s start, and binds once the VM boots, is one devvm doesn&amp;rsquo;t record, so no forwarder reserves it. Another VM forwarding every port, with a server on that port in the window, has its forward take it. Lima then carries on with its other ssh forward and waits on the port (seen with a host program holding it), and Lima&amp;rsquo;s own ssh checks no host key (&lt;code&gt;StrictHostKeyChecking no&lt;/code&gt;), so &lt;code&gt;limactl shell&lt;/code&gt;, the host keys devvm reads and pins after the start, and devvm&amp;rsquo;s setup and shell would reach the other VM. The fix: each VM&amp;rsquo;s ssh port is devvm&amp;rsquo;s, whatever its tier, recorded before the clone and reserved by every forwarder. It&amp;rsquo;s unit-tested and checked by the CLI tests, and end to end, the port a VM&amp;rsquo;s state records is the one Lima listens on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A guest port bound around the rules:&lt;/strong&gt; ruled out on macOS on a confined tier. Lima forwards a port only by binding it on the host, and the sandbox refuses every port but the ssh port. End to end, with Lima&amp;rsquo;s own rule put back for one start inside the sandbox, Lima tries the guest&amp;rsquo;s TCP and UDP ports, is refused (&lt;code&gt;operation not permitted&lt;/code&gt;), and has no port but its ssh port, while devvm&amp;rsquo;s forwarder forwards the TCP port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The ssh port on every address:&lt;/strong&gt; listed. Seatbelt allows the ssh port on any address, so a Lima that bound it on &lt;code&gt;0.0.0.0&lt;/code&gt; would put the VM&amp;rsquo;s sshd on the network, where it still takes only keys. Lima binds it on &lt;code&gt;127.0.0.1&lt;/code&gt;, and the end-to-end checks look at the hostagent&amp;rsquo;s listeners. The rule allows the port over TCP alone, so the guest&amp;rsquo;s UDP server on that port number can&amp;rsquo;t get a forward from it; checked end to end.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A program holding a stopped VM&amp;rsquo;s ssh port:&lt;/strong&gt; ruled out, but for a race. A start looks for the recorded port with a bind on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; as well as a connection, so a program that has the port on any address, even one that accepts no connections, gives the VM a new port. Only a program that takes the port between that check and Lima&amp;rsquo;s bind, a few seconds later, gets Lima&amp;rsquo;s ssh, which is listed under not covered below. End to end, a VM whose port a host program holds starts on a new one, recorded, and the program keeps its own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two VMs choosing the same ssh port:&lt;/strong&gt; confirmed, fixed. Without a lock, two devvm commands making VMs at once could each choose the same port from the ports other VMs record, and the second VM&amp;rsquo;s Lima would wait on a port that the first one&amp;rsquo;s has. devvm chooses and records a port while it holds the claims lock, &lt;code&gt;run/claims.lock&lt;/code&gt; in its data folder, after the VM&amp;rsquo;s own lock (&lt;a href="https://next.devvm.dev/docs/internals/overview/#locks"&gt;locks&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A build VM&amp;rsquo;s ssh port:&lt;/strong&gt; confirmed, fixed. A port that Lima picked at a build&amp;rsquo;s start would be one that no VM&amp;rsquo;s state records, so another VM forwarding every port could take it in the window before Lima binds it, and Lima&amp;rsquo;s ssh would then run the build&amp;rsquo;s scripts in that VM. The fix: devvm chooses every build VM&amp;rsquo;s ssh port, on macOS and Linux, under the claims lock, and records it in &lt;code&gt;run/build-ports/&amp;lt;name&amp;gt;&lt;/code&gt;, which every forwarder reserves, until the build VM&amp;rsquo;s start returns. A record that a killed devvm leaves is deleted the first time devvm chooses a port once the record is 15 minutes old, because no process holds its lock, and until then it keeps the port from any VM while the start that the killed devvm left may still bind it. Builds carry no credentials, an image is the build VM&amp;rsquo;s own disk, and a tool build writes its images through a folder that only its own VM mounts, so even a VM that reached a build&amp;rsquo;s ssh another way could break that build but couldn&amp;rsquo;t learn a secret from it or choose what an image or a tool image holds. It&amp;rsquo;s unit-tested on both systems, and the CLI tests check that a build&amp;rsquo;s start sets the port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A browser reaching a VM&amp;rsquo;s ssh port:&lt;/strong&gt; confirmed, fixed. Lima listens on the ssh port on this machine&amp;rsquo;s loopback, and root in the VM can make what answers on port 22 speak HTTP, so a page opened as &lt;code&gt;http://localhost:PORT&lt;/code&gt;, by a link or by a VM that opens URLs, would reach a server the VM controls with the cookies of the apps you use on &lt;code&gt;localhost&lt;/code&gt;, even in a VM that forwards no ports. The fix is that every VM&amp;rsquo;s ssh port, and every build VM&amp;rsquo;s, is one of the Fetch standard&amp;rsquo;s bad ports from 1024 up that Chromium&amp;rsquo;s &lt;code&gt;kRestrictedPorts&lt;/code&gt; also blocks (&lt;code&gt;ports.SSHPorts&lt;/code&gt;, 17 of them, because Chromium lacks 4190 and 6679, which headless Chrome 157 loads). Every browser engine refuses every request to these ports, navigations and WebSockets included. The one allocator chooses them (&lt;code&gt;ports.Allocator.SSH&lt;/code&gt; and &lt;code&gt;Build&lt;/code&gt;, through &lt;code&gt;freeSSH&lt;/code&gt;), its other ports never take one, and a proxy or desktop port that an older devvm chose there moves at the VM&amp;rsquo;s next start. No forwarder takes one unless its VM lists it (&lt;code&gt;ports.Reserved&lt;/code&gt;), so a guest forwarding every port can&amp;rsquo;t fill them, and a stopped VM&amp;rsquo;s listed ports don&amp;rsquo;t keep them from a start. That allows at most 17 running VMs, and a start past that fails with &lt;code&gt;ports_ssh_limit&lt;/code&gt; or &lt;code&gt;ports_ssh_limit_all&lt;/code&gt;, naming the VMs whose ports are in use, or &lt;code&gt;ports_ssh_limit_others&lt;/code&gt;. An older devvm&amp;rsquo;s VM moves onto the list at its next start, in the start&amp;rsquo;s one &lt;code&gt;limactl edit&lt;/code&gt;, and each launch warns of a running VM still on an old port (&lt;code&gt;ports_ssh_old&lt;/code&gt;). A start holds its port, kept or new, for a minute (&lt;code&gt;run/ports.ssh-hold&lt;/code&gt; in the VM&amp;rsquo;s folder), because a stopped VM&amp;rsquo;s port that it keeps would otherwise look free to another start in the window before Lima binds it. The hold is time-limited, so a backend that takes over a minute to bind can lose the port to another start and fail, and its next start gets another. It&amp;rsquo;s unit-tested (&lt;code&gt;TestSSHPorts&lt;/code&gt;, &lt;code&gt;TestSSH&lt;/code&gt;, &lt;code&gt;TestSSHHolds&lt;/code&gt;, &lt;code&gt;TestSSHListed&lt;/code&gt;, &lt;code&gt;TestOffList&lt;/code&gt;, &lt;code&gt;TestBuild&lt;/code&gt;, &lt;code&gt;TestReserved&lt;/code&gt;, &lt;code&gt;TestStartBuildSSHPort&lt;/code&gt;, &lt;code&gt;TestPrepareRestartsTheProxy&lt;/code&gt;, &lt;code&gt;TestDesktopListener&lt;/code&gt;), checked by the CLI tests (&lt;code&gt;ssh_ports&lt;/code&gt;, the frozen 0.1.0 fixture&amp;rsquo;s launches), and end to end each VM&amp;rsquo;s ssh port is on the list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a failed start or create leaves:&lt;/strong&gt; ruled out. A VM whose create fails, other than by an interrupt, keeps its state, and with it its recorded port, until &lt;code&gt;devvm rm&lt;/code&gt; deletes it, so the port stays reserved and nothing else takes it. &lt;code&gt;devvm rm&lt;/code&gt; deletes the state, which frees the port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unix sockets:&lt;/strong&gt; ruled out as a way out. The hostagent binds them only in the VM&amp;rsquo;s Lima folder, which only Lima&amp;rsquo;s own commands and devvm use.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS around the proxy:&lt;/strong&gt; ruled out. With Lima&amp;rsquo;s resolver off, the guest&amp;rsquo;s DNS server is &lt;code&gt;127.0.0.1&lt;/code&gt;, which &lt;a href="#transparent-mode"&gt;transparent mode&lt;/a&gt;&amp;rsquo;s dnsmasq answers inside the VM with one stand-in address and no upstream, or nothing answers when it&amp;rsquo;s off, and Lima&amp;rsquo;s network&amp;rsquo;s DNS address and the host&amp;rsquo;s address on it answer nothing even when root asks them directly with transparent mode stopped, because the sandbox denies the hostagent the host&amp;rsquo;s DNS service and every connection but the proxy&amp;rsquo;s; checked end to end, with transparent mode stopped and running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A compromised hostagent:&lt;/strong&gt; listed. The bind rules stop a Lima that misbehaves, not code an attacker runs in it, which the profile still lets read and write your files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starts without the sandbox:&lt;/strong&gt; listed. Only confined starts on macOS run under it. A build keeps Lima&amp;rsquo;s host resolver, so its binds aren&amp;rsquo;t denied, and an open VM starts unconfined. Such a VM could run under a profile that denies binds alone, as its ssh port is fixed, but it would need Lima&amp;rsquo;s resolver off too, which changes how it resolves names (the user-mode network&amp;rsquo;s own DNS instead of the host&amp;rsquo;s resolver), so that&amp;rsquo;s proposed rather than done.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check for listed ports&lt;/strong&gt; (the security-audit skill, its local IPC companion). Listed ports use the same forwarder with &lt;code&gt;-only&lt;/code&gt;, so these leads are what listed ports add, each confirmed or ruled out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A port the VM chooses:&lt;/strong&gt; ruled out. &lt;code&gt;-only&lt;/code&gt; comes from the VM&amp;rsquo;s state, less the ports a host program has, both read on the host by the forwarder&amp;rsquo;s owner, and the VM&amp;rsquo;s reports can&amp;rsquo;t add to it. A listed port is forwarded only while a server in the VM listens on it, as with every port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Port 22 listed:&lt;/strong&gt; ruled out as a collision. Port 22 in the VM is its sshd, and Lima&amp;rsquo;s ssh forward comes from another host port, so a listed 22 forwards the VM&amp;rsquo;s sshd to the host&amp;rsquo;s port 22 as it would forward any server. The VM&amp;rsquo;s sshd still takes only keys. A host whose own sshd has port 22 keeps it, with a &lt;code&gt;ports_taken&lt;/code&gt; warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A listed proxy port:&lt;/strong&gt; ruled out. The forwarder reserves the VM&amp;rsquo;s own proxy port whether or not it&amp;rsquo;s listed, and every other VM&amp;rsquo;s as well.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A listed port below 1024:&lt;/strong&gt; taken because the user asked for it. A host service that has the port keeps it, and a bind the host refuses is logged and recorded as refused, never as in use, so &lt;code&gt;devvm ports&lt;/code&gt; warns &lt;code&gt;ports_refused&lt;/code&gt; rather than &lt;code&gt;ports_taken&lt;/code&gt;. One that isn&amp;rsquo;t running yet is under &lt;strong&gt;Not covered&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forwarder left behind:&lt;/strong&gt; ruled out. &lt;code&gt;devvm stop&lt;/code&gt; stops it, &lt;code&gt;devvm rm&lt;/code&gt; stops it and removes its files, any other stop ends it through its lifeline, and a start or change whose listed ports are all taken runs none. Two devvm runs that start a VM&amp;rsquo;s forwarder at once take turns on the VM&amp;rsquo;s lock, so the second stops the first one&amp;rsquo;s forwarder, and neither leaves one that its pid file doesn&amp;rsquo;t name, which nothing would stop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A tier&amp;rsquo;s confinement:&lt;/strong&gt; ruled out. Listed ports take fewer ports than every port, never more, and every connection still starts on the host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another VM takes a stopped or restarting VM&amp;rsquo;s listed port:&lt;/strong&gt; mitigated. Only a running VM holds a port, so while VM V is stopped, another VM E may forward V&amp;rsquo;s listed port, and a hostile E could then try to keep it, such as by forwarding every port and holding its ssh session open without reporting again. Three things stop that. First, the host decides when a port is given up: every forwarder closes each forward whose port is now reserved within 10 s on its own clock, whatever its VM reports, so E gives V&amp;rsquo;s port up once V runs and lists it. Closing a forward also closes every connection it accepted that&amp;rsquo;s still open, so a browser&amp;rsquo;s keep-alive connection to &lt;code&gt;localhost:5173&lt;/code&gt;, opened while E had the port, ends then too, and the browser&amp;rsquo;s later requests, with V&amp;rsquo;s cookies, never reach E over it. Second, V&amp;rsquo;s start, a change of its ports and &lt;code&gt;devvm ports&lt;/code&gt; warn with &lt;code&gt;ports_held&lt;/code&gt; and name E in &lt;code&gt;held_by&lt;/code&gt;, whether E lists the port or forwards every port, so V never waits silently. Third, V&amp;rsquo;s listed ports stay reserved while devvm holds V&amp;rsquo;s &lt;code&gt;ports.lock&lt;/code&gt;, from stopping V&amp;rsquo;s old forwarder until its new one runs, so no other VM takes them in that window. A stale &lt;code&gt;ports.forwarded&lt;/code&gt; can&amp;rsquo;t hold a port either: devvm removes it under that lock before each start, each forwarder writes an empty one when it starts, and a record counts only while its pid is the VM&amp;rsquo;s running forwarder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A relay the VM holds open:&lt;/strong&gt; confirmed, fixed. Closing a forward closed the connections it had accepted, but each connection&amp;rsquo;s ssh (&lt;code&gt;-W&lt;/code&gt;) waits for the VM&amp;rsquo;s sshd to end its channel, so a hostile VM that ignored the EOF kept that ssh process, and one of the forwarder&amp;rsquo;s 256 relays, until the forwarder ended. Up to 256 such ssh processes could pile up on the host for each VM, and the VM&amp;rsquo;s forwards would then refuse every new connection. Each relay now runs with a context of its own, which closing its forward cancels, under the forwarder&amp;rsquo;s lock as the close already runs, so the ssh is killed (&lt;code&gt;exec.CommandContext&lt;/code&gt;), and a relay that ends by itself releases its context. Unit-tested with an ssh stand-in that never exits on its own: the relay ends, its process is gone and its slot is free once the forward closes (&lt;code&gt;TestForwarderEndsStuckRelay&lt;/code&gt;), with no goroutine or file descriptor left under &lt;code&gt;-race&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A relay the VM holds open after its client has gone:&lt;/strong&gt; mitigated. While a forward lasts, a VM that ignores EOF would keep each relay whose client on the host had closed, its ssh process and one of the 256, so a hostile VM could fill the forwarder&amp;rsquo;s relays with connections a browser had already closed. Each relay&amp;rsquo;s ssh is killed once its client has closed and the VM has sent nothing for 30 seconds, or 30 seconds after the client can take nothing more, so a VM keeps such a relay only by sending to it, and only for as long as the client keeps its side open for reading. The grace doesn&amp;rsquo;t run while a write waits for a slow client, so a client that stops reading holds the relay and its ssh itself, as it could by staying open, until it reads again, closes, or the relay&amp;rsquo;s forward or link goes. Unit-tested with an ssh stand-in that never exits: a closed client&amp;rsquo;s relay and a half-closed one&amp;rsquo;s both end after the grace when the stand-in is silent, and one the stand-in keeps talking to goes on past it, while a fully closed client&amp;rsquo;s relay, and one whose writes to its client fail, end within the grace however much the stand-in sends. A half-closed client that doesn&amp;rsquo;t read for many graces still gets all of the stand-in&amp;rsquo;s answer afterwards, and a relay whose write waits on a client that stopped reading ends when its context does (&lt;code&gt;TestPipeSSHGrace&lt;/code&gt;, &lt;code&gt;TestPipeSSHGraceWriteError&lt;/code&gt;, &lt;code&gt;TestPipeSSHGraceSlowClient&lt;/code&gt;, &lt;code&gt;TestRelayGrace&lt;/code&gt;, &lt;code&gt;TestRelayGraceWriteError&lt;/code&gt;, &lt;code&gt;TestRelayGraceSlowClient&lt;/code&gt;, &lt;code&gt;TestRelayCancelEndsBlockedWrite&lt;/code&gt;, &lt;code&gt;TestGraceTimer&lt;/code&gt;). The price is a client that half-closes and waits more than 30 seconds for an answer&amp;rsquo;s first byte, which is cut.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forward on IPv4 alone:&lt;/strong&gt; ruled out except on a host without IPv6 or one that denies it. A bind on &lt;code&gt;::1&lt;/code&gt; that fails with an error that says nothing of the port, such as &lt;code&gt;EMFILE&lt;/code&gt; or &lt;code&gt;ENOBUFS&lt;/code&gt;, closes the port&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; listener, is logged, and has the port tried again at the next report, so &lt;code&gt;localhost&lt;/code&gt; never reaches the VM on one address and another program, or nothing, on the other. Only &lt;code&gt;EADDRNOTAVAIL&lt;/code&gt;, &lt;code&gt;EAFNOSUPPORT&lt;/code&gt; and &lt;code&gt;EPROTONOSUPPORT&lt;/code&gt;, a host without IPv6, give IPv4 alone, and so do &lt;code&gt;EACCES&lt;/code&gt; and &lt;code&gt;EPERM&lt;/code&gt; on &lt;code&gt;::1&lt;/code&gt; alone, logged, as a security module that denies IPv6 sockets would otherwise stop every forward. On such a host, a program that the module lets use IPv6 could still take &lt;code&gt;::1&lt;/code&gt; on a forwarded port, and &lt;code&gt;localhost&lt;/code&gt; would then reach it there, which is listed rather than refused because the alternative is no forwarding at all. Unit-tested with each error on &lt;code&gt;::1&lt;/code&gt; (&lt;code&gt;TestForwarderIPv6Failures&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forward&amp;rsquo;s listener out of files:&lt;/strong&gt; confirmed, fixed. The loop that accepts a forward&amp;rsquo;s connections ended at any error, &lt;code&gt;EMFILE&lt;/code&gt; included, while its listener stayed open, so a burst that ran the forwarder out of open files left that port taking connections that nothing answered until the forward went. The fix is that it tries again after a wait that starts at 5 ms and doubles with each failure in a row, up to a second, and logs only the first failure of a run (&lt;code&gt;daemon.AcceptRetry&lt;/code&gt;), as the link session, a login&amp;rsquo;s forward and the proxy&amp;rsquo;s SSH agent relay do. A login&amp;rsquo;s forward also carries at most 16 connections at once, an ssh process each (&lt;code&gt;TestAcceptRetry&lt;/code&gt;, &lt;code&gt;TestForwarderAcceptRetries&lt;/code&gt;, &lt;code&gt;TestLinksAcceptRetries&lt;/code&gt;, &lt;code&gt;TestForwardLoopbackLimit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Channels the VM never closes in the master:&lt;/strong&gt; listed. A hostile VM that never sends CLOSE for a killed relay&amp;rsquo;s channel can leave small channel entries, with no file descriptor, in the forwarder&amp;rsquo;s ssh master. At most 256 relays run at once, which bounds them, and no code change is needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;While a VM is stopped, another VM that serves on its listed port, such as &lt;code&gt;localhost:5173&lt;/code&gt;, gets that port&amp;rsquo;s browser origin, with the site data, storage and service workers your browser keeps for it, as two projects on one port would on any host. A service worker that the other VM&amp;rsquo;s page registers there can still answer for that origin after the first VM takes the port back.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A VM can take a free port from 1024 up, or a listed one, on the host&amp;rsquo;s loopback that a program there expects to be its own, such as one that isn&amp;rsquo;t running yet or is restarting. What the VM serves there reaches whatever connects, so a page it serves to the user&amp;rsquo;s browser can reach the internet from the host, past the VM&amp;rsquo;s tier.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A host program that starts on a port while the VM has it forwarded still binds it when it listens on all addresses with &lt;code&gt;SO_REUSEADDR&lt;/code&gt;, as most servers do (checked on macOS). Its loopback connections then reach the VM, because the forward&amp;rsquo;s address is the narrower one. A program that binds without &lt;code&gt;SO_REUSEADDR&lt;/code&gt; is refused.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The VM can make the forwarder dial a host loopback port that&amp;rsquo;s in use and then close the connection at once without sending anything, because that&amp;rsquo;s how the forwarder checks for a port held only by ended connections. This happens at most once per port every second, as the VM&amp;rsquo;s listener on the port goes and comes back.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Servers only on the VM&amp;rsquo;s other addresses, such as its network address or a container&amp;rsquo;s, aren&amp;rsquo;t forwarded.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Other users on the host reach the forwards, because they&amp;rsquo;re on the host&amp;rsquo;s loopback.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;UDP isn&amp;rsquo;t forwarded. &lt;a href="https://next.devvm.dev/docs/using/ports-size/#ports"&gt;Ports&lt;/a&gt; shows how to tunnel it over TCP.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A server that keeps a port while its forward couldn&amp;rsquo;t be made, because the host had the port, isn&amp;rsquo;t forwarded until it stops and starts again.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Another user on the host can take a VM&amp;rsquo;s ssh port while the VM is stopped or booting. Lima&amp;rsquo;s own ssh would then reach that user&amp;rsquo;s program, as it checks no host key, while devvm&amp;rsquo;s forwarder and ssh config pin the VM&amp;rsquo;s.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A VM started outside devvm, such as with &lt;code&gt;devvm limactl start&lt;/code&gt;, or one whose forwarder ended, runs without forwarded ports until its next start through devvm, or until &lt;code&gt;devvm ports&lt;/code&gt; changes its ports, which starts a forwarder with the host key devvm pinned at its last start.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;, and &lt;code&gt;network&lt;/code&gt; for the sandbox&amp;rsquo;s binds):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lima&amp;rsquo;s rules ignore everything, the forwarder runs with the host key devvm pinned for the VM, and Lima&amp;rsquo;s ssh listens on the port the VM&amp;rsquo;s state records.&lt;/li&gt;
&lt;li&gt;A stopped VM whose ssh port a host program holds, on &lt;code&gt;127.0.0.1&lt;/code&gt; alone and accepting no connections, starts on a new port that its state records, and the program keeps its own.&lt;/li&gt;
&lt;li&gt;A VM server on a port answers at the host&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; through the forwarder, while Lima&amp;rsquo;s hostagent has neither that port nor a UDP server&amp;rsquo;s port. The forward listens on the host&amp;rsquo;s loopback alone. A port that a host program has on every address keeps that program&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt; connections while a server in the VM listens on it, and the forwarder logs that port as not forwarded.&lt;/li&gt;
&lt;li&gt;With listed ports, only those reach the host, whatever address the VM&amp;rsquo;s server is on. A listed port that a host program has is left out with a warning, and forwarded again once it&amp;rsquo;s free.&lt;/li&gt;
&lt;li&gt;On a running VM, &lt;code&gt;devvm ports&lt;/code&gt; changes the forwarder&amp;rsquo;s ports at once. A port that &lt;code&gt;devvm ports add&lt;/code&gt; lists has its server reach the host at once, and once &lt;code&gt;devvm ports rm&lt;/code&gt; takes it out, it doesn&amp;rsquo;t. The VM&amp;rsquo;s boot ID is the same throughout, so it never restarted.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devvm stop&lt;/code&gt; stops the forwarder, &lt;code&gt;limactl stop&lt;/code&gt; outside devvm ends it (on macOS), and &lt;code&gt;rm&lt;/code&gt; stops it and deletes its files.&lt;/li&gt;
&lt;li&gt;On macOS, a confined VM has a profile that denies every bind but its ssh port&amp;rsquo;s over TCP and unix sockets in its Lima folder, and the same binds that work outside the profile, a TCP port and a UDP socket on the ssh port, fail under it. Its hostagent listens on its ssh port alone, with Lima&amp;rsquo;s resolver off. Started again with Lima&amp;rsquo;s own forwarding rule put back inside the sandbox, the hostagent tries a VM server&amp;rsquo;s TCP and UDP ports and is refused, and has neither. The VM still works: ssh by name, devvm&amp;rsquo;s forwarder (on the host&amp;rsquo;s loopback alone), the proxy and the self-check. Its next start puts the ignore rules back.&lt;/li&gt;
&lt;li&gt;On a confined tier, with transparent mode stopped, DNS fails at once, because the guest&amp;rsquo;s programs ask &lt;code&gt;127.0.0.1&lt;/code&gt; alone, and Lima&amp;rsquo;s network&amp;rsquo;s DNS address and the host&amp;rsquo;s address on it give no answer for a name, with transparent mode running too.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="devcontainerjson"&gt;devcontainer.json&lt;span class="hx:absolute hx:-mt-20" id="devcontainerjson"&gt;&lt;/span&gt;
&lt;a href="#devcontainerjson" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A new VM gets what the project&amp;rsquo;s &lt;code&gt;devcontainer.json&lt;/code&gt; says, as far as devvm does it (&lt;a href="https://next.devvm.dev/docs/using/devcontainer/"&gt;its page&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; nothing from the file runs on or reaches this machine: it reads none of its environment, files, credentials, Docker images or registry logins, adds no mount, writes nothing to the project folder, and weakens no confinement (the network tier, &lt;code&gt;.git&lt;/code&gt; protection). It shapes only what&amp;rsquo;s in a new VM and what runs in it, as the VM&amp;rsquo;s user. devvm&amp;rsquo;s own handling of it (reading, parsing, state, the environment file, commands, ports, the image lookup) can&amp;rsquo;t be turned against this machine or devvm. Reviewed: the threat check&amp;rsquo;s leads are fixed, ruled out or listed below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The problem:&lt;/strong&gt; the file is the project&amp;rsquo;s, so the VM&amp;rsquo;s: the VM writes the folder, and a cloned repo&amp;rsquo;s file is whoever wrote it. Dev Containers runs much of it on the host (&lt;code&gt;initializeCommand&lt;/code&gt;, &lt;code&gt;${localEnv:…}&lt;/code&gt;, builds, &lt;code&gt;mounts&lt;/code&gt;, &lt;code&gt;runArgs&lt;/code&gt;, docker-outside-of-docker&amp;rsquo;s socket), pulls images with the user&amp;rsquo;s logins, and forwards ports at will.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How it&amp;rsquo;s kept:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reading:&lt;/strong&gt; only in the folder, through &lt;code&gt;os.Root&lt;/code&gt; (a link out of it isn&amp;rsquo;t followed, &lt;code&gt;..&lt;/code&gt; included), opened without blocking (a FIFO the VM made in its place opens at once and is refused) and checked as a regular file on the open descriptor, at most 1 MiB. It&amp;rsquo;s read once, at &lt;code&gt;plan&lt;/code&gt;; what the VM is made from is the parsed plan, recorded in its state, never the file read again. Later launches only hash it and warn.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parsing:&lt;/strong&gt; comments and trailing commas are blanked at the same offsets, strings untouched, then &lt;code&gt;encoding/json&lt;/code&gt;; values of the wrong kind, a NUL, an environment variable&amp;rsquo;s name that isn&amp;rsquo;t one, and every variable devvm doesn&amp;rsquo;t fill in are refused before anything&amp;rsquo;s made, &lt;code&gt;${localEnv:…}&lt;/code&gt;/&lt;code&gt;${env:…}&lt;/code&gt; above all. Nothing is filled in from this machine: &lt;code&gt;${containerWorkspaceFolder}&lt;/code&gt; is the folder&amp;rsquo;s path (the same in the VM), &lt;code&gt;${containerEnv:X}&lt;/code&gt; the VM&amp;rsquo;s own &lt;code&gt;X&lt;/code&gt;, left to its shell.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mapped, or refused, or ignored:&lt;/strong&gt; &lt;code&gt;build&lt;/code&gt;/Dockerfiles/Compose are refused; &lt;code&gt;initializeCommand&lt;/code&gt; never runs; &lt;code&gt;mounts&lt;/code&gt;, &lt;code&gt;runArgs&lt;/code&gt;, &lt;code&gt;privileged&lt;/code&gt;, &lt;code&gt;capAdd&lt;/code&gt;, &lt;code&gt;securityOpt&lt;/code&gt;, &lt;code&gt;workspaceMount&lt;/code&gt; and the rest are ignored, named. Features map only to devvm&amp;rsquo;s own layers (docker-in-docker to the docker layer, a toolchain&amp;rsquo;s name to that toolchain); no feature&amp;rsquo;s script is fetched, &lt;code&gt;docker-outside-of-docker&lt;/code&gt; is refused, everything else too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The image:&lt;/strong&gt; &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s path, but only an image its registry gives anyone: asked anonymously (&lt;code&gt;from.Lookup.Public&lt;/code&gt;, never Docker&amp;rsquo;s store), pinned to that digest, which the build pulls by. A registry named &lt;code&gt;localhost&lt;/code&gt; or by an address that isn&amp;rsquo;t the internet&amp;rsquo;s is refused by name, and the lookup&amp;rsquo;s client (&lt;code&gt;from.NewPublicRegistry&lt;/code&gt;) connects only to the internet&amp;rsquo;s addresses, whatever a name resolves to, its token service&amp;rsquo;s included; offline, only a registry digest recorded for that reference stands in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The docker layer:&lt;/strong&gt; the backend&amp;rsquo;s own rules for it, as when it&amp;rsquo;s named; the file never changes the VM&amp;rsquo;s tier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The environment:&lt;/strong&gt; each variable&amp;rsquo;s value is built as a shell word (single-quoted text, &lt;code&gt;&amp;quot;${X}&amp;quot;&lt;/code&gt; for the VM&amp;rsquo;s own), stored as JSON in the VM&amp;rsquo;s state, and written as &lt;code&gt;export NAME=word&lt;/code&gt; into the VM&amp;rsquo;s environment file before devvm&amp;rsquo;s own (which win); a name is checked again when it&amp;rsquo;s written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commands:&lt;/strong&gt; stored as argv in the VM&amp;rsquo;s state; run by the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; (on Lima, one &lt;code&gt;sh -c&lt;/code&gt; string, each word in single quotes), as the VM&amp;rsquo;s user, in the folder, after the self-check, &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s locks and a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s clone: confined like anything in the VM. Their output goes to the run log, shown only through &lt;code&gt;printable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ports:&lt;/strong&gt; only numbers and &lt;code&gt;localhost:N&lt;/code&gt;/&lt;code&gt;127.0.0.1:N&lt;/code&gt;, added to the user&amp;rsquo;s ports as &lt;code&gt;devvm ports add&lt;/code&gt; adds them (&lt;code&gt;filePorts&lt;/code&gt;, through &lt;code&gt;AddPorts&lt;/code&gt; and &lt;code&gt;RemovePorts&lt;/code&gt;; &lt;code&gt;--ports&lt;/code&gt; wins when the VM is made): with every port forwarded, the default, they&amp;rsquo;re among them already. The ones the file added are recorded (&lt;code&gt;devcontainer.ports_gave&lt;/code&gt;), so &lt;code&gt;devvm update&lt;/code&gt; takes out only those the file no longer lists and never brings back one &lt;code&gt;devvm ports rm&lt;/code&gt; took out. Forwarded on this machine&amp;rsquo;s loopback alone, as any listed port, by the one forwarder, never a host port of another program&amp;rsquo;s (&lt;code&gt;ports_taken&lt;/code&gt;). A repo&amp;rsquo;s file can so widen a list the user narrowed, to more of this machine&amp;rsquo;s loopback, which is the user&amp;rsquo;s decision to accept by opening the folder; &lt;code&gt;--no-devcontainer&lt;/code&gt; skips it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; &lt;code&gt;os.Root&lt;/code&gt; and &lt;code&gt;O_NONBLOCK&lt;/code&gt;; &lt;code&gt;encoding/json&lt;/code&gt;; Lima&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; passing arguments unchanged; the registry&amp;rsquo;s digest naming what&amp;rsquo;s pulled (a pull checks it); the backend&amp;rsquo;s own confinement of the VM and its builds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a backend whose &lt;code&gt;Exec&lt;/code&gt; runs its arguments through a host shell; a new property mapped without the same review; a host proxy that reaches this machine or its network for a public-looking name (Not covered).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The project&amp;rsquo;s own VM&lt;/strong&gt; and &lt;strong&gt;the lookup through a host proxy&lt;/strong&gt; (&lt;code&gt;HTTPS_PROXY&lt;/code&gt;), where only names are checked, not what the proxy resolves them to: &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt; lists both, under its devcontainer.json entries. Its &lt;code&gt;image&lt;/code&gt; is any public image, whose code runs as root in the build VM, as with &lt;code&gt;--from&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A name that resolves to the internet for devvm and to this machine&amp;rsquo;s network for the backend&amp;rsquo;s pull&lt;/strong&gt; (DNS rebinding) gets only content with the digest the public registry gave, which only someone who has that content can give.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill; its local IPC, data isolation and supply chain companions). Leads, each confirmed and fixed, or ruled out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;An image only this machine or its network has&lt;/strong&gt; (&lt;code&gt;localhost:5000/…&lt;/code&gt;, a private address, a name that resolves to one, its token service on one): confirmed: a backend that pulls it from this machine reaches this machine&amp;rsquo;s loopback, and the lookup was made on this machine; fixed: refused by name and by address (&lt;code&gt;publicHost&lt;/code&gt;, &lt;code&gt;NewPublicRegistry&lt;/code&gt;), a recorded digest included; unit-, CLI- and end-to-end-tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;forwardPorts over a user&amp;rsquo;s port list&lt;/strong&gt; (added to &lt;code&gt;devvm ports -g&lt;/code&gt;&amp;rsquo;s list, or to &lt;code&gt;none&lt;/code&gt;, a limit the user set): accepted: the file&amp;rsquo;s ports are added to the user&amp;rsquo;s list, on this machine&amp;rsquo;s loopback alone, as the Ports entry above says, so opening the folder accepts them, and &lt;code&gt;--no-devcontainer&lt;/code&gt; skips them; CLI- and end-to-end-tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The JSONC stripper and parser&lt;/strong&gt; (comments in strings, an unterminated comment or string, a BOM, trailing commas): ruled out: blanking keeps offsets and leaves strings alone; anything else is invalid JSON; fuzzed (&lt;code&gt;FuzzParse&lt;/code&gt;): no panic, every variable a shell word, nothing of this machine&amp;rsquo;s environment kept.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reading&lt;/strong&gt; (a link out, &lt;code&gt;..&lt;/code&gt;, a FIFO, a device, a huge file, a swap between the check and the read): ruled out: &lt;code&gt;os.Root&lt;/code&gt;, a non-blocking open, the descriptor&amp;rsquo;s own &lt;code&gt;Stat&lt;/code&gt;, 1 MiB; one read per new VM; unit-tested (links, a FIFO).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variables&lt;/strong&gt; (&lt;code&gt;${localEnv:…}&lt;/code&gt;, &lt;code&gt;${env:…}&lt;/code&gt;, nested or unterminated): ruled out: refused, or left as text for the VM&amp;rsquo;s shell; nothing is read from this machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The environment file and state&lt;/strong&gt; (newlines, quotes, &lt;code&gt;$()&lt;/code&gt;, a name like &lt;code&gt;A;rm&lt;/code&gt;): ruled out: values are shell words, JSON-escaped in state (one line), names checked twice; the file is the VM&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Command quoting&lt;/strong&gt; (&lt;code&gt;'&lt;/code&gt;, newlines, an argument starting with &lt;code&gt;-&lt;/code&gt;): ruled out: devvm runs &lt;code&gt;bash -lc 'exec &amp;quot;$@&amp;quot;'&lt;/code&gt; with the argv after it, and Lima quotes each word.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Messages&lt;/strong&gt; (the file&amp;rsquo;s values in this machine&amp;rsquo;s terminal): ruled out: every message value goes through &lt;code&gt;msg.OneLine&lt;/code&gt; as it renders, the image through &lt;code&gt;from.Valid&lt;/code&gt;, errors&amp;rsquo; causes aren&amp;rsquo;t printed, the log tail goes through &lt;code&gt;msg.Printable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commands before confinement:&lt;/strong&gt; ruled out: they run after the self-check (which stops a VM whose policy fails), &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s locks, and a clone&amp;rsquo;s seeding.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A digest the registry made up&lt;/strong&gt; (&lt;code&gt;Docker-Content-Digest&lt;/code&gt;): ruled out: &lt;code&gt;sha256:&lt;/code&gt; and 64 hex digits, and every pull checks content against it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;project&lt;/code&gt;): a VM made from a file: its variables in the shell, &lt;code&gt;postCreateCommand&lt;/code&gt; once and &lt;code&gt;postStartCommand&lt;/code&gt; at each start, in the VM and folder, its port forwarded and no other, nothing written to the folder, a changed file only warned about; a file whose image is on this machine&amp;rsquo;s registry refused, nothing made.&lt;/p&gt;
&lt;h2 data-hextra-search-id="network-tiers"&gt;Network tiers&lt;span class="hx:absolute hx:-mt-20" id="network-tiers"&gt;&lt;/span&gt;
&lt;a href="#network-tiers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s network is one of four tiers, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;internet&lt;/code&gt;, &lt;code&gt;allowlist&lt;/code&gt; and &lt;code&gt;none&lt;/code&gt;, from the lowest to the highest (&lt;a href="https://next.devvm.dev/docs/safety/network/#network-tiers"&gt;what each reaches&lt;/a&gt;). The design keeps two things: every VM&amp;rsquo;s requests go through its own proxy, whatever its tier, and only the open tier ever runs a VM unconfined.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;netpolicy.Tier&lt;/code&gt;, in the VM&amp;rsquo;s &lt;code&gt;net&lt;/code&gt; section as &lt;code&gt;tier&lt;/code&gt;. An unknown tier fails to read (&lt;code&gt;Tier.UnmarshalJSON&lt;/code&gt;), and &lt;code&gt;TierOf&lt;/code&gt; reads a section it can&amp;rsquo;t read as &lt;code&gt;none&lt;/code&gt;, never as &lt;code&gt;open&lt;/code&gt;; a section without a tier reads as &lt;code&gt;allowlist&lt;/code&gt;. &lt;code&gt;Tier.Net&lt;/code&gt; maps the tier to the backend&amp;rsquo;s confinement: &lt;code&gt;NetProxy&lt;/code&gt; for every tier but open, and &lt;code&gt;NetDirect&lt;/code&gt; with the proxy&amp;rsquo;s port and password for open (&lt;code&gt;Confinement.GuestProxy&lt;/code&gt;). &lt;code&gt;netpolicy.Policies&lt;/code&gt; gives each tier its policies (&lt;code&gt;PolicySet&lt;/code&gt;), and &lt;code&gt;Prepare&lt;/code&gt; writes them into the proxy&amp;rsquo;s config: &lt;code&gt;builtin_policies&lt;/code&gt; for the built-in policies and &lt;code&gt;policies&lt;/code&gt; for your files on the allowlist tier, &lt;code&gt;deny_policies&lt;/code&gt; for the user&amp;rsquo;s files on internet and none, whose allows the proxy drops as it reads them, and &lt;code&gt;open&lt;/code&gt; for the open tier, which allows every host and address with no floor and takes no policy at all (&lt;code&gt;Config.check&lt;/code&gt;). Every tier&amp;rsquo;s proxy has the VM&amp;rsquo;s CAs and its bindings file, an open VM&amp;rsquo;s included, and every VM&amp;rsquo;s setup sends the same placeholders and redacted copies (&lt;code&gt;stageSecrets&lt;/code&gt;), so no VM holds a real secret and the tier decides only the confinement and the rules. A running VM keeps the confinement it started with: one made open while it runs confined stays on &lt;code&gt;NetProxy&lt;/code&gt; until its next start, with an open proxy. Every &lt;code&gt;Prepare&lt;/code&gt; reads the tier from the VM&amp;rsquo;s state as it is then, so a command that read the state before a tier change never starts the proxy with the tier before.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rules:&lt;/strong&gt; &lt;code&gt;**&lt;/code&gt; covers addresses as well as names, and &lt;code&gt;:*&lt;/code&gt; any port 1 to 65535. Neither lifts the floor, because only an address rule can (&lt;code&gt;policy.addrAllowed&lt;/code&gt;), so the internet tier&amp;rsquo;s &lt;code&gt;**:*&lt;/code&gt; reaches every public host and address and no internal one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lima:&lt;/strong&gt; an open VM runs as a VM without a proxy would, with no Seatbelt profile and no &lt;code&gt;restrict=on&lt;/code&gt; from the QEMU wrapper, and its guest reaches its proxy at &lt;code&gt;192.168.5.2&lt;/code&gt;, the host&amp;rsquo;s loopback on Lima&amp;rsquo;s user-mode network, on macOS and on Linux. &lt;code&gt;propagateProxyEnv&lt;/code&gt; is off for it, so the host&amp;rsquo;s proxy settings never reach the guest, and its &lt;code&gt;NO_PROXY&lt;/code&gt; adds Lima&amp;rsquo;s names for the host.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt; a client links only to a target on its tier or a stricter one (&lt;code&gt;policyRule&lt;/code&gt;), and a group&amp;rsquo;s VMs are all on one tier. A tier change that would break either is refused (&lt;code&gt;tierLinked&lt;/code&gt;, &lt;code&gt;group_tier_fixed&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The open flag reaching a confined VM&amp;rsquo;s proxy:&lt;/strong&gt; ruled out. &lt;code&gt;Open&lt;/code&gt; is set only for the open tier, a config with &lt;code&gt;open&lt;/code&gt; and any policy is refused, and an unknown or unreadable tier reads as none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A confined VM reaching the host or the LAN:&lt;/strong&gt; ruled out. The confinement is the tier&amp;rsquo;s (&lt;code&gt;Tier.Net&lt;/code&gt;), the floor still judges every address the proxy dials on a confined tier, and &lt;code&gt;**&lt;/code&gt; and &lt;code&gt;:*&lt;/code&gt; lift no floor (&lt;code&gt;TestAnyPort&lt;/code&gt;, &lt;code&gt;TestFloor&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A tier change racing the proxy&amp;rsquo;s config:&lt;/strong&gt; fixed. &lt;code&gt;Prepare&lt;/code&gt; read the tier from the state its caller had read, so a command started before &lt;code&gt;devvm network&lt;/code&gt; changed the tier could start the proxy again with the looser one; it now reads the tier from the VM&amp;rsquo;s state as it is then. Listed: two devvm commands at once can still interleave between that read and the proxy&amp;rsquo;s start, and the next launch puts the right config back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A running confined VM made open:&lt;/strong&gt; listed, by design. Until its next start it stays confined, but its proxy is open&amp;rsquo;s, so through the proxy it reaches this machine&amp;rsquo;s loopback and the LAN, as the open tier you asked for does. &lt;code&gt;devvm network open&lt;/code&gt; asks first in a parent folder (&lt;code&gt;widen&lt;/code&gt;), and the VM keeps its CAs, which its open proxy goes on signing with.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other programs or VMs using an open VM&amp;rsquo;s proxy:&lt;/strong&gt; ruled out. Every request needs the VM&amp;rsquo;s own random password, which is in no process&amp;rsquo;s arguments: the proxy&amp;rsquo;s config is mode 600, and the open self-check names &lt;code&gt;$HTTPS_PROXY&lt;/code&gt;, not its value (&lt;code&gt;TestSelfCheckOpen&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy&amp;rsquo;s password:&lt;/strong&gt; improved. An open VM no longer gets the host&amp;rsquo;s proxy settings, so neither the shell&amp;rsquo;s password nor &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s reaches its guest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM spending a secret past its proxy:&lt;/strong&gt; ruled out. Its environment, its git credential helper and its agents&amp;rsquo; copies hold only its placeholders, which end in its own salt, so a request it sends directly carries a placeholder that the secret&amp;rsquo;s host refuses, and only a request through its proxy, with its password, gets the real value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM&amp;rsquo;s proxy putting secrets into another host&amp;rsquo;s requests:&lt;/strong&gt; ruled out. The open flag lifts the rules and the floor, not the bindings: the proxy intercepts and puts a secret in only for the binding&amp;rsquo;s own hosts on &lt;code&gt;:443&lt;/code&gt;, and a request inside the tunnel that names another host gets &lt;code&gt;421&lt;/code&gt;, as on every tier (&lt;code&gt;TestInterceptOpen&lt;/code&gt;; &lt;code&gt;TestPrepareOpen&lt;/code&gt; and &lt;code&gt;sync.txtar&lt;/code&gt; for the VM&amp;rsquo;s CAs, salt, bindings and placeholders).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open VM&amp;rsquo;s CA:&lt;/strong&gt; listed, as on every tier. The VM trusts its own CA, whose key stays on this machine, so its proxy can impersonate the secrets&amp;rsquo; hosts to that VM alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;**&lt;/code&gt; matching addresses on the allowlist tier:&lt;/strong&gt; listed. A policy with &lt;code&gt;**&lt;/code&gt; now allows public address literals too, which it refused before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Old VMs:&lt;/strong&gt; listed. A VM made before tiers reads as allowlist, so one that was open starts confined, and a running one shows as &lt;code&gt;unenforced&lt;/code&gt; until devvm restarts it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;): &lt;code&gt;network&lt;/code&gt;: open from its next start, a direct connection works, its proxy is set, answers the self-check and carries the VM to this machine&amp;rsquo;s loopback and its LAN address, while the allowlist tier refuses this machine&amp;rsquo;s loopback; the open VM holds no real secret, its proxy puts the token in over TLS the VM verifies with its own CA, and a request around the proxy carries only the placeholder and gets a 401; open behind a company proxy, the guest gets its own proxy and never the shell&amp;rsquo;s settings, which go through the VM&amp;rsquo;s proxy alone; internet reaches a host off the allowlist and another port but not this machine&amp;rsquo;s LAN address, and a direct connection still fails; none refuses github.com, lets Claude Code&amp;rsquo;s API through, and keeps a deny. &lt;code&gt;link&lt;/code&gt;: an allowlist client&amp;rsquo;s link to a none target goes on, and to an internet one is refused and warned of.&lt;/p&gt;
&lt;h2 data-hextra-search-id="rules-by-method-and-path"&gt;Rules by method and path&lt;span class="hx:absolute hx:-mt-20" id="rules-by-method-and-path"&gt;&lt;/span&gt;
&lt;a href="#rules-by-method-and-path" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A rule can narrow a host name to some of its requests, by method, by path or both (&lt;a href="https://next.devvm.dev/docs/safety/network/#rules-by-method-and-path"&gt;how to use them&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/network/#requests-by-method-and-path"&gt;how the proxy judges them&lt;/a&gt;), and a secret of yours can go in for some methods alone. The design keeps two things: a request that a deny names doesn&amp;rsquo;t reach its host by any spelling of its method or its path that the threat check below covers, and an allow lets through only what it names, as every server would read it. What it leaves open, such as a form&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; field and methods outside the list, is listed there.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; the policy files&amp;rsquo; one line per rule, with the methods and then the path after the host (&lt;code&gt;proxy.parseRule&lt;/code&gt;), &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; on devvm network allow, deny and rm (&lt;code&gt;netpolicy.Rule&lt;/code&gt;), the proxy&amp;rsquo;s interception with the VM&amp;rsquo;s CA, which the secrets already use, and one matcher, &lt;code&gt;proxy.match&lt;/code&gt; in &lt;code&gt;internal/proxy/request.go&lt;/code&gt;, for rules and for secrets&amp;rsquo; bindings, whose path check (&lt;code&gt;plainPath&lt;/code&gt;) is the one that custom secrets&amp;rsquo; &lt;code&gt;--path&lt;/code&gt; had.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Decisions:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One line per rule, in the files there are.&lt;/strong&gt; A rule stays a line of a policy file, &lt;code&gt;api.github.com GET,HEAD /repos/&lt;/code&gt;, which the one parser reads for the proxy, devvm network and devvm doctor (&lt;code&gt;ParsePolicy&lt;/code&gt;), so layers&amp;rsquo; and your own policies, &lt;code&gt;-g&lt;/code&gt;&amp;rsquo;s and each VM&amp;rsquo;s take it as they are. A TOML or table form would be a second grammar beside the line one, for the same files. Every line that was a rule before means what it did, any method and any path. A line with spaces in it wasn&amp;rsquo;t a rule, so a hand-written one that has the new form gains a meaning: &lt;code&gt;example.com GET&lt;/code&gt;, which the proxy skipped, now allows &lt;code&gt;GET&lt;/code&gt;, and &lt;code&gt;!example.com GET&lt;/code&gt;, a broken deny that denied everything, now denies &lt;code&gt;GET&lt;/code&gt; alone. Both are what the line says, and devvm writes such lines only from &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flags, not a quoted rule.&lt;/strong&gt; RULE stays one word, as the cli skill has an argument, and &lt;code&gt;--method&lt;/code&gt; and &lt;code&gt;--path&lt;/code&gt; say how the rule narrows, so devvm network allow takes &lt;code&gt;api.github.com --method GET,HEAD&lt;/code&gt;. The same flags on devvm secret set narrow a secret of yours, with &lt;code&gt;none&lt;/code&gt; for every method, as &lt;code&gt;--path&lt;/code&gt; and &lt;code&gt;--scheme&lt;/code&gt; have it, so a saved secret&amp;rsquo;s methods can go without deleting it. A path is one value, as &lt;code&gt;--path&lt;/code&gt; has one wherever it appears, so two paths are two rules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allows add up, and a deny beats any allow, as before.&lt;/strong&gt; An allow that narrows allows its host for the connection and only its requests one by one, and a deny that narrows refuses only its requests. So narrowing a host that a rule allows whole, devvm&amp;rsquo;s built-in GitHub among them, takes a deny, and devvm network allow warns when an allow by method and path would narrow nothing because the VM&amp;rsquo;s allowlist, or every VM&amp;rsquo;s with &lt;code&gt;-g&lt;/code&gt;, allows its host whole (&lt;code&gt;proxy.Allowlist.CoversWhole&lt;/code&gt;, &lt;code&gt;rule_narrows_nothing&lt;/code&gt;). An allow that replaced the whole allows of earlier policies was ruled out: adding an allow would then take access away, and a user&amp;rsquo;s file would silently override devvm&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Methods from a closed list.&lt;/strong&gt; &lt;code&gt;proxy.Methods&lt;/code&gt; are RFC 9110&amp;rsquo;s, &lt;code&gt;PATCH&lt;/code&gt; and &lt;code&gt;QUERY&lt;/code&gt;, without &lt;code&gt;CONNECT&lt;/code&gt;. A method outside them isn&amp;rsquo;t a rule, so a typo in a deny, such as &lt;code&gt;PSOT&lt;/code&gt;, is a broken deny, which denies everything until it&amp;rsquo;s fixed, rather than a deny of nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paths as patterns, judged only in a plain form.&lt;/strong&gt; &lt;code&gt;*&lt;/code&gt; within a segment, &lt;code&gt;**&lt;/code&gt; for one segment or more, and a last &lt;code&gt;/&lt;/code&gt; for everything below, which is what a binding&amp;rsquo;s path below which its value goes in already meant. Rather than decode and clean a path, which servers do differently, the matcher takes only a path that every server reads alike (&lt;code&gt;plainPath&lt;/code&gt;), as custom secrets&amp;rsquo; &lt;code&gt;--path&lt;/code&gt; did. An allow, and a binding, match exactly, in case too, and never a path in another form, while a deny matches broadly, so each fails closed in its own direction. A deny matches in any case, every path that isn&amp;rsquo;t plain, the path above one that ends with &lt;code&gt;/&lt;/code&gt;, as &lt;code&gt;/gists&lt;/code&gt; is to &lt;code&gt;/gists/&lt;/code&gt; for most servers, and a last segment cut at its first &lt;code&gt;.&lt;/code&gt;, as Rails and Spring route &lt;code&gt;/admin.json&lt;/code&gt; to &lt;code&gt;/admin&lt;/code&gt; and some servers drop a trailing dot. Cutting at the first dot rather than the last covers &lt;code&gt;/admin.tar.gz&lt;/code&gt; too, and it refuses a few more requests than a deny names, which is the side a deny errs on. The cost is that a request to a host with path rules whose path has an encoded character, such as a file name with a space, is refused unless a rule without a path allows it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rules that need requests force interception, or a refusal.&lt;/strong&gt; A host whose requests the rules judge (&lt;code&gt;hostRules.byRequest&lt;/code&gt;) is decrypted on &lt;code&gt;:443&lt;/code&gt; with the VM&amp;rsquo;s CA, and refused on any other port and without a CA, never tunneled unjudged. A host that a whole allow covers, with no deny that narrows, stays a tunnel, so the cost falls only where the rules need it. No host is spliced by name: devvm already decrypts GitHub, Anthropic&amp;rsquo;s API and the agents&amp;rsquo; token endpoints for secrets, and git, the GitHub CLI and Claude Code work through it. A client that pins its certificates or ignores the VM&amp;rsquo;s CA fails its handshake, which &lt;code&gt;devvm network log&lt;/code&gt; shows as &lt;code&gt;TLS with the VM failed&lt;/code&gt;, so devvm notes that a host is now decrypted when a rule narrows it (&lt;code&gt;rule_narrows&lt;/code&gt;) rather than refusing the rule. Addresses, CIDRs and &lt;code&gt;**&lt;/code&gt; can&amp;rsquo;t narrow, because an address has no name to make a certificate for and &lt;code&gt;**&lt;/code&gt; would decrypt every host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Methods a request names besides its own.&lt;/strong&gt; Some frameworks take the method from a header, &lt;code&gt;X-HTTP-Method-Override&lt;/code&gt; and its kin, which Rack and CGI read with &lt;code&gt;_&lt;/code&gt; for &lt;code&gt;-&lt;/code&gt;, or from a &lt;code&gt;_method&lt;/code&gt; parameter. The proxy reads every override-like header (&lt;code&gt;overrideLike&lt;/code&gt;) and the query&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt;, and while a rule narrows a host by method, it refuses a request whose value isn&amp;rsquo;t exactly one method, such as a list, which servers read apart, rather than guess. Judging a &lt;code&gt;_method&lt;/code&gt; in the query, rather than refusing every request with one, keeps a &lt;code&gt;GET&lt;/code&gt; that names &lt;code&gt;GET&lt;/code&gt; working, and an allow still needs every method named to be its own. A form&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; in a &lt;code&gt;POST&lt;/code&gt;&amp;rsquo;s body isn&amp;rsquo;t read: the proxy forwards bodies unread, so it&amp;rsquo;s judged as the &lt;code&gt;POST&lt;/code&gt; it is.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every request is judged.&lt;/strong&gt; The intercepted tunnel&amp;rsquo;s own HTTP server calls the handler for each request, HTTP/1.1 kept alive or HTTP/2, and so does each absolute-form request, so the rules and the bindings are asked for each one, with the files as they are then. A connection&amp;rsquo;s verdict and whether its requests are judged come from one read of the files (&lt;code&gt;hostRules&lt;/code&gt;). A WebSocket is judged by its upgrade request, and an upgrade to anything else, such as &lt;code&gt;h2c&lt;/code&gt;, and a &lt;code&gt;CONNECT&lt;/code&gt; inside the tunnel are refused, as the bytes after them would pass unread. A tunnel opened before a rule narrowed its host stays a tunnel until it closes, as tunnels do for every new deny, and &lt;code&gt;rule_narrows&lt;/code&gt; says so. The shared Nix cache&amp;rsquo;s own fetch from cache.nixos.org is judged as a &lt;code&gt;GET&lt;/code&gt; of the path the VM asked for, so its rules apply there too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A proxy from another binary.&lt;/strong&gt; A running proxy is the devvm binary that started it, and one from before this change reads a rule by method and path as a line that isn&amp;rsquo;t a rule: an allow it skips and a deny that denies everything. So devvm network allow, deny and rm warn, naming the VM, when they change such a rule while the VM&amp;rsquo;s proxy runs from another binary than their own (&lt;code&gt;proxy_other_binary&lt;/code&gt;, by the &lt;code&gt;devvm_sha256&lt;/code&gt; of the config it started with, and when that config or this binary can&amp;rsquo;t be read, as devvm can&amp;rsquo;t tell), and the VM&amp;rsquo;s next launch starts the proxy again. A change to a host&amp;rsquo;s rule doesn&amp;rsquo;t warn, as every binary reads it alike. The bindings file stays version 1 while every binding has no methods and no path but a prefix longer than &lt;code&gt;/&lt;/code&gt; that ends with &lt;code&gt;/&lt;/code&gt; and has no &lt;code&gt;*&lt;/code&gt;, so devvm secret set and rm, which write every VM&amp;rsquo;s file, don&amp;rsquo;t take an older proxy&amp;rsquo;s bindings away, logins included. Such a file reads alike to a proxy from after bindings gained paths; a 0.1.0 proxy ignores the path, which for the built-in bindings only widens OpenRouter&amp;rsquo;s key to all of openrouter.ai, as 0.1.0 bound it, until the VM starts again. Writing version 2 instead would cut those proxies&amp;rsquo; logins. It&amp;rsquo;s version 2 only for a binding with methods or a pattern, which such a proxy refuses, so it puts no value in rather than put one in for every method, and devvm warns about each such VM whenever it writes one, from devvm secret set, rm and use or devvm agent login &amp;ndash;api-key (&lt;code&gt;Proxy.SecretsWritten&lt;/code&gt;, &lt;code&gt;secrets_other_binary&lt;/code&gt;). A path of &lt;code&gt;/&lt;/code&gt;, which that proxy&amp;rsquo;s prefix check refused with the whole file, is no path, as it&amp;rsquo;s every path. A custom secret&amp;rsquo;s path that devvm writes is marked a pattern (&lt;code&gt;path_pattern&lt;/code&gt;), so a path saved as a prefix whose &lt;code&gt;*&lt;/code&gt; was itself is refused rather than read as a wildcard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A blocked request&lt;/strong&gt; gets &lt;code&gt;403&lt;/code&gt; and a &lt;code&gt;blocked&lt;/code&gt; event with its method and path, which devvm network log, &lt;code&gt;/blocked&lt;/code&gt; and devvm-why show. A deny&amp;rsquo;s refusal is marked refused, so no allow is suggested, and a request that no allow covers suggests the allow of the whole host, never a path, which the VM chose. Learning stays by host: devvm network lock adds whole hosts, which you then narrow, because a log of methods and paths would turn every request a VM made while it learned into a rule to review.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The floor and secrets.&lt;/strong&gt; A rule that narrows names a host, so it lifts no floor: an internal address still needs an address rule. A secret of yours narrowed by &lt;code&gt;--method&lt;/code&gt; goes in by the same matcher as an allow. A built-in secret&amp;rsquo;s or an agent&amp;rsquo;s login&amp;rsquo;s binding isn&amp;rsquo;t narrowed per VM: a deny by method and path in the VM&amp;rsquo;s own file already keeps the token from those requests, and refuses them outright rather than sending them with a placeholder, which is stricter, while narrowing the binding would need a per-VM record of known secrets and logins and a second way to the same end.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a spelling of a method or a path that a server reads as one a deny names and the matcher doesn&amp;rsquo;t; an allow letting through a request it doesn&amp;rsquo;t name; a host whose requests the rules judge reaching the far end without being judged; a request after the first on a connection going unjudged; the matcher being made slow by a VM&amp;rsquo;s path; and the bindings&amp;rsquo; methods widening a secret.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A path&amp;rsquo;s spelling past a deny&lt;/strong&gt; (case, a trailing slash, the prefix itself, a format&amp;rsquo;s suffix or a trailing dot, percent-encoding, &lt;code&gt;..&lt;/code&gt;, &lt;code&gt;//&lt;/code&gt;, &lt;code&gt;\&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;): fixed. A deny of &lt;code&gt;/gists/&lt;/code&gt; let &lt;code&gt;/gists&lt;/code&gt; through, and a deny of &lt;code&gt;/admin&lt;/code&gt; let &lt;code&gt;/admin.json&lt;/code&gt; and &lt;code&gt;/admin.&lt;/code&gt; through, which it now refuses (&lt;code&gt;TestDenyBypasses&lt;/code&gt;, &lt;code&gt;TestMatchPath&lt;/code&gt;; &lt;code&gt;FuzzDenyBypass&lt;/code&gt; checks, with a deny of &lt;code&gt;/gists/&lt;/code&gt; alone, that no path that a server could read as &lt;code&gt;/gists&lt;/code&gt; or below, decoded once or twice, with &lt;code&gt;\&lt;/code&gt; as &lt;code&gt;/&lt;/code&gt;, without &lt;code&gt;;&lt;/code&gt;&amp;rsquo;s parameters, cleaned and with its last segment&amp;rsquo;s suffix dropped, gets through). A deny of &lt;code&gt;/config.json&lt;/code&gt; let &lt;code&gt;/config.json.&lt;/code&gt; through, and every segment now matches with its trailing dots dropped too. Listed: a server that routes &lt;code&gt;/admin-x&lt;/code&gt; or &lt;code&gt;/admin~&lt;/code&gt; to &lt;code&gt;/admin&lt;/code&gt; isn&amp;rsquo;t covered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A method&amp;rsquo;s spelling past a deny:&lt;/strong&gt; fixed. The deny compared each of three override headers&amp;rsquo; whole value, so &lt;code&gt;X-HTTP-Method-Override: DELETE, GET&lt;/code&gt;, &lt;code&gt;X_HTTP_METHOD_OVERRIDE: DELETE&lt;/code&gt; and &lt;code&gt;?_method=DELETE&lt;/code&gt; got past a deny of &lt;code&gt;DELETE&lt;/code&gt;. Now every override-like header in any spelling and the query&amp;rsquo;s &lt;code&gt;_method&lt;/code&gt; are read, each word of a list is judged, and a value that isn&amp;rsquo;t exactly one method is refused while a rule narrows the host by method. Go&amp;rsquo;s &lt;code&gt;url.ParseQuery&lt;/code&gt; skips a pair with a &lt;code&gt;;&lt;/code&gt; in it, so &lt;code&gt;?a=1;_method=DELETE&lt;/code&gt; hid its &lt;code&gt;_method&lt;/code&gt;; a query with a &lt;code&gt;;&lt;/code&gt;, or one &lt;code&gt;ParseQuery&lt;/code&gt; can&amp;rsquo;t read whole, is refused there too (&lt;code&gt;TestDenyBypasses&lt;/code&gt;, &lt;code&gt;TestAllowNarrowed&lt;/code&gt;, &lt;code&gt;TestForRequestMethods&lt;/code&gt;, and &lt;code&gt;FuzzDenyBypass&lt;/code&gt;, with a header of its choosing and an oracle that splits the raw query at &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;;&lt;/code&gt; itself). Listed: a method outside &lt;code&gt;proxy.Methods&lt;/code&gt;, such as WebDAV&amp;rsquo;s, can&amp;rsquo;t be named, so a deny of writes doesn&amp;rsquo;t refuse &lt;code&gt;PROPFIND&lt;/code&gt;, which a server that doesn&amp;rsquo;t speak WebDAV refuses itself; a &lt;code&gt;_method&lt;/code&gt; field in a &lt;code&gt;POST&lt;/code&gt;&amp;rsquo;s body, which the proxy doesn&amp;rsquo;t read, is judged as the &lt;code&gt;POST&lt;/code&gt; it is; a header of another name that a framework is set to read the method from isn&amp;rsquo;t.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An allow letting through more than it names:&lt;/strong&gt; ruled out. It matches the method as written, every method the request names besides, and only a plain path in its own case (&lt;code&gt;TestAllowNarrowed&lt;/code&gt;, &lt;code&gt;TestPathWithin&lt;/code&gt;, which the bindings share).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An allow that narrows nothing:&lt;/strong&gt; fixed. An allow by method and path for a host that a whole allow covers, such as &lt;code&gt;api.github.com&lt;/code&gt;, changed nothing, while devvm said the host was now decrypted; devvm network allow now warns that it narrows nothing, naming the VMs, with &lt;code&gt;-g&lt;/code&gt; by each VM&amp;rsquo;s own allowlist, its file, layers and shared tools included, and names the deny instead. Where the whole allow names port 443 alone, the warning says the rule narrows only port 80&amp;rsquo;s plain HTTP (&lt;code&gt;TestCoversWhole&lt;/code&gt;, &lt;code&gt;network_narrow.txtar&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two reads of the rules for one connection:&lt;/strong&gt; fixed. The &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s verdict and whether its requests are judged each read the files, so a change between them could tunnel a host whose new rules needed its requests; both now come from one read (&lt;code&gt;hostRules&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The shared Nix cache past the rules:&lt;/strong&gt; fixed. Its fetch from cache.nixos.org asked only whether the host was allowed, and now meets rules by method and path as a &lt;code&gt;GET&lt;/code&gt; of its path (&lt;code&gt;TestNixCacheRulesByPath&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A proxy or a saved secret from before this change:&lt;/strong&gt; fixed. A proxy from another binary, or one devvm can&amp;rsquo;t tell, gets a warning when a rule by method and path changes (&lt;code&gt;TestOtherBinaries&lt;/code&gt;). devvm wrote every bindings file as version 2, so a devvm secret set or rm after an upgrade took every running older proxy&amp;rsquo;s bindings away, its agents&amp;rsquo; logins included, without a word; the file is version 1 now unless a binding needs 2, which an older proxy refuses rather than put a value in for every method, and writing one for such a proxy warns, devvm agent login &amp;ndash;api-key&amp;rsquo;s write included (&lt;code&gt;TestReadBindings&lt;/code&gt;, &lt;code&gt;TestRefreshSecretsOtherBinary&lt;/code&gt;, &lt;code&gt;TestDefine&lt;/code&gt;&amp;rsquo;s path of &lt;code&gt;/&lt;/code&gt;). Checking whether an allow narrows anything after it&amp;rsquo;s written warns about a VM whose rules can&amp;rsquo;t be read rather than fail the change (&lt;code&gt;TestNarrowNotesUnreadable&lt;/code&gt;). devvm 0.1.0&amp;rsquo;s own state, frozen in the repo, is the check that none of this moves what 0.1.0 wrote: its bindings files read as version 1 and are written again byte for byte, its proxies&amp;rsquo; configs read and name the binary that started them, its grammar&amp;rsquo;s lines and verdicts are a table of their own (&lt;code&gt;TestFixtureBindings&lt;/code&gt;, &lt;code&gt;TestFixtureProxyConfig&lt;/code&gt;, &lt;code&gt;TestV010Rules&lt;/code&gt;), and its app VM takes an allow that narrows nothing, a deny by method, a launch that leaves its bindings file as 0.1.0 wrote it, and a secret by method that makes it version 2 (&lt;code&gt;fixture_v010_network.txtar&lt;/code&gt;). A custom secret&amp;rsquo;s path with a &lt;code&gt;*&lt;/code&gt; saved as a prefix is refused (&lt;code&gt;TestCustomsUnreadable&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host whose requests the rules judge, tunneled unjudged:&lt;/strong&gt; ruled out. Its &lt;code&gt;CONNECT&lt;/code&gt; is intercepted on &lt;code&gt;:443&lt;/code&gt; and refused anywhere else and without a CA, logged as a refused block (&lt;code&gt;TestNarrowedNotDecrypted&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Requests after the first, or smuggled in one:&lt;/strong&gt; ruled out. Go&amp;rsquo;s HTTP server parses every request on the decrypted connection and calls the handler for each, HTTP/1.1 kept alive and HTTP/2 alike, and the proxy sends each to the host as a request of its own through its reverse proxy, so no bytes of the VM&amp;rsquo;s pass unparsed (&lt;code&gt;TestInterceptRules&lt;/code&gt; over both). An upgrade other than WebSocket and a &lt;code&gt;CONNECT&lt;/code&gt; inside the tunnel are refused. Listed: what a WebSocket carries after its upgrade request passes unread.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Another host&amp;rsquo;s requests in the tunnel:&lt;/strong&gt; ruled out, as before: a request that names another host gets &lt;code&gt;421&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s path making matching slow:&lt;/strong&gt; ruled out. Matching is a table over the pattern&amp;rsquo;s segments, at most 32, and the path&amp;rsquo;s, so a path of 20,000 segments against several &lt;code&gt;**&lt;/code&gt; takes well under a second (&lt;code&gt;TestMatchPath&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A rule a typo turned into nothing:&lt;/strong&gt; ruled out for methods and paths, which a line that isn&amp;rsquo;t a rule can&amp;rsquo;t hold, so a deny with one is a broken deny that denies everything (&lt;code&gt;network_narrow.txtar&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binding&amp;rsquo;s methods widening a secret:&lt;/strong&gt; ruled out. A binding goes in only where its match allows, and the lookup checks a binding&amp;rsquo;s methods against the secret&amp;rsquo;s as it&amp;rsquo;s saved (&lt;code&gt;fits&lt;/code&gt;), so a bindings file edited to drop them gets nothing (&lt;code&gt;TestForRequestMethods&lt;/code&gt;, &lt;code&gt;TestInterceptSecretMethods&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interception breaking a client:&lt;/strong&gt; listed. A tool that doesn&amp;rsquo;t trust the VM&amp;rsquo;s CA fails at a host once a rule narrows it, which devvm says when the rule is added and devvm network log shows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What an allowed request carries:&lt;/strong&gt; listed. A rule judges a request&amp;rsquo;s method, the methods it names and its path, not its body or its other headers, so a &lt;code&gt;POST&lt;/code&gt; that an allow lets through, such as GitHub&amp;rsquo;s GraphQL, carries whatever the VM sends there, and a deny of &lt;code&gt;POST&lt;/code&gt; refuses GraphQL&amp;rsquo;s reads too. A deny of &lt;code&gt;git-receive-pack&lt;/code&gt; blocks pushes over HTTPS alone, not over ssh on &lt;code&gt;github.com:22&lt;/code&gt; or through GitHub&amp;rsquo;s Git Data API.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;network&lt;/code&gt;): a host that only devvm network allow &lt;code&gt;--method GET --path&lt;/code&gt; allows, faked by the run&amp;rsquo;s company proxy, is decrypted with no secret bound to it. Two &lt;code&gt;GET&lt;/code&gt;s below the path reach it, while a &lt;code&gt;POST&lt;/code&gt; to the same path, a &lt;code&gt;GET&lt;/code&gt; elsewhere, and a &lt;code&gt;GET&lt;/code&gt; that names &lt;code&gt;POST&lt;/code&gt; in &lt;code&gt;X_HTTP_METHOD_OVERRIDE&lt;/code&gt; or in &lt;code&gt;?_method=&lt;/code&gt; get the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt;, never reach it, and are logged as &lt;code&gt;blocked&lt;/code&gt; with their method and path, which devvm network log shows. A secret of yours with &lt;code&gt;--method GET,HEAD&lt;/code&gt; goes into a &lt;code&gt;GET&lt;/code&gt; and leaves the placeholder in a &lt;code&gt;POST&lt;/code&gt; to the same host and path.&lt;/p&gt;
&lt;h2 data-hextra-search-id="transparent-mode"&gt;Transparent mode&lt;span class="hx:absolute hx:-mt-20" id="transparent-mode"&gt;&lt;/span&gt;
&lt;a href="#transparent-mode" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A confined VM&amp;rsquo;s tools that ignore the proxy settings, such as workerd under &lt;code&gt;wrangler dev&lt;/code&gt;, a static Go binary or a container made through Docker&amp;rsquo;s API, reach the VM&amp;rsquo;s proxy by the names they look up (&lt;a href="https://next.devvm.dev/docs/internals/network/#tools-that-skip-the-proxy"&gt;how&lt;/a&gt;). The design keeps three things: no DNS query and no connection leaves the VM but through its proxy, the host the proxy judges is the host it dials, and nothing new listens on the host or takes part in the backends.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;internal/proxy/transparent.go&lt;/code&gt;: the reserved target &lt;code&gt;TransparentHost&lt;/code&gt; (&lt;code&gt;transparent.devvm.proxy&lt;/code&gt;), the stand-in address &lt;code&gt;SentinelAddr&lt;/code&gt; (&lt;code&gt;198.18.0.1&lt;/code&gt;, in benchmarking&amp;rsquo;s &lt;code&gt;198.18.0.0/15&lt;/code&gt;, which clients such as workerd&amp;rsquo;s kj count as public and the floor counts as internal), &lt;code&gt;transparent&lt;/code&gt;&amp;rsquo;s &lt;code&gt;serve&lt;/code&gt;, &lt;code&gt;tls&lt;/code&gt;, &lt;code&gt;handler&lt;/code&gt; and &lt;code&gt;refusePage&lt;/code&gt;, &lt;code&gt;sniHost&lt;/code&gt;, and &lt;code&gt;policy.transparentPorts&lt;/code&gt; behind &lt;code&gt;/transparent/ports&lt;/code&gt;. &lt;code&gt;routeFor&lt;/code&gt; is the order every connection is judged in, &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s and the transparent path&amp;rsquo;s alike, and &lt;code&gt;carry&lt;/code&gt; is the one tunnel, its SNI check included. &lt;code&gt;Event.Via&lt;/code&gt; is &lt;code&gt;dns&lt;/code&gt; for the path&amp;rsquo;s events (&lt;code&gt;withVia&lt;/code&gt; for its requests). In the guest, &lt;code&gt;assets/guest/transparent.sh&lt;/code&gt; is &lt;code&gt;devvm-transparent&lt;/code&gt;, its ruleset (&lt;code&gt;render&lt;/code&gt;), its slots and its service, set up by &lt;code&gt;sync.sh&lt;/code&gt; when &lt;code&gt;netpolicy.TransparentAddr&lt;/code&gt; gives the setup the stand-in address: the VM runs confined (&lt;code&gt;backend.NetProxy&lt;/code&gt;) and its mode is on (&lt;code&gt;netpolicy.TransparentOf&lt;/code&gt;: the VM&amp;rsquo;s &lt;code&gt;net.transparent&lt;/code&gt;, else &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;transparent-proxy&lt;/code&gt;, else on). &lt;code&gt;layers/base.sh&lt;/code&gt; installs dnsmasq, socat and nftables, which changes base&amp;rsquo;s key.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Choices against the first design:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Listeners on the stand-in address, not on &lt;code&gt;127.0.77.1&lt;/code&gt;:&lt;/strong&gt; Docker&amp;rsquo;s containers reach a local address on the VM over its bridges, but a loopback one only with &lt;code&gt;route_localnet=1&lt;/code&gt;, the hole of CVE-2020-8558, which would open every loopback service of the VM to them. The port forwarder forwards only loopback and wildcard listeners, and &lt;code&gt;vmssh.dialAddr&lt;/code&gt; refuses the stand-in address by name too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;dnsmasq on the stand-in address alone:&lt;/strong&gt; a listener on &lt;code&gt;127.0.0.1:53&lt;/code&gt; could be forwarded to this machine&amp;rsquo;s loopback when you list port 53, giving the host&amp;rsquo;s programs the stand-in address for every name and putting their names in the VM&amp;rsquo;s log. A rule sends the VM&amp;rsquo;s own &lt;code&gt;127.0.0.1:53&lt;/code&gt; to dnsmasq instead, so nothing of transparent mode listens on loopback, and the forwarder never sees it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS to public servers, not &lt;code&gt;daemon.json&lt;/code&gt;:&lt;/strong&gt; Docker gives containers &lt;code&gt;8.8.8.8&lt;/code&gt; and &lt;code&gt;8.8.4.4&lt;/code&gt; when the host&amp;rsquo;s only name servers are on loopback, and an edit of &lt;code&gt;daemon.json&lt;/code&gt; would restart Docker and need undoing on the open tier. A rule sends DNS to any public address to dnsmasq, from the VM and the bridges, which also catches resolvers that tools hard-code, and so does DNS to the VM&amp;rsquo;s own name servers but loopback&amp;rsquo;s: Lima&amp;rsquo;s DHCP adds one beside &lt;code&gt;127.0.0.1&lt;/code&gt;, which systemd-resolved falls back on and Docker gives containers once it drops the loopback one, and the e2e run showed both failing without it. Other private, link-local, CGNAT and loopback addresses are left alone, so a DNS server on a container&amp;rsquo;s or the LAN&amp;rsquo;s address still answers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every other port refused, Docker&amp;rsquo;s published ports included:&lt;/strong&gt; the NAT chains run at -110, before Docker&amp;rsquo;s at -100, and give every TCP and UDP port of the stand-in address a mapping, to its listener, to dnsmasq, or to a port where nothing listens. Without that, Docker&amp;rsquo;s &lt;code&gt;DOCKER&lt;/code&gt; chain, which takes every local address but loopback, would send &lt;code&gt;db.example.com:5432&lt;/code&gt; to a container that publishes 5432, and a test suite would write into a local database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The ports from the proxy:&lt;/strong&gt; the proxy owns the policy and reads its files again when they change, so &lt;code&gt;devvm-transparent&lt;/code&gt; fetches &lt;code&gt;/transparent/ports&lt;/code&gt; every 10 seconds rather than devvm finding every command and hand edit that changes a rule.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The first bytes decide on every port:&lt;/strong&gt; HTTP and TLS each work on every redirected port, so a rule such as &lt;code&gt;api.internal.example:8080&lt;/code&gt; works for plain HTTP too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm.proxy&lt;/code&gt; reserved whole:&lt;/strong&gt; a name under it never reaches a link, a rule, a resolver or a company proxy, and neither does &lt;code&gt;CONNECT devvm.proxy:P&lt;/code&gt;, which has no endpoint; only absolute-form requests for &lt;code&gt;http://devvm.proxy/&lt;/code&gt; reach the endpoints.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never 22 or 53:&lt;/strong&gt; SSH names no host in its first bytes, and the VM&amp;rsquo;s ssh goes through &lt;code&gt;ProxyCommand&lt;/code&gt; already. 53 is the VM&amp;rsquo;s own names'.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link&amp;rsquo;s name refused on both ways:&lt;/strong&gt; dnsmasq gives a link&amp;rsquo;s name its &lt;code&gt;/etc/hosts&lt;/code&gt; address, never the stand-in address, so only a crafted client reaches a link through the reserved target, and both the TLS and the HTTP way refuse it, so the two agree.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, on the reserved target, the guest&amp;rsquo;s rules and the setup). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Naming one host and reaching another:&lt;/strong&gt; ruled out. The host is the SNI&amp;rsquo;s, or each request&amp;rsquo;s &lt;code&gt;Host&lt;/code&gt;, and the proxy dials that host by name after &lt;code&gt;routeFor&lt;/code&gt; judged it, then checks the replayed ClientHello&amp;rsquo;s SNI again (&lt;code&gt;carry&lt;/code&gt;). An interception&amp;rsquo;s leaf names the SNI host alone, and every request whose &lt;code&gt;Host&lt;/code&gt; or &lt;code&gt;:authority&lt;/code&gt; differs gets &lt;code&gt;421&lt;/code&gt; (&lt;code&gt;TestTransparentIntercept&lt;/code&gt;). Domain fronting and ECH&amp;rsquo;s outer name are what &lt;code&gt;CONNECT&lt;/code&gt; with the password reaches already.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets on the wrong host, or in plain HTTP:&lt;/strong&gt; ruled out. Interception is chosen from the SNI host alone, on 443, and a plain request is always forwarded as &lt;code&gt;http://&lt;/code&gt;, which never gets a secret (&lt;code&gt;TestTransparentHTTP&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SNI and Host shapes:&lt;/strong&gt; ruled out. No SNI, an address, a trailing dot, two names, a ClientHello split across records or cut short, a name &lt;code&gt;HostOK&lt;/code&gt; refuses and a name under &lt;code&gt;devvm.proxy&lt;/code&gt; are refused before the policy (&lt;code&gt;TestTransparentSNI&lt;/code&gt;, &lt;code&gt;FuzzTransparent&lt;/code&gt;). A name with anything but printable ASCII is refused before its case is folded, so the Kelvin sign never becomes &lt;code&gt;k&lt;/code&gt;, and the same holds for &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s target and its SNI check (&lt;code&gt;TestHostsNotASCII&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Holding the proxy&amp;rsquo;s memory or slots:&lt;/strong&gt; fixed. A transparent connection counts toward the 1024 tunnels and gets 10 seconds for its first bytes. A ClientHello record longer than 16 KiB and 256 bytes is never read, and on every tunnel a ClientHello that has started must arrive whole within 10 seconds (&lt;code&gt;TestTunnelHelloDeadline&lt;/code&gt;, &lt;code&gt;TestPeekClientHelloCap&lt;/code&gt;). The &lt;code&gt;403&lt;/code&gt; page&amp;rsquo;s TLS connection and an intercepted tunnel took 1 MiB of a request&amp;rsquo;s headers, where the proxy&amp;rsquo;s own listener takes 64 KiB. With the fix, every connection that the proxy serves HTTP on takes 64 KiB, and HTTP/2 inside one asks for at most 100 requests at once, where Go&amp;rsquo;s default is 250, each a request upstream (&lt;code&gt;serveOne&lt;/code&gt;, &lt;code&gt;TestServeOneHeaderLimit&lt;/code&gt;, &lt;code&gt;TestServeOneStreamsLimit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Requests left running, and idle connections:&lt;/strong&gt; fixed. A plain HTTP request, the transparent path&amp;rsquo;s included, went on after its client had gone, because the proxy can&amp;rsquo;t tell that from a half-close, so a VM could leave requests waiting on a host that never answers, past the connections it holds. Once its client stops sending, a request ends after a minute with nothing to pass on, while an answer that keeps coming still reaches a client that half-closed. A connection to the proxy waits at most 10 minutes between requests, and one without the password is closed after its &lt;code&gt;407&lt;/code&gt;. Only tunnels counted toward a limit, so the fix holds the proxy to at most 2048 connections of every kind at once, a request that outlives its client included, as &lt;code&gt;net/http&lt;/code&gt; closes its connection only once the handler returns (&lt;code&gt;maxConns&lt;/code&gt;). A connection counts from its first request with the password, and the ones that haven&amp;rsquo;t sent it wait in a pool of 128 where a new one closes the oldest (&lt;code&gt;maxWaiting&lt;/code&gt;), so an open VM that reaches another VM&amp;rsquo;s proxy port can&amp;rsquo;t take that VM&amp;rsquo;s room by holding connections through their 30 seconds for headers. Tunnels&amp;rsquo; HTTP/2 streams were bounded only for each tunnel, and every request upstream is a connection of its own, so 1024 tunnels could open about 100,000 connections to hosts. The proxy has at most 2048 requests upstream at once (&lt;code&gt;maxRequests&lt;/code&gt;). Each limit&amp;rsquo;s line in &lt;code&gt;proxy.log&lt;/code&gt; comes once a minute at most (&lt;code&gt;everyMinute&lt;/code&gt;). A plain &lt;code&gt;ws://&lt;/code&gt; upgrade got &lt;code&gt;502&lt;/code&gt;, because the request&amp;rsquo;s writer hid the hijack it needs, and with the fix it gets its &lt;code&gt;101&lt;/code&gt; (&lt;code&gt;TestPlainHTTPEndsWithClient&lt;/code&gt;, &lt;code&gt;TestProxyConnectionBounds&lt;/code&gt;, &lt;code&gt;TestProxyConnectionLimit&lt;/code&gt;, &lt;code&gt;TestProxyWaitingConnections&lt;/code&gt;, &lt;code&gt;TestUpstreamRequestLimit&lt;/code&gt;, &lt;code&gt;TestPlainWebSocket&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A flood of connections to another VM&amp;rsquo;s proxy:&lt;/strong&gt; listed. Connections without the password wait in their own pool, so holding them can&amp;rsquo;t take a VM&amp;rsquo;s room, but an open VM or a program on this machine that opens connections as fast as the host accepts them fills the kernel&amp;rsquo;s accept queue, and the VM&amp;rsquo;s own connections wait in it with them, or are evicted from the pool before their first request arrives. That slows the VM&amp;rsquo;s proxy for as long as the flood lasts, and ends with it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A ClientHello sent a byte, then late:&lt;/strong&gt; fixed, found in review. The deadline first made a record header that didn&amp;rsquo;t come whole read as &amp;ldquo;not TLS&amp;rdquo;, so a tunnel that sent &lt;code&gt;0x16&lt;/code&gt;, waited past it, then sent a ClientHello naming another host was carried unchecked, which the SNI check had refused before. A stream whose first byte is &lt;code&gt;0x16&lt;/code&gt; is TLS from then on: a header that doesn&amp;rsquo;t come whole, or whose version byte isn&amp;rsquo;t 3, is refused, and the far end gets nothing (&lt;code&gt;TestTunnelHelloStall&lt;/code&gt;, &lt;code&gt;FuzzClientHello&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A split ClientHello on an address&amp;rsquo;s tunnel:&lt;/strong&gt; fixed, found in review, older than transparent mode. A tunnel to an address may carry no server name, and a ClientHello that didn&amp;rsquo;t parse read as one without a name, so one split across two records, naming another host in the second, went on unchecked. Only a ClientHello that parsed whole counts now: one that doesn&amp;rsquo;t is refused, on every tunnel (&lt;code&gt;TestTunnelAddressSplitHello&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other bridges and protocols reaching Docker&amp;rsquo;s DNAT through the stand-in address:&lt;/strong&gt; fixed, found in review. The NAT chains map TCP and UDP alone, and only for &lt;code&gt;lo&lt;/code&gt;, &lt;code&gt;docker0&lt;/code&gt; and &lt;code&gt;br-*&lt;/code&gt;, so a published SCTP port, or a connection from Podman&amp;rsquo;s or LXD&amp;rsquo;s bridges, could reach a container through the stand-in address. Two filter chains at -150 drop both before any NAT chain (&lt;code&gt;TestTransparentRuleset&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s endpoints without the password:&lt;/strong&gt; fixed, found in review. socat adds the VM&amp;rsquo;s password for any client, so a container without the proxy settings reached &lt;code&gt;devvm.proxy&lt;/code&gt;&amp;rsquo;s CA, ports and Nix cache through &lt;code&gt;Host: devvm.proxy&lt;/code&gt;. On the transparent path that host reaches &lt;code&gt;/blocked&lt;/code&gt; alone (&lt;code&gt;TestTransparentHTTP&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names under the search domain:&lt;/strong&gt; listed. dnsmasq can&amp;rsquo;t tell a single-label name the resolver extended from a name a tool names whole, so every name under this machine&amp;rsquo;s network&amp;rsquo;s search domain gets no answer through transparent mode, &lt;code&gt;git.corp.example.com&lt;/code&gt; under &lt;code&gt;corp.example.com&lt;/code&gt; included. Such a host needs the tool&amp;rsquo;s proxy settings, as its address on the LAN or a company network would anyway.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A DNS server on the VM&amp;rsquo;s &lt;code&gt;127.0.0.1:53&lt;/code&gt;:&lt;/strong&gt; listed. The rule that sends the VM&amp;rsquo;s resolver to dnsmasq takes every connection to that address and port, a forward of port 53 that the user listed included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;via&lt;/code&gt; label:&lt;/strong&gt; listed. Whether a connection came through transparent mode is the VM&amp;rsquo;s own doing, as its &lt;code&gt;User-Agent&lt;/code&gt; is, so &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s heading for such hosts is a hint, not proof.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DNS out of the VM:&lt;/strong&gt; ruled out. dnsmasq has no upstream, the proxy asks the policy before it resolves a name, and the &lt;code&gt;403&lt;/code&gt; page resolves nothing, so a blocked name never reaches the host&amp;rsquo;s resolver. Root that gives dnsmasq an upstream, or stops the service, meets the host&amp;rsquo;s confinement, which the e2e checks prove with the service stopped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New exposure on the host:&lt;/strong&gt; ruled out. No listener, socket or sandbox rule is added on the host. socat&amp;rsquo;s connections are the VM&amp;rsquo;s own, to its own proxy, with its own password, which &lt;code&gt;/etc/environment&lt;/code&gt; gives every VM process already.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The listeners reached from the host or another network:&lt;/strong&gt; ruled out. Nothing listens on loopback, the forwarder refuses the stand-in address, and an input rule keeps every interface but &lt;code&gt;lo&lt;/code&gt; and Docker&amp;rsquo;s bridges off it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM&amp;rsquo;s password in arguments:&lt;/strong&gt; ruled out. The setup reads the proxy&amp;rsquo;s URL on stdin, and socat and curl read the password from root&amp;rsquo;s files, so &lt;code&gt;ps&lt;/code&gt; and the journal never show it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Containers without the proxy settings:&lt;/strong&gt; listed, within the threat model. A container made through Docker&amp;rsquo;s API, or with its proxy variables emptied, had no way out before, and now reaches what the VM&amp;rsquo;s policy allows, as every program in the VM does. &lt;code&gt;--network none&lt;/code&gt; gives a container no network, and an &lt;code&gt;--internal&lt;/code&gt; network&amp;rsquo;s containers reach nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What &lt;code&gt;/transparent/ports&lt;/code&gt; tells the VM:&lt;/strong&gt; listed. It&amp;rsquo;s the ports the VM&amp;rsquo;s rules name, the shared &lt;code&gt;~/.config/devvm/policy&lt;/code&gt;&amp;rsquo;s included, never their hosts. The VM can&amp;rsquo;t read its policy otherwise, and it can&amp;rsquo;t learn a rule&amp;rsquo;s port by trying without a host that matches it, so the list is a small disclosure that reaches nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learning:&lt;/strong&gt; listed. Tools that failed silently before, such as telemetry, now succeed on the learn tier and would be learned, so &lt;code&gt;devvm network lock&lt;/code&gt; lists the hosts that only they reached apart, under a heading of their own. A &lt;code&gt;tunnel&lt;/code&gt; event needs a dial that succeeded, so a VM can&amp;rsquo;t make learn list a host it never reached.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An open start after a confined one:&lt;/strong&gt; listed. The service is enabled at boot until that launch&amp;rsquo;s setup takes it out, a few seconds later. In that window its connections reach the VM&amp;rsquo;s proxy, which is open by then, so they reach what the open tier allows anyway, and its answers have a time to live of 0, so nothing keeps them after.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A running VM&amp;rsquo;s tier changed:&lt;/strong&gt; listed, by design. The setup decides by the confinement the VM runs with, so a confined VM made open keeps transparent mode on an open proxy until its next start, which reaches what the open tier allows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unprivileged in the VM:&lt;/strong&gt; listed. dnsmasq and each socat connection&amp;rsquo;s process run as &lt;code&gt;devvm-transparent&lt;/code&gt;, while socat&amp;rsquo;s listeners stay root&amp;rsquo;s, because socat drops its user only in each connection&amp;rsquo;s process. That&amp;rsquo;s hardening inside the VM, which the threat model doesn&amp;rsquo;t rely on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;): &lt;code&gt;network&lt;/code&gt;, on macOS and on a Linux host: the service runs, the stand-in address is on &lt;code&gt;lo&lt;/code&gt;, and dnsmasq and socat listen on that address alone; every name with a dot resolves to it, IPv6 has none at once, &lt;code&gt;/etc/hosts&lt;/code&gt;&amp;rsquo; names keep theirs, and a name without a dot that isn&amp;rsquo;t there resolves to nothing, though the VM&amp;rsquo;s resolver appends this machine&amp;rsquo;s network&amp;rsquo;s search domain to it; curl without proxy settings and a static Go client with its own resolver reach github.com with its own certificate, logged &lt;code&gt;without proxy settings&lt;/code&gt;; a blocked host gets the &lt;code&gt;403&lt;/code&gt; over the VM&amp;rsquo;s CA; port 5432 of a name is refused at once and &lt;code&gt;devvm-why&lt;/code&gt; names it; a port a rule names is redirected while the rule is there and refused at once after; your own servers bind &lt;code&gt;0.0.0.0:443&lt;/code&gt; and &lt;code&gt;:80&lt;/code&gt;; the service comes back when it&amp;rsquo;s killed or its table flushed; &lt;code&gt;devvm network transparent off&lt;/code&gt; takes it out at the next launch and &lt;code&gt;on&lt;/code&gt; puts it back; open, there&amp;rsquo;s none and names resolve with Lima&amp;rsquo;s DNS; with the service stopped, direct connections, DNS to Lima&amp;rsquo;s addresses and TCP to a public server&amp;rsquo;s port 53 still fail, and with it running a public DNS server and Lima&amp;rsquo;s DNS addresses answer only with the stand-in address, TTL 0, or nothing. In a VM of the docker layer, containers without proxy settings reach github.com on the default bridge and on a network of their own, a blocked host is logged, a container reaches no other port of the stand-in address and none of its listeners directly, a container&amp;rsquo;s published 5432 isn&amp;rsquo;t reached through the stand-in address from the VM or from another container, its published 443 doesn&amp;rsquo;t take the VM&amp;rsquo;s connections, and an &lt;code&gt;--internal&lt;/code&gt; network reaches nothing. &lt;code&gt;from&lt;/code&gt;: a Debian 12 VM and an Alpine one each pass the same checks on the allowlist tier, and with the service stopped, Lima&amp;rsquo;s DNS and a public server answer nothing.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-company-proxy"&gt;A company proxy&lt;span class="hx:absolute hx:-mt-20" id="a-company-proxy"&gt;&lt;/span&gt;
&lt;a href="#a-company-proxy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Behind a company proxy, nothing reaches the internet without going through it, so each VM&amp;rsquo;s proxy goes through it too (&lt;a href="https://next.devvm.dev/docs/internals/network/#through-a-company-proxy"&gt;how&lt;/a&gt;), and each build goes through a proxy of devvm&amp;rsquo;s for the build alone, which goes through it. The design keeps two things: the proxy still decides every request by the name the VM asked for, and the company proxy&amp;rsquo;s password reaches nothing of a VM&amp;rsquo;s or a build&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; the host&amp;rsquo;s &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;NO_PROXY&lt;/code&gt;, read from devvm&amp;rsquo;s environment (&lt;code&gt;backend.ReadHostProxy&lt;/code&gt;) when a VM&amp;rsquo;s proxy starts, or &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;[proxy]&lt;/code&gt; when the environment sets neither proxy (&lt;code&gt;settings.HostProxy&lt;/code&gt;), checked (&lt;code&gt;HostProxy.Upstream&lt;/code&gt;: only &lt;code&gt;http://&lt;/code&gt; proxies), and written into the proxy&amp;rsquo;s config, &lt;code&gt;proxy.json&lt;/code&gt; in the VM&amp;rsquo;s run folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt; (mode 600), as &lt;code&gt;upstream&lt;/code&gt; (&lt;code&gt;internal/proxy/upstream.go&lt;/code&gt;). &lt;code&gt;config.toml&lt;/code&gt; is a file people copy and keep with their dotfiles, so it never holds the password: its URL names the user, and the password is the &lt;code&gt;proxy&lt;/code&gt; secret (&lt;code&gt;proxy.UpstreamSecret&lt;/code&gt;), in the Keychain or devvm&amp;rsquo;s secrets folder, which the proxy looks up through &lt;code&gt;IO.Secret&lt;/code&gt; as it starts (&lt;code&gt;upstreamPassword&lt;/code&gt;), so no file of devvm&amp;rsquo;s holds it either. It&amp;rsquo;s a host-only secret (&lt;code&gt;secrets.Secret.HostOnly&lt;/code&gt;): no VM is ever bound to it. The proxy opens its own &lt;code&gt;CONNECT&lt;/code&gt; through the company proxy, by name, with &lt;code&gt;Proxy-Authorization: Basic&lt;/code&gt; from the URL, for tunnels and for the TLS connections it makes to put secrets in, which check the server against the system&amp;rsquo;s roots and the user&amp;rsquo;s CAs. Plain HTTP goes to the company proxy in absolute form. A change to the settings starts the VM&amp;rsquo;s proxy again at devvm&amp;rsquo;s next run, and an old proxy that won&amp;rsquo;t stop fails the start (&lt;code&gt;proxy_stop_failed&lt;/code&gt;) rather than run on with its old settings.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What an upstream changes:&lt;/strong&gt; the proxy resolves a name and dials the addresses it checked only when it connects directly. Through a company proxy, the company proxy resolves the name, so the floor can&amp;rsquo;t hold it to checked addresses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An address the VM asks for is judged as before, and &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;*.localhost&lt;/code&gt; and loopback and unspecified addresses never go upstream, so the floor refuses them as before unless a rule names them. A host whose last label is all digits or starts with &lt;code&gt;0x&lt;/code&gt; (&lt;code&gt;127.1&lt;/code&gt;, &lt;code&gt;2130706433&lt;/code&gt;, &lt;code&gt;0x7f000001&lt;/code&gt;) is refused as no host name (&lt;code&gt;hostOK&lt;/code&gt;), because a company proxy that reads it as &lt;code&gt;inet_aton&lt;/code&gt; does would reach an address the floor never judged.&lt;/li&gt;
&lt;li&gt;A name is refused when this machine&amp;rsquo;s resolver answers with any internal or denied address (&lt;code&gt;floorUpstream&lt;/code&gt;). The proxy looks it up absolute, as it does for a direct connection (&lt;code&gt;egress.lookupName&lt;/code&gt;), so this machine&amp;rsquo;s DNS search domain never turns &lt;code&gt;api&lt;/code&gt; into &lt;code&gt;api.corp.example.com&lt;/code&gt;, a name that no rule judged. A name this machine can&amp;rsquo;t resolve within three seconds goes upstream unjudged only when the policy names it, as itself or under &lt;code&gt;*.domain&lt;/code&gt; (&lt;code&gt;policy.byName&lt;/code&gt;). When only &lt;code&gt;**&lt;/code&gt; allows it, the proxy refuses it (&lt;code&gt;errUnresolved&lt;/code&gt;), because &lt;code&gt;**&lt;/code&gt; would otherwise send the company proxy any name the VM makes up, and the company proxy may resolve such a name to its own network&amp;rsquo;s hosts.&lt;/li&gt;
&lt;li&gt;The company proxy may still resolve a name differently, or later, than this machine did (DNS rebinding between the two lookups). It may also add its own search domain to any name it&amp;rsquo;s sent, before or after it tries the name as written, depending on its resolver. A Kubernetes pod&amp;rsquo;s resolver, for example, uses &lt;code&gt;ndots:5&lt;/code&gt;, so it tries the search domain first for any name with fewer than five dots. So a name that a rule names, such as &lt;code&gt;jenkins&lt;/code&gt;, may reach &lt;code&gt;jenkins.corp.example.com&lt;/code&gt; through it, and a name that resolves here may reach another under the company&amp;rsquo;s search domain there. A VM that controls a name under an allowed domain can choose the unjudged path: its name server can fail, or answer after the proxy&amp;rsquo;s three seconds, and then answer the company proxy with an internal address.&lt;/li&gt;
&lt;li&gt;So under a name the policy lists, a VM reaches whatever the company proxy reaches: its company&amp;rsquo;s internal hosts, and the company proxy&amp;rsquo;s own host, including this machine&amp;rsquo;s loopback when the company proxy runs on this machine (a local proxy that a VPN client runs, for example). Address denies apply only to the addresses this machine resolves. The allowlist stays the limit: a name the VM&amp;rsquo;s policy doesn&amp;rsquo;t allow never reaches the company proxy.&lt;/li&gt;
&lt;li&gt;The proxy reads at most 64 KiB of the company proxy&amp;rsquo;s answer to &lt;code&gt;CONNECT&lt;/code&gt; (&lt;code&gt;maxConnectReply&lt;/code&gt;), so an answer whose headers never end fails the request instead of filling memory.&lt;/li&gt;
&lt;li&gt;The company proxy sees every allowed host name and port, and with a CA in the user&amp;rsquo;s CA folder, it reads TLS too, as it does for this machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Credentials:&lt;/strong&gt; the company proxy&amp;rsquo;s user and password are in no process&amp;rsquo;s arguments (only the file&amp;rsquo;s path is), in no log (the event log&amp;rsquo;s &lt;code&gt;upstream&lt;/code&gt; field and the proxy&amp;rsquo;s own log name the company proxy as &lt;code&gt;host:port&lt;/code&gt;, and the URL the proxy&amp;rsquo;s HTTP transport uses has no user), and in no request but the company proxy&amp;rsquo;s own: the proxy drops the VM&amp;rsquo;s &lt;code&gt;Proxy-Authorization&lt;/code&gt; and sets the company proxy&amp;rsquo;s only for a request it sends there. The VM never sees them, not even in a refusal, which names the company proxy by &lt;code&gt;host:port&lt;/code&gt; and its status code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Builds:&lt;/strong&gt; a build runs code that isn&amp;rsquo;t devvm&amp;rsquo;s: layer scripts run third-party installers, and with &lt;code&gt;--from&lt;/code&gt;, the container image&amp;rsquo;s own shell and package manager run as root in the build VM. So a build never gets the company proxy&amp;rsquo;s settings. Behind a company proxy, each build goes through a proxy of devvm&amp;rsquo;s on the host for that build alone (&lt;code&gt;backend.ProxyStarter&lt;/code&gt;). It&amp;rsquo;s &lt;code&gt;devvm _proxy -config&lt;/code&gt; with the same config as a VM&amp;rsquo;s proxy (&lt;code&gt;proxy.Config&lt;/code&gt;): a policy file of &lt;code&gt;**&lt;/code&gt;, which allows any host on ports 80 and 443 but the host&amp;rsquo;s own and internal addresses, a new random password, the company proxy&amp;rsquo;s settings as its &lt;code&gt;upstream&lt;/code&gt;, and its &lt;code&gt;lifeline&lt;/code&gt; on the build VM&amp;rsquo;s hostagent, all in one file of mode 600. The build gets only &lt;code&gt;http://devvm:&amp;lt;password&amp;gt;@&amp;lt;host&amp;gt;:&amp;lt;port&amp;gt;&lt;/code&gt;, in each proxy variable the host sets, and the host&amp;rsquo;s &lt;code&gt;NO_PROXY&lt;/code&gt;. When the build ends, devvm stops that proxy and deletes its config, which holds the password and the company proxy&amp;rsquo;s, and a successful build&amp;rsquo;s folder goes too. The password is worthless once the proxy has stopped, and the build never sees the company proxy&amp;rsquo;s address, user or password. Without a company proxy, builds start no proxy and get no proxy settings.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima:&lt;/strong&gt; the build VM (an image&amp;rsquo;s, the tools build&amp;rsquo;s or &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion VM) reaches the proxy at &lt;code&gt;192.168.5.2&lt;/code&gt;, the host&amp;rsquo;s address on Lima&amp;rsquo;s user-mode network, with vz and with QEMU, and on macOS its Seatbelt profile allows that one port of the host&amp;rsquo;s loopback alongside its ssh port. The proxy runs on the host, so a company proxy on this machine&amp;rsquo;s loopback, such as one a VPN client runs, works for builds on macOS too. Lima&amp;rsquo;s &lt;code&gt;propagateProxyEnv&lt;/code&gt; would write the host&amp;rsquo;s proxy settings into the guest&amp;rsquo;s &lt;code&gt;/etc/environment&lt;/code&gt; between &lt;code&gt;#LIMA-START&lt;/code&gt; and &lt;code&gt;#LIMA-END&lt;/code&gt; at each boot (Lima&amp;rsquo;s &lt;code&gt;07-etc-environment.sh&lt;/code&gt;), and a stopped build VM&amp;rsquo;s disk would keep that block, so build VMs start with &lt;code&gt;propagateProxyEnv: false&lt;/code&gt;, and only a VM on Lima&amp;rsquo;s own network whose guest doesn&amp;rsquo;t name devvm&amp;rsquo;s proxy (&lt;code&gt;NetDirect&lt;/code&gt; without &lt;code&gt;Confinement.GuestProxy&lt;/code&gt;) starts with it on. Every project VM names its proxy, an open one&amp;rsquo;s included, so every project VM starts with it off, and its first start makes that change in the edit that adds its proxy to its environment. Lima also logs the proxy settings it reads, password and all, into devvm&amp;rsquo;s run log, so devvm runs &lt;code&gt;limactl&lt;/code&gt; without them, and only a start with &lt;code&gt;propagateProxyEnv&lt;/code&gt; on gets them back. Each build script gets the build proxy&amp;rsquo;s variables exported at its start, on its input with the script (&lt;code&gt;internal/backend/lima/buildproxy.go&lt;/code&gt;), and &lt;code&gt;/etc/sudoers.d/devvm-build-proxy&lt;/code&gt; keeps them for &lt;code&gt;sudo&lt;/code&gt; until the scripts end. The build proxy&amp;rsquo;s files and logs are in the build VM&amp;rsquo;s folder, in &lt;code&gt;run/builds/&amp;lt;name&amp;gt;/run/build-proxy/&lt;/code&gt; in devvm&amp;rsquo;s data folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion:&lt;/strong&gt; &lt;code&gt;oci/build.sh&lt;/code&gt; runs as root with the build proxy&amp;rsquo;s variables for crane. The container image&amp;rsquo;s own code runs only in a chroot under &lt;code&gt;env -i&lt;/code&gt;: the &lt;code&gt;/etc/os-release&lt;/code&gt; check gets &lt;code&gt;PATH&lt;/code&gt; alone, and &lt;code&gt;chroot_run&lt;/code&gt; (&lt;code&gt;bootify.sh&lt;/code&gt;, the CAs&amp;rsquo; &lt;code&gt;ca.sh&lt;/code&gt;) gets &lt;code&gt;PATH&lt;/code&gt;, &lt;code&gt;HOME&lt;/code&gt;, &lt;code&gt;LC_ALL&lt;/code&gt; and the build proxy&amp;rsquo;s variables, for &lt;code&gt;bootify.sh&lt;/code&gt;&amp;rsquo;s package downloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The build&amp;rsquo;s policy is &lt;code&gt;**&lt;/code&gt; alone, so on its own the build&amp;rsquo;s proxy would refuse every name this machine can&amp;rsquo;t resolve, and where only the company proxy resolves outside names, a build would reach nothing by name. Lima&amp;rsquo;s build proxies start with &lt;code&gt;upstream_unresolved&lt;/code&gt; in their config, which sends such names on to the company proxy unjudged. The refusal would protect little there, because without a company proxy those builds are on Lima&amp;rsquo;s user-mode network and reach internal addresses directly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (Lima):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;images&lt;/code&gt;: a layer built with a fake company proxy&amp;rsquo;s password in &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt; (a closed port, &lt;code&gt;NO_PROXY=*&lt;/code&gt;): its script and &lt;code&gt;sudo&lt;/code&gt; see the build&amp;rsquo;s proxy at &lt;code&gt;192.168.5.2&lt;/code&gt; with user &lt;code&gt;devvm&lt;/code&gt;, never the password, the build&amp;rsquo;s proxy is gone afterwards, and neither the image&amp;rsquo;s whole disk, nor Lima&amp;rsquo;s files for it, nor devvm&amp;rsquo;s logs hold the password;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from&lt;/code&gt;: a company proxy of the run&amp;rsquo;s own with a password, and a &lt;code&gt;--from alpine:3.21&lt;/code&gt; base, with every feature, and a layer on it: the registry, Alpine&amp;rsquo;s mirror and the layer&amp;rsquo;s own download reach the company proxy through the builds&amp;rsquo; proxies; what the layer&amp;rsquo;s commands and &lt;code&gt;sudo&lt;/code&gt; have is the build&amp;rsquo;s proxy with a password of its own; and the password is in no converted disk, image, log, build file or process&amp;rsquo;s arguments;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;network&lt;/code&gt;: a company proxy of the run&amp;rsquo;s own (a &lt;code&gt;devvm _proxy&lt;/code&gt; with a password, allowing any host): the VM&amp;rsquo;s next launch with it in devvm&amp;rsquo;s environment starts the VM&amp;rsquo;s proxy again with &lt;code&gt;-upstream&lt;/code&gt;; an allowed host goes through it by name (its event log) and the VM&amp;rsquo;s event log names it; a host the VM&amp;rsquo;s policy doesn&amp;rsquo;t allow gets &lt;code&gt;403&lt;/code&gt; and never reaches it; its password is in no process&amp;rsquo;s arguments, no log and nothing of the VM&amp;rsquo;s; the launch after, without it, starts the VM&amp;rsquo;s proxy again going directly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt; &lt;code&gt;https://&lt;/code&gt; and &lt;code&gt;socks5://&lt;/code&gt; company proxies, which devvm refuses (&lt;code&gt;upstream_proxy_scheme&lt;/code&gt;); proxy auto-configuration (PAC) files and the macOS system proxy, which devvm doesn&amp;rsquo;t read; Kerberos or NTLM authentication. An open VM goes through its proxy as every VM does, so no project VM gets the host&amp;rsquo;s settings in its &lt;code&gt;/etc/environment&lt;/code&gt;. What devvm&amp;rsquo;s redaction of Lima&amp;rsquo;s logs leaves open is under &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#this-machine"&gt;your company proxy&amp;rsquo;s password&lt;/a&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="one-form-of-a-host"&gt;One form of a host&lt;span class="hx:absolute hx:-mt-20" id="one-form-of-a-host"&gt;&lt;/span&gt;
&lt;a href="#one-form-of-a-host" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Every check that judges or compares a host reads it in one form, &lt;code&gt;proxy.NormHost&lt;/code&gt;&amp;rsquo;s, so a deny, a binding, a risk or a warning can never hold for one spelling of a host and miss another. &lt;code&gt;NormHost&lt;/code&gt; lowercases a host of printable ASCII, in ASCII alone, and drops its one trailing dot, unless the host is an address, whose dot can only be its IPv6 zone&amp;rsquo;s. Any other host keeps its case and its dots, and &lt;code&gt;HostOK&lt;/code&gt; refuses it, because Unicode&amp;rsquo;s case folding turns some letters into ASCII ones, such as the Kelvin sign into &lt;code&gt;k&lt;/code&gt;. A host with two trailing dots or more keeps them all, which &lt;code&gt;HostOK&lt;/code&gt; refuses, so &lt;code&gt;NormHost&lt;/code&gt; gives the same host however many times it runs, and a caller that reads a host again can&amp;rsquo;t turn &lt;code&gt;evil.test..&lt;/code&gt; into &lt;code&gt;evil.test&lt;/code&gt;. A matcher takes a &lt;code&gt;proxy.Host&lt;/code&gt;, which only &lt;code&gt;NormHost&lt;/code&gt; makes, and the structure test refuses another copy (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#the-checks-on-owners"&gt;the checks on owners&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The shapes each reader meets.&lt;/strong&gt; Each reader has a differential fuzz target (&lt;code&gt;FuzzHostSites&lt;/code&gt; in &lt;code&gt;internal/proxy&lt;/code&gt;, and one beside each reader elsewhere), which checks it against a frozen copy of the readers that each folded and trimmed a host its own way, and allows only these differences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A rule&amp;rsquo;s host and its &lt;code&gt;!&lt;/code&gt;&lt;/strong&gt; read exactly as the frozen copy reads them, so a line is the same rule or no rule, and a line that starts with &lt;code&gt;!&lt;/code&gt; but isn&amp;rsquo;t a rule is a broken deny, which makes the policy deny everything, never a valid deny. The frozen state&amp;rsquo;s policy files, bindings and links read the same too (&lt;code&gt;TestFixtureHosts&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two trailing dots&lt;/strong&gt; in a request&amp;rsquo;s host, an SNI or a host &lt;code&gt;Allows&lt;/code&gt; or &lt;code&gt;Denies&lt;/code&gt; judges stay, where the copy drops one. The proxy answers &lt;code&gt;400&lt;/code&gt; to both, and no rule but &lt;code&gt;**&lt;/code&gt; matches either spelling, while &lt;code&gt;**&lt;/code&gt; matches both.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The policy&amp;rsquo;s own matching&lt;/strong&gt; (&lt;code&gt;rulesFor&lt;/code&gt;, &lt;code&gt;quiet&lt;/code&gt;, &lt;code&gt;byName&lt;/code&gt;) and &lt;code&gt;devvm network lock&lt;/code&gt;&amp;rsquo;s risks and ticks don&amp;rsquo;t fold a host that isn&amp;rsquo;t ASCII, where the copy folds it in Unicode. Neither meets such a host, because the proxy refuses it before the policy sees it, and the lock judges only hosts the proxy took.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Brackets&lt;/strong&gt; hold only an IPv6 address, one pair of them, as in a rule, so &lt;code&gt;HostOK&lt;/code&gt; and &lt;code&gt;Host.Addr&lt;/code&gt; take an address bare or as &lt;code&gt;[::1]&lt;/code&gt;, never with a stray bracket, and &lt;code&gt;NormHost&lt;/code&gt; keeps a dot after a bracket (&lt;code&gt;[::1].&lt;/code&gt;), so that&amp;rsquo;s no address either. A request for &lt;code&gt;[evil.com]:443&lt;/code&gt;, &lt;code&gt;[1.2.3.4]:443&lt;/code&gt;, &lt;code&gt;1.2.3.4]&lt;/code&gt; or &lt;code&gt;[[::1]]&lt;/code&gt; gets &lt;code&gt;400&lt;/code&gt;, where &lt;code&gt;net.SplitHostPort&lt;/code&gt; or a trim took the brackets off and the name or address in them was judged. An SNI in brackets is refused as no host name rather than as an address.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An IPv6 address whose zone ends in a dot&lt;/strong&gt; keeps it, so &lt;code&gt;::1%.&lt;/code&gt; is the zoned address it is, where the copy dropped the dot and left &lt;code&gt;::1%&lt;/code&gt;, an empty zone, which is no address. The proxy answers &lt;code&gt;400&lt;/code&gt; to both, and an address with a zone is never the internet&amp;rsquo;s (&lt;code&gt;proxy.Public&lt;/code&gt;), so a promisor remote at one counts as private and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry at one isn&amp;rsquo;t public.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host with a stray bracket around an address is an address&lt;/strong&gt;, so an MCP server there (&lt;code&gt;https://1.2.3.4]/&lt;/code&gt;, whose hostname Go&amp;rsquo;s URL parser gives as &lt;code&gt;1.2.3.4]&lt;/code&gt;) gets no binding.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A line that isn&amp;rsquo;t a rule&lt;/strong&gt;, which devvm network rm and its duplicate check compare as text, matches another line only when the two differ in nothing but the case of ASCII letters and one trailing dot, so a Kelvin sign typed for a &lt;code&gt;k&lt;/code&gt; never names the rule with the &lt;code&gt;k&lt;/code&gt;, such as the deny &lt;code&gt;!kubernetes.io&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An SNI&amp;rsquo;s trailing dot&lt;/strong&gt; on the transparent path is dropped, as a request&amp;rsquo;s is. &lt;code&gt;crypto/tls&lt;/code&gt; refuses such a ClientHello, so none reaches it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;NO_PROXY&lt;/code&gt; name that isn&amp;rsquo;t ASCII&lt;/strong&gt; matches no host, so the Kelvin sign&amp;rsquo;s &lt;code&gt;kubernetes.io&lt;/code&gt; doesn&amp;rsquo;t send &lt;code&gt;kubernetes.io&lt;/code&gt; directly, and the request goes through the company proxy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;NO_PROXY&lt;/code&gt; entry with port &lt;code&gt;0&lt;/code&gt;&lt;/strong&gt;, which no request has, sends nothing directly, as one with a port past &lt;code&gt;65535&lt;/code&gt; doesn&amp;rsquo;t, where the copy read &lt;code&gt;git.test:0&lt;/code&gt; as &lt;code&gt;git.test&lt;/code&gt; on every port (found by &lt;code&gt;FuzzNoProxy&lt;/code&gt;). Neither does an entry whose port isn&amp;rsquo;t in plain decimal, such as &lt;code&gt;git.test:080&lt;/code&gt; or &lt;code&gt;git.test:+80&lt;/code&gt;, which Go&amp;rsquo;s clients match against no request, where the copy read it as port 80.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A secret&amp;rsquo;s &lt;code&gt;--host&lt;/code&gt; or an MCP server&amp;rsquo;s host that isn&amp;rsquo;t ASCII&lt;/strong&gt; is refused, as the proxy refuses it, rather than taken as the ASCII host its letters fold into.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s registry&lt;/strong&gt; isn&amp;rsquo;t on the internet when its name is one the proxy doesn&amp;rsquo;t take (&lt;code&gt;HostOK&lt;/code&gt;), such as one with anything but printable ASCII, a bracket that a trailing dot hid (&lt;code&gt;[::1].&lt;/code&gt;) or a shorthand address (&lt;code&gt;10.1&lt;/code&gt;), none of which a registry&amp;rsquo;s name is, so a registry is never more public than the copy finds it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A partial clone&amp;rsquo;s promisor remote&lt;/strong&gt; loses its trailing dot, so a warning names &lt;code&gt;example.com&lt;/code&gt; rather than &lt;code&gt;example.com.&lt;/code&gt;, and &lt;code&gt;localhost.&lt;/code&gt; or &lt;code&gt;127.0.0.1.&lt;/code&gt; counts as private, as the proxy refuses it. The Kelvin sign isn&amp;rsquo;t folded.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A remote&amp;rsquo;s ssh host&lt;/strong&gt;, which finds a VM&amp;rsquo;s alias in the ssh config, keeps its own reading, lowercased with its trailing dot kept, as ssh reads it, because it&amp;rsquo;s no host a policy judges.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-desktop"&gt;The desktop&lt;span class="hx:absolute hx:-mt-20" id="the-desktop"&gt;&lt;/span&gt;
&lt;a href="#the-desktop" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm desktop&lt;/code&gt; shows a VM&amp;rsquo;s desktop on this machine with VNC, and keeps two things: no one on this machine or the network reaches the desktop without the VM&amp;rsquo;s password, and the desktop gives the VM no new way out. Both hold whatever the VM&amp;rsquo;s own server does, because root in the VM can replace it (&lt;a href="https://next.devvm.dev/docs/internals/desktop/"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; the built-in &lt;code&gt;desktop&lt;/code&gt; layer (&lt;code&gt;assets/layers/desktop.sh&lt;/code&gt;): Xfce and TigerVNC&amp;rsquo;s &lt;code&gt;Xvnc&lt;/code&gt; from the distribution&amp;rsquo;s archive, and &lt;code&gt;/usr/local/bin/devvm-desktop&lt;/code&gt;, which starts &lt;code&gt;Xvnc&lt;/code&gt; on a socket of the VM&amp;rsquo;s user&amp;rsquo;s own (&lt;code&gt;/run/devvm-desktop/vnc.sock&lt;/code&gt;, mode 600 in a 700 folder), with no TCP port and no password, then an Xfce session. On this machine, &lt;code&gt;internal/desktop&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Relay&lt;/code&gt;, which &lt;code&gt;devvm desktop&lt;/code&gt; runs (&lt;code&gt;internal/vm/desktop.go&lt;/code&gt;): a listener on &lt;code&gt;127.0.0.1&lt;/code&gt; alone (&lt;code&gt;platform.ListenLoopback&lt;/code&gt;, without address reuse), on the port the VM&amp;rsquo;s state records (the &lt;code&gt;ports&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;host.desktop&lt;/code&gt;, chosen by &lt;code&gt;ports.Allocator&lt;/code&gt; and among &lt;code&gt;ports.Used&lt;/code&gt;), and for each viewer that passes its check, an &lt;code&gt;ssh -W&lt;/code&gt; channel to the socket through devvm&amp;rsquo;s ssh config&amp;rsquo;s entry for the VM. Only a VM made with the layer has the desktop (&lt;code&gt;image.DesktopLayer&lt;/code&gt;), because it adds about 370 MB to an image, so &lt;code&gt;base&lt;/code&gt; and the VMs without it stay that much smaller.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why devvm&amp;rsquo;s own relay, not the port forwarder:&lt;/strong&gt; the forwarder forwards every port a VM listens on from its start, on the same port number. A VNC server on a port would have been on this machine&amp;rsquo;s loopback at every start, without anyone running &lt;code&gt;devvm desktop&lt;/code&gt;, on a port another VM&amp;rsquo;s desktop or macOS&amp;rsquo;s own Screen Sharing server (5900) can have. The relay is open only while &lt;code&gt;devvm desktop&lt;/code&gt; runs, on a port of the VM&amp;rsquo;s own, and checks the password itself, which the forwarder, a byte copier, can&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The password:&lt;/strong&gt; VNC&amp;rsquo;s own authentication (RFB security type 2: DES of a 16-byte challenge, &lt;code&gt;desktop.Response&lt;/code&gt;) is what macOS&amp;rsquo;s Screen Sharing speaks to a server that isn&amp;rsquo;t a Mac, and it takes 8 characters. devvm&amp;rsquo;s are random, from 31 characters (about 40 bits), checked one at a time with a second&amp;rsquo;s wait after a wrong one, so an online guess takes thousands of years. The relay checks it before it starts any ssh, so a wrong viewer costs the VM nothing. It&amp;rsquo;s kept in the VM&amp;rsquo;s state (the &lt;code&gt;desktop&lt;/code&gt; section&amp;rsquo;s &lt;code&gt;made.password&lt;/code&gt;, mode 600), shown only with the address (&lt;code&gt;desktop_ready&lt;/code&gt;, a message, not the run log), and never sent to the VM, so a VM can&amp;rsquo;t use it to reach its own desktop&amp;rsquo;s port. Screen Sharing gets the address alone (&lt;code&gt;open vnc://127.0.0.1:PORT&lt;/code&gt;), not the password, which would be in &lt;code&gt;open&lt;/code&gt;&amp;rsquo;s arguments where any process on this machine reads them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What keeps the VNC connection from carrying the VM out.&lt;/strong&gt; Every connection starts on this machine: a viewer connects to the relay, and the relay asks devvm&amp;rsquo;s ssh for a local channel (&lt;code&gt;-W&lt;/code&gt;) that the VM&amp;rsquo;s sshd connects to the VM&amp;rsquo;s own socket. The ssh asks for no session, agent, X11, tunnel or remote forward, and OpenSSH&amp;rsquo;s client refuses a channel the server opens unasked, as for &lt;a href="#ports-on-lima"&gt;the forwarder&lt;/a&gt;. What the VM sends back goes only to the viewer that connected. The VM&amp;rsquo;s server reaches nothing on this machine, so the VM&amp;rsquo;s tier holds as it is: the VM&amp;rsquo;s own connections still reach only its proxy, and devvm allows no new host for the desktop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The clipboard:&lt;/strong&gt; off unless &lt;code&gt;--clipboard&lt;/code&gt;. Without it, &lt;code&gt;Xvnc&lt;/code&gt; starts with &lt;code&gt;AcceptCutText&lt;/code&gt;, &lt;code&gt;SendCutText&lt;/code&gt;, &lt;code&gt;SetPrimary&lt;/code&gt; and &lt;code&gt;SendPrimary&lt;/code&gt; off, and the relay drops every &lt;code&gt;ClientCutText&lt;/code&gt; from the viewer, extended clipboard ones too (&lt;code&gt;internal/desktop/filter.go&lt;/code&gt;). It reads the viewer&amp;rsquo;s messages by their lengths (RFC 6143&amp;rsquo;s and the extensions TigerVNC offers: fences, continuous updates, desktop size, xvp, GII, QEMU&amp;rsquo;s key and audio events) and ends the connection on a type it doesn&amp;rsquo;t know, so nothing it can&amp;rsquo;t read reaches the VM. The other way, from the VM to the viewer, isn&amp;rsquo;t read: following the server&amp;rsquo;s &lt;code&gt;ServerCutText&lt;/code&gt; would mean decoding every screen update&amp;rsquo;s encoding. A VM whose server was changed can send its clipboard to the viewer, so Screen Sharing&amp;rsquo;s Use Shared Clipboard setting is what keeps it off this machine then.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The local proxy, for browsers:&lt;/strong&gt; Chrome, Chromium and Firefox ignore the password in the VM&amp;rsquo;s &lt;code&gt;HTTP_PROXY&lt;/code&gt; and ask for it on every site, so the desktop&amp;rsquo;s session uses &lt;code&gt;devvm-local-proxy&lt;/code&gt; instead (&lt;a href="https://next.devvm.dev/docs/internals/desktop/#the-local-proxy"&gt;how&lt;/a&gt;), which the guest setup writes (&lt;code&gt;assets/guest/sync.sh&lt;/code&gt;) and &lt;code&gt;socat&lt;/code&gt; serves. It gives no program a power it lacked, because the password it adds is the one the VM&amp;rsquo;s environment already holds, and every program in the VM can read it there. What it must not do is hand the password to anything outside the VM, or send it anywhere but the VM&amp;rsquo;s proxy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Where it listens:&lt;/strong&gt; &lt;code&gt;127.0.77.1:3128&lt;/code&gt; (&lt;code&gt;proxy.LocalProxyAddr&lt;/code&gt;, &lt;code&gt;proxy.LocalProxyPort&lt;/code&gt;), on the VM&amp;rsquo;s loopback alone (&lt;code&gt;bind=&lt;/code&gt;), taking connections from &lt;code&gt;127.0.0.0/8&lt;/code&gt; alone (&lt;code&gt;range=&lt;/code&gt;). The port forwarder never forwards a server on that address (&lt;code&gt;vmssh&lt;/code&gt;&amp;rsquo;s &lt;code&gt;dialAddr&lt;/code&gt;, &lt;code&gt;proxy.IsLocalProxyAddr&lt;/code&gt;), so a VM that forwards every port doesn&amp;rsquo;t put a proxy that needs no password on this machine&amp;rsquo;s &lt;code&gt;localhost&lt;/code&gt;, where other users and programs would reach the VM&amp;rsquo;s proxy, and its secrets, without the password.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where the password goes:&lt;/strong&gt; only to the VM&amp;rsquo;s proxy, whose address is written into the script with the password, never to an address a request names. It&amp;rsquo;s in the one &lt;code&gt;Proxy-Authorization&lt;/code&gt; header the local proxy adds, after it drops the client&amp;rsquo;s, and devvm&amp;rsquo;s proxy removes that header before it forwards a request. A &lt;code&gt;CONNECT&lt;/code&gt;&amp;rsquo;s tunnel carries nothing of the local proxy&amp;rsquo;s after its head.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web pages:&lt;/strong&gt; a page can reach the loopback as a server, but its requests are in origin form (&lt;code&gt;GET /&lt;/code&gt;), which the local proxy refuses with &lt;code&gt;400&lt;/code&gt; before it connects anywhere. A page can&amp;rsquo;t send a &lt;code&gt;CONNECT&lt;/code&gt; or an absolute-form request line, and DNS rebinding changes only the &lt;code&gt;Host&lt;/code&gt; header, so a page can&amp;rsquo;t use the local proxy to reach the VM&amp;rsquo;s proxy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One request per connection:&lt;/strong&gt; a request that isn&amp;rsquo;t a &lt;code&gt;CONNECT&lt;/code&gt; goes with &lt;code&gt;Connection: close&lt;/code&gt;, because the local proxy reads only a connection&amp;rsquo;s first head, so no later request on the connection reaches the VM&amp;rsquo;s proxy without the password, as it would otherwise get &lt;code&gt;407&lt;/code&gt; and the browser&amp;rsquo;s prompt.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The file:&lt;/strong&gt; &lt;code&gt;/usr/local/bin/devvm-local-proxy&lt;/code&gt; holds the password, mode 700 and the VM&amp;rsquo;s user&amp;rsquo;s, which is stricter than the VM&amp;rsquo;s &lt;code&gt;/etc/environment&lt;/code&gt;, where the same password already is.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tier holds as it is: the VM&amp;rsquo;s proxy decides each request the local proxy sends, and a host the tier doesn&amp;rsquo;t allow gets its &lt;code&gt;403&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;desktop&lt;/code&gt; (Lima): a VM of base without the desktop&amp;rsquo;s programs, which &lt;code&gt;devvm desktop&lt;/code&gt; refuses (&lt;code&gt;desktop_no_layer&lt;/code&gt;); then a VM with the &lt;code&gt;desktop&lt;/code&gt; layer on the allowlist tier: the relay on &lt;code&gt;127.0.0.1&lt;/code&gt; alone, its port and password in the VM&amp;rsquo;s state; a wrong password refused, the password let in, with the VM&amp;rsquo;s ServerInit and a screen update (&lt;code&gt;TestE2EDesktop&lt;/code&gt;); &lt;code&gt;Xvnc&lt;/code&gt; on its user&amp;rsquo;s socket (700, 600) and no TCP port, the clipboard off; the password in no file of the VM&amp;rsquo;s, no run log and no host process&amp;rsquo;s arguments while &lt;code&gt;devvm desktop&lt;/code&gt; started; the self-check passed and no direct connection out, nor to the desktop&amp;rsquo;s port on this machine; the Xfce session&amp;rsquo;s proxy variables set to the local proxy, which listens on &lt;code&gt;127.0.77.1:3128&lt;/code&gt; alone, takes curl without a password to an allowed host, gives a blocked one the proxy&amp;rsquo;s &lt;code&gt;403&lt;/code&gt; (&lt;code&gt;CONNECT&lt;/code&gt; and plain HTTP), refuses an origin-form request with &lt;code&gt;400&lt;/code&gt;, and isn&amp;rsquo;t forwarded to this machine; root&amp;rsquo;s own server in place of &lt;code&gt;Xvnc&lt;/code&gt; (no password, its socket anyone&amp;rsquo;s, recording what reaches it): a wrong viewer never reaches it, and the viewer&amp;rsquo;s clipboard never does while its key event does; Ctrl+C closing the port; &lt;code&gt;--clipboard&lt;/code&gt; on the same port, the clipboard on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt; the VM&amp;rsquo;s clipboard sent to a viewer that takes it, by a server root changed; Screen Sharing itself, which no check drives, so its messages are the relay&amp;rsquo;s reading of the protocol; a program on this machine with the password, which reaches the desktop as you do; a program on this machine, or a VM that reaches this machine&amp;rsquo;s loopback, that keeps the relay&amp;rsquo;s 8 connections busy or keeps failing its check, which keeps viewers out for as long as it does, and gets no further; the browsers themselves, which no check drives, so that they read the session&amp;rsquo;s proxy variables rests on Chrome&amp;rsquo;s and Firefox&amp;rsquo;s documented behavior on Xfce, and the local proxy&amp;rsquo;s handling of requests on its unit test (&lt;code&gt;netpolicy&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TestLocalProxy&lt;/code&gt;) and curl.&lt;/p&gt;
&lt;h2 data-hextra-search-id="pasting-images"&gt;Pasting images&lt;span class="hx:absolute hx:-mt-20" id="pasting-images"&gt;&lt;/span&gt;
&lt;a href="#pasting-images" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm paste&lt;/code&gt; gets an image, a PDF, or one copied file, from this machine&amp;rsquo;s clipboard to an agent in the VM (&lt;a href="https://next.devvm.dev/docs/using/coding-agents/#pasting-images"&gt;how&lt;/a&gt;). It keeps four things. The VM gets the clipboard only when you run the command, and only an image, a PDF or a copied file. A copied file goes only after you say yes to its path on this machine (&lt;code&gt;paste_file_ask&lt;/code&gt;), because the clipboard can name any file of yours, such as one a web page or another program put there. Nothing the VM says reaches your clipboard. And devvm leaves no process of its own running for it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--send-file&lt;/code&gt; answers the question only for a file below the folder the VM mounts, which the VM can read already. &lt;code&gt;confirmFile&lt;/code&gt; decides with &lt;code&gt;sendFileAnswers&lt;/code&gt;: &lt;code&gt;inFolder&lt;/code&gt; compares the cleaned path that &lt;code&gt;OpenNoLinks&lt;/code&gt; opened with the folder&amp;rsquo;s physical path, and &lt;code&gt;OpenNoLinks&lt;/code&gt; must have followed no link at all, because a root-owned link below the folder, such as one a root container made on a Linux host, can lead anywhere. It never answers for a &lt;code&gt;--clone&lt;/code&gt; VM. A file anywhere else is refused where devvm can&amp;rsquo;t ask (&lt;code&gt;paste_file_outside&lt;/code&gt;), and so is one reached through a link (&lt;code&gt;paste_file_through_link&lt;/code&gt;), so a hotkey or a script can&amp;rsquo;t send a file it never showed. There&amp;rsquo;s no list of credential folders that devvm refuses outright, because it could never name every place a key is kept, and the question shows every path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;internal/platform&lt;/code&gt;&amp;rsquo;s clipboard readers, &lt;code&gt;vm.Paste&lt;/code&gt;, and &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On macOS, &lt;code&gt;clipboard_darwin.go&lt;/code&gt; runs &lt;code&gt;osascript&lt;/code&gt; with a JavaScript for Automation script through &lt;code&gt;NSPasteboard&lt;/code&gt;. The script takes a PDF (&lt;code&gt;com.adobe.pdf&lt;/code&gt;) first, as it is, before the picture of it and the temporary file of its own that Preview puts beside it. Then it asks for file URLs alone (&lt;code&gt;readObjectsForClasses&lt;/code&gt; with &lt;code&gt;NSPasteboardURLReadingFileURLsOnlyKey&lt;/code&gt;), counts several and reports one&amp;rsquo;s path. Otherwise it writes a PNG, JPEG, GIF or WebP as it is, or a TIFF made a PNG, to a file in a private folder devvm makes and deletes, only when it&amp;rsquo;s within the cap. The copy back is &lt;code&gt;pbcopy&lt;/code&gt;. Both tools run by their paths in &lt;code&gt;/usr/bin&lt;/code&gt;, never found on &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On Linux, &lt;code&gt;clipboard_linux.go&lt;/code&gt; runs &lt;code&gt;wl-paste --list-types&lt;/code&gt; and &lt;code&gt;--type&lt;/code&gt; on Wayland, and &lt;code&gt;xclip&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TARGETS&lt;/code&gt; and &lt;code&gt;-t&lt;/code&gt; on X11, taking &lt;code&gt;application/pdf&lt;/code&gt; before a file reference and the image types. The copy back is &lt;code&gt;wl-copy&lt;/code&gt; or &lt;code&gt;xclip -i&lt;/code&gt;. Each comes from the first of &lt;code&gt;/usr/bin&lt;/code&gt;, &lt;code&gt;/bin&lt;/code&gt;, &lt;code&gt;/usr/local/bin&lt;/code&gt; and NixOS&amp;rsquo;s &lt;code&gt;/run/current-system/sw/bin&lt;/code&gt; that has it, never from &lt;code&gt;PATH&lt;/code&gt;, because &lt;code&gt;PATH&lt;/code&gt; can hold a project&amp;rsquo;s folder, such as direnv&amp;rsquo;s &lt;code&gt;PATH_add&lt;/code&gt; or &lt;code&gt;node_modules/.bin&lt;/code&gt;, and the VM writes those.&lt;/p&gt;
&lt;p&gt;Every clipboard tool runs with &lt;code&gt;exec.CommandContext&lt;/code&gt; (&lt;code&gt;clipboard_tool.go&lt;/code&gt;), and devvm reads its output, never through the run log, so the image stays out of it. Each tool is stopped after 30 seconds, as a tool waits on a program that holds the clipboard and doesn&amp;rsquo;t answer: a read gives &lt;code&gt;paste_tool_slow&lt;/code&gt;, and a copy back gives a warning. Its pipes are closed a second after it ends, as a child of its may keep them.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;vm.Paste&lt;/code&gt; (&lt;code&gt;internal/vm/paste.go&lt;/code&gt;) finds the VM as every command does, refuses a stopped one, and reads the clipboard before touching the VM. It names the file on this machine: &lt;code&gt;paste-YYYYMMDD-HHMMSS-8hex&lt;/code&gt;, then the image&amp;rsquo;s or the PDF&amp;rsquo;s extension, or the copied file&amp;rsquo;s when it&amp;rsquo;s letters and digits alone and at most 16 of them, and nothing else of the file&amp;rsquo;s name. It runs &lt;code&gt;assets/guest/paste.sh&lt;/code&gt; in the VM as &lt;code&gt;sh -c&lt;/code&gt;&amp;rsquo;s script, so nothing of it is left on disk. &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt; (&lt;code&gt;settings.PasteDir&lt;/code&gt;) is the folder in every VM, which each launch makes through &lt;code&gt;sync.sh&lt;/code&gt; (&lt;code&gt;DEVVM_PASTE_DIR&lt;/code&gt;), mode 700 and the user&amp;rsquo;s own.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why push, not pull.&lt;/strong&gt; A VM that pulls the clipboard on Ctrl+V, through a stand-in &lt;code&gt;xclip&lt;/code&gt; and a channel to this machine, would need three things. It would need a server of devvm&amp;rsquo;s on this machine for as long as a session lasts, and devvm runs &lt;code&gt;limactl shell&lt;/code&gt; in its own place, so no devvm process exists during a session. It would need a remote forward into the VM&amp;rsquo;s sshd, which allows them on &lt;code&gt;127.77.0.0/16&lt;/code&gt; alone, for links. And anything in the VM could read your clipboard at any moment while a session is open, a screenshot of your password manager included. With push, only the host starts the transfer, and only an image, a PDF or a file crosses. Stand-ins for &lt;code&gt;xclip&lt;/code&gt; and &lt;code&gt;wl-paste&lt;/code&gt; in the VM would reach only Claude Code and pi, because Codex and opencode read X11 or Wayland in their own process, and both already handle a pasted path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the VM can&amp;rsquo;t do.&lt;/strong&gt; It can&amp;rsquo;t ask for the clipboard, because devvm reads it once, when you run the command. devvm asks only for a file&amp;rsquo;s reference, a PDF and image types, never text, then checks an image&amp;rsquo;s or a PDF&amp;rsquo;s bytes against the type (&lt;code&gt;http.DetectContentType&lt;/code&gt;, for which a PDF starts with &lt;code&gt;%PDF-&lt;/code&gt;). Text is never taken for a file. AppleScript&amp;rsquo;s &lt;code&gt;the clipboard as «class furl»&lt;/code&gt; makes any text a path, &lt;code&gt;/Users/you/.ssh/id_ed25519&lt;/code&gt; as it is and &lt;code&gt;hello&lt;/code&gt; as &lt;code&gt;/hello&lt;/code&gt;, so the macOS reader asks &lt;code&gt;NSPasteboard&lt;/code&gt; for file URLs alone, which text never gives. A copied file whose path can&amp;rsquo;t be found is refused (&lt;code&gt;paste_file_gone&lt;/code&gt;) rather than Finder&amp;rsquo;s icon beside it sent.&lt;/p&gt;
&lt;p&gt;It can&amp;rsquo;t write to your clipboard. The path is built on this machine from &lt;code&gt;paste-dir&lt;/code&gt; and a name devvm picks, both from a fixed set of characters, before the VM runs anything. Of a copied file&amp;rsquo;s own name only its extension is kept, letters and digits alone, because a file in the project folder is named by the VM. So what reaches your clipboard is devvm&amp;rsquo;s own path, with no space, quote or newline in it, which can&amp;rsquo;t run anything when you paste it into a terminal.&lt;/p&gt;
&lt;p&gt;It can&amp;rsquo;t keep devvm reading or waiting. The one thing devvm reads back from the VM is a count, parsed as a whole number from bounded output. Each of &lt;code&gt;paste.sh&lt;/code&gt;&amp;rsquo;s commands is stopped once it prints past 32 bytes on stdout or 4 MiB on stderr, so a VM that prints without end can&amp;rsquo;t keep devvm reading. It&amp;rsquo;s also stopped past its time, 10 minutes for &lt;code&gt;put&lt;/code&gt;, which carries up to 64 MiB, and 2 for &lt;code&gt;count&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt;, so a VM that never answers can&amp;rsquo;t keep devvm waiting. The command then fails as it does for any other failure of the script (&lt;code&gt;paste_not_sent&lt;/code&gt;, &lt;code&gt;paste_count_failed&lt;/code&gt;, &lt;code&gt;paste_rm_not_done&lt;/code&gt;). It gets no SSH agent, because the writes and counts go through the backend&amp;rsquo;s &lt;code&gt;Exec&lt;/code&gt; as it is, never &lt;code&gt;target.exec&lt;/code&gt;, as the clone checks do.&lt;/p&gt;
&lt;p&gt;It can&amp;rsquo;t send a file of yours through a link. A copied file may be in the project folder, which the VM writes, so its path is cleaned, never resolved first, and opened as named following no link but the system&amp;rsquo;s. &lt;code&gt;platform.OpenNoLinks&lt;/code&gt; opens each component from its parent with &lt;code&gt;O_NOFOLLOW&lt;/code&gt;, through &lt;code&gt;golang.org/x/sys/unix&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Openat&lt;/code&gt;, because the standard library exports no &lt;code&gt;Openat&lt;/code&gt; on macOS and &lt;code&gt;internal/safefile&lt;/code&gt; is standard library only. It reads a link on the way with &lt;code&gt;Readlinkat&lt;/code&gt; and follows it only when &lt;code&gt;Fstatat&lt;/code&gt; says root owns it, and the folder&amp;rsquo;s &lt;code&gt;Fstat&lt;/code&gt; says root owns that too and neither its group nor others can write it, as for macOS&amp;rsquo;s &lt;code&gt;/tmp&lt;/code&gt;, &lt;code&gt;/var&lt;/code&gt; and &lt;code&gt;/etc&lt;/code&gt; in &lt;code&gt;/&lt;/code&gt;, for at most 40 hops. Root owning the link isn&amp;rsquo;t enough on its own, because a link of root&amp;rsquo;s can be hard-linked into a folder of yours, and in a folder only root can change, no one else can swap the link between its &lt;code&gt;Fstatat&lt;/code&gt; and its &lt;code&gt;Readlinkat&lt;/code&gt;. It never follows the file itself, and it opens it with &lt;code&gt;O_NONBLOCK&lt;/code&gt; and &lt;code&gt;O_NOCTTY&lt;/code&gt;, so a FIFO never makes devvm wait and a terminal never becomes devvm&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;A link the VM makes in a mount is the user&amp;rsquo;s on this machine, never root&amp;rsquo;s. So a link in the file&amp;rsquo;s place, a folder&amp;rsquo;s link planted before the copy or swapped in after it, and a copied folder&amp;rsquo;s reference whose trailing slash hid a link all fail (&lt;code&gt;paste_file_link&lt;/code&gt;) rather than send what they point to, and your own links do too. Every step goes through a file descriptor, so there&amp;rsquo;s no moment for a swap between a check and the open. The file opened is then checked and read as every file a VM can write is, by &lt;code&gt;internal/safefile&lt;/code&gt; (&lt;code&gt;Checked&lt;/code&gt;, then &lt;code&gt;ReadAll&lt;/code&gt;): a regular file within the cap of 64 MiB, the cap an image is held to as well.&lt;/p&gt;
&lt;p&gt;In the VM, &lt;code&gt;paste.sh&lt;/code&gt; writes with &lt;code&gt;umask 077&lt;/code&gt; to a &lt;code&gt;.part&lt;/code&gt; name and renames it, and it refuses a &lt;code&gt;paste-dir&lt;/code&gt; that&amp;rsquo;s a link, not a folder or not the user&amp;rsquo;s. Its &lt;code&gt;count&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; see only regular files at the folder&amp;rsquo;s top level with devvm&amp;rsquo;s names, never anything else in a folder that may be yours. Root in the VM can get around any check the VM runs, which gives it nothing it couldn&amp;rsquo;t do to a file in the project folder.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What&amp;rsquo;s left on this machine:&lt;/strong&gt; on Linux, &lt;code&gt;wl-copy&lt;/code&gt; or &lt;code&gt;xclip&lt;/code&gt; serves the path until you copy something else, because a Linux clipboard&amp;rsquo;s contents live in the program that copied them. It isn&amp;rsquo;t devvm&amp;rsquo;s process, and devvm runs it with no pipes on its output, because Go&amp;rsquo;s &lt;code&gt;Wait&lt;/code&gt; waits for a child that inherited them. On macOS, nothing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section): with stand-in clipboard tools in a test build&amp;rsquo;s &lt;code&gt;DEVVM_CLIP_TOOLS&lt;/code&gt;, &lt;code&gt;devvm paste --json&lt;/code&gt; puts the copied image into the running VM, where its SHA-256 matches, mode 600 in the folder of mode 700, and the stand-in copier got the path. &lt;code&gt;devvm paste rm --force&lt;/code&gt; deletes it and leaves a file of the user&amp;rsquo;s in the folder, and a stopped VM is refused before the clipboard is read.&lt;/p&gt;
&lt;p&gt;The CLI tests (&lt;code&gt;testdata/script/paste.txtar&lt;/code&gt;, &lt;code&gt;paste_rm.txtar&lt;/code&gt;) drive the rest against the stubs: the types read, the bytes sent, each refusal, the launch&amp;rsquo;s offer and &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;paste-dir&lt;/code&gt;. On macOS, &lt;code&gt;TestReadClipPasteboard&lt;/code&gt; runs the real script against a pasteboard of the test&amp;rsquo;s own, never the clipboard. Text that&amp;rsquo;s a path or a &lt;code&gt;file://&lt;/code&gt; URL is no file, nor is a &lt;code&gt;file://&lt;/code&gt; URL as &lt;code&gt;public.url&lt;/code&gt;. A file URL with Finder&amp;rsquo;s &lt;code&gt;.icns&lt;/code&gt; icon beside it is the file, a file reference URL is resolved, two files are counted, and a file that&amp;rsquo;s gone is refused. A PNG and a TIFF are read as PNGs, beside text too. A PDF is read as it is, beside its picture and beside the temporary file a thumbnail copied in Preview names, while a file URL beside a JPEG, as Photos copies, is the file. One past the cap is refused before it&amp;rsquo;s written.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt; the real clipboard, which no automated check reads. The copies of Finder (one file URL per file, with an &lt;code&gt;.icns&lt;/code&gt; icon), Photos (a JPEG and a file URL), Preview (a PDF with a TIFF, and a thumbnail&amp;rsquo;s temporary file beside them), and Safari, Chrome and Firefox (a TIFF or a PNG) were checked by hand on macOS, and &lt;code&gt;TestReadClipPasteboard&lt;/code&gt; writes the same types to its own pasteboard, so a change in what an app copies would need checking by hand again. Also not covered: image types other than PNG, JPEG, GIF, WebP and TIFF, which devvm doesn&amp;rsquo;t read on macOS; whether macOS asks before &lt;code&gt;osascript&lt;/code&gt; reads the clipboard, which depends on the release and its privacy settings; Linux&amp;rsquo;s clipboard tools, which only the stubs stand in for; and the agents&amp;rsquo; own reading of a pasted path, which their releases change.&lt;/p&gt;
&lt;h2 data-hextra-search-id="bases-image-and-packages"&gt;Base&amp;rsquo;s image and packages&lt;span class="hx:absolute hx:-mt-20" id="bases-image-and-packages"&gt;&lt;/span&gt;
&lt;a href="#bases-image-and-packages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;base starts from the newest Ubuntu cloud image on each machine, and its packages are the newest when each key of base first builds, so devvm&amp;rsquo;s own files pin neither and need no bumps (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;how&lt;/a&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#bases-packages"&gt;packages&lt;/a&gt;). What it trusts, and where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The image:&lt;/strong&gt; Ubuntu&amp;rsquo;s cloud image key alone, pinned in devvm&amp;rsquo;s files. devvm checks the release&amp;rsquo;s &lt;code&gt;SHA256SUMS&lt;/code&gt; signature itself, in Go, so a host without &lt;code&gt;gpgv&lt;/code&gt; checks it too, and a bad signature is refused, never passed over for an older release. The listing that names the newest release is unsigned, so a server or network that can change it can only hold devvm back to an older signed release, over HTTPS. The signed &lt;code&gt;SHA256SUMS&lt;/code&gt; names files, not its release, so such a server could also serve an older release&amp;rsquo;s files under a newer release&amp;rsquo;s name, which devvm then records as the pin; that holds base back the same way, and it makes the package check&amp;rsquo;s date stricter, not looser. The pinned SHA-256 then decides every later download.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The packages:&lt;/strong&gt; Ubuntu&amp;rsquo;s archive key, through apt in the build VM, which holds nothing but Ubuntu&amp;rsquo;s image and devvm&amp;rsquo;s own scripts while it records. A mirror only serves files, and apt checks each against the archive key, so &lt;code&gt;ubuntu-mirror&lt;/code&gt; can&amp;rsquo;t install a package Ubuntu didn&amp;rsquo;t publish. Ubuntu&amp;rsquo;s &lt;code&gt;InRelease&lt;/code&gt; files carry no &lt;code&gt;Valid-Until&lt;/code&gt;, and the build VM has no lists before, so a stale or hostile mirror, or anyone on an &lt;code&gt;http://&lt;/code&gt; path to one, can serve an older signed state of the archive. devvm refuses one older than the archive state the pinned cloud image was built from, naming the mirror (&lt;code&gt;packages_stale_mirror&lt;/code&gt;, &lt;code&gt;packages_stale&lt;/code&gt; without one): every pocket but the release&amp;rsquo;s must be dated no more than a day before the image&amp;rsquo;s release, and the release pocket no earlier than Ubuntu&amp;rsquo;s release day (&lt;code&gt;Release.Stale&lt;/code&gt;). So a recorded state is never older than the pinned image. A mirror that fell behind after the pinned release still gets recorded, so freshness past the pin&amp;rsquo;s date rests on the mirror, and on HTTPS for Ubuntu&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The cache:&lt;/strong&gt; a first build records what its own apt checked, and devvm checks it again on this machine before it keeps anything. The build hands back the &lt;code&gt;InRelease&lt;/code&gt; files and package lists apt used, and devvm verifies each &lt;code&gt;InRelease&lt;/code&gt; with Ubuntu&amp;rsquo;s archive key, pinned in its files, in Go (&lt;code&gt;pgp.go&lt;/code&gt;&amp;rsquo;s clearsigned messages). Each list must be one a verified &lt;code&gt;InRelease&lt;/code&gt; gives the SHA-256 and size of, and each package one a list gives the SHA-256 of, so the recording VM can&amp;rsquo;t add a package Ubuntu didn&amp;rsquo;t publish, even with root, and the set keeps the archive&amp;rsquo;s own entry for each package. devvm keeps each file under its own SHA-256 and each key&amp;rsquo;s set once. What comes back from the VM is checked for shape, hashes and size (at most 20,000 entries and 16 GiB of packages, 2 GiB of lists) before anything is kept, so a build VM can&amp;rsquo;t put a file under another file&amp;rsquo;s name, change another key&amp;rsquo;s set, or write outside the cache. A key&amp;rsquo;s set is never written again, so a later build can&amp;rsquo;t change it either. The recording VM can&amp;rsquo;t record an older version than apt would install either: the build must hand back &lt;code&gt;resolute-updates&lt;/code&gt;&amp;rsquo; and &lt;code&gt;resolute-security&lt;/code&gt;&amp;rsquo;s &lt;code&gt;InRelease&lt;/code&gt; files with lists for the recorded packages&amp;rsquo; architectures, and every non-empty list that each &lt;code&gt;InRelease&lt;/code&gt; it hands back gives for the recorded packages&amp;rsquo; architectures, and devvm refuses a package that the release pocket, &lt;code&gt;-updates&lt;/code&gt; or &lt;code&gt;-security&lt;/code&gt; lists a newer version of, ordered as &lt;code&gt;dpkg --compare-versions&lt;/code&gt; orders them (&lt;code&gt;packages_lists_missing&lt;/code&gt;, &lt;code&gt;packages_not_newest&lt;/code&gt;). apt in the build takes phased updates too, so the newest version is what it installs. A replay checks each file&amp;rsquo;s SHA-256 on this machine before it sends it, and apt in the VM checks it again against the set&amp;rsquo;s entry. Replays trust apt&amp;rsquo;s entries as recorded (&lt;code&gt;trusted=yes&lt;/code&gt; on a local repository of files devvm checked), because the archive&amp;rsquo;s signature covers the archive&amp;rsquo;s lists, not a set of packages taken from them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it doesn&amp;rsquo;t stop:&lt;/strong&gt; anything with root in the recording VM before &lt;code&gt;apt.sh end&lt;/code&gt; (a feature&amp;rsquo;s script, a compromised pinned download) chooses which of Ubuntu&amp;rsquo;s signed packages get recorded, because the host checks that each package is the archive&amp;rsquo;s and the newest that the lists handed back have, not that apt chose it. It can record a package base doesn&amp;rsquo;t ask for, or one from &lt;code&gt;-backports&lt;/code&gt;, but never one from &lt;code&gt;-proposed&lt;/code&gt;. It can also hand back an older signed state of &lt;code&gt;-updates&lt;/code&gt; and &lt;code&gt;-security&lt;/code&gt; than the archive&amp;rsquo;s newest, dated as early as a day before the pinned image&amp;rsquo;s release, which the stale check allows, and record the newest versions of that state. Every later build of that key replays what it recorded, as the same image would. It can also change the image itself, which the image&amp;rsquo;s key doesn&amp;rsquo;t cover. &lt;code&gt;devvm rebuild base&lt;/code&gt; records anew. Packages for &lt;code&gt;--from&lt;/code&gt; bases and for layers come from their sources as they are, unpinned.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Breakage from upstream:&lt;/strong&gt; users now build from images and packages that e2e hasn&amp;rsquo;t run. If the newest image doesn&amp;rsquo;t boot, a first build tries the release before it (&lt;a href="https://next.devvm.dev/docs/internals/images/#ubuntus-cloud-image"&gt;how&lt;/a&gt;), which covers a release whose kernel Lima can&amp;rsquo;t start, but not packages that break base.sh or a VM later. A scheduled build of base from the newest image and packages, on CI or the test machines, should catch a break before users do; it isn&amp;rsquo;t built yet.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="shared-tools"&gt;Shared tools&lt;span class="hx:absolute hx:-mt-20" id="shared-tools"&gt;&lt;/span&gt;
&lt;a href="#shared-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each tool version is one compressed EROFS image, loop-mounted read-only in each VM from a read-only share (&lt;a href="https://next.devvm.dev/docs/using/images/#shared-tools"&gt;details&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Measured (macOS):&lt;/strong&gt; ten tools take 0.85 GB as images (1.5 GB installed), once for every VM and mix. Start times from an image match a local disk warm (&lt;code&gt;node -e 0&lt;/code&gt; 13 ms vs 14 ms, &lt;code&gt;claude --version&lt;/code&gt; 3 ms), and are 10–30 ms slower cold. Mounting five images takes 0.15 s; VM start is unchanged.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why images, not a shared folder:&lt;/strong&gt; tools run from a virtiofs folder were about 3× slower warm (&lt;code&gt;node -e 0&lt;/code&gt; 38 ms, &lt;code&gt;claude --version&lt;/code&gt; 30 ms), the Mac&amp;rsquo;s case-insensitive disk collided 33 file names in Python&amp;rsquo;s terminfo, and mise&amp;rsquo;s version links failed in a read-only folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why not per-tool layers:&lt;/strong&gt; an image chain for every mix of languages and agents repeats each agent&amp;rsquo;s files in every mix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where they build:&lt;/strong&gt; a tool image is shared by every VM whose tools need its key, and its build runs whatever runs as root in its build VM, so the key alone can&amp;rsquo;t keep one VM&amp;rsquo;s base out of another VM&amp;rsquo;s tools. A glibc tool image therefore always builds in a clone of devvm&amp;rsquo;s own Ubuntu base, on every backend, even for a VM on a &lt;code&gt;--from&lt;/code&gt; Debian or Ubuntu image, whose code would otherwise run as root in the build of images that Ubuntu VMs then mount. &lt;code&gt;--from&lt;/code&gt; VMs mount those images, because the tools are their projects&amp;rsquo; own prebuilt releases, which run on any glibc new enough, and devvm still refuses a tool that needs a newer glibc than the image has (&lt;a href="https://next.devvm.dev/docs/using/from/#shared-tools-and-glibc"&gt;shared tools and glibc&lt;/a&gt;). A musl tool image can only build on Alpine, so it builds in the VM&amp;rsquo;s own &lt;code&gt;--from&lt;/code&gt; base, and its key hashes that base&amp;rsquo;s digest, so it&amp;rsquo;s only ever another VM&amp;rsquo;s on the same container image. Before it builds, devvm checks the base&amp;rsquo;s record against what the images are for, and refuses any other base (&lt;code&gt;tools_wrong_base&lt;/code&gt;, &lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;). The cost is a build of devvm&amp;rsquo;s own base for a &lt;code&gt;--from&lt;/code&gt; VM&amp;rsquo;s first glibc tools when it isn&amp;rsquo;t built yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM for each tool:&lt;/strong&gt; a tool&amp;rsquo;s installer runs as root in its build VM, and a tool image&amp;rsquo;s key hashes only its own tool&amp;rsquo;s inputs, so tools built together in one VM could write into each other&amp;rsquo;s images: through a shared work folder, a process left running until the next tool&amp;rsquo;s &lt;code&gt;mkfs.erofs&lt;/code&gt;, or root replacing &lt;code&gt;mise&lt;/code&gt; or &lt;code&gt;mkfs.erofs&lt;/code&gt; itself. A fresh folder for each tool and killing its processes wouldn&amp;rsquo;t stop root, so each tool builds in a VM of its own, with an output folder of its own, and only that tool&amp;rsquo;s image leaves it (&lt;a href="https://next.devvm.dev/docs/internals/images/#building-tools"&gt;building tools&lt;/a&gt;). Measured on Fedora 43 (bare-metal x86_64, Lima with QEMU and KVM), building node, pnpm and bun took about 16 s in one VM and about 34 s in three, the same in two runs each, so each extra tool costs about 9 s, once for each tool version.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why a tool that doesn&amp;rsquo;t mount fails the launch:&lt;/strong&gt; mise would otherwise download the same version into the VM on first use, which gives that VM a private copy, a download nobody asked for, and one that the VM&amp;rsquo;s tier may block, all without a word (&lt;a href="https://next.devvm.dev/docs/internals/images/#the-share"&gt;how&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instead of Nix:&lt;/strong&gt; Nix and NixOS were weighed as the way to deliver the shared tools and rejected, because NixOS breaks prebuilt binaries, and a Nix hidden under the tools shows through in read-only-store errors. The &lt;a href="https://next.devvm.dev/docs/internals/images/#the-nix-layer"&gt;&lt;code&gt;nix&lt;/code&gt; layer&lt;/a&gt; is separate, and you choose it. It gives a project that uses Nix a Nix of its own in its VM, with its own store and daemon, and the shared tools stay as they are beside it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-shared-nix-cache"&gt;The shared Nix cache&lt;span class="hx:absolute hx:-mt-20" id="the-shared-nix-cache"&gt;&lt;/span&gt;
&lt;a href="#the-shared-nix-cache" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;VMs with the nix layer share their downloads from cache.nixos.org through a cache that only the host fills (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache"&gt;how&lt;/a&gt;). It&amp;rsquo;s the first thing that VMs share, so the design keeps two things: each VM&amp;rsquo;s Nix store stays its own, and no VM can change what another VM gets.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why a cache the host fills, not a shared store:&lt;/strong&gt; one store, or one daemon, shared between VMs is what Nix&amp;rsquo;s own store vulnerabilities break. CVE-2026-110450 (the daemon&amp;rsquo;s store corrupted through &lt;code&gt;repair&lt;/code&gt;), CVE-2026-39860 and the CVE-2024-27297 family (a fixed-output derivation that changes its output after Nix registered it) each let a client of the daemon change paths in its store, and in a shared store, every other VM would then trust those paths. A VM&amp;rsquo;s own builds are worse: a path a VM built has no signature that another VM could check, short of a key that trusts that VM, and then every VM trusts every other. A binary cache keeps the trust where Nix already has it. Each VM&amp;rsquo;s Nix fetches from the cache as from cache.nixos.org, checks cache.nixos.org&amp;rsquo;s signature and the &lt;code&gt;NarHash&lt;/code&gt; itself, and adds the path to its own store, so the cache only saves downloads.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the host checks, and what each VM checks:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The proxy (&lt;code&gt;internal/proxy/nixcache.go&lt;/code&gt;) takes only &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;HEAD&lt;/code&gt; of &lt;code&gt;nix-cache-info&lt;/code&gt;, &lt;code&gt;&amp;lt;32 nix32&amp;gt;.narinfo&lt;/code&gt; and &lt;code&gt;nar/&amp;lt;52 nix32&amp;gt;.nar&lt;/code&gt; with no suffix or &lt;code&gt;.xz&lt;/code&gt;, &lt;code&gt;.zst&lt;/code&gt; or &lt;code&gt;.bz2&lt;/code&gt;, with no query and nothing escaped (&lt;code&gt;nixPath&lt;/code&gt;, fuzzed by &lt;code&gt;FuzzNixPath&lt;/code&gt;), and &lt;code&gt;400&lt;/code&gt; for anything else. It makes up &lt;code&gt;nix-cache-info&lt;/code&gt; itself.&lt;/li&gt;
&lt;li&gt;It fetches from &lt;code&gt;https://cache.nixos.org&lt;/code&gt; alone, only when the VM&amp;rsquo;s policy allows &lt;code&gt;cache.nixos.org:443&lt;/code&gt; and, by &lt;a href="#rules-by-method-and-path"&gt;method and path&lt;/a&gt;, a &lt;code&gt;GET&lt;/code&gt; of the path the VM asked for (&lt;code&gt;policy.judge&lt;/code&gt;), through the floor or the company proxy (&lt;code&gt;dialOut&lt;/code&gt;), with the system&amp;rsquo;s roots and the user&amp;rsquo;s CAs, following no redirect, and sending only its own &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;User-Agent&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A narinfo is kept when its &lt;code&gt;StorePath&lt;/code&gt; is the path asked for, its URL is a NAR path of the pattern above, its hashes are SHA-256 in Nix&amp;rsquo;s base 32, each reference is a store path&amp;rsquo;s base name, and a &lt;code&gt;Sig&lt;/code&gt; by &lt;code&gt;cache.nixos.org-1&lt;/code&gt; (the Ed25519 key pinned in &lt;code&gt;nixKey&lt;/code&gt;) verifies over &lt;code&gt;1;StorePath;NarHash;NarSize;References&lt;/code&gt;, the references as full store paths, sorted and joined by commas (&lt;code&gt;parseNarinfo&lt;/code&gt;, against a narinfo of cache.nixos.org&amp;rsquo;s own in &lt;code&gt;internal/proxy/testdata/nix/&lt;/code&gt;). The bytes kept are cache.nixos.org&amp;rsquo;s, as they came.&lt;/li&gt;
&lt;li&gt;A narinfo&amp;rsquo;s URL must be named by its own &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, since the URL isn&amp;rsquo;t signed. A NAR is fetched only after a narinfo this proxy checked names its URL (&lt;code&gt;nixKnown&lt;/code&gt;, at most 65536 entries), and kept only when its SHA-256 and size are that narinfo&amp;rsquo;s &lt;code&gt;FileHash&lt;/code&gt; and &lt;code&gt;FileSize&lt;/code&gt;, read through a limit of &lt;code&gt;FileSize&lt;/code&gt; plus one byte. A &lt;code&gt;HEAD&lt;/code&gt; never fetches one.&lt;/li&gt;
&lt;li&gt;Each VM&amp;rsquo;s Nix checks the signature again and the &lt;code&gt;NarHash&lt;/code&gt;, which the host can&amp;rsquo;t: the compression is xz or zstd, which aren&amp;rsquo;t in Go&amp;rsquo;s standard library, and &lt;code&gt;internal/proxy&lt;/code&gt; takes nothing else. The spike showed a VM&amp;rsquo;s Nix refuses both a narinfo with an added reference and a corrupted NAR.&lt;/li&gt;
&lt;li&gt;Files go into a temporary file in the folder (&lt;code&gt;.tmp-*&lt;/code&gt;, 600) and are renamed into place, in folders of 700. Not-found answers and errors are never kept, and the VM gets &lt;code&gt;404&lt;/code&gt;, so its Nix goes to cache.nixos.org itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The cap:&lt;/strong&gt; &lt;code&gt;nix-cache.size&lt;/code&gt;, 10 GiB when it&amp;rsquo;s off, passed in the proxy&amp;rsquo;s config as &lt;code&gt;nix_cache_max&lt;/code&gt;. Before a proxy writes a file, it takes the file&amp;rsquo;s room under an exclusive &lt;code&gt;flock&lt;/code&gt; on &lt;code&gt;.lock&lt;/code&gt; (&lt;code&gt;reserve&lt;/code&gt;), in whole 4 KiB blocks. When &lt;code&gt;.size&lt;/code&gt;, the running total, is missing or the new file would pass the cap, it counts the folder again, each file by the larger of its size and its blocks, and deletes the least recently used files, by modification time, which a hit sets, down to nine tenths of the cap. A NAR being fetched is made its full size at once and counts, but is never deleted, so a fetch that would pass the cap with them is refused. A fetch that fails gives its room back. One proxy fetches each NAR once however many requests ask for it, and at most four at once. A NAR whose &lt;code&gt;FileSize&lt;/code&gt; is over the cap isn&amp;rsquo;t fetched. devvm gc, its &lt;code&gt;--nix-cache&lt;/code&gt; and the daily retention run trim under the same lock (&lt;code&gt;TrimNixCache&lt;/code&gt;). A temporary file over an hour old is a dead proxy&amp;rsquo;s, and the next count deletes it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What stays open:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Timing and filling the cache:&lt;/strong&gt; &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;Attack vectors&lt;/a&gt; lists what one VM learns of another by how fast the cache answers, and how a VM that fills the cache to its cap pushes other VMs&amp;rsquo; paths out. Hiding the timing would mean waiting as long as a fetch on every hit, which is the saving.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Private caches&lt;/strong&gt; (Cachix, a &lt;code&gt;netrc&lt;/code&gt;) are never shared: only root in the VM can add a substituter, and Nix reaches it through the allowlist directly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Options weighed:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Nix&amp;rsquo;s local overlay store&lt;/strong&gt;, the VM&amp;rsquo;s store over a read-only lower store shared from the host. It works on Lima, but it&amp;rsquo;s still experimental in Nix 2.35, the lower store can&amp;rsquo;t change while it&amp;rsquo;s mounted, so sharing new paths means remounting, and a garbage collection by a daemon not set up for it writes whiteouts that hide lower paths from that VM for good.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Packages fetched into an image&lt;/strong&gt;, by a custom layer that runs &lt;code&gt;nix build&lt;/code&gt; while the image builds (&lt;a href="https://next.devvm.dev/docs/using/toolchains/#sharing-a-teams-packages"&gt;the recipe&lt;/a&gt;). Clones share them on disk at no cost, but only what&amp;rsquo;s in the image, and a changed &lt;code&gt;flake.lock&lt;/code&gt; needs a rebuild.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open VMs:&lt;/strong&gt; every VM has its own proxy, an open one&amp;rsquo;s included, so open VMs share the cache through it, with the VM&amp;rsquo;s password, as confined ones do. Ruled out: a shared loopback listener without a password, because anything on the host or any VM that reaches the host&amp;rsquo;s loopback could use it; and the cache folder mounted read-only into VMs, which leaves the VM&amp;rsquo;s Nix to read the files and the host with nothing to fill it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Review&lt;/strong&gt; (the security-audit skill, on &lt;code&gt;nixcache.go&lt;/code&gt;, its callers and the VM&amp;rsquo;s setup):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What a VM sends&lt;/strong&gt; (headers, a body, a query, an escaped path, another method): ruled out: &lt;code&gt;nixGet&lt;/code&gt; makes a request of its own from the checked path, the VM&amp;rsquo;s &lt;code&gt;User-Agent&lt;/code&gt; and path go only to its own event log, and what&amp;rsquo;s kept is cache.nixos.org&amp;rsquo;s body under a name of the pattern.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A path out of the folder&lt;/strong&gt; (&lt;code&gt;..&lt;/code&gt;, &lt;code&gt;%2e&lt;/code&gt;, a symlink): ruled out: the names hold only Nix&amp;rsquo;s base 32, which has no &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;%&lt;/code&gt;, and can&amp;rsquo;t be &lt;code&gt;.lock&lt;/code&gt;, &lt;code&gt;.size&lt;/code&gt; or &lt;code&gt;.tmp-*&lt;/code&gt;; the folder is in devvm&amp;rsquo;s data folder, which no backend mounts, so nothing in a VM can put a file or link there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Upstream elsewhere&lt;/strong&gt; (a redirect, DNS rebinding, a company proxy): ruled out: every dial is &lt;code&gt;dialOut(cache.nixos.org, 443)&lt;/code&gt;, through the floor or the company proxy as any request, &lt;code&gt;ServerName&lt;/code&gt; is fixed and no redirect is followed; the client is made after the user&amp;rsquo;s CAs are read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A NAR kept under another NAR&amp;rsquo;s name:&lt;/strong&gt; confirmed, fixed. A narinfo&amp;rsquo;s &lt;code&gt;URL&lt;/code&gt;, &lt;code&gt;FileHash&lt;/code&gt; and &lt;code&gt;FileSize&lt;/code&gt; aren&amp;rsquo;t signed, so a bad upstream (or a CA in the user&amp;rsquo;s CA folder) could pair a real narinfo with another NAR&amp;rsquo;s URL and a file of its own, and every VM would then get that file for the other NAR, which its Nix refuses, until a trim. &lt;code&gt;parseNarinfo&lt;/code&gt; takes a URL only when it&amp;rsquo;s named by the narinfo&amp;rsquo;s own &lt;code&gt;NarHash&lt;/code&gt; or &lt;code&gt;FileHash&lt;/code&gt;, and a hit whose size isn&amp;rsquo;t that of the narinfo this proxy checked is dropped and fetched again; unit-tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The cap under many proxies:&lt;/strong&gt; confirmed, fixed. Files being fetched didn&amp;rsquo;t count and were written before any room was taken, so one VM&amp;rsquo;s parallel requests could put many NARs&amp;rsquo; worth on the host&amp;rsquo;s disk past the cap, and a small narinfo takes a whole block. Now a fetch takes its room under the lock first, makes its file its full size at once, and is refused when the files being fetched leave no room (&lt;code&gt;reserve&lt;/code&gt;); sizes count whole blocks; one proxy fetches each NAR once, however many ask, and at most four at once (&lt;code&gt;fetchOnce&lt;/code&gt;); a narinfo is written under the lock; unit-tested (40 writers at once, a full cache, eight requests for one NAR).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;HEAD&lt;/code&gt; that downloads:&lt;/strong&gt; confirmed, fixed: a &lt;code&gt;HEAD&lt;/code&gt; for a NAR the cache doesn&amp;rsquo;t have answers &lt;code&gt;404&lt;/code&gt; without fetching it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parser differences&lt;/strong&gt; (spaces, &lt;code&gt;\r&lt;/code&gt;, a key twice, references twice): ruled out: they only refuse, and each VM&amp;rsquo;s Nix parses and checks the bytes again, so no narinfo the host keeps means something else to Nix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One VM learning of another:&lt;/strong&gt; timing only: hits and fetches answer with the same bytes and headers (no &lt;code&gt;Last-Modified&lt;/code&gt; or &lt;code&gt;ETag&lt;/code&gt;), events go to the VM&amp;rsquo;s own log, &lt;code&gt;/blocked&lt;/code&gt; holds none of them, and errors in the body say nothing of the host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM&amp;rsquo;s own settings:&lt;/strong&gt; ruled out: &lt;code&gt;devvm-cache.conf&lt;/code&gt; and the &lt;code&gt;!include&lt;/code&gt; line are root&amp;rsquo;s, in that VM; only root is a trusted user, and root in a VM changes only its own Nix, while the cache takes nothing from any VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory:&lt;/strong&gt; ruled out: a narinfo is read up to 1 MiB, and &lt;code&gt;nixKnown&lt;/code&gt; holds at most 65536 entries per proxy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;nix&lt;/code&gt;): the VM&amp;rsquo;s Nix has the cache first and cache.nixos.org&amp;rsquo;s key alone; &lt;code&gt;nix run nixpkgs#hello&lt;/code&gt; comes through the cache, fetched by the host into the folder (files 600, folders 700); a VM&amp;rsquo;s &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;, a URL in the path, a query and &lt;code&gt;..&lt;/code&gt; get &lt;code&gt;400&lt;/code&gt;, a NAR no checked narinfo names and a path cache.nixos.org doesn&amp;rsquo;t have get &lt;code&gt;404&lt;/code&gt;, and the host keeps none of them; a second VM gets the first&amp;rsquo;s paths as hits and fetches none; after &lt;code&gt;devvm network open&lt;/code&gt;, the open VM&amp;rsquo;s nix-daemon still goes through its proxy and keeps the cache first.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-ca-per-vm"&gt;A CA per VM&lt;span class="hx:absolute hx:-mt-20" id="a-ca-per-vm"&gt;&lt;/span&gt;
&lt;a href="#a-ca-per-vm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To put a secret in, a VM&amp;rsquo;s proxy shows the VM certificates from a CA that the VM trusts, and inside the VM that CA vouches for any site. So each VM has CAs of its own, and the design keeps two things: a CA&amp;rsquo;s key never leaves this machine, and no VM&amp;rsquo;s proxy can make a certificate that another VM accepts (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-vms-ca"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt; &lt;code&gt;trust.InitCA&lt;/code&gt;, at each launch, whatever the VM&amp;rsquo;s tier, readies the VM&amp;rsquo;s current CA and its next one in &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/ca/&lt;/code&gt; (&lt;code&gt;paths.VM.CA&lt;/code&gt;): ECDSA P-256, 30 days and an hour each, the next one starting a week and an hour before the current one ends. The proxy&amp;rsquo;s config names the four files (&lt;code&gt;ca&lt;/code&gt;, &lt;code&gt;ca_key&lt;/code&gt;, &lt;code&gt;ca_next&lt;/code&gt;, &lt;code&gt;ca_next_key&lt;/code&gt;) and their certificates&amp;rsquo; SHA-256 (&lt;code&gt;ca_sha256&lt;/code&gt;, &lt;code&gt;ca_next_sha256&lt;/code&gt;), so a replaced CA starts the proxy again. The proxy signs with the next CA from an hour after its start (&lt;code&gt;ca.signer&lt;/code&gt;), and the VM&amp;rsquo;s setup installs both certificates, &lt;code&gt;devvm-proxy.crt&lt;/code&gt; and &lt;code&gt;devvm-proxy-next.crt&lt;/code&gt;, so the switch needs neither a launch nor a new proxy. The guest never fetches a CA: its trust comes only from the setup that devvm sends over ssh at each launch.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its data isolation and lifecycle companion). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One VM&amp;rsquo;s CA signing for another:&lt;/strong&gt; ruled out. Each proxy&amp;rsquo;s config is devvm&amp;rsquo;s, mode 600 in the VM&amp;rsquo;s own run folder, and names only that VM&amp;rsquo;s files, and a VM reaches no other VM&amp;rsquo;s proxy without that VM&amp;rsquo;s password. A VM trusts only the certificates its own setup sends, and the setup removes any other &lt;code&gt;devvm-*.crt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The keys reaching a VM:&lt;/strong&gt; ruled out. The setup sends the two certificates and nothing else from the folder, &lt;code&gt;/ca.pem&lt;/code&gt; serves certificates only, and no VM mounts devvm&amp;rsquo;s data folder. The CLI tests check the setup&amp;rsquo;s files for a private key, and e2e searches the VM&amp;rsquo;s &lt;code&gt;/etc&lt;/code&gt;, &lt;code&gt;/home&lt;/code&gt;, &lt;code&gt;/root&lt;/code&gt; and &lt;code&gt;/usr/local&lt;/code&gt; for each key.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Key files:&lt;/strong&gt; the folder is mode 700 and each key mode 600, written whole through a temporary file. Fixed: the proxy read the CA&amp;rsquo;s files through &lt;code&gt;tls.LoadX509KeyPair&lt;/code&gt;, which follows links and takes any mode, and it now reads them as the user&amp;rsquo;s own regular files, not links, with a key no one else may read or write, of at most 64 KiB (&lt;code&gt;loadCA&lt;/code&gt;, &lt;code&gt;readPrivate&lt;/code&gt;). On macOS each VM&amp;rsquo;s CA folder is kept out of Time Machine at each launch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Expiry and rotation:&lt;/strong&gt; a CA lasts 30 days and an hour, and each certificate it makes a day, never past the CA&amp;rsquo;s end. Listed: the next CA&amp;rsquo;s key is on disk for up to 23 days before that CA starts, so a copy of it taken then works until that CA ends, up to 53 days after the copy. A VM that isn&amp;rsquo;t opened again stays verifiable for at least 30 days less an hour after its last launch, which is the trade the successor buys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two launches of one VM at once:&lt;/strong&gt; fixed. &lt;code&gt;InitCA&lt;/code&gt; holds the CA folder&amp;rsquo;s lock, &lt;code&gt;run/ca/lock&lt;/code&gt;, while it reads and writes the CAs, so two launches at once take turns and never leave a key and a certificate from different runs (&lt;code&gt;TestInitCATogether&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lifecycle:&lt;/strong&gt; a remake keeps the VM&amp;rsquo;s folder and its CAs. &lt;code&gt;devvm rm&lt;/code&gt;, &lt;code&gt;devvm gc --orphans&lt;/code&gt; and the deletion of a VM whose creation was interrupted delete the folder with the keys. A change of tier keeps the CAs, because every tier&amp;rsquo;s proxy signs with them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Issuer confusion:&lt;/strong&gt; fixed before it could arise: each CA&amp;rsquo;s name holds its serial, so a VM&amp;rsquo;s two CAs never share a subject, which some verifiers look issuers up by.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clock skew:&lt;/strong&gt; the switch waits an hour past the next CA&amp;rsquo;s start, so a VM whose clock is up to an hour behind still accepts the certificates.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, &lt;code&gt;network&lt;/code&gt;): two confined VMs have different CAs; each VM trusts its own two and none of the other&amp;rsquo;s, and its &lt;code&gt;/etc/ssl/devvm.pem&lt;/code&gt; holds the next one; no key is anywhere in the VM, and the keys are mode 600; each proxy serves its own CAs at &lt;code&gt;/ca.pem&lt;/code&gt;, and a certificate it presents for a bound host verifies with its own VM&amp;rsquo;s CAs and not with the other&amp;rsquo;s; &lt;code&gt;devvm rm&lt;/code&gt; deletes one VM&amp;rsquo;s CAs and leaves the other&amp;rsquo;s. The switch itself is checked by unit tests (&lt;code&gt;TestNextCASigns&lt;/code&gt;, &lt;code&gt;TestInitCASwitch&lt;/code&gt;), because it happens weeks after a launch.&lt;/p&gt;
&lt;h2 data-hextra-search-id="links-between-vms"&gt;Links between VMs&lt;span class="hx:absolute hx:-mt-20" id="links-between-vms"&gt;&lt;/span&gt;
&lt;a href="#links-between-vms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A link lets a program in one VM, the client, reach a TCP service in another VM, the target, by name, as in &lt;code&gt;postgres://db:5432/app&lt;/code&gt;. Links work on every tier, within the tier rule below. You run &lt;code&gt;devvm link publish 5432&lt;/code&gt; in the target&amp;rsquo;s folder to offer the port to any of your VMs, and &lt;code&gt;devvm link add db 5432&lt;/code&gt; in the client&amp;rsquo;s folder to reach it as &lt;code&gt;db:5432&lt;/code&gt; and &lt;code&gt;db.devvm.internal:5432&lt;/code&gt;. A link carries its connections over ssh through the host, so it uses neither VM&amp;rsquo;s network, and the design keeps every guarantee that the tiers&amp;rsquo; confinement and port forwarding give. The review of the code checks it against the threat check below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rules:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A link is reached only by its name.&lt;/strong&gt; The client reaches the target&amp;rsquo;s port at the link&amp;rsquo;s short name and at &lt;code&gt;NAME.devvm.internal&lt;/code&gt;, and never at its own &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt;, so &lt;code&gt;localhost:PORT&lt;/code&gt; in the client stays the client&amp;rsquo;s own. The short name is the target&amp;rsquo;s folder part, or the name given with &lt;code&gt;--as NAME&lt;/code&gt;, and the target&amp;rsquo;s full VM name is never a hostname. &lt;code&gt;.internal&lt;/code&gt; is reserved for private use, so &lt;code&gt;NAME.devvm.internal&lt;/code&gt; names no host on the internet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The target publishes.&lt;/strong&gt; A port is reached only once the target&amp;rsquo;s folder has published it with &lt;code&gt;devvm link publish&lt;/code&gt;, which offers it to any of your VMs. Each link is still made from the client&amp;rsquo;s folder, with &lt;code&gt;devvm link add&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A client links only to a target on its own tier or a stricter one.&lt;/strong&gt; A link joins the two VMs&amp;rsquo; trust (below), so a client linked to a target on a lower tier would reach more through the target than its own tier allows: an allowlist client linked to an internet or open target would reach the internet through it. devvm checks the rule when the link is made, at each launch of the client, on every connection, and when &lt;code&gt;devvm network&lt;/code&gt; gives the target a tier lower than the client&amp;rsquo;s or the client one higher than a target&amp;rsquo;s, both of which it refuses while such a link exists (&lt;code&gt;link_tier_mismatch&lt;/code&gt;). For a client on a confined tier, on every connection the target&amp;rsquo;s tier must also be enforced as the target runs (&lt;code&gt;netpolicy.Listed&lt;/code&gt;), not only recorded in its state: &lt;code&gt;devvm network allowlist&lt;/code&gt; on a running open target takes effect at its next start, and a target whose self-check failed may reach the internet directly, so until then the connection is refused as &lt;code&gt;unenforced&lt;/code&gt;. &lt;code&gt;devvm link add&lt;/code&gt;, &lt;code&gt;devvm link publish&lt;/code&gt; of a port such a client links to, and the client&amp;rsquo;s launch warn of a running target in this state with the same check (&lt;code&gt;link_target_unenforced&lt;/code&gt;), refusing nothing, and a stopped target isn&amp;rsquo;t warned of, because its tier applies when it next starts. An open client may link to a target on any tier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A connection never starts a VM.&lt;/strong&gt; A connection to a stopped target fails, and devvm logs why in the client&amp;rsquo;s event log, but the target stays stopped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm records links on the host,&lt;/strong&gt; in each VM&amp;rsquo;s state under &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, never in a project folder or a VM. The client&amp;rsquo;s VM gets only the names and addresses it needs, which devvm checks before it sends them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;A link joins the two VMs&amp;rsquo; trust.&lt;/strong&gt; Code in the client can often run code in the target through the target&amp;rsquo;s own service, such as Postgres&amp;rsquo;s &lt;code&gt;COPY … TO PROGRAM&lt;/code&gt;, and it then has whatever the target has: its network, the secrets its proxy puts into requests, and its project folder. devvm doesn&amp;rsquo;t try to stop that, because it&amp;rsquo;s the service&amp;rsquo;s own behavior. So a link is safe only between VMs you&amp;rsquo;d trust with each other&amp;rsquo;s reach, and &lt;code&gt;devvm link add&lt;/code&gt; says so when it makes one. The tier rule above keeps a link from widening the client&amp;rsquo;s tier.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it&amp;rsquo;s built from:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s identity.&lt;/strong&gt; Every VM gets a random ID when devvm makes it, recorded in its state. A link records the target&amp;rsquo;s VM name and its ID when it&amp;rsquo;s made, so a VM made again in the target&amp;rsquo;s folder, which has the same name and a new ID, isn&amp;rsquo;t the linked target, and a second VM with the same folder name that appears later changes nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which VM a link names.&lt;/strong&gt; &lt;code&gt;devvm link add TARGET PORT&lt;/code&gt; takes a VM&amp;rsquo;s full name, its ssh alias (&lt;code&gt;devvm-&amp;lt;folder&amp;gt;&lt;/code&gt;, as its state records it), a folder&amp;rsquo;s path, or a folder&amp;rsquo;s name, which is matched against the folder that each VM&amp;rsquo;s state records, so a VM whose backend cut its name still matches its whole folder name. A folder name that matches several VMs is refused, with each VM and its folder listed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The published ports&lt;/strong&gt; are in the target&amp;rsquo;s state, a list of ports and ranges as &lt;code&gt;devvm ports&lt;/code&gt; takes them, without &lt;code&gt;all&lt;/code&gt;. &lt;code&gt;devvm link unpublish&lt;/code&gt; takes ports out of the list, and a link to a port that isn&amp;rsquo;t published is refused on its next connection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An address per target.&lt;/strong&gt; Each target a client links to gets an address of its own in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, chosen when the first link to it is made and kept for every port of that target in that client, so two targets can share a port. The client listens on the target&amp;rsquo;s own port, so &lt;code&gt;devvm link add db 80&lt;/code&gt; listens on port 80. The addresses are internal and appear only on these pages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names in the client.&lt;/strong&gt; The setup that devvm sends at each launch writes a block marked &lt;code&gt;# devvm links begin&lt;/code&gt; and &lt;code&gt;# devvm links end&lt;/code&gt; into the client&amp;rsquo;s &lt;code&gt;/etc/hosts&lt;/code&gt;, with a line &lt;code&gt;127.77.x.y NAME NAME.devvm.internal&lt;/code&gt; for each target, and replaces the block whole, writing the file in place rather than renaming over it. devvm sends the same block over ssh as root when links change on a running client, and it applies at once. No link name goes into &lt;code&gt;NO_PROXY&lt;/code&gt; or &lt;code&gt;no_proxy&lt;/code&gt;, which name the VM alone, because a running VM can&amp;rsquo;t take a new environment: HTTP clients with the VM&amp;rsquo;s proxy settings reach a link through the proxy (below). So a change of links changes no VM&amp;rsquo;s environment, restarts no daemon, and on Lima runs no &lt;code&gt;limactl edit&lt;/code&gt;, which would give the VM new ssh host keys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The client&amp;rsquo;s sshd.&lt;/strong&gt; Every VM&amp;rsquo;s sshd allows remote forwards to &lt;code&gt;127.77.0.0/16&lt;/code&gt; alone, with one rule written when the image is built, so no link rewrites or reloads it. That&amp;rsquo;s &lt;code&gt;00-devvm.conf&lt;/code&gt; from &lt;code&gt;assets/layers/base.sh&lt;/code&gt;, which sets &lt;code&gt;AllowTcpForwarding all&lt;/code&gt;, &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; and &lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt;, and keep &lt;code&gt;AllowStreamLocalForwarding local&lt;/code&gt;, &lt;code&gt;PermitTunnel no&lt;/code&gt; and &lt;code&gt;X11Forwarding no&lt;/code&gt;. Without &lt;code&gt;clientspecified&lt;/code&gt;, sshd would bind every remote forward on the VM&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;. sshd matches the address a request names against the rule as text, so &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt; and &lt;code&gt;*&lt;/code&gt; are refused, and only devvm on the host asks for these forwards, always with a numeric address. The rule is a safeguard for an honest VM, because root in the VM can change sshd, and the boundary is the host&amp;rsquo;s ssh client (below).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Low ports.&lt;/strong&gt; At each start, the setup sets &lt;code&gt;net.ipv4.ip_unprivileged_port_start&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; where it&amp;rsquo;s &lt;code&gt;1024&lt;/code&gt;, which is on Lima&amp;rsquo;s Alpine VMs, so sshd can listen on a link&amp;rsquo;s port below 1024 for the VM&amp;rsquo;s user. Lima&amp;rsquo;s Ubuntu and Debian VMs already have &lt;code&gt;0&lt;/code&gt;, so devvm leaves it there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The link session.&lt;/strong&gt; For each running client with links, a hidden command, &lt;code&gt;devvm _links&lt;/code&gt;, runs on the host as one detached process. It keeps an ssh connection of its own to the client, never the forwarder&amp;rsquo;s master, with the options of &lt;code&gt;internal/vmssh&lt;/code&gt;: &lt;code&gt;-F none&lt;/code&gt;, &lt;code&gt;BatchMode&lt;/code&gt;, the VM&amp;rsquo;s key alone (&lt;code&gt;IdentitiesOnly&lt;/code&gt;, &lt;code&gt;IdentityAgent=none&lt;/code&gt;), its pinned host key, &lt;code&gt;ForwardAgent=no&lt;/code&gt;, &lt;code&gt;ForwardX11=no&lt;/code&gt;, &lt;code&gt;Tunnel=no&lt;/code&gt;, &lt;code&gt;PermitRemoteOpen=none&lt;/code&gt;, &lt;code&gt;PermitLocalCommand=no&lt;/code&gt; and &lt;code&gt;ProxyJump=none&lt;/code&gt;. It starts that connection as a master with &lt;code&gt;ClearAllForwardings=yes&lt;/code&gt;, so the master asks for nothing at first, and adds each link with &lt;code&gt;ssh -O forward -R 127.77.x.y:PORT:&amp;lt;socket&amp;gt;&lt;/code&gt; and removes it with &lt;code&gt;ssh -O cancel&lt;/code&gt;, at its start and while the client runs. A cancel keeps the connections that are open, and the master ending drops them. Each link is its own &lt;code&gt;-O forward&lt;/code&gt;, never &lt;code&gt;ExitOnForwardFailure&lt;/code&gt; for all of them, so a link whose address a program in the client already holds fails alone, with an error naming the link (&lt;code&gt;link_port_taken&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sockets.&lt;/strong&gt; Each link&amp;rsquo;s forward ends at a unix socket on the host, mode 600 in devvm&amp;rsquo;s run folder &lt;code&gt;~/.local/share/devvm/run&lt;/code&gt; (mode 700), named by a hash of the client, the address and the port, because a socket&amp;rsquo;s path has fewer than 104 characters. The masters&amp;rsquo; control sockets are in the same folder, named by a hash of the client, and for a master to a target, of the target and its start too. A stale socket at the path is replaced, anything else there is refused, and the socket goes when its link or the process ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each connection.&lt;/strong&gt; When a program in the client connects to a link&amp;rsquo;s address, the client&amp;rsquo;s sshd opens a channel to the host for the forward, and the host&amp;rsquo;s ssh connects it to that link&amp;rsquo;s socket. &lt;code&gt;devvm _links&lt;/code&gt; then reads the links state again and checks that the link still exists, that the target&amp;rsquo;s ID matches, that the port is published, that the tier rule holds, that the target runs as its backend says, and, for a client on a confined tier, that the target&amp;rsquo;s tier is enforced as it runs. The connections to one target share what its backend says of its run, which is whether it runs, its start and its ssh. One lookup is in flight for each target, and its answer is reused for one second (&lt;code&gt;linkRunFor&lt;/code&gt;), so a burst of 256 connections asks the backend once rather than once for each. A connection that closes while its lookup runs finds the target stopped, but that lookup isn&amp;rsquo;t kept, and the connections waiting on it look again, so they get the target&amp;rsquo;s real answer. A target that stops is noticed within that second, and the connection&amp;rsquo;s other checks, the tier&amp;rsquo;s as the target runs included, are made for each connection. That tier check asks the backend again, and a stopped VM never runs confined, so for a client on a confined tier it notices at once that the target stopped. When the backend then says the target no longer runs on the start that was looked up, the connection is refused as &lt;code&gt;link_target_stopped&lt;/code&gt;, not as &lt;code&gt;unenforced&lt;/code&gt;. It then carries the connection with &lt;code&gt;ssh -S &amp;lt;master&amp;gt; -o ProxyCommand=/usr/bin/false -W 127.0.0.1:PORT&lt;/code&gt; through a master to the target that it keeps, one per target, with the target&amp;rsquo;s key and pinned host key. The target&amp;rsquo;s sshd connects to the target&amp;rsquo;s own loopback. When the master is gone, &lt;code&gt;-S&lt;/code&gt; alone would make a connection of its own, and &lt;code&gt;ProxyCommand=/usr/bin/false&lt;/code&gt; makes that connection fail, so a channel goes through the master or nowhere. A target&amp;rsquo;s master ends when the target stops, and the next one reads the target&amp;rsquo;s known hosts again, because a VM whose Lima config changed gets new host keys when it boots. Each relay&amp;rsquo;s ssh (&lt;code&gt;-W&lt;/code&gt;) waits for the target&amp;rsquo;s sshd to end its channel, so each runs with a context of its own (&lt;code&gt;vmssh.relayConns&lt;/code&gt;, which the port forwarder&amp;rsquo;s forwards also use). The link&amp;rsquo;s removal and its master&amp;rsquo;s replacement close its connection and cancel that context under the session&amp;rsquo;s lock, which kills the ssh (&lt;code&gt;exec.CommandContext&lt;/code&gt;), and a relay that ends by itself releases its context. So a removed link&amp;rsquo;s open connections end with it, and a target that never ends a channel can&amp;rsquo;t keep the relay&amp;rsquo;s ssh process, or one of the 256, past either. A link whose address and port lead to another target at the next sync, as a link removed and another added within one second would, cuts the old target&amp;rsquo;s connections and starts a new set for the new one, and a connection accepted before that change is cut with the old set. While a link lasts, the relay&amp;rsquo;s grace (&lt;code&gt;pipeSSH&lt;/code&gt;, as for &lt;a href="#ports-on-lima"&gt;the forwarder&lt;/a&gt;) kills an ssh whose client in the client VM has closed and whose target has sent nothing for 30 seconds. devvm never starts the target. At most 256 connections are carried at once, and the next one is refused and logged. A link&amp;rsquo;s socket holds 128 connections waiting to be accepted on macOS, and the process accepts nothing while it starts an ssh, so its accept loop only accepts, and hands a burst on whole once 5 ms pass with nothing more waiting, the first has waited 50 ms, or 257 wait. Another goroutine then carries or refuses each connection in it, logging each refusal before it closes the connection, while the loop goes on accepting the next burst, and the loop waits for that goroutine only once 257 of the next burst wait. So every connection in a burst is carried or refused with &lt;code&gt;link_limit&lt;/code&gt;, and none is refused by the socket unlogged.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The proxy&amp;rsquo;s entrance.&lt;/strong&gt; In a client on any tier, an HTTP client that honors &lt;code&gt;HTTP_PROXY&lt;/code&gt; sends &lt;code&gt;db:5432&lt;/code&gt; to the VM&amp;rsquo;s proxy, and the proxy is a second entrance to the same socket, so a link added while the client runs works at once without a restart. &lt;code&gt;devvm _links&lt;/code&gt; writes every link the client has, carried or not, to &lt;code&gt;links.json&lt;/code&gt; in the client&amp;rsquo;s run folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/run/&lt;/code&gt; (mode 600, written whole) whenever they change or the file is gone, with each link&amp;rsquo;s names, address, port, target and socket. A link it doesn&amp;rsquo;t carry has no socket, and a session that ended leaves its list, so the proxy refuses those links (&lt;code&gt;502&lt;/code&gt;, &lt;code&gt;link_refused&lt;/code&gt;) instead of asking its rules, which could send &lt;code&gt;db&lt;/code&gt; to a host the host&amp;rsquo;s resolver or a company proxy finds by that name. devvm removes the list with the VM. devvm puts the path in the proxy&amp;rsquo;s config as &lt;code&gt;links&lt;/code&gt;, and its run folder, where the sockets are, as &lt;code&gt;link_sockets&lt;/code&gt;, so &lt;code&gt;internal/proxy&lt;/code&gt; stays standard library only, and the proxy reads the list for every request, after the VM&amp;rsquo;s password and before any rule, as it does for &lt;code&gt;devvm.proxy&lt;/code&gt;. It matches &lt;code&gt;CONNECT NAME:PORT&lt;/code&gt; and absolute-form &lt;code&gt;GET http://NAME:PORT/&lt;/code&gt; exactly, after one normalization: lower case, one trailing dot dropped, and &lt;code&gt;NAME.devvm.internal&lt;/code&gt; as the list names it. It takes an entry only when the entry&amp;rsquo;s socket is the one that &lt;code&gt;proxy.LinkSocket&lt;/code&gt; names from devvm&amp;rsquo;s run folder, this VM, the entry&amp;rsquo;s address and its port, which is also the name &lt;code&gt;vmssh.Links.Socket&lt;/code&gt; gives the socket. It then connects to the socket and passes the bytes as they are: no SNI check, no interception, no secret put in, even when a secret&amp;rsquo;s hosts would match, and no rule asked. An absolute-form request goes over a new connection to the socket for each request, without the proxy&amp;rsquo;s headers, and HTTPS in absolute form gets &lt;code&gt;400&lt;/code&gt;. &lt;code&gt;devvm _links&lt;/code&gt;&amp;rsquo;s checks of each connection apply to both entrances unchanged, and it logs the connection once, as &lt;code&gt;link&lt;/code&gt;. A stale entry fails there, or finds no socket, which the proxy answers with &lt;code&gt;502&lt;/code&gt; and logs as &lt;code&gt;link_refused&lt;/code&gt; (&lt;code&gt;not carried&lt;/code&gt;). The proxy also refuses any other name under &lt;code&gt;devvm.internal&lt;/code&gt;, logged as a refused block, so a long name never reaches the rules. An absolute-form request to a link ends when the client gives it up, so a target that never answers can&amp;rsquo;t hold the client&amp;rsquo;s 256 connections. Anything else not on the list meets the floor and the rules as before, so a short name the client has no link for, before its first session lists it, is the rules&amp;rsquo; to decide.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Events.&lt;/strong&gt; &lt;code&gt;devvm _links&lt;/code&gt; writes &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;link_refused&lt;/code&gt; (with why), &lt;code&gt;link_target_stopped&lt;/code&gt; and &lt;code&gt;link_limit&lt;/code&gt; events to the client&amp;rsquo;s event log, in the proxy&amp;rsquo;s JSON-lines format, with the link&amp;rsquo;s name as the host and the target VM as &lt;code&gt;target&lt;/code&gt;, so &lt;code&gt;devvm network log&lt;/code&gt; shows them. Every client gets an event log for them, whatever its tier. &lt;code&gt;devvm _links&lt;/code&gt; writes it with the proxy&amp;rsquo;s own writer, which rotates it past 10 MiB by the proxy&amp;rsquo;s rule and follows the file to its new name when the other writer rotated it, so the two writers never lose each other&amp;rsquo;s lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The forwarder skips links.&lt;/strong&gt; The port forwarder (&lt;code&gt;vmssh.Forwarder&lt;/code&gt;) forwards a server on any loopback address of the VM&amp;rsquo;s, so it would put a link&amp;rsquo;s listener on the host&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;. It never forwards a listener whose address is in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, on any VM, so a server of the client&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with the same port is forwarded as usual. Lima&amp;rsquo;s own forwards don&amp;rsquo;t take it either, because devvm&amp;rsquo;s rules ignore every port first, and Lima&amp;rsquo;s fallback rule matches &lt;code&gt;127.0.0.1&lt;/code&gt; and the bind addresses &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;::&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; alone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;In VMs&amp;rsquo; lives.&lt;/strong&gt; A launch starts &lt;code&gt;devvm _links&lt;/code&gt; once the client runs and its setup is done, warns once for each stopped target (&lt;code&gt;link_target_stopped&lt;/code&gt;) without starting it, and skips a link whose tier rule no longer holds, with &lt;code&gt;link_tier_mismatch&lt;/code&gt;. For a client on a confined tier, it also warns once for each running target whose tier isn&amp;rsquo;t enforced (&lt;code&gt;link_target_unenforced&lt;/code&gt;). &lt;code&gt;devvm link add&lt;/code&gt; and &lt;code&gt;devvm link rm&lt;/code&gt; on a running client change its setup and its running &lt;code&gt;devvm _links&lt;/code&gt; at once, and on a stopped client they apply at its next start. &lt;code&gt;devvm stop&lt;/code&gt; stops &lt;code&gt;devvm _links&lt;/code&gt; with the client, which ends its connections and removes its sockets, and the process also ends once the client no longer runs the start it was made for, as the forwarder does, or has no links left. &lt;code&gt;devvm rm&lt;/code&gt; of a client removes its links with its state, and &lt;code&gt;devvm rm&lt;/code&gt; of a target removes every link to it from every client&amp;rsquo;s state and names the clients that lost one, deleting nothing else of theirs. &lt;code&gt;devvm link unpublish&lt;/code&gt; of a port with links names the clients that link to it. Both backends must have the link feature, which needs ssh on both VMs, and devvm checks it with &lt;code&gt;Review.Require&lt;/code&gt; when a link is made and at each launch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What keeps a link from carrying a VM out.&lt;/strong&gt; Every connection starts on the host, and neither VM&amp;rsquo;s network carries it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A confined VM reaches only its proxy and the links you made.&lt;/strong&gt; The link&amp;rsquo;s bytes travel inside ssh connections that the host opens, so no backend&amp;rsquo;s confinement changes, and the client&amp;rsquo;s own connections, including sshd&amp;rsquo;s, stay confined as before. Through its proxy, a VM reaches only the sockets of its own links: a request names a host and a port, never a socket, the proxy&amp;rsquo;s list is in the VM&amp;rsquo;s run folder, which no VM can write, and the proxy takes an entry only when its socket is the one devvm names for that VM&amp;rsquo;s link at that address and port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The VM can&amp;rsquo;t choose where its connections go on the host.&lt;/strong&gt; OpenSSH&amp;rsquo;s client accepts a forwarded channel only for a listener it asked for, and connects it only where it chose, which is the link&amp;rsquo;s socket. A channel the client&amp;rsquo;s sshd opens for any other address or port, or of any other kind, is refused, whatever sshd root in the client runs. The forwarder&amp;rsquo;s master asks for no remote forward, and the link session is a connection of its own, so links don&amp;rsquo;t change what &lt;a href="#ports-on-lima"&gt;the ports note&lt;/a&gt; says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other users and VMs can&amp;rsquo;t use a link.&lt;/strong&gt; Its end on the host is a unix socket of yours, mode 600 in a folder of mode 700, so no other user on the host reaches it, and neither does a VM that reaches the host&amp;rsquo;s loopback. Programs of yours on the host can connect to it, as they can already ssh into the target by the name devvm host shows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A target&amp;rsquo;s service isn&amp;rsquo;t put on the host&amp;rsquo;s localhost.&lt;/strong&gt; &lt;code&gt;-W&lt;/code&gt; reaches the target&amp;rsquo;s loopback through its sshd, and the forwarder never forwards &lt;code&gt;127.77.0.0/16&lt;/code&gt;, so a link listens nowhere on the host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Each VM&amp;rsquo;s own ssh rules hold.&lt;/strong&gt; Host keys are pinned, each VM has its own key, and no agent is forwarded (&lt;code&gt;ForwardAgent=no&lt;/code&gt;, &lt;code&gt;IdentityAgent=none&lt;/code&gt;), as for the forwarder. devvm takes a client&amp;rsquo;s or a target&amp;rsquo;s ssh only as its backend gives it on the host&amp;rsquo;s loopback, &lt;code&gt;127.0.0.1&lt;/code&gt;, with a user and a key, and it refuses any other address, as the ssh config&amp;rsquo;s entries do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Why not a shared network, the proxy, or a host port:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A network shared between VMs&lt;/strong&gt; would bypass the proxy and the VMs&amp;rsquo; confinement. On Lima it needs a root helper, and QEMU can&amp;rsquo;t make one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;CONNECT&lt;/code&gt; through the proxy as the only way in&lt;/strong&gt; would work only for programs that use the VM&amp;rsquo;s proxy settings, and a raw TCP client in every VM would need a tool of devvm&amp;rsquo;s to make the connection. The proxy is a second entrance instead, for HTTP clients, beside the ssh forward that carries every link on every VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The target&amp;rsquo;s port forwarded to the host&amp;rsquo;s localhost&lt;/strong&gt; is refused by the proxy&amp;rsquo;s floor, is reached by any open VM and any program on the host, and is a port that a host program can take first.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What the prototype showed.&lt;/strong&gt; devvm&amp;rsquo;s prototype ran in the e2e sandbox, and nothing needed the link feature off:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;macOS&amp;rsquo;s ssh 10.3p1 and Linux hosts&amp;rsquo; ssh 9.6p1 and 10.2p1 accept &lt;code&gt;-R 127.77.x.y:PORT:&amp;lt;unix socket&amp;gt;&lt;/code&gt;, and &lt;code&gt;-O forward&lt;/code&gt; and &lt;code&gt;-O cancel&lt;/code&gt; work on a master started with &lt;code&gt;ClearAllForwardings=yes&lt;/code&gt;. A cancel keeps open connections, ending the master drops them, and a session keeps the &lt;code&gt;PermitListen&lt;/code&gt; it connected with.&lt;/li&gt;
&lt;li&gt;sshd 9.2p1 (Debian 12, &lt;code&gt;--from&lt;/code&gt;), 10.2p1 (Ubuntu 26.04) and 10.3p1 (Alpine), with &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt; and &lt;code&gt;PermitListen&lt;/code&gt; naming one address, bind that address alone and refuse &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, other ports and port 0. The glob &lt;code&gt;127.77.*:*&lt;/code&gt; works the same way and matches the requested address as text.&lt;/li&gt;
&lt;li&gt;All of them honor &lt;code&gt;ip_unprivileged_port_start&lt;/code&gt;, which is &lt;code&gt;0&lt;/code&gt; by default on Lima&amp;rsquo;s Ubuntu and Debian VMs, and &lt;code&gt;1024&lt;/code&gt; on Lima&amp;rsquo;s Alpine VMs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SIGHUP&lt;/code&gt; keeps sessions and open connections under systemd and OpenRC. Lima&amp;rsquo;s Ubuntu VMs (an sshd per connection over vsock) read the config at every connection. sshd&amp;rsquo;s rule is written once, so links don&amp;rsquo;t depend on either.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ssh -W&lt;/code&gt; through a kept master works over Lima&amp;rsquo;s ssh, and a new master after the target restarts reads its rewritten known hosts, while Lima keeps its key. Without a master, &lt;code&gt;-S&lt;/code&gt; connects on its own unless &lt;code&gt;ProxyCommand=/usr/bin/false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;glibc 2.36 and 2.43 and musl 1.2.6 resolve &lt;code&gt;/etc/hosts&lt;/code&gt; names in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, and Go, Node 18, 22 and 24, curl, Python and libpq 15 and 18 reach &lt;code&gt;db&lt;/code&gt; and &lt;code&gt;db.devvm.internal&lt;/code&gt;. HTTP clients honor &lt;code&gt;NO_PROXY&lt;/code&gt; with &lt;code&gt;db,.devvm.internal&lt;/code&gt;, Node 22 needs the leading dot, and Node 18&amp;rsquo;s &lt;code&gt;fetch&lt;/code&gt; ignores proxies.&lt;/li&gt;
&lt;li&gt;devvm&amp;rsquo;s port forwarder put a link&amp;rsquo;s listener on the host&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt;, which is why it skips &lt;code&gt;127.77.0.0/16&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The prototype didn&amp;rsquo;t run confined VMs, so the end-to-end checks do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What it relies on:&lt;/strong&gt; OpenSSH&amp;rsquo;s client accepting forwarded channels only for listeners it asked for, and connecting each one only where it chose. It also relies on &lt;code&gt;-O forward&lt;/code&gt; and &lt;code&gt;-O cancel&lt;/code&gt; changing one master&amp;rsquo;s forwards, on &lt;code&gt;ProxyCommand=/usr/bin/false&lt;/code&gt; keeping &lt;code&gt;-S&lt;/code&gt; from connecting without its master, and on the host&amp;rsquo;s unix socket permissions. The pinned host keys are the ones the &lt;a href="#ports-on-lima"&gt;forwarder&lt;/a&gt; and &lt;a href="#ssh-into-vms"&gt;ssh&lt;/a&gt; rely on. Lima&amp;rsquo;s rules must ignore every port ahead of its fallback rule, and devvm&amp;rsquo;s state on the host must hold each link&amp;rsquo;s target, ID and port. The proxy&amp;rsquo;s entrance relies on devvm&amp;rsquo;s run folder and the VM&amp;rsquo;s being yours alone, and on the proxy checking each entry&amp;rsquo;s socket against the one it names itself from the VM, the address and the port.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; an OpenSSH release whose client accepts a channel for a listener it didn&amp;rsquo;t ask for, which the end-to-end checks would see as a host connection devvm didn&amp;rsquo;t make. A Lima release that forwards a listener on a &lt;code&gt;127.77&lt;/code&gt; address despite the rules would put a link on the host&amp;rsquo;s loopback, which the forwarder&amp;rsquo;s own skip doesn&amp;rsquo;t cover, and the end-to-end checks look for it on the host. A backend that started a target for a connection would break the rule that a connection never starts a VM, but devvm never asks a backend to start one then.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What the client does through the target&amp;rsquo;s service.&lt;/strong&gt; A link joins the two VMs&amp;rsquo; trust, as above, and &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;what a VM does through a link&lt;/a&gt; lists what that leaves open.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Programs of yours on the host&lt;/strong&gt; can connect to a link&amp;rsquo;s socket and the masters&amp;rsquo; control sockets, as they can already reach the VMs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open connections outlive an unpublished port.&lt;/strong&gt; &lt;code&gt;devvm link unpublish&lt;/code&gt; refuses the next connection, while those that are open stay until they close, the client stops or the target does, because the link itself stays. A link that goes, by &lt;code&gt;devvm link rm&lt;/code&gt;, &lt;code&gt;devvm rm&lt;/code&gt; of its target or a group&amp;rsquo;s change, ends its open connections (above). A target can&amp;rsquo;t get a tier lower than a client&amp;rsquo;s that links to it, because &lt;code&gt;devvm network&lt;/code&gt; refuses it then, so no open connection breaks the tier rule.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A program in the client can take a link&amp;rsquo;s address and port first,&lt;/strong&gt; and that link then fails with &lt;code&gt;link_port_taken&lt;/code&gt; until the program lets it go. Root in the client can also edit its own &lt;code&gt;/etc/hosts&lt;/code&gt;, which changes only what the client reaches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link name hides a name the client would otherwise resolve,&lt;/strong&gt; such as &lt;code&gt;db&lt;/code&gt; under its search domain. devvm refuses &lt;code&gt;localhost&lt;/code&gt;, the client&amp;rsquo;s own hostname, another link&amp;rsquo;s name and anything that isn&amp;rsquo;t one DNS label.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A remote forward you ask for&lt;/strong&gt; into a VM, with &lt;code&gt;ssh -R&lt;/code&gt; through devvm&amp;rsquo;s ssh config, may bind an address in &lt;code&gt;127.77.0.0/16&lt;/code&gt; in that VM, as &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#the-network"&gt;remote forwards you add&lt;/a&gt; says. sshd matches the rule as text and then resolves what it matched, which is why a host name that begins with &lt;code&gt;127.77.&lt;/code&gt; binds whatever address it resolves to in the VM. devvm&amp;rsquo;s own forwards name addresses only.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Many connections:&lt;/strong&gt; a client can keep 256 connections busy, which refuses its own further connections and makes the host run that many ssh processes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network rules don&amp;rsquo;t apply to links,&lt;/strong&gt; through the proxy or not, so &lt;code&gt;devvm network deny db&lt;/code&gt; doesn&amp;rsquo;t stop the link &lt;code&gt;db&lt;/code&gt;. The published ports and the policy rule between the two VMs decide a link&amp;rsquo;s connections, and &lt;code&gt;devvm link rm&lt;/code&gt; removes one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A link&amp;rsquo;s short name before its first session lists it.&lt;/strong&gt; Until &lt;code&gt;devvm _links&lt;/code&gt; has written a client&amp;rsquo;s list once, the proxy doesn&amp;rsquo;t know &lt;code&gt;db&lt;/code&gt; is a link, so a request for &lt;code&gt;db:5432&lt;/code&gt; meets the rules, and a rule such as &lt;code&gt;**&lt;/code&gt; sends it to whatever the host&amp;rsquo;s resolver finds for &lt;code&gt;db&lt;/code&gt; as a full name, such as in &lt;code&gt;/etc/hosts&lt;/code&gt;, never under its search domain, or a company proxy finds by that name. After that, the list stays until devvm removes the VM, and &lt;code&gt;NAME.devvm.internal&lt;/code&gt; is never the rules'.&lt;/li&gt;
&lt;li&gt;Linux hosts are untested.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC, data isolation and resource exhaustion companions). One row per lead, with what holds it and the end-to-end check that proves it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;End-to-end check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A compromised client attacking the target through a link&lt;/td&gt;
&lt;td&gt;Accepted, bounded by the rules: only a published port, only on the target&amp;rsquo;s loopback, and a client only to a target on its own tier or a stricter one&lt;/td&gt;
&lt;td&gt;The link reaches the published port, while an unpublished port and a port that isn&amp;rsquo;t linked are refused, and after devvm link unpublish the next connection is refused&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A client reaching a target on a lower tier&lt;/td&gt;
&lt;td&gt;Refused when the link is made, at the client&amp;rsquo;s launch, on every connection, and by &lt;code&gt;devvm network&lt;/code&gt; giving the target a lower tier than the client&amp;rsquo;s or the client a higher one than the target&amp;rsquo;s. For a client on a confined tier, on every connection the target&amp;rsquo;s tier must also be enforced as it runs, so a target given a confined tier while running, outside its proxy until its next start, or one whose self-check failed, is refused (&lt;code&gt;unenforced&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;An allowlist client and an open target are refused by devvm link add, at launch, after &lt;code&gt;devvm network open&lt;/code&gt; on the target, and by &lt;code&gt;devvm network allowlist&lt;/code&gt; on an open client linked to such a target. A target given the allowlist tier while it runs, which devvm ls shows as unenforced, has the link&amp;rsquo;s next connection refused and logged as &lt;code&gt;unenforced&lt;/code&gt;, while its server runs, devvm link add and the client&amp;rsquo;s launch warn of it, and once restarted behind its proxy it&amp;rsquo;s reached again&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root in the client opening a channel to an address or port the host didn&amp;rsquo;t ask for&lt;/td&gt;
&lt;td&gt;OpenSSH&amp;rsquo;s client refuses it and connects only to the link&amp;rsquo;s socket&lt;/td&gt;
&lt;td&gt;With the client&amp;rsquo;s sshd loosened by root (below), no host listener or connection appears that devvm didn&amp;rsquo;t make, and only the link&amp;rsquo;s socket is reached&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root in the client loosening sshd (&lt;code&gt;PermitListen any&lt;/code&gt;, &lt;code&gt;GatewayPorts yes&lt;/code&gt;, a restart)&lt;/td&gt;
&lt;td&gt;The host asks only for its links&amp;rsquo; numeric &lt;code&gt;127.77&lt;/code&gt; addresses, and what sshd binds in the client is the client&amp;rsquo;s own: root can already put a relay of its own on any of its addresses. With &lt;code&gt;GatewayPorts yes&lt;/code&gt;, sshd binds each forward on every address of the client instead, so a second link on the same port can&amp;rsquo;t bind, and a client forwarding every port would forward it, as it would root&amp;rsquo;s relay. Nothing on the host changes&lt;/td&gt;
&lt;td&gt;After root rewrites the client&amp;rsquo;s sshd config and restarts it, the link session asks only for the links&amp;rsquo; addresses and the link still works, and with &lt;code&gt;PermitListen any&lt;/code&gt; alone nothing listens on the client&amp;rsquo;s &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt; for it. With &lt;code&gt;GatewayPorts yes&lt;/code&gt; too, the link session still listens on no host TCP port and connects only to the VMs&amp;rsquo; sshd, and the check prints what the client binds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM making its proxy reach a socket that isn&amp;rsquo;t one of its own links, or another VM&amp;rsquo;s link&lt;/td&gt;
&lt;td&gt;A request names a host and a port, never a path. The list is in the VM&amp;rsquo;s run folder (mode 700), which no VM can write, at a path devvm gives the proxy in its config, and the proxy reads it only as a regular file, not a symbolic link, that only you can write. An entry counts only when its socket is the one devvm names for this VM&amp;rsquo;s link at that address and port in devvm&amp;rsquo;s run folder (&lt;code&gt;proxy.LinkSocket&lt;/code&gt;), and each proxy needs its own VM&amp;rsquo;s password&lt;/td&gt;
&lt;td&gt;The client&amp;rsquo;s proxy refuses, by &lt;code&gt;GET&lt;/code&gt; and by &lt;code&gt;CONNECT&lt;/code&gt;, a name or port it hasn&amp;rsquo;t linked, a published port it hasn&amp;rsquo;t linked, &lt;code&gt;NAME.devvm.internal.devvm.internal&lt;/code&gt;, &lt;code&gt;devvm.internal&lt;/code&gt; and a link&amp;rsquo;s &lt;code&gt;127.77&lt;/code&gt; address, and none of them reaches a link, while its own link answers. The target, on the allowlist tier and with no links, gets a refusal from its own proxy for the client&amp;rsquo;s link name. Unit tests (&lt;code&gt;internal/proxy/links_test.go&lt;/code&gt;) refuse an entry naming another VM&amp;rsquo;s socket, a socket outside the sockets&amp;rsquo; folder (one in the list&amp;rsquo;s own folder among them) or another port&amp;rsquo;s, no link without the sockets&amp;rsquo; folder, a list that&amp;rsquo;s a symbolic link, writable by others, of another version or not JSON, and a host that is a socket&amp;rsquo;s path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An HTTP client in a confined client reaching a link added while it runs&lt;/td&gt;
&lt;td&gt;The proxy reads the list for every request, before any rule, and NAME stays out of &lt;code&gt;NO_PROXY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A link added to the running client is reached at once by curl through the VM&amp;rsquo;s proxy, by &lt;code&gt;GET&lt;/code&gt; and by &lt;code&gt;CONNECT&lt;/code&gt;, &lt;code&gt;NO_PROXY&lt;/code&gt; holds only &lt;code&gt;localhost,127.0.0.1,::1&lt;/code&gt;, and the client&amp;rsquo;s boot, its init&amp;rsquo;s start and its pinned host keys are the same after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The proxy changing a link&amp;rsquo;s bytes, or putting a secret into them&lt;/td&gt;
&lt;td&gt;The link&amp;rsquo;s path tunnels the bytes as they are, before the SNI check, interception and secrets&lt;/td&gt;
&lt;td&gt;None of its own end to end. Unit tests send a ClientHello for another host and a placeholder through a link whose name and port a secret&amp;rsquo;s hosts and an allow rule match, and the socket gets them as they were sent, and an absolute-form request reaches it without &lt;code&gt;Proxy-Authorization&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An honest VM&amp;rsquo;s sshd binding a link where it shouldn&amp;rsquo;t&lt;/td&gt;
&lt;td&gt;&lt;code&gt;PermitListen 127.77.*:*&lt;/code&gt; with &lt;code&gt;GatewayPorts clientspecified&lt;/code&gt;, written once in every VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sshd -T&lt;/code&gt; in every VM shows the settings, and &lt;code&gt;ssh -R&lt;/code&gt; from inside the client to &lt;code&gt;0.0.0.0&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt; or another range fails&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Another user&amp;rsquo;s program, or a VM, using a link&lt;/td&gt;
&lt;td&gt;A unix socket, mode 600, in a folder of mode 700, and no host TCP port&lt;/td&gt;
&lt;td&gt;The socket is mode 600 in a 700 folder, and no host TCP port carries the link&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link listener forwarded to the host&amp;rsquo;s localhost&lt;/td&gt;
&lt;td&gt;The forwarder skips &lt;code&gt;127.77.0.0/16&lt;/code&gt;, and Lima&amp;rsquo;s rules ignore every port&lt;/td&gt;
&lt;td&gt;With the client forwarding every port, nothing from a link listens on the host, while a server of the client&amp;rsquo;s own on &lt;code&gt;127.0.0.1&lt;/code&gt; with the same port is forwarded as usual (its control)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link reached on the client&amp;rsquo;s localhost&lt;/td&gt;
&lt;td&gt;Names only, numeric &lt;code&gt;127.77&lt;/code&gt; addresses&lt;/td&gt;
&lt;td&gt;Nothing from a link listens on the client&amp;rsquo;s &lt;code&gt;127.0.0.1&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt;, and a server of the client&amp;rsquo;s own there runs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM made again in the target&amp;rsquo;s folder inheriting a link&lt;/td&gt;
&lt;td&gt;The target&amp;rsquo;s ID, recorded with the link&lt;/td&gt;
&lt;td&gt;After devvm rm of the target, the client&amp;rsquo;s link is gone and the client is named, and a VM made again in that folder isn&amp;rsquo;t linked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Many connections&lt;/td&gt;
&lt;td&gt;At most 256 at once, then refused and logged (&lt;code&gt;link_limit&lt;/code&gt;), and an accept loop that takes a burst whole before it starts any relay and goes on accepting while the burst is carried or refused, so the socket&amp;rsquo;s backlog never refuses one unlogged&lt;/td&gt;
&lt;td&gt;256 connections at once, past the socket&amp;rsquo;s backlog of 128 on macOS, are all carried, and a 257th is refused and &lt;code&gt;devvm network log&lt;/code&gt; shows &lt;code&gt;link_limit&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A target holding a relay open, so its ssh and one of the 256 stay after its link goes&lt;/td&gt;
&lt;td&gt;Each relay&amp;rsquo;s own context, which the link&amp;rsquo;s removal and its target master&amp;rsquo;s replacement cancel, killing its ssh and freeing its slot&lt;/td&gt;
&lt;td&gt;A connection that a program in the client holds open, to a target&amp;rsquo;s server that never closes one, has its relay&amp;rsquo;s ssh on this machine end after &lt;code&gt;devvm link rm&lt;/code&gt;. Unit tests check the same with an ssh stand-in that never exits, for a removed link, a replaced master and a link whose target changed, with no goroutine left under &lt;code&gt;-race&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A target filling the client&amp;rsquo;s 256 relays while its links last, by never ending the channels of connections the client&amp;rsquo;s programs have closed&lt;/td&gt;
&lt;td&gt;The relay&amp;rsquo;s grace: its ssh is killed once the client&amp;rsquo;s side has closed and the target has sent nothing for 30 seconds, or 30 seconds after the client can take nothing more. One target can still hold relays that the client&amp;rsquo;s programs keep open, which the client chooses, so there&amp;rsquo;s no cap for each target&lt;/td&gt;
&lt;td&gt;None end to end, as an honest target ends its channels. Unit tests check it with an ssh stand-in that never exits: a closed and a half-closed client&amp;rsquo;s relay end after the grace, and one the stand-in keeps answering goes on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A program in the client taking a link&amp;rsquo;s address first&lt;/td&gt;
&lt;td&gt;Each link&amp;rsquo;s own &lt;code&gt;-O forward&lt;/code&gt;, failing alone with &lt;code&gt;link_port_taken&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A server on a link&amp;rsquo;s address and port before the link is added: that link fails with &lt;code&gt;link_port_taken&lt;/code&gt;, and another link of the client&amp;rsquo;s works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A malicious target&amp;rsquo;s answers&lt;/td&gt;
&lt;td&gt;As any server&amp;rsquo;s: they reach only the connection that asked&lt;/td&gt;
&lt;td&gt;None of its own: the target&amp;rsquo;s bytes go back over the same connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root in the client, or a malicious target, writing a line into the session&amp;rsquo;s log that reads as the session&amp;rsquo;s own, such as a false &lt;code&gt;link_port_taken&lt;/code&gt; or a hidden real one&lt;/td&gt;
&lt;td&gt;OpenSSH prints what the remote side sends, such as a disconnect&amp;rsquo;s reason, with its newlines, at the &lt;code&gt;LogLevel=ERROR&lt;/code&gt; the session&amp;rsquo;s ssh uses. So &lt;code&gt;devvm _links&lt;/code&gt; writes its ssh processes&amp;rsquo; output to its log a whole line at a time, each line behind &lt;code&gt;ssh:&lt;/code&gt;, so only the session&amp;rsquo;s own lines start with its prefix, which devvm link add and the launch read. A line in an error the session logs is indented, and the output of &lt;code&gt;ssh -O&lt;/code&gt; is joined into one line&lt;/td&gt;
&lt;td&gt;None of its own. A unit test (&lt;code&gt;internal/vmssh/links_test.go&lt;/code&gt;) runs a stub ssh that prints a disconnect&amp;rsquo;s reason holding forged lines, one of them in pieces around a line of the session&amp;rsquo;s, and the log holds only the session&amp;rsquo;s own lines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A connection starting a stopped target&lt;/td&gt;
&lt;td&gt;Never: &lt;code&gt;devvm _links&lt;/code&gt; checks the target runs and never starts it&lt;/td&gt;
&lt;td&gt;A connection to a stopped target fails, &lt;code&gt;devvm network log&lt;/code&gt; shows &lt;code&gt;link_target_stopped&lt;/code&gt;, and the target stays stopped. Restarted, it works again with its new host key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lima&amp;rsquo;s own ssh asking for remote forwards, as every VM&amp;rsquo;s sshd allows them&lt;/td&gt;
&lt;td&gt;Lima&amp;rsquo;s own ssh never asks for one, because devvm sets no reverse rule and its Lima home refuses settings it didn&amp;rsquo;t write. Every VM&amp;rsquo;s sshd allows remote forwards only on &lt;code&gt;127.77.*:*&lt;/code&gt;, so no other address binds, and on macOS a confined VM also has the hostagent&amp;rsquo;s sandbox&lt;/td&gt;
&lt;td&gt;Lima&amp;rsquo;s rules ignore every port, &lt;code&gt;sshd -T&lt;/code&gt; shows &lt;code&gt;permitlisten 127.77.*:*&lt;/code&gt;, and on a running Lima client, sshd listens on nothing but its own port and the link&amp;rsquo;s addresses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link name shadowing a real host&lt;/td&gt;
&lt;td&gt;One DNS label, never &lt;code&gt;localhost&lt;/code&gt;, the client&amp;rsquo;s hostname or another link&amp;rsquo;s, plus &lt;code&gt;NAME.devvm.internal&lt;/code&gt; under a reserved name&lt;/td&gt;
&lt;td&gt;The CLI tests refuse each, and end to end, &lt;code&gt;--as NAME&lt;/code&gt; reaches the target by that name alone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links changing on a running client&lt;/td&gt;
&lt;td&gt;&lt;code&gt;-O forward&lt;/code&gt; and &lt;code&gt;-O cancel&lt;/code&gt;, the setup over ssh, and the proxy&amp;rsquo;s list&lt;/td&gt;
&lt;td&gt;devvm link add and devvm link rm on a running client apply within seconds, through the proxy too, without a restart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two targets on one port&lt;/td&gt;
&lt;td&gt;An address per target&lt;/td&gt;
&lt;td&gt;Two targets publishing the same port are each reached by their own name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link left behind&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm stop&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; end the process and its sockets, and &lt;code&gt;gc --orphans&lt;/code&gt; finds leftovers&lt;/td&gt;
&lt;td&gt;Removing either VM leaves no &lt;code&gt;devvm _links&lt;/code&gt; process, socket or link state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links on open and confined tiers&lt;/td&gt;
&lt;td&gt;The same mechanism on every tier&lt;/td&gt;
&lt;td&gt;The section runs with both VMs on the allowlist tier and both open, a port below 1024 such as 80 on Lima&amp;rsquo;s Alpine VMs, and &lt;code&gt;devvm network log&lt;/code&gt; shows link events on both tiers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 data-hextra-search-id="groups"&gt;Groups&lt;span class="hx:absolute hx:-mt-20" id="groups"&gt;&lt;/span&gt;
&lt;a href="#groups" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A group is a named set of VMs that reach each other&amp;rsquo;s published ports by name: you run &lt;code&gt;devvm group join web&lt;/code&gt; in each VM&amp;rsquo;s folder, and every member gets a link to each port that every other member publishes. Groups are built on links alone. A group adds nothing below the link session, so every connection of a group&amp;rsquo;s link goes through the same session, sockets, proxy entrance and checks as a link made with &lt;code&gt;devvm link add&lt;/code&gt;, and everything above holds for it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rules:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A VM is in one group at a time.&lt;/strong&gt; &lt;code&gt;devvm group join&lt;/code&gt; refuses a VM that&amp;rsquo;s in another group (&lt;code&gt;group_other&lt;/code&gt;), naming &lt;code&gt;devvm group leave&lt;/code&gt;, and &lt;code&gt;devvm group leave&lt;/code&gt; takes no name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One tier.&lt;/strong&gt; Every member of a group is on the same tier. &lt;code&gt;devvm group join&lt;/code&gt; refuses a VM whose tier differs from the members&amp;rsquo; (&lt;code&gt;group_tier_mismatch&lt;/code&gt;), and a group with a member whose network section can&amp;rsquo;t be read, and &lt;code&gt;devvm network&lt;/code&gt; is refused for a member (&lt;code&gt;group_tier_fixed&lt;/code&gt;), naming the group and &lt;code&gt;devvm group leave&lt;/code&gt;. So every link a group makes keeps the links&amp;rsquo; tier rule, and each of its connections is still checked against the states, with the target&amp;rsquo;s tier enforced as it runs, and warned of with &lt;code&gt;link_target_unenforced&lt;/code&gt; when the group makes the link.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Membership is recorded on the host,&lt;/strong&gt; in each member&amp;rsquo;s own state under &lt;code&gt;~/.local/share/devvm&lt;/code&gt;, as &lt;code&gt;group&lt;/code&gt; and &lt;code&gt;group_as&lt;/code&gt; in its &lt;code&gt;links&lt;/code&gt; section, never in a project folder or a VM. A VM made again after &lt;code&gt;devvm rm&lt;/code&gt; gets new state with a new ID, so it&amp;rsquo;s in no group, and the links to the old VM, which record its ID, don&amp;rsquo;t apply to it. &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; keep the VM&amp;rsquo;s state, so the VM stays in its group (&lt;a href="#a-vm-made-again"&gt;a VM made again&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A group&amp;rsquo;s links are links,&lt;/strong&gt; recorded in each member&amp;rsquo;s links state with a mark of their own, so &lt;code&gt;devvm group leave&lt;/code&gt; removes only those, and &lt;code&gt;devvm link rm&lt;/code&gt; refuses them (&lt;code&gt;link_from_group&lt;/code&gt;) while they still apply. Every connection of one is also checked against membership: a group&amp;rsquo;s link applies only while its client and its target are in the same group (&lt;code&gt;ungrouped&lt;/code&gt; otherwise), so a link that a leave cut short, or a race between two devvm commands, left behind carries nothing, and &lt;code&gt;devvm link rm&lt;/code&gt; removes it. &lt;code&gt;devvm group leave&lt;/code&gt; removes the leaver&amp;rsquo;s own group links before it takes it out of the group, and running &lt;code&gt;devvm group join&lt;/code&gt; again works out every member&amp;rsquo;s links again. Each takes the client&amp;rsquo;s address for that member and the member&amp;rsquo;s name in the group: its folder part, or the name it joined with (&lt;code&gt;--as NAME&lt;/code&gt;). devvm works out a member&amp;rsquo;s group links again whenever a member joins or leaves, publishes or unpublishes a port, or adds or removes a link of its own, and it records and applies only the members whose links changed, naming the links each gains or loses (&lt;code&gt;group_links_added&lt;/code&gt;, &lt;code&gt;group_links_removed&lt;/code&gt;). A running member gets them at once, as &lt;code&gt;devvm link add&lt;/code&gt; gives them, and a stopped one at its next start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The user&amp;rsquo;s links take precedence.&lt;/strong&gt; A link made with &lt;code&gt;devvm link add&lt;/code&gt; stays as it is: a port it links gets no group link, its name names that member&amp;rsquo;s group links too, and when its name is another member&amp;rsquo;s name in the group, that member&amp;rsquo;s group links aren&amp;rsquo;t made in that client, which is warned of (&lt;code&gt;group_link_name_clash&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Names are unique in a group.&lt;/strong&gt; &lt;code&gt;devvm group join&lt;/code&gt; refuses a name another member has, as its name or its folder part (&lt;code&gt;group_name_taken&lt;/code&gt;), and &lt;code&gt;localhost&lt;/code&gt; (&lt;code&gt;group_name_host&lt;/code&gt;). It also refuses a VM whose own hostname, its folder part, is another member&amp;rsquo;s name, whether that&amp;rsquo;s the member&amp;rsquo;s folder part or the name it joined with (&lt;code&gt;group_name_hostname&lt;/code&gt;), because the name would resolve to the joining VM itself, whatever name it joins as. The refusal names the fix: the other member leaves and joins again with another name, or the project goes in a folder with another name. So no member&amp;rsquo;s name is another member&amp;rsquo;s hostname, and &lt;code&gt;groupLinks&lt;/code&gt; makes no link by such a name, or by &lt;code&gt;localhost&lt;/code&gt;, all the same.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Joins take turns.&lt;/strong&gt; Each &lt;code&gt;devvm group join&lt;/code&gt; and &lt;code&gt;devvm group leave&lt;/code&gt;, each publish and unpublish that works the members&amp;rsquo; links out again, and &lt;code&gt;devvm rm&lt;/code&gt; of a VM hold a lock on the host, &lt;code&gt;~/.local/share/devvm/groups.lock&lt;/code&gt; (&lt;code&gt;lockGroups&lt;/code&gt;), from reading the members&amp;rsquo; states to writing them. A join checks the group once before it asks to widen a parent folder&amp;rsquo;s VM, and again once it holds the lock, with the VM&amp;rsquo;s state read again, so two VMs joining at once are checked one after the other, and the second sees the first as a member. So the one tier and the names hold however the joins overlap. A devvm that waits for the lock does so under a status line (&lt;code&gt;group_waiting&lt;/code&gt;). The lock is an OS lock (&lt;code&gt;flock&lt;/code&gt;) on an open file, which the system lets go of when the process holding it ends, however it ends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm rm&lt;/code&gt; of a member takes it out of its group,&lt;/strong&gt; after &lt;code&gt;devvm rm&lt;/code&gt;&amp;rsquo;s removal of every link to it, and the group goes with its last member.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What a group adds to the link threat check.&lt;/strong&gt; A group joins the trust of every member: code in any member can often run code in the others through the ports they publish, and then has their network, secrets and project folder. A member joining later gets that reach into every member, and they into it, without a command in their folders, so &lt;code&gt;devvm group join&lt;/code&gt; says so on every join (&lt;code&gt;group_trust&lt;/code&gt;). Nothing reaches more than the published ports on each member&amp;rsquo;s own loopback, and the one tier keeps every member&amp;rsquo;s tier whole.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Every member trusts every other,&lt;/strong&gt; which &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;what a VM does through a link&lt;/a&gt; lists.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A published range gives a link for each port in it,&lt;/strong&gt; in every other member. A wide range means as many forwards in each member and as many sockets on the host, so publish only the ports you mean the group to reach.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm link add&lt;/code&gt; or &lt;code&gt;devvm link rm&lt;/code&gt; at the same moment as a group&amp;rsquo;s change&lt;/strong&gt; can each write the same member&amp;rsquo;s links whole, because those two don&amp;rsquo;t take the groups lock, so the later write wins. A group link left that way is refused as &lt;code&gt;ungrouped&lt;/code&gt;, and the next change works the links out again from the states.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC, data isolation and resource exhaustion companions), what a group adds to the links&amp;rsquo; rows above:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;End-to-end check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A member reaching every other member&amp;rsquo;s published ports&lt;/td&gt;
&lt;td&gt;Accepted, bounded by the links&amp;rsquo; rules: only published ports, only on each member&amp;rsquo;s loopback, and said on every join (&lt;code&gt;group_trust&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Three members reach each other&amp;rsquo;s published ports by name within seconds of the last join, and a port published by a member reaches the others at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A member joining later&lt;/td&gt;
&lt;td&gt;It needs &lt;code&gt;devvm group join&lt;/code&gt; in its own folder, on the host; membership is in each member&amp;rsquo;s state on the host, which no VM writes. Every join says the group joins every member&amp;rsquo;s trust&lt;/td&gt;
&lt;td&gt;The third VM&amp;rsquo;s join gives the other two links to its published port and it links to theirs, and &lt;code&gt;group_trust&lt;/code&gt; is said&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A member reaching one on a lower tier&lt;/td&gt;
&lt;td&gt;One tier at &lt;code&gt;devvm group join&lt;/code&gt;, checked again under the groups lock, &lt;code&gt;devvm network&lt;/code&gt; refused for a member, and every connection checked as for any link&lt;/td&gt;
&lt;td&gt;An allowlist VM is refused by an open group, and an open one by an allowlist group; &lt;code&gt;devvm network allowlist&lt;/code&gt; for a member is refused. Unit tests (&lt;code&gt;TestGroupJoinsAtOnce&lt;/code&gt;) and the CLI tests join an allowlist VM and an open one at once, and only one gets in, every time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A member&amp;rsquo;s name taking over a name the user chose&lt;/td&gt;
&lt;td&gt;The user&amp;rsquo;s links take precedence, a name is unique in the group, &lt;code&gt;localhost&lt;/code&gt; is refused, and so is a VM whose own hostname is a member&amp;rsquo;s name&lt;/td&gt;
&lt;td&gt;The CLI tests refuse a taken name, another member&amp;rsquo;s folder part, &lt;code&gt;localhost&lt;/code&gt;, and a VM whose folder part is a member&amp;rsquo;s folder part or the name it joined with, and drop a member&amp;rsquo;s group links whose name one of the user&amp;rsquo;s links has&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leaving or removing a member leaving links behind&lt;/td&gt;
&lt;td&gt;&lt;code&gt;devvm group leave&lt;/code&gt; and &lt;code&gt;devvm rm&lt;/code&gt; remove the group&amp;rsquo;s links in every member, and the user&amp;rsquo;s stay&lt;/td&gt;
&lt;td&gt;After &lt;code&gt;devvm group leave&lt;/code&gt;, the leaver&amp;rsquo;s and the others&amp;rsquo; group links are gone and their names don&amp;rsquo;t resolve, while a link made with &lt;code&gt;devvm link add&lt;/code&gt; still answers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A group&amp;rsquo;s link outliving its group, from a leave cut short or a race&lt;/td&gt;
&lt;td&gt;Each connection checks that the client and the target are in the same group (&lt;code&gt;ungrouped&lt;/code&gt;), and a leave removes the leaver&amp;rsquo;s group links first&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestCheckGroupLink&lt;/code&gt;) refuse a group&amp;rsquo;s link once either VM is in another group or none, and keep the user&amp;rsquo;s own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM made again inheriting membership&lt;/td&gt;
&lt;td&gt;Membership is in the VM&amp;rsquo;s own state, which &lt;code&gt;devvm rm&lt;/code&gt; deletes, so a VM made after it starts in no group. &lt;code&gt;devvm layer add&lt;/code&gt;, &lt;code&gt;devvm layer rm&lt;/code&gt; and &lt;code&gt;devvm update&lt;/code&gt; keep the state, because they make the same VM again (&lt;a href="#a-vm-made-again"&gt;below&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;The CLI tests: devvm rm of a member takes it out, and the last one&amp;rsquo;s leaving removes the group&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="read-only-paths-on-linux"&gt;Read-only paths on Linux&lt;span class="hx:absolute hx:-mt-20" id="read-only-paths-on-linux"&gt;&lt;/span&gt;
&lt;a href="#read-only-paths-on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;macOS locks &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks and config with the user-immutable flag, which Linux has only for root, so on Linux devvm makes them read-only where the VM sees them instead (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts"&gt;.git protection on Linux hosts&lt;/a&gt;). Lima&amp;rsquo;s &lt;code&gt;read-only-paths&lt;/code&gt; feature is native: QEMU serves the project folder over 9p from its own mount namespace, and devvm binds each path over itself there. Landlock, a FUSE layer and a 9p server of devvm&amp;rsquo;s own were ruled out: Landlock can&amp;rsquo;t make paths read-only below a folder it allows writes in, and the other two would put devvm&amp;rsquo;s code between the VM and every file of the project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; while a VM whose protection is on runs, nothing in it, root included, can write, replace, remove or rename &lt;code&gt;.git&lt;/code&gt;&amp;rsquo;s hooks, config and the rest of what&amp;rsquo;s locked, of &lt;code&gt;.git&lt;/code&gt; and of the submodules the check before its start found, or rename &lt;code&gt;.git&lt;/code&gt; and those git folders. git in the VM commits as before. Nothing changes for this machine&amp;rsquo;s own git, and nothing persists once QEMU ends. Where the host can&amp;rsquo;t do it, the start is refused, or, for a VM made there, protection is off and devvm says so at each launch. devvm reports a VM that&amp;rsquo;s on and runs without its pins, at each launch of it and at &lt;code&gt;devvm stop&lt;/code&gt;. One gap is listed, not closed: a file that a git command on this machine renames over a pinned one while the VM runs is the guest&amp;rsquo;s until it&amp;rsquo;s pinned again, and devvm names it afterwards.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a path that&amp;rsquo;s a symlink, or under one, which &lt;code&gt;mount(2)&lt;/code&gt; would follow out of the project folder; a file with another name; a host whose kernel refuses the namespace&amp;rsquo;s capabilities; a pinned file that a git command on this machine replaces while the VM runs; QEMU, or a process it starts, undoing a pin; what keeps the pins ending while QEMU runs; a pin reaching this machine&amp;rsquo;s own mounts; a VM started without devvm&amp;rsquo;s wrapper.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion&amp;rsquo;s privileged-helper and local-file classes). Leads, each ruled out, fixed or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A symlink at a pinned path, or above one:&lt;/strong&gt; ruled out. The check that lists the paths skips any that isn&amp;rsquo;t real (&lt;code&gt;realInDir&lt;/code&gt;), and &lt;code&gt;devvm _qemu pinned&lt;/code&gt; opens each path with &lt;code&gt;openat2&lt;/code&gt; beneath the project folder with &lt;code&gt;RESOLVE_NO_SYMLINKS&lt;/code&gt;, refuses anything but a file or a folder, and binds the descriptor it opened, never the path. A refused path stops the start (&lt;code&gt;TestRunPinned&lt;/code&gt;&amp;rsquo;s symlinked hooks folder). The VM isn&amp;rsquo;t running while QEMU&amp;rsquo;s namespace pins, so only this machine&amp;rsquo;s own programs could race the check.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The guest undoing a pin:&lt;/strong&gt; ruled out. The guest has no way into QEMU&amp;rsquo;s mount namespace, and 9p carries file operations, not mounts. A rename or removal of a mount point gets &lt;code&gt;EBUSY&lt;/code&gt;, and a write &lt;code&gt;EROFS&lt;/code&gt; (&lt;code&gt;TestRunPinned&lt;/code&gt;; e2e).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;QEMU undoing a pin:&lt;/strong&gt; ruled out for QEMU as it runs. It runs as you, with no capability in any namespace (&lt;code&gt;CapInh&lt;/code&gt;, &lt;code&gt;CapPrm&lt;/code&gt;, &lt;code&gt;CapEff&lt;/code&gt; and &lt;code&gt;CapAmb&lt;/code&gt; 0; its bounding set stays whole, which gives nothing with no new privileges) and no-new-privileges, and the pins belong to the namespace devvm made, where only &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; could unmount them. Listed: a guest that breaks out of QEMU runs as you, and can reach &lt;code&gt;.git&lt;/code&gt; through a process outside the namespace (&lt;code&gt;/proc/&amp;lt;pid&amp;gt;/root&lt;/code&gt;), as it can every file of yours.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm _qemu pinned&lt;/code&gt;, which keeps &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; in the namespace:&lt;/strong&gt; ruled out as a way in. It reads only &lt;code&gt;DEVVM_QEMU_PINS&lt;/code&gt;, which devvm gives it, binds only those paths with the same checks, and ends with QEMU. The guest can make it work by filling &lt;code&gt;.git&lt;/code&gt; with files, but each burst of changes makes one look at the pins.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What keeps the pins ending while QEMU runs:&lt;/strong&gt; fixed. A separate keeper could end (an inotify limit, a misread parent) with QEMU running on, so &lt;code&gt;devvm _qemu pinned&lt;/code&gt; runs QEMU as its child, killed when it ends, and a watch it can&amp;rsquo;t set up on any of the folders refuses the start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A change to a pin that goes unrecorded:&lt;/strong&gt; fixed. &lt;code&gt;devvm _qemu pinned&lt;/code&gt; refuses the start when it can&amp;rsquo;t write the events file&amp;rsquo;s first line. An event it can&amp;rsquo;t add later goes to Lima&amp;rsquo;s log with a warning, and to the file as a mark when it can, and the check names a record that&amp;rsquo;s unreadable, holds a mark or a line that isn&amp;rsquo;t an event, or lost its first line (&lt;code&gt;git_pins_unrecorded&lt;/code&gt;). A file it can&amp;rsquo;t write at all after the start stays listed, with Lima&amp;rsquo;s log as its record.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A git command on this machine replacing &lt;code&gt;.git/config&lt;/code&gt;:&lt;/strong&gt; listed, and reported. The new file isn&amp;rsquo;t pinned until &lt;code&gt;devvm _qemu pinned&lt;/code&gt; pins it again, within milliseconds of the change, and in that window the guest can write it, put a file of its own in its place, which then gets the pin, open it for writing, a handle the pin doesn&amp;rsquo;t take back, or give it another name. A guest that loops can win that window. Each pin made again, or that can&amp;rsquo;t be, is recorded and named once the VM stops, and the watch&amp;rsquo;s sums, which run on Linux with the pins too, name a file whose contents changed. macOS&amp;rsquo;s flag has no such window.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file with another name (a hard link):&lt;/strong&gt; fixed. A bind covers one name, and the guest could write the file through another, so a regular file to pin, or one in a folder to pin, with more than one name is refused at the start (&lt;code&gt;git_pin_linked&lt;/code&gt;), and one that gets another name while the VM runs isn&amp;rsquo;t pinned again and is named.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM that&amp;rsquo;s on running without its pins:&lt;/strong&gt; fixed, reported. Each launch of a running VM and &lt;code&gt;devvm stop&lt;/code&gt; read QEMU&amp;rsquo;s mounts and name each pin it lacks, &lt;code&gt;.git&lt;/code&gt; and the git folders as mount points and the rest read-only (&lt;code&gt;git_pins_missing&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A pin reaching this machine&amp;rsquo;s mounts:&lt;/strong&gt; ruled out. The namespace&amp;rsquo;s mounts are private, and a mount namespace owned by a user namespace gets none of its pins back to its parent&amp;rsquo;s (checked on Fedora: this machine&amp;rsquo;s &lt;code&gt;mountinfo&lt;/code&gt; has none of them while the VM runs).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What&amp;rsquo;s pinned, from the guest&amp;rsquo;s index:&lt;/strong&gt; ruled out. The VM writes the index, so it can add submodules, but devvm pins only real git folders inside the project folder (&lt;code&gt;hostsafety.IsGitDir&lt;/code&gt;), so the worst it can do is make a folder of its own project read-only to itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;DEVVM_QEMU_PINS&lt;/code&gt;:&lt;/strong&gt; ruled out. devvm sets it for the start alone, &lt;code&gt;_qemu&lt;/code&gt; checks that the folder is absolute and clean and that every path is relative and below it, and devvm takes it out of QEMU&amp;rsquo;s environment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An AppArmor profile for Ubuntu:&lt;/strong&gt; ruled out for now. A profile with the &lt;code&gt;userns&lt;/code&gt; rule for devvm&amp;rsquo;s binary, in a folder you can write, would let any program running as you put itself there and get what Ubuntu&amp;rsquo;s restriction holds back, so devvm offers none, and Ubuntu with the restriction on only watches &lt;code&gt;.git&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;.git/commondir&lt;/code&gt;:&lt;/strong&gt; listed. A file has to be there to be pinned, and devvm puts nothing in &lt;code&gt;.git&lt;/code&gt; that git doesn&amp;rsquo;t, so the VM can still make one, which devvm reports at each check, as on macOS.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM started without devvm:&lt;/strong&gt; reported. &lt;code&gt;limactl start&lt;/code&gt; runs QEMU without devvm&amp;rsquo;s wrapper, so without pins, as it runs without the network confinement (&lt;code&gt;unenforced&lt;/code&gt; in &lt;code&gt;devvm ls&lt;/code&gt;), and the next launch or &lt;code&gt;devvm stop&lt;/code&gt; names its missing pins. Start VMs with devvm.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files owned by another user:&lt;/strong&gt; listed. QEMU&amp;rsquo;s namespace maps only you, so a file in the project folder that another user owns shows as &lt;code&gt;nobody&lt;/code&gt;&amp;rsquo;s in the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section on a Linux host, run on Fedora 43 and Debian 13): QEMU runs in a namespace with &lt;code&gt;.git/config&lt;/code&gt; and &lt;code&gt;.git/hooks&lt;/code&gt; mounted read-only, with no capability and no-new-privileges; root in the VM can&amp;rsquo;t add a hook, change, replace or remove the config, rename &lt;code&gt;.git&lt;/code&gt; or move the hooks folder; git in the VM commits; &lt;code&gt;git config&lt;/code&gt; on this machine reaches the VM, and the new config is read-only in the VM again; a submodule the VM adds is named by devvm stop, nothing of the namespace outlives the stop, and the next start pins the submodule&amp;rsquo;s config but not a folder that isn&amp;rsquo;t a git folder; &lt;code&gt;devvm git-protect off&lt;/code&gt; on a running VM applies at its next start, which pins nothing; a VM left strict is on at its next launch, its &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; taken out, and pinned again, and its next stop names nothing. Unit tests: &lt;code&gt;TestRunPinned&lt;/code&gt; (a file renamed over a pinned one is pinned again and recorded; a hard link refuses the start), &lt;code&gt;TestPinsInNamespace&lt;/code&gt;, &lt;code&gt;TestKeep&lt;/code&gt; and &lt;code&gt;TestProbePin&lt;/code&gt; on a Linux host, &lt;code&gt;TestPinsOrder&lt;/code&gt;, &lt;code&gt;TestPinsRefused&lt;/code&gt;, &lt;code&gt;TestStartPins&lt;/code&gt;, &lt;code&gt;TestPins&lt;/code&gt;, &lt;code&gt;TestBindsWatch&lt;/code&gt;, &lt;code&gt;TestReportPinEvents&lt;/code&gt; (a path&amp;rsquo;s repeats in one line, each record it can&amp;rsquo;t trust named), &lt;code&gt;TestRecordPinEvent&lt;/code&gt;, &lt;code&gt;TestPinWaits&lt;/code&gt; (a folder it can&amp;rsquo;t watch fails the watch) and &lt;code&gt;TestPinsMissing&lt;/code&gt; (&lt;code&gt;.git&lt;/code&gt; not a mount point, a config not read-only).&lt;/p&gt;
&lt;h2 data-hextra-search-id="nested-repos"&gt;Nested repos&lt;span class="hx:absolute hx:-mt-20" id="nested-repos"&gt;&lt;/span&gt;
&lt;a href="#nested-repos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A folder often holds git repos of its own besides its submodules, such as a workspace of several repos with no repo at its top. Every one of them is in the VM&amp;rsquo;s mount, so &lt;code&gt;.git&lt;/code&gt; protection covers each as it covers the folder&amp;rsquo;s own repo (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#nested-repos"&gt;nested repos&lt;/a&gt;). Two other designs were weighed. Refusing such folders, or warning only, leaves the most common multi-repo layout without protection. A &lt;code&gt;--clone&lt;/code&gt; of every repo keeps the VM out of the working trees altogether, which is what a &lt;a href="#workspace-clones"&gt;workspace clone&lt;/a&gt; does for a user who doesn&amp;rsquo;t need the VM to write them, so both are built.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; in a VM made by this devvm, or one &lt;code&gt;devvm git-protect on&lt;/code&gt; set, nothing in the VM can change the hooks and config of a nested repo that a walk of the stopped VM&amp;rsquo;s folder found, with the same locks, pins and watch as the folder&amp;rsquo;s own repo, and with the same reports at each check. It holds from the check that found the repo: a repo the VM makes while it runs, or a folder of its own the VM puts in a protected repo&amp;rsquo;s place on Linux, is git&amp;rsquo;s to use on this machine until the next stopped check names it, and what the walk can&amp;rsquo;t find or the bound leaves out is named, or counted, not protected. A VM an earlier devvm made keeps protecting only its own repo until &lt;code&gt;devvm git-protect on&lt;/code&gt;, because locking a repo&amp;rsquo;s config breaks &lt;code&gt;git config&lt;/code&gt; there, which the user didn&amp;rsquo;t ask for. It&amp;rsquo;s told once.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; the walk finding the wrong folders or too many; a lock or a read outside the mount through a nested repo&amp;rsquo;s paths, which now have two bounds, the repo&amp;rsquo;s top folder and the mount; the VM hiding a nested repo behind another one&amp;rsquo;s protection; two VMs protecting one repo, where one&amp;rsquo;s unlock would take the other&amp;rsquo;s locks off; taking a strict VM&amp;rsquo;s &lt;code&gt;diff.ignoreSubmodules&lt;/code&gt; out, which unlocks a config to write it; and the cost of a check, which the VM can raise by making repos.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion&amp;rsquo;s local-file and race classes, with two independent reviews of the change, the second adversarial, which proved its two highs with real host git running a VM-planted &lt;code&gt;core.fsmonitor&lt;/code&gt;). Leads, each fixed, ruled out or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A nested repo hidden behind another&amp;rsquo;s protection:&lt;/strong&gt; fixed. The first version left a nested repo to any repo whose scan locked its git folder as a submodule&amp;rsquo;s, and the VM writes the index that names submodules, so a gitlink with a &lt;code&gt;.git&lt;/code&gt; file naming &lt;code&gt;b/.git&lt;/code&gt; hid &lt;code&gt;b&lt;/code&gt;&amp;rsquo;s own submodules and worktrees from every scan (&lt;code&gt;TestNestedGitlinkCantHide&lt;/code&gt;). The second left one to any repo whose &lt;code&gt;.git&lt;/code&gt; its git folder was below, so a &lt;code&gt;src/.git&lt;/code&gt; file naming a &lt;code&gt;.git/evil&lt;/code&gt; the VM made, or a &lt;code&gt;.git/modules/x&lt;/code&gt; whose &lt;code&gt;commondir&lt;/code&gt; leads to one, was neither locked nor named. A repo is now left to another only when its git folder is one that repo&amp;rsquo;s scan locks whole: its &lt;code&gt;.git&lt;/code&gt;, a git folder under &lt;code&gt;.git/modules&lt;/code&gt; that reads its own config, or a linked worktree whose &lt;code&gt;commondir&lt;/code&gt; leads back. Anything else is scanned on its own and named (&lt;code&gt;TestNestedIntoTopGit&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A protected nested repo made to look gone:&lt;/strong&gt; fixed. devvm took a folder for a repo by a narrower test than git&amp;rsquo;s, which also takes a &lt;code&gt;HEAD&lt;/code&gt; with a &lt;code&gt;commondir&lt;/code&gt;, and &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt; that are files, so the VM could rename a protected repo&amp;rsquo;s &lt;code&gt;objects&lt;/code&gt; and &lt;code&gt;refs&lt;/code&gt;, add a &lt;code&gt;commondir&lt;/code&gt; to a git folder of its own, or rename &lt;code&gt;.git&lt;/code&gt; to &lt;code&gt;.GIT&lt;/code&gt; on macOS, or make it unreadable, and devvm dropped the repo as gone while git still used it, its pins and watch with it. The walk now takes anything named &lt;code&gt;.git&lt;/code&gt;, any case on macOS, &lt;code&gt;hostsafety.IsGitDir&lt;/code&gt; follows git&amp;rsquo;s test, and a recorded repo stays while anything is at its &lt;code&gt;.git&lt;/code&gt; (&lt;code&gt;TestNestedNotGone&lt;/code&gt;, &lt;code&gt;TestIsGitDir&lt;/code&gt;). &lt;code&gt;git_nested_gone&lt;/code&gt; is a warning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A bare repo the VM makes:&lt;/strong&gt; listed, named. git takes a folder shaped like a git folder for a bare repo, and its config can name a work tree, so git run below one runs its &lt;code&gt;core.fsmonitor&lt;/code&gt;. devvm names the ones it finds, and &lt;code&gt;devvm doctor&lt;/code&gt; gives a tip until git&amp;rsquo;s &lt;code&gt;safe.bareRepository&lt;/code&gt; is &lt;code&gt;explicit&lt;/code&gt; (git 2.38 and newer), which refuses them; devvm never changes your git config.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A path outside the mount:&lt;/strong&gt; ruled out. Every lock, unlock and pin goes through &lt;code&gt;realInDir&lt;/code&gt;, which takes the mount as its bound and refuses a path with a symlink in it below the mount, so a nested repo whose folder became a symlink is reported, not locked (&lt;code&gt;TestLockNeverThroughSymlinks&lt;/code&gt;, &lt;code&gt;TestRealInDirPins&lt;/code&gt;). The walk follows no symlink and stays on the mount&amp;rsquo;s file system. The state records nested repos by local relative paths only.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two VMs, one repo:&lt;/strong&gt; fixed. On macOS both VMs set the same flag, so an unlock leaves what another VM&amp;rsquo;s protection still covers, and names that VM (&lt;code&gt;TestNestedUnlockKept&lt;/code&gt;, the &lt;code&gt;git_nested&lt;/code&gt; script&amp;rsquo;s nested VM). Unlocking a kept config for a moment, to take a strict VM&amp;rsquo;s &lt;code&gt;diff.ignoreSubmodules&lt;/code&gt; out, would let a running VM race it, so devvm skips a kept config there, and locks a config again when git can&amp;rsquo;t change it (&lt;code&gt;TestUnstrictKept&lt;/code&gt;, &lt;code&gt;TestUnstrictFails&lt;/code&gt;). The ownership check fails closed: a state that can&amp;rsquo;t be read keeps every path in the folder its state&amp;rsquo;s folder is named after, and a VMs&amp;rsquo; folder that can&amp;rsquo;t be read keeps everything (&lt;code&gt;TestGitKeeper&lt;/code&gt;). Locking and recording, and unlocking, take one host lock (&lt;code&gt;paths.Dirs.GitLock&lt;/code&gt;), so two commands at once can&amp;rsquo;t unlock what the other just locked. A repo devvm stops protecting keeps its record in &lt;code&gt;made.left&lt;/code&gt;, so its locks come off with the rest, and one that left the folder is named, as only &lt;code&gt;chflags&lt;/code&gt; reaches it then (&lt;code&gt;TestNestedLeftUnlocked&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo whose git folder is outside the folder:&lt;/strong&gt; named. Its &lt;code&gt;.git&lt;/code&gt; file is locked, and the VM can&amp;rsquo;t reach where it leads, but another project&amp;rsquo;s VM may write it, as for a submodule&amp;rsquo;s (&lt;code&gt;git_nested_gitdir_outside&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The watch hiding a change:&lt;/strong&gt; fixed. The watch records a new or gone nested repo&amp;rsquo;s sums without naming them, and it first skipped every path under such a repo&amp;rsquo;s folder, so a repo nested in it went unwatched for a check. It now skips only the paths whose deepest repo is that one (&lt;code&gt;TestRepoOf&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The bound used to hide a repo:&lt;/strong&gt; fixed. The VM can make up to 100 repos cheaply, and the walk keeps the first 100, so the count past the bound is now named at every check, with the first ten of them, not only when it grows, as the VM could keep the count and change which repos are past it. The &lt;code&gt;.git&lt;/code&gt; the walk sees where it doesn&amp;rsquo;t look for repos, which a set-id walk on Linux sees, and the folders on other disks it doesn&amp;rsquo;t enter, are counted and named.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost:&lt;/strong&gt; fixed, and listed. A scan followed gitlinks that led back to a git folder it had followed, through a symlinked folder, up to eight deep, so the VM could make it run git without end; it now follows each git folder once, and one check&amp;rsquo;s scans follow 1,000 in all, across every repo, and name a repo past that (&lt;code&gt;TestEmbeddedOnce&lt;/code&gt;, &lt;code&gt;TestScanBudget&lt;/code&gt;). A launch into a running VM scans no nested repo, so it costs what it did before them. A check scans eight repos at once, so 50 nested repos take under a second on an M3 Max, walk and locks included (&lt;code&gt;BenchmarkNestedCheck&lt;/code&gt;). Listed: the watch&amp;rsquo;s bounds grow with the repos, at most 2,000 sums for the folder&amp;rsquo;s own repo and 200 for each nested one, each file read up to 16 MiB, so a VM that fills them makes a stopped check slow; a hooks folder filled to blind the watch is named at every check (&lt;code&gt;git_watch_blind&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A nested repo&amp;rsquo;s folder renamed on Linux:&lt;/strong&gt; listed, reported. A pin makes &lt;code&gt;.git&lt;/code&gt; a mount point, which the guest can&amp;rsquo;t rename, but a nested repo&amp;rsquo;s own folder isn&amp;rsquo;t one, so the guest can rename &lt;code&gt;ws/a&lt;/code&gt;, &lt;code&gt;.git&lt;/code&gt; and all, and put another repo in its place, which git on this machine then reads until the next check names it (&lt;code&gt;git_replaced&lt;/code&gt;). Pinning every folder down to each nested repo would refuse the VM&amp;rsquo;s own moves of those folders. macOS has the same gap for every repo, the folder&amp;rsquo;s own included.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo the VM makes while it runs:&lt;/strong&gt; listed, reported. devvm can&amp;rsquo;t lock what it hasn&amp;rsquo;t found, so a repo the VM clones while it runs is git&amp;rsquo;s repo for its folder from then on, shell prompts and editors included, and the VM&amp;rsquo;s until the next stopped check names it, with the config keys and hooks in it that run programs (&lt;code&gt;git_nested_appeared_runs&lt;/code&gt;), and locks it as it is. One deeper than four folders or under a skipped name is never named, only counted where a set-id walk sees it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The pins&amp;rsquo; file:&lt;/strong&gt; ruled out. A VM with many nested repos has more pins than one environment variable holds (&lt;code&gt;MAX_ARG_STRLEN&lt;/code&gt; is 128 KiB), so the start writes them to &lt;code&gt;run/git-pins.json&lt;/code&gt; in the VM&amp;rsquo;s folder, private and whole, which the VM can&amp;rsquo;t reach, and &lt;code&gt;devvm _qemu&lt;/code&gt; reads it through no symlink, capped, and checks it again (&lt;code&gt;TestPinsOrder&lt;/code&gt;, &lt;code&gt;TestPinsRefused&lt;/code&gt;). The keeper&amp;rsquo;s inotify watches are a few folders for each repo, far below the kernel&amp;rsquo;s limit for 100 repos.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section): a folder of two repos without one of its own gets a VM whose root can&amp;rsquo;t add a hook or change the config of either repo, on macOS and on a Linux host that pins; on a Linux host that can&amp;rsquo;t pin, &lt;code&gt;devvm stop&lt;/code&gt; names the config the VM changed; &lt;code&gt;devvm rm&lt;/code&gt; takes the locks off both; a repo whose &lt;code&gt;.git&lt;/code&gt; file names a git folder the VM made under the folder&amp;rsquo;s own &lt;code&gt;.git&lt;/code&gt; is named at &lt;code&gt;devvm stop&lt;/code&gt;; and a protected repo whose objects and refs the VM renamed, with a &lt;code&gt;commondir&lt;/code&gt; to a git folder of its own, or whose &lt;code&gt;.git&lt;/code&gt; it renamed to &lt;code&gt;.GIT&lt;/code&gt; on macOS, stays protected. Unit tests: &lt;code&gt;TestWalkRepos&lt;/code&gt;, &lt;code&gt;TestIsGitDir&lt;/code&gt;, &lt;code&gt;TestNestedIntoTopGit&lt;/code&gt;, &lt;code&gt;TestNestedNotGone&lt;/code&gt;, &lt;code&gt;TestScanBudget&lt;/code&gt;, &lt;code&gt;TestRunsProgram&lt;/code&gt;, &lt;code&gt;TestNestedLeftUnlocked&lt;/code&gt;, &lt;code&gt;TestGitKeeper&lt;/code&gt;, &lt;code&gt;TestBareExplicit&lt;/code&gt;, &lt;code&gt;TestNestedProtected&lt;/code&gt;, &lt;code&gt;TestNestedNoTopRepo&lt;/code&gt;, &lt;code&gt;TestNestedExistingVM&lt;/code&gt;, &lt;code&gt;TestNestedWatch&lt;/code&gt;, &lt;code&gt;TestNestedPins&lt;/code&gt;, &lt;code&gt;TestNestedGitdirInside&lt;/code&gt;, &lt;code&gt;TestKeeps&lt;/code&gt;, &lt;code&gt;TestMadeJSON&lt;/code&gt; and the 0.1.0 fixture&amp;rsquo;s tests, whose state reads as a VM whose protection covers its own repo alone.&lt;/p&gt;
&lt;h2 data-hextra-search-id="workspace-clones"&gt;Workspace clones&lt;span class="hx:absolute hx:-mt-20" id="workspace-clones"&gt;&lt;/span&gt;
&lt;a href="#workspace-clones" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm --clone&lt;/code&gt; in a folder of repos gives one VM a clone of each repo the user picks, each at its own path, so the paths between them work as on the host (&lt;a href="https://next.devvm.dev/docs/using/clone/#folders-of-repos"&gt;folders of repos&lt;/a&gt;). It extends the one-repo clone rather than adding a mode beside it: the clone section&amp;rsquo;s &lt;code&gt;repos&lt;/code&gt; lists the repos by their paths relative to the folder, and a clone of the folder&amp;rsquo;s own repo, the only kind devvm 0.1.0 made, reads as one repo at &lt;code&gt;.&lt;/code&gt; with its remote and seed in &lt;code&gt;made&lt;/code&gt;, so its state needs no migration. Every step that a one-repo clone takes for its repo, a workspace clone takes for each: the checks of &lt;code&gt;--clone&lt;/code&gt; (&lt;code&gt;checkRepoTop&lt;/code&gt;, &lt;code&gt;cloneSource&lt;/code&gt;, &lt;code&gt;gitprotect.OwnRepo&lt;/code&gt;), a remote of its own (&lt;code&gt;freeRemote&lt;/code&gt;), a copy of its branches through the VM&amp;rsquo;s own command channel to that repo&amp;rsquo;s path (&lt;a href="https://next.devvm.dev/docs/internals/git-protection/#the-copy-into-a-clone-vm"&gt;the copy into a clone VM&lt;/a&gt;), and at &lt;code&gt;devvm rm&lt;/code&gt; or &lt;code&gt;devvm clone off&lt;/code&gt;, the check of its work and the removal of its remote. The repos are found by the walk that &lt;a href="#nested-repos"&gt;&lt;code&gt;.git&lt;/code&gt; protection&lt;/a&gt; makes (&lt;code&gt;starter.walk&lt;/code&gt;), so the same depth, skipped folders and bound apply, and they&amp;rsquo;re recorded once, when the VM is made or at &lt;code&gt;devvm clone add&lt;/code&gt;, never at a launch.&lt;/p&gt;
&lt;p&gt;Four choices keep it small. The seed copies each repo&amp;rsquo;s refs as a one-repo clone&amp;rsquo;s seed does, every branch, tag and remote-tracking branch, so a workspace repo behaves in the VM as a repo of its own does; the seed sends one pack for each repo, so this costs about what a clone of the repo does. A repo &lt;code&gt;--clone&lt;/code&gt; can&amp;rsquo;t copy is listed and left out, never fatal, so one odd repo doesn&amp;rsquo;t stop the rest; the same holds for a repo whose three remote names are taken. The folder&amp;rsquo;s own files outside every repo are copied once and never back, as a tar the host makes from what it reads beneath the folder, so a Makefile or a compose file works in the VM without becoming a sync. And &lt;code&gt;devvm&lt;/code&gt; in one of the repos opens the folder&amp;rsquo;s VM at that repo&amp;rsquo;s path, because the VM has the repo there and mounts nothing of the host, so the finder&amp;rsquo;s reason to pass over a parent&amp;rsquo;s VM below a repo of its own, that the parent&amp;rsquo;s VM can write that repo, doesn&amp;rsquo;t hold; &lt;code&gt;--here&lt;/code&gt; still makes the repo&amp;rsquo;s own VM.&lt;/p&gt;
&lt;p&gt;rm&amp;rsquo;s check reads every repo at once: one script sent with the command (&lt;code&gt;cloneState&lt;/code&gt;, never a copy on disk) prints each repo&amp;rsquo;s branches, its status and its linked worktrees below the folder with their statuses, as length-prefixed records, so ten repos cost one ssh session, not thirty. devvm reads it as it reads anything from a VM, capped, by a parser that takes only what it asked for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The guarantee:&lt;/strong&gt; a workspace clone&amp;rsquo;s VM gets nothing of the host but the branches the user&amp;rsquo;s repos already have, the files outside them that devvm copied once, and the shared tools and agent folders every VM gets. Nothing from the VM runs on the host, changes a ref outside a repo&amp;rsquo;s remote-tracking branches for the VM, or writes outside those repos&amp;rsquo; &lt;code&gt;.git&lt;/code&gt;. Everything the VM says, its branch names, paths and statuses, is untrusted, checked before it&amp;rsquo;s used and made printable before it&amp;rsquo;s shown.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What could break it:&lt;/strong&gt; a host file outside the folder reaching the VM through the copy, by a link, a hard link, a swap during the read or a special file; host git run in a folder the state names, or by what the VM serves; refs written outside &lt;code&gt;refs/remotes/&amp;lt;remote&amp;gt;/&lt;/code&gt;; the clone check&amp;rsquo;s answer read without a bound, or a path in it that leads out of the folder; the finder taking a VM that mounts the folder for one that doesn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, its local IPC companion&amp;rsquo;s local-file class, and two independent adversarial reviews of the change, &amp;ldquo;the review&amp;rdquo; and &amp;ldquo;the second review&amp;rdquo; below). Leads, each fixed, ruled out or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A host file through the copy:&lt;/strong&gt; fixed. devvm first walked the folder by paths beneath an &lt;code&gt;os.Root&lt;/code&gt;, which follows a link in the middle of a path while it stays in the root, so another VM that mounts a subfolder could swap a folder there for a link to an unchosen repo, or its &lt;code&gt;.git&lt;/code&gt;, as the walk reached it, and the copy took that repo&amp;rsquo;s files and config (the adversarial review). The walk now opens each folder from its parent&amp;rsquo;s handle and checks it&amp;rsquo;s the folder it listed (&lt;code&gt;safefile.Root.OpenDir&lt;/code&gt;, &lt;code&gt;TestOpenDir&lt;/code&gt;), and opens each file by its own name in its folder, without following a link at its end, checked to be a regular file once open, and refused when it has another hard link, which could be any file on its disk (&lt;code&gt;OneLink&lt;/code&gt;). A folder shaped like a git dir, such as a bare mirror, was copied as plain files, which the review found too; it&amp;rsquo;s now left out and counted. A link is copied as a link only when its target is relative and stays in the folder, never read through. Other disks, sockets, FIFOs and devices stay on the host, and files keep their permissions without set-id bits (&lt;code&gt;TestWorkspaceFiles&lt;/code&gt;). A workspace clone copies the folder&amp;rsquo;s files, so devvm refuses the folders it refuses to mount, such as the home folder (&lt;code&gt;checkUnsafe&lt;/code&gt;). Listed: a secret the user keeps at the folder&amp;rsquo;s top, such as an &lt;code&gt;.env&lt;/code&gt;, is copied as any file is, which the docs say.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Host git in a folder the VM chose:&lt;/strong&gt; fixed. Host git runs only in the repos devvm&amp;rsquo;s state records, which only devvm writes, each at a clean path below the folder, and &lt;code&gt;repos&lt;/code&gt; passes over any other. The review found that only the seed checked a recorded repo again, so once another VM, or the user, removed a repo&amp;rsquo;s &lt;code&gt;.git&lt;/code&gt; or put another folder in its place, &lt;code&gt;devvm clone fetch&lt;/code&gt; and rm&amp;rsquo;s fetch wrote the VM&amp;rsquo;s objects and refs into whichever repo git found there, the folder&amp;rsquo;s own above it included. Every fetch into a repo, and devvm clone off&amp;rsquo;s undo adding its remote again, now checks first that the folder is still the top of a repo of its own (&lt;code&gt;checkRepoTop&lt;/code&gt;): &lt;code&gt;devvm clone fetch&lt;/code&gt; leaves it alone and names it, and rm and devvm clone off refuse and keep the VM (the &lt;code&gt;clone_workspace&lt;/code&gt; script). Every host git command goes through &lt;code&gt;hostgit&lt;/code&gt;, so no hook, fsmonitor, filter or &lt;code&gt;GIT_*&lt;/code&gt; of the environment runs, and the push and fetch connect to the VM alone, whatever the repo&amp;rsquo;s config says (&lt;code&gt;gitSSHCommand&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Refs from the VM:&lt;/strong&gt; ruled out. &lt;code&gt;devvm clone fetch&lt;/code&gt; fetches with &lt;code&gt;--refmap=&lt;/code&gt; and one refspec, &lt;code&gt;+refs/heads/*:refs/remotes/&amp;lt;remote&amp;gt;/*&lt;/code&gt;, so the VM&amp;rsquo;s branches land only under that repo&amp;rsquo;s remote for the VM, whose name devvm chose, and host git refuses a ref name it can&amp;rsquo;t take. rm&amp;rsquo;s fetch writes new &lt;code&gt;saved/&lt;/code&gt; branches only, never over one (&lt;code&gt;savedPrefix&lt;/code&gt;). The names devvm lists are host git&amp;rsquo;s, read back, and shown through &lt;code&gt;msg.Printable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The clone check&amp;rsquo;s answer:&lt;/strong&gt; ruled out. devvm reads at most 8 MiB, and fails the check past that or after 2 minutes; each record must be whole, of a repo asked for, and each worktree&amp;rsquo;s path clean, relative and below the folder, once, followed by its status (&lt;code&gt;TestParseCloneState&lt;/code&gt;, &lt;code&gt;TestWorktreePathPins&lt;/code&gt;). A VM that hides its work only loses its own work, which the docs say: devvm checks what the VM answers, not that it answers everything. A repo whose clone isn&amp;rsquo;t at its path in the VM first read as having nothing to check, so a clone moved in the VM went with its work without a question (the review); it&amp;rsquo;s now asked about, as uncommitted changes are (&lt;code&gt;TestCloneChangesAcrossRepos&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The finder&amp;rsquo;s carve-out:&lt;/strong&gt; ruled out. It applies only to a state whose clone section is on and a workspace, which never mounts the folder; a VM made again with the folder mounted clears that section first (&lt;code&gt;TestCoversRepo&lt;/code&gt;, the &lt;code&gt;clone_workspace&lt;/code&gt; script).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo another VM can swap:&lt;/strong&gt; fixed. A VM that mounts a subfolder holding a workspace repo, or the repo itself, can swap it for a link to another repo between devvm&amp;rsquo;s check and its push or fetch, which would send another repo&amp;rsquo;s history into the clone VM, or write the clone&amp;rsquo;s refs into another repo (the second review). devvm now refuses such a repo when it finds the repos, at &lt;code&gt;devvm clone add&lt;/code&gt; and before each push and fetch, and rm&amp;rsquo;s check runs no host git in it, naming the VM (&lt;code&gt;finder.mountsRepo&lt;/code&gt;, &lt;code&gt;stillRepo&lt;/code&gt;, the &lt;code&gt;clone_workspace_repo&lt;/code&gt; script); the check and git still race for a VM that mounts it only later, which the next command names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A repo with worktrees or repos of its own:&lt;/strong&gt; fixed. The second review found that a repo holding a linked worktree, as the docs&amp;rsquo; &lt;code&gt;.worktrees/NAME&lt;/code&gt; layout makes, or a repo below it, became a workspace: &lt;code&gt;--no-input&lt;/code&gt; scripts that 0.1.0 ran now refused, the worktree was copied as a repo of its own, recording a remote in the config it shares with its repo, and the folder&amp;rsquo;s own clone showed the other clones as untracked, so rm always asked. A folder that&amp;rsquo;s a repo gets its own clone unless &lt;code&gt;--repos&lt;/code&gt; is given, a linked worktree of a repo in the folder is never a repo of its own (&lt;code&gt;worktreeIn&lt;/code&gt;), each repo&amp;rsquo;s remote is chosen once the one before is added, and the folder&amp;rsquo;s own clone excludes the other clones and what the host&amp;rsquo;s &lt;code&gt;info/exclude&lt;/code&gt; names (&lt;code&gt;repoExcludes&lt;/code&gt;, &lt;code&gt;TestFindRepos&lt;/code&gt;, &lt;code&gt;TestRepoExcludes&lt;/code&gt;, the &lt;code&gt;clone_workspace_repo&lt;/code&gt; script). A folder of repos inside another repo&amp;rsquo;s working tree is refused, as its copy would take that repo&amp;rsquo;s files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Work lost to a copy that didn&amp;rsquo;t finish:&lt;/strong&gt; fixed. &lt;code&gt;devvm clone add&lt;/code&gt; records a repo before its copy, and a failed copy left it recorded and unseeded, which the command then called added, and rm passed over, so a push that reached the VM without its record went unchecked. A recorded, unseeded repo is now copied again by &lt;code&gt;devvm clone add&lt;/code&gt;, fetched when its remote is recorded, and checked by rm when its clone is in the VM (the &lt;code&gt;clone_workspace&lt;/code&gt; script&amp;rsquo;s failed add, then its retry).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The verification pass:&lt;/strong&gt; fixed. &lt;code&gt;devvm clone add .&lt;/code&gt; gave the folder&amp;rsquo;s own clone no excludes, so it showed the other clones as changes and rm always asked; it now gets every other repo&amp;rsquo;s and the host&amp;rsquo;s. A linked worktree whose repo another VM mounts wasn&amp;rsquo;t refused; devvm now checks the repo its common dir is in too (&lt;code&gt;mountingVM&lt;/code&gt;). Exclude lines took a repo&amp;rsquo;s folder name as a pattern, so &lt;code&gt;lib[2]&lt;/code&gt; wasn&amp;rsquo;t left out, and a name with a line break could write a line that left out every new folder, hiding work from rm; git&amp;rsquo;s pattern characters are now escaped, each line is anchored at both ends, and a repo whose name has a character &lt;code&gt;msg.Safe&lt;/code&gt; refuses, a line break among them, is refused (&lt;code&gt;TestRepoExcludes&lt;/code&gt; runs real git on them). A repo another VM mounts failed rm for the whole workspace; rm now reads its clone in the VM, checks every other repo, and asks before its work goes, never running host git in it. The VM&amp;rsquo;s folder never made failed the check; it now reads as every repo gone. Each repo is checked again after rm&amp;rsquo;s question, before its fetch. A retry whose push had landed sent it again, which the VM refused once its branch moved on; a repo the VM has with a commit is now left as it is, and only its remote added. The branches&amp;rsquo; bound of 10,000 is for all the repos of a check together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A worktree hidden by the bound:&lt;/strong&gt; fixed. The clone check&amp;rsquo;s script counted the worktrees outside the folder towards its 101 before leaving them out, so 101 outside ones hid a changed one inside, and rm deleted without asking, for a one-repo clone too; it counts only those inside now (&lt;code&gt;TestCloneStateScript&lt;/code&gt;). The repos&amp;rsquo; branches are capped at 10,000 in all per check, as each costs host git a lookup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost:&lt;/strong&gt; listed. The walk is &lt;code&gt;.git&lt;/code&gt; protection&amp;rsquo;s, bounded at 100 repos; the copy at 5,000 entries and 64 MiB, each file at 10 MiB. A VM can serve a pack without end, or many branches, which &lt;code&gt;devvm clone fetch&lt;/code&gt; writes into the repo until the disk is full or the user presses Ctrl+C, as &lt;code&gt;git fetch devvm&lt;/code&gt; would; a cap on what host git reads from the VM&amp;rsquo;s ssh isn&amp;rsquo;t built. The read of the clone, by rm and &lt;code&gt;devvm clone off&lt;/code&gt;, shares the bounds of the read of the agents&amp;rsquo; worktrees (&lt;code&gt;answer&lt;/code&gt;). devvm stops the VM&amp;rsquo;s command past 8 MiB and gives up past 2 minutes, so when a VM writes without end, slowly or not, or never answers, the check fails and devvm keeps the VM, and &lt;code&gt;--no-clone-check&lt;/code&gt; is the way out (&lt;code&gt;TestWorkCheckBounded&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;clone&lt;/code&gt; section): a folder of two repos and a file of its own gets one VM that mounts only the shared tools, with each repo&amp;rsquo;s clone at its path holding every branch and the folder&amp;rsquo;s file; an agent-like commit in each repo comes back with &lt;code&gt;devvm clone fetch&lt;/code&gt;, listed as one branch with both repos; &lt;code&gt;devvm clone add&lt;/code&gt; copies a third; rm without a terminal refuses with unfetched work in one repo, naming it, and keeps the VM; &lt;code&gt;--no-clone-check&lt;/code&gt; deletes it and removes every repo&amp;rsquo;s remote. Unit tests: &lt;code&gt;TestDefaultBranch&lt;/code&gt;, &lt;code&gt;TestSeedTips&lt;/code&gt;, &lt;code&gt;TestIsWorkspace&lt;/code&gt;, &lt;code&gt;TestChooseRepos&lt;/code&gt;, &lt;code&gt;TestPickRepos&lt;/code&gt;, &lt;code&gt;TestFindRepos&lt;/code&gt;, &lt;code&gt;TestWorkspaceFiles&lt;/code&gt;, &lt;code&gt;TestCloneChangesAcrossRepos&lt;/code&gt;, &lt;code&gt;TestFetchedByBranch&lt;/code&gt;, &lt;code&gt;TestCloneRepos&lt;/code&gt;, &lt;code&gt;TestFixtureClonesReadAsOneRepo&lt;/code&gt;, &lt;code&gt;TestCoversRepo&lt;/code&gt;, &lt;code&gt;TestParseCloneState&lt;/code&gt;, &lt;code&gt;TestCloneStateScript&lt;/code&gt;, &lt;code&gt;TestOpenDir&lt;/code&gt; and &lt;code&gt;TestRepoExcludes&lt;/code&gt;.&lt;/p&gt;
&lt;h2 data-hextra-search-id="a-vm-made-again"&gt;A VM made again&lt;span class="hx:absolute hx:-mt-20" id="a-vm-made-again"&gt;&lt;/span&gt;
&lt;a href="#a-vm-made-again" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;code&gt;devvm layer add&lt;/code&gt; and &lt;code&gt;devvm layer rm&lt;/code&gt; make a VM again from a new image, and &lt;code&gt;devvm update&lt;/code&gt; from its own image&amp;rsquo;s new build, while keeping devvm&amp;rsquo;s state for it and its home folder (&lt;a href="https://next.devvm.dev/docs/internals/overview/#making-a-vm-again"&gt;making a VM again&lt;/a&gt;). All three use the one remake, and three choices shape it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option B, a new disk.&lt;/strong&gt; The layer&amp;rsquo;s script never runs in the existing VM. Running it there would run a third-party installer next to the project&amp;rsquo;s files, as root, on a disk the VM&amp;rsquo;s own code has changed, and the image&amp;rsquo;s key would then describe a disk that no longer matches it. A new disk from the image keeps every VM a copy of an image whose key hashes everything in it. Taking a layer out works the same way, because a layer has no script that undoes it, and only a new disk from an image without the layer leaves nothing of it behind.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The old disk is kept until the new VM has started.&lt;/strong&gt; devvm stops the VM and renames its machine to &lt;code&gt;devvm-&amp;lt;hash&amp;gt;-old&lt;/code&gt; (&lt;code&gt;backend.Backend&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Rename&lt;/code&gt;, &lt;code&gt;limactl rename&lt;/code&gt; on Lima, which keeps the disk whole) before it makes the new one by the VM&amp;rsquo;s name, rather than deleting it first. So a failed create, start or home copy puts the old VM back as it was, and only a remake that got its new VM started with its home folder deletes the old disk. Every backend renames a stopped VM, so none deletes the old disk early. The aside name is no project VM&amp;rsquo;s name (&lt;code&gt;vmname.IsVM&lt;/code&gt;), which keeps it out of &lt;code&gt;devvm ls&lt;/code&gt;, the ssh config, the mounts devvm&amp;rsquo;s SSH agent checks and &lt;code&gt;devvm space&lt;/code&gt;&amp;rsquo;s strays. It&amp;rsquo;s 24 characters for every VM, two more than the shortest name a project VM can have, so in a Lima home whose path leaves room for fewer, the rename is refused (&lt;code&gt;lima_home_too_long&lt;/code&gt;) before anything else changes, and the VM stays as it was, stopped.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The VM keeps its ID.&lt;/strong&gt; A link records its target&amp;rsquo;s &lt;code&gt;id&lt;/code&gt; so that a different VM in the target&amp;rsquo;s folder, made after &lt;code&gt;devvm rm&lt;/code&gt;, never inherits the link (&lt;a href="#links-between-vms"&gt;links between VMs&lt;/a&gt;). A remake isn&amp;rsquo;t that case. The user runs it in the folder, on the host, and it keeps the VM&amp;rsquo;s name, its state, its folder and its project, so its links, its group and its published ports are the user&amp;rsquo;s choices for this project, and none of them is worth losing to a layer. A new ID would make every client&amp;rsquo;s link to the VM &lt;code&gt;replaced&lt;/code&gt;, and the user would have to add each again in every client&amp;rsquo;s folder, which gives nothing a check needs: the clients reach the same project&amp;rsquo;s published ports, on a VM the same person made again from an image devvm built. What changes is the VM&amp;rsquo;s disk and its host keys. devvm reads the new host keys from the new disk&amp;rsquo;s system files, which the home folder&amp;rsquo;s copy never reaches, as for any VM that starts, and a link session&amp;rsquo;s master to the target ends when the target stops, so the next one reads the new keys. A remake of a confined VM keeps it, with the same proxy password and salt, so the links&amp;rsquo; policy rule holds throughout.&lt;/p&gt;
&lt;h3 data-hextra-search-id="the-home-folders-copy"&gt;The home folder&amp;rsquo;s copy&lt;span class="hx:absolute hx:-mt-20" id="the-home-folders-copy"&gt;&lt;/span&gt;
&lt;a href="#the-home-folders-copy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The old VM&amp;rsquo;s home folder is the VM&amp;rsquo;s own data, which nothing on the host trusts. devvm runs &lt;code&gt;tar --one-file-system --ignore-failed-read&lt;/code&gt; in the old VM as its user, so the stream holds nothing from a mount, such as the project folder or an agent&amp;rsquo;s folder, and devvm reads it on the host with Go&amp;rsquo;s &lt;code&gt;archive/tar&lt;/code&gt; and &lt;code&gt;compress/gzip&lt;/code&gt; (&lt;code&gt;copyHome&lt;/code&gt;). Nothing unpacks it on the host. Each entry is kept or dropped there, and only what&amp;rsquo;s kept is written, gzipped again, to &lt;code&gt;home.tar.gz&lt;/code&gt; in the VM&amp;rsquo;s folder, 600 in folders that are 700:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Types:&lt;/strong&gt; regular files, folders and symlinks, and a hard link only to a regular file kept before it. Devices, FIFOs and anything else are dropped, so the new VM&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; creates none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paths:&lt;/strong&gt; each is cleaned, and one that&amp;rsquo;s absolute, has &lt;code&gt;..&lt;/code&gt; above the home folder or holds a control character is dropped, and so is the home folder&amp;rsquo;s own entry, so its mode stays the new image&amp;rsquo;s. So is any entry below a symlink kept before it, which &lt;code&gt;tar&lt;/code&gt; would follow out of the home folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modes and owners:&lt;/strong&gt; the setuid, setgid and sticky bits are dropped, and so are the entry&amp;rsquo;s owner and group, so the new VM&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; makes everything its user&amp;rsquo;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What devvm writes itself:&lt;/strong&gt; &lt;code&gt;~/.config/devvm&lt;/code&gt; (its environment, which holds the placeholders of the VM&amp;rsquo;s secrets), &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;, every agent&amp;rsquo;s login files, whichever agents the VM has, but Claude Code&amp;rsquo;s &lt;code&gt;~/.claude.json&lt;/code&gt;, whose per-folder state is history, the agents&amp;rsquo; folders that devvm links to their mounts and the files it copies from the host, all of which the new VM&amp;rsquo;s setup writes again, and &lt;code&gt;~/.cache&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;devvm puts the file into the new VM once it has started confined, as the VM&amp;rsquo;s user, with &lt;code&gt;tar --skip-old-files&lt;/code&gt;, so a file or folder the new image put in the home folder, &lt;code&gt;~/.bashrc&lt;/code&gt; among them, stays the image&amp;rsquo;s, its metadata included, and the shell that runs &lt;code&gt;tar&lt;/code&gt; there reads only the image&amp;rsquo;s files. devvm&amp;rsquo;s setup runs after it and writes its own files again. The file is deleted once the new disk has it, when the remake is undone, and with the VM&amp;rsquo;s folder.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The home folder is as trusted as the old VM was.&lt;/strong&gt; What its code wrote there, such as a shell snippet in &lt;code&gt;~/.bashrc.d&lt;/code&gt;, a &lt;code&gt;~/.ssh/config&lt;/code&gt; entry or an agent&amp;rsquo;s settings, runs in the new VM as it would have in the old one. The new VM is the same project&amp;rsquo;s VM, with the same reach, so this is no new access, and &lt;code&gt;--clean-home&lt;/code&gt; starts from the image&amp;rsquo;s home folder instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its size isn&amp;rsquo;t bounded.&lt;/strong&gt; A VM can make its home folder as large as its disk, and the copy then takes as much room on the host, besides the old disk and the new one. A VM can already fill the host&amp;rsquo;s disk through the project folder, which it writes, so this adds no new way to do it, and devvm checks for a VM&amp;rsquo;s free space before the remake.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It&amp;rsquo;s on the host&amp;rsquo;s disk for the remake&amp;rsquo;s minutes,&lt;/strong&gt; with whatever the VM keeps in its home, such as keys or logins it made itself. The VM&amp;rsquo;s disk holds the same data in devvm&amp;rsquo;s Lima home, with the same permissions, so a backup of the data folder sees it either way.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its data isolation and lifecycle and resource exhaustion companions):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A hostile home folder writing outside the new VM&amp;rsquo;s home through &lt;code&gt;..&lt;/code&gt;, an absolute path or a symlink it planted&lt;/td&gt;
&lt;td&gt;&lt;code&gt;copyHome&lt;/code&gt; drops each, on the host, before the new VM&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; sees the stream, and that &lt;code&gt;tar&lt;/code&gt; runs as the VM&amp;rsquo;s user&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestCopyHome&lt;/code&gt;) keep files, folders, symlinks and hard links to kept files, and drop &lt;code&gt;..&lt;/code&gt;, absolute paths, control characters, devices, FIFOs, setuid bits, owners, hard links out of the home folder and entries below a symlink&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A hostile stream attacking the host&lt;/td&gt;
&lt;td&gt;It&amp;rsquo;s parsed by memory-safe stdlib readers and never unpacked on the host, and it&amp;rsquo;s written only into the VM&amp;rsquo;s own folder, which only devvm writes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCopyHome&lt;/code&gt; refuses a stream that isn&amp;rsquo;t gzip&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;devvm&amp;rsquo;s own files or the user&amp;rsquo;s secrets carried across&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;, the agents&amp;rsquo; logins and the files and folders devvm copies or links from the host are left out, and the new VM&amp;rsquo;s setup writes them again&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCopyHome&lt;/code&gt; leaves them out, and the CLI tests check that a saved home holds &lt;code&gt;.bash_history&lt;/code&gt; without &lt;code&gt;~/.config/devvm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The old VM&amp;rsquo;s code influencing the new VM&amp;rsquo;s setup or the restore itself&lt;/td&gt;
&lt;td&gt;The restore keeps what the image put in the home folder, its folders&amp;rsquo; metadata included (&lt;code&gt;--skip-old-files&lt;/code&gt;), so the shell that runs it reads the image&amp;rsquo;s &lt;code&gt;~/.bashrc&lt;/code&gt;, and devvm&amp;rsquo;s setup runs after it&lt;/td&gt;
&lt;td&gt;The CLI tests check the restore&amp;rsquo;s command and order; e2e checks that a file in &lt;code&gt;~&lt;/code&gt; survives a remake and that the VM opens a shell afterwards&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A remake halfway losing the VM&lt;/td&gt;
&lt;td&gt;The old machine is kept aside until the new one has started with its home folder, the cleanup puts it back on any failure or interrupt before then and never deletes the new one after, and a killed devvm leaves the &lt;code&gt;remake&lt;/code&gt; section, which the next devvm finishes, while &lt;code&gt;devvm gc --orphans&lt;/code&gt; skips the VM and &lt;code&gt;devvm rm&lt;/code&gt; deletes both machines. The saved home folder goes only after the section does&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestRemakeUndo&lt;/code&gt;, &lt;code&gt;TestRemakePending&lt;/code&gt;, &lt;code&gt;TestRemakeDone&lt;/code&gt;, &lt;code&gt;TestRemakePendingChecked&lt;/code&gt;) and the CLI tests: a failed create and an interrupt put the old VM back as it was, a remake left with its old machine aside or gone is finished by the next devvm, checked again first, and one whose old machine wasn&amp;rsquo;t deleted keeps its new machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two devvms on one remake&lt;/td&gt;
&lt;td&gt;The remake lock (&lt;code&gt;run/remake.lock&lt;/code&gt;), held from finding the VM until the remake ends, with the state read again under it: a second devvm refuses (&lt;code&gt;remake_running&lt;/code&gt;) rather than finishing a remake that&amp;rsquo;s still running&lt;/td&gt;
&lt;td&gt;Unit test (&lt;code&gt;TestRemakeHeld&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Links reaching a different VM&lt;/td&gt;
&lt;td&gt;The VM keeps its ID only when its state is kept, by the user&amp;rsquo;s own remake in its folder, and a link session reads the new host keys once the target starts again&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestAddLayers&lt;/code&gt;) check every state key but the image survives, the ID included, and e2e&amp;rsquo;s &lt;code&gt;project&lt;/code&gt; section checks that a VM made again keeps its settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A parent folder&amp;rsquo;s VM made again from a subfolder&lt;/td&gt;
&lt;td&gt;Asked only in a terminal (&lt;code&gt;remake_parent_vm_ask&lt;/code&gt;), which &lt;code&gt;--force&lt;/code&gt; never answers, and refused without one&lt;/td&gt;
&lt;td&gt;The CLI tests refuse it without a terminal and keep it when the answer is no&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="a-folders-volume"&gt;A folder&amp;rsquo;s volume&lt;span class="hx:absolute hx:-mt-20" id="a-folders-volume"&gt;&lt;/span&gt;
&lt;a href="#a-folders-volume" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s state records its folder&amp;rsquo;s volume beside the folder&amp;rsquo;s device, inode and birth time, so a folder that moved while a restart gave its disk another device number keeps its VM (&lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;). The volume is macOS&amp;rsquo;s volume UUID, from &lt;code&gt;diskutil info -plist&lt;/code&gt; for the mount point and device read from the folder opened with no link on its path, or Linux&amp;rsquo;s &lt;code&gt;f_fsid&lt;/code&gt; on ext4, Btrfs and ZFS, read from that open folder. It&amp;rsquo;s bound to the folder&amp;rsquo;s inode and birth time, so a record that an older devvm left beside another folder names no volume.&lt;/p&gt;
&lt;p&gt;The volume tells two disks apart that each have a folder with the same inode and birth time, which happens by chance or when a copy of a disk gets a volume ID of its own. It doesn&amp;rsquo;t tell a disk from a copy that keeps the volume ID, and it isn&amp;rsquo;t a secret or a signature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Who can forge one:&lt;/strong&gt; whoever can write a volume&amp;rsquo;s metadata. On macOS that&amp;rsquo;s root, any program running as you, which can attach a disk image it made with &lt;code&gt;hdiutil&lt;/code&gt; without root and without asking, or anyone who makes a disk image, sets the UUID in its bytes and gets you to attach it. On Linux, &lt;code&gt;tune2fs -U&lt;/code&gt; and &lt;code&gt;btrfstune&lt;/code&gt; need write access to the block device, which is root&amp;rsquo;s, and a crafted image needs a loop mount, which is root&amp;rsquo;s unless your desktop lets you mount images. A crafted disk or image can set the inode and birth time too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What it gets them:&lt;/strong&gt; what a copy of the disk that keeps all three already gets. At another path, devvm offers the VM to the folder only when nothing is left at the old path and the folder is yours, and moves it only after you confirm. On a disk image or an external disk mounted with its owners ignored, as macOS mounts them by default, a folder can read as yours whoever made it, so that check holds little there. At the folder&amp;rsquo;s own path, the forged disk has to be mounted over the folder&amp;rsquo;s path, and then it gets the VM as the folder&amp;rsquo;s disk would.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What a VM can do:&lt;/strong&gt; nothing here. A VM can&amp;rsquo;t attach a disk or write a volume&amp;rsquo;s metadata on the host, and devvm reads the folder&amp;rsquo;s identity, its owner, its mount point and its device from the folder opened with no link on its path, so a link a VM puts in a folder&amp;rsquo;s place can&amp;rsquo;t pass another folder off as it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its data isolation companion):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A folder on another volume with the same inode and birth time, at the folder&amp;rsquo;s own path after a restart&lt;/td&gt;
&lt;td&gt;A renumbered folder at its own path must be on the recorded volume when both are known (&lt;code&gt;platform.KeepsVolume&lt;/code&gt;), checked when devvm finds the VM and again when the start records the new device&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestKeepsVolume&lt;/code&gt;, &lt;code&gt;TestRenumberedOnAnotherVolume&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link swapped in while devvm reads the folder&lt;/td&gt;
&lt;td&gt;The identity, owner, mount point, device and &lt;code&gt;f_fsid&lt;/code&gt; come from one folder opened with no link on its path (&lt;code&gt;platform.StatFolder&lt;/code&gt;), and &lt;code&gt;diskutil&lt;/code&gt;&amp;rsquo;s answer must name that mount point and device&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestStatFolderAndVolumeUUID&lt;/code&gt;, &lt;code&gt;TestStatFolder&lt;/code&gt;, &lt;code&gt;TestMovedFrom&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A &lt;code&gt;diskutil&lt;/code&gt; that hangs or fails&lt;/td&gt;
&lt;td&gt;A lookup within 1 or 5 seconds, none after one fails in a run, and a volume that can&amp;rsquo;t be told records no volume and matches no moved folder, while a renumbered folder at its own path is then judged by its device, inode and birth time alone, as for a state that records no volume&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestVolumeOfCache&lt;/code&gt;, &lt;code&gt;TestRecordFolder&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A disk the user mounts in its place&lt;/td&gt;
&lt;td&gt;Not held, because a disk mounted at the folder&amp;rsquo;s path with the folder&amp;rsquo;s volume ID, inode and birth time is the folder to devvm, as it is to any program&lt;/td&gt;
&lt;td&gt;Documented here and in &lt;a href="https://next.devvm.dev/docs/internals/security/#one-vm-per-folder"&gt;one VM per folder&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="opencodes-database-in-history-exports"&gt;opencode&amp;rsquo;s database in history exports&lt;span class="hx:absolute hx:-mt-20" id="opencodes-database-in-history-exports"&gt;&lt;/span&gt;
&lt;a href="#opencodes-database-in-history-exports" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;opencode 2 keeps its sessions and its logins in one SQLite database, &lt;code&gt;~/.local/share/opencode/opencode.db&lt;/code&gt; (&lt;code&gt;opencode-&amp;lt;channel&amp;gt;.db&lt;/code&gt; for another channel&amp;rsquo;s build), in WAL mode. An export of agents&amp;rsquo; history goes to this machine and can go into another VM of the folder, so it must carry the sessions without the logins. Leaving the database out would lose opencode&amp;rsquo;s history, and opencode&amp;rsquo;s own &lt;code&gt;opencode session export&lt;/code&gt; runs opencode and its server once per session, which an export before &lt;code&gt;devvm rm&lt;/code&gt; can&amp;rsquo;t count on. devvm copies the database in the VM with the &lt;code&gt;sqlite3&lt;/code&gt; that base installs (&lt;code&gt;sqlite3&lt;/code&gt; on Debian and Ubuntu, &lt;code&gt;sqlite&lt;/code&gt; on Alpine), as the VM&amp;rsquo;s user, in a temporary folder in &lt;code&gt;~/.cache&lt;/code&gt; (&lt;code&gt;opencodeClean&lt;/code&gt;):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;VACUUM INTO&lt;/code&gt; copies the database as one snapshot, with what its &lt;code&gt;-wal&lt;/code&gt; file holds, so a login that opencode saved last, which is still only in the WAL, is in the copy and taken out with the rest.&lt;/li&gt;
&lt;li&gt;In the copy, devvm drops every trigger, so none can put a row back, and empties the tables that hold logins: opencode 2.2&amp;rsquo;s &lt;code&gt;credential&lt;/code&gt; (its logins and API keys), &lt;code&gt;account&lt;/code&gt; and &lt;code&gt;control_account&lt;/code&gt; (its console&amp;rsquo;s access and refresh tokens) and &lt;code&gt;account_state&lt;/code&gt;, the &lt;code&gt;session_share&lt;/code&gt; table of an earlier opencode (each share&amp;rsquo;s secret), and any other table whose name has &lt;code&gt;credential&lt;/code&gt;, &lt;code&gt;account&lt;/code&gt;, &lt;code&gt;auth&lt;/code&gt;, &lt;code&gt;secret&lt;/code&gt;, &lt;code&gt;token&lt;/code&gt; or &lt;code&gt;share&lt;/code&gt; in it, or that has a column such as &lt;code&gt;secret&lt;/code&gt;, &lt;code&gt;api_key&lt;/code&gt;, &lt;code&gt;access_token&lt;/code&gt; or &lt;code&gt;password&lt;/code&gt;, so a table that a later opencode adds for its logins is emptied too. It also deletes the rows of the &lt;code&gt;kv&lt;/code&gt; table whose key starts with &lt;code&gt;wellknown:config:&lt;/code&gt;, because each holds an organization&amp;rsquo;s remote config, which opencode fetched with that organization&amp;rsquo;s well-known login and which can hold the organization&amp;rsquo;s keys. opencode fetches the config again once it has the login. It also empties what would run without asking in the VM that imports the copy (&lt;code&gt;opencodeUnattended&lt;/code&gt;): opencode 2.4&amp;rsquo;s &lt;code&gt;automation&lt;/code&gt; table, each automation&amp;rsquo;s trigger and the shell command it runs, which opencode approved once, as the automation was made, and never asks about again, its &lt;code&gt;permission&lt;/code&gt; table, the requests you said always to allow in a project, its &lt;code&gt;job&lt;/code&gt; table, the subagents&amp;rsquo; jobs, and its &lt;code&gt;session_inbox&lt;/code&gt; table, a session&amp;rsquo;s queued messages, which its service starts again when it starts (&lt;code&gt;restart.ts&lt;/code&gt;), and any table whose name starts with one of those names. It sets to NULL, in every table, a column named &lt;code&gt;time_suspended&lt;/code&gt;, which marks a session whose turn the service resumes on its own, and one named &lt;code&gt;commands&lt;/code&gt;, a project&amp;rsquo;s commands, whose start command opencode runs with &lt;code&gt;bash -lc&lt;/code&gt; for each worktree it makes (&lt;code&gt;opencodeNulled&lt;/code&gt;). It drops every view, as a view in an emptied table&amp;rsquo;s name could show a renamed table&amp;rsquo;s rows, and its check fails on any table with a generated column, which &lt;code&gt;pragma_table_info&lt;/code&gt; doesn&amp;rsquo;t list. Each session&amp;rsquo;s own rules are the &lt;code&gt;permission&lt;/code&gt; column of &lt;code&gt;session_v2&lt;/code&gt;, a JSON array of rules, each with an &lt;code&gt;effect&lt;/code&gt; of allow, deny or ask, so in every table with a &lt;code&gt;permission&lt;/code&gt; column, its name in any case, devvm keeps only the deny and ask rules with a text action, and a value that isn&amp;rsquo;t such an array becomes no rules (&lt;code&gt;opencodeAllowRules&lt;/code&gt;). It writes each kept rule again from the values that &lt;code&gt;sqlite3&lt;/code&gt; read, because &lt;code&gt;sqlite3&lt;/code&gt; reads a key written twice by its first value and opencode&amp;rsquo;s &lt;code&gt;JSON.parse&lt;/code&gt; by its last, so &lt;code&gt;&amp;quot;effect&amp;quot;:&amp;quot;deny&amp;quot;,&amp;quot;effect&amp;quot;:&amp;quot;allow&amp;quot;&lt;/code&gt; would otherwise stay as an allow rule for opencode. A kept rule whose resource is missing or isn&amp;rsquo;t text gets &lt;code&gt;*&lt;/code&gt;, which matches every resource, because opencode&amp;rsquo;s rules need one. It reads that JSON only where a &lt;code&gt;CASE&lt;/code&gt; has found it valid, because &lt;code&gt;sqlite3&lt;/code&gt; may read both sides of an &lt;code&gt;AND&lt;/code&gt; and fail on text that isn&amp;rsquo;t JSON.&lt;/li&gt;
&lt;li&gt;It takes out the record of opencode&amp;rsquo;s migration that imports &lt;code&gt;auth.json&lt;/code&gt; (&lt;code&gt;20260805200742_import_legacy_credentials&lt;/code&gt;), so the opencode that next opens the copy imports the logins that devvm&amp;rsquo;s setup wrote in its own VM&amp;rsquo;s &lt;code&gt;auth.json&lt;/code&gt;, as it does when it first makes its database.&lt;/li&gt;
&lt;li&gt;It turns WAL off, with &lt;code&gt;secure_delete&lt;/code&gt; on, and runs &lt;code&gt;VACUUM&lt;/code&gt;, which writes the file again, so no free page keeps a deleted row and no &lt;code&gt;-wal&lt;/code&gt; or &lt;code&gt;-journal&lt;/code&gt; file is left.&lt;/li&gt;
&lt;li&gt;It checks what &lt;code&gt;sqlite3&lt;/code&gt; printed, not only that it succeeded. Right after &lt;code&gt;VACUUM INTO&lt;/code&gt;, the copy must have as many tables as the database, and at least one. At the end, devvm counts the triggers and views, the generated columns, the rows of each table it emptied, the values left in each column it set to NULL, the rows whose &lt;code&gt;permission&lt;/code&gt; still holds anything but deny and ask rules, and the &lt;code&gt;kv&lt;/code&gt; rows it deleted, and each count must be &lt;code&gt;0&lt;/code&gt;, so a &lt;code&gt;sqlite3&lt;/code&gt; that runs nothing and prints nothing fails the check too. When a check or any step fails, the database is left out of the export and the run log says why.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The export&amp;rsquo;s &lt;code&gt;tar&lt;/code&gt; leaves out the database and its &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; and &lt;code&gt;-journal&lt;/code&gt; files as they are, matched within opencode&amp;rsquo;s folder, and adds the copy at the database&amp;rsquo;s path (&lt;code&gt;--transform&lt;/code&gt;, which leaves symlinks&amp;rsquo; targets alone). The import does the same to an export it unpacks, in the VM, before anything reaches the home folder: it deletes the &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; and &lt;code&gt;-journal&lt;/code&gt; files and any database that isn&amp;rsquo;t a regular file, and puts in each database&amp;rsquo;s copy, or deletes the database when the VM has no &lt;code&gt;sqlite3&lt;/code&gt; or the copy fails. Each &lt;code&gt;sqlite3&lt;/code&gt; runs with &lt;code&gt;trusted_schema&lt;/code&gt; off, so an imported database&amp;rsquo;s schema can&amp;rsquo;t call the CLI&amp;rsquo;s functions that write files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A secret that&amp;rsquo;s in a session itself,&lt;/strong&gt; such as a key you pasted into a prompt, stays in the session, as it does in Claude Code&amp;rsquo;s and Codex&amp;rsquo;s transcripts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A plugin&amp;rsquo;s own storage and a remote workspace&amp;rsquo;s binding stay.&lt;/strong&gt; opencode keeps each plugin&amp;rsquo;s storage in its &lt;code&gt;kv&lt;/code&gt; table, under the plugin&amp;rsquo;s own prefix, and each remote workspace&amp;rsquo;s binding, the record its provider needs to reconnect, in its &lt;code&gt;workspace&lt;/code&gt; table. opencode&amp;rsquo;s built-in plugins keep model catalogs and session records there, but a plugin you install, or a workspace provider, that keeps a token there takes it into the export.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM without &lt;code&gt;sqlite3&lt;/code&gt;,&lt;/strong&gt; made from an image built without it, exports and imports no opencode database, and opencode&amp;rsquo;s sessions are lost from that export.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;opencode&amp;rsquo;s own agents keep their rules.&lt;/strong&gt; A session keeps its agent, and a turn is checked against that agent&amp;rsquo;s built-in rules too, such as &lt;code&gt;explore&lt;/code&gt;&amp;rsquo;s, which allow its shell commands. With no suspended session, job or queued message, no turn starts until you send one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A host password that looks like a variable&amp;rsquo;s name or a number.&lt;/strong&gt; Settings&amp;rsquo; copies keep a value that looks like an environment variable&amp;rsquo;s name or a switch (&lt;code&gt;envName&lt;/code&gt;, &lt;code&gt;plainValue&lt;/code&gt;), so a service password set by hand in that form reached VMs as it was, with no &lt;code&gt;devvm-redacted&lt;/code&gt; for the setup&amp;rsquo;s clean-up to find; the release page says what to do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;event&lt;/code&gt; table stays as it is.&lt;/strong&gt; It holds the events that opencode&amp;rsquo;s sessions were made from, a &lt;code&gt;session.permissions&lt;/code&gt; event&amp;rsquo;s rules among them, and opencode 2.4.1 writes an event into &lt;code&gt;session_v2&lt;/code&gt; as it publishes it (its session projector), not when it opens a database, so the copy&amp;rsquo;s rules are the ones opencode reads. A later opencode that rebuilt its sessions from that table would read the allow rules again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A remake&amp;rsquo;s home folder copy&lt;/strong&gt; keeps opencode&amp;rsquo;s database with its logins, and its home key, because it&amp;rsquo;s the same VM&amp;rsquo;s data going into the same folder&amp;rsquo;s new VM (&lt;a href="#the-home-folders-copy"&gt;the home folder&amp;rsquo;s copy&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;opencode 2.4 keeps the private Ed25519 key of its home, which every machine it pairs with &lt;code&gt;opencode machine add&lt;/code&gt; trusts and which it never replaces, in a file of its own, &lt;code&gt;~/.local/state/opencode/machine/home-key&lt;/code&gt;, not in the database. The database&amp;rsquo;s &lt;code&gt;machine&lt;/code&gt; table holds each paired machine&amp;rsquo;s name and the public key it logs in to the home with, so it&amp;rsquo;s the VM&amp;rsquo;s own pairings, and the copy empties it with the login tables (&lt;code&gt;opencodeLogins&lt;/code&gt;). The key&amp;rsquo;s folder, the background service&amp;rsquo;s registration (&lt;code&gt;service.json&lt;/code&gt;, or &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt; on a channel other than latest, dev, beta or next, with the service&amp;rsquo;s password, written through &lt;code&gt;&amp;lt;file&amp;gt;.&amp;lt;id&amp;gt;.tmp&lt;/code&gt;, and &lt;code&gt;&amp;lt;file&amp;gt;.pty-handoff&lt;/code&gt;, a terminal&amp;rsquo;s handoff ticket, written through &lt;code&gt;&amp;lt;file&amp;gt;.pty-handoff.&amp;lt;uuid&amp;gt;.tmp&lt;/code&gt;) and the terminals&amp;rsquo; daemons (&lt;code&gt;pty&lt;/code&gt;, their sockets and access tokens) are opencode&amp;rsquo;s &lt;code&gt;HistoryOwn&lt;/code&gt; in the agents&amp;rsquo; registry: the export leaves them out and the import never writes them, while a remake keeps them. The registrations are patterns, &lt;code&gt;service-*.json&lt;/code&gt;, &lt;code&gt;service.json.*&lt;/code&gt; and &lt;code&gt;service-*.json.*&lt;/code&gt;, which the export&amp;rsquo;s GNU &lt;code&gt;tar --exclude&lt;/code&gt; and the import&amp;rsquo;s &lt;code&gt;tar --exclude&lt;/code&gt; and its clean-up loop, a shell glob, all expand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its data isolation companion):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A key typed into opencode in the VM reaching this machine&amp;rsquo;s export&lt;/td&gt;
&lt;td&gt;The export holds only the copy, whose login tables are empty and whose file is written again by &lt;code&gt;VACUUM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unit tests (&lt;code&gt;TestOpencodeClean&lt;/code&gt;, &lt;code&gt;TestHistoryExportRuns&lt;/code&gt;) plant a credential, an account&amp;rsquo;s tokens, a share&amp;rsquo;s secret and a later table&amp;rsquo;s key, the credential only in the WAL of an open connection, and find none of them in any byte of the copy or the export; e2e&amp;rsquo;s &lt;code&gt;network&lt;/code&gt; section plants a key with the VM&amp;rsquo;s &lt;code&gt;sqlite3&lt;/code&gt; and finds neither it nor the login&amp;rsquo;s placeholders in the export&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The WAL or journal file carrying the rows&lt;/td&gt;
&lt;td&gt;They never go into an export, and an import deletes them&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryExportRuns&lt;/code&gt; and &lt;code&gt;TestHistoryImportCleansOpencode&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An export with the logins in it reaching another VM&lt;/td&gt;
&lt;td&gt;The import makes the same copy in the VM before anything reaches its home folder, or leaves the database out&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryImportCleansOpencode&lt;/code&gt;, with and without &lt;code&gt;sqlite3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A trigger putting a row back as it&amp;rsquo;s deleted&lt;/td&gt;
&lt;td&gt;Every trigger is dropped first, and the rows are counted after&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestOpencodeClean&lt;/code&gt; plants one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A hostile VM&amp;rsquo;s export running a command, or allowing one, without asking in the VM that imports it&lt;/td&gt;
&lt;td&gt;The copy empties &lt;code&gt;automation&lt;/code&gt;, &lt;code&gt;permission&lt;/code&gt;, &lt;code&gt;job&lt;/code&gt; and &lt;code&gt;session_inbox&lt;/code&gt;, and every table whose name starts with one of those names, sets &lt;code&gt;time_suspended&lt;/code&gt; and &lt;code&gt;commands&lt;/code&gt; to NULL, keeps only the deny and ask rules of each &lt;code&gt;permission&lt;/code&gt; column, written again, drops views and refuses generated columns; the counts after must be &lt;code&gt;0&lt;/code&gt;. The export leaves out opencode&amp;rsquo;s git repositories (&lt;code&gt;snapshot&lt;/code&gt;, &lt;code&gt;repos&lt;/code&gt;, &lt;code&gt;worktree&lt;/code&gt;), and the import never writes them&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestOpencodeCleanSchema&lt;/code&gt; plants a row in each from opencode 2.4.1&amp;rsquo;s schema, an allow rule, a suspended session and a project&amp;rsquo;s commands; &lt;code&gt;TestOpencodeCleanSessionRules&lt;/code&gt; plants rules that aren&amp;rsquo;t deny or ask, a key written twice, values that aren&amp;rsquo;t rules and a column in upper case; &lt;code&gt;TestOpencodeCleanHidden&lt;/code&gt; a view and a generated column; &lt;code&gt;TestHistoryExportRuns&lt;/code&gt; and &lt;code&gt;TestHistoryImportRuns&lt;/code&gt; the git folders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;opencode&amp;rsquo;s home key reaching this machine&amp;rsquo;s export or another VM&lt;/td&gt;
&lt;td&gt;The export leaves out its &lt;code&gt;machine&lt;/code&gt; folder, &lt;code&gt;service.json&lt;/code&gt;, &lt;code&gt;service-&amp;lt;channel&amp;gt;.json&lt;/code&gt;, their handoff and temporary files, and &lt;code&gt;pty&lt;/code&gt;, and the import never writes them, by their paths after it unpacks too; the copy of the database empties its &lt;code&gt;machine&lt;/code&gt; table, the paired machines&amp;rsquo; public keys&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryExportRuns&lt;/code&gt;, &lt;code&gt;TestHistoryImportRuns&lt;/code&gt; and &lt;code&gt;TestHistoryImportV010&lt;/code&gt; plant them; &lt;code&gt;TestOpencodeCleanSchema&lt;/code&gt; empties &lt;code&gt;machine&lt;/code&gt; from opencode 2.4.1&amp;rsquo;s schema; &lt;code&gt;TestHomeSkipsEveryLogin&lt;/code&gt; keeps them in a remake&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A hostile database&amp;rsquo;s schema running code in the VM&lt;/td&gt;
&lt;td&gt;&lt;code&gt;trusted_schema&lt;/code&gt; is off, and it runs as the VM&amp;rsquo;s user on the VM&amp;rsquo;s own files, which the export&amp;rsquo;s code could reach anyway&lt;/td&gt;
&lt;td&gt;Reviewed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="links-out-of-an-agents-folder"&gt;Links out of an agent&amp;rsquo;s folder&lt;span class="hx:absolute hx:-mt-20" id="links-out-of-an-agents-folder"&gt;&lt;/span&gt;
&lt;a href="#links-out-of-an-agents-folder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s agent store reaches every VM with the agent: its folders are mounted read-only, its files are copied in at every launch, and the hooks, MCP servers&amp;rsquo; commands and plugins in it run in each of those VMs. So whatever &lt;code&gt;devvm agent import&lt;/code&gt; copies is something every such VM reads and runs. A link in an agent&amp;rsquo;s folder that leads out of it can lead anywhere on this machine, such as to &lt;code&gt;~/.ssh&lt;/code&gt;, to another agent&amp;rsquo;s login, or into a folder that a VM can write, such as a dotfiles repo that is also a devvm project. Following such links unasked would let a mistaken link put a secret into every VM, and let a VM that writes the folder a link leads into change what every other VM&amp;rsquo;s agent runs. That&amp;rsquo;s why the import follows no link out of an agent&amp;rsquo;s folder by default, and reads each folder through itself as an &lt;code&gt;os.Root&lt;/code&gt; (&lt;a href="https://next.devvm.dev/docs/internals/agents/#links-out-of-an-agents-folder"&gt;how&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Dotfiles repos keep settings as links all the same, and copying them into the store by hand is lost at the next import, so devvm follows them when you allow it, in two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s &lt;code&gt;follow-links&lt;/code&gt;&lt;/strong&gt; names folders, such as &lt;code&gt;~/dotfiles&lt;/code&gt;, whose links devvm follows without asking. You choose a folder once, for every import, so devvm checks the folder as a whole: one that is, holds or is inside a refused place fails the import, because a link inside it can lead anywhere in it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--follow-links&lt;/code&gt;, or a yes to the question,&lt;/strong&gt; follows one run&amp;rsquo;s links after naming each and where it leads, so you see every target before anything is copied. Without a terminal, no link out is followed unless the flag is given, and each is named in a warning, so a script never follows a link it didn&amp;rsquo;t ask for. The folder each is read through is the link&amp;rsquo;s own target, or a linked file&amp;rsquo;s own folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whichever allows it, the same rules hold:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Resolved first, read inside.&lt;/strong&gt; devvm resolves every link on the way to the target, checks that target, then reads it through the allowed folder as a root, which it opens one folder at a time from &lt;code&gt;/&lt;/code&gt;, never through a link. A link inside what it copies is read only when it leads to a file inside the same root.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Always refused.&lt;/strong&gt; devvm never follows a link to the home folder or a folder holding it, to devvm&amp;rsquo;s config, data or Lima folders, to &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/.gnupg&lt;/code&gt;, &lt;code&gt;~/.aws&lt;/code&gt;, &lt;code&gt;~/Library/Keychains&lt;/code&gt;, &lt;code&gt;~/.config/devvm&lt;/code&gt;, &lt;code&gt;~/.netrc&lt;/code&gt;, &lt;code&gt;~/.config/gh&lt;/code&gt;, &lt;code&gt;~/.docker&lt;/code&gt; or &lt;code&gt;~/.kube&lt;/code&gt;, or to any agent&amp;rsquo;s logins or history, nor into one of them or to a folder holding one. The home folder holds all of them, devvm&amp;rsquo;s folders hold its CA keys, binaries and every VM&amp;rsquo;s disk, and the agents&amp;rsquo; logins and history are what the store exists to keep apart from VMs. The named folders are the places that commonly hold credentials, and the list can&amp;rsquo;t name every one, which is why the question names each target and the setting takes folders you choose.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A VM&amp;rsquo;s folder warns.&lt;/strong&gt; A target in a VM&amp;rsquo;s project folder, or a &lt;code&gt;--clone&lt;/code&gt; VM&amp;rsquo;s source folder, is followed with a warning naming the VM, because that VM can change what every VM&amp;rsquo;s agent reads from the next import on. Refusing it would refuse the common case of a dotfiles repo that you also work on in a VM, and the warning leaves the choice with you. A chain that passes through a link in a VM&amp;rsquo;s folder to a place outside it is refused, though, because the VM chose that place, and it could name any file the refused list doesn&amp;rsquo;t.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compared by identity.&lt;/strong&gt; devvm compares a target with the refused places and the VMs&amp;rsquo; folders by name and by file identity, because a Mac&amp;rsquo;s file system ignores case, so &lt;code&gt;~/.SSH&lt;/code&gt; names &lt;code&gt;~/.ssh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copies only.&lt;/strong&gt; The store gets a copy of each file and folder, never a link, and the next import replaces or takes out each copy as it does the agent&amp;rsquo;s own files. devvm agent save still refuses a link the VM sends.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounded.&lt;/strong&gt; One import copies at most 20,000 files and folders, 128 MiB and a file of 16 MiB through links, the bounds of devvm agent save, so a link to a large tree can&amp;rsquo;t fill the store.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The copy is as the target was at the import.&lt;/strong&gt; A VM that writes a followed folder later changes nothing in the store until the next import, which then copies what it wrote. The warning names that VM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A refused place under another name,&lt;/strong&gt; such as a credential folder that the list doesn&amp;rsquo;t name, is copied when a link you allowed leads to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A huge folder is read before the bounds stop it.&lt;/strong&gt; devvm lists each folder whole before it counts its entries, so a folder of millions of entries costs memory on this machine before the import leaves it out.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, an independent review of the code):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A VM swapping a link into the path of an allowed folder, or into what&amp;rsquo;s being read&lt;/td&gt;
&lt;td&gt;The root is opened one folder at a time from &lt;code&gt;/&lt;/code&gt;, never through a link, and everything below it is read through it as a root, without blocking and without following a swapped-in link&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestOpenPhysical&lt;/code&gt;, &lt;code&gt;TestAgentImportNestedLinks&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM choosing the target through a link in its project folder&lt;/td&gt;
&lt;td&gt;Every link on the way is kept, and a chain through a VM&amp;rsquo;s folder to a place outside it is refused, whatever allows it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportLinkThroughProject&lt;/code&gt;; the review found it first, and it&amp;rsquo;s fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A refused place spelled another way, such as &lt;code&gt;~/.SSH&lt;/code&gt; on a Mac&lt;/td&gt;
&lt;td&gt;Targets are compared with the places by identity as well as by name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportRefusedOtherCase&lt;/code&gt;; the review found it first, and it&amp;rsquo;s fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link to a secret, a login or devvm&amp;rsquo;s own files&lt;/td&gt;
&lt;td&gt;The refused places, checked on every target and every &lt;code&gt;follow-links&lt;/code&gt; folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportRefusedPlaces&lt;/code&gt;, &lt;code&gt;TestAgentImportRefusedRoots&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A write outside the store&lt;/td&gt;
&lt;td&gt;Names come from real folder entries under the link&amp;rsquo;s own path, and the store&amp;rsquo;s clean-up goes through the store as a root&lt;/td&gt;
&lt;td&gt;Reviewed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A FIFO, a device, a huge or growing file, a loop&lt;/td&gt;
&lt;td&gt;Reads refuse anything but a regular file, the bounds are checked when listing and again when reading, and loops end at the bounds or the system&amp;rsquo;s&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportLinkBounds&lt;/code&gt;, &lt;code&gt;TestLinkSourceGrown&lt;/code&gt;, &lt;code&gt;TestLinkHops&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A link followed without the user seeing it&lt;/td&gt;
&lt;td&gt;Without a terminal nothing is followed unless the flag is given, and each link followed is named&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportFollowsLinks&lt;/code&gt;, &lt;code&gt;agent_import_links&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What VMs get&lt;/td&gt;
&lt;td&gt;Copies only, mounted read-only like the rest of the store&lt;/td&gt;
&lt;td&gt;e2e&amp;rsquo;s &lt;code&gt;project&lt;/code&gt; section reads the linked skill&amp;rsquo;s copy in a VM and finds root can&amp;rsquo;t write it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own"&gt;Claude Code&amp;rsquo;s plugins: a seed and a folder of the VM&amp;rsquo;s own&lt;span class="hx:absolute hx:-mt-20" id="claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own"&gt;&lt;/span&gt;
&lt;a href="#claude-codes-plugins-a-seed-and-a-folder-of-the-vms-own" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Claude Code writes into its plugins folder whenever it runs: each plugin&amp;rsquo;s data, which a plugin reaches as &lt;code&gt;${CLAUDE_PLUGIN_DATA}&lt;/code&gt;, the plugins it installs, its marketplaces&amp;rsquo; copies and their updates, its MCP bundles and its records. devvm&amp;rsquo;s agent store holds one plugins folder for every VM with Claude Code, mounted read-only, so if that folder were each VM&amp;rsquo;s &lt;code&gt;~/.claude/plugins&lt;/code&gt;, every one of those writes would fail. A plugin that keeps data would break, and no plugin could be installed in a VM. Making the store&amp;rsquo;s folder writable would fix the writes, but every VM shares it, so a VM could then change the plugins, hooks and MCP servers&amp;rsquo; commands that Claude Code runs in every other VM, and keep a foothold in each of them after you delete it. That isn&amp;rsquo;t an escape to this machine, but it breaks the line between VMs that the store&amp;rsquo;s read-only mounts hold for every other agent folder.&lt;/p&gt;
&lt;p&gt;So each VM&amp;rsquo;s plugins folder is its own, on its own disk, and the store&amp;rsquo;s folder is Claude Code&amp;rsquo;s seed, a plugins folder that Claude Code reads but never writes, which it supports for container images and CI (&lt;a href="https://next.devvm.dev/docs/internals/agents/#claude-codes-plugins"&gt;how&lt;/a&gt;). Its two variables, &lt;code&gt;CLAUDE_CODE_PLUGIN_CACHE_DIR&lt;/code&gt; and &lt;code&gt;CLAUDE_CODE_PLUGIN_SEED_DIR&lt;/code&gt;, are Claude Code&amp;rsquo;s own, so devvm patches nothing in Claude Code and copies nothing into the VM at a launch, and the seed stays one mount that every VM reads. What a VM writes stays in that VM, and what it installed reaches the store, and every VM, only through &lt;code&gt;devvm agent save&lt;/code&gt;, whose diff you read before you answer yes. The import and the save copy only the entries a seed has, the marketplaces&amp;rsquo; records, their copies and the plugins&amp;rsquo; cache, because the rest of the folder is each machine&amp;rsquo;s own. Each plugin&amp;rsquo;s data can hold its own logins, and this machine&amp;rsquo;s plugins&amp;rsquo; data in the store would reach every VM.&lt;/p&gt;
&lt;p&gt;The save never takes a plugin out of the store, because a VM&amp;rsquo;s folder holds only what that VM installed, not the store&amp;rsquo;s plugins, which it reads from the seed, so a plugin missing from it isn&amp;rsquo;t one the VM removed. Taking out what the VM&amp;rsquo;s folder lacks would empty the store of every plugin the VM didn&amp;rsquo;t install itself. The VM&amp;rsquo;s marketplaces&amp;rsquo; records join the store&amp;rsquo;s for the same reason, and only a record whose copy is in the store&amp;rsquo;s marketplaces folder joins, so the records that Claude Code made of the seed&amp;rsquo;s own marketplaces stay as the store has them, and a record can&amp;rsquo;t point other VMs elsewhere.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A marketplace in a folder on this machine&lt;/strong&gt; reaches a VM only when that folder is in the VM too, because Claude Code reads such a marketplace where it is, and a seed holds no copy of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A plugin&amp;rsquo;s data stays in its VM.&lt;/strong&gt; A new VM, or one made from an export of another&amp;rsquo;s history, starts each plugin&amp;rsquo;s data afresh, and so does every VM after you install a plugin there, as the export leaves the VM&amp;rsquo;s plugins folder out.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A plugin installed in a VM runs in that VM&lt;/strong&gt; with whatever it does, as a plugin does on this machine. devvm keeps it from the other VMs until you save it, and the save&amp;rsquo;s diff shows what it adds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, a hostile VM writing what other VMs or this machine run):&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Lead&lt;/th&gt;
&lt;th&gt;What holds it&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A VM writing the store&amp;rsquo;s plugins, which every VM runs&lt;/td&gt;
&lt;td&gt;The store&amp;rsquo;s folder stays mounted read-only, and the VM&amp;rsquo;s writes go to its own folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestClaudePluginsSeed&lt;/code&gt;, &lt;code&gt;sync&lt;/code&gt;&amp;rsquo;s links and &lt;code&gt;own-dirs&lt;/code&gt;, e2e&amp;rsquo;s &lt;code&gt;project&lt;/code&gt; section&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A save that sends more than the seed&amp;rsquo;s entries, such as a plugin&amp;rsquo;s data&lt;/td&gt;
&lt;td&gt;The VM&amp;rsquo;s script sends only the seed&amp;rsquo;s entries, and devvm saves nothing when the stream has any other entry of the folder&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestReadSentClaudePlugins&lt;/code&gt;, &lt;code&gt;TestAgentSaveScriptClaudePlugins&lt;/code&gt;, &lt;code&gt;agent_save&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;This machine&amp;rsquo;s plugins&amp;rsquo; data reaching every VM&lt;/td&gt;
&lt;td&gt;The import copies only the seed&amp;rsquo;s entries, through links too&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentImportClaudePlugins&lt;/code&gt;, &lt;code&gt;agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;This machine&amp;rsquo;s plugins&amp;rsquo; data that devvm 0.1.0&amp;rsquo;s import left in the store&lt;/td&gt;
&lt;td&gt;Every start takes the store&amp;rsquo;s entries that a seed lacks out before the VM runs, from devvm&amp;rsquo;s config folder as a root, refusing a link anywhere on the path and following none among the entries, and a VM with Claude Code doesn&amp;rsquo;t start while they can&amp;rsquo;t go&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCleanSeeds&lt;/code&gt;, &lt;code&gt;TestCleanSeedsFails&lt;/code&gt;, &lt;code&gt;fixture_v010_plugins&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A VM&amp;rsquo;s paths in the records it saves&lt;/td&gt;
&lt;td&gt;The records&amp;rsquo; paths to the VM&amp;rsquo;s plugins folder are renamed to the store&amp;rsquo;s, only a record whose copy is in the store&amp;rsquo;s &lt;code&gt;marketplaces&lt;/code&gt; by a clean path joins the store&amp;rsquo;s, and a records file that isn&amp;rsquo;t a JSON object is left out&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentSaveClaudePlugins&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A name in the VM&amp;rsquo;s plugins folder that the save&amp;rsquo;s script would read as a pattern&lt;/td&gt;
&lt;td&gt;It&amp;rsquo;s sent rather than excluded, and devvm refuses the save&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestAgentSaveScriptClaudePlugins&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A plugin&amp;rsquo;s data, or what a VM installed, reaching another VM through an export&lt;/td&gt;
&lt;td&gt;The export and the import leave out the VM&amp;rsquo;s plugins folder, and the import leaves out the seed&amp;rsquo;s link&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestClaudePluginsHistory&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An export that names the VM&amp;rsquo;s plugins folder another way, such as &lt;code&gt;.claude/./plugins&lt;/code&gt;, past the import&amp;rsquo;s excludes, as the folder is writable&lt;/td&gt;
&lt;td&gt;The import refuses a name with a &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;..&lt;/code&gt; or empty part, and deletes what it leaves out by its path once unpacked. The review found it first, and it&amp;rsquo;s fixed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestHistoryImportRuns&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 data-hextra-search-id="the-9p-cache-on-linux"&gt;The 9p cache on Linux&lt;span class="hx:absolute hx:-mt-20" id="the-9p-cache-on-linux"&gt;&lt;/span&gt;
&lt;a href="#the-9p-cache-on-linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On a Linux host, Lima&amp;rsquo;s QEMU shares the project folder over 9p, and Lima mounts a writable 9p share with &lt;code&gt;cache=mmap&lt;/code&gt; unless the VM&amp;rsquo;s config says otherwise (read-only ones with &lt;code&gt;fscache&lt;/code&gt;). The guest kernel&amp;rsquo;s 9p client has a race in that mode, which &lt;a href="https://lore.kernel.org/all/[email protected]/" target="_blank" rel="noopener"&gt;Pierre Barre&amp;rsquo;s patch&lt;/a&gt; describes and which isn&amp;rsquo;t merged. A &lt;code&gt;stat()&lt;/code&gt; that runs while a &lt;code&gt;write()&lt;/code&gt; makes a file longer refreshes the inode from the server, which still has the old size, so the client takes that size over its own, and writeback then drops the pages past it. &lt;code&gt;fsync&lt;/code&gt; succeeds, yet the file reaches the host empty or cut to 4096 bytes. Claude Code&amp;rsquo;s Edit tool sets it off, and so can any editor or build that stats files as they&amp;rsquo;re written. macOS isn&amp;rsquo;t affected, because Lima&amp;rsquo;s &lt;code&gt;vz&lt;/code&gt; VMs mount the folder with virtiofs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mmap&lt;/code&gt; has a second bug on the guest kernel devvm&amp;rsquo;s base boots (Ubuntu 26.04&amp;rsquo;s 7.0), which doesn&amp;rsquo;t depend on timing. After a process writes a file and takes a POSIX lock or an &lt;code&gt;flock&lt;/code&gt; on it, its next read of that data returns zeros, though the host has the data and another process reads it. On such a lock, the 9p client writes the file&amp;rsquo;s pages back and drops them, and the next buffered read through netfs returns zeros. SQLite takes a shared lock at the start of each transaction, so its second transaction reads page 1 as zeros and stops with &lt;code&gt;SQLITE_NOTADB&lt;/code&gt; (&amp;ldquo;file is not a database&amp;rdquo;), in its default journal mode as in WAL mode, and Gradle&amp;rsquo;s daemon, which keeps its lock files in &lt;code&gt;.gradle/&lt;/code&gt; open across builds, fails from its second build with &amp;ldquo;Unexpected lock protocol found in lock file&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;none&lt;/code&gt;, the one mode devvm sets.&lt;/strong&gt; With &lt;code&gt;cache=none&lt;/code&gt;, the client caches neither pages nor sizes, so every write goes to the host as it&amp;rsquo;s made, no stat can roll a size back and no lock drops data. It takes away shared writable &lt;code&gt;mmap&lt;/code&gt;, which 9p allows only with writeback caching: a shared mapping of a file opened for writing fails with &lt;code&gt;EINVAL&lt;/code&gt;, even one that&amp;rsquo;s only read. That fails at once, so nothing is lost, and only programs that keep a database or an index in the folder do it: SQLite&amp;rsquo;s WAL mode, whose &lt;code&gt;-shm&lt;/code&gt; index is such a mapping, unless the connection sets &lt;code&gt;locking_mode=EXCLUSIVE&lt;/code&gt; first, which keeps the index on the heap; LMDB, which Parcel&amp;rsquo;s &lt;code&gt;.parcel-cache&lt;/code&gt; and Gatsby&amp;rsquo;s cache use; numpy&amp;rsquo;s &lt;code&gt;memmap&lt;/code&gt; in &lt;code&gt;r+&lt;/code&gt; or &lt;code&gt;w+&lt;/code&gt; mode; Java&amp;rsquo;s read-write &lt;code&gt;MappedByteBuffer&lt;/code&gt;; and the mold linker, which maps its output. Each of them works on the VM&amp;rsquo;s own disk, in its home folder or in a &lt;code&gt;--clone&lt;/code&gt; VM, faster than under any 9p mode. &lt;code&gt;mmap&lt;/code&gt; is faster than &lt;code&gt;none&lt;/code&gt; only for large sequential files, about 7 to 12 times for 1 GiB, 1.3 to 1.5 times for cargo, and within 10 to 20% for git, npm, Vite, Go and &lt;code&gt;rg&lt;/code&gt;, while the VM&amp;rsquo;s own disk is faster still by far, from about 2 times for &lt;code&gt;npm ci&lt;/code&gt; to over 20 for a cold &lt;code&gt;git status&lt;/code&gt; (measured on a Fedora 43 host). So devvm doesn&amp;rsquo;t offer &lt;code&gt;mmap&lt;/code&gt;, which would trade two ways of losing data for what the VM&amp;rsquo;s own disk does better. It doesn&amp;rsquo;t offer &lt;code&gt;loose&lt;/code&gt; or &lt;code&gt;fscache&lt;/code&gt; either: they allow the same mappings, share &lt;code&gt;mmap&lt;/code&gt;&amp;rsquo;s SQLite failure in a worse form, as the database can&amp;rsquo;t be opened again at all, and cache files&amp;rsquo; contents and metadata in the guest without asking the host, so the guest misses edits you make on this machine, which devvm&amp;rsquo;s mounted folder exists for.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Existing VMs opt in.&lt;/strong&gt; A VM made before devvm chose &lt;code&gt;none&lt;/code&gt; has no mode in its state, and its starts leave its mount&amp;rsquo;s cache as it is, so an upgrade changes nothing in how such a VM uses its folder. Each launch of such a VM warns of the risk and names &lt;code&gt;devvm mount-cache none&lt;/code&gt;, which ends the warning. &lt;code&gt;none&lt;/code&gt; is the only value the command takes, so there&amp;rsquo;s no default to choose and no &lt;code&gt;-g&lt;/code&gt; or &lt;code&gt;config.toml&lt;/code&gt; key: every new VM gets &lt;code&gt;none&lt;/code&gt;, and so does the folder &lt;code&gt;devvm clone off&lt;/code&gt; mounts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Build VMs&amp;rsquo; output folders get &lt;code&gt;none&lt;/code&gt; too.&lt;/strong&gt; The shared tools&amp;rsquo; build writes its EROFS images into a writable mount with &lt;code&gt;mkfs.erofs&lt;/code&gt;, and &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s conversion writes its disk into one with &lt;code&gt;mke2fs&lt;/code&gt;, and neither maps its output for shared writing, so &lt;code&gt;none&lt;/code&gt; takes nothing from them. The read-only mounts, agents&amp;rsquo; folders and the shared tools, keep Lima&amp;rsquo;s &lt;code&gt;fscache&lt;/code&gt;: the guest can&amp;rsquo;t write them, so the race has no write to drop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One edit.&lt;/strong&gt; The mode is a mount&amp;rsquo;s &lt;code&gt;9p: cache:&lt;/code&gt; option, which devvm compares with what &lt;code&gt;limactl list&lt;/code&gt; shows and sets only where it differs, in the start&amp;rsquo;s one &lt;code&gt;limactl edit&lt;/code&gt;, as any edit gives the VM new ssh host keys. &lt;code&gt;limactl list&lt;/code&gt; fills each mount&amp;rsquo;s other 9p and sshfs settings in, at Lima&amp;rsquo;s defaults where &lt;code&gt;lima.yaml&lt;/code&gt; sets none. A rewrite of the mounts keeps only the settings devvm knows (9p&amp;rsquo;s security model, protocol version and message size, sshfs&amp;rsquo;s cache, symlinks and SFTP driver) where they differ from Lima&amp;rsquo;s defaults, as the VM&amp;rsquo;s own, and drops the rest, so no default gets written into &lt;code&gt;lima.yaml&lt;/code&gt;, where a later Lima&amp;rsquo;s would never reach it. A setting devvm doesn&amp;rsquo;t know, such as one a later Lima adds, is dropped too, for Lima to fill in, as devvm can&amp;rsquo;t tell its default from a value someone gave: it has no YAML parser to read &lt;code&gt;lima.yaml&lt;/code&gt; itself. Editing only devvm&amp;rsquo;s own fields with &lt;code&gt;--set&lt;/code&gt; instead (&lt;code&gt;.mounts[0][&amp;quot;9p&amp;quot;].cache = &amp;quot;none&amp;quot;&lt;/code&gt;, which Lima takes) would keep everything else as it is, but a moved folder or other agents&amp;rsquo; folders would then need edits by index and by selector, which the CLI tests&amp;rsquo; limactl stub doesn&amp;rsquo;t model, so devvm rewrites the mounts whole. The defaults are the ones in the golden fixture of real Lima&amp;rsquo;s &lt;code&gt;limactl list&lt;/code&gt; (Lima 2.2), which &lt;code&gt;TestMountRoundTrip&lt;/code&gt; checks, so a later fixture that changes them fails that test; until then, a known setting whose default a later Lima changes keeps the old default through a rewrite.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The remount.&lt;/strong&gt; Lima&amp;rsquo;s cloud-init writes the new options into the guest&amp;rsquo;s &lt;code&gt;/etc/fstab&lt;/code&gt; at the boot after the edit, but systemd has mounted the folder by the old line by then, and a 9p share keeps its tag. So that start unmounts the folder and mounts it again from &lt;code&gt;/etc/fstab&lt;/code&gt; once the VM runs, with a minute&amp;rsquo;s limit and its output in the run log, then checks it with &lt;code&gt;mountpoint&lt;/code&gt; and the folder&amp;rsquo;s line of &lt;code&gt;/proc/self/mountinfo&lt;/code&gt;, which a POSIX &lt;code&gt;awk&lt;/code&gt; picks by its mount point, as &lt;code&gt;mountinfo&lt;/code&gt; escapes it (a space as &lt;code&gt;\040&lt;/code&gt;). The check is portable: it runs with any guest&amp;rsquo;s &lt;code&gt;awk&lt;/code&gt;, busybox&amp;rsquo;s too, and depends on no util-linux tool, such as &lt;code&gt;findmnt&lt;/code&gt;, but &lt;code&gt;mountpoint&lt;/code&gt;, which busybox has as well. devvm reads at most 4 KiB of the answer and only its last line, the mount visible at the folder where mounts are stacked, takes the mount&amp;rsquo;s options and its file system&amp;rsquo;s from it, refuses an answer that isn&amp;rsquo;t a &lt;code&gt;mountinfo&lt;/code&gt; line, and names any mode but &lt;code&gt;none&lt;/code&gt; and &lt;code&gt;mmap&lt;/code&gt; as unknown. The remount&amp;rsquo;s and the check&amp;rsquo;s output pipes close a second after the commands end or time out, as limactl shell&amp;rsquo;s ssh can leave a child that holds them open.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The restart.&lt;/strong&gt; A folder that isn&amp;rsquo;t mounted, one still mounted with the old mode, or a check that gets no answer gets one restart. The remount fails when something the VM started at boot holds the share, when a degraded start mounted it again by the old line, or on an Alpine guest with OpenRC, whose &lt;code&gt;mount&lt;/code&gt; after a successful &lt;code&gt;umount&lt;/code&gt; finds the share already mounted or busy. The Lima backend writes why in the run log, stops the VM under one status step, and fails the start with a &lt;code&gt;RemountError&lt;/code&gt;, and the start&amp;rsquo;s caller (&lt;code&gt;starter.start&lt;/code&gt;) starts the VM again once, all of it: a new proxy that follows the new hostagent, the &lt;code&gt;.git&lt;/code&gt; pins applied in QEMU&amp;rsquo;s new namespace, the host keys read again for the new start, and the start recorded. The caller restarts the VM, not the backend, because the proxy follows one start&amp;rsquo;s hostagent and exits when the VM stops. The guest&amp;rsquo;s &lt;code&gt;/etc/fstab&lt;/code&gt; has the new mode by then, so the restart&amp;rsquo;s boot mounts the folder with it, and that start&amp;rsquo;s &lt;code&gt;Want.CheckCache&lt;/code&gt; asks the backend for the same check without the remount. That check is the last, and nothing it finds restarts the VM again. A folder that isn&amp;rsquo;t mounted stops the VM and fails the start before its setup or shell, as an agent&amp;rsquo;s writes there would land on the VM&amp;rsquo;s disk and vanish under the share at its next mount (&lt;code&gt;mount_cache_unmounted&lt;/code&gt;, which names &lt;code&gt;devvm restart&lt;/code&gt;), and so does a check that gets no answer (&lt;code&gt;mount_cache_unchecked&lt;/code&gt;). A folder still mounted with the old mode is warned of (&lt;code&gt;mount_cache_remount_failed&lt;/code&gt;). When the restart&amp;rsquo;s stop fails, a folder still mounted with the old mode is warned of the same way and the VM goes on with its proxy, and any other failure fails the start as a stop that failed (&lt;code&gt;stop_failed&lt;/code&gt;, with the run log&amp;rsquo;s end), as the VM may still be running. The retry runs the whole start again, so the UI says each warning once a run, and the first start&amp;rsquo;s warnings aren&amp;rsquo;t repeated. An interrupt during the remount, a check or the restart&amp;rsquo;s stop, on any tier, leaves a cleanup that stops the VM, which stays until that stop returns, and an interrupt gets no restart. A known race, older than the restart, fails closed: another devvm command can start the VM between the restart&amp;rsquo;s stop and its start again, and the two starts then contend as any two starts of one VM do.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A running VM&amp;rsquo;s folder.&lt;/strong&gt; A launch into a running VM whose folder has a cache mode checks it&amp;rsquo;s a mount point, one &lt;code&gt;mountpoint -q&lt;/code&gt; over the VM&amp;rsquo;s ssh, and refuses one that isn&amp;rsquo;t (&lt;code&gt;project_unmounted&lt;/code&gt;), or whose check fails to run or gives no answer (&lt;code&gt;project_unchecked&lt;/code&gt;). The guest answers in words, as &lt;code&gt;mountpoint&lt;/code&gt;&amp;rsquo;s exit codes differ between util-linux (32) and busybox (1).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tool images built before.&lt;/strong&gt; A shared tool&amp;rsquo;s build wrote its EROFS image into a writable 9p mount with Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; before devvm chose &lt;code&gt;none&lt;/code&gt;, so an image built then could reach the share empty or cut to 4096 bytes. devvm reads each EROFS image&amp;rsquo;s superblock when it asks whether the image is built: one that ends before its superblock does (1,064 bytes), empty included, or is shorter than the block count its superblock gives, counts as not built, and the next build makes it again. A build whose output is cut short is refused (&lt;code&gt;tool_bad_output&lt;/code&gt;). It costs a 40-byte read per image, and a file that isn&amp;rsquo;t EROFS&amp;rsquo;s at all is left to the guest&amp;rsquo;s mount to refuse.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; (&lt;code&gt;tests/e2e&lt;/code&gt;, the &lt;code&gt;project&lt;/code&gt; section on a Linux host): a new VM&amp;rsquo;s folder mounts with &lt;code&gt;none&lt;/code&gt;, as its state says, which &lt;code&gt;/proc/self/mountinfo&lt;/code&gt; shows as no &lt;code&gt;cache&lt;/code&gt; option at all, as the kernel leaves it out for &lt;code&gt;none&lt;/code&gt;, where it shows &lt;code&gt;cache=0x5&lt;/code&gt; for &lt;code&gt;mmap&lt;/code&gt;; 40 files written in 4 KiB extending writes with &lt;code&gt;fsync&lt;/code&gt;, while a loop stats each, all reach the host whole under &lt;code&gt;none&lt;/code&gt;; SQLite&amp;rsquo;s WAL mode fails in the folder under &lt;code&gt;none&lt;/code&gt; and its default journal works; a shared writable &lt;code&gt;mmap&lt;/code&gt; of a file there is refused with &lt;code&gt;EINVAL&lt;/code&gt;, and SQLite&amp;rsquo;s WAL with &lt;code&gt;locking_mode=EXCLUSIVE&lt;/code&gt; works and opens again; a VM whose state loses its mode, and whose &lt;code&gt;lima.yaml&lt;/code&gt; gets Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; by hand, keeps &lt;code&gt;mmap&lt;/code&gt; with its &lt;code&gt;lima.yaml&lt;/code&gt; unedited by devvm, and warns at each launch; and &lt;code&gt;devvm mount-cache none&lt;/code&gt; gives it &lt;code&gt;none&lt;/code&gt; at its next start, &lt;code&gt;devvm restart&lt;/code&gt;, which mounts the folder again, and the warning stops. The &lt;code&gt;tools&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt; sections build the shared tools and &lt;code&gt;--from&lt;/code&gt; bases with their output folders under &lt;code&gt;none&lt;/code&gt;, and the &lt;code&gt;from&lt;/code&gt; section&amp;rsquo;s Alpine VM, given Lima&amp;rsquo;s &lt;code&gt;mmap&lt;/code&gt; with no mode chosen, gets &lt;code&gt;none&lt;/code&gt; from &lt;code&gt;devvm mount-cache none&lt;/code&gt; at its next start, through the restart its failed remount gets, its folder checked by the portable check. On macOS, the &lt;code&gt;project&lt;/code&gt; section checks that the folder is virtiofs and that &lt;code&gt;devvm mount-cache&lt;/code&gt; refuses the VM&amp;rsquo;s. Two things under &lt;code&gt;mmap&lt;/code&gt; are run and reported, not checked: the same loop, as the race is timing&amp;rsquo;s, which left 1 file of the 40 short in one run on Fedora 43 and none in others, and five new SQLite databases in the default journal mode, for the lock bug. The research behind dropping &lt;code&gt;mmap&lt;/code&gt; (every tool above under each mode, on a Fedora 43 host with devvm&amp;rsquo;s Ubuntu 26.04 guest) was run by hand, outside the end-to-end tests. Unit tests: &lt;code&gt;TestProjectCache&lt;/code&gt;, &lt;code&gt;TestMountRoundTrip&lt;/code&gt;, &lt;code&gt;TestStartSetsProjectCacheOnce&lt;/code&gt; (the remount&amp;rsquo;s outcomes, each failure a restart), &lt;code&gt;TestStartRechecksProjectCache&lt;/code&gt; (the restart&amp;rsquo;s check, with no second restart), &lt;code&gt;TestRemountInterrupted&lt;/code&gt;, &lt;code&gt;TestRemountRestartStop&lt;/code&gt; (the cleanup kept through the restart&amp;rsquo;s stop, and a stop that fails), &lt;code&gt;TestOptionsOfMountinfo&lt;/code&gt;, &lt;code&gt;TestMountinfoPath&lt;/code&gt; and &lt;code&gt;TestLastMount&lt;/code&gt; (real &lt;code&gt;mountinfo&lt;/code&gt; lines: 9p with and without &lt;code&gt;cache=0x5&lt;/code&gt;, stacked mounts, a path with a space) in the Lima backend, &lt;code&gt;TestCutShort&lt;/code&gt; and &lt;code&gt;TestBuiltCutShort&lt;/code&gt; in the shared tools, &lt;code&gt;TestGuestMountOptions&lt;/code&gt; in the stubs, &lt;code&gt;TestUpCacheMode&lt;/code&gt;, &lt;code&gt;TestWarnMountCache&lt;/code&gt;, &lt;code&gt;TestCacheAtNextStart&lt;/code&gt;, &lt;code&gt;TestSwitchCache&lt;/code&gt;, &lt;code&gt;TestSetMountCache&lt;/code&gt; and &lt;code&gt;TestRemountRestart&lt;/code&gt; (one start again, with a proxy of its own), &lt;code&gt;TestRemountRestartConfined&lt;/code&gt; (each start&amp;rsquo;s interrupt undo, an interrupt between the starts, a start again whose proxy fails), &lt;code&gt;TestWarnOnce&lt;/code&gt; in the UI, and the CLI tests &lt;code&gt;mount_cache&lt;/code&gt; (with the stubs&amp;rsquo; &lt;code&gt;remount-fails&lt;/code&gt;, and a policy line warned of once), &lt;code&gt;clone_switch&lt;/code&gt; and the 0.1.0 fixture, whose VMs keep &lt;code&gt;mmap&lt;/code&gt; and warn.&lt;/p&gt;
&lt;h2 data-hextra-search-id="linux-hosts-overlays-instead-of-copies"&gt;Linux hosts: overlays instead of copies&lt;span class="hx:absolute hx:-mt-20" id="linux-hosts-overlays-instead-of-copies"&gt;&lt;/span&gt;
&lt;a href="#linux-hosts-overlays-instead-of-copies" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lima on QEMU keeps one qcow2 disk per VM, and a clone copies it (2.0 GB for &lt;code&gt;base&lt;/code&gt;). A project VM&amp;rsquo;s disk is a qcow2 overlay of its image&amp;rsquo;s instead (&lt;a href="https://next.devvm.dev/docs/internals/lima/#clones-and-overlays"&gt;details&lt;/a&gt;): 196 KB new, 12 MB after booting, the same speed except fsync writes (1.8–2.5 s vs 1.2–2.1 s per GiB). Flattening one (&lt;code&gt;qemu-img rebase -b &amp;quot;&amp;quot;&lt;/code&gt;) took 8 s, if it&amp;rsquo;s ever needed.&lt;/p&gt;
&lt;h2 data-hextra-search-id="one-binary"&gt;One binary&lt;span class="hx:absolute hx:-mt-20" id="one-binary"&gt;&lt;/span&gt;
&lt;a href="#one-binary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm&amp;rsquo;s own files (&lt;code&gt;assets/&lt;/code&gt; in the repo: &lt;code&gt;base.yaml&lt;/code&gt;, &lt;code&gt;prelude.sh&lt;/code&gt;, &lt;code&gt;layers/&lt;/code&gt;, &lt;code&gt;features/&lt;/code&gt;, &lt;code&gt;shared-tools/&lt;/code&gt;, &lt;code&gt;network/&lt;/code&gt;, &lt;code&gt;guest/&lt;/code&gt;, &lt;code&gt;oci/&lt;/code&gt;) are embedded in the binary (&lt;code&gt;assets.FS&lt;/code&gt;), so devvm installs, moves and upgrades as one file and can&amp;rsquo;t find a mismatched copy beside it. Code reads them from that file system; scripts reach VMs on their standard input, never by path or file mode. The binary is the only copy: no shared folder on disk holds devvm&amp;rsquo;s files, because a copy there could be edited and still be used. A VM&amp;rsquo;s proxy is devvm itself, so it reads its built-in policies from the binary (its config&amp;rsquo;s &lt;code&gt;builtin_policies&lt;/code&gt;, by name), once, and its &lt;code&gt;policies&lt;/code&gt; carry only your files. &lt;code&gt;limactl create&lt;/code&gt; reads &lt;code&gt;base.yaml&lt;/code&gt; on its standard input (&lt;code&gt;-&lt;/code&gt;). Only &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s build on Lima needs a path, because its build VM mounts the conversion&amp;rsquo;s scripts from &lt;code&gt;oci/&lt;/code&gt; read-only (root there reads them), and none of the folder&amp;rsquo;s other files, with &lt;code&gt;guest/ca.sh&lt;/code&gt; beside it when you have &lt;a href="https://next.devvm.dev/docs/internals/network/#a-companys-ca"&gt;company CAs&lt;/a&gt;. It writes them into its own temporary folder, &lt;code&gt;devvm-oci.&amp;lt;random&amp;gt;&lt;/code&gt;, beside &lt;code&gt;vm/&lt;/code&gt; and never inside it, files 600 and folders 700, and the build&amp;rsquo;s cleanup deletes the folder however the build ends. Image keys hash the embedded files, so what goes into an image is always what its key describes.&lt;/p&gt;
&lt;h2 data-hextra-search-id="devvms-own-lima-home"&gt;devvm&amp;rsquo;s own Lima home&lt;span class="hx:absolute hx:-mt-20" id="devvms-own-lima-home"&gt;&lt;/span&gt;
&lt;a href="#devvms-own-lima-home" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lima merges &lt;code&gt;_config/default.yaml&lt;/code&gt; and &lt;code&gt;override.yaml&lt;/code&gt; of its home into every VM. In &lt;code&gt;~/.lima&lt;/code&gt;, a &lt;code&gt;networks: [{vzNAT: true}]&lt;/code&gt; there gave a confined VM a second network card with a default route around its proxy (the self-check caught it), and an extra mount went unnoticed. Hence a Lima home of devvm&amp;rsquo;s own, which refuses those files and any network devvm didn&amp;rsquo;t give a VM (&lt;a href="https://next.devvm.dev/docs/internals/lima/#a-lima-home-of-its-own"&gt;details&lt;/a&gt;). The costs: plain &lt;code&gt;limactl list&lt;/code&gt; doesn&amp;rsquo;t show devvm&amp;rsquo;s VMs, and VM names are shorter, as the path of Lima&amp;rsquo;s ssh socket has fewer than 104 characters.&lt;/p&gt;
&lt;h2 data-hextra-search-id="the-state-layout"&gt;The state layout&lt;span class="hx:absolute hx:-mt-20" id="the-state-layout"&gt;&lt;/span&gt;
&lt;a href="#the-state-layout" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm keeps its state in plain files in two folders, which &lt;a href="https://next.devvm.dev/docs/internals/overview/#state-files"&gt;State files&lt;/a&gt; describes. The layout follows a few rules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One folder per VM, keyed by identity.&lt;/strong&gt; A VM&amp;rsquo;s folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/&lt;/code&gt;, is named by the hash that ends the VM&amp;rsquo;s name, the hash of its project folder&amp;rsquo;s physical path when devvm made it. The VM&amp;rsquo;s name, its backend and its ssh alias are chosen once, when devvm makes the VM, and recorded in its state, so devvm finds a folder&amp;rsquo;s VM by the state that records the folder, first by the path&amp;rsquo;s hash, then reads the name and the backend from the state. A folder that moves keeps its VM, whose state records the new path while its name and folder stay (&lt;a href="https://next.devvm.dev/docs/internals/overview/#a-moved-folder"&gt;a moved folder&lt;/a&gt;). A backend&amp;rsquo;s limit on names, or another VM taking the same folder name, never changes which VM a folder finds. Every file devvm keeps for a VM is in its folder, so deleting a VM stops what runs for it, removes what it has outside the folder, and then deletes the folder whole, and &lt;code&gt;devvm space&lt;/code&gt; and &lt;code&gt;devvm gc&lt;/code&gt; count folders. A list of a VM&amp;rsquo;s files, kept in each place that deletes or counts them, would drift, and one of those places would miss a file. Only sockets stay outside, in &lt;code&gt;run/&lt;/code&gt; and named by hashes, because a socket&amp;rsquo;s path has fewer than 104 characters.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The folder says who writes a file.&lt;/strong&gt; &lt;code&gt;~/.config/devvm&lt;/code&gt; holds what you write, and devvm never rewrites a file of yours there: it changes single lines of &lt;code&gt;policy&lt;/code&gt; and keeps the rest, comments included, and it writes the folder&amp;rsquo;s &lt;code&gt;version&lt;/code&gt;. Everything devvm writes is in &lt;code&gt;~/.local/share/devvm&lt;/code&gt;. A default comes from a flag, then &lt;code&gt;config.toml&lt;/code&gt;, then &lt;code&gt;settings.json&lt;/code&gt;, then devvm&amp;rsquo;s own, and a command that would save a default that &lt;code&gt;config.toml&lt;/code&gt; sets refuses, naming the file and the key, because the saved value would never apply.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two formats.&lt;/strong&gt; What you edit is TOML, read strictly, so a typo stops the command and devvm names the file and the line, rather than the key being ignored. What only devvm writes is JSON, through &lt;code&gt;encoding/json&lt;/code&gt;, and devvm ignores fields it doesn&amp;rsquo;t know, so a newer devvm&amp;rsquo;s additions don&amp;rsquo;t stop an older one. A change that an older devvm would read wrongly goes through the layout version instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One section per package.&lt;/strong&gt; &lt;code&gt;vm.json&lt;/code&gt; has the core fields every VM has, and each package that keeps something of a VM&amp;rsquo;s owns one section of it, with its own type, so &lt;code&gt;internal/state&lt;/code&gt; imports none of them. Each section keeps what you asked for apart from what devvm made, which sits under &lt;code&gt;made&lt;/code&gt;, so a value is never stored twice under two names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The lock rule.&lt;/strong&gt; Each change to a VM&amp;rsquo;s state holds that VM&amp;rsquo;s lock, reads the file again, and writes it once, so a command&amp;rsquo;s changes land together, and reads take no lock, because each write renames a whole file over the old one. A command holds at most one VM&amp;rsquo;s lock at a time. A change across VMs, such as removing every link to a VM being deleted, lets go of the first VM&amp;rsquo;s lock, then takes each other VM&amp;rsquo;s lock in turn and reads its state again before writing it. The claims lock is taken only after a VM&amp;rsquo;s own lock, never before, so no two devvms can each wait for the lock the other holds. Test builds and the tests check this order as each lock is taken (&lt;code&gt;internal/state&lt;/code&gt;&amp;rsquo;s &lt;code&gt;held&lt;/code&gt;): a second VM&amp;rsquo;s lock, a VM&amp;rsquo;s lock under the claims lock, or a lock the same goroutine holds already panics, naming both locks, before it waits. The check is per goroutine. It follows the locks each goroutine holds, by the goroutine&amp;rsquo;s number, which it reads from the goroutine&amp;rsquo;s stack, so two goroutines that each hold one VM&amp;rsquo;s lock pass, and a goroutine that a change starts while it holds a lock isn&amp;rsquo;t checked against that lock. A release build checks nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A layout version.&lt;/strong&gt; Each folder records its layout version in &lt;code&gt;version&lt;/code&gt;. A newer devvm that changes the layout raises it and adds a migration from the version before, an older layout is migrated before a command runs, and a newer one is refused, because this devvm would read it wrongly. &lt;code&gt;testdata/script/layout.txtar&lt;/code&gt; lists every file and folder a confined VM, a port, a link and a secret leaves, so a change to the layout changes a listing and fails the test until someone decides whether it needs a new version (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#changing-the-state-layout"&gt;changing the state layout&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm&amp;rsquo;s own files stay in the binary,&lt;/strong&gt; as &lt;a href="#one-binary"&gt;one binary&lt;/a&gt; describes, so neither folder holds a copy of &lt;code&gt;assets/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Why not a database.&lt;/strong&gt; SQLite or bbolt would give transactions, but either one is a new dependency, and devvm builds without cgo, so SQLite would mean a large pure-Go port. State would also stop being files that you can read with &lt;code&gt;cat&lt;/code&gt; or &lt;code&gt;jq&lt;/code&gt;, back up, and check by hand. Files written whole and renamed into place, with an OS file lock for each VM, give what devvm needs: one writer to a VM at a time, and readers that never see half a file.&lt;/p&gt;
&lt;h2 data-hextra-search-id="where-secret-values-live"&gt;Where secret values live&lt;span class="hx:absolute hx:-mt-20" id="where-secret-values-live"&gt;&lt;/span&gt;
&lt;a href="#where-secret-values-live" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;devvm handles values that let whoever holds them act as you or as a VM: a VM&amp;rsquo;s proxy password, a build proxy&amp;rsquo;s, the company proxy&amp;rsquo;s password, the secrets you save and the keys and tokens in agents&amp;rsquo; login files. Each one lives in a few places, and only there: the Keychain or the secret&amp;rsquo;s file in &lt;code&gt;~/.local/share/devvm/secrets/&lt;/code&gt;, the proxy&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt;, the VM&amp;rsquo;s &lt;code&gt;vm.json&lt;/code&gt; for its proxy password, the agent store&amp;rsquo;s login files, the proxy&amp;rsquo;s memory for the values it caches, and the VM&amp;rsquo;s own proxy settings for its password, which the VM must send. In devvm&amp;rsquo;s code, each such value is a &lt;code&gt;redact.Secret&lt;/code&gt; from the moment it&amp;rsquo;s read until the place it&amp;rsquo;s used, except for the two that &lt;strong&gt;Not covered&lt;/strong&gt; names (&lt;a href="https://next.devvm.dev/docs/contributing/structure/#secrets-in-the-code"&gt;secrets in the code&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Printing never shows the value.&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt;, &lt;code&gt;GoString&lt;/code&gt; and &lt;code&gt;Format&lt;/code&gt; write &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; for every verb, so a &lt;code&gt;%v&lt;/code&gt; of a struct in an error, a log line in the proxy&amp;rsquo;s own log or a line of devvm&amp;rsquo;s run log can&amp;rsquo;t hold it. &lt;code&gt;fmt&lt;/code&gt; can&amp;rsquo;t call &lt;code&gt;Format&lt;/code&gt; on a value in an unexported field, and prints such a field as it is, so the value is behind a pointer, and the field shows only its address. The run log&amp;rsquo;s own redaction, &lt;code&gt;redact.String&lt;/code&gt;, still takes proxy keys and URL passwords out of the output of the commands devvm runs, which no type can reach.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encoding fails rather than writing a stand-in.&lt;/strong&gt; &lt;code&gt;MarshalJSON&lt;/code&gt; and &lt;code&gt;MarshalText&lt;/code&gt; return &lt;code&gt;redact.ErrEncode&lt;/code&gt;. A &lt;code&gt;MarshalJSON&lt;/code&gt; that wrote &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; would look safe, but a struct written to the file that should hold the value, such as &lt;code&gt;proxy.json&lt;/code&gt; or &lt;code&gt;vm.json&lt;/code&gt;, would then lose it, and a VM would lose its proxy or you your login, with no error. A file that holds a value has a wire type of its own instead, which writes the value as a string, so the two kinds of file can&amp;rsquo;t be confused.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;There&amp;rsquo;s no &lt;code&gt;LogValue&lt;/code&gt;.&lt;/strong&gt; devvm has no &lt;code&gt;log/slog&lt;/code&gt; logging, so a &lt;code&gt;slog.LogValuer&lt;/code&gt; would have no caller, and &lt;code&gt;Format&lt;/code&gt; already covers the proxy&amp;rsquo;s &lt;code&gt;log.Logger&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;Reveal&lt;/code&gt; is the one way to the value,&lt;/strong&gt; and forbidigo refuses every call to it outside tests, so each place that uses a value carries a &lt;code&gt;//nolint:forbidigo&lt;/code&gt; with its reason: the proxy&amp;rsquo;s password check, the headers it puts values in, the company proxy&amp;rsquo;s credentials, the VM&amp;rsquo;s CA key as it signs, its config file and the broker&amp;rsquo;s frames to its child; the secrets&amp;rsquo; store, which writes the Keychain and the file; the VM&amp;rsquo;s proxy URL and &lt;code&gt;vm.json&lt;/code&gt;; and &lt;code&gt;internal/agentlogin&lt;/code&gt;&amp;rsquo;s login files, refreshes and claims. A new use is a choice someone made, with its reason on the line, which the review sees. The structure test refuses a struct that embeds a &lt;code&gt;Secret&lt;/code&gt;, which would take on its &lt;code&gt;Reveal&lt;/code&gt;, and an interface that declares &lt;code&gt;Reveal() string&lt;/code&gt;, through which a value could pass without a call forbidigo sees.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The wire types keep each file&amp;rsquo;s bytes as they were, so a frozen release&amp;rsquo;s &lt;code&gt;proxy.json&lt;/code&gt; writes back byte for byte (&lt;code&gt;TestV010ProxyConfigs&lt;/code&gt;), its &lt;code&gt;Sum&lt;/code&gt; doesn&amp;rsquo;t change and no running VM&amp;rsquo;s proxy starts again for an upgrade. An agent&amp;rsquo;s login file stays the agent&amp;rsquo;s own format, read and written as a map so that fields devvm doesn&amp;rsquo;t know are kept, and a key or token is a &lt;code&gt;redact.Secret&lt;/code&gt; once it leaves the map, through a lookup, a refresh or a capture.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not covered.&lt;/strong&gt; The company proxy&amp;rsquo;s URLs as your environment gives them, &lt;code&gt;HTTPS_PROXY&lt;/code&gt; and &lt;code&gt;HTTP_PROXY&lt;/code&gt;, can hold a password, and they stay strings, because devvm passes them on as they are, to &lt;code&gt;proxy.json&lt;/code&gt; and to the programs it runs on the host. So do the URLs &lt;code&gt;proxy.Upstream.WithPassword&lt;/code&gt; returns, which hold the saved password for devvm&amp;rsquo;s own clients and the programs it runs. The VM&amp;rsquo;s proxy URL, which holds its password, is a string too, because it goes into the VM&amp;rsquo;s Lima config and environment, where the VM needs it. &lt;code&gt;redact.String&lt;/code&gt; and &lt;code&gt;redact.In&lt;/code&gt; take the passwords in such URLs out of devvm&amp;rsquo;s run log and Lima&amp;rsquo;s logs (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#this-machine"&gt;your company proxy&amp;rsquo;s password&lt;/a&gt;). Two values are strings by design:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Keychain&amp;rsquo;s value,&lt;/strong&gt; which &lt;code&gt;platform.KeychainGet&lt;/code&gt; returns and &lt;code&gt;KeychainSet&lt;/code&gt; takes as a string, because &lt;code&gt;internal/platform&lt;/code&gt; imports no devvm package. &lt;code&gt;secrets.Store&lt;/code&gt; makes it a &lt;code&gt;Secret&lt;/code&gt; at once in &lt;code&gt;saved&lt;/code&gt;, and reveals it only for &lt;code&gt;KeychainSet&lt;/code&gt; in &lt;code&gt;save&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;devvm desktop&amp;rsquo;s VNC password,&lt;/strong&gt; 8 characters that you must see to type into a VNC viewer. devvm keeps it in the desktop section of &lt;code&gt;vm.json&lt;/code&gt; and shows it in &lt;code&gt;desktop_ready&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="the-proxys-broker"&gt;The proxy&amp;rsquo;s broker&lt;span class="hx:absolute hx:-mt-20" id="the-proxys-broker"&gt;&lt;/span&gt;
&lt;a href="#the-proxys-broker" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A VM&amp;rsquo;s proxy reads every byte the VM sends out, and it runs as you, with your Keychain, your files and every socket of yours. A bug in it that a VM could drive, such as a parser that a crafted request takes over or a path that leads out of its folder, would reach all of that. So &lt;code&gt;devvm _proxy&lt;/code&gt; is split in two: a broker, which keeps what only the host should do and stays unconfined, and a child, which reads the VM&amp;rsquo;s network and can be confined. The design keeps four things. A child that a VM takes over holds nothing of this machine&amp;rsquo;s beyond what it held for that VM. It can&amp;rsquo;t make the broker act for another VM, another secret or another file. It connects to no address that the VM&amp;rsquo;s rules and the floor refuse, such as this machine&amp;rsquo;s loopback, except for what a company proxy reaches for it. And the VM&amp;rsquo;s connections stay the child&amp;rsquo;s. Of each request, only the host name it looks up and the address it connects to cross to the broker, which opens the connection and hands it to the child, so no byte that the connection carries passes through the broker. Of a request&amp;rsquo;s own bytes, only a login&amp;rsquo;s token exchange reaches the broker, as captures in the broker below describe. &lt;a href="https://next.devvm.dev/docs/internals/processes/#a-vms-proxy"&gt;Processes&lt;/a&gt; describes the two processes as they run, and this note is their design, with its threat check. On macOS the child runs under Seatbelt, and on Linux it confines itself with Landlock and a seccomp filter (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt;), and on both its sandbox refuses it every connection of its own, so the broker looks up each name and opens each connection that the child asks for, once its own policy and floor allow the address.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why a broker, and not values handed over at the start:&lt;/strong&gt; the proxy looks each bound value up when a request needs it, in the Keychain, devvm&amp;rsquo;s secrets folder or an agent&amp;rsquo;s login file, which it refreshes on the host when it&amp;rsquo;s due (&lt;a href="https://next.devvm.dev/docs/internals/network/#how-the-proxy-puts-them-in"&gt;how the proxy puts them in&lt;/a&gt;). A login&amp;rsquo;s value changes with each refresh, and the proxy keeps it for 30 seconds, and any other value for 5 minutes. The proxy also saves the logins that a VM makes, and writes the VM&amp;rsquo;s bindings again. Values handed over once would be stale within the minute, and the child would need to write the store of logins. So the broker runs beside the child for as long as it does, and answers its questions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What runs where:&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Side&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The VM&amp;rsquo;s proxy port, every request and tunnel, the rules and the floor, the SNI check, interception, putting values into headers, transparent mode, &lt;code&gt;devvm.proxy&lt;/code&gt;&amp;rsquo;s endpoints, and the bounds on what a VM makes the proxy hold (&lt;code&gt;maxConns&lt;/code&gt; and &lt;code&gt;admit&lt;/code&gt;, &lt;code&gt;maxConnects&lt;/code&gt;, &lt;code&gt;maxRequests&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;child&lt;/td&gt;
&lt;td&gt;they read the VM&amp;rsquo;s bytes, which is what the child is for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The event log, &lt;code&gt;network.jsonl&lt;/code&gt;, and the child&amp;rsquo;s own lines in &lt;code&gt;proxy.log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;child&lt;/td&gt;
&lt;td&gt;each request logs an event, so a hop to the broker would sit on every request&amp;rsquo;s path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The shared Nix cache, its fetches and its files&lt;/td&gt;
&lt;td&gt;child&lt;/td&gt;
&lt;td&gt;its fetches go through the floor and the company proxy as the VM&amp;rsquo;s requests do, and each VM&amp;rsquo;s Nix checks what it gets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The company proxy as the requests&amp;rsquo; upstream, with its credentials&lt;/td&gt;
&lt;td&gt;child, with the &lt;code&gt;proxy&lt;/code&gt; secret&amp;rsquo;s value from the broker&lt;/td&gt;
&lt;td&gt;the company proxy takes its password with each plain HTTP request, so whatever sends those requests holds it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Looking up a name, and opening a TCP connection to an address or to the company proxy&lt;/td&gt;
&lt;td&gt;broker, which hands the connection to the child, and judges each address again with its own policy and floor&lt;/td&gt;
&lt;td&gt;a sandbox can&amp;rsquo;t tell this machine&amp;rsquo;s loopback, its own addresses and the LAN apart from the internet as a rule changes (below), so the child&amp;rsquo;s sandbox refuses it every connection of its own&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Each value&amp;rsquo;s lookup: the Keychain through &lt;code&gt;security&lt;/code&gt;, devvm&amp;rsquo;s secrets folder, an agent&amp;rsquo;s login file and its OAuth refresh (&lt;code&gt;IO.Secret&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;they need the Keychain and your files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Capturing logins: the token request to the endpoint, its reply, saving the login and writing the bindings again (&lt;code&gt;IO.Capture&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;the endpoint&amp;rsquo;s reply holds the login&amp;rsquo;s real tokens, its refresh token among them, which never enter the child&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The SSH agent&amp;rsquo;s relay, its socket and its connections to the agent&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;its filter is the guarantee, and a child with the agent&amp;rsquo;s socket could send the agent anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Holding the backend&amp;rsquo;s logs to their cap (&lt;code&gt;IO.KeepLogs&lt;/code&gt;, &lt;code&gt;Config.VMLogs&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;they&amp;rsquo;re in Lima&amp;rsquo;s folder for the VM, beside its disk and its &lt;code&gt;lima.yaml&lt;/code&gt;, which a child must never write&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connecting to a link&amp;rsquo;s socket&lt;/td&gt;
&lt;td&gt;broker, which hands the connection to the child&lt;/td&gt;
&lt;td&gt;devvm&amp;rsquo;s run folder holds every VM&amp;rsquo;s link sockets and agents&amp;rsquo; relays, and the ssh masters&amp;rsquo; control sockets, each a way into a VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Finding a request&amp;rsquo;s host in the links&amp;rsquo; list&lt;/td&gt;
&lt;td&gt;child, checked again by the broker&lt;/td&gt;
&lt;td&gt;the child decides for each request whether it&amp;rsquo;s for a link, before any rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;proxy.json&lt;/code&gt;, the CAs&amp;rsquo; files, the lifeline, the status file and the pid file&lt;/td&gt;
&lt;td&gt;broker&lt;/td&gt;
&lt;td&gt;the child gets what it needs of them over the socket, so it needs no read of the VM&amp;rsquo;s run folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The files that change while the proxy runs: the policy files, the bindings file and the links&amp;rsquo; list&lt;/td&gt;
&lt;td&gt;the child looks at them, the broker reads them&lt;/td&gt;
&lt;td&gt;below&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;The files that change.&lt;/strong&gt; The proxy reads each of these files again when its modification time, size or inode changes, which it checks with a &lt;code&gt;stat&lt;/code&gt; on every request. The child keeps that check, because Landlock leaves &lt;code&gt;stat&lt;/code&gt; unrestricted and Seatbelt can allow it alone (&lt;code&gt;file-read-metadata&lt;/code&gt;), and asks the broker for the file only when it has changed. The broker reads the file with the proxy&amp;rsquo;s usual checks, its owner, its mode, at most 1 MiB, and a symbolic link followed or refused as each file allows, and returns its bytes with the stamp of the file it read. The child parses them and keeps that stamp, so a change still applies to the next request, and an unchanged file costs no hop. Both write &lt;code&gt;proxy.log&lt;/code&gt;, each line saying which side wrote it. A rotation takes the file&amp;rsquo;s lock and checks its size again, as the event log&amp;rsquo;s does, so the two writers rotate it once, and the broker reads, copies and empties the file through the descriptor it was given, never by its path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The folders the child writes are the VM&amp;rsquo;s.&lt;/strong&gt; A child that a VM takes over can put anything in the folders it writes, so the unconfined code that later opens them reads them as it reads a file a VM can write. The child may create only regular files there. On Linux it never gets Landlock&amp;rsquo;s rights to make a link, a FIFO, a socket, a device or a folder, and the Nix cache&amp;rsquo;s &lt;code&gt;nar/&lt;/code&gt; folder is made before it confines itself. On macOS its profile refuses creating anything but a regular file, and hard links, which the follow-up checks there. devvm, &lt;code&gt;devvm _links&lt;/code&gt;, &lt;code&gt;devvm network log&lt;/code&gt;, &lt;code&gt;devvm network lock&lt;/code&gt;, the port forwarder, the link session, devvm gc&amp;rsquo;s trim of the Nix cache and the cache&amp;rsquo;s lock open, rename, empty, change and delete files in those folders through &lt;code&gt;internal/safefile&lt;/code&gt;, never following a link and taking only a regular file with one link that&amp;rsquo;s yours, or through an &lt;code&gt;os.Root&lt;/code&gt; of the folder. The broker makes the cache&amp;rsquo;s &lt;code&gt;nar/&lt;/code&gt; folder and sets both folders&amp;rsquo; modes the same way (&lt;code&gt;makeNixFolders&lt;/code&gt;), deleting anything at &lt;code&gt;nar/&lt;/code&gt; that isn&amp;rsquo;t a folder, a link as itself, and making a folder in its place, which its log warns of, so its &lt;code&gt;chmod&lt;/code&gt; never reaches a folder of yours. A confined child can&amp;rsquo;t leave a link there, so this is for one that runs without Landlock or Seatbelt. So a link that a child leaves where &lt;code&gt;proxy.log&lt;/code&gt;, &lt;code&gt;network.jsonl&lt;/code&gt;, &lt;code&gt;links.log&lt;/code&gt;, &lt;code&gt;ports.log&lt;/code&gt; or &lt;code&gt;nar/&lt;/code&gt; was never leads devvm to your files, and a FIFO there never hangs a command. A build&amp;rsquo;s child writes &lt;code&gt;events.jsonl&lt;/code&gt; and &lt;code&gt;proxy.log&lt;/code&gt; in a &lt;code&gt;logs/&lt;/code&gt; folder of its own inside the build proxy&amp;rsquo;s folder, apart from its config, its policy and its status file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What the child needs,&lt;/strong&gt; which what confines it holds it to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its descriptors:&lt;/strong&gt; standard input from the null device, &lt;code&gt;proxy.log&lt;/code&gt; as its output and its error output, the socket to the broker as descriptor 3, and the VM&amp;rsquo;s proxy port&amp;rsquo;s listener, which the broker opened, as descriptor 4.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its environment:&lt;/strong&gt; &lt;code&gt;TZ&lt;/code&gt;, &lt;code&gt;SSL_CERT_FILE&lt;/code&gt; and &lt;code&gt;SSL_CERT_DIR&lt;/code&gt; when devvm has them, so the roots it trusts on Linux are the proxy&amp;rsquo;s usual ones, and &lt;code&gt;GODEBUG&lt;/code&gt;, to which it adds &lt;code&gt;updatemaxprocs=0&lt;/code&gt;, so Go&amp;rsquo;s runtime doesn&amp;rsquo;t read its cgroup&amp;rsquo;s CPU limit again as it runs. It gets nothing else, so it never sees a token in the environment of the shell that started devvm, or the status file&amp;rsquo;s name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files to read and write:&lt;/strong&gt; the VM&amp;rsquo;s logs folder, &lt;code&gt;vms/&amp;lt;hash&amp;gt;/logs/&lt;/code&gt;, where it creates, appends to, reads, empties and renames its two logs and takes the event log&amp;rsquo;s lock, which &lt;code&gt;devvm _links&lt;/code&gt; takes too, and for a VM with the nix layer, the shared Nix cache, &lt;code&gt;cache/nix-cache/&lt;/code&gt; and its &lt;code&gt;nar/&lt;/code&gt; folder, where it creates, writes, reads, lists, deletes and renames regular files, from the top folder into &lt;code&gt;nar/&lt;/code&gt; among them, and takes &lt;code&gt;.lock&lt;/code&gt;. A build&amp;rsquo;s child writes its own &lt;code&gt;logs/&lt;/code&gt; folder instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Files to look at only:&lt;/strong&gt; the policy files, the bindings file and the links&amp;rsquo; list, with &lt;code&gt;stat&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What the system gives it:&lt;/strong&gt; what a Go program reads to start, the system&amp;rsquo;s roots, its time zone, and the host&amp;rsquo;s own addresses. On Linux, it loads the roots and its time zone before it confines itself. On macOS, &lt;code&gt;crypto/x509&lt;/code&gt; asks &lt;code&gt;trustd&lt;/code&gt; through &lt;code&gt;com.apple.trustd.agent&lt;/code&gt;, after CoreFoundation looks at the metadata of the program&amp;rsquo;s folder for its bundle. The floor reads the host&amp;rsquo;s addresses every 30 seconds (&lt;code&gt;hostAddrs&lt;/code&gt;), through a netlink route socket on Linux and the route &lt;code&gt;sysctl&lt;/code&gt; on macOS. It needs no resolver, because the broker looks up its names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network:&lt;/strong&gt; no connection of its own. It accepts on its listener, reads and writes the connections it accepted and those that the broker hands it, and on Linux binds its netlink route socket, which reaches the kernel alone. It sends no UDP, and it listens on nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nothing else:&lt;/strong&gt; no read of your home folder or of devvm&amp;rsquo;s data, config or run folders, no Keychain, no unix socket but its own two descriptors, no Lima folder, no signal to another process, no tracing, and no fork or &lt;code&gt;exec&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The floor fails open if it reads no addresses for the host, because &lt;code&gt;hostAddrs&lt;/code&gt; then refuses none of them, so the child&amp;rsquo;s check after it confines itself needs a read of the host&amp;rsquo;s addresses that isn&amp;rsquo;t empty, and a later read that fails keeps the last good one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The protocol.&lt;/strong&gt; The broker makes one unix stream socketpair, close-on-exec from the start (&lt;code&gt;SOCK_CLOEXEC&lt;/code&gt; on Linux, and &lt;code&gt;syscall.ForkLock&lt;/code&gt; held with &lt;code&gt;CloseOnExec&lt;/code&gt; on macOS), so no program the broker runs, such as &lt;code&gt;security&lt;/code&gt;, holds an end, and the child&amp;rsquo;s end is its descriptor 3. Each message is a frame: a 4-byte big-endian length, then a JSON object of at most 2 MiB with its &lt;code&gt;type&lt;/code&gt;, its &lt;code&gt;id&lt;/code&gt; and its fields, which the reader decodes refusing unknown fields. Bytes, such as a file, a body or a header&amp;rsquo;s value, cross as &lt;code&gt;[]byte&lt;/code&gt;, which JSON holds in base64, so &lt;code&gt;encoding/json&lt;/code&gt; never changes bytes that aren&amp;rsquo;t UTF-8 and a 1 MiB file takes about 1.4 MiB of a frame. Every read is a &lt;code&gt;recvmsg&lt;/code&gt; with room for one descriptor, and a read whose control data was cut short (&lt;code&gt;MSG_CTRUNC&lt;/code&gt;) breaks the rules. Each read asks for no more than the bytes left in its frame, and the writer sends each frame whole under one lock, with its descriptor on the frame&amp;rsquo;s first bytes, so a descriptor always arrives with the frame it belongs to. The broker&amp;rsquo;s first frame is &lt;code&gt;start&lt;/code&gt;, with the protocol&amp;rsquo;s version, 1, the SHA-256 of the broker&amp;rsquo;s own executable, which the broker reads first thing as it starts, and everything the child runs with, as the start below says. The child answers &lt;code&gt;ready&lt;/code&gt;, with the same version, the SHA-256 of its own executable, which it reads before it confines itself on Linux and through its profile on macOS, the address it serves and how it&amp;rsquo;s confined, or &lt;code&gt;failed&lt;/code&gt;, with why. After that only the child asks, and the broker answers each request with a frame of the same &lt;code&gt;id&lt;/code&gt;, in any order:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th&gt;What the child sends&lt;/th&gt;
&lt;th&gt;What the broker answers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;value&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a binding&amp;rsquo;s kind, agent and name (&lt;code&gt;valueKey&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the value and when the broker looked it up, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;file&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a watched file&amp;rsquo;s number in the start&amp;rsquo;s list&lt;/td&gt;
&lt;td&gt;the file&amp;rsquo;s bytes and the stamp it read, or that it&amp;rsquo;s missing or refused, and why&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;link&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a request&amp;rsquo;s host and port&lt;/td&gt;
&lt;td&gt;a connection to the link&amp;rsquo;s socket, as the frame&amp;rsquo;s one descriptor (&lt;code&gt;SCM_RIGHTS&lt;/code&gt;), or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;token&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a captured request&amp;rsquo;s host, its clean path, method and query, its headers, at most 64 KiB, and its body, at most 64 KiB (&lt;code&gt;captureRequestMax&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;the reply the VM gets, its status and its few headers, and the agent whose login it was, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lookup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a host name, absolute, with its one trailing dot&lt;/td&gt;
&lt;td&gt;its addresses, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dial&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;an address and a port, or which company proxy, &lt;code&gt;https&lt;/code&gt; or &lt;code&gt;http&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;a TCP connection to it, as the frame&amp;rsquo;s one descriptor, or an error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cancel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the ID of a &lt;code&gt;lookup&lt;/code&gt; or a &lt;code&gt;dial&lt;/code&gt; it gave up on, as the frame&amp;rsquo;s own&lt;/td&gt;
&lt;td&gt;nothing of its own: that request ends with an error&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Only a &lt;code&gt;lookup&lt;/code&gt; and a &lt;code&gt;dial&lt;/code&gt; can be cancelled, with a &lt;code&gt;cancel&lt;/code&gt; frame of the request&amp;rsquo;s ID, below. A value&amp;rsquo;s lookup and a token exchange run to their 20 seconds whatever happens to the VM&amp;rsquo;s request, so the broker keeps a value it looked up for the next request. The child stops waiting for a reply once its request has ended, drops the reply when it comes, and holds the request&amp;rsquo;s place under its type&amp;rsquo;s cap until then, so it never has more under way than the broker allows, and it closes a link&amp;rsquo;s or a dial&amp;rsquo;s connection that it no longer wants. A reply that wouldn&amp;rsquo;t fit in a frame is sent as an error instead, so no request waits for one that never comes, and the few headers a token&amp;rsquo;s reply keeps are 1 KiB each at most. An error reaches the child as one of a few codes, &lt;code&gt;not_found&lt;/code&gt;, &lt;code&gt;refused&lt;/code&gt;, &lt;code&gt;busy&lt;/code&gt;, &lt;code&gt;too_long&lt;/code&gt; or &lt;code&gt;failed&lt;/code&gt;, or for a &lt;code&gt;lookup&lt;/code&gt;, &lt;code&gt;no_such_host&lt;/code&gt;, &lt;code&gt;timeout&lt;/code&gt; or &lt;code&gt;temporary&lt;/code&gt;, which the child turns back into the resolver&amp;rsquo;s error that its block&amp;rsquo;s reason and its second try need, and the broker&amp;rsquo;s own log keeps its text, which can name a lookup&amp;rsquo;s or an endpoint&amp;rsquo;s details. The broker&amp;rsquo;s start frame has the start&amp;rsquo;s deadline to be written, so a child that never reads can&amp;rsquo;t hold the broker either.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bounds, and failing closed.&lt;/strong&gt; The broker serves one &lt;code&gt;value&lt;/code&gt; at a time, as the proxy&amp;rsquo;s lookups go one at a time, at most 8 &lt;code&gt;token&lt;/code&gt;s at once, as &lt;code&gt;captureReads&lt;/code&gt; allows, 4 &lt;code&gt;file&lt;/code&gt;s, 256 &lt;code&gt;link&lt;/code&gt;s, which is the link session&amp;rsquo;s own cap on a client&amp;rsquo;s connections, 256 &lt;code&gt;lookup&lt;/code&gt;s and 1024 &lt;code&gt;dial&lt;/code&gt;s, as many as the child&amp;rsquo;s tunnels at once (&lt;code&gt;maxConnects&lt;/code&gt;). It answers a request past its cap with an error, which a child that keeps the same caps never gets, because the broker gives a request&amp;rsquo;s place back as its reply starts to go, before the child can send the next. A reply that waits for the socket keeps its place, so a child that stops reading holds no more of the broker&amp;rsquo;s answers than the caps. It keeps each value it looked up for as long as the proxy keeps it, so a child that asks again and again makes the broker look a binding up at most once in 30 seconds or 5 minutes, and on macOS run &lt;code&gt;security&lt;/code&gt; that often. It keeps a failed lookup for 5 seconds, so a child can&amp;rsquo;t make it run &lt;code&gt;security&lt;/code&gt; or try a refresh back to back. The child keeps a value only until the broker&amp;rsquo;s lookup is that old, so no value is kept longer than the broker keeps it. The broker keeps its own watch on the bindings file, the links&amp;rsquo; list and the policy files, as the proxy does (&lt;code&gt;watched&lt;/code&gt;), looking at the first two on every &lt;code&gt;value&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt; and &lt;code&gt;token&lt;/code&gt; request, and at the policy files on every &lt;code&gt;dial&lt;/code&gt;, whatever the child asks, so a binding or a link that devvm takes away is gone for the next request, and a change to the bindings file drops the broker&amp;rsquo;s values and its failed lookups, as it drops the proxy&amp;rsquo;s values, so a secret set right after a failure goes in at the next request. Some frames end the pair: one over 2 MiB, one that isn&amp;rsquo;t JSON or has a type or a field that the version doesn&amp;rsquo;t know, a second &lt;code&gt;start&lt;/code&gt;, a reply to no request, a frame that carries a descriptor from the child, and a &lt;code&gt;ready&lt;/code&gt; whose version or executable&amp;rsquo;s SHA-256 differs. The child takes a descriptor only with a &lt;code&gt;link&lt;/code&gt; or &lt;code&gt;dial&lt;/code&gt; reply that says it carries one, and closes any other. For each, the broker stops the child, logs the rule the frame broke but never its bytes, and exits, and the VM has no network until devvm starts its proxy again. A request that the broker refuses, such as one for a binding that isn&amp;rsquo;t in the file, gets an error instead, which the child handles as it handles a failed lookup. No value goes in, a capture gets &lt;code&gt;502&lt;/code&gt;, a link gets &lt;code&gt;link_refused&lt;/code&gt;, a name that the broker can&amp;rsquo;t look up gets the block of any name that doesn&amp;rsquo;t resolve, and a connection that the broker refuses or can&amp;rsquo;t open gets &lt;code&gt;connect failed&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Naming nothing but its own VM&amp;rsquo;s.&lt;/strong&gt; Every request names something in the broker&amp;rsquo;s own config, which is one VM&amp;rsquo;s, so the child can&amp;rsquo;t reach another VM&amp;rsquo;s binding, any other secret or any file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;value&lt;/code&gt;:&lt;/strong&gt; the broker finds the key in its own read of the bindings file that its config names, and looks the value up with its own copy of that binding, never the child&amp;rsquo;s, so the binding&amp;rsquo;s &lt;code&gt;id&lt;/code&gt; and its methods are checked as for any binding (&lt;code&gt;fits&lt;/code&gt;). A key that the file doesn&amp;rsquo;t hold now gets an error, the company proxy&amp;rsquo;s secret&amp;rsquo;s included, which no binding names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;file&lt;/code&gt;:&lt;/strong&gt; a number in the broker&amp;rsquo;s list, which is the bindings file, the links&amp;rsquo; list and the policy files in the config&amp;rsquo;s order, so no path crosses the socket.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;link&lt;/code&gt;:&lt;/strong&gt; the broker finds the host and port in its own read of the links&amp;rsquo; list (&lt;code&gt;links.find&lt;/code&gt;), and connects to &lt;code&gt;LinkSocket&lt;/code&gt; of its run folder, its VM, the entry&amp;rsquo;s address and its port, only for an address in &lt;code&gt;127.77.0.0/16&lt;/code&gt;, trying a few times for a full backlog as the proxy does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;token&lt;/code&gt;:&lt;/strong&gt; the broker finds the endpoints in its own &lt;code&gt;captures&lt;/code&gt; that the host, the path and the method match, which gives the agents, refuses a request that matches none, and puts in the VM&amp;rsquo;s name itself (&lt;code&gt;Exchange.VM&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;lookup&lt;/code&gt;:&lt;/strong&gt; the broker takes only a host name in the proxy&amp;rsquo;s own form (&lt;code&gt;NormHost&lt;/code&gt;, &lt;code&gt;HostOK&lt;/code&gt;), with its trailing dot, and no address, and looks it up as the proxy does, so a child learns no more than it could ask this machine&amp;rsquo;s resolver.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;dial&lt;/code&gt;:&lt;/strong&gt; the broker connects to an address only once its own read of the VM&amp;rsquo;s policy files and its own read of the host&amp;rsquo;s addresses allow it, as the floor does, and to a company proxy only at the address of its own config.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Captures in the broker.&lt;/strong&gt; For a captured request, the child does what the proxy does for any request up to the request&amp;rsquo;s body. It judges the host and the request by the VM&amp;rsquo;s rules, intercepts it and reads the body. Then it sends the request in &lt;code&gt;token&lt;/code&gt;. The broker runs &lt;code&gt;IO.Capture&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Request&lt;/code&gt;, and sends the request to the endpoint&amp;rsquo;s host from its own config, on port 443, through the company proxy when there is one, and trusting the system&amp;rsquo;s roots and &lt;code&gt;upstream_cas&lt;/code&gt;, as an OAuth refresh does. It reads the reply, runs &lt;code&gt;Response&lt;/code&gt; and returns what the VM gets. The broker does what the proxy does with a captured request. It drops a &lt;code&gt;1xx&lt;/code&gt;, refuses an upgrade, leaves gzip to Go&amp;rsquo;s transport, sends the VM&amp;rsquo;s headers on without the hop-by-hop ones and &lt;code&gt;Proxy-Authorization&lt;/code&gt;, takes a successful reply of at most 1 MiB and returns only &lt;code&gt;keepHeaders&lt;/code&gt;&amp;rsquo; headers with it. It returns an error reply as it is, up to the same 1 MiB, rather than streaming it through, and gives one that&amp;rsquo;s longer a &lt;code&gt;502&lt;/code&gt;. An error reply to a request whose body &lt;code&gt;Request&lt;/code&gt; changed comes back as its OAuth error code alone (&lt;code&gt;errorReply&lt;/code&gt;). The child logs the &lt;code&gt;login&lt;/code&gt; event, naming the agent that the broker returned, and &lt;code&gt;guard&lt;/code&gt; stays in the child, for the host&amp;rsquo;s other replies. So the real tokens in an endpoint&amp;rsquo;s reply, a new login&amp;rsquo;s refresh token among them, and the &lt;code&gt;id_token&lt;/code&gt; that &lt;code&gt;Request&lt;/code&gt; puts into Codex&amp;rsquo;s API-key exchange, never enter the child, and a child can&amp;rsquo;t save tokens that the endpoint didn&amp;rsquo;t issue.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Connections through the broker.&lt;/strong&gt; The child judges each request as the proxy does, by the VM&amp;rsquo;s rules, then the floor, which looks the name up and keeps the addresses that aren&amp;rsquo;t internal or that a rule names. It asks the broker for each lookup, and then for a connection to each address it kept, one at a time, as the proxy dials them, or for a connection to the company proxy when one applies. The broker answers a &lt;code&gt;dial&lt;/code&gt; for an address only when that address passes its own copy of the floor&amp;rsquo;s check: no deny names it, and it&amp;rsquo;s neither internal nor this machine&amp;rsquo;s own, or a rule names it, by the broker&amp;rsquo;s own read of the VM&amp;rsquo;s built-in policies, its policy files, which it looks at on every &lt;code&gt;dial&lt;/code&gt;, and the host&amp;rsquo;s addresses, which it reads every 30 seconds, or the config says the VM is open. Then it connects over TCP, with the proxy&amp;rsquo;s 15-second timeout, and hands the connection to the child as it hands a link&amp;rsquo;s. So a child that a VM takes over connects to this machine&amp;rsquo;s loopback, its own addresses and the private and link-local ranges only where a rule names the address, as the VM does, and it reaches the internet as the VM does. Two ways stay open, as they do for the VM: a company proxy, which the child speaks to with its password and which reaches whatever it reaches, this machine&amp;rsquo;s loopback included when it runs on this machine, and a host on this machine&amp;rsquo;s network whose address is public, such as a neighbour&amp;rsquo;s global IPv6 address, which the floor counts as the internet.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A rule applies from the next connection.&lt;/strong&gt; &lt;code&gt;devvm network allow 127.0.0.1:5432&lt;/code&gt; changes the policy file, the child sees its new stamp at the next request and asks for it, and the broker&amp;rsquo;s own look at the file at the &lt;code&gt;dial&lt;/code&gt; that follows sees it too. A rule taken away is gone for the broker&amp;rsquo;s next &lt;code&gt;dial&lt;/code&gt; as well, so a connection opened as a rule goes may fail, but never one that no rule allowed. The broker also looks at its own copy of the policy files at each &lt;code&gt;file&lt;/code&gt; request for one of them, so its copy is never older than what it gave the child, but in the moment between the two looks. A rule for a name, such as &lt;code&gt;localhost:5432&lt;/code&gt;, judges the name, and the floor needs a rule for the address too, such as &lt;code&gt;127.0.0.1:5432&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Which addresses:&lt;/strong&gt; the broker judges each address as the floor does, unmapped, so an IPv4-mapped &lt;code&gt;::ffff:127.0.0.1&lt;/code&gt; is &lt;code&gt;127.0.0.1&lt;/code&gt;, a NAT64 or 6to4 address is judged by the IPv4 address in it, &lt;code&gt;::1&lt;/code&gt; and every address in &lt;code&gt;127.0.0.0/8&lt;/code&gt; are loopback, and &lt;code&gt;0.0.0.0&lt;/code&gt; and &lt;code&gt;::&lt;/code&gt;, which reach this machine&amp;rsquo;s own services, are internal. It refuses an address with a zone, such as &lt;code&gt;fe80::1%en0&lt;/code&gt;, which no rule can name, and a port outside 1 to 65535.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy:&lt;/strong&gt; the child asks for &lt;code&gt;https&lt;/code&gt;&amp;rsquo;s or &lt;code&gt;http&lt;/code&gt;&amp;rsquo;s, and the broker connects to the address in its own config, by name, through the system&amp;rsquo;s resolver, so a company proxy on this machine&amp;rsquo;s loopback, such as a VPN client&amp;rsquo;s, works, and the child can name no other address that way. The child still speaks &lt;code&gt;CONNECT&lt;/code&gt; and plain HTTP to it, with its password, so the company proxy, not the broker, decides where those go.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The host&amp;rsquo;s addresses:&lt;/strong&gt; the broker reads them before it starts the child, and a read that fails or finds none fails the start, as the child&amp;rsquo;s own check does, and a later read that fails keeps the last good one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A request given up on:&lt;/strong&gt; the child sends &lt;code&gt;cancel&lt;/code&gt; with a &lt;code&gt;lookup&lt;/code&gt;&amp;rsquo;s or a &lt;code&gt;dial&lt;/code&gt;&amp;rsquo;s ID once the VM&amp;rsquo;s request has ended, or a lookup&amp;rsquo;s own deadline has passed, and the broker ends that lookup or connection, answers it with an error and frees its place, so slots that a VM&amp;rsquo;s abandoned requests held don&amp;rsquo;t fill the caps. A &lt;code&gt;cancel&lt;/code&gt; gets no answer of its own, and one for an ID that isn&amp;rsquo;t under way is dropped.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lookups:&lt;/strong&gt; the broker looks each name up through this machine&amp;rsquo;s resolver, as the proxy does, so the child sends no DNS, and a resolver on this machine&amp;rsquo;s loopback, such as systemd-resolved&amp;rsquo;s &lt;code&gt;127.0.0.53&lt;/code&gt; or a &lt;code&gt;dnsmasq&lt;/code&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt;, answers the broker. The child sends no UDP at all.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What doesn&amp;rsquo;t change:&lt;/strong&gt; the open tier&amp;rsquo;s broker allows every address, as the floor does there. Transparent mode&amp;rsquo;s connections, the Nix cache&amp;rsquo;s fetches and the connections that put a value in go through the same &lt;code&gt;dial&lt;/code&gt;. A link&amp;rsquo;s connection is the broker&amp;rsquo;s already, through its &lt;code&gt;link&lt;/code&gt; request, and a capture&amp;rsquo;s token request is the broker&amp;rsquo;s own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The sandboxes:&lt;/strong&gt; on macOS the child&amp;rsquo;s profile allows no network out at all, neither TCP nor UDP to any address, nor any unix socket, and Seatbelt checks every &lt;code&gt;connect&lt;/code&gt; and every send with an address, while writes on a connection it accepted or was handed need no rule. On Linux, Landlock from ABI 4 refuses every TCP &lt;code&gt;connect&lt;/code&gt;, and from ABI 10 every UDP bind and send, as the child&amp;rsquo;s ruleset handles those rights and allows no port, and the seccomp filter refuses the child every socket but a netlink route socket, &lt;code&gt;connect&lt;/code&gt; and &lt;code&gt;socketpair&lt;/code&gt; outright, and &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; on &lt;code&gt;sendto&lt;/code&gt;, &lt;code&gt;sendmsg&lt;/code&gt; and &lt;code&gt;sendmmsg&lt;/code&gt;, because TCP Fast Open connects a socket as it sends, and the listener, once a &lt;code&gt;shutdown&lt;/code&gt; has closed it, is a TCP socket that could connect again. A filter reads only a call&amp;rsquo;s arguments, never what they point to, and these checks need nothing else, so no other thread of the child can change what the filter checked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Without the sandbox:&lt;/strong&gt; a child that runs unconfined, or on a Linux kernel without seccomp filters, still asks the broker for every connection, but nothing stops a child that a VM took over from connecting itself, so its confinement says so (&lt;code&gt;partial&lt;/code&gt; with &lt;code&gt;no-seccomp&lt;/code&gt;, or &lt;code&gt;none&lt;/code&gt;), and devvm doctor warns of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The &lt;code&gt;Secret&lt;/code&gt; type on the socket.&lt;/strong&gt; The frames are the third kind of file that holds values, after &lt;code&gt;proxy.json&lt;/code&gt; and &lt;code&gt;vm.json&lt;/code&gt;, so they get wire types of their own, as those files have (&lt;a href="#where-secret-values-live"&gt;where secret values live&lt;/a&gt;). The start&amp;rsquo;s password, the company proxy&amp;rsquo;s password, the CAs&amp;rsquo; keys, and a &lt;code&gt;value&lt;/code&gt; or &lt;code&gt;token&lt;/code&gt; reply&amp;rsquo;s value each cross as a string in a wire struct. Only the protocol&amp;rsquo;s encoder fills that string, with &lt;code&gt;Reveal&lt;/code&gt; and its &lt;code&gt;//nolint:forbidigo&lt;/code&gt; on the line, and the decoder makes it a &lt;code&gt;redact.Secret&lt;/code&gt; at once. Nothing logs a frame, and an error names only its type and the rule it broke. The company proxy&amp;rsquo;s URLs from the environment cross as strings, as they are in &lt;code&gt;proxy.json&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The start:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;devvm starts the broker as it starts the proxy, &lt;code&gt;devvm _proxy -config FILE&lt;/code&gt;, detached, with its output in &lt;code&gt;proxy.log&lt;/code&gt;, and waits up to 5 seconds for its status file.&lt;/li&gt;
&lt;li&gt;The broker reads the config, looks up the company proxy&amp;rsquo;s password when the config names the &lt;code&gt;proxy&lt;/code&gt; secret, reads the CAs&amp;rsquo; files, listens on the VM&amp;rsquo;s proxy port, starts the agent&amp;rsquo;s relay and the keeping of the backend&amp;rsquo;s logs, and makes the socketpair.&lt;/li&gt;
&lt;li&gt;It starts the child, devvm&amp;rsquo;s own binary with the arguments &lt;code&gt;_proxy-child -for FILE&lt;/code&gt;, through &lt;code&gt;daemon.Spawn&lt;/code&gt;, which gains the descriptors to pass (&lt;code&gt;ExtraFiles&lt;/code&gt;) and an environment that its caller chooses. On Linux it runs &lt;code&gt;/proc/self/exe&lt;/code&gt;, which is its own file even once an upgrade has replaced the file at its path. &lt;code&gt;-for&lt;/code&gt; names the config only so the child can be told apart, and the child never opens it. Once the child runs, the broker closes its own copies of the listener and of the child&amp;rsquo;s end of the socketpair.&lt;/li&gt;
&lt;li&gt;It sends &lt;code&gt;start&lt;/code&gt;, which also says how the broker started the child, under Seatbelt or unconfined and why. The child checks the executable&amp;rsquo;s SHA-256 against its own, makes its server from the start, opens its logs and the Nix cache, loads the system&amp;rsquo;s roots and its time zone, checks that it can read the host&amp;rsquo;s addresses, confines itself where its platform does that in the process, checks that the confinement holds by opening its broker&amp;rsquo;s config, which it must be refused, and answers &lt;code&gt;ready&lt;/code&gt; with how it&amp;rsquo;s confined.&lt;/li&gt;
&lt;li&gt;Within 4 seconds of its own start, the broker writes the child&amp;rsquo;s pid file, &lt;code&gt;run/proxy-child.pid&lt;/code&gt;, and how it&amp;rsquo;s confined, &lt;code&gt;run/proxy.confined&lt;/code&gt;, which devvm doctor reads only while the broker runs, and which &lt;code&gt;Proxy.Stop&lt;/code&gt; removes with the pid file, and then the status file with its own pid and the address (&lt;code&gt;daemon.Ready&lt;/code&gt;), which is what devvm waits for. The status keeps the address alone, which devvm compares with the config&amp;rsquo;s. When the child answers &lt;code&gt;failed&lt;/code&gt;, or doesn&amp;rsquo;t answer in time, the broker stops it and exits with the reason in &lt;code&gt;proxy.log&lt;/code&gt;, so devvm reports &lt;code&gt;proxy_start_failed&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;The end.&lt;/strong&gt; The two end together, and neither starts the other again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The lifeline is the broker&amp;rsquo;s.&lt;/strong&gt; When the VM&amp;rsquo;s hostagent ends, the broker closes the socket, and the child closes its listener first, then closes its connections, waits up to 5 seconds for its handlers as the proxy does, and exits. The broker waits for it, and kills it a second past that, then removes the agent&amp;rsquo;s socket and exits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;devvm stop&lt;/code&gt;&amp;rsquo;s &lt;code&gt;SIGTERM&lt;/code&gt;&lt;/strong&gt; reaches the broker through its pid file. The broker sends the child &lt;code&gt;SIGTERM&lt;/code&gt; through its &lt;code&gt;daemon.Handle&lt;/code&gt;, which ends it at once, as &lt;code&gt;SIGTERM&lt;/code&gt; ends the proxy, and kills it if it hasn&amp;rsquo;t ended within a second, inside the 2 seconds that devvm waits before its own &lt;code&gt;SIGKILL&lt;/code&gt;. So a stop ends both, and the next start finds the port free.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A broker that ends any other way,&lt;/strong&gt; &lt;code&gt;SIGKILL&lt;/code&gt; included, leaves the socket closed, because nothing else holds its end, and the child reads its end, closes its listener and exits. The child reads the socket for as long as it runs, so this needs no signal. A child that a VM has taken over can ignore the socket&amp;rsquo;s end, so on Linux the broker also starts the child with &lt;code&gt;PR_SET_PDEATHSIG&lt;/code&gt; set to &lt;code&gt;SIGKILL&lt;/code&gt;, from a goroutine that holds its thread (&lt;code&gt;runtime.LockOSThread&lt;/code&gt;) until the child is reaped, because Linux ties that signal to the thread that started the child rather than its process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A child that ends,&lt;/strong&gt; crashed or killed, ends the broker, which logs how it ended and removes the agent&amp;rsquo;s socket. Neither starts the other again, so a child that fails at once can&amp;rsquo;t loop, and the VM has no network until devvm&amp;rsquo;s next command starts its proxy again, as after a proxy&amp;rsquo;s crash.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Finding them.&lt;/strong&gt; To devvm, the broker is the proxy. Its pid file, its status file and its arguments, &lt;code&gt;_proxy -config FILE&lt;/code&gt;, which &lt;code&gt;daemon.Proc&lt;/code&gt; matches, stay as they are. The broker signals the child through the &lt;code&gt;daemon.Handle&lt;/code&gt; that &lt;code&gt;Spawn&lt;/code&gt; returned, which reaps it. devvm also finds the child as a &lt;code&gt;daemon.Proc&lt;/code&gt;, by &lt;code&gt;run/proxy-child.pid&lt;/code&gt; and its arguments, &lt;code&gt;_proxy-child -for&lt;/code&gt; and the VM&amp;rsquo;s config, so &lt;code&gt;Proxy.Stop&lt;/code&gt; and &lt;code&gt;devvm gc --orphans&lt;/code&gt; stop a child that outlived its broker, checking its arguments before each signal as they do for every background process. The broker writes that pid file only once the child said it&amp;rsquo;s ready, after &lt;code&gt;sandbox-exec&lt;/code&gt; has run it, so the arguments are already the child&amp;rsquo;s own. Its arguments don&amp;rsquo;t contain &lt;code&gt;_proxy -config&lt;/code&gt;, so every pattern that finds a VM&amp;rsquo;s proxy finds only the broker. The testscript runner&amp;rsquo;s &lt;code&gt;pkill -f&lt;/code&gt; of &lt;code&gt;_proxy -config&lt;/code&gt; in the sandbox ends the brokers and so their children, and the runner also ends &lt;code&gt;_proxy-child -for&lt;/code&gt; in the sandbox, in case a test killed a broker in a way that kept its child. The end-to-end checks find the child by &lt;code&gt;[_]proxy-child -for&lt;/code&gt; and the config, and a check that a proxy is gone checks both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The build proxy&lt;/strong&gt; is the same broker and child, which &lt;code&gt;backend.ProxyStarter&lt;/code&gt; starts and stops through its &lt;code&gt;daemon.Handle&lt;/code&gt;, and which ends the child as &lt;code&gt;devvm stop&lt;/code&gt; does. Its broker has no secrets, captures, links, agent or backend logs to keep, so it only looks up the &lt;code&gt;proxy&lt;/code&gt; secret when &lt;code&gt;config.toml&lt;/code&gt;&amp;rsquo;s company proxy names one, and follows the build VM&amp;rsquo;s lifeline. Its child writes &lt;code&gt;events.jsonl&lt;/code&gt; and &lt;code&gt;proxy.log&lt;/code&gt; in the build proxy&amp;rsquo;s &lt;code&gt;logs/&lt;/code&gt; folder and reads nothing else, so the end-to-end checks that look for a build&amp;rsquo;s logs look there. One way for both keeps one code path, and a build runs code that devvm trusts no more than a VM&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Upgrades.&lt;/strong&gt; The config doesn&amp;rsquo;t change. &lt;code&gt;proxy.json&lt;/code&gt; keeps its fields and &lt;code&gt;ConfigVersion&lt;/code&gt; stays 1, so every release&amp;rsquo;s frozen configs still read and write back byte for byte (&lt;code&gt;TestV010ProxyConfigs&lt;/code&gt;), and the implementation starts a broker and its child on each of them. A proxy that a devvm before the split started runs as one process until the VM&amp;rsquo;s next launch, which starts it again because its config&amp;rsquo;s &lt;code&gt;devvm_sha256&lt;/code&gt; differs, as every upgrade does, so a running VM keeps its network through the upgrade. An older devvm that stops a VM&amp;rsquo;s proxy after a downgrade finds the broker by the same pid file and arguments, and the child ends with it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Confining the child.&lt;/strong&gt; Two follow-ups hold the child to what it needs, as listed above, and where a platform can&amp;rsquo;t, the child runs unconfined, says so in &lt;code&gt;ready&lt;/code&gt;, the broker logs a warning and writes it to &lt;code&gt;run/proxy.confined&lt;/code&gt;, and devvm doctor warns of it for each running VM. The child says how it&amp;rsquo;s confined in one line of words from a fixed set, its level, &lt;code&gt;full&lt;/code&gt;, &lt;code&gt;partial&lt;/code&gt; or &lt;code&gt;none&lt;/code&gt;, then what confines it, and for a child that isn&amp;rsquo;t fully confined, why (&lt;code&gt;proxy.Confinement&lt;/code&gt;, in &lt;code&gt;internal/proxy/confine.go&lt;/code&gt;), which the broker refuses unless it parses, so devvm never prints what a child wrote (&lt;a href="https://next.devvm.dev/docs/internals/network/#the-childs-sandbox"&gt;the child&amp;rsquo;s sandbox&lt;/a&gt; has the table). Both follow-ups share it, the check that the confinement holds (&lt;code&gt;checkConfined&lt;/code&gt;, which opens the broker&amp;rsquo;s config) and the hook where the child confines itself in the process (&lt;code&gt;confineSelf&lt;/code&gt;, by platform), which on Linux calls &lt;code&gt;internal/landlock&lt;/code&gt; and turns what it got into the line (&lt;code&gt;landlockConfinement&lt;/code&gt;), and which &lt;code&gt;confineChild&lt;/code&gt; bounds to 2 seconds (&lt;code&gt;confineWait&lt;/code&gt;). The child gets the hook through &lt;code&gt;IO&lt;/code&gt;&amp;rsquo;s &lt;code&gt;confine&lt;/code&gt;, which &lt;code&gt;ChildMain&lt;/code&gt; sets, so a test&amp;rsquo;s child in the test&amp;rsquo;s own process confines nothing, and a confinement that fails, rather than one the kernel can&amp;rsquo;t give, fails the start. Each follow-up&amp;rsquo;s start fits in the broker&amp;rsquo;s 4 seconds, so a sandbox that refuses what the child needs fails the start rather than hang it, and on macOS a broker and its child under Seatbelt are ready in about 40 ms, or 350 ms for the first start of a binary that macOS hasn&amp;rsquo;t run before.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS, with Seatbelt:&lt;/strong&gt; the broker starts the child through &lt;code&gt;/usr/bin/sandbox-exec -p PROFILE&lt;/code&gt;, with a profile that denies everything by default, so the child is confined from its first instruction, and the profile is an argument, never a file on disk. &lt;code&gt;internal/seatbelt&lt;/code&gt; owns it (&lt;code&gt;ChildProfile&lt;/code&gt;), with the quoting and the real paths that Lima&amp;rsquo;s hostagent&amp;rsquo;s profile uses too, and the broker gets it through &lt;code&gt;proxy.IO.Seatbelt&lt;/code&gt;, which only &lt;code&gt;devvm _proxy&lt;/code&gt; on macOS sets, because &lt;code&gt;internal/proxy&lt;/code&gt; imports the standard library alone. The profile imports the system&amp;rsquo;s &lt;code&gt;dyld-support.sb&lt;/code&gt;, the rules that Apple keeps for starting a program, so dyld and the system&amp;rsquo;s libraries in their cryptexes load as Apple changes them. It allows &lt;code&gt;exec&lt;/code&gt; and reading of devvm&amp;rsquo;s binary by its real path alone, which &lt;code&gt;sandbox-exec&lt;/code&gt; needs to run it and the child needs for its SHA-256, and the metadata of its folder, which CoreFoundation looks at for the program&amp;rsquo;s bundle before Security checks a certificate. It allows reading &lt;code&gt;/usr/lib&lt;/code&gt; and &lt;code&gt;/System/Library&lt;/code&gt; and the time zone, and the metadata of the links on the way, &lt;code&gt;/etc&lt;/code&gt;, &lt;code&gt;/var&lt;/code&gt; and &lt;code&gt;/tmp&lt;/code&gt;, because a sandboxed lookup through a link needs it. It allows reading and writing in its folders, making only regular files there (&lt;code&gt;vnode-type REGULAR-FILE&lt;/code&gt;), no hard link anywhere (&lt;code&gt;file-link&lt;/code&gt;), no folder removed, and no change to a file&amp;rsquo;s flags, ACL, owner, set-id bits or extended attributes, so the broker makes the Nix cache&amp;rsquo;s folders before the child starts. It allows &lt;code&gt;file-read-metadata&lt;/code&gt; alone on the watched files, on their targets when they&amp;rsquo;re links, and on every link on the way to any of its files and folders (&lt;code&gt;seatbelt.Links&lt;/code&gt;), the mach services &lt;code&gt;com.apple.trustd&lt;/code&gt; and &lt;code&gt;com.apple.trustd.agent&lt;/code&gt;, reading &lt;code&gt;sysctl&lt;/code&gt; but its &lt;code&gt;kern.proc&lt;/code&gt; names, and signals to itself. It allows no network out at all, to any address or unix socket, and accepting on its listener, and reading and writing the connections it accepted and those that the broker handed it, need no rule. It allows no bind, no fork, no look at another process (&lt;code&gt;process-info&lt;/code&gt;, the process list), and none of the Keychain&amp;rsquo;s services. The list of what the child needs came from the sandbox&amp;rsquo;s own log of what it refused (&lt;code&gt;log show --predicate 'eventMessage CONTAINS &amp;quot;devvm(&amp;quot;'&lt;/code&gt;), and the profile leaves refused what the child does without: &lt;code&gt;com.apple.logd&lt;/code&gt;, &lt;code&gt;com.apple.system.notification_center&lt;/code&gt;, &lt;code&gt;com.apple.system.opendirectoryd.libinfo&lt;/code&gt;, &lt;code&gt;/Library/Preferences/com.apple.networkd.plist&lt;/code&gt;, &lt;code&gt;/etc/passwd&lt;/code&gt;, &lt;code&gt;/dev/fd&lt;/code&gt;, the interfaces&amp;rsquo; link addresses (&lt;code&gt;net.link.addr&lt;/code&gt;), &lt;code&gt;AF_SYSTEM&lt;/code&gt; sockets and the binds that the system&amp;rsquo;s network code tries. &lt;code&gt;crypto/x509&lt;/code&gt;&amp;rsquo;s checks don&amp;rsquo;t need &lt;code&gt;com.apple.SecurityServer&lt;/code&gt;, which the profile never allows. A watched file whose link points elsewhere after the start gets its &lt;code&gt;stat&lt;/code&gt; refused, which the child takes as a file to ask the broker for at every request (&lt;code&gt;watched.get&lt;/code&gt;), so a change still applies to the next request. The broker starts the child again unconfined, within the same 4 seconds, only when &lt;code&gt;sandbox-exec&lt;/code&gt; failed before devvm&amp;rsquo;s code ran, which the child&amp;rsquo;s end shows: it ended before it answered, with &lt;code&gt;sandbox-exec&lt;/code&gt;&amp;rsquo;s own exit status, 65 for a profile it refused or 71 for a program it couldn&amp;rsquo;t run, or killed by &lt;code&gt;SIGABRT&lt;/code&gt; or &lt;code&gt;SIGKILL&lt;/code&gt;, as dyld aborts a program that the profile refuses what it needs to load, which the broker decides before its own stop of the child. A ready that names a sandbox the broker didn&amp;rsquo;t start the child under breaks the protocol&amp;rsquo;s rules (&lt;code&gt;Confinement.fits&lt;/code&gt;). &lt;code&gt;ChildProfile&lt;/code&gt; refuses a path that isn&amp;rsquo;t absolute or that is the root, as resolved. A missing &lt;code&gt;sandbox-exec&lt;/code&gt; starts it unconfined too. Anything else fails the start, so nothing a VM left in the child&amp;rsquo;s folders can turn a confined start into an unconfined one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux, with Landlock:&lt;/strong&gt; the child sets &lt;code&gt;no_new_privs&lt;/code&gt; on every thread and restricts itself (&lt;code&gt;landlock_restrict_self&lt;/code&gt;, through &lt;code&gt;syscall.AllThreadsSyscall&lt;/code&gt;, or with ABI 8&amp;rsquo;s &lt;code&gt;TSYNC&lt;/code&gt; where the kernel has it) before it reads a byte of the VM&amp;rsquo;s, and the files it opened before then are its logs and the Nix cache. It keeps the rights above on its folders, to make regular files alone, binds and connects no TCP port (ABI 4), binds and sends no UDP (ABI 10), scopes abstract unix sockets and signals to itself (ABI 6), and connects to no named unix socket (ABI 9). Landlock&amp;rsquo;s network rules match only ports, so they can refuse the child an address only by refusing it every connection, which is what the child needs, and the seccomp filter refuses the same on every kernel, TCP Fast Open included, which Landlock&amp;rsquo;s check of &lt;code&gt;connect&lt;/code&gt; doesn&amp;rsquo;t see. It reads no file outside its folders, because it needs no resolver. The Nix cache renames a NAR&amp;rsquo;s temporary file from its top folder into &lt;code&gt;nar/&lt;/code&gt;, which Landlock allows only from ABI 2 (&lt;code&gt;REFER&lt;/code&gt;), so the floor is ABI 2, unless the cache makes each temporary file in the folder that its file goes to. A child on a kernel below ABI 4 or 6 is partly confined, which it says in &lt;code&gt;ready&lt;/code&gt; and devvm doctor reports. A kernel at ABI 6 or 7 without Landlock&amp;rsquo;s erratum 2, which lets a process&amp;rsquo;s threads signal each other across the domains each made in turn, would refuse the signals that &lt;code&gt;syscall.AllThreadsSyscall&lt;/code&gt; sends each thread and hang the start, so there the child leaves signals unscoped and says so (&lt;code&gt;landlock-signals&lt;/code&gt;). A kernel without Landlock, or at ABI 1, confines no files, and the child runs with the seccomp filter alone and says so (&lt;code&gt;partial seccomp no-landlock&lt;/code&gt;), which devvm doctor warns of: the VM keeps its network rather than lose it on such a kernel. &lt;code&gt;internal/landlock&lt;/code&gt; (&lt;code&gt;Self&lt;/code&gt;) does all of it, with the standard library alone, behind its own build tags, as the proxy can&amp;rsquo;t import &lt;code&gt;internal/platform&lt;/code&gt;, and checks after confining that the child lists its folders and fails to list &lt;code&gt;/&lt;/code&gt; and to read &lt;code&gt;/etc/hosts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux, with seccomp:&lt;/strong&gt; no Landlock ABI can refuse the child an address, a kernel before ABI 9 can&amp;rsquo;t refuse it a named unix socket, and one before ABI 4 can&amp;rsquo;t refuse it a port, so the child also installs a seccomp filter on every thread (&lt;code&gt;SECCOMP_FILTER_FLAG_TSYNC&lt;/code&gt;) that refuses &lt;code&gt;socket&lt;/code&gt; for every family but a netlink route socket (&lt;code&gt;AF_NETLINK&lt;/code&gt; with &lt;code&gt;NETLINK_ROUTE&lt;/code&gt;), &lt;code&gt;socketpair&lt;/code&gt;, &lt;code&gt;connect&lt;/code&gt;, &lt;code&gt;listen&lt;/code&gt;, &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; on &lt;code&gt;sendto&lt;/code&gt;, &lt;code&gt;sendmsg&lt;/code&gt; and &lt;code&gt;sendmmsg&lt;/code&gt;, &lt;code&gt;socketcall&lt;/code&gt;, and &lt;code&gt;io_uring_setup&lt;/code&gt;, &lt;code&gt;io_uring_enter&lt;/code&gt; and &lt;code&gt;io_uring_register&lt;/code&gt;, whose operations would pass a filter of system calls. It kills the child for a system call of any architecture but its own, and on amd64 for the x32 numbers, so the 32-bit calls can&amp;rsquo;t get around it. &lt;code&gt;socketcall&lt;/code&gt; is a 32-bit call alone, so the check of the architecture is what refuses it. The filter also refuses &lt;code&gt;ptrace&lt;/code&gt;, &lt;code&gt;process_vm_readv&lt;/code&gt;, &lt;code&gt;process_vm_writev&lt;/code&gt; and &lt;code&gt;pidfd_getfd&lt;/code&gt;, which Landlock restricts to the child&amp;rsquo;s own domain but nothing does on a kernel without it, and which would let the child read the memory, or take the descriptors, of another process of yours, such as an ssh master. Changed in review, it refuses what Landlock doesn&amp;rsquo;t restrict at any ABI: a file&amp;rsquo;s mode, owner, extended attributes and times changed by its path (&lt;code&gt;chmod&lt;/code&gt;, &lt;code&gt;fchmodat&lt;/code&gt;, &lt;code&gt;fchmodat2&lt;/code&gt;, &lt;code&gt;chown&lt;/code&gt;, &lt;code&gt;lchown&lt;/code&gt;, &lt;code&gt;fchownat&lt;/code&gt;, the six &lt;code&gt;xattr&lt;/code&gt; calls, &lt;code&gt;utime&lt;/code&gt;, &lt;code&gt;utimes&lt;/code&gt;, &lt;code&gt;futimesat&lt;/code&gt;, and &lt;code&gt;utimensat&lt;/code&gt; with a path), &lt;code&gt;truncate&lt;/code&gt;, which Landlock restricts only from ABI 3, the kernel&amp;rsquo;s keyrings (&lt;code&gt;add_key&lt;/code&gt;, &lt;code&gt;request_key&lt;/code&gt;, &lt;code&gt;keyctl&lt;/code&gt;), another process&amp;rsquo;s limits and scheduling (&lt;code&gt;prlimit64&lt;/code&gt; on another pid, &lt;code&gt;setpriority&lt;/code&gt;, &lt;code&gt;ioprio_set&lt;/code&gt; and the four &lt;code&gt;sched_set&lt;/code&gt; calls), watches that would tell it of files outside its folders (&lt;code&gt;inotify_init&lt;/code&gt;, &lt;code&gt;inotify_init1&lt;/code&gt;, &lt;code&gt;inotify_add_watch&lt;/code&gt;, &lt;code&gt;fanotify_init&lt;/code&gt;, &lt;code&gt;fanotify_mark&lt;/code&gt;), and what the child never does: &lt;code&gt;execve&lt;/code&gt; and &lt;code&gt;execveat&lt;/code&gt;, &lt;code&gt;fork&lt;/code&gt;, &lt;code&gt;vfork&lt;/code&gt; and a &lt;code&gt;clone&lt;/code&gt; that isn&amp;rsquo;t a thread, a namespace (&lt;code&gt;unshare&lt;/code&gt;, &lt;code&gt;setns&lt;/code&gt;, a &lt;code&gt;clone&lt;/code&gt; with a namespace&amp;rsquo;s flag), &lt;code&gt;bpf&lt;/code&gt;, &lt;code&gt;userfaultfd&lt;/code&gt; and &lt;code&gt;perf_event_open&lt;/code&gt;, with &lt;code&gt;clone3&lt;/code&gt; refused as &lt;code&gt;ENOSYS&lt;/code&gt;, as its flags are behind a pointer. The calls on a descriptor the child opened stay (&lt;code&gt;fchmod&lt;/code&gt;, &lt;code&gt;fchown&lt;/code&gt;, &lt;code&gt;ftruncate&lt;/code&gt;, &lt;code&gt;utimensat&lt;/code&gt; without a path), and the Nix cache marks a file used through its descriptor. The review&amp;rsquo;s own check: the filter&amp;rsquo;s interpreter, and &lt;code&gt;TestSelf&lt;/code&gt; on Fedora 43 (ABI 11), Ubuntu 26.04 (ABI 8) and Debian 13 (ABI 6), where Go&amp;rsquo;s runtime still starts new threads under it. The child needs none of these, as the broker looks up its names and opens its connections. Once confined, the child checks that it can&amp;rsquo;t make a unix or an IPv4 socket, nor &lt;code&gt;connect&lt;/code&gt; or send with &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; on any socket, which the filter refuses before the kernel looks at the descriptor. The filter is classic BPF written out by hand (&lt;code&gt;internal/landlock&lt;/code&gt;&amp;rsquo;s &lt;code&gt;filter&lt;/code&gt;), a unit test runs its bytes in an interpreter of its own for amd64 and arm64, and a test&amp;rsquo;s child confines itself under it on the Linux test hosts and in CI&amp;rsquo;s &lt;code&gt;nocgo&lt;/code&gt; job (&lt;code&gt;TestSelf&lt;/code&gt;). A kernel without seccomp leaves the filter out, and the child says so (&lt;code&gt;no-seccomp&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Performance.&lt;/strong&gt; The path of the VM&amp;rsquo;s requests is the child&amp;rsquo;s alone: no request, tunnel or byte in them crosses the socket. The child asks the broker only for a value that its cache doesn&amp;rsquo;t hold, at most once for each binding in 30 seconds or 5 minutes, for a watched file after it changed, for each connection to a link, which is a new connection for each plain HTTP request to a link, for each token request, and for each lookup and each connection that a request opens upstream. Those last two add a round trip on the socketpair to each lookup and each connection, a JSON frame each way and a descriptor, which is small beside a lookup&amp;rsquo;s or a TCP handshake&amp;rsquo;s own time, and a kept-alive connection or a tunnel costs it once. A start costs one more process and its &lt;code&gt;exec&lt;/code&gt;, and each VM&amp;rsquo;s proxy takes a second Go process&amp;rsquo;s memory: on an Apple silicon Mac, an idle broker and its child each take about 19 MB resident.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Options weighed:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Values handed to the child at the start:&lt;/strong&gt; ruled out, above.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The child reading the changing files itself:&lt;/strong&gt; it would need to read the VM&amp;rsquo;s run folder and devvm&amp;rsquo;s config folder. Landlock keeps a rule for a file on that file itself, so a file that devvm replaces whole would lose it, and only a rule on the folder would hold. Asking the broker after a change keeps the check on each request without a hop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker sending changes to the child as they happen:&lt;/strong&gt; the broker would have to watch each file, and the standard library can only poll, so a change would wait for the next poll, while with the stamp&amp;rsquo;s check it applies to the next request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker speaking to the company proxy and handing over the tunnel:&lt;/strong&gt; that would keep the company proxy&amp;rsquo;s password out of the child for tunnels, but the company proxy takes it with each plain HTTP request, which would put the broker on that path, parsing what the child sends. So the broker opens the TCP connection to the company proxy alone, and the child speaks to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Seatbelt refusing &lt;code&gt;localhost:*&lt;/code&gt; alone, with the broker connecting to loopback only:&lt;/strong&gt; Seatbelt&amp;rsquo;s network filter names a host only as &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;localhost&lt;/code&gt;, so the child would still reach this machine&amp;rsquo;s own LAN addresses, where a server that listens on every address answers, such as Docker&amp;rsquo;s published ports, and the LAN, and whether &lt;code&gt;localhost&lt;/code&gt; covers all of &lt;code&gt;127.0.0.0/8&lt;/code&gt;, &lt;code&gt;0.0.0.0&lt;/code&gt; and the mapped forms is Apple&amp;rsquo;s to say. A profile that allows nothing out, with the broker judging every address, holds for all of them, and keeps one way for both systems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;seccomp&amp;rsquo;s user notification on Linux,&lt;/strong&gt; with the broker as the supervisor of &lt;code&gt;connect&lt;/code&gt;, &lt;code&gt;sendto&lt;/code&gt; and &lt;code&gt;sendmsg&lt;/code&gt;: the broker would read the address from the child&amp;rsquo;s memory, which another thread of the child can change after the read, so it could never let the call go on, and would make every connection itself and put it in the child (&lt;code&gt;SECCOMP_IOCTL_NOTIF_ADDFD&lt;/code&gt;), which costs what the &lt;code&gt;dial&lt;/code&gt; request does. Reading the child&amp;rsquo;s memory needs &lt;code&gt;ptrace&lt;/code&gt;&amp;rsquo;s access, which Yama&amp;rsquo;s &lt;code&gt;ptrace_scope&lt;/code&gt; 2 or 3 refuses, the broker couldn&amp;rsquo;t tell a TCP socket from a UDP one without taking it (&lt;code&gt;pidfd_getfd&lt;/code&gt;, the same access), the listener&amp;rsquo;s descriptor would have to come from the child, which the protocol refuses, and &lt;code&gt;ADDFD&lt;/code&gt; needs Linux 5.9. The filter on arguments works on every kernel with seccomp filters, with no access to the child&amp;rsquo;s memory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A network namespace for the child with nothing but its own loopback,&lt;/strong&gt; with the broker dialing every connection: it costs what the &lt;code&gt;dial&lt;/code&gt; request does, it needs an unprivileged user namespace, which Ubuntu&amp;rsquo;s AppArmor restricts from 24.04 and other systems turn off, and which the child&amp;rsquo;s filter refuses (&lt;code&gt;unshare&lt;/code&gt;), so the broker would have to make it. The filter refuses the same connections without a namespace.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker signing the interception&amp;rsquo;s certificates:&lt;/strong&gt; the child already sees every byte of its VM&amp;rsquo;s traffic, so the VM&amp;rsquo;s CA key gives it nothing more, and no other VM trusts that CA.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The agent&amp;rsquo;s relay in the child, through a connection from the broker:&lt;/strong&gt; that connection would carry whatever the child sends, so the broker would have to filter it, which is the relay&amp;rsquo;s whole job.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A process each for the relay, the logs and the lookups:&lt;/strong&gt; each would be unconfined, as the broker is, so more processes would add lifecycles but no boundary.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Threat check&lt;/strong&gt; (the security-audit skill, guidance mode, with its local IPC, protocols, data isolation and resource exhaustion companions, on this design, and an independent review of it against today&amp;rsquo;s code, whose findings are folded in). Leads, each ruled out by the design, changed in review, or listed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The child naming another VM&amp;rsquo;s binding, another secret or a file:&lt;/strong&gt; ruled out. Each request is a key, a number, a host and port, or an endpoint that the broker resolves in its own config and its own reads of its VM&amp;rsquo;s files, and no path, VM name or binding crosses the socket.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The values bound to its VM:&lt;/strong&gt; listed. A child that a VM takes over can ask for every value that its VM&amp;rsquo;s bindings file names, such as a secret of yours, a GitHub token or an agent&amp;rsquo;s access token, and use it anywhere the child reaches, while the VM itself holds only placeholders. It gets no other VM&amp;rsquo;s value, no value that isn&amp;rsquo;t bound to its VM, and no login&amp;rsquo;s refresh token.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy&amp;rsquo;s password:&lt;/strong&gt; listed. The child holds it, as the proxy does, because the company proxy takes it with each plain HTTP request, so a child that a VM takes over can send it anywhere it reaches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Its VM&amp;rsquo;s password and CAs:&lt;/strong&gt; listed. The child holds its VM&amp;rsquo;s password and both CAs&amp;rsquo; keys, which only that VM trusts, and it already sees all of that VM&amp;rsquo;s traffic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A forged token reply:&lt;/strong&gt; ruled out. The broker gets the endpoint&amp;rsquo;s reply itself, over TLS that it checks, from the host in its own config, so a child can&amp;rsquo;t save tokens that the endpoint didn&amp;rsquo;t issue. Listed: a real exchange of a code that the VM got for an account of its own saves that account&amp;rsquo;s login for every VM with the agent, as a VM can do without the proxy taken over (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binding or link that devvm took away:&lt;/strong&gt; changed in review. The broker read the bindings file and the links&amp;rsquo; list only when the child asked for them, which a child that a VM takes over never does, so a secret unbound or deleted, or a link removed, stayed within its reach. The broker now looks at both on every request that uses them, and drops its values when the bindings file changes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flooding the broker:&lt;/strong&gt; listed. Frames have a cap, each request type has a cap on how many run at once, the broker&amp;rsquo;s cache holds a lookup to once a binding in 30 seconds or 5 minutes, a failed lookup is kept for 5 seconds (changed in review, as a failure wasn&amp;rsquo;t kept, so a child could make the broker run &lt;code&gt;security&lt;/code&gt; or try a refresh back to back), and a frame that breaks a rule ends the pair. A child can still run up to 8 token exchanges at once with your login, one after another, as a VM can, and make the broker write a line in &lt;code&gt;proxy.log&lt;/code&gt; for each connection it refuses or can&amp;rsquo;t open, which pushes older lines out of the log&amp;rsquo;s rotation, as the child&amp;rsquo;s own lines can.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The broker&amp;rsquo;s own parsing:&lt;/strong&gt; listed. The broker still reads bytes that a VM chooses, in four bounded places: the child&amp;rsquo;s frames, at most 2 MiB each, which &lt;code&gt;encoding/json&lt;/code&gt; decodes, the agent&amp;rsquo;s relay&amp;rsquo;s messages, at most 256 KiB each, read by their length and type alone, the backend&amp;rsquo;s logs, which it scans for passwords, and a token request and its reply, at most 64 KiB and 1 MiB, which &lt;code&gt;internal/agentlogin&lt;/code&gt; parses as the proxy&amp;rsquo;s process does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The network:&lt;/strong&gt; changed, and listed. The rules and the floor were the child&amp;rsquo;s own code, and the sandboxes allowed it TCP and UDP to any address, so a child that a VM took over reached this machine&amp;rsquo;s loopback, its own LAN addresses and the LAN, such as your dev servers, Docker&amp;rsquo;s published ports and other VMs&amp;rsquo; proxies, whatever the rules said. A profile can&amp;rsquo;t follow a rule that applies from the next connection, and Landlock and a seccomp filter can&amp;rsquo;t refuse an address, so the sandboxes now refuse the child every connection of its own, and the broker, which judges each address with its own read of the policy files and the host&amp;rsquo;s addresses, opens each one for it. Listed: the child still reaches any public address on the internet, as an open VM&amp;rsquo;s proxy does, over TCP alone, and an address that a rule names. Changed in review, the note no longer says the LAN is out of reach: the floor counts a host on this machine&amp;rsquo;s network whose address is public as the internet, such as a printer&amp;rsquo;s or a NAS&amp;rsquo;s global IPv6 address on most networks with IPv6, or any host on a network of public IPv4 addresses, so the child, as the VM, reaches those, and the floor counting this machine&amp;rsquo;s own networks as internal is a change of its own, for the VM as much as the child. The child reaches no unix socket, so neither the ssh masters&amp;rsquo; control sockets, nor &lt;code&gt;docker.sock&lt;/code&gt;, nor an SSH agent.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;dial&lt;/code&gt; and &lt;code&gt;lookup&lt;/code&gt; requests:&lt;/strong&gt; ruled out, and listed. A &lt;code&gt;dial&lt;/code&gt; names an address and a port, which the broker judges as the floor does before it connects, or a company proxy of its own config, and nothing else, so a child can&amp;rsquo;t make the broker connect where the floor refuses, nor reach a unix socket, nor send UDP through it. A &lt;code&gt;lookup&lt;/code&gt; takes a host name alone, and the broker returns its addresses, which the child could ask this machine&amp;rsquo;s resolver for, split DNS, &lt;code&gt;/etc/hosts&lt;/code&gt; and &lt;code&gt;.local&lt;/code&gt; names included. Listed: a child can make the broker look up any name, which carries data out in the name as a VM&amp;rsquo;s own lookups through the proxy can, and hold 256 lookups and 1024 connections under way at once, each for at most its timeout, as it could hold them itself before. Changed in review: a lookup or a connection that the child gave up on held its place until its timeout, so a VM whose requests went away while DNS or IPv6 hung could fill the caps, and now the child cancels it. The broker logged a line for each failed lookup and connection, which a VM that asks for one refused address after another drives, and now it logs at most 20 a minute, then one that says it stops, as the child does for the lookups it gives up on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The connections the child holds:&lt;/strong&gt; changed in review, and listed. The caps count a connection only while it opens, and Go raises a process&amp;rsquo;s limit on open files to its hard limit, so a child could keep every connection the broker handed it and use up this machine&amp;rsquo;s ports for outgoing connections. The child now lowers its own limit, soft and hard, to 8448 files before it confines itself, four times &lt;code&gt;maxConns&lt;/code&gt; and room for its logs and the Nix cache, so it holds at most that many, which a process can&amp;rsquo;t raise again. Listed: that lowers the risk but doesn&amp;rsquo;t remove it, as macOS gives out its outgoing ports from one range of 16,384 for every process, so a few children that VMs took over, or one on a busy machine, could still use them up.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A connection connected again:&lt;/strong&gt; ruled out. A child holds connected TCP sockets, those it accepted and those the broker handed it, and its listener. On Linux, the filter refuses &lt;code&gt;connect&lt;/code&gt;, which could otherwise disconnect a TCP socket (&lt;code&gt;AF_UNSPEC&lt;/code&gt;) and connect it elsewhere, and &lt;code&gt;MSG_FASTOPEN&lt;/code&gt;, which would connect the listener once a &lt;code&gt;shutdown&lt;/code&gt; has closed it. On macOS, Seatbelt checks every &lt;code&gt;connect&lt;/code&gt; and every &lt;code&gt;sendto&lt;/code&gt; with an address against the profile, which allows none.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A rule as it changes:&lt;/strong&gt; ruled out, and listed. The child and the broker each read the policy files when their stamp changes, and the broker looks at them at each &lt;code&gt;dial&lt;/code&gt;, after the child&amp;rsquo;s own look, so a rule that the child saw is one the broker sees. A rule taken away as a connection opens makes that connection fail, which fails closed. Changed in review: the broker&amp;rsquo;s copy and what it gave the child were two reads, and a file that keeps its last rules when it can&amp;rsquo;t be read, as a policy file does, could leave the broker&amp;rsquo;s copy older than the child&amp;rsquo;s, with a rule the child no longer had, so the broker now looks at its copy at each &lt;code&gt;file&lt;/code&gt; request for a policy file too. Listed: a file that changes and can&amp;rsquo;t be read between those two looks, which only you can make happen, still leaves the broker&amp;rsquo;s copy a version behind until the file reads again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The company proxy:&lt;/strong&gt; listed. A child that a VM takes over can connect to the company proxy of its config, wherever it is, loopback included, and send it what it likes with the password it holds, as the proxy does: &lt;code&gt;CONNECT&lt;/code&gt; and plain HTTP to any host and port, which the company proxy, not the floor, decides on, so it reaches whatever the company proxy reaches, this machine&amp;rsquo;s loopback included when the company proxy runs here. The broker speaking &lt;code&gt;CONNECT&lt;/code&gt; itself would keep tunnels to the floor, but plain HTTP takes the password with each request, so the child would still hold it and reach the same through &lt;code&gt;http&lt;/code&gt;&amp;rsquo;s company proxy.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other processes&amp;rsquo; details:&lt;/strong&gt; changed in review. The first profile allowed every &lt;code&gt;sysctl&lt;/code&gt; and &lt;code&gt;process-info&lt;/code&gt;, so a child could list your processes and read their paths and arguments, a token on a command line among them. The profile now denies &lt;code&gt;process-info&lt;/code&gt; for any process but the child, the process list, and &lt;code&gt;sysctl&lt;/code&gt;&amp;rsquo;s &lt;code&gt;kern.proc&lt;/code&gt; names. macOS answers &lt;code&gt;kern.procargs2&lt;/code&gt;, a process&amp;rsquo;s arguments, to a sandboxed process only for the processes of its own process group, and the child is alone in a session of its own (&lt;code&gt;daemon.Spawn&lt;/code&gt;&amp;rsquo;s &lt;code&gt;Setsid&lt;/code&gt;), so it&amp;rsquo;s refused every other process&amp;rsquo;s, its broker&amp;rsquo;s included, which &lt;code&gt;TestChildProfileConfines&lt;/code&gt; checks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Changing the shared folders&amp;rsquo; files:&lt;/strong&gt; changed in review. The first profile allowed every write in the child&amp;rsquo;s folders, so a child could set a flag such as &lt;code&gt;uchg&lt;/code&gt; on a file in the shared Nix cache, or remove its &lt;code&gt;nar/&lt;/code&gt; folder, and stop every VM&amp;rsquo;s cache and devvm gc&amp;rsquo;s trim from changing it. The profile now refuses changing a file&amp;rsquo;s flags, ACL, owner, set-id bits and extended attributes, and removing a folder, and leaves the mode and times, which the child changes. A child can still delete or rewrite the cache&amp;rsquo;s files, as the disk&amp;rsquo;s row says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The seccomp filter&amp;rsquo;s way around:&lt;/strong&gt; changed in review. A filter of &lt;code&gt;socket&lt;/code&gt; alone lets a child reach a unix socket through the 32-bit system calls (&lt;code&gt;socketcall&lt;/code&gt;, or the x32 numbers) or through &lt;code&gt;io_uring&lt;/code&gt;, which doesn&amp;rsquo;t pass the filter, and before ABI 9 that filter is all that keeps the ssh masters&amp;rsquo; control sockets from it. The filter now kills any other architecture&amp;rsquo;s calls and refuses &lt;code&gt;socketcall&lt;/code&gt; and &lt;code&gt;io_uring&lt;/code&gt;, on every thread.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The folders the child writes:&lt;/strong&gt; changed in review. A child that a VM takes over could leave a link or a FIFO in its logs folder or the Nix cache, and devvm opened &lt;code&gt;proxy.log&lt;/code&gt; again by its path at the next start, copied and emptied it by its path at each rotation, opened &lt;code&gt;links.log&lt;/code&gt; and &lt;code&gt;ports.log&lt;/code&gt;, read the event log, and trimmed the cache through &lt;code&gt;nar/&lt;/code&gt;, each following the link. That would have written the VM&amp;rsquo;s bytes into a file of yours, copied one into the log the child reads, emptied or deleted yours, or hung a command on a FIFO. The child now makes regular files alone, and devvm opens everything in those folders through &lt;code&gt;internal/safefile&lt;/code&gt; or an &lt;code&gt;os.Root&lt;/code&gt;, never following a link, and rotates &lt;code&gt;proxy.log&lt;/code&gt; through its descriptor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The disk:&lt;/strong&gt; listed. Only the child&amp;rsquo;s own code bounds its logs and the shared Nix cache, so a child that a VM takes over can fill the disk, write what it likes into its VM&amp;rsquo;s logs, which devvm network log and devvm network lock read, replace &lt;code&gt;links.log&lt;/code&gt; and &lt;code&gt;ports.log&lt;/code&gt; with files of its own, so the link session&amp;rsquo;s report after a start can show warnings it forged or miss real ones, and write what it likes into the cache. Each VM&amp;rsquo;s Nix checks a cached NAR against cache.nixos.org&amp;rsquo;s signature and its &lt;code&gt;NarHash&lt;/code&gt;, so the other VMs fetch such a NAR again rather than trust it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Nix cache&amp;rsquo;s lock and its names:&lt;/strong&gt; changed in review, and listed. A child that held &lt;code&gt;.lock&lt;/code&gt; forever would have hung every other VM&amp;rsquo;s &lt;code&gt;/nix/&lt;/code&gt; requests and devvm gc&amp;rsquo;s trim, so each takes the lock with a deadline of a few seconds, trying it without blocking, and past it answers &lt;code&gt;404&lt;/code&gt; or skips the trim and says so. A child can still slow the cache down by holding the lock, and list the store paths that other VMs fetched.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The logs&amp;rsquo; locks:&lt;/strong&gt; changed in review, and listed. The broker and its child share &lt;code&gt;proxy.log&lt;/code&gt;&amp;rsquo;s lock, and the child and &lt;code&gt;devvm _links&lt;/code&gt; the event log&amp;rsquo;s, so a child that held one for ever would have stopped the broker at its next line, and the broker logged before it closed the socket when the hostagent ended, so the pair would have outlived the VM. Now the broker closes the socket and starts its kill&amp;rsquo;s timer before it logs anything, and every writer tries each log&amp;rsquo;s lock without blocking for at most 200 ms, then writes its line without the lock or skips the rotation. A child can still make each of the broker&amp;rsquo;s lines wait that long, and make a rotation lose the lines written as it copies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A log made huge:&lt;/strong&gt; changed in review, and listed. A rotation of &lt;code&gt;proxy.log&lt;/code&gt; read the whole file into memory, so a child that made it huge, or sparse at a terabyte, could have made the broker run out of memory and write as much. Now a rotation copies at most the last twice its limit, 20 MiB, from a line&amp;rsquo;s start, streamed into its copy. A child can still fill the disk, as the disk&amp;rsquo;s row says.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What &lt;code&gt;stat&lt;/code&gt; shows:&lt;/strong&gt; listed. Landlock doesn&amp;rsquo;t restrict &lt;code&gt;stat&lt;/code&gt;, so a child that a VM takes over on Linux learns whether any file of yours exists, its size and when it changed, though not what it holds. Changed: it read every file below &lt;code&gt;/etc&lt;/code&gt; that you can, which its resolver needed, and now that the broker looks up its names, it reads none. On macOS the profile refuses &lt;code&gt;stat&lt;/code&gt; outside the child&amp;rsquo;s files, but a refused path answers &lt;code&gt;EPERM&lt;/code&gt; and a missing one &lt;code&gt;ENOENT&lt;/code&gt;, so a child there learns whether a path exists, though nothing else of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The services the profile allows on macOS:&lt;/strong&gt; listed, and changed. A child that a VM takes over can ask &lt;code&gt;trustd&lt;/code&gt; to check certificates, which reads your trust settings, and that holds no secret of yours and isn&amp;rsquo;t the Keychain. &lt;code&gt;trustd&lt;/code&gt; can fetch a missing issuer&amp;rsquo;s certificate or an OCSP answer from the URL in a certificate, from its own unconfined process, which a review raised as a way to send a request to loopback or the LAN. Checked: a leaf whose issuer was missing and whose issuer, OCSP and CRL URLs named a server on this machine&amp;rsquo;s loopback or its LAN address made &lt;code&gt;trustd&lt;/code&gt; fetch nothing, through Go&amp;rsquo;s verifier under the profile and without it, and through &lt;code&gt;security verify-cert&lt;/code&gt;, which allows network fetches, with revocation required or not, on macOS 27. Listed: when it fetches is Apple&amp;rsquo;s to change, and the worst it could do is a request, whose answer the child never sees, to loopback or the LAN. The profile allowed mDNSResponder&amp;rsquo;s socket for the resolver, so a child could browse the local network&amp;rsquo;s Bonjour services, announce services of its own there, and register any &lt;code&gt;.local&lt;/code&gt; record it liked (&lt;code&gt;DNSServiceRegisterRecord&lt;/code&gt;), and now that the broker looks up its names, the profile allows no unix socket. &lt;code&gt;com.apple.trustd.agent&lt;/code&gt; also takes changes to your trust settings, which macOS asks your password for through its authorization services (&lt;code&gt;com.apple.authd&lt;/code&gt;), and the profile allows neither those nor &lt;code&gt;com.apple.SecurityServer&lt;/code&gt;, so a child can&amp;rsquo;t trust a CA of its own. devvm&amp;rsquo;s tests didn&amp;rsquo;t try such a change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A confined start made unconfined:&lt;/strong&gt; ruled out, and changed in review. The broker starts the child again unconfined only for a failure of &lt;code&gt;sandbox-exec&lt;/code&gt; itself, an exit status of its own or &lt;code&gt;SIGABRT&lt;/code&gt; or &lt;code&gt;SIGKILL&lt;/code&gt; before the child answered, which comes before devvm&amp;rsquo;s code runs and reads nothing of a VM&amp;rsquo;s, so a child that a VM took over, or what it left in its folders, can&amp;rsquo;t make the next start unconfined. The broker counted any signal, after its own stop of a child that hadn&amp;rsquo;t answered in time, so a child that hung, which its stop then ended with &lt;code&gt;SIGTERM&lt;/code&gt;, counted as the sandbox&amp;rsquo;s failure. It now decides before its stop, only for a child that had already ended, and only for those two signals. Listed: a program of yours that kills the child in that moment makes the start unconfined, which the proxy&amp;rsquo;s log and devvm doctor say. A child that fails after that, such as on a planted file, or that hangs, fails the start, which leaves the VM without a network until its next start, as before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A child that claims more:&lt;/strong&gt; changed in review. The broker took any confinement the child&amp;rsquo;s ready named, so a child could say &lt;code&gt;full seatbelt&lt;/code&gt; when the broker had started it unconfined. The broker now refuses a ready that names a sandbox it didn&amp;rsquo;t start the child under, or another than the one it did (&lt;code&gt;Confinement.fits&lt;/code&gt;), which ends the pair.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other processes:&lt;/strong&gt; ruled out where the child is confined. Landlock scopes signals to the child (ABI 6) and lets it trace only processes in its own domain, and the profile allows signals only to itself. Listed: on a Linux kernel before ABI 6, or at ABI 6 or 7 without erratum 2, a child that a VM takes over can signal any process of yours, which devvm doctor warns of. Changed in review: Landlock&amp;rsquo;s scope of signals doesn&amp;rsquo;t cover a process&amp;rsquo;s limits or scheduling, and a review killed another process from a fully confined child on ABI 8 by setting its &lt;code&gt;RLIMIT_CPU&lt;/code&gt; to 1 with &lt;code&gt;prlimit64&lt;/code&gt;, so the seccomp filter refuses &lt;code&gt;prlimit64&lt;/code&gt; on any pid but the child&amp;rsquo;s own (0), and &lt;code&gt;setpriority&lt;/code&gt;, &lt;code&gt;ioprio_set&lt;/code&gt;, &lt;code&gt;sched_setaffinity&lt;/code&gt;, &lt;code&gt;sched_setscheduler&lt;/code&gt;, &lt;code&gt;sched_setparam&lt;/code&gt; and &lt;code&gt;sched_setattr&lt;/code&gt; outright. The seccomp filter refuses &lt;code&gt;ptrace&lt;/code&gt;, &lt;code&gt;process_vm_readv&lt;/code&gt;, &lt;code&gt;process_vm_writev&lt;/code&gt; and &lt;code&gt;pidfd_getfd&lt;/code&gt; on every kernel, but on a kernel without Landlock the child can still open &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/mem&lt;/code&gt; and &lt;code&gt;/proc/&amp;lt;pid&amp;gt;/fd/&lt;/code&gt; of another process of yours, unless the kernel&amp;rsquo;s Yama restricts tracing (&lt;code&gt;ptrace_scope&lt;/code&gt; 1 or more, Ubuntu&amp;rsquo;s default), and so read its memory and its files. Changed in review: the broker sets itself undumpable (&lt;code&gt;PR_SET_DUMPABLE&lt;/code&gt; 0), so its own memory and descriptors, which hold the VM&amp;rsquo;s secrets, are root&amp;rsquo;s alone there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A port of another VM&amp;rsquo;s:&lt;/strong&gt; changed in review, and ruled out where the seccomp filter or Seatbelt holds. Before ABI 4, Landlock can&amp;rsquo;t refuse the child a port, so a child could bind another VM&amp;rsquo;s proxy port while that proxy starts again, and take that VM&amp;rsquo;s password from its requests. The seccomp filter refuses &lt;code&gt;listen&lt;/code&gt;, and now every new socket but a netlink route socket, so the child has no socket to bind, as the ones it holds are bound already, and the profile refuses a bind on macOS. Listed: without either, the child can still bind such a port, so that VM&amp;rsquo;s proxy fails to start until it&amp;rsquo;s free again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No confinement, or part of it:&lt;/strong&gt; listed. Where Landlock or Seatbelt isn&amp;rsquo;t there, the child runs with the broker&amp;rsquo;s access, and the split then only keeps the lookups, the captures, the relay and the logs&amp;rsquo; keeping out of the code that reads the VM&amp;rsquo;s network. Without the seccomp filter, or on macOS without Seatbelt, a child that a VM took over can also connect anywhere itself, loopback included. A kernel below ABI 4 or 6 confines the child in part, which &lt;code&gt;ready&lt;/code&gt;, &lt;code&gt;run/proxy.confined&lt;/code&gt; and devvm doctor say. Changed in review: ABI 6, 7 and 8 with the seccomp filter and scoped signals count as full, as the filter refuses every unix socket that ABI 9 would refuse by path, and every connection and datagram of the child&amp;rsquo;s own, which ABI 10 would refuse only for UDP, so doctor warns of nothing that a user could close. On macOS, &lt;code&gt;sandbox-exec&lt;/code&gt; is deprecated, and if macOS drops it, or it fails to start the child, the child runs unconfined, and the proxy&amp;rsquo;s log and devvm doctor say so, so the VM keeps its network.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The floor without the host&amp;rsquo;s addresses:&lt;/strong&gt; changed in review. A confinement that refused the read of the host&amp;rsquo;s addresses would have left the floor with none, and so let the VM reach this machine&amp;rsquo;s own public addresses. The child&amp;rsquo;s check after it confines itself needs a read that isn&amp;rsquo;t empty, and a later read that fails keeps the last good one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Descriptors and the environment:&lt;/strong&gt; ruled out. The child inherits only its four descriptors, the socketpair is close-on-exec so no other program holds an end, the child closes any descriptor that a frame brings that it didn&amp;rsquo;t ask for, and it gets only &lt;code&gt;TZ&lt;/code&gt;, &lt;code&gt;SSL_CERT_FILE&lt;/code&gt;, &lt;code&gt;SSL_CERT_DIR&lt;/code&gt; and &lt;code&gt;GODEBUG&lt;/code&gt; from the environment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The pid and status files:&lt;/strong&gt; ruled out. The child can&amp;rsquo;t write the run folder, the status file&amp;rsquo;s name isn&amp;rsquo;t in its environment, and the status names the broker&amp;rsquo;s pid, which &lt;code&gt;daemon.Proc&lt;/code&gt; checks, so a child that a VM takes over can&amp;rsquo;t make devvm signal another process. The broker writes the child&amp;rsquo;s pid file, and devvm checks the child&amp;rsquo;s arguments before it signals it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A child that outlives its broker, or starts again:&lt;/strong&gt; ruled out, changed in review. The child ends when it reads the socket&amp;rsquo;s end, which a killed broker leaves because no other process holds it, and the broker ends with its child, and neither starts the other. A stop gave the broker 2 seconds and the child&amp;rsquo;s close took up to 6, so a child could have kept the port and its old config as the next start began. Now &lt;code&gt;SIGTERM&lt;/code&gt; ends the child within a second, and devvm finds a child that outlived its broker by its pid file and stops it. Listed: a child that a VM has taken over can ignore the socket&amp;rsquo;s end and change its own arguments, which &lt;code&gt;daemon.Proc&lt;/code&gt; then doesn&amp;rsquo;t match, so devvm leaves it alone. On Linux &lt;code&gt;PR_SET_PDEATHSIG&lt;/code&gt; kills it with its broker, but on macOS such a child outlives a broker that was killed, confined, with its VM&amp;rsquo;s values and port, and the VM&amp;rsquo;s next start reports its proxy&amp;rsquo;s port as taken.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A binary that changed under the broker:&lt;/strong&gt; changed in review. The protocol&amp;rsquo;s version alone can&amp;rsquo;t tell two builds apart, so the start and the answer carry each side&amp;rsquo;s executable&amp;rsquo;s SHA-256, and a child from another build fails the start, and the VM&amp;rsquo;s next launch starts the pair again. On Linux the child is the broker&amp;rsquo;s own file anyway.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A file that changes between its stamp and its read:&lt;/strong&gt; ruled out. The child keeps the stamp of the file that the broker read, so a write after that read changes the stamp, and the child asks again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory and CPU:&lt;/strong&gt; listed. A child that a VM takes over can use memory and CPU without a bound, as the proxy can.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;End-to-end checks&lt;/strong&gt; that the implementation adds, in &lt;code&gt;network&lt;/code&gt;, &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;nix&lt;/code&gt;, &lt;code&gt;images&lt;/code&gt;, &lt;code&gt;tools&lt;/code&gt; and &lt;code&gt;from&lt;/code&gt;: a VM&amp;rsquo;s proxy runs as a broker and a child, with the child&amp;rsquo;s arguments and descriptors above and no environment but the four variables. A bound secret goes in, a login is captured from the fake token endpoint, a link connects and the Nix cache fills, each through the child. &lt;code&gt;devvm stop&lt;/code&gt; leaves neither process, and the next launch starts on the same port at once. A symbolic link, a FIFO and a hard link planted in the VM&amp;rsquo;s logs folder and the Nix cache lead no command of devvm&amp;rsquo;s, the next start or a rotation to their targets, and hang none. A broker killed with &lt;code&gt;SIGKILL&lt;/code&gt; takes its child with it within a second, a child killed takes its broker and the agent&amp;rsquo;s socket with it, and nothing starts again until the next launch. A build behind a company proxy goes through a broker and a child, and both are gone after the build. The two follow-ups add the checks that the confined child can&amp;rsquo;t read a file in the home folder, reach the Keychain or connect to a unix socket, on each platform. On Linux, &lt;code&gt;network&lt;/code&gt; checks that the VM&amp;rsquo;s proxy says Landlock in &lt;code&gt;run/proxy.confined&lt;/code&gt;, and that the child&amp;rsquo;s &lt;code&gt;/proc&lt;/code&gt; entry shows &lt;code&gt;no_new_privs&lt;/code&gt; and a seccomp filter, and &lt;code&gt;TestSelf&lt;/code&gt;, in &lt;code&gt;internal/landlock&lt;/code&gt;, runs its test binary again as a child that confines itself, which writes, renames and lists in its folder, reads the host&amp;rsquo;s addresses and writes to a TCP connection it held before, and is refused a file outside its folder, &lt;code&gt;/etc/hosts&lt;/code&gt;, listing &lt;code&gt;/&lt;/code&gt;, its own executable, a folder, a link and a FIFO in its folder, a unix socket that stands in for an ssh master&amp;rsquo;s, a socketpair, a listen, an IPv4 and an IPv6 socket, a netlink socket of another family than routes, connecting a TCP socket it held before to a loopback server, &lt;code&gt;MSG_FASTOPEN&lt;/code&gt; from its listener once a &lt;code&gt;shutdown&lt;/code&gt; has closed it, from ABI 4 a bind and from ABI 6 a signal to its parent. By hand, devvm&amp;rsquo;s release build ran a broker whose child was confined on Ubuntu 26.04 (AppArmor, ABI 8), Fedora 43 (SELinux, ABI 11), Debian 13 (ABI 6) and Ubuntu 26.04 on arm64, served a request, refused a blocked host and reached the Nix cache&amp;rsquo;s endpoint. On macOS, &lt;code&gt;network&lt;/code&gt; checks that the VM&amp;rsquo;s proxy says &lt;code&gt;full seatbelt&lt;/code&gt; in &lt;code&gt;run/proxy.confined&lt;/code&gt;, which means the child started under &lt;code&gt;sandbox-exec&lt;/code&gt; and its own check held, and &lt;code&gt;TestChildProfileConfines&lt;/code&gt;, in &lt;code&gt;internal/seatbelt&lt;/code&gt;, runs its test binary again under the child&amp;rsquo;s profile, which writes a regular file in its folder, renames it, changes its mode, removes it, looks at its policy file, and writes to a TCP connection it was handed and to one it accepted on a listener it was handed, and is refused a link, a folder, a FIFO and a hard link there, changing a file&amp;rsquo;s flags, removing a folder, reading its policy file, reading or looking at a file outside, opening the broker&amp;rsquo;s config, connecting to a unix socket, connecting over TCP to a loopback server on &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; or to any other address, sending UDP, running a program, listening on a port, signalling its parent and listing the processes. The broker&amp;rsquo;s judgment is unit tests: a &lt;code&gt;dial&lt;/code&gt; to a loopback port that no rule names is refused, &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;::1&lt;/code&gt; alike, and so is one to this machine&amp;rsquo;s own address, while one that a rule names connects, from the &lt;code&gt;dial&lt;/code&gt; after the rule is written, and not after it&amp;rsquo;s gone, and the open tier&amp;rsquo;s broker connects to any. &lt;code&gt;FuzzBrokerFrames&lt;/code&gt; sends the broker any &lt;code&gt;lookup&lt;/code&gt; and &lt;code&gt;dial&lt;/code&gt;, and checks that it looks up only a host name and connects only where its own floor allows, and the in-process tests run the whole proxy with every lookup and connection through the broker. By hand, devvm&amp;rsquo;s release build ran a broker whose child was confined, and a helper under the child&amp;rsquo;s profile was refused &lt;code&gt;~/.zshrc&lt;/code&gt;, &lt;code&gt;~/.ssh&lt;/code&gt;, &lt;code&gt;~/Library/Keychains&lt;/code&gt; and the login keychain&amp;rsquo;s file, &lt;code&gt;~/.local/share/devvm&lt;/code&gt; and &lt;code&gt;~/.config/devvm&lt;/code&gt;, running &lt;code&gt;security&lt;/code&gt;, and an ssh master&amp;rsquo;s control socket, and reached example.com. The fallback and its limits are unit tests (&lt;code&gt;TestStartChildSandbox&lt;/code&gt;), as a broken &lt;code&gt;sandbox-exec&lt;/code&gt; can&amp;rsquo;t be made on a real Mac.&lt;/p&gt;
&lt;h2 data-hextra-search-id="failed-attempts"&gt;Failed attempts&lt;span class="hx:absolute hx:-mt-20" id="failed-attempts"&gt;&lt;/span&gt;
&lt;a href="#failed-attempts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Claude&amp;rsquo;s host login in VMs:&lt;/strong&gt; on macOS it&amp;rsquo;s in the Keychain, which can&amp;rsquo;t be shared. VMs get a login made in a VM instead, which the VM&amp;rsquo;s proxy captures. The first token saved by hand was the code the browser shows, so &lt;code&gt;devvm secret set claude&lt;/code&gt; refuses one without the &lt;code&gt;sk-ant-oat01-&lt;/code&gt; prefix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;krunkit (Lima on libkrun) to return freed memory:&lt;/strong&gt; it didn&amp;rsquo;t visibly return any.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debian&amp;rsquo;s cloud kernel for &lt;code&gt;--from&lt;/code&gt;:&lt;/strong&gt; on arm64 it has no &lt;code&gt;gpio_keys&lt;/code&gt;, so it ignored Lima&amp;rsquo;s stop request; Lima hard-killed the VM after 30 s, and node, bun and dockerd in the image came out corrupted. On x86_64 it has no 9p, so on a Linux host every mount of the VM&amp;rsquo;s was an empty folder: Lima mounts them with &lt;code&gt;nofail&lt;/code&gt;, and the shared tools&amp;rsquo; build failed at its first &lt;code&gt;cd&lt;/code&gt;. &lt;code&gt;--from&lt;/code&gt; uses the generic kernel on both. With it, a Debian VM on QEMU first booted with its network card named &lt;code&gt;enp0s4&lt;/code&gt;, which cloud-init couldn&amp;rsquo;t rename to Lima&amp;rsquo;s &lt;code&gt;eth0&lt;/code&gt; once the card was up, so the VM got no ssh host keys. Debian&amp;rsquo;s kernel command line has &lt;code&gt;net.ifnames=0&lt;/code&gt;, which keeps the name &lt;code&gt;eth0&lt;/code&gt; from the start.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every layer as a Docker build stage, flattened:&lt;/strong&gt; it worked, but each image became its own full disk (3.7 GB for &lt;code&gt;node&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared read-only layers:&lt;/strong&gt; each Docker layer as an EROFS file, stacked as &lt;code&gt;/&lt;/code&gt; with overlayfs over each VM&amp;rsquo;s own disk by an initramfs of devvm&amp;rsquo;s own. It worked (&lt;code&gt;node&lt;/code&gt; took 1.0 GB of layers instead of a 1.8 GB disk), but devvm owned the boot path (the initramfs, an exit initramfs for clean shutdowns, kernel extraction), and cold program starts were 10–50 ms slower. Shared tools, and overlays on Linux, give the same savings without it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A read-only mount for &lt;code&gt;.git/hooks&lt;/code&gt; in the VM:&lt;/strong&gt; root in the VM can unmount it and write hooks through the project mount underneath. Locking &lt;code&gt;.git&lt;/code&gt; itself (&lt;code&gt;uappnd&lt;/code&gt;) breaks git, and a locked placeholder &lt;code&gt;.git/commondir&lt;/code&gt; makes git fail. Hence &lt;code&gt;chflags uchg&lt;/code&gt; on hooks and config on macOS, plus detection, and on Linux read-only binds in QEMU&amp;rsquo;s own namespace, which the VM can&amp;rsquo;t reach (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/"&gt;details&lt;/a&gt;, &lt;a href="#read-only-paths-on-linux"&gt;read-only paths on Linux&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keeping git on this machine out of submodules the VM adds (strict):&lt;/strong&gt; &lt;code&gt;diff.ignoreSubmodules = all&lt;/code&gt; in the locked &lt;code&gt;.git/config&lt;/code&gt;, which &lt;code&gt;devvm git-protect strict&lt;/code&gt; sets in devvm 0.1.0 and 0.1.1-rc.1, can&amp;rsquo;t hold. The VM writes &lt;code&gt;.gitmodules&lt;/code&gt;, whose &lt;code&gt;ignore&lt;/code&gt; line beats it, and git reads the index&amp;rsquo;s or &lt;code&gt;HEAD&lt;/code&gt;&amp;rsquo;s copy when the working tree has none. &lt;code&gt;git add -A&lt;/code&gt;, &lt;code&gt;-u&lt;/code&gt; and &lt;code&gt;.&lt;/code&gt; enter a submodule whatever the settings say, &lt;code&gt;git diff-index&lt;/code&gt;, &lt;code&gt;git diff-files&lt;/code&gt; and &lt;code&gt;git describe --dirty&lt;/code&gt; enter one that &lt;code&gt;.gitmodules&lt;/code&gt; doesn&amp;rsquo;t name, &lt;code&gt;git fetch&lt;/code&gt; and &lt;code&gt;git pull&lt;/code&gt; recurse into one that fetched commits move, and &lt;code&gt;--ignore-submodules&lt;/code&gt; on the command line beats config. A per-name &lt;code&gt;submodule.&amp;lt;name&amp;gt;.ignore&lt;/code&gt; holds only for the name the VM picks, and locking &lt;code&gt;.gitmodules&lt;/code&gt; would put a file in the working tree and leave checkouts across it stale on macOS. The submodule&amp;rsquo;s own config runs either way, because the git that the host&amp;rsquo;s git starts in it reads that config, and no setting refuses it. Only &lt;code&gt;--clone&lt;/code&gt; keeps the VM&amp;rsquo;s code away from git on this machine, so &lt;code&gt;devvm git-protect strict&lt;/code&gt; is a usage error that names &lt;code&gt;devvm clone on&lt;/code&gt;, and a VM left strict is &lt;code&gt;on&lt;/code&gt; from its next check that finds it stopped (&lt;a href="https://next.devvm.dev/docs/safety/git-protection/#vms-that-were-strict"&gt;VMs that were strict&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A root helper for Linux&amp;rsquo;s immutable attribute:&lt;/strong&gt; a helper with &lt;code&gt;CAP_LINUX_IMMUTABLE&lt;/code&gt;, installed with sudo, could lock &lt;code&gt;.git&lt;/code&gt; as macOS&amp;rsquo;s flag does, but it would put a privileged program on every host that the VM&amp;rsquo;s repo could aim at. QEMU&amp;rsquo;s own namespace needs no privilege.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kernel extraction trying gzip first:&lt;/strong&gt; Ubuntu&amp;rsquo;s arm64 kernel is an EFI executable with a zstd payload.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;mke2fs -d&lt;/code&gt; from a tarball:&lt;/strong&gt; it needed libarchive and a UTF-8 locale. A directory works.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="things-learned"&gt;Things learned&lt;span class="hx:absolute hx:-mt-20" id="things-learned"&gt;&lt;/span&gt;
&lt;a href="#things-learned" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lima &lt;code&gt;vz&lt;/code&gt; never returns freed guest memory to the Mac.&lt;/strong&gt; sbx returns it with a VM monitor of its own; libkrun has &lt;code&gt;MADV_FREE&lt;/code&gt;, with a stronger fix still an open PR.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;APFS clones&lt;/strong&gt; cost nothing until written, and &lt;code&gt;du&lt;/code&gt; overcounts them: real use was 5.5 GB where &lt;code&gt;du&lt;/code&gt; said 12.7 GB.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lima locks each additional disk to one running VM,&lt;/strong&gt; so images shared across VMs go through a shared folder (virtiofs on macOS, 9p on Linux) and are loop-mounted from it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read-only mounts are enforced by the host:&lt;/strong&gt; even root in the VM can&amp;rsquo;t write to them, but root can unmount a nested one and reach what&amp;rsquo;s underneath.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Codex and opencode refreshing their OAuth logins in a VM can rotate the token and sign the host out.&lt;/strong&gt; On every tier the VM holds only placeholders, and devvm refreshes the logins on the host when the proxy asks it for their values (&lt;code&gt;internal/agentlogin&lt;/code&gt;). Codex decodes &lt;code&gt;id_token&lt;/code&gt;&amp;rsquo;s claims and the access token&amp;rsquo;s &lt;code&gt;exp&lt;/code&gt; without checking signatures, so placeholders are unsigned JWTs with the real account claims and a far-off &lt;code&gt;exp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;On macOS, a socket in transit over &lt;code&gt;SCM_RIGHTS&lt;/code&gt; can lose the data it held&lt;/strong&gt; and read as ended when the same process closes, at that moment, a unix socket that still holds descriptors no one received. It fails closed, as an ended connection. The broker and its child close such a socket only as the pair ends, and the test that reads a handed-over link&amp;rsquo;s data asks for the link once more when it reads empty.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A process passes the files it was given on to the processes it starts,&lt;/strong&gt; unless they&amp;rsquo;re marked close-on-exec. Go marks only the files it opens itself, so a terminal, an editor or a test harness that gives devvm another one (a pty on descriptor 3, the end of a pipe) would have it held by devvm&amp;rsquo;s proxy, its port forwarder and Lima&amp;rsquo;s processes, which keep that terminal or pipe open for as long as they run. So devvm marks every file it was given past standard input, output and error close-on-exec as it starts, and keeps them open itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No existing tool&lt;/strong&gt; gives Lima Dockerfile-style layers with sharing at run time; nerdbox and Kata do it on VM runtimes of their own.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Where devvm fits,&lt;/strong&gt; next to sbx and Colima: sbx puts agents first; devvm gives a full Linux VM per project, with agents optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-hextra-search-id="open-work-and-risks"&gt;Open work and risks&lt;span class="hx:absolute hx:-mt-20" id="open-work-and-risks"&gt;&lt;/span&gt;
&lt;a href="#open-work-and-risks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;User-facing limits are in &lt;a href="https://next.devvm.dev/docs/using/limits/"&gt;Known limits&lt;/a&gt;, and what devvm leaves open is in &lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/"&gt;Attack vectors&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--from&lt;/code&gt;:&lt;/strong&gt; a moved tag is noticed only at the next build, not when listing images; devvm doesn&amp;rsquo;t log in to registries, so private images work only through Docker; registries over plain HTTP (&lt;code&gt;localhost:5000&lt;/code&gt;) aren&amp;rsquo;t supported.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alpine:&lt;/strong&gt; &lt;code&gt;rc-status&lt;/code&gt; as a normal user shows &lt;code&gt;acpid&lt;/code&gt; and &lt;code&gt;syslog&lt;/code&gt; as crashed, as their pid files are root&amp;rsquo;s (&lt;code&gt;sudo rc-status&lt;/code&gt; is clean).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free-space floors:&lt;/strong&gt; the free space devvm wants before each build and new VM (&lt;a href="https://next.devvm.dev/docs/using/ports-size/#free-space"&gt;free space&lt;/a&gt;) is set by Lima&amp;rsquo;s own package, and for shared tool images in &lt;code&gt;internal/backend/disk.go&lt;/code&gt;, where the comments give what each number was measured from. The measurements are free space, read with statfs before, during and after each step, in e2e runs on macOS with Lima &lt;code&gt;vz&lt;/code&gt;, and for shared tool images also with devvm&amp;rsquo;s data folder on a tmpfs of its own on Linux. On Linux hosts, Lima&amp;rsquo;s numbers add a copy of base&amp;rsquo;s disk to an image&amp;rsquo;s and a tools build&amp;rsquo;s, but they haven&amp;rsquo;t been measured there yet. A &lt;code&gt;--from&lt;/code&gt; base converts its image in the host&amp;rsquo;s temporary folder, which devvm doesn&amp;rsquo;t check, because on Linux that&amp;rsquo;s often a small tmpfs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workspace clones:&lt;/strong&gt; each repo&amp;rsquo;s seed is copied one after another, so a folder of many big repos takes a copy per repo; copies in parallel, bounded, aren&amp;rsquo;t built. A repo made in the VM stays there until the user clones it out by hand, and nothing of the folder&amp;rsquo;s own files comes back (&lt;a href="#workspace-clones"&gt;workspace clones&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;x86_64 hosts&lt;/strong&gt; are untested on real hardware; on Intel Macs, &lt;code&gt;--from&lt;/code&gt;&amp;rsquo;s kernel is untested with &lt;code&gt;vz&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux hosts:&lt;/strong&gt; the QEMU wrapper depends on the shape of Lima&amp;rsquo;s &lt;code&gt;-netdev user,id=net0,…&lt;/code&gt; argument. If Lima changes it, the wrapper refuses to start QEMU rather than run it unrestricted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network tiers, not built:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;approving blocked hosts as they&amp;rsquo;re hit.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Claude Code&amp;rsquo;s login is captured on a path Anthropic doesn&amp;rsquo;t document.&lt;/strong&gt; devvm reads Claude Code&amp;rsquo;s token endpoint, its client ID, its requests and replies and the &lt;code&gt;.credentials.json&lt;/code&gt; format from Claude Code 2.1&amp;rsquo;s bundle, and refreshes the login on the host as Claude Code would (&lt;a href="https://next.devvm.dev/docs/internals/network/#logins-made-in-a-vm"&gt;logins made in a VM&lt;/a&gt;). A release that changes any of them can break the login in VMs, or the host&amp;rsquo;s refresh, without warning. The &lt;code&gt;network&lt;/code&gt; end-to-end section drives the real Claude Code&amp;rsquo;s &lt;code&gt;claude auth login&lt;/code&gt; against a fake endpoint, so a change to its requests fails that section, and a Claude Code token from &lt;code&gt;claude setup-token&lt;/code&gt;, which Anthropic documents, stays the fallback.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network tiers, risks of the mechanism:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sandbox-exec&lt;/code&gt; is deprecated. If Apple removes it, macOS needs another way to confine the hostagent: an egress filter upstream (gvisor-tap-vsock#609 and #631; Lima&amp;rsquo;s &lt;code&gt;hostLoopback: false&lt;/code&gt;, lima#5581), a user-v2 daemon of devvm&amp;rsquo;s own (lima#5464), or QEMU with the Linux mechanism on macOS too (it works there, slower than &lt;code&gt;vz&lt;/code&gt;). The self-check catches it breaking silently.&lt;/li&gt;
&lt;li&gt;VMs started outside devvm (&lt;code&gt;limactl start&lt;/code&gt;, &lt;code&gt;limactl shell&lt;/code&gt; starting a stopped VM, Lima&amp;rsquo;s start at login) aren&amp;rsquo;t confined: devvm reports them &lt;code&gt;unenforced&lt;/code&gt;. An &lt;code&gt;override.yaml&lt;/code&gt; setting a dead &lt;code&gt;HTTPS_PROXY&lt;/code&gt; might harden this (untested).&lt;/li&gt;
&lt;li&gt;A Lima upgrade that adds a hostagent connection fails closed: the start hangs until Lima gives up (10 minutes in the experiment). devvm should time-box the start and say it&amp;rsquo;s the sandbox. That includes unix sockets: the profile allows only those in the VM&amp;rsquo;s Lima folder and the forwarded agent&amp;rsquo;s. Allowing every unix socket would let a compromised hostagent reach &lt;code&gt;docker.sock&lt;/code&gt; or another ssh agent.&lt;/li&gt;
&lt;li&gt;Tunnels the proxy doesn&amp;rsquo;t read are decided by the &lt;code&gt;CONNECT&lt;/code&gt; host and checked against the TLS server name, so domain fronting through a shared CDN may still reach other hosts (&lt;a href="https://next.devvm.dev/docs/safety/attack-vectors/#network"&gt;attack vectors&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>