Repository navigation
Closed
3 / 33 of 3 issues completed
Copy link
Labels
enhancementNew feature or request
Description
Problem Statement
Maintaining native macOS (aarch64-apple-darwin) as a supported target alongside Linux creates two problems for the Day shift and for anyone running thirdshift on an Apple Silicon Mac:
- Inconsistent and degraded host capabilities on native macOS: Many of
thirdshift's core production and evaluation guarantees rely on Linux kernel and userspace primitives that do not exist on macOS:bwrapuser, PID, IPC, UTS and network namespaces withsocatproxy isolation for Trials, Graders, and Setup's Security sandbox probe;systemd --usertransient cgroup v2 memory and OOM scopes;systemdservice and reverse-proxy generation inthirdshift console install;pidfd_openprocess-identity pinning;/proc/self/exeand/proc/self/fdinheritance so child Ticket runs keep running the parent binary acrossthirdshift update; and nativeinotifyfilesystem watching. Running unattended sessions directly on a personal macOS host also exposes the host home directory and macOS Keychain withoutbwrapisolation or cgroup memory limits, whilegitworktree operations spawn processes four to five times slower on macOS than on a Linuxext4filesystem. - Disproportionate CI and maintenance cost: GitHub caps personal accounts at five concurrent macOS jobs, requiring a multi-job
macos-plan/ gate / 4-shard CI split, a manually curated macOS gate test filter, amacos-26release build, and#[cfg(target_os = ...)]branches and test guards across the codebase. With#1663adding a statically linkedaarch64-unknown-linux-muslrelease binary andubuntu-24.04-armCI coverage, Apple Silicon Mac users can run the full-featured ARM Linux binary inside an Ubuntu 24.04 Linux VM (such as Lima on Apple'sVirtualization.framework), just as Windows users runthirdshiftinside WSL2. Keeping native macOS alongsideaarch64Linux duplicates Apple Silicon support with a second, degraded target.
Solution
Specialize thirdshift strictly on Linux and remove native macOS (aarch64-apple-darwin) support:
- Releases (
distand ADR 0003): Publish only statically linked Linux binaries (x86_64-unknown-linux-muslandaarch64-unknown-linux-muslfrom#1663) through GitHub Releases and the shell installer. Remove theaarch64-apple-darwinbuild target and itsmacos-26runner mapping, and regenerate the release workflow. - CI workflows and test configuration: Remove the macOS CI plan, gate, shards, aggregate check, and
test:macoslabel handling, along with the macOS gate nextest profile. Keepubuntu-24.04(x86_64) on every pull request andubuntu-24.04-arm(aarch64) onmainpushes, nightly schedules, manual dispatches, and opt-in pull requests. - Linux-only codebase and test suite: Remove all macOS and non-Linux conditional compilation branches from the binary and integration tests so process identity (
pidfd_openand/proc), Console process exit watching (pidfd_open), Console service installation, Setup's Security sandbox probe, embedded Factory skills directory handles, Trial/Gradersystemdscopes, and child Ticket run executable inheritance are unconditional Linux implementations. Add a top-level compile-time check rejecting non-Linux targets with a clear message directing macOS users to a Linux VM (such as Lima) and Windows users to WSL2. - Documentation and site: Update ADR 0003, the README, the user manual (and regenerated site manual), the hand-written site pages, and the CI/testing documentation so supported platforms are Linux-only:
- Full test suite in CI: Ubuntu 24.04.3 and later (
x86_64andaarch64), noting that on Apple Silicon macOS, users run Ubuntu 24.04aarch64in a Linux VM such as Lima (vz, with repositories kept on the Linux filesystem rather than under/Users, parallel to WSL2 avoiding/mnt/c). - Release smoke check only: Rocky Linux 9.8 and later (
x86_64) and WSL2 with Ubuntu 24.04 or later (x86_64).
Remove the macOSLaunchAgentscheduling section from the user manual (since standard Linuxcronandsystemduser timers work directly inside a Linux VM on macOS) and update the homepage structured dataoperatingSystemfield to"Linux".
- Full test suite in CI: Ubuntu 24.04.3 and later (
User Stories
- As a Day shift maintainer on an Apple Silicon MacBook, I want to run
thirdshiftinside an Ubuntu 24.04aarch64Linux VM (such as Lima) using the official shell installer andthirdshift update, so that I get fullbwrapsandboxing,systemdcgroup memory scopes, fastext4gitworktree operations, and host filesystem isolation without compiling from source. - As a Day shift maintainer, I want
thirdshift setupto always run the livebwrapSecurity sandbox probe rather than maintaining a non-Linux "unavailable on this OS" fallback, so that every supported installation validates real network and home-directory isolation. - As a Day shift maintainer, I want
thirdshift stopand Command record liveness checks to rely unconditionally on Linux/procboot-id + start-time ticks andpidfd_open/pidfd_send_signal, so that PID-reuse protection has one implementation across all supported hosts. - As a Day shift maintainer viewing the Console, I want live process-exit notifications to use Linux
pidfd_openunconditionally without a parallelkqueueimplementation, so that Console process watching has a single code path to maintain and test. - As a Day shift maintainer running
thirdshift console install, I want the command to generate thesystemdand reverse-proxy installation script directly without a runtime platform refusal branch, because every supportedthirdshiftbinary already runs on Linux. - As a Day shift maintainer running
thirdshift updatewhile a Spec run or Ticket run is active, I want child Ticket runs and Base fixes to always start from/proc/self/exerather than falling back to the install path on non-Linux systems, so that in-flight runs never mix binary versions across an update on any supported platform. - As a Day shift maintainer, I want embedded Factory skills directory handles to always use Linux
O_PATH | O_DIRECTORY | O_NOFOLLOWdescriptors without a non-Linux fallback, so that skill linking has uniform symlink-race protection everywherethirdshiftruns. - As a Day shift maintainer running Experiments, Trials, and Graders, I want
systemd --usertransient cgroup scopes to be a guaranteed platform capability rather than guarded by runtimecfg!(target_os = "linux")checks, so that memory limits and OOM detection behave identically on every supported host. - As a contributor or user who accidentally runs
cargo buildorcargo install thirdshifton a native macOS or Windows host toolchain, I want compilation to fail immediately with a clearcompile_error!message pointing me to a Linux VM (such as Lima on macOS) or WSL2 (on Windows), so that I know right away how to runthirdshifton my machine. - As a Day shift maintainer waiting on pull request and
mainCI runs, I want CI to run withoutmacos-26jobs (macos-plan,test-macos-gate,test-macos-shard,test-macos), so that pull requests and merges are never queued behind GitHub's 5-runner macOS concurrency cap or slowed down by macOSfork/execoverhead. - As a contributor adding or modifying tests, I want
.config/nextest.tomlto have nomacos-gatefilterset to keep in sync and integration tests to have no#[cfg(target_os = "linux")]/#[cfg(not(target_os = "linux"))]guards, so that every test in the repository is unconditionally compiled and run as part of the standard Linux test suite. - As a Day shift maintainer cutting a release, I want the generated release workflow to build and smoke-test only the static Linux binaries (
x86_64-unknown-linux-muslandaarch64-unknown-linux-musl), so that releases do not depend onmacos-26runner availability or publish an unsupportedaarch64-apple-darwinarchive. - As a new user reading the README, user manual, or website on an Apple Silicon Mac, I want the Supported Platforms documentation to explain that
thirdshiftruns on Ubuntu 24.04aarch64inside a Linux VM such as Lima (keeping repositories on the Linux filesystem rather than under/Users, just as WSL2 keeps repositories off/mnt/c), so that I can set up a supported environment with full sandboxing and fastgitI/O. - As a Day shift maintainer scheduling unattended Architect runs, Pickup runs, or Security runs on a Mac via a Linux VM, I want the user manual's scheduling instructions to cover standard Linux
cronandsystemduser timers without a separate macOSLaunchAgentplist section, because runs execute inside the Linux VM where macOS Keychain session restrictions do not apply. - As a reader of the project's architecture decision records and CI documentation, I want ADR 0003, the CI performance guide, and the testing guide to reflect the Linux-only architecture and the
x86_64/aarch64Linux runner split accurately, so that operational and design docs never contradict the workflows or code.
Implementation Decisions
- Sequencing with
#1663: This Spec builds on top of#1663, which adds theaarch64-unknown-linux-muslrelease target, theubuntu-24.04-armrelease smoke check, and theubuntu-24.04-armCI test suite. Native macOS removal must be executed after#1663lands so thataarch64-unknown-linux-muslandubuntu-24.04-armremain in place whileaarch64-apple-darwinandmacos-26are removed. - Compile-time Linux target enforcement: The binary crate will enforce
#[cfg(not(target_os = "linux"))] compile_error!(...)at the crate root with a message stating thatthirdshiftsupports Linux only and directing macOS users to run it inside an Ubuntu 24.04 Linux VM (such as Lima) and Windows users to use WSL2. - Unconditional Linux implementations in production modules:
- Process identity and termination: Remove the macOS
proc_pidinfoandproc_signal_with_audittokenimplementations; retain only the Linux/proc/<pid>/stat+/proc/sys/kernel/random/boot_idstart identity andpidfd_open+pidfd_send_signaltermination. - Console process watching and filesystem change paths: Remove the macOS
kqueue(EVFILT_PROC) exit descriptor implementation, leaving only the Linuxpidfd_openimplementation. Remove macOS-specific/private/varpath-alias commentary where no longer relevant while keeping canonical path handling intact. - Setup Security sandbox probe: Remove the non-Linux
unavailable_reportfallback branch and its unit tests (macos_report_explains_unchecked_controls_and_needs_validation,other_platforms_get_unchecked_isolation_guidance_without_seatbelt, and the non-Linux integration testsecurity_sandbox_unavailable_report_preserves_saved_settings).Setupalways runs the realbwrapprobe on Linux. - Skills directory handle: Remove the non-Linux directory-handle fallback, keeping the Linux
O_PATH | O_DIRECTORY | O_NOFOLLOWdescriptor implementation unconditionally. - Child Ticket run and Base fix spawning: Remove the
cfg!(target_os = "linux")conditionals around/proc/self/exeresolution andprctl(PR_SET_NAME)so child runs unconditionally execute from/proc/self/exeand set their Linux process name. - Trial and Grader systemd scopes: Remove the
cfg!(target_os = "linux")guard sosystemd --userscope creation is unconditional. - Console service installer: Remove the
ensure!(cfg!(target_os = "linux"), ...)runtime check fromconsole install, since the binary only compiles on Linux.
- Process identity and termination: Remove the macOS
- Test suite cleanup: Remove all
#[cfg(target_os = "linux")],#[cfg(not(target_os = "linux"))],#[cfg(target_os = "macos")], and#![cfg_attr(not(target_os = "linux"), ...)]attributes andcfg!(target_os = "macos")branches across unit and integration tests (setup,setup_lifetime,base_fix,spec_run,console,console_install,metrics,release,site_deploy, andsupport), deleting dead non-Linux test stubs and keeping the Linux test implementations unconditional. - Release configuration and generator: Remove
aarch64-apple-darwinfrom thedisttarget list and custom runner map, leavingx86_64-unknown-linux-musl(ubuntu-24.04) andaarch64-unknown-linux-musl(ubuntu-24.04-arm). Regenerate the release workflow through the repository's release generator script so that nomacos-26build job is emitted and the shell installer's platform table contains only the Linux targets. - CI workflow and nextest configuration: Remove
macos-plan,test-macos-gate,test-macos-shard, andtest-macosfrom the CI workflow, along withtest:macoslabel handling if not shared with ARM Linux, and remove[profile.macos-gate]from the nextest configuration. Preserve#1663'subuntu-24.04-armCI policy (mainpushes, nightlyschedule,workflow_dispatch, and opt-in pull request label) alongside the per-PRubuntu-24.04(x86_64) jobs. - Documentation, ADR 0003, and site updates:
- Amend ADR 0003 to record that
thirdshiftships two static Linux musl binaries (x86_64-unknown-linux-muslandaarch64-unknown-linux-musl) and specializes on Linux so every supported host providesbwrapnamespaces,systemd --usercgroup scopes,pidfd_open,/proc/self/exeinheritance, andinotify; native macOS, Intel macOS, and native Windows have no binary, and Apple Silicon macOS users run theaarch64Linux binary inside a Linux VM (such as Lima) just as Windows users run thex86_64Linux binary inside WSL2. - Update the README, the user manual's Supported platforms and
thirdshift updatesections, and the hand-written site homepage (Requirements and platformsand JSON-LDoperatingSystem: "Linux") to state each supported platform and how it is checked:- Test suite in CI: Ubuntu 24.04.3 and later (
x86_64andaarch64), noting underaarch64that on Apple Silicon macOS you run Ubuntu 24.04aarch64in a Linux VM such as Lima (vz, keeping repositories on the Linux filesystem with--mount-none, not under/Users). - Release smoke check only: Rocky Linux 9.8 and later (
x86_64) and WSL2 with Ubuntu 24.04 or later (x86_64, keeping repositories on the Linux filesystem, not/mnt/c).
- Test suite in CI: Ubuntu 24.04.3 and later (
- Remove the
On macOS, a LaunchAgentsubsection and all cross-references to it from the user manual, and regenerate the HTML user manual (site/docs/index.html). - Update the CI performance and testing documentation (
docs/ci-performance.mdanddocs/testing.md) to remove activemacos-gate/macos-26workflow tables and macOS test-fallback notes while keeping dated files underdocs/research/as historical research records.
- Amend ADR 0003 to record that
Testing Decisions
- What makes a good test: Tests should verify external, user-observable behavior at the highest existing seam (CLI invocations, generated workflow files, HTTP responses, and rendered documentation pages) rather than internal implementation details.
- Release generator and workflow seam: Run the release generator freshness check and unit tests (
python3 scripts/generate-release.py --checkandpython3 -m unittest discover -s scripts -p 'test_*.py') to verify that the generated release workflow includes onlyx86_64-unknown-linux-muslandaarch64-unknown-linux-musland passes all release policy assertions. - Linux CLI and integration test seam: Run the existing integration and unit test suites covering
Setup'sbwrapsandbox probe,Stopprocess-identity signaling,Consolelive process watching and service installation,Spec run/ childTicket runexecution, and PTY child lifetime supervision (setup,setup_lifetime,stop,console,console_install,spec_run,release,site_deploy, and binary unit tests) to verify that all unconditional Linux paths compile cleanly with zero warnings undercargo clippy --all-targets -- -D warningsand pass. - Site and generated manual seam: Regenerate the user manual (
npm run docs --prefix site) and run the full site Playwright test suite (npm test --prefix site) and Console Playwright test suite (npm test --prefix console) to verify that all internal section links, anchor targets (after removing#on-macos-a-launchagent), structured data, and responsive layouts pass. - Final validation: Run
scripts/affected-tests mainto execute all affected suites end to end.
Out of Scope
- Native macOS (
aarch64-apple-darwinorx86_64-apple-darwin) and native Windows builds or runtime support. - Target repositories whose local build or test loop requires Apple's macOS-only Xcode SDKs (
xcodebuild,SwiftUI/UIKit/AppKit, or the iOS Simulator). - Running a nested Lima VM inside GitHub Actions CI (the guest OS, Ubuntu 24.04
aarch64, is tested directly onubuntu-24.04-armin CI). - Modifying historical research notes in
docs/research/macos-ci-speed.md.
Further Notes
- Full primary-source research and step-by-step Lima (
vz) Ubuntu 24.04 setup notes for Apple Silicon MacBooks are recorded indocs/research/linux-on-macbook.md. - Must be sequenced after
#1663merges so thataarch64-unknown-linux-muslandubuntu-24.04-armCI are already present onmain.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 3 sub-issues
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
Complete Linux-only Console comment cleanup (#1665)