Skip to content
Go back

One Always-On Machine, Disposable Guests: Designing Tilfrd CI đź§±

(updated )

Tilfrd’s protected-main branch now has two verified CI stages: a required GitHub-hosted source gate, and a downstream job running the same foundation and SQLite tests on my own MSI machine, pinned to the source commit that passed the gate.

That part works. The more demanding part is still being qualified: running reviewed pull-request jobs inside disposable Firecracker microVMs, with host-controlled isolation, authenticated just-in-time registration and independently verified cleanup.

The purpose of the design is not simply to move GitHub Actions onto cheaper hardware. It is to make the execution boundary explicit, testable and recoverable.

One boundary before the details: this is internal CI infrastructure and experimental architecture for my own projects. It is not a generally available product, and nothing here is production-certified for anyone else.

Why one machine at all

Metered CI is excellent, and I want to be careful here, because “self-host” often turns into a religion. Hosted runners are billed by the minute, which is a perfectly reasonable way to buy compute you do not want to operate.

What I wanted was a different shape of cost. A fixed machine, a fixed power bill, and no meter running while I debug something for an hour. I also wanted the execution to happen somewhere I control, with the checkout and the credentials handled the way I choose.

You do not get that for free. You pay in hardware, electricity, maintenance, and the specific loneliness of being the only person who knows why the network config looks like that. If you cannot afford that last one, do not do this.

The host is deliberately boring

The machine runs Ubuntu Server on x86-64, with a normal non-root account for the runner. The runner itself is a systemd service with no new privileges, setuid binaries restricted, and memory and CPU limits — so a runaway job hits a ceiling before it takes the host with it.

Trusted jobs are serialised on that host: one at a time, so two builds never compete for the same memory or the same disk. That is slower in aggregate and much easier to reason about. On a single machine, predictability beats throughput.

Boring is the feature. Every extra service on that host is another thing a job could talk to, and every one of them has to be justified.

Two lanes, one verified, one still a target

The mistake I nearly made was treating “self-hosted CI” as one problem with one solution. It is two problems, because the trust level is different — and right now they are at very different stages.

Diagram of the two Tilfrd CI lanes. Three sources enter from the left — a first-party push to main, a pull request from the same repository, and a fork or unknown ref — and all three pass through one required hosted validation gate that runs the full contract suite on the exact commit. After the gate the routing diverges. The protected-main push continues to a permanent runner marked verified on 20 November, having run 424 foundation tests and 45 SQLite tests on both sides of the gate. The reviewed pull request points to a dashed disposable Firecracker guest marked target and NO_GO, with components tested independently but no end-to-end run. The fork stops at a hosted VM because the routing refuses it. A caption says the main lane is verified end to end, while the pull-request lane remains a target until routing, JIT execution and teardown are accepted.

The protected-main lane, which is real. A required hosted validation gate runs the full contract suite on the exact commit. Only when it succeeds on a push to protected main does a downstream job run on the permanent runner, pinned to the gate’s head SHA. On 20 November the gate and the downstream job each ran the same 424 foundation tests and 45 SQLite tests against the same commit, and both passed. The downstream job runs as a non-root user, with a read-only token, no provider secrets and no pull-request code in the checkout.

Automatic MSI execution follows successful hosted-gated main pushes. A separate manual pilot exists for founder-dispatched checks. Feature and fix branch pushes stay on GitHub-hosted runners.

The pull-request lane, which is not. This is the target, and it gets the real boundary: a reviewed pull request running inside its own Firecracker microVM, with host-controlled isolation, authenticated just-in-time registration and independently verified cleanup.

What has actually been demonstrated is narrower than that sentence. Isolated and manual guest experiments have passed — a one-shot disposable canary has run and reported its result. Source-level and native coordinator lifecycle contracts exist and are tested. There are authenticated GitHub App identity milestones, and local lifecycle rehearsals. What has not happened is the thing that matters: a genuine queued GitHub job, a temporary JIT runner registered for it, isolated execution of that job, and completed-job teardown, end to end.

