Skip to content

Development

How to build, test, and contribute to instar. See AGENTS.md for conventions and the Claude Code skills, and testing.md for the integration test suite in detail.

Building instar

# Build the main instar project
make instar

# The binaries will be in src/target/release/
sudo src/target/release/instar info <IMAGE>
sudo src/target/release/instar copy <INPUT> <OUTPUT>

Build and dev containers

The build runs in Docker, and there are two devcontainer images:

  • instar-release — a minimal debian:bullseye image (src/.devcontainer/build/Dockerfile) carrying only the toolchain that produces the release artifacts: the C linker, protobuf-compiler, the pinned Rust nightly with rust-src + llvm-tools, cargo-binutils, cargo-deb, cargo-generate-rpm. Used by make instar, make deb, make rpm. It is built on bullseye deliberately: glibc is forward-compatible, so building the host binary against glibc 2.31 lets one artifact run on every distro down to Rocky/RHEL 9 and Ubuntu 22.04 (see installation.md).
  • instar-build — the full Debian dev/test image (src/.devcontainer/Dockerfile, base pinned by digest) with qemu-utils, the libyal parsers, cargo-fuzz, cargo-audit, and gh. Used by everything else: make test, make test-rust, the make test-container* targets, make audit, the fuzz targets, and the VS Code devcontainer.

make clean-devcontainers removes both. To prove the release binary's glibc floor empirically, tools/verify-glibc-floor.sh <deb> <rpm> installs the packages on every target distribution and runs info/create/map under KVM.

Do not bump the release image's base

src/.devcontainer/build/Dockerfile pins debian:bullseye, and that pin is the product rather than an implementation detail: the base's glibc is the floor of every binary we ship, so a newer Debian is a regression dressed as an update. renovate.json excludes the file for that reason; the dev/test image next door stays managed normally.

Two checks back the pin up, because a comment is not a control:

  • tools/ci/check-glibc-floor.sh runs on the line immediately after make instar, in both build-and-test and the release workflow, once per shipped binary — instar by default and instar-fetch by argument — and fails if either references a symbol above GLIBC_2.31 — the floor published in installation.md, not the matrix CI's oldest distro (Rocky 9, 2.34), which is looser than the promise and would let a smaller base movement through unnoticed. It needs nothing but the built binary, so it gates every pull request. The placement is deliberate: the unit test run that follows builds bin targets into the same src/target/release/ from the dev image, so a later check could read a binary that image relinked.
  • tools/verify-glibc-floor.sh is the empirical version above, and remains the real acceptance gate — but it needs containers, packages and /dev/kvm, so it runs in the merge queue matrix or by hand.

The gap between those two is not hypothetical. Renovate raised the base to debian:trixie in #488; the floor went from GLIBC_2.30 to GLIBC_2.39; pull request CI passed completely, because nothing on the pull request path looks at the floor; and the failure surfaced as three red distros in the merge queue after the change was already on develop. The cheap check exists to make that a pull request failure.

bullseye reached end of life: apt is pinned to a snapshot

Debian 11 LTS ended on 2026-08-31 (wiki.debian.org/LTS), and it broke the image within a week, exactly as predicted: not as a glibc change but as an apt-get failure on a runner with no cached instar-release, while every warm runner stayed green. First the deb.debian.org CDN began returning 404 for pool objects the bullseye-security index still advertised (gnupg2, glibc, xz-utils), then the final bullseye-security Release expired at 2026-09-07 21:13 UTC, after which apt rejects the suite outright. See #550.

The decision taken was the snapshot pin. src/.devcontainer/build/Dockerfile still says FROM debian:bullseye, but rewrites /etc/apt/sources.list to a frozen snapshot.debian.org timestamp (ARG DEBIAN_SNAPSHOT, currently 20260901T000000Z — just after the last bullseye-security publication, so the image carries the final security state of the suite) and sets Acquire::Check-Valid-Until "false", because a snapshot serves the historical Release file including its long-past Valid-Until. gpg signature verification stays on; the sources stay http:// because the base ships no ca-certificates and that is the layer installing it. archive.debian.org was not usable: it carries debian/dists/bullseye but still has no debian-security/dists/bullseye-security.

The cost is a build toolchain that no longer receives updates. That is accepted deliberately — the shipped binary's security posture rests on the Rust toolchain (pinned, and bumped weekly by rust-nightly-bump.yml) and on our own code, not on the build image's C library, none of which is linked into the artifact beyond glibc itself.

To move the pin, change DEBIAN_SNAPSHOT only. Do not change FROM debian:bullseye, and do not "fix" a future apt failure by pointing back at deb.debian.org.

Both devcontainer images set Acquire::Retries "3". Pinning to a snapshot removed the 404 failure mode and left the transport one, and if anything raised it: snapshot.debian.org is a single origin behind a CDN, not the deb.debian.org mirror network. A fetch failure here is not an ordinary build failure — the release image is built in the merge queue, and when it fails there it ejects the pull request from the queue (#531). That pull request was docs-only, which had no pull-request run to catch the failure first; a docs-only merge group now skips the build altogether (see "Pull requests versus the merge queue" in testing.md). The occurrence on PR #560 was one object out of 150 dying with a TCP reset ten seconds in, after 125 MB had come down from the same host at 15.3 MB/s, with the next object succeeding. apt retries the failed object rather than the transaction, so a retry costs nothing on a healthy run and still fails promptly against a genuinely missing object. If this class of failure returns despite the retries, the next step is a local caching apt proxy or a BuildKit cache mount over /var/cache/apt, not a longer retry count.

The options that were not taken

No option was free, because "move to the next Debian" is not available: bookworm ships glibc 2.36, above both the 2.31 we publish and the 2.34 the matrix needs, so taking it silently drops Debian 11, Ubuntu 22.04 and Rocky 9.

  • Move to bookworm and narrow the promise to glibc 2.36. This drops Debian 11, Ubuntu 22.04 LTS and Rocky/RHEL 9 — the last of which is in the matrix CI and was the reason the floor was set this low in the first place. It needs installation.md, README.md, MAX_GLIBC in check-glibc-floor.sh, and the matrix distro list all updated together.
  • Change build strategy — a zig cc or cargo-zigbuild style cross-link against an explicitly chosen older glibc, decoupling the floor from the base image entirely. The most work, and the only option that stops this recurring every few years.

Pre-commit hooks

This project uses pre-commit hooks for Rust code quality:

# Install pre-commit (if not already installed)
pip install pre-commit

# Install the hooks
pre-commit install

# Run manually on all files
pre-commit run --all-files

The hooks run rustfmt (formatting) and clippy (linting) on all Rust code via Docker, ensuring consistent tooling regardless of local Rust installation.

Beyond the Rust hooks, pre-commit run --all-files also runs:

  • skillsaw, which lints the agent context — AGENTS.md, CLAUDE.md and the skills and settings under .claude/ — for malformed frontmatter, instructions smuggled into a file an agent is handed, embedded credentials, and dangerous hook or settings configuration. The hook is pinned by rev in .pre-commit-config.yaml and fetches its own environment on first run, so the first invocation after a fresh checkout is slower than the rest. The same hook runs in CI as the Agent context check.
  • actionlint over .github/workflows/, and shellcheck over scripts/ and tools/.
  • docs-line-references, which fails when documentation cites a source line number, in either the file.rs:NNN form or a prose form such as "(line NNN)", "lines NNN-NNN" or "at line NNN" -- spelled with digits, which this page cannot do without tripping the hook that reads it, so the specimens live beside the pattern in .pre-commit-config.yaml. Both spellings rot on the next edit to the code they point into, in a change that never touches the document, and then point at something unrelated; name the function, class or constant instead, or use a permalink pinned to a commit SHA. It covers docs/ (excluding docs/plans/, which records what was true when each phase was planned), README.md, AGENTS.md, ARCHITECTURE.md and the skills under .claude/.
  • binary-sizes, which checks the built binaries against the guest memory layout, and devcontainer-pins, which fails if the two devcontainer Dockerfiles disagree about the Rust nightly or about the version of any cargo tool they both install, if a cargo install line has lost its --locked, or if a version pin has stopped being visible to Renovate. See "Cargo tool pinning" below.
  • no-runtime-luks-create, which fails when a Python or shell file under tests/ mentions encrypt.format=luks or luksFormat, the marks of a test making a LUKS image at runtime. Use the prebuilt qcow2-luks fixture instead; the flake this prevents, and the one exempt file, are explained in testing.md. The ci-tooling job runs the same script.
  • no-changelog, which fails if the tree carries a CHANGELOG.md, CHANGELOG or a case variant of either, at the root or anywhere below it. Release notes go on the GitHub release; see "Releases" below. The script is tools/ci/check-no-changelog.sh, and functional-tests.yml's Check paths job runs it on every pull request, docs-only ones included.
  • no-named-temporary-file, which fails when a Python file under tests/ names NamedTemporaryFile. Use ScratchFile from tests/helpers/scratch.py, which tolerates instar removing a failed run's empty output on every Python; the reason is in testing.md. The ci-tooling job runs the same script.
  • source-size-ratchet, which fails when a source file over 1,500 lines has grown past its entry in tools/source-size-baseline, or has crossed 1,500 without one. See "Source file size" below.

To auto-fix formatting issues:

./scripts/check-rust.sh fix

Source file size

A file that is already too long rarely gets there in one pull request. It grows a few dozen lines at a time, each landing reviewed on its own merits, and none of them is the one that made it large. instar's src/vmm/src/main.rs grew on all nineteen of its landings over the months before this was measured, at a median of 235 lines each: a review scoped to one diff cannot see that, which is why the rule is enforced by a tool rather than by taste.

PUSH-AUDIT.md's source-file-size block is the policy -- what to ask of a long file, and why splitting at a line number rather than at a seam is worse than not splitting at all. The enforcement is tools/source-size-ratchet.py, copied verbatim from shakenfist/development's templates/source-size-ratchet/. The source-size-ratchet pre-commit hook runs it on every commit, and functional-tests.yml's Check paths job runs it on every pull request and merge group. Both, because instar does not run pre-commit run --all-files in CI the way the rest of the fleet does, so the hook on its own would only ever stop a commit by someone who had run pre-commit install.

There is no cap and nothing is ever forced to split. Every tracked source file over 1,500 lines is listed in tools/source-size-baseline with its length. A listed file may stay exactly that long for ever; it may not grow, and no new file may cross 1,500, unless the change that does it also edits the baseline -- a one-line diff a reviewer cannot scroll past -- and says in the pull request description why the file should grow rather than split. Raising an entry is allowed: it is the stated reason the block asks for.

Three things follow that are easy to get wrong:

  • Shrinking needs nothing. An entry higher than its file is not a failure. python3 -I tools/source-size-ratchet.py --update lowers entries that have shrunk and drops files that have gone or fallen under the threshold. It never raises an entry and never adds a file, because that edit is the reviewable decision. --init is for adoption only: run it later and it silently accepts whatever has grown.
  • Never buy lines back by deleting comments or docstrings. The tool counts lines and cannot tell the difference; the block counts that trade as a finding rather than a win.
  • The baseline is not the whole rule. The ratchet's threshold is 1,500 and its extension list is fleet-wide, so it says nothing about a file growing through the 800-line candidate-to-split band, and nothing about workflow YAML. The push audit covers both by hand with tools/audit/source-size.sh; the "In this project" note under source-file-size in PUSH-AUDIT.md is the full division of labour.

tools/source-size-exclude holds the trees the count skips: one glob per line, each with a comment saying why. Only prototypes/ is there, as reference material rather than shipped code. Generated and vendored code belongs there; a hand-written file that is merely long belongs in the baseline, where its length is visible.

Diagrams

Diagrams of structure or flow -- components and the arrows between them, an ordered exchange of messages, a state machine -- are written as fenced mermaid blocks, which GitHub renders natively. Character art that is not a diagram stays in a plain fence: file trees, memory maps, register and bit-field layouts, wire-format byte layouts and captured terminal output all carry their meaning in the column alignment, and mermaid would destroy it. The full policy is the diagram-discipline shared block in PUSH-AUDIT.md.

Mermaid fails at render time rather than at commit time, so a syntax error commits cleanly and then shows an error box on GitHub. Render before you push:

tools/mermaid-lint.sh            # every tracked markdown file
tools/mermaid-lint.sh docs/x.md  # just this one

Check the exit status directly. Piping the script into tail or grep reports the filter's status, not the script's, and turns every failure green. tools/audit/wave1.sh runs it as part of the pre-push audit, and CI runs the same script from mermaid-lint.yml on any pull request that touches markdown, on any push to develop or main that does, and on demand via workflow_dispatch. The lane gates nothing automatically, so without the push trigger a commit that lands without a pull request would go unlinted until it failed somebody else's markdown change. (The template ships both branch names because the fleet's default branch varies; here only develop ever matches.)

