S10 - Technology Choices
Purpose: Fix languages, libraries, packaging, and repository layout, with the reason for each choice.
Requirements: NFR04-host-platformsNFR04-host-platforms: Host platformsFirst target: Apple Silicon, macOS 27 or later, because wb image build needs the guest provisioning options that are new in macOS 27 (X17-image-build)., NFR07-maintainabilityNFR07-maintainability: MaintainabilityMost code is cross-platform Go., NFR08-licensingNFR08-licensing: LicensingApache-2.0; dependencies under permissive licenses only., SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts., FR17-same-everywhereFR17-same-everywhere: Same on every hostThe same wb commands, flags, policy files, and behavior on every host OS..
Design
Section titled “Design”| Page | What it covers |
|---|---|
| S10-01-librariesS10-01-libraries: LibrariesThe libraries and programs Wraith Box uses, and their licenses. | The libraries and programs Wraith Box uses, and their licenses |
| S10-02-packaging-and-signingS10-02-packaging-and-signing: Packaging and SigningHow Wraith Box is packaged and signed on each host, and the one version every build stamps. | The app bundle, helper bundles, signing, other hosts, and the build version |
Languages: Go first, native where needed
Section titled “Languages: Go first, native where needed”Most of Wraith Box is Go, and the same on every host OS. A platform-native language is used only where Go cannot reasonably reach a platform API. It then runs in a separate process with a gRPC contract (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.).
| Component | Language | Reason |
|---|---|---|
wb |
Go | One static binary per OS with millisecond start-up; mature PTY and terminal handling; the same CLI everywhere |
wb-hostd |
Go | Sessions, policy, approvals, audit, and the git gateway are platform-independent logic |
wb-netd, wb-proxyd |
Go | gVisor’s network stack is Go; strong standard TLS/HTTP/HTTP2 libraries; built-in fuzzing for the parsers that face the guest |
wb-guestd, git-remote-wb |
Go | One code base for macOS, Linux, and Windows guests; PTY, vsock, and user management |
wb-vmd on Windows and Linux |
Go | HCS and Hyper-V sockets have Go bindings; Linux VMMs are driven over sockets and processes |
wb-vmd on macOS, macOS notification helper, macOS guest Network Extension (S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection.) |
Swift 6 | First-class access to the Virtualization framework (macOS guests, save/restore, file-handle network attachment), to notifications, and to the Network Extension provider classes |
| Windows notification and tray helper (later) | C# (.NET) | Native Windows notifications with actions |
No other language is added without a spec change.
Repository layout
Section titled “Repository layout”packages/ wraithbox-go/ Go module: cmd/{wb,wb-hostd,wb-netd,wb-proxyd,wb-guestd,wb-vmd}, internal/… internal/platform: host/guest matrix and per-OS interfaces (S12-platforms) internal/gen/wraithbox/<area>/v1: generated code for every .proto package wraithbox-swift/ SwiftPM package: WraithBoxVM library, wb-vmd executable (macOS) Sources/wb-dev-bundle: test tooling, never in the app bundle Sources/WraithBoxRPC: generated code for wraithbox.vmd.v1 only WraithBox.xcodeproj, App/: the app target of Wraith Box.app (S17-01-bundle) wraithbox-dotnet/ .NET solution for Windows-native helpers (when the first one is built) wraithbox-doc/ documentation siteproto/ .proto contracts shared by every language: wraithbox/<area>/v1/<area>.protobuf.yaml buf module and lint and breaking rules for proto/buf.gen.yaml Go generation; buf.gen.swift.yaml: Swift generationdocs/spec/ specifications (this directory)Generated contract code
Section titled “Generated contract code”The code generated from proto/ is committed (B52-proto-contractsB52-proto-contracts: How are the gRPC contracts between the processes written, generated, and checked?Recommended to commit generated code, made by pinned local plugins and checked in CI for drift and breaking changes.).
So a fresh clone builds with go build and swift build alone, on
every OS.
mise run proto:generatewrites the Go code, andproto:generate-swiftthe Swift code on macOS. Nobody edits it by hand.mise run proto:checkrunsbuf lintandbuf breakingagainstmain, and fails when the Go code differs from whatbuf generatemakes.proto:check-swiftdoes the same for the Swift code. Both are part oflint.- Every plugin is local, never
remote:. The Go plugins aretoollines ingo.mod. The Swift plugins are built from the Swift package’s pinned dependencies. - The generated files record the plugin versions. So a bump of
protoc-gen-go,protoc-gen-go-grpcor the Swift plugins’ packages needsmise run proto:generateorproto:generate-swiftin the same change, or the drift check fails. - cspell and SwiftLint skip the generated paths.
swift formatskips the generated files, which sayswift-format-ignore-file. golangci-lint skips generated Go files. - Only
wraithbox.vmd.v1has Swift code, becausewb-vmdis the only Swift process that serves or calls a contract.
cmd/wb-vmd in the Go module builds for Windows and Linux. On macOS,
the binary of that name comes from the Swift package.
Test tooling
Section titled “Test tooling”Some programs exist only to develop and test Wraith Box. They are never in the app bundle (S17-01-bundleS17-01-bundle: The BundleWhat a Wraith Box bundle holds, and how mise run build builds and signs it.), and no product program links their code. They are held to the same gates as the product code.
| Program | Language | What it does |
|---|---|---|
wb-dev-app |
Go | Builds the app bundle’s Go half, runs its check, and installs it (mise run app:*) |
wb-dev-bundle |
Swift | Makes, clones, provisions, stops and removes macOS test bundles in the spike cache (mise run vm:*) |
wb-dev-vm |
Go | Starts the signed wb-vmd as wb-launcher is to, boots the bundle in the work slot, and runs wb-guestd’s hello or relays a local socket to a guest port below 1024 |
wb-dev-vm lets VM spikes and needs-vm work reach their guest code
through wb-vmd’s hand-off. It runs one VM at a time
(NFR05-two-macos-vmsNFR05-two-macos-vms: Platform limitmacOS permits at most two concurrently running macOS guests per host.), and the bundle has to be in the work slot before
it starts. mise run go:build ::: swift:sign builds it with the same stamp
as wb-vmd, because wb-vmd refuses a peer of another build version.
wb-dev-bundle comes from the X18-vsock-handoffX18-vsock-handoff: Host-guest socket and descriptor hand-offCan wb-guestd, written in Go, open AFVSOCK sockets in a macOS guest? host tool, and
mise run vm:build signs it ad hoc with spikes/vm.entitlements. It
accepts paths only in ~/Library/Caches/wraithbox-spikes/. Its
provisioning boot gives a test guest an SSH user and Remote Login on
Apple’s NAT network, which no product guest gets (SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable.).
The page docs/agents/host-work.md says how agents use it.
Platforms
Section titled “Platforms”See 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. for the host/guest matrix. v1 is Apple Silicon, macOS 27 or later, with macOS guests (NFR04-host-platformsNFR04-host-platforms: Host platformsFirst target: Apple Silicon, macOS 27 or later, because wb image build needs the guest provisioning options that are new in macOS 27 (X17-image-build).). The image build needs macOS 27 in the guest as well (S06-02-image-buildS06-02-image-build: Image BuildHow wb image build makes a guest image: the build VM, its two provisioning stages, terminfo, sealing, and storage.). Above that, the guest image’s macOS version is independent of the host’s, within what the Virtualization framework supports.
Quality gates
Section titled “Quality gates”- Go:
gofumpt,goimports,golangci-lint,go vet, andgovulncheckfor each host OS. Agovulncheckfinding warns and doesn’t fail for now, because it can’t ignore one advisory (golang/go#61211, 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., I762I762 (closed): ci: govulncheck findings warn instead of failing the buildGO-2026-6859 (a crash in Go's net/http HTTP/1 server, found in go1.27.3 and fixed in go1.27.4) fails go:vulncheck since 2026-11-11.). I763I763 (open): ci: find a way to ignore single govulncheck advisories, and fail on findings againFind a way to get back to "fail on a finding, except named advisories until a date", matching how osv-scanner.toml handles an ignoreUntil entry (AGENTS.md, "Supply chain"; scripts/osv-ignores.mjs). restores failing on a finding. - Complexity and size limits in golangci-lint (cognitive and cyclomatic complexity, nesting, function, file and signature size) and in SwiftLint.
swift-format(strict).- Swift Testing and
go test -race. - Fuzz targets for every guest-facing parser (S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…).
- Vale and cspell for prose.
Go runs natively in CI on macOS, Linux, and Windows. See S02-toolchainS02-toolchain: ToolchainStandardize how this repository manages runtime versions, repo tasks, and CI. for the toolchain itself.
Status: Draft