Until that is accepted, production pull-request-to-MSI routing is NO_GO, and general pull-request CI stays on hosted infrastructure.

There is a documentation trap here worth naming. The workflow carrying this narrow canary was merged into protected main on 23 November, while its description still contains draft and owner-hold language. The merged configuration is not an unconditional if: false — it listens for pull_request: edited on one exact pull request and one exact head SHA, and asks for an ephemeral runner label derived from the run and attempt. That makes it armed for a deliberately narrow case, not evidence of a functioning Firecracker path. The released configuration and the approval records have to be reconciled before anyone triggers a genuine canary, and a merged workflow is not an accepted lifecycle.

Target disposable-guest lifecycle, labelled as release criteria rather than completed milestones. Five dashed stages run left to right: a genuine queued GitHub job, JIT registration with a unique label per run, a signed host-side attestation of no external NIC behind the jailer and cgroup, isolated execution with no checkout or secrets, and teardown with recovery checks. Three of the five stages are marked still required. A panel lists the acceptance order: a real queued job, a temporary JIT runner removed afterwards, execution verified from the host, and completed-job teardown with lease reconciliation and a clean restart. A second panel explains that commands inside the guest cannot prove what the host attached or will remove. A status bar reads that PR-to-MSI routing remains NO_GO as of 24 November 2026.

None of this can be certified from inside the job. Commands in the guest can describe the guest; they cannot prove what the host attached to it, or what the host will remove afterwards. Guest NIC isolation has to be verified from the protected host-side lifecycle that builds the VM — the namespaces, the cgroup, the interface set and the cleanup path. That is what the release criteria are about, and it is why a green workflow is not the same thing as a proven boundary.

Trust is a routing problem, not a filter

The temptation with self-hosted runners is to add a guard and send everything through. That is the wrong instinct, because a guard is code running inside the thing you are trying to contain.

So the routing is explicit, and it stays explicit through the cutover. Pull requests, forks, unrecognised branches, browser and Playwright jobs, dependency audits — today all of that stays on hosted runners, where the isolation is GitHub’s problem and the VM is discarded after the job. The cutover does not change that rule. It changes where a reviewed pull request would land: in a disposable guest, never on the permanent runner.

The permanent runner executes protected main automatically after the gate passes, plus a founder-dispatched manual pilot. It does not accept pull-request source or forks.

The workflows declare empty or read-only permissions, skip credential persistence, and carry no provider secrets. That is defence in depth, and it is worth doing — but none of it is the isolation. The guest is the isolation, once the guest path is actually accepted.

The machine has to survive being always on

A CI host that sleeps is a CI host that drops jobs, and a laptop-class machine will absolutely try to sleep the moment you close the lid.

So there is a systemd-logind drop-in that disables lid-close, idle, docked and external-power actions, plus persistent masks on the sleep and suspend targets. Masking the targets matters more than the lid setting, because the lid setting only covers the paths logind knows about; the masks stop other software from deciding to suspend on its own.

The verification is not “the config file exists”. It is systemctl is-enabled sleep.target printing masked, and then closing the lid and confirming SSH still answers. And keeping the vents clear, because a machine that never sleeps and never shuts down also never gets a break from being warm.

Networking is where the confidence goes

This is the part of the story that is mostly a lesson.

The host runs Netplan over systemd-networkd, and the documentation says, in as many words, do not migrate it to NetworkManager. That instruction was written after an attempt to do exactly that.

The cutover was scripted to be reversible. It failed anyway: a detached systemd service depended on a file that only existed if an earlier step had installed it correctly. The automatic rollback did its job and the network came back — but it left a stale pending marker behind, and the runbook’s next instruction is not “continue” but “do not restart until that state is reconciled”. A reboot in that condition would have turned a recoverable mistake into a guess.

The decision after that was not “try again more carefully”. It was: stop, keep the working networkd backend, reconcile the stale state before any reboot, and make no further NetworkManager attempts. The runtime fallback for a dead uplink is a separate, opt-in wpa_supplicant path that does not touch the known-good Netplan file at all.

