Skip to content

S11 - Verification

Purpose: How the requirements are proven: the test layers, what gates a release, and where each area’s test cases are.

Go go test -race, table-driven, and Swift Testing. They run in ci: Go on every host OS (S02-04-goS02-04-go: Go on Three Operating SystemsHow the Go module is checked on macOS, Linux and Windows, and how its tasks run under Windows cmd.exe.), and Swift on macOS (S02-05-swift-contracts-dotnetS02-05-swift-contracts-dotnet: Swift, Contracts and .NETWhere the Swift toolchain comes from, the Swift tasks, the contract tools, and the .NET toolchain to come.).

Every parser that sees guest-controlled bytes has a Go native fuzz target. Where fuzzing is impractical in Swift, property-based tests take its place.

Where an area page names properties for a target, the target checks them, not only that the parser doesn’t crash. ci runs each target briefly as a smoke run (go:fuzz). The task finds the targets itself, and a new target doesn’t need a change to it. CI lists the targets on Linux with the default build tags. A fuzz target belongs in a file without a GOOS suffix or build constraint, or CI never finds it.

The smoke run has a budget of 60 seconds of fuzzing, so ci doesn’t grow with each new target. It fuzzes 4 targets at once. Each target gets an equal share of the budget, at most 5 seconds. With more targets, each one fuzzes for less time. Building the test binaries takes time on top. A target still running at its deadline is killed and fails the run by name. Plain go test already replays every target’s seeds and the failing inputs kept in testdata/fuzz.

ci runs the smoke run locally before each push. CI runs it on a push to main and on a train’s pull request into main, and not on other pull requests (S02-02-ciS02-02-ci: CIHow the CI workflow runs the checks, which jobs a pull request or push skips, and the Go and Swift caches.).

The smoke run is too short to find much that is new. A daily run (go:fuzz-long, the Fuzz workflow) fuzzes every target the same way within a budget of 10 minutes. It also runs locally. CI keeps the fuzz corpus Go builds up ($GOCACHE/fuzz) in its cache between daily runs. Each run starts from what the earlier ones found. A failure prints the input that caused it, which is then kept in the package’s testdata/fuzz.

Adversarial checks run inside a guest against a real wb-netd, wb-proxyd and wb-guestd. Each must fail safely. The cases are on the test case pages, under “Conformance”.

The checks are Go tests in packages/wraithbox-go/conformance/, one package per area, behind the build tag conformance. So go test ./... never runs them. mise run conformance:build compiles each package for the guest, darwin/arm64 for now, into packages/wraithbox-go/.build/conformance/<package>.test. The binary is copied into a test guest and run there. A check that isn’t run in a guest, or not as the user it needs (root, or a standard user outside admin and wheel), skips with a message that says why.

The suite is a release gate for every host and guest combination in the platform matrix (S12-platformsS12-platforms: PlatformsWhich host and guest operating systems Wraith Box targets, how platform-specific code is isolated, what each platform uses, and how wb works inside WSL.). A combination isn’t supported until it passes.

OpenShell’s adversarial end-to-end tests are the first source of further cases. They are in e2e/rust/tests/, and cover bypass detection, L7 proxy bypass, and credential gating.

The benchmarks measure NFR01-startupNFR01-startup: StartupGoals: a warm VM reaches the Claude prompt in about 4 s and a suspended VM in about 7 s, and no start takes more than 10 s (p95), excluding first-time project setup and the first boot after a host restart. and NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage.:

Those CPU figures of X03-network-pathX03-network-path: Network pathA macOS guest boots on the file-handle attachment with the gVisor stack: gets a DHCP lease, resolves only allowlisted names, reaches only the proxy. are for the two together. The spike ran a wb-netd stand-in and a plain HTTP stand-in for wb-proxyd in one process.

The startup and filesystem figures are reported against the NFR01-startupNFR01-startup: StartupGoals: a warm VM reaches the Claude prompt in about 4 s and a suspended VM in about 7 s, and no start takes more than 10 s (p95), excluding first-time project setup and the first boot after a host restart. and NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. goals, with:

  • the host’s conditions: load, FileVault, Endpoint Security agents, chip;
  • the guest’s memory size;
  • whether the state file was in the host’s page cache.

They don’t pass or fail the release gate (“Benchmarks don’t gate the release”).

Each internal/platform interface has one test suite that every OS implementation runs (S12-platformsS12-platforms: PlatformsWhich host and guest operating systems Wraith Box targets, how platform-specific code is isolated, what each platform uses, and how wb works inside WSL.).

C00-indexC00-index: Test casesThe test cases of each area, by test layer: unit tests, fuzz targets, and conformance checks. lists a page of test cases per area, with each case under its test layer:

A spec names the pages that verify it in a **Tests:** line, under its **Requirements:** line (S01-spec-based-developmentS01-spec-based-development: Spec-Based DevelopmentHow the design is written down: the kinds of design documents, their IDs, the spec template, how a spec is split into pages, and how packages are named.).

A change to a spec adds or changes its cases on the page of their area.

  • One case per bullet, under the heading of its test layer.
  • A case says what the test does and what it sees.
  • It names the rule it checks, and the spec section that states it.

These run on hosted runners:

  • Go unit tests, lint, and vet, natively on macOS, Linux, and Windows, with Windows only on a push to main, a pull request from a train into main, and a pull request into a train;
  • Swift, on macOS;
  • the fuzz smoke, on Linux, on a push to main and a pull request from a train into main;
  • and once a day, the daily fuzz run, on Linux.

Which jobs run on which event is in S02-02-ciS02-02-ci: CIHow the CI workflow runs the checks, which jobs a pull request or push skips, and the Go and Swift caches..

CI compiles the conformance suite in its Go build step (conformance:build) and never runs it. A check that stops compiling fails CI. The conformance suite and the benchmarks need machines that can run the guest VMs. Those are Apple Silicon for macOS guests, and nested virtualization or bare metal elsewhere. Hosted runners mostly can’t.

Until v1 is close, tests that need a running macOS guest run on the maintainer’s Mac, outside ci. They are the spikes, the conformance suite, and the benchmarks.

Open questions are spikes, in X00-indexX00-index: SpikesThe open questions that must be answered by a throwaway prototype before work builds on them, in the order they are taken up., each with its result page once answered. What V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. leaves out is in V1-initialV1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there..

Guest tests on the maintainer’s Mac until v1 is close

Section titled “Guest tests on the maintainer’s Mac until v1 is close”

Status: Draft