mmdc reads exactly one fence: three backticks, then mermaid, then nothing. GitHub renders a wider family, and every shape in between is rejected rather than skipped -- a tilde fence, a space before the language, four or more backticks, and anything after the language such as ```mermaid title=x. The script names the file, the line and what to change. Trailing whitespace after the language is fine; mmdc reads that. Quoting one of the rejected forms in a document is also fine -- a fence nested inside a longer fence is an example, not a diagram, and this paragraph's own page is the case that rule exists for.

Put a diagram at the top level. A mermaid fence inside a blockquote is the one shape that is neither linted nor rejected: GitHub renders it and mmdc finds nothing in the file, so it passes silently. That is a deliberate blind spot rather than an oversight -- refusing one means ruling on a fence nested inside a blockquoted fence -- but it does mean a blockquoted diagram is unchecked.

If this repository ever grows a REVIEWS.md, the script skips it, matching the workflow's path filter: a review session rewrites the file and changes no diagram. Name it as an argument to lint it anyway.

The container runs with --network none, so a diagram that reaches for a remote font or icon pack fails here rather than rendering differently depending on the runner.

Makefile

A Makefile is provided for common development tasks:

# Show all available targets
make help

# List available prototypes
make list-prototypes

Main Instar Project:

# Build instar
make instar

# Clean instar build
make clean-instar

# Show how to run instar
make run-instar

Prototypes:

# Build a specific prototype
make build-prototype PROTOTYPE=virtio-block5

# Build all prototypes
make build-all

# Build the shared guest-protocol crate
make guest-protocol

# Build devcontainer for a prototype
make build-prototype-devcontainer PROTOTYPE=virtio-block5

# Build the rust-lint Docker container
make build-lint-container

Cleaning:

# Clean a specific prototype's target directory
make clean-prototype PROTOTYPE=virtio-block5

# Clean all build directories (main + prototypes)
make clean-all

# Remove all devcontainer Docker images
make clean-devcontainers

# Remove the rust-lint Docker image
make clean-lint-container

# Remove everything (all targets + all containers)
make distclean

Linting:

# Run rustfmt and clippy checks
make lint

# Run with auto-fix
make lint-fix

# Install pre-commit hooks
make install-hooks

Integration Testing:

# Create Python venv for tests (testtools/stestr)
make test-venv

# Run safe integration tests
make test

# Run tests with verbose output (shows diffs)
make test-report

# Run all tests including malicious images (explicit opt-in)
make test-malicious

# Run tests inside container (as CI does)
make test-container

# Run split test targets (used by CI for parallel execution)
make test-container-core              # info, check, security, oslo-crossval
make test-container-convert-qcow2    # QCOW2/VMDK/RAW convert + compare
make test-container-convert-vhd      # VHD/VHDX convert (slowest)

# Clean test artifacts
make clean-tests

Fuzz Testing:

# Build a single coverage-guided fuzz target (uses the devcontainer)
make fuzz-build FUZZ_TARGET=fuzz_resize_planners

# Build every coverage-guided fuzz target
make fuzz-build

# Run a single target for a bounded wall-clock budget (seconds; default 60)
make fuzz-run FUZZ_TARGET=fuzz_resize_planners FUZZ_DURATION=300

# Per-function coverage for one target, to show what it actually reached
make fuzz-coverage FUZZ_TARGET=fuzz_vhd_parent
make fuzz-coverage FUZZ_TARGET=fuzz_vhd_parent FUZZ_COVERAGE_FILTER=locator

# Run the seven snapshot shell harnesses (live differential
# verification against qemu-img; needs a built instar + /dev/kvm)
make snapshot-harnesses

See the "Coverage-Guided Fuzzing" section below for the target list and the nightly CI rotation.

Running:

# Show run instructions for a prototype
make run PROTOTYPE=virtio-block5

What the integration tests cover

The integration tests compare instar info output against qemu-img info to verify drop-in replacement compatibility, validate instar check against deliberately corrupt test images, cross-validate instar compare output against qemu-img compare, and cross-validate instar convert output against qemu-img convert. oslo.utils format_inspector cross-validation tests verify that instar's format detection, safety checks, and virtual size reporting agree with OpenStack's image safety gate. Adversarial image tests verify safe handling of compression bombs, circular/deep backing chains, integer overflow headers, boundary value edge cases (refcount order, oversized virtual sizes, VMDK grain sizes, VHDX dual headers, BAT beyond EOF), and format confusion attacks (polyglot files, truncated headers, VMDK descriptor attacks). CVE reproduction tests verify that 6 known qemu-img CVEs (CVE-2024-32498, CVE-2015-5163, CVE-2022-47951, CVE-2015-5162, CVE-2014-0223, CVE-2024-4467) are fully mitigated by instar's architecture. tests/test_snapshot.py adds 94 snapshot-subcommand tests: the 12-image list matrix against cross-version baselines, 12 JSON golden comparisons with a structural cross-check, mutation round-trips (create/delete/apply) with qemu-img check post-op assertions, error paths and qcow2-only enforcement, and empty-table behaviour. JSON goldens live in tests/golden/snapshot-list/. Test images are in the sibling instar-testdata/ repository.

See testing.md for the full test suite documentation, and testdata/README.md for the test image catalogue (benign, malicious, edge-case, and AFL-discovered images).

Directory structure

instar/
├── .devcontainer/  # Development containers
│   └── rust-lint/  # Stable Rust for linting
├── src/            # Main instar implementation
│   ├── vmm/        # Virtual machine monitor (host-side)
│   ├── core/       # Core guest initialization
│   ├── shared/     # Shared library code
│   ├── crates/     # Shared format parsing crates (no_std)
│   │   ├── qcow2/  # QCOW2 header, L1/L2, decompression, refcounts
│   │   ├── raw/    # MBR/GPT partition table detection
│   │   ├── vhd/    # VHD footer, dynamic header, BAT parsing
│   │   ├── vhdx/   # VHDX headers, region table, metadata, BAT, CRC-32C
│   │   ├── vmdk/   # VMDK4 header and descriptor parsing
│   │   ├── luks/   # LUKS header parsing, KDF, AFsplitter, decryption
│   │   ├── vdi/    # VDI header parsing, block-map lookup
│   │   ├── parallels/ # Parallels header parsing, BAT lookup
│   │   ├── qcow1/  # QCOW1 (v1) header, L1/L2 block-lookup
│   │   ├── dmg/    # DMG koly trailer, chunk-table, chunk lookup
│   │   └── ...     # Per-operation planner crates (measure, create,
│   │               # resize, rebase, commit, snapshot)
│   ├── operations/ # Pluggable operations (info, copy, check, compare, convert, measure, create, resize, rebase, commit, map, snapshot, amend, dd, bitmap, bench)
│   └── build.sh    # Build script
├── crates/         # Shared Rust crates
│   └── guest-protocol/ # Protocol Buffers messaging for guests
├── prototypes/     # Experimental implementations (reference)
│   ├── helloworld/     # Minimal KVM VMM with bare-metal guest
│   ├── helloworld2/    # Same, using rust-vmm vm-memory crate
│   ├── virtio-block/   # Virtio-block device emulation
│   ├── virtio-block2/  # With guest-protocol integration
│   ├── virtio-block3/  # With configurable sector sizes
│   ├── virtio-block4/  # With performance statistics
│   ├── virtio-block5/  # With ioeventfd optimization
│   ├── virtio-block6/  # With sparse/dynamic output support
│   ├── pluggable/      # Modular operations architecture
│   ├── pluggable2/     # Separate binary loading for operations
│   └── info/           # Image format detection (qemu-img info)
├── scripts/        # Build and check scripts
├── tests/          # Integration tests (Python/testtools)
│   ├── base.py         # Base test class
│   ├── manifest.json   # Test image definitions
│   ├── helpers/        # Test utilities
│   └── test_*.py       # Test files
├── docs/           # Design documents and research
│   ├── index.md    # Documentation index
│   ├── usage.md    # Platform usage analysis (oVirt, Proxmox, OpenStack)
│   ├── security.md # CVE analysis for image handling
│   ├── qcow2/      # QCOW2 format documentation
│   ├── vmdk/       # VMDK format documentation
│   └── raw/        # Raw format documentation
├── testdata/       # Test images for security validation
│   ├── benign/     # Safe test images (qcow2, raw, vmdk, vhdx, vpc)
│   ├── malicious/  # CVE exploit images (DANGEROUS)
│   └── downloaded/ # External test images (CirrOS, QEMU iotests, etc.)
├── Makefile        # Build and development automation
├── SECURITY.md     # Vulnerability reporting and security policy
└── README.md

Releases

What the version number promises

instar is on 0.x.y, and the leading zero is the promise: the CLI surface and the format handling may still change between minor versions. A minor bump carries new features or subcommands, a patch bump carries fixes. 1.0.0 is for when both the command-line interface and the format behaviour have settled enough that changing them would need a deprecation rather than a release note -- it is not a maturity badge to be awarded once the feature list looks long enough.

The one version that does not fit the scheme is v0.1, tagged in January 2026 as an internal pre-release with only info and copy and no published binary. The first public release was v0.2.0.

Release notes live on each GitHub release, not in the tree. instar keeps no CHANGELOG.md: a file that every pull request appends to is a merge conflict between every pair of pull requests in flight, and the per-change record is already the commit messages and docs/. The summary a user reads -- what behaviour changed between two versions, one entry for a fix however many commits it took -- is written once, at release time, by whoever cuts the release (step 5 below). The no-changelog hook, which CI runs too, fails if CHANGELOG.md reappears. The notes it kept for 0.3.0 and earlier are still at git show v0.3.0:CHANGELOG.md.

Release artifacts (pre-compiled Linux binaries, plus .deb and .rpm packages) are published to GitHub Releases via the release workflow (.github/workflows/release.yml). Tags are signed with Sigstore.

A release is two steps, because the commit that is tagged must have been through the merge queue: the release workflow refuses to build a commit whose functional-tests.yml merge queue run did not succeed, and a version bump pushed straight to develop has no such run.

  1. Propose. From a clean develop that is in step with origin, run make propose-release VERSION=0.2.0 (or tools/propose-release.sh 0.2.0). It creates a release-0.2.0 branch, sets every crate's version with make set-version, runs pre-commit, the release workflow's own version check and make test-rust, and then asks before it commits Release 0.2.0., pushes the branch and opens a pull request. On N, or on any failure before the push, it deletes the branch and leaves the checkout as it was. Run make audit before proposing: the comment above the audit target in the Makefile says which cargo audit findings block a release and which do not.
  2. Merge. Get the pull request reviewed and land it through the merge queue like any other change, then wait for the queue's functional-tests.yml run on the merged commit to finish.
  3. Tag. Run make tag-release VERSION=0.2.0 (or tools/tag-release.sh 0.2.0). It finds the commit that merged Release 0.2.0., which is the queue's merge commit rather than develop's tip, checks that it carries the version, lists anything that merged after it and so is not in the release, and asks before it pushes the annotated tag v0.2.0. It then watches the workflow run.
  4. Approve. The workflow runs ci-gate, check-version and build, then waits at sign-tag for a reviewer to approve the release environment. After approval it re-signs the tag with gitsign and creates the GitHub release.
  5. Write the release notes. The workflow fills the release body with GitHub's generated list of merged pull requests, which says what merged but not what a user will notice. Write a summary above it from git log --no-merges PREVIOUS_TAG..v0.2.0 (the previous tag, such as v0.1, to this one) and the docs/ pages those commits changed, grouped as Added, Changed and Fixed, and put it on the release with gh release edit v0.2.0 --notes-file NOTES.md, keeping the generated list below it. The first release after 0.3.0 has a draft already: the entries the removed CHANGELOG.md collected under ## [Unreleased], which git show "$(git log -1 --format=%H --diff-filter=D -- CHANGELOG.md)^:CHANGELOG.md" prints.

ci-gate checks that functional-tests.yml succeeded on the tagged commit, in its merge queue run. A run started by hand, as pr-retest.yml does with workflow_dispatch, does not count. How the gate decides is documented with the action, as require-ci-success. It has no override. A commit merged around the queue, by an administrator bypassing it, cannot be released: tag a later commit that went through the queue instead.

The queue merges an entry only once Can merge passes, so a commit that merged through the queue already has a successful run. A queue run that fails, flaky or not, gets its entry ejected, and the commit it built never reaches develop: re-running that run cannot make any tag pass. Re-queue the pull request instead, and tag the commit that merges. Re-running a queue run matters only when the tagged commit's own run was re-run after it merged and that later attempt failed, because the gate judges each run at its latest attempt. Then use "Re-run jobs" on that merge queue run until it succeeds, and re-run the release's ci-gate job.

A gate or version-check failure means nothing was signed or published, so every such failure is recoverable. It shows only as the failed workflow run, which tools/tag-release.sh is watching. The workflow files no issue for it: propose-release.sh and tag-release.sh both check the version before the tag is pushed. The recovery table in the shared release template's README says what to do for each cause; it is the canonical one, and the Rust template's README points to it rather than keeping its own. Where it says to move the tag:

git push origin :refs/tags/v0.2.0   # needs the tag ruleset's bypass
git tag -d v0.2.0
tools/tag-release.sh 0.2.0 <commit that went through the queue>

The "Restrict releases" tag ruleset lets only the repository's admin role create or delete a v* tag, so an admin runs tag-release.sh. It does not stop sign-tag replacing the tag it has just re-signed: ryll's identical ruleset let v0.3.0's sign-tag force-update its tag.

Once sign-tag has run, anyone can check a release tag's signature:

git fetch --tags --force origin
gitsign verify-tag v0.2.0 \
  --certificate-identity-regexp '^https://github\.com/shakenfist/instar/\.github/workflows/release\.yml@refs/tags/v[0-9]' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

The pattern names release.yml running for a version tag, v and a digit: a pattern that stops at the repository would accept a signature from any of its workflows. gitsign has install instructions.

Running release.yml by hand with workflow_dispatch is a dry run: it runs check-version and build, and skips ci-gate, sign-tag and github-release.

The release scripts come from shakenfist/development's Rust release template. tools/tag-release.sh and tools/sign-release-tag.sh are copied from it unchanged, and tools/propose-release.sh and tools/release-version.sh differ only between their --- per-repository settings --- markers, so make changes upstream first. The version the tag must name is src/vmm/Cargo.toml's; make set-version keeps the other crates in CARGO_TOML_FILES at the same version. Bump with it, never with tools/release-version.sh set, which changes only src/vmm/Cargo.toml and would leave the other crates behind.

Distribution channels instar does not use

Each of these was considered when the first public release was put together and deliberately left out. None is blocked on effort alone, so a proposal to add one should start from the reason it is absent.

  • crates.io, for the format crates. Every crate under src/crates/ is marked publish = false. They are not a general-purpose parser API: they expose the bare-metal call-table ABI the guest operations are built against, with the allocation and panic discipline that implies. Publishing them usefully means designing and maintaining a wrapper layer first, which is a project of its own rather than a packaging step.
  • cargo-dist and release-plz. Both model a build that is cargo build on a hosted runner. instar's is Docker plus a pinned nightly plus a bare-metal cross-compile, with the guest binaries converted to flat images and size-checked against the guest memory map, so the parts these tools automate are the parts that are not the hard ones here.
  • A Homebrew tap. instar needs /dev/kvm, so there is no macOS build to tap.
  • musl static builds, and aarch64 packages. Neither is planned. The glibc floor, not linking, is what decides which distributions the release runs on -- see "Do not bump the release image's base" above -- and aarch64 waits on test hardware, since a package built for an architecture nothing in CI can boot is a claim rather than a release.

GitHub automation

This project uses Claude Code-powered GitHub automation for PR management.

Bot commands

Comment on a PR with these commands (requires write access):

Command Description
@shakenfist-bot please re-review Request a fresh automated code review
@shakenfist-bot please retest Re-run functional tests without pushing a new commit
@shakenfist-bot please attempt to fix Attempt to fix failing tests

GitHub issues

The automated reviewer creates GitHub issues for actionable items (fix/document). These issues are linked in the review comment with "Closes #N" syntax, so they're automatically closed when the PR merges.

Workflows

  • Automated Review: same-repository PRs automatically receive code review after CI passes, and GitHub issues are created for actionable items
  • Test Fixing: On-demand test failure resolution via PR comment

Pull requests from forks are not reviewed automatically. The reviewer runs Claude Code with --dangerously-skip-permissions on a runner holding a token with pull-requests: write, and the PR diff it reads is untrusted input, so a prompt injection in a fork's diff could reach a write-capable token. Fork contributions are reviewed by a human instead; asking a maintainer to push the branch to this repository will get it the automated review as well.

The reviewer itself is not defined here. automated_reviewer in .github/workflows/functional-tests.yml is a thin caller which names this project's test jobs in its needs: list -- the "CI passed" gate -- and delegates everything else to shakenfist/actions/.github/workflows/pr-auto-review.yml, which is shared across the Shaken Fist projects.

See .github/workflows/ for implementation details.

Self-hosted runners and Docker

Almost every job in this repository runs on the self-hosted runner pool ([self-hosted, debian-13, ...]), and those runners do not ship Docker. Since instar is built and tested inside the devcontainer image, any job that runs docker, make instar, make test-rust, make lint or any other container-backed Makefile target must install it first. Do not paste an apt block into the workflow -- call the shared installer, after the checkout step that puts it on disk:

    env:
      DOCKER_BUILDKIT: 1

    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Install Docker
        run: tools/ci/install-docker.sh

Anything else the job needs from the same apt run is passed as an argument, which saves a second apt-get update: tools/ci/install-docker.sh qemu-utils.

Omitting the step does not fail at job start -- it fails part way through with docker: command not found, whenever the first container command is reached.

The installer exists because the apt block it replaced was pasted into fourteen steps across six workflows, and the paste is what broke when the fleet moved to debian-13. On bookworm, docker.io shipped one package that was client, daemon and builder; on trixie it is the daemon only, and the other two live in separate docker-cli and docker-buildx packages that docker.io merely Recommends -- which the runners do not install. Each omission has its own failure, and both arrive seconds after a step named "Install Docker" reported success:

  • Without docker-cli there is no /usr/bin/docker at all, and four jobs failed with docker: not found.
  • Without docker-buildx the client is present but cannot build. Every job here sets DOCKER_BUILDKIT: 1, and the docker 26 client implements docker build under BuildKit by delegating to the buildx plugin, so the build refuses to run -- "BuildKit is enabled but the buildx component is missing or broken" -- rather than falling back to the legacy builder.

Neither package exists before trixie, so the installer requires a debian-13 runner.

The one exception is mermaid-lint.yml, which runs on [self-hosted, vm, debian-13-docker, s]. That is the fleet image that ships docker.io, so it needs no install step -- but the label has to be listed in .github/actionlint.yaml or actionlint rejects the workflow.

apt and its locks

A runner can still be running its own apt job (apt-daily, or an unattended upgrade) when a job's first step arrives, and by default apt-get does not wait for a held lock -- it fails at once. That failed integration-convert-vhd on a PR that never touched it, with Could not get lock /var/lib/dpkg/lock-frontend.

So every host-side apt-get in CI goes through tools/ci/apt-get.sh, and so should any new one -- in a workflow step and in an installer script alike:

      - name: Install gitleaks
        run: |
          tools/ci/apt-get.sh update
          tools/ci/apt-get.sh install -y gitleaks

Passing -o DPkg::Lock::Timeout=300 yourself is not the same thing. Measured against apt 3.0.3, the version on the debian-13 runners, that option makes apt wait for the dpkg frontend lock and nothing else: the lists lock that update takes and the archives lock that install takes to download both still fail at once, and those are the two locks apt-daily itself holds. The wrapper passes the option and also retries any command that failed on a held lock, inside one five-minute deadline -- far longer than the competing job takes, and short enough that a genuinely wedged apt still fails the step. tools/ci/test-apt-get.sh checks the retry logic against a fake apt-get.

apt-get run inside a fresh container needs none of this, since nothing else in the container is running apt, and calls it directly.

Distro mirrors and dnf

The container legs have the mirror-image problem, and it is not about locks. Installing a package resolves its dependencies against the distro's repositories -- a local .rpm included, since its Requires have to come from somewhere -- so those legs depend on a third party's metadata being self-consistent at the moment they run. A point release's repodata rotation breaks that: a repomd.xml served from a stale mirror or edge cache names primary and filelists files the mirrors have already deleted, every mirror answers 404, and dnf stops before it has looked at the package at all:

  - Status code: 404 for https://.../9.9/AppStream/x86_64/os/repodata/
      8dad4ae7...-primary.xml.gz
Error: Failed to download metadata for repo 'appstream': ... Cannot
download, all mirrors were already tried without success

Nothing in this repository is wrong when that happens, and it is expensive to be told so: the matrix legs are the last to run, so a 404 in one of them can cost most of a day of queue wait before the ejected pull request can go back.

So every dnf that resolves against a distro repository goes through tools/ci/dnf.sh, which retries that failure with a clean metadata in between -- so the retry cannot be answered from the copy that just failed -- inside one five-minute deadline. The deadline is checked between attempts, so it bounds when the last retry starts rather than when the wrapper returns: an attempt against wedged mirrors is not cut short, and can run past it. Any other failure, an unknown package or an unsatisfied dependency, is returned at once: that is an answer about the package, and retrying it would only make a clear failure slow. tools/ci/test-dnf.sh checks all of that against a fake dnf, including that the wrapper adds nothing to the arguments it is given -- and fails on any dnf in tools/ or the workflows that does not go through the wrapper, unless its line ends in # direct dnf: <reason>.

A rotation deletes packages as well as repodata, and a deleted package is retried too -- but not on the mirror line. librepo reports running out of mirrors as "all mirrors were already tried", which is how a metadata failure ends, while a payload that has spent its allowance of mirror failures ends in the bare transfer error (Status code: 404 for ...), naming no mirrors. So the wrapper also matches the wordings dnf wraps a failed payload in: Error downloading packages: from dnf4 and Failed to download packages from dnf5. That is deliberately broad -- a repository with skip_if_unavailable turns an unreachable mirror into a warning and carries on, so an unrelated failure in the same run can carry a matching line and be retried for the whole deadline. One wasted deadline on a failure that would have failed anyway is the cheaper mistake; tools/ci/test-dnf.sh pins that trade rather than leaving it to a comment.

Two things follow for callers. The wrapper merges dnf's stderr into its stdout, because that is what it matches on, so a caller that captures the wrapper's stdout captures dnf's diagnostics with it -- group an || chain before redirecting it ({ a || b; } >/dev/null 2>&1), since a redirection on a list binds to its last command alone. And where a fallback arm exists at all, give it a short DNF_RETRY_TIMEOUT so that the waiting is paid once per install rather than once per arm.

It has four callers:

  • tools/test-package-install.sh and tools/probe-qemu-versions.sh run dnf inside a container, where the wrapper has to be mounted to be callable; that is what -v "$REPO_ROOT/tools/ci/dnf.sh:/dnf.sh:ro" is for.
  • tools/test-package-functional.sh already mounts the repository at /workspace and calls it from there. dnf loads every enabled repository's metadata on its first transaction, so later calls reuse that, but they still download packages from the mirrors, which a rotation deletes too. So every dnf in the leg goes through the wrapper, the best-effort installs ending in || true included: losing the newer interpreters to a 404 fails the leg later at the Python check, with a message that hides the mirror, and losing qemu-storage-daemon skips the bitmap oracle tests without a word.
  • tools/validate-published-release.sh, the manual release check, finds the wrapper relative to itself, so it only has it when run from a clone. "From a clone" means the script's own resolved directory is the enclosing tree's tools/, not merely that something exists at tools/ci/dnf.sh: a lone copy run from /tmp/foo/ would otherwise resolve the probe to /tmp/tools/ci/dnf.sh and run whatever a local user had left there with sudo already primed. The check compares realpath-derived names rather than inodes, because test -ef follows a symlink planted at /tmp/tools/validate-published-release.sh back to the real file and passes. A lone copy falls back to plain dnf and prints a note saying so, because there a mirror mid-rotation looks like a broken artifact.

The wrapper needs bash, mktemp, tee and grep wherever it runs, which every image in the matrix has.

The deb arms of the same container legs carry the same third-party risk -- a Debian or Ubuntu mirror caught mid-push fails with Hash Sum mismatch, or a 404 for a Packages file its InRelease still names -- and still call apt-get directly. That is deliberate for now, to keep this wrapper about dnf, and is tracked in #955.

Self-hosted runners and the GitHub CLI

The same applies to gh: the [self-hosted, debian-13, ...] runners do not ship it either, so any job that files an issue, opens a PR or otherwise calls the GitHub CLI must install it first. Do not paste an apt block into the workflow -- call the shared installer, which is a no-op when gh is already present:

      - name: Install GitHub CLI on host
        run: tools/ci/install-gh-cli.sh

The [self-hosted, claude-code] and [self-hosted, static] runners do have gh preinstalled, which is why the Claude Code workflows and the comment-triggered bot workflows call it directly. The static case is load-bearing rather than incidental: shakenfist/actions' pr-bot-trigger composite action -- the first step of every @shakenfist-bot please ... workflow across the fleet -- is built entirely on gh api and gh pr comment, so if those runners lacked gh no bot trigger anywhere would work. Instar's own pr-address-comments.yml run 24368074053 (2026-04-13) has that step passing on a static runner.

So the rule is per runner label, not per workflow: add the installer step on debian-13 (and any new pool that turns out to lack gh), and leave the claude-code and static jobs alone.

This one bites late rather than early. The gh call is usually the last thing a job does -- open the PR, file the issue -- so the job burns its full runtime, succeeds at the real work, and then dies on gh: command not found. That is exactly what happened to rust-nightly-bump on 2026-08-24: it validated nightly-2026-08-24, committed it and pushed the branch, then failed the run without opening the PR. Worse, an if: failure() error-reporting step that calls gh silently swallows the report of the original failure when gh is missing.

Merge queue and the develop ruleset

develop is gated by a repository ruleset named "Develop branch" (not classic branch protection — the whole Shaken Fist fleet uses rulesets). It requires merges to go through GitHub's merge queue, which is what runs the seven-distro package matrix; see testing.md for what runs on a pull request versus in the queue.

The configuration is recorded here so it can be recreated if the repository ever is. It mirrors shakenfist/shakenfist's ruleset of the same name:

Setting Value
Ruleset "Develop branch", id 20783686 (created 2026-08-12)
Target refs/heads/develop
Enforcement active
Bypass team shakenfist/sf-can-skip-merge-queue, mode always
Rules deletion, non_fast_forward, merge_queue, pull_request, required_status_checks
Required checks Can enqueue and Can merge (GitHub Actions, integration 15368)
Queue grouping ALLGREEN, max_entries_to_build: 1, max_entries_to_merge: 5
Queue merge method MERGE, min 1 entry, 5 minute wait
Check timeout 360 minutes
Required approvals 0 (dismiss_stale_reviews_on_push: true)

Can merge was added second, and the gap between the two was not theoretical. Can merge only runs on merge_group events, so until a real merge group had executed GitHub had never seen that check context — and requiring a context that has never reported blocks every merge, on a branch that had no protection to fall back to. The ruleset therefore shipped on 2026-08-12 requiring Can enqueue alone, and Can merge was added on 2026-08-15 once the queue had made the context exist.

In between, two PRs merged through the queue without the matrix gating them, because a job that is skipped reports success while a job that never runs reports nothing at all. Can enqueue carries an if test that excludes merge_group, so inside a merge group it skips, reports success, and satisfies the only required check. Both merges followed the same clock: Can enqueue skipped, and GitHub merged the entry thirty one seconds later with the seven-distro matrix still running. #496's matrix then took until 14:10Z to finish, and was green.

493's was not — Rocky 9 went red seventeen minutes after that PR had

already merged, Ubuntu 22.04 and Debian 12 followed, and the Can merge aggregate reported failure seventy five minutes post-merge. The regression it was reporting (the release image's glibc floor) sat on develop until #496 fixed it.

If you are recreating this repository, add both contexts up front only if you can also arrange for a merge group to have run; otherwise reproduce the two-step order above. To add a required context to a live ruleset, transform the exported object rather than PUTting the GET response back unchanged — the response carries fields that are not part of the update schema (id, _links, and "parameters": null on the rules that take no parameters):

gh api repos/shakenfist/instar/rulesets/20783686 | jq '{
  name, target, enforcement, conditions,
  bypass_actors: [.bypass_actors[] | {actor_id, actor_type, bypass_mode}],
  rules: [.rules[]
    | if .type == "required_status_checks"
      then .parameters.required_status_checks
             += [{context: "Can merge", integration_id: 15368}]
      else . end
    | if .parameters == null then {type: .type} else . end]}' > ruleset.json
gh api -X PUT repos/shakenfist/instar/rulesets/20783686 --input ruleset.json

Read it back and diff it against the intent afterwards; dropping bypass_actors from the payload silently removes the bypass.

Two other settings deserve explanation:

  • max_entries_to_build: 1 bounds the cost of the matrix. Only one merge group builds at a time, so the seven-wide fan-out is seven on-demand runners for one PR, not seven per queued PR.
  • The required checks are the two aggregate jobs, never the individual matrix entries. Entry names change whenever the distro list does, and a required check whose name no longer exists blocks every merge permanently. can_enqueue aggregates the pull-request jobs; can_merge aggregates the merge-queue jobs. Both use always() plus an event test so they always report, because a required check that never reports leaves the queue waiting forever.

To inspect or recreate it:

gh api repos/shakenfist/instar/rulesets --jq '.[] | "\(.id) \(.name) \(.enforcement)"'
gh api repos/shakenfist/instar/rulesets/<id>

.github/exported-config/ carries the nightly export of the live ruleset state, which is the machine-readable companion to the table above; the export proposes its updates as pull requests rather than committing directly.

Differential fuzzing

On-demand differential fuzzing compares instar against qemu-img on randomly generated images to find behavioral divergences:

# Run locally (requires instar binary and qemu-img)
python3 scripts/differential-fuzz.py \
    --instar src/target/release/instar \
    --iterations 100 \
    --seed 42

# Trigger via GitHub Actions (workflow_dispatch)
gh workflow run differential-fuzz.yml \
    -f iterations=1000 \
    -f seed=42

The fuzzer generates random images (varying format, size, cluster size, compression, data patterns), runs chains of operations (info, check, convert) against both tools, and reports divergences with full reproduction details.

When libyal tools are available (vmdkinfo, vhdiinfo, qcowinfo), the fuzzer also cross-checks instar output against these independent forensic-grade parsers. This provides a third opinion for QCOW2 (alongside qemu-img) and fills the gap for VMDK/VHD/VHDX where qemu-img check is unavailable.

See scripts/differential-fuzz.py for implementation details.

Coverage-guided fuzzing

Coverage-guided fuzzing uses cargo-fuzz (libFuzzer) to exercise the parser crates directly without the VMM/KVM stack:

# Inside the instar-build container:
cd src/fuzz
cargo fuzz run fuzz_qcow2_header -- -max_total_time=60

44 fuzz targets cover all parser crates (QCOW2, VMDK, VHD, VHDX, VDI, Parallels, QCOW1, DMG, RAW, LUKS) including header parsing, L1/L2 lookup, refcount traversal, and decompression, plus the create / resize / rebase / commit planners, the qcow2 check-repair planners (fuzz_check_repair), the map extent walkers, the snapshot table parser (fuzz_snapshot_parse), the snapshot refcount mutators (fuzz_snapshot_refcount), the dd window math (fuzz_dd_window), CHS geometry rounding (fuzz_chs_rounded_size), windowed read primitives (fuzz_dd_read), and the qcow2-write planner (fuzz_qcow2_write, which drives the write/copy-on-write planner through the crate's sim harness asserting the max_rc < 3 COW invariant oracle, and fuzz_qcow2_write_growth). Seed the corpus from instar-testdata:

python3 scripts/extract-fuzz-corpus.py --testdata /path/to/instar-testdata

The CI workflow runs nightly at 04:00 UTC. Crashes are minimized and filed as GitHub Issues with the security-audit label immediately. See src/fuzz/ for target implementations.

Build and dev containers

The build runs in two devcontainer images: a minimal debian:bullseye release build image (src/.devcontainer/build/Dockerfile, image instar-release) that produces the binary and packages at a low glibc floor, and the full Debian dev/test image (src/.devcontainer/Dockerfile, image instar-build) that runs the test, fuzz, and audit suites. make instar/deb/rpm use the former; everything else uses the latter. See docs/development.md for which target uses which image and why bullseye.

RPM dependency generation

make rpm runs cargo generate-rpm, and src/vmm/Cargo.toml sets auto-req = "auto" so the Requires list is derived from the built binary rather than hand-maintained. "auto" is not one implementation: cargo-generate-rpm uses /usr/lib/rpm/find-requires when that path exists, and otherwise silently falls back to a builtin parser of ldd -v output.

The fallback is broken and must never be taken. The builtin parser strips whitespace out of each ldd -v line, so a weak symbol-version reference — which glibc's ldd renders as libc.so.6 (GLIBC_2.25) [WEAK] — collapses into the dependency libc.so.6(GLIBC_2.25)[WEAK](64bit). No glibc package Provides that string, so the .rpm fails to install on every RPM distro with nothing provides libc.so.6(GLIBC_2.25)[WEAK](64bit). rpm's own elfdeps ignores VER_FLG_WEAK and emits the plain libc.so.6(GLIBC_2.25)(64bit), which resolves normally.

Both container images therefore install Debian's rpm package purely so /usr/lib/rpm/find-requires is present. It is not used to build the package. Do not remove it from either Dockerfile.

This is latent, not theoretical: it only bites when the toolchain starts marking glibc version needs weak. nightly-2026-07-22 emitted Flags: none for GLIBC_2.18/2.25/2.28/2.29/2.30; nightly-2026-08-17 emitted Flags: WEAK for the same five, which took out the Rocky 9, Rocky 10 and Fedora matrix jobs in the merge queue. .deb packaging is unaffected — cargo-deb uses dpkg-shlibdeps. To inspect what a built package actually requires:

rpm -qpR src/target/generate-rpm/instar-*.rpm
readelf -V src/target/release/instar   # Version needs section

Note that this class of breakage is only caught by the distro matrix, which runs in the merge queue rather than in the pull-request gate.

Toolchain pinning

Both devcontainer Dockerfiles pin the same Rust nightly via ARG RUST_NIGHTLY=nightly-YYYY-MM-DD — a broken floating nightly otherwise breaks every from-scratch image build (a 2026-07-24 nightly ICE'd compiling tokio inside cargo install cargo-audit and took out CI's "Build devcontainer" step). Renovate cannot bump rustup toolchain pins; instead the weekly rust-nightly-bump workflow (tools/ci/bump-rust-nightly.sh) rewrites and test-builds both images, then instar and the Rust test suite, then make package, the glibc floor check and an install of each package on the oldest glibc of its family, against the newest published nightly — and opens a bump PR only when everything passes. Do not un-pin the toolchain, and do not bump the pin by hand without at least building both images.

Packaging is part of a toolchain change's blast radius, which is why the validation goes that far. cargo-generate-rpm derives the .rpm's dependencies from the built binary's ELF, so a nightly can change the package without changing a line of our code, and neither building nor testing can see it. nightly-2026-08-17 passed the build and the whole Rust suite, then produced an .rpm requiring libc.so.6(GLIBC_2.18)[WEAK](64bit); nothing provides that, and all three RPM legs of the matrix failed before a test ran (#504). Installing the package is the only step that finds an unsatisfiable dependency, so if you add validation here, add it before the PR is opened rather than relying on the bump PR's own CI. (The lint container is separate and uses a stable rust: tag Renovate does manage; the dev image's Debian base is pinned by digest and Renovate walks it forward.)

Cargo tool pinning

The Rust nightly is not the only thing a from-scratch image build resolves at build time. Both Dockerfiles cargo install their tooling from crates.io — cargo-binutils, cargo-deb and cargo-generate-rpm in both images, plus cargo-fuzz and cargo-audit in the dev image — and those installs are pinned two ways:

  • An ARG <TOOL>_VERSION per crate, so the tool version itself does not float. Each ARG carries a # renovate: datasource=crate depName=<crate> comment directly above it, which a customManagers entry in renovate.json matches. Keep the comment adjacent to its ARG or the pin silently stops being managed. Renovate raises one PR per crate covering every file it appears in, so the dev and build images move together — never bump one file alone.
  • cargo install --locked, so each tool builds against the exact dependency versions its author released it with instead of re-resolving to the newest semver-compatible transitive dependencies.

tools/ci/check-devcontainer-pins.sh enforces both, from pre-commit and from the build-and-test CI job: it fails if the two images disagree about the nightly or about a shared tool version, if any cargo install line has lost its --locked, if a crate is installed at a hardcoded version rather than through its ARG, or if a pin's # renovate: comment is missing, detached, or names a different crate than the ARG. A quoted pin value fails too — renovate.json captures [^\s"]+, so ARG CARGO_DEB_VERSION="3.8.0" would match nothing and freeze silently.

Nothing in the guard is keyed off a list of tool names or a cargo- prefix. The shared set it compares across the two images is the intersection of what they actually install, so a tool added to both later is covered from the day it is added rather than when someone remembers to extend a list; and the Renovate-visibility rules are applied to whatever crates the install lines name, so a dependency whose crate is not called cargo-something gets the same treatment.

The guard also runs the customManagers regex as it is written in renovate.json today over both Dockerfiles, and requires it to find exactly the pins the guard found by its own parse — same crates, same versions, no more and no fewer (tools/ci/check-renovate-manager.py). Without that, the format rules above are only this repository's memory of what Renovate needs: a typo in matchStrings, or a managerFilePatterns entry that stops naming these files, would freeze all eight pins forever while the guard still reported them healthy. A frozen pin is worse than the floating install it replaced, because nothing errors anywhere.

The second is what protects against a broken transitive dependency, and it is not hypothetical: on 2026-09-03 tinyvec 1.13.0 was published with use alloc::vec::{self, Vec}, which shadows the vec! macro so the crate does not compile at all. cargo install cargo-audit picked it up within the hour and failed the "Build and test via devcontainer" step on every PR until upstream shipped 1.13.2. Nothing in the repository had changed. --locked would have held cargo-audit to the tinyvec its lockfile names.

Note the interaction with the Renovate rule that freezes src/.devcontainer/build/Dockerfile: that rule is scoped to the docker datasource, so it still pins debian:bullseye (whose glibc 2.31 sets the floor of the shipped binary) while leaving the crate pins in the same file managed.

Dependency updates

No workflow here runs Renovate. It runs centrally, from shakenfist/development's fleet runner, over every repository in the organisation, and renovate.json extends that repository's renovate-fleet preset. The preset holds the policy shared across the fleet: the schedule (Saturdays, Sydney time, with majors and the grouped "CI tooling" pull request on the first of the month), the 3-day minimumReleaseAge, automerge off, the pre-commit manager, SHA pins for third-party actions, the dependency dashboard and the assignee. The Renovate audit describes the runner, its cadence and the preset's contents.

renovate.json keeps only what is instar's own: the bullseye freeze on the release image's base (see "Do not bump the release image's base" above), the crate groups, and the customManagers entry for the cargo tool pins, which tools/ci/check-devcontainer-pins.sh cross-checks against both Dockerfiles. Local packageRules are applied after the preset's, so they win where the two overlap.

Do not add a .github/workflows/renovate.yml back: two Renovate instances over one repository race on branch creation. If updates seem to have stopped, the dependency dashboard issue shows when Renovate last saw this repository, and the fleet runner's run history in shakenfist/development shows why.

CI tooling guards

The ci-tooling CI job runs the cheap guards over CI's own tooling: the test-partition check below, plus tools/ci/test-report-fuzz-crash.sh, tools/ci/test-pick-fuzz-artifact.sh and tools/ci/test-fuzz-tier.sh for the coverage-fuzz helpers (see "Crash reporting" in docs/testing.md) and tools/ci/test-check-devcontainer-pins.sh for the devcontainer pin guard (see "Cargo tool pinning" above). It is also the job named in automated_reviewer's needs list, which is required to list every job that can fail a PR.

Integration tests are split across several CI jobs by stestr regex selectors (the test-container-* Makefile targets). tools/ci/check-test-partition.sh fails if any test_*.py test is run by no pull-request job. When you add a new integration test module or a new integration job, the guard validates that the new partition still covers everything; an orphan is a hard CI failure. Deliberate exclusions live in an allowlist in tools/ci/check-test-partition.py (currently just the malicious suite). See docs/testing.md.

How automated review works

The review job lives in the shared workflow shakenfist/actions/.github/workflows/pr-auto-review.yml, not in this repository. automated_reviewer in functional-tests.yml is only the caller: its needs: list names this project's test jobs, which is what gates the review on CI passing. The runner, the timeout, the bot-commit check and the fork restriction all live in the shared workflow.

Reviews run on same-repository pull requests only. The reviewer runs Claude Code with --dangerously-skip-permissions while holding a token with pull-requests: write and issues: write, and the PR diff is untrusted input, so a fork PR is skipped rather than reviewed. Fork PRs get a skipped job, not a failing one.

The automated reviewer outputs structured JSON. The shared workflow validates it, creates GitHub issues for actionable items (action=fix or action=document), and posts a human-readable rendering as a PR comment with the raw JSON embedded in a collapsed <details> section. The schema and the renderer live in shakenfist/actions alongside the reviewer.

The review comment includes links to the created issues with "Closes #N" syntax, so issues are automatically closed when the PR merges.

Each review item has an action field: - fix - Must be fixed before merging (creates an issue) - document - Documentation should be added (creates an issue) - consider - Optional improvement (reviewer suggestion) - none - Informational observation only

Workflow Files

  • .github/workflows/functional-tests.yml - Main CI, and the caller for the shared automated review workflow (shakenfist/actions/.github/workflows/pr-auto-review.yml)
  • .github/workflows/release.yml - Release workflow, on a v* tag: the CI gate, the version check, the build, then Sigstore-signed tags and GitHub Releases with pre-compiled binaries (see "Releases" above)
  • .github/workflows/pr-re-review.yml - Manual re-review trigger
  • .github/workflows/pr-retest.yml - Manual retest trigger via bot command
  • .github/workflows/pr-fix-tests.yml - Test failure fixing
  • .github/workflows/test-drift-fix.yml - Scheduled/on-demand test maintenance
  • .github/workflows/differential-fuzz.yml - On-demand differential fuzzing (instar vs qemu-img + libyal)
  • .github/workflows/coverage-fuzz.yml - Coverage-guided fuzzing of parser crates (nightly + PR)
  • .github/workflows/nightly-matrix.yml - The nightly half of the distro matrix: the six heavy VHD conversion tests on all seven distros, plus a full-suite leg that measures tests/stestr-timing.txt and a separate job, holding the only write scopes in the workflow and running no tests, that publishes the refresh. Files an issue when a leg fails, when the refresh fails, and when there was no measurement to refresh from (see "The nightly matrix's timing refresh and failure reporting" in docs/testing.md)
  • .github/workflows/rust-nightly-bump.yml - Weekly devcontainer Rust nightly pin bump (see "Toolchain pinning" above)
  • .github/workflows/codeql-analysis.yml - CodeQL static analysis (push/PR to develop, plus weekly cron)
  • .github/workflows/supply-chain.yml - gitleaks secret scanning on debian-13 (PR/push, plus weekly cron)
  • .github/workflows/agent-context.yml - skillsaw lint of AGENTS.md, CLAUDE.md and .claude/, by running the pre-commit hook (PR and push to develop, both path-filtered)
  • .github/workflows/lint.yml - rustfmt and clippy in the containerised toolchain (PR, path-filtered to the Rust tree)
  • .github/workflows/export-repo-config.yml - nightly export of this repository's GitHub settings for the fleet configuration audit
  • .github/workflows/mermaid-lint.yml - renders every mermaid diagram in the repository's markdown and fails on any that does not parse (PR, push to develop, and workflow_dispatch; path-filtered to markdown)

The self-hosted runners have no Docker preinstalled, so any job touching docker or a container-backed Makefile target needs an "Install Docker" step -- see "Self-hosted runners and Docker" in docs/development.md.

The debian-13 runners have no gh preinstalled either, so any job on those that calls the GitHub CLI needs a tools/ci/install-gh-cli.sh step -- see "Self-hosted runners and the GitHub CLI" in docs/development.md.

Scripts

  • scripts/differential-fuzz.py - Differential fuzzing script (instar vs qemu-img + libyal)
  • scripts/extract-fuzz-corpus.py - Seeds + restores the coverage-fuzz corpus from instar-testdata
  • tools/ci/apt-get.sh - Runs sudo apt-get, waiting for apt's locks rather than failing on them; every host-side apt-get in CI goes through it (see "apt and its locks" above)
  • tools/ci/test-apt-get.sh - Tests for that wrapper against a fake apt-get; the ci-tooling CI job runs it
  • tools/ci/dnf.sh - Runs dnf, retrying a repository-metadata failure rather than failing the job on it; every dnf that resolves against a distro repository goes through it (see "Distro mirrors and dnf" above)
  • tools/ci/test-dnf.sh - Tests for that wrapper against a fake dnf, and that nothing in tools/ or the workflows calls dnf around it; the ci-tooling CI job runs it
  • tools/ci/install-docker.sh - Installs the Docker client and daemon on a self-hosted runner, plus any extra packages passed as arguments (see "Self-hosted runners and Docker" above)
  • tools/ci/install-gh-cli.sh - Installs the GitHub CLI on a self-hosted runner if absent (see "Self-hosted runners and the GitHub CLI" above)
  • tools/propose-release.sh, tools/tag-release.sh - The two release steps: open the version-bump pull request, then tag the commit that merged it (see "Releases" above)
  • tools/release-version.sh - Reads and checks the release version in src/vmm/Cargo.toml; check-version in release.yml and make check-version run it
  • tools/sign-release-tag.sh - Re-signs the release tag with gitsign and force-pushes it; sign-tag in release.yml runs it on a throwaway runner
  • tools/ci/fuzz-tier.sh - Computes tiered nightly per-target fuzz durations, and the fuzzing budget left before the job's deadline
  • tools/ci/test-fuzz-tier.sh - Tests that a plan never sums to more than its budget and that the budget leaves its reserve; the ci-tooling CI job runs it
  • tools/ci/report-fuzz-crash.sh - Files the security-audit issue for a coverage-fuzz crash (bounds the log excerpt, dedups against open issues; see "Crash reporting" in docs/testing.md)
  • tools/ci/pick-fuzz-artifact.sh - Chooses which libFuzzer artifact to report as the reproducer
  • tools/ci/test-report-fuzz-crash.sh, tools/ci/test-pick-fuzz-artifact.sh - Tests for those two; run them after any change (the ci-tooling CI job does)
  • tools/ci/check-fuzz-targets.sh - Fails if the three places a fuzz target has to be registered by hand disagree: the .rs file under src/fuzz/fuzz_targets/, the [[bin]] stanza in src/fuzz/Cargo.toml, and the TARGETS=(...) array in coverage-fuzz.yml. It also fails if coverage-fuzz.yml's FUZZ_DEADLINE is computed from a different number of minutes than the job's timeout-minutes, which GitHub cannot read back at runtime. A target absent from that array is never fuzzed in CI at all, silently, while its row in docs/testing.md keeps claiming it is. FAST_TIER in fuzz-tier.sh is checked as a subset, since an unlisted target legitimately defaults to the deep tier
  • tools/ci/test-check-fuzz-targets.sh - Tests for the registration guard, against a synthetic four-target tree; the ci-tooling CI job runs it
  • tools/ci/check-doc-phrases.sh - Fails if any tracked file contains a plan filename mangled by a bad automated replace that spliced the word "work" into it; seven of these in docs/testing.md were repaired by hand, and a further 17 had spread to other pages before anything checked. It decides by rejoining the text either side of " work" and asking whether that names a file in docs/plans/, so it catches a splice at any offset and cannot false-positive on a real English continuation like "PLAN-differencing workflow", which rejoins to nothing. docs/plans/ and tools/ci/ are exempt: the plan pages quote corrupted phrases verbatim as examples when describing the bug, and this guard's own tests build fixtures carrying the pattern on purpose
  • tools/ci/test-check-doc-phrases.sh - Tests for that guard, including that it does not false-positive on legitimate strings like "the PLAN-map work" or "PLAN-differencing workflow"; the ci-tooling CI job runs it
  • tools/ci/check-no-runtime-luks-create.sh - Fails if a Python or shell file under tests/ mentions encrypt.format=luks or luksFormat: a test that makes a LUKS image at runtime hits qemu-img's key-derivation timing flake in the merge queue (#905), so tests use the qcow2-luks fixture. It matches the option rather than a command shape, which has no bypass but means a file that only mentions it is exempted by name in the script; tests/test_measure.py is the one. Runs as the no-runtime-luks-create pre-commit hook and in the ci-tooling CI job
  • tools/ci/test-check-no-runtime-luks-create.sh - Tests for that guard: the two argv lists the fixture conversion deleted, a ] inside the list, cryptsetup luksFormat, the exemption holding only for its named file, and a git failure exiting 2 rather than reading as clean; the ci-tooling CI job runs it
  • tools/ci/check-no-changelog.sh - Fails if any tracked path is a CHANGELOG.md or CHANGELOG in any case, at any depth (see "Releases" below). Runs as the no-changelog pre-commit hook and in functional-tests.yml's Check paths job, which every pull request runs
  • tools/ci/test-check-no-changelog.sh - Tests for that guard: the root file, a nested one, no extension, another case, and names that only contain the word; the ci-tooling CI job runs it
  • tools/ci/check-no-named-temporary-file.sh - Fails if a Python file under tests/ names NamedTemporaryFile: a failed convert, dd or copy removes the empty output it created (#849), and on Python 3.10 and 3.11 the stdlib's cleanup then raises, which only the merge queue's older-Python legs see (#959). Tests use ScratchFile from tests/helpers/scratch.py, the one exempt file. Runs as the no-named-temporary-file pre-commit hook and in the ci-tooling CI job
  • tools/ci/test-check-no-named-temporary-file.sh - Tests for that guard: the refused-convert shape #959 was about, an import by name, a helper module, every hit counted, the exemption holding only for its named file, code outside tests/ not read, and a git failure exiting 2 rather than reading as clean; the ci-tooling CI job runs it
  • tools/source-size-ratchet.py - Fails when a tracked source file over 1,500 lines has grown past its entry in tools/source-size-baseline, or has crossed 1,500 with no entry. Copied verbatim from shakenfist/development's templates/source-size-ratchet/ and not to be edited here; tools/source-size-exclude is this repository's own, and holds prototypes/. Runs as the source-size-ratchet pre-commit hook and, because instar does not run pre-commit run --all-files in CI, also as a step of functional-tests.yml's Check paths job, which every pull request and merge group runs. See "Source file size" above
  • tools/check-no-capability-claims.py - Fails, naming the line, if anything in the tree claims instar cannot read or compose a differencing image; five operations compose one, so the claim is false wherever it is made. It reads flattened paragraphs across src/**/*.rs, tests/**/*.py, docs/**/*.md, tools/**/*.py and scripts/**/*.py, so a sentence wrapped mid-phrase and one inside an assertion message are both caught. docs/plans/ is exempt: it records what was true when each phase was planned. --self-test checks the pattern against the nine forms it must and must not catch, plus that the globs still read the tree from any working directory; the ci-tooling CI job runs both
  • tools/ci/check-stestr-run.sh - Decides whether a stestr run is a result at all: a worker lost to the subunit >4MB packet-size limit, a worker reported with N/A elapsed, a missing totals block, a run shorter than its own discovery count, and a selection in which every test skipped all exit 0 with a totals block that reads like a pass. Takes the output file and the discovery count, the count either as a number or as in-output to read the selection contains N tests line the run printed; the count is mandatory, because the one caller that could omit it did, and a count of zero is refused in either spelling, because a selection that matched nothing clears every floor there is. It expects one run per file and refuses a file holding two totals blocks, because every number it reads is the last one in the file. The integration-core and two integration-convert-* CI jobs and tools/test-package-functional.sh all call it, so every job that runs a stestr selection shares one implementation
  • tools/ci/test-check-stestr-run.sh - Tests for that guard against totals blocks in the shape stestr really prints, including that a legitimate run with many skips still passes; the ci-tooling CI job runs it
  • tools/verify-info-output-parity.sh - Builds the merge-base's instar as well as this tree's and requires byte-identical instar info output over every differencing fixture, which is how a parser change proves it left behaviour alone. The push audit's wave 1 runs it when the audit scope touches src/crates/vhd/, src/crates/vhdx/ or the script itself -- a scope resolved by audit_scope_parity_names in tools/audit/audit-scope.sh, so tools/audit/test-audit-scope.sh can assert that the pattern selects those files out of a real scope rather than out of a copy of itself -- and skips it out loud when there is no merge-base to compare against. The scope is narrower than the risk by decision: an info-path change can alter the output without matching, and PUSH-AUDIT.md says so rather than letting a green wave 1 imply otherwise. A change that means to alter info output will fail it
  • tools/fuzz-coverage.sh - Per-function coverage for one fuzz target, via make fuzz-coverage (see "Coverage-Guided Fuzzing" in docs/testing.md). Calls llvm-cov directly because cargo cov panics on cargo-fuzz 0.12
  • tools/ci/test_differential_fuzz_issues.py - Tests that the differential fuzzer files one issue per divergence shape, capped at --max-issues, and does not report a failed filing as filed. Run with python3 -m unittest; the ci-tooling CI job does
  • tools/ci/test_differential_fuzz_oracles.py - Tests that the differential fuzzer refuses to run with a libyal oracle missing when INSTAR_REQUIRE_LIBYAL is set, names the tool, package and affected formats when it does, and still degrades gracefully without the variable. Run with python3 -m unittest; the ci-tooling CI job does
  • tools/ci/test_extract_fuzz_corpus.py - Tests the corpus seed builders in scripts/extract-fuzz-corpus.py: that a fixture carrying a hostile locator offset cannot abort the nightly seeding run, and that the defect it carries survives the reshape. Run with python3 -m unittest; the ci-tooling CI job does
  • tools/ci/check-glibc-floor.sh - Fails if a built binary needs a glibc above the published floor (GLIBC_2.31, Debian 11; see docs/installation.md). Takes the binary as its first argument and defaults to instar, so each shipped binary needs its own invocation: both call sites check instar and then src/target/release/instar-fetch, which the packages and the release tarball also carry. Runs immediately after make instar in both build-and-test and the release workflow. Do not raise the ceiling to make it pass: it means the release image's base moved, and src/.devcontainer/build/Dockerfile must stay on debian:bullseye
  • tools/ci/test-check-glibc-floor.sh - Tests for that check; the ci-tooling CI job runs it
  • tools/ci/claude-result.sh - Reads the JSONL stream a claude -p --output-format stream-json --verbose run leaves behind; --text reconstructs the assistant text (plus a diagnostic block when the run reported an error or the stream was truncated), --trailer emits the Assisted-By:/Co-Authored-By: pair naming the model the run actually resolved to. Called from test-drift-fix.yml
  • tools/ci/test-claude-result.sh - Tests for that helper; the ci-tooling CI job runs it
  • tools/ci/resparsify-testdata.sh - Restores the sparse holes git and git-lfs fill with zeros, over downloaded/ and the five whole-disk image extensions only. Reached through resparsify-prepared-testdata.sh after prepare-testdata.sh in every job that runs the Python suite over the tree (not coverage-fuzz.yml, which compares no allocated sizes), and is also fetched over HTTPS and run by private-ci's testdata image build, which makes its one-argument-whole-tree call a cross-repository interface (see "Test Data Location" in docs/testing.md). Further optional arguments narrow it to named files or to a --files-from list, for a tree that is a copy-on-write overlay of an already-sparse image; --list-extensions publishes the extension list so a caller filtering its own list cannot carry a second copy
  • tools/ci/test-resparsify-testdata.sh - Tests for that script in private-ci's calling convention, measuring allocated blocks rather than trusting the exit status -- on the files a narrow run did not name as well as the ones it did; the ci-tooling CI job runs it
  • tools/ci/test-prepare-testdata.sh - Tests for prepare-testdata.sh's branches, the TESTDATA_SOURCE and TESTDATA_CHANGED_FILES it exports, and all three states of the TESTDATA_REQUIRE_CACHE guard -- the refusal with the cache absent, the ordinary job proceeding with the cache present, and an unrecognised value being an error rather than a silent "off". git is stubbed and TESTDATA_CONTRACT_CACHE relocates the contractual path, so it needs no token, network, testdata or testdata disk, and no case in it is skippable; the ci-tooling CI job runs it
  • tools/ci/test-testdata-changed-files.sh - The other half of that one, against a real git over local bare repositories: proves the changed-file list names every path the update's reset --hard rewrote, including the entries that were already stat-dirty because the disk build resparsified them and that no diff of the two trees reports. The stub cannot show which paths git picks, and that choice is what the narrow resparsify rests on; the ci-tooling CI job runs it
  • tools/ci/resparsify-prepared-testdata.sh - The workflow step between prepare-testdata.sh and resparsify-testdata.sh: reads TESTDATA_SOURCE and TESTDATA_CHANGED_FILES and calls resparsify-testdata.sh in whichever form the prepared tree needs -- the whole tree for a fresh clone or a cache the job did not vouch for, only the paths the update changed for the fleet's testdata disk updated in place. test-prepare-testdata.sh feeds it what each of prepare-testdata.sh's branches exports, so a rename on either side fails there. An unset or unrecognised source is an error, never a fall back to the whole tree, because the fallback is the expensive branch. The decision cannot live in resparsify-testdata.sh, which reads no environment variable by cross-repository contract, and seven copies of it in YAML would drift with no symptom. test-and-fix in test-drift-fix.yml is the eighth job that resparsifies and does not use this wrapper: its workflow comes from the default branch while its scripts come from the pull request's checkout, so it stays on the one-argument form that exists on every branch
  • tools/ci/test-resparsify-prepared-testdata.sh - Tests for that step, measuring allocated blocks on the files a run was not supposed to touch as well as the ones it was; the ci-tooling CI job runs it
  • tools/ci/seed-stestr-timing.sh - Loads the committed tests/stestr-timing.txt into a fresh stestr repository before stestr run, so the scheduler bin-packs its workers by measured duration instead of splitting the suite round-robin. A missing or unusable file is not an error (see "The nightly matrix's timing refresh and failure reporting" in docs/testing.md)
  • tools/ci/generate-stestr-timing.py - Derives that file from a stestr repository's recorded durations; it must never be hand-maintained
  • tools/ci/compare-stestr-timing.py - Decides whether a fresh measurement moved materially, in shares of the suite's weight because bin packing is scale-free; exits 0 material, 10 immaterial, 1 error. Also the publication path's validation: a measured test id outside a conservative charset stops the refresh rather than being dropped, because the ids reach a pull request body and the committed file
  • tools/ci/fetch-previous-stestr-timing.sh - Downloads the most recent earlier night's stestr-timing artifact from the nightly workflow's runs on the same branch, skipping the current run and any night whose measure job did not succeed; leaves nothing and exits 0 when there is none or the API fails, so the publisher falls back to one night's evidence rather than the job failing
  • tools/ci/publish-stestr-timing.sh - Opens or updates the one long-lived timing-refresh pull request when a material move has also persisted: with --previous, the measurement must be immaterial against the previous night's, and both must be material against the committed file, which holds back a single contended night (its header records the three-night oscillation that made this necessary). Never pushes to develop, assigns nobody unless TIMING_PR_ASSIGNEE says so, and the same header records why the pull request it opens needs a maintainer to approve its checks
  • tools/ci/report-nightly-matrix-failure.sh - Files or updates the test-failure issue for a failed nightly leg, naming the distro and the failing tests, with separate deduplication keys for a failed timing refresh and for timings that could not be refreshed at all
  • tools/ci/test-seed-stestr-timing.sh, tools/ci/test-generate-stestr-timing.sh, tools/ci/test_compare_stestr_timing.py, tools/ci/test-fetch-previous-stestr-timing.sh, tools/ci/test-publish-stestr-timing.sh, tools/ci/test-report-nightly-matrix-failure.sh - Tests for those six; the ci-tooling CI job runs them all
  • tools/mermaid-lint.sh - Renders every tracked markdown file that contains a mermaid fence, in the upstream mermaid-cli container (see "Diagrams" above); mermaid-lint.yml and the push audit's wave 1 both run it

📝 Report an issue with this page