The general rule I took from it: on a headless machine you reach over the network, any network change is a change that can lock you out. The rollback has to be automatic, and the working configuration has to be something the experiment cannot modify. Anything else is hoping.

The health check should not need an open door

The host is checked remotely, and the design constraint is that the check must not put an SSH daemon on the public internet.

I started with Desktop Commander, which is very good at local work, and ran into its allocation limit. The replacement is AI Commander: a small host agent that connects outbound to a relay, so remote management does not require a public SSH listener, a port forward or a VPN. SSH still exists on the local network, where I use it; it is not exposed to the internet.

I am not going to call the check read-only, because the management agent can execute commands. That is what makes it useful, and it is also the honest description of the risk. What is narrow is the use: one machine, a named health command that prints hostname, uptime, systemd state, root disk and address, and an account treated like a credential. The constraint is configuration and scope, not a protocol guarantee.

The property I want is the same either way: reachable for one question, without an open door at the other end.

What this actually costs

I am not going to pretend the trade-offs are free, because they are the whole point of the design.

The host is a single point of failure. If it dies, the trusted lane stops, and no amount of good architecture fixes that. It depends on one internet connection, so the ISP is part of the build system. It has no elastic capacity — a burst of jobs queues rather than scales. It needs physical security, patching and someone who notices when it is unhealthy. That someone is me.

Two lanes also mean two things to maintain. The permanent runner needs a systemd unit, a non-root user, a patching routine and a limit on what it can consume. The guest path needs an image, a lifecycle, a coordinator and an attestation that is worth trusting. Neither is free, and both fail differently.

What it buys is a fixed cost, execution that stays where I put it, no shared tenancy, and a failure mode I can inspect. When something goes wrong I can read the journal on the actual machine instead of opening a support ticket about a VM I cannot see. For a small product that is a reasonable trade. For a team of forty it would be a bad one.

The accounting trap

Here is the part I think most self-hosting posts skip.

The duplicate hosted main job that used to run alongside the gate is gone. That is a verified optimisation: it was removed only after the MSI job had succeeded against the same gate, and only the duplicate. The required validation gate that every pull request still passes stayed exactly where it was. Fewer hosted minutes is a real reduction in hosted workload.

It is not a confirmed monthly saving. Reduced workload is a line in a workflow log; money is a line on a bill, and I have not reconciled that bill. The wider target — moving the expensive browser and audit jobs — is not even routed yet, so any number attached to it would be a guess.

So the measurement has to come before the claim. Which hosted job would have run? Did the self-hosted run actually replace it, for the same source and the same checks? Does the bill agree? Until all three line up, the saving is unverified, and treating it as real is how people justify buying hardware they did not need.

What I would tell someone starting

Start hosted. It is genuinely good, and it is the correct default. Move a specific job to your own host when you can name three things: the job, the trust boundary around it, and the way back if it breaks.

Then cut over one lane at a time. The lane that already has a gate in front of it is the easy one, because the hard question is already answered by something else. The lane that accepts other people’s code is the one that needs a real boundary — and if you cannot describe that boundary without pointing at the workflow file, you do not have one yet.

If you cannot name the rollback, you are not ready to move the job. You are ready to write the rollback.

The machine is not the achievement. The boundary is — and a boundary you cannot explain is not one you have.

Where this stands

As of 24 November 2026, the trusted-main MSI execution path has passed real GitHub Actions acceptance, including parity with the required hosted source gate. The disposable pull-request path has demonstrated important components independently, but its complete authenticated JIT-to-Firecracker execution and teardown lifecycle remains unaccepted. Until that boundary is proven, general pull-request CI stays on hosted infrastructure and the permanent runner remains restricted to trusted work.

If you run self-hosted runners, what did you move first, and what did you deliberately keep hosted? 👇


Share this post on:

Previous Post
AI Forgets My Project And Ships 2004 UI — Two Fixes đź§