notes

The continuous fuzzing host: what runs, what it keeps, what it publishes

Name: provisional.

An appendix to notes/fuzzing.md. A dedicated x86_64 machine with KVM runs the two in-guest drivers all the time. The maintainers keep its specification off-tree. This page covers what the repository supplies to it.

What runs

helpers/continuous-fuzz.sh runs four guests at once, two of each driver: the kernel-thread driver (milestone 752 (a seeded system call driver with a shadow model)) and the confined user-mode driver (milestone 779 (fuzz the surface a confined process can reach)). The false-red measurements in rates-on-x86-64-under-kvm.md support four. Raise NIFE_FUZZ_GUESTS only after a measurement at the new size comes back clean.

Each guest slot owns a git worktree and a target/ directory, so two windows never share a build directory. A window builds the x86_64 archive and the system test image once, baking the seed range in at build time, then starts one QEMU process through the PVH runner with -accel kvm and sweeps in that guest. It does not call cargo xtask test, which clears NIFE_ACCEL and boots the OVMF legs under TCG. The driver stops itself after 60 seconds of guest time, so each window costs a rebuild, a boot and one minute of seeds.

Before each window the supervisor checks that KVM is usable: the device exists, the user may open it, and QEMU can start a machine on it. If not, it names the problem on standard error and does not run the window. It never falls back to TCG, which sweeps about a tenth of the seeds per second. helpers/continuous-fuzz.sh --check-kvm runs the same check by hand. Two bounds apply: NIFE_FUZZ_BUILD_BOUND (default 1800 seconds) covers the build, and NIFE_FUZZ_BOUND (default 300) covers the guest, so a window that reaches the second is a hung guest, and the supervisor holds it.

Before it starts any slot, the supervisor installs, or confirms, the toolchain that rust-toolchain.toml pins, once and serially, through helpers/rustup-retry.sh show active-toolchain with the same PATH it uses for everything else, so four slots never download one nightly at once and collide. If the install fails, the supervisor stops with a message that names it, starts no slot and writes no row to windows.tsv. helpers/continuous-fuzz-selftest.sh, run by script/lint, holds this against a stub rustup. Decided by the maintainer 2026-11-01 (UTC), provisional; reversing costs one pull request.

Below NIFE_FUZZ_FREE_FLOOR_GIGABYTES (default 20) free under $NIFE_FUZZ_HOME, no window starts and main is not followed, and the journal says so when the space drops and when it returns. Each slot's target/ is cleared before its first build with a newer pinned nightly, and whenever it passes NIFE_FUZZ_TARGET_CAP_GIGABYTES (default 10), since cargo removes no old artifacts. The maintainer chose both, provisionally.

helpers/systemd/nife-fuzz.service starts the supervisor at boot and restarts it on failure. The supervisor exits non-zero after five windows in a row fail without a finding. A broken build reaches systemd that way instead of looping silently.

Following main

The host updates itself from main with no person pulling, within four limits that an architect ruled on 2026-11-01 (UTC) in fuzz-findings-without-a-person. At most every 5 minutes (NIFE_FUZZ_FOLLOW_EVERY, in seconds; 0 turns it off) the supervisor runs helpers/fuzz-follow-main.py look. It fetches main alone from https://github.com/nifeos/nife.git, with every other protocol refused and no credential helper. It refuses a commit that does not contain the clone's commit. It reads the names of main's required checks from the branch's rules and the commit's check runs from the public API, with no credential. It moves only when each required check has a successful run by GitHub Actions on that commit and none is unfinished or failed. An error or a rate limit keeps the current commit, and the journal says why once.

When look names a commit, each slot stops after its current window. Then apply moves the clone and the supervisor re-executes itself from it, which reruns the toolchain step and moves every slot worktree. A change under helpers/systemd/ is never applied. apply prints one journal line naming the changed unit files, and a person with root installs them as below. The mint helper lives outside the clone, so an update never replaces it.

This runs main's code on the host unattended, as the fuzz account, within about one window of a merge. It widens nothing that account may do. helpers/fuzz-follow-main-selftest.sh, run by script/lint, holds each limit against a scratch upstream and stub API answers. The maintainer chose three details, provisionally; reversing any costs one pull request. The required checks come from main's rules, not from a list in the tree; a run counts only when GitHub Actions made it; and a check whose runs were all skipped is not green.

Replaying a red CI shard

The fuzz-guests job sweeps four shards on every merge-queue entry, and a red shard prints only its commit, its shard and "the fuzz host replays this shard". The host does that replay. At most every 15 minutes (NIFE_FUZZ_REPLAY_EVERY, in seconds; 0 turns it off) the supervisor runs helpers/fuzz-red-shards.py look. It lists the failed merge-queue runs of ci.yml from the public API with no credential, and keeps a run only once the clone's HEAD contains its commit. It then reads that run's jobs and queues each fuzz-guests shard that ended failure or timed_out. A green, skipped or cancelled shard, and a red job of any other name, queue nothing. The commit must also be green by the follower's rule. Then each slot stops after its current window, and the supervisor re-executes itself and replays the queue before any slot starts.

A replay checks the commit out in its own worktree and asks that commit's helpers/continuous-fuzz.sh --ci-range SHARD for the driver and first seed. It then builds and sweeps the range once, as a window does. The host holds a reproduction like any window: its log moves to the held directory, and its windows.tsv row carries the held class and the slot replay. The filer reads both unchanged and files a private advisory. The journal gets one line, the finding id and the time since the shard went red. A clean replay keeps no log and writes one replay-clean row.

Three choices hold this to the host's rules.

