S11 - Verification
Purpose: How the requirements are proven: the test layers, what gates a release, and where each area’s test cases are.
Design
Section titled “Design”Unit tests
Section titled “Unit tests”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.).
Fuzzing
Section titled “Fuzzing”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.
Conformance suite
Section titled “Conformance suite”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.
Benchmarks
Section titled “Benchmarks”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.:
- Time to the Claude prompt: warm, suspended, and cold boot. The suspended case restores a state saved after a Claude Code session and a build, not an idle guest. It records the state file’s size (X02-warm-startX02-warm-start: Warm startMeasure time to restore a macOS guest from saved state with a vsock device and a file-handle network attachment.).
npm ciwith the dependency gate on,git statuson a large repository, and an incremental build on the data disk. Each is compared with the host.- Throughput of a large download through the gateway, with the CPU time
of
wb-netdandwb-proxyd. It is compared with the 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. at the same MTU.
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”).
Platform contract tests
Section titled “Platform contract tests”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.).
Test cases
Section titled “Test cases”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:
- C01-network-and-dnsC01-network-and-dns: Network and DNSThe test cases for the guest's network path: the link endpoint, addressing, and the DNS gateway with its hold, quiet refusals, and negative answers.
- C02-streams-and-tlsC02-streams-and-tls: Streams, TLS, and the Inspection CAThe test cases for the streams wb-proxyd takes over: the hand-off from wb-netd, the first-byte and TLS checks, upstream addresses, the HTTP request form, and the inspection CA's leaves, rotation, and keys.
- C03-policy-and-approvalsC03-policy-and-approvals: Policy and ApprovalsThe test cases for network policy: loading it, combining the policies of the projects in one VM, modes per host, profile parts, learn mode, and the approval flow.
- C04-projectsC04-projects: ProjectsThe test cases for project identity: which repository a session belongs to, what happens when a repository moves, is cloned again or changes its remote, and the project commands.
- C05-credentials-and-storeC05-credentials-and-store: Credentials and the Secret StoreThe test cases for the secret store and its callers, the signing setup that gives development builds their Keychain groups, and the credential checks wb-proxyd makes on guest requests and server responses.
- C06-model-apiC06-model-api: Model APIThe test cases for the model credential: its placeholder, the scan for the placeholder in whole requests, what is injected on the model API, the event log, and Claude Code end to end.
- C07-dependency-gateC07-dependency-gate: Dependency GateThe test cases for the dependency gate: registry paths, minimum age and known vulnerabilities, the Go checksum database clock, and Homebrew bottles from ghcr.io.
- C08-gitC08-git: GitThe test cases for the git round trip: the transport, the pack scanner and the pre-receive check, git's own limits behind them, and the data scope of what a session gets from the host repository.
- C09-guest-and-sessionsC09-guest-and-sessions: Guest and SessionsThe test cases for what a project user can reach inside the guest, wb-guestd's update and the guest clock, the shared toolchain prefix, the guest admin password, and the session lifecycle.
- C10-terminalC10-terminal: TerminalThe test cases for the terminal filter in wb, which stands between the guest's output and the host terminal.
- C11-host-daemonsC11-host-daemons: Host Daemons, Audit, and DisksThe test cases for the host daemons' own checks: wb-vmd's device set and slots, the image build bundle, supervision, the accounting and event channels, the daemon log pipes, the audit writer, free space, and the data…
- C12-install-and-downloadsC12-install-and-downloads: Install and DownloadsThe test cases for installing and upgrading Wraith Box: wb-download, wb-release-check, the checks wb-hostd makes on what it fetches, wb setup, and the migrations of state.db and configuration.
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 intomain, and a pull request into a train; - Swift, on macOS;
- the fuzz smoke, on Linux, on a push to
mainand a pull request from a train intomain; - 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.
- Agents may build issues that need a guest. The
needs-vmlabel marks them. - A wave runs at most one such builder at a time. That keeps the Mac
within NFR05-two-macos-vmsNFR05-two-macos-vms: Platform limitmacOS permits at most two concurrently running macOS guests per host. (
docs/agents/orchestration.md). - The runner question is revisited near v1.
Open questions
Section titled “Open questions”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..
Decisions
Section titled “Decisions”Benchmarks don’t gate the release
Section titled “Benchmarks don’t gate the release”- Why: filesystem results vary more between hosts than the gap they would judge.
- Decided: I19I19 (closed): X05-fs-benchmark: Filesystem benchmarkHow does the data disk perform with default versus relaxed write-through settings, against the host, on the NFR02-fs-speed workloads? and I111I111 (closed): NFR00-index: write the performance requirements as goals, like NFR02-fs-speedX18-vsock-handoff measured a cold boot to wb-guestd at 10.93 s (p50) and 13.48 s (p95), against the 10 s hard ceiling (p95) of NFR01-startup (#86)..
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