helpers/fuzz-replay-selftest.sh, run by script/lint, holds each part against stand-in guests and stub API answers. The maintainer chose the 15-minute poll, the 24-hour patience, the three attempts after an infrastructure failure and the replay-clean row, provisionally; reversing any costs one pull request.

What it keeps

Everything lives under one state directory. windows.tsv holds one row per window: the driver, the slot, the first seed, the seeds run, the time, the status and the commit. A seed replays the same calls every time, so a clean range is its own corpus.

The supervisor holds every window whose status is not ok or infrastructure. Its log moves to a private directory and stays there. The next window for that slot starts one seed past the failing one. The status column of windows.tsv says which kind of hold it is:

The scheduler's thread dump follows the panic that carries the marker, on later lines. It holds neither the marker nor a replay line, so the classification below stays the same.

A budget expiry outranks the other classes. The drivers begin the message of every such failure with budget-expired: (BUDGET_EXPIRED_MARKER in kernel/src/testing.rs, which the supervisor's selftest checks). The supervisor files the window as held-budget-expired whether or not the message also carries a replay: line. That line, when there is one, still sets where the slot resumes and is what the filer replays. The class only keeps a host that stalled apart from a model that disagreed. A real bug can also look like a budget expiry (a region that never reclaims, an actor that never wakes). A replay that fails again at a quiet host is a finding.

What it publishes

helpers/fuzz-daily-publish.sh runs from a daily timer and writes counter totals and a table of clean seed ranges. It reports held findings by count and age only. It never opens a held log. After a held replay the slot's next window starts one seed past the held seed, so the table leaves out every range of a slot from that slot's first held window onward. A finding starts as a private security advisory and stays private until a person publishes it after its fix is on main, or at the latest 90 days after the report. A finding sorted as public at triage is the exception.

Who reads a held finding

The host's duties end at filing. An architect ruled on 2026-11-04 (UTC) that the continuous fuzzer reports each problem and stops. No lane opens, copies, prints or moves anything under the held directory. A plain service on the host, not an agent, files each held finding as a private security advisory on nifeos/nife, holding the finding class and the reproducer. A person works the queue of advisories with the regular lane workflow on a separate fix-lane machine, where a lane reads an advisory and nothing else. The host never replays a fix and never publishes an advisory. Crash inputs, seeds and reproducers stay out of every public text until the fix is on main. An architect ruled this on 2026-11-01 (UTC) in fuzz-findings-without-a-person, which also lists the milestones that build it. The filer is fuzz-filer in nifeos/fuzz-host; it runs as the fuzz account and files from a one-hour token that a root timer mints. Its binary is installed. It files only while fuzz-filer.timer runs, and the heartbeat fails when it does not.

With --publish it creates one GitHub release per day on nifeos/nife, tagged fuzz-YYYY-MM-DD (the UTC date), with report.md and clean-ranges.tsv as its assets: gh release create fuzz-YYYY-MM-DD report.md clean-ranges.tsv. The newest release's date is the heartbeat. A maintainer can delete an old release without touching history, and no clone carries it. An architect ruled this on 2026-11-01 (UTC) in where-the-daily-fuzz-output-goes, which also records the rejected branch of artifacts.

A second run on the same UTC day reads the day's release first. If it holds exactly report.md and clean-ranges.tsv, the run logs that and exits 0, and the release keeps the first report. Any other set of assets, or a view that fails with anything but release not found, makes the run refuse with exit 1. It never deletes, replaces or adds an asset, so a disagreement between runs stays visible and a person decides. Assets match by name, since each run writes a newer report.

The credential is a one-hour installation token of the nife-fuzz GitHub App, which a mint helper on the host makes from the App's private key, readable by root alone. The helper is fuzz-token in nifeos/fuzz-host, and it mints one token per service, each narrower than the App. The App holds Contents write and Repository security advisories write on nifeos/nife alone (ruled 2026-11-01 UTC). the-fuzz-app.md is the runbook for the person who creates it, and it states what the key can do. Main's ruleset requires a pull request and has no bypass actor, so the token cannot push to main; the script calls only gh release view and gh release create.

When the loop breaks

.github/workflows/fuzz-heartbeat.yml runs daily at 17:00 UTC on a GitHub-hosted runner and runs helpers/fuzz-heartbeat.py. It reads the releases of the last two UTC days and opens one issue with the label fuzz-loop-broken when no release exists, when the report shows no ok window, or when infrastructure windows are half or more of all windows. It opens one when the filer looks dead (what it proves about the filer). The issue names the check and the day, and no second one opens while one is open. It repairs nothing. A lane fixes anything in the tree; a repair of the host is a written spec the architect hands to the homelab agent. While no fuzz-* release has ever existed the workflow passes quietly, and it switches on by itself at the first release. The maintainer decides the bound, the label and the two-day window, provisionally; reversing costs one pull request. See the proposal.

Install, for a person with root

A person copies the three files in helpers/systemd/ to /etc/systemd/system/, tells systemd to reread its unit files, then enable --now nife-fuzz.service and enable --now nife-fuzz-publish.timer.

That installs phase 1: the publish unit writes the day's report and clean ranges to local files and publishes nothing. Phase 2 publishes the release. It waits on the key and the installed mint helper, and step P7 of finishing-the-setup.md gives its drop-in. The unit as shipped has no EnvironmentFile=, sets no NIFE_FUZZ_PUBLISH and passes no flag. Before any gh call the script refuses a missing NIFE_FUZZ_PUBLISH=1, a missing token or expiry, and a token within five minutes of expiring. Either way it writes the local files.

The supervisor moves every slot worktree to the clone's commit when it starts, so a restart after a person moves the clone runs every slot at that commit. The clone reaches the commit that carries the follower once, by hand, in step P1 of that page; from then on it follows main by itself.

BUGS