Design spec: Mac runners for Equipo thin v1 (workers, placement, Seatbelt)
A second runner of the same person on a shared Mac, enrolled with one install command and one tap. The worker advertises its capabilities (Xcode, simulators, toolchains, harness versions); the instance derives each step's needs from the repository and places it, preferring the primary. Checks with no harness run under srt; Engineering uses Claude Code's own Seatbelt sandbox with Equipo's deny list; Codex on the Mac waits for slice 5 and a nesting probe. Termination is a process-group kill plus a marker sweep, recorded as such. Linux keeps bubblewrap. Includes the wire and API v1 changes, fixtures, a fake mac runner for Linux CI, the staging witness on tito-studio with the probes to run there first, four slices, and three decisions for Paul: the dedicated macOS user (recommended), the sealed forge-credential hand-off, and the 30-minute offline rule.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 file changed,
+500
−0
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md+500 −0
CI failed — run details
diff --git a/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md b/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md| new file mode 100644 |
| index 00000000..c6e6f19a |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md |
| @@ -0,0 +1,500 @@ |
| +# Equipo: Mac runners for thin v1 |
| + |
| +Status: draft for Paul, 2026-11-07. Written by Claude (Fable 5.1) from the |
| +approved thin v1 spec (`2026-11-06-equipo-thin-v1.md`), the slice 1 to 4 |
| +logs, and the code at `thin-v1-slice4` (ca0a65c). Not implemented. Facts |
| +about `srt`, Claude Code and Codex sandboxing were read from their current |
| +docs on 2026-11-07 and are marked where the docs were unclear. |
| + |
| +## 0. The problem and the shape of the answer |
| + |
| +Woodstar is an iOS app. On the Linux runner its checks step says "Checks |
| +can't run here (needs macOS)" (`judge.go: needsMacOS`), and Engineering |
| +cannot build or run it. Paul has a shared Mac, Tito Studio |
| +(`tito-studio`, Tailscale 100.76.110.54). He wants work that needs macOS |
| +to go there without choosing anything. |
| + |
| +The answer is a second runner of the same person, a **worker**, enrolled |
| +with one install command and one tap. The worker advertises what it can |
| +do. The instance places each step on a runner that can do it. The |
| +coordinator stays on the primary (docs-t1) and only says where things |
| +ran. Linux keeps bubblewrap unchanged; the Mac trusts the harness |
| +sandboxes (Seatbelt through Claude Code's own sandbox mode, and `srt` for |
| +checks that have no harness). |
| + |
| +Paul's rulings in the brief are binding and are not re-argued here. |
| + |
| +## 1. Several runners per person |
| + |
| +### 1.1 Roles and identity |
| + |
| +Today `primaryRunner` (`chat_wiring.go`) is the newest unrevoked runner of |
| +an owner. That changes to an explicit role on the `runners` row: `role` |
| +is `primary` or `worker`. The first runner a person enrols is primary; |
| +every later enrolment is a worker unless the person has no primary (then |
| +it becomes primary). The coordinator session, move-in, notebook, the |
| +catalog index and `watch_merge` live on the primary, as now. Workers run |
| +steps. |
| + |
| +Identity is unchanged: each machine runs `equipo-runner enrol`, gets a |
| +device code and a runner credential of its own, and holds one outbound |
| +WebSocket with the mailbox, acks, generation lease and `lease` check from |
| +slice 1. The instance's `runner_commands` mailbox is already keyed by |
| +runner, so a frame to a worker waits durably while it is offline. |
| + |
| +**Enrolment in one tap.** The Mac installer (§3) ends by running `enrol` |
| +and prints one link, `https://<instance>/enrol/<code>`. Paul taps it in |
| +Equipo; the page says "Add Tito Studio to your team" (the label comes |
| +from `scutil --get ComputerName`) and has one button. Because a primary |
| +exists, the row is created as a worker. No forms. The runner's first |
| +`hello` fills in what it can do. |
| + |
| +### 1.2 The capability report |
| + |
| +`hello` gains `platform {os, arch}`, `label`, `sandbox` (`bubblewrap` or |
| +`seatbelt`) and `capabilities`, a bounded JSON object the runner computes |
| +at start, re-probes hourly and when a probe disagrees with the last |
| +report, and sends with every 30 s heartbeat (the instance stores the |
| +newest beside the existing `hello` column, so no new table): |
| + |
| +- `xcode {version, build, path}` from `xcodebuild -version` and |
| + `xcode-select -p`; empty on Linux. |
| +- `simulators [{name, runtime, udid, state}]` from |
| + `xcrun simctl list -j devices available`, capped at 40 entries. |
| +- `toolchains {go, swift, node, python}` versions found. |
| +- `harness {claude, codex, srt}` versions found (§3.3). |
| +- `accounts` as today (`Account` rows, no credential fields), one per |
| + provider home on that machine. |
| +- `tags`: the matching vocabulary derived from the above, from the fixed |
| + set `linux`, `macos`, `xcode`, `ios_simulator`, `claude`, `codex`, `go`. |
| + |
| +The report is for placement and for the Runners page; it never carries a |
| +path outside the runner's own install, a credential or raw tool output. |
| + |
| +### 1.3 Needs and placement |
| + |
| +Each step declares `needs`, a subset of the tag set, derived by the |
| +instance from facts it already has, never by the model: |
| + |
| +- Checks: `macos` and `xcode` when `needsMacOS(changed, gateText)` is |
| + true (the rule in `judge.go` today, moved to the instance by having the |
| + primary's index report `needs_macos` per repository in `RepoInfo` and |
| + the Engineering step report whether its change touched Apple files); |
| + `ios_simulator` as well when the repository has an `.xcodeproj` or |
| + `.xcworkspace` with a shared scheme; otherwise `linux` or nothing. |
| +- Engineering: `macos`, `xcode`, `ios_simulator` and `claude` when the |
| + repository is marked `needs_macos` and the Mac path is enabled (§6, |
| + slice D); until then nothing, so it stays on the primary as today. |
| +- Review: nothing. It reads a tree; it runs anywhere. |
| +- Ask the implementer (read-only resume of a step's session): pinned to |
| + the runner that ran the step, because the session home is there. |
| + |
| +Placement happens in `advance` (`review.go`) when a step is created, and |
| +again whenever a runner comes online while steps wait. The rule: among |
| +the person's unrevoked runners whose tags cover the needs, prefer the |
| +primary; otherwise the online worker with the fewest running steps; ties |
| +by enrolment order. The step row records `runner_id` and the dispatch |
| +goes to that runner's mailbox. `DispatchCommand` carries `needs`; a |
| +runner that receives needs it cannot meet refuses with |
| +`placement_refused`, and the instance re-places. |
| + |
| +Honest outcomes when nobody fits: |
| + |
| +- No runner of the person has ever had the tags: checks end |
| + `cannot_run` with `needs_macos` at once (today's behaviour); an |
| + Engineering step with Mac needs runs on the primary with today's |
| + summary. |
| +- A fitting worker exists but is offline: the step is `queued` with |
| + `placement: waiting_runner`, and the card says "Waiting for Tito |
| + Studio (offline since 10:12)". After 30 minutes a checks step resolves |
| + `cannot_run` with the new reason `runner_offline`, never a pass, and |
| + the task goes on to review. An Engineering step keeps waiting and |
| + raises Needs you `runner_offline` so Paul knows to wake the Mac; |
| + Cancel stays available. |
| +- A worker goes offline mid-step: the step stays `running` until the |
| + worker's `sync` on reconnect settles it (today's primary rule, applied |
| + per owning runner). Only the primary's `sync` reconciles turns, as now. |
| + |
| +### 1.4 Health and the Runners view |
| + |
| +Online is what it is today (`runnerOnline` window on `seen_at`), per |
| +runner. `GET /api/v1/runners` returns `{items: [Runner]}`; `snapshot` |
| +gains `runners` (the singular `runner` stays one release for the apps). |
| +The `runner` event fires per runner. The sidebar's Team section lists |
| +runners by label with a dot for online. The coordinator's `status()` |
| +lists them; `read_task` returns each step's `runner_label`; house rule |
| +2026-11-07.8: mention where a step runs only when it is not the primary |
| +("Checks are running on Tito Studio"). |
| + |
| +## 2. The macOS sandbox, per step kind |
| + |
| +### 2.1 What the harnesses give us (verified 2026-11-07) |
| + |
| +Claude Code's sandbox (`sandbox.enabled`) is built on |
| +`@anthropic-ai/sandbox-runtime`, Seatbelt on macOS, and covers **shell |
| +commands only**; Read, Edit, Write and WebFetch "follow permission rules |
| +instead." A headless run takes `--settings <file>`, above user and |
| +project files and below managed settings. Keys used here: |
| +`sandbox.enabled`, `failIfUnavailable`, `allowUnsandboxedCommands`, |
| +`excludedCommands`, `filesystem.{allowWrite, denyWrite, denyRead, |
| +allowRead}`, `network.{allowedDomains, allowUnixSockets, |
| +allowLocalBinding, allowMachLookup}`. |
| + |
| +`srt` (Apache-2.0, `npm install -g @anthropic-ai/sandbox-runtime`, 0.0.81 |
| +on main today, Node 22.12 or later, `ripgrep`) wraps one command: |
| +`srt --settings <path> -- <cmd> <args>`. The settings JSON has |
| +`network.allowedDomains` (empty means no network), `allowUnixSockets`, |
| +`allowLocalBinding`, `filesystem.denyRead`, `allowRead` (re-opens inside |
| +a deny), `allowWrite` (empty means no writes), `denyWrite`, plus |
| +`allowPty`, `enableWeakerNetworkIsolation`, `allowAppleEvents`. On macOS |
| +it runs `sandbox-exec` with a generated Seatbelt profile; network goes |
| +through a local proxy named by `HTTP_PROXY`/`HTTPS_PROXY`/`ALL_PROXY`, |
| +and the profile allows only that loopback port, so a program that |
| +ignores the variables has no network. `~` expands; paths are git-style |
| +globs. A built-in mandatory deny list blocks writes to shell rc files, |
| +`.gitconfig`, `.git/config` and `.git/hooks` even inside `allowWrite`. |
| + |
| +Codex's `workspace-write` (`sandbox_mode`, `[sandbox_workspace_write] |
| +writable_roots, network_access`; app-server `turn/start.sandboxPolicy`) |
| +is Seatbelt too, but its docs show **no read deny** for named paths. |
| + |
| +### 2.2 Equipo's deny list (every profile) |
| + |
| +`denyRead` and `denyWrite`: the runner's state dir |
| +(`EQUIPO_RUNNER_STATE_DIR`), the accounts root |
| +(`~/.local/share/equipo/accounts`), the forge credential file, the |
| +session homes, `~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.config/op`, |
| +`~/Library/Keychains`, every home under `/Users` other than the runner |
| +user's, `/Volumes`, and the runner's own install dir for writes. Forge |
| +credentials never leave the runner process: on the Mac as on Linux, the |
| +model's tools and the gate see a tree with no remote and no credential |
| +helper, and the runner commits and pushes after the process has exited. |
| + |
| +### 2.3 Profiles |
| + |
| +**Checks** (no harness, so `srt`): the runner writes a per-attempt |
| +settings file under its scratch dir and runs |
| +`srt --settings <file> -- /bin/bash -c <gate script>` in the checks tree |
| +(the exact SHA, with the one-commit `.git` as today). Settings: |
| +`allowWrite` is the tree, the attempt's DerivedData dir and temp dir |
| +under the runner's scratch root, `~/Library/Developer/Xcode/DerivedData`, |
| +`~/Library/Caches/org.swift.swiftpm` and `~/Library/org.swift.swiftpm` |
| +(SwiftPM's caches); `denyRead` and `denyWrite` per §2.2; |
| +`network.allowedDomains` empty. A gate that fails because it needed the |
| +network is `needs_network`, honest, as on Linux (the `offline` pattern |
| +gains `Could not resolve host` variants Xcode prints). Environment is |
| +built from scratch: `HOME` is the runner user's home (Xcode needs it), |
| +`DEVELOPER_DIR` from `xcode-select -p`, `TMPDIR` the attempt dir, |
| +`CI=1`, `PATH` `/usr/bin:/bin:/usr/sbin:/sbin` plus the Xcode toolchain. |
| +Exit code and the last 200 lines are recorded as today. |
| + |
| +When the repository has no `.amadan/ci.d`, `.amadan/ci` or `make ci` |
| +but has an `.xcodeproj` or `.xcworkspace`, the Mac runner synthesises |
| +the gate Paul named: `xcodebuild test -scheme <scheme> -destination |
| +'platform=iOS Simulator,name=<device>' -derivedDataPath <attempt dir> |
| +CODE_SIGNING_ALLOWED=NO`, gate name `xcodebuild test`. The scheme is the |
| +one shared scheme under `xcshareddata/xcschemes`, or the one named like |
| +the project; the device is the newest available iPhone simulator from |
| +the capability report. Several candidates or none is `cannot_run` with |
| +`checks_unavailable` and a line saying so. Simulator builds need no |
| +signing identity and no keychain prompt; device builds are out of scope. |
| + |
| +**Engineering** (Claude Code, its own sandbox): the step runs `claude -p` |
| +as today (`--setting-sources ''`, `--strict-mcp-config`, pinned tools, |
| +the `StepPermission` callback that allows only workspace file actions) |
| +plus `--settings <per-attempt file>` with `sandbox.enabled true`, |
| +`allowUnsandboxedCommands false`, `failIfUnavailable true`, |
| +`excludedCommands []`, `filesystem.allowWrite` the worktree plus the |
| +DerivedData and SwiftPM paths above, the §2.2 deny lists, and |
| +`network.allowedDomains` empty. The model's shell therefore builds and |
| +runs simulator tests but has no network; the `claude` process itself |
| +talks to Anthropic as the runner user, outside the sandbox, which is the |
| +trust Paul granted. The Read/Edit/Write tools are not sandboxed by |
| +Seatbelt; the permission callback is what confines them, exactly as it |
| +does today behind bubblewrap, and a mutation test keeps it honest. The |
| +init-frame policy check (`provider/policy.go`) keeps validating argv, |
| +settings, MCP config and tool list; `denied_paths` in the manifest is |
| +the §2.2 list rather than mounts. |
| + |
| +Codex Engineering on the Mac waits. Its sandbox has no read deny, the |
| +thin runner has no Codex step path until slice 5, and nesting `codex` |
| +under `srt` is unproven (probe P5). Mac Engineering is Claude only in |
| +this spec. |
| + |
| +**Review** (`inspect`): Read, Glob and Grep only, no shell, no write |
| +tools, so there is nothing for Seatbelt to do; `ReadPermission` confines |
| +reads to the tree. The prompt's `/workspace` becomes the tree's real |
| +path on the Mac. Review is placed by §1.3, so it usually stays on the |
| +primary even for Mac tasks, and its independence label is unchanged. |
| + |
| +**Ask the implementer** (the slice 4 open item): resumes the step's |
| +session with the `inspect` tool set and `ReadPermission`, on the runner |
| +that holds the session home. It needs step sessions kept per task |
| +(today a fresh `--session-id` per attempt, home deleted on exit); that |
| +is built in slice D with the session home copied back as the |
| +coordinator's is. If that runner is offline the thread gets one line: |
| +"Tito Studio is offline; ask again when it is back." |
| + |
| +### 2.4 Xcode's needs and the known limits |
| + |
| +Xcode talks to CoreSimulatorService and XCBBuildService over Mach, and |
| +those run as per-user launchd services outside any sandbox; the |
| +sandboxed `xcodebuild` must be allowed to look them up. Claude Code's |
| +settings have `sandbox.network.allowMachLookup`; whether `srt` exposes |
| +the same key, and which services `xcodebuild test` needs, is probe P2 |
| +and decides the checks settings file. DerivedData and module caches are |
| +large and reused across attempts on purpose (a cold Woodstar build is |
| +minutes; a warm one is seconds), so the shared DerivedData path is |
| +allowed and not deleted; the per-attempt dir is deleted. |
| + |
| +Honest limits, Seatbelt and `srt`: `sandbox-exec` is deprecated by Apple |
| +but still present and is what both harnesses use; `failIfUnavailable` |
| +turns its removal into a visible stop. No PID namespace, no uid |
| +isolation, no resource limits; path rules resolve through symlinks; |
| +allowed Mach lookups are open. Network filtering is a proxy plus |
| +environment variables with no TLS termination, so an allowed host can be |
| +a front; we allow none. Claude's sandbox covers shell commands only, and |
| +hooks, MCP servers and `apiKeyHelper` run unsandboxed (Equipo disables |
| +hooks and pins MCP). Codex has no read deny. Violations show only in |
| +`log stream --predicate 'process == "sandbox-exec"'`, which the runner |
| +tails during a step and counts in the step log. `denyRead` on another |
| +user's home is belt; Unix permissions are braces, hence §3.5. |
| + |
| +## 3. Install, update, discovery and sign-in on macOS |
| + |
| +### 3.1 Artifacts |
| + |
| +`make release` adds `releases/equipo-runner-darwin-arm64-<version>/` with |
| +`equipo-runner`, `equipo-tool-proxy` (both `CGO_ENABLED=0 GOOS=darwin |
| +GOARCH=arm64`; the runner uses `modernc.org/sqlite`, so Linux CI |
| +cross-builds it), `io.amadan.equipo-runner.plist` and the install |
| +script. Go ad-hoc signs darwin/arm64 binaries, and `curl` sets no |
| +quarantine attribute, so Gatekeeper does not block them; notarisation is |
| +not needed for a binary the person installs from a terminal. |
| +`install-manifest.json` gains a `targets` map keyed `linux/amd64` and |
| +`darwin/arm64`, each with its digests; `install-v1.sh` dispatches on |
| +`uname`. `make staged-check` records both targets. |
| + |
| +### 3.2 One command, then one tap |
| + |
| +`curl -fsSL https://<instance>/install.sh | sh` installs to |
| +`~/.local/lib/equipo-runner`, writes |
| +`~/Library/LaunchAgents/io.amadan.equipo-runner.plist` (`RunAtLoad`, |
| +`KeepAlive`, `ProcessType Standard` so builds are not throttled, logs |
| +under `~/Library/Logs/equipo-runner/`, `ProgramArguments` `equipo-runner |
| +run --env-file ~/.config/equipo-runner/runner.env`, a new flag since |
| +launchd has no `EnvironmentFile`), loads it with `launchctl bootstrap |
| +gui/$UID`, installs `srt` with `npm install -g` when `npm` is present |
| +(else one printed line; checks report `checks_unavailable` until it is), |
| +then runs `enrol` and prints the link. A user agent runs only while that |
| +user has a GUI session, and a sleeping Mac is an offline worker: the |
| +runner wraps every step in `caffeinate -i`. |
| + |
| +### 3.3 Discovery and update |
| + |
| +At start the runner looks for `claude` at `~/.local/bin/claude`, |
| +`/opt/homebrew/bin/claude`, `/usr/local/bin/claude`, then a login shell's |
| +`PATH` (`zsh -lc 'command -v claude'`); `codex` and `srt` likewise |
| +(`srt` also via `npm root -g`). Paths and versions go in the capability |
| +report, and `EQUIPO_CLAUDE_PATH` still overrides. |
| + |
| +Update: `welcome` gains `release`. A worker whose version is older |
| +downloads its target from `/releases/<version>/`, verifies the manifest |
| +digests, swaps the binary between steps (never mid-step) and exits 0; |
| +`KeepAlive` restarts it. This also removes the slice 4 skew loop, since a |
| +worker that sees an unknown durable frame now updates instead of |
| +reconnecting forever. Linux keeps its scripted install for now. |
| + |
| +### 3.4 Account sign-in |
| + |
| +`equipo-runner login claude` works as on Linux: a dedicated home under |
| +`~/.local/share/equipo/accounts/claude-<n>`, the official login, the |
| +observed email recorded. One difference needs a probe (P3): Claude Code |
| +on macOS stores its OAuth credential in the login Keychain rather than |
| +in `$HOME/.claude/.credentials.json`. If it does so even with `HOME` |
| +redirected, the Linux runtime-copy and 25-minute copy cycle do not apply |
| +on the Mac: the CLI reads the Keychain item directly, refresh is native, |
| +and one Claude account per macOS user is the practical limit. The spec |
| +assumes that: the worker has one Claude account, enough for Engineering |
| +and for Review when placed there; no coordinator runs on a worker. If |
| +the probe finds a file instead, the Linux copy code runs unchanged. |
| + |
| +### 3.5 A dedicated macOS user: recommended, yes |
| + |
| +Run the runner as a standard (non-admin) macOS user `equipo` on |
| +tito-studio. The box is shared, so Unix permissions must be the hard |
| +boundary around Paul's and others' homes, with Seatbelt `denyRead` as |
| +the second layer; Codex has no read deny at all; the runner's Keychain |
| +item is then the runner's, not Paul's own Claude sign-in; DerivedData, |
| +simulators and caches stay out of his account; and a process sweep can |
| +fall back to "every process of user `equipo` outside the runner" without |
| +touching anyone else. Paul must, once: create the user (System Settings, |
| +Users & Groups, Standard); add it to the developer group so simulator |
| +tests run without a prompt (`sudo dscl . append /Groups/_developer |
| +GroupMembership equipo`); log it in with fast user switching and leave |
| +it logged in, sleep off while plugged in; open a terminal as that user, |
| +paste the install command, tap the link. Xcode's licence and |
| +`DevToolsSecurity` are machine-wide and already accepted; the installer |
| +runs `xcodebuild -runFirstLaunch`; the user gets its own simulator |
| +device set on first use. |
| + |
| +## 4. Termination on macOS |
| + |
| +There is no namespace and no pidfd proof. Each attempt starts in its own |
| +session and process group (`Setsid`) with `EQUIPO_ATTEMPT=<key>` in its |
| +environment. Cancel or timeout: `SIGTERM` to the group, 10 s grace, |
| +`SIGKILL` to the group, then a sweep (`ps -axo pid,pgid,user,command` |
| +and, for the runner's own processes, `ps -E`) that kills anything with |
| +the group id or the attempt marker, then `xcrun simctl shutdown` for any |
| +simulator the attempt booted (recorded from `simctl list` before and |
| +after). **Termination is reported, and Retry allowed, when `kill(-pgid, |
| +0)` returns `ESRCH` and the sweep finds no process with the marker, |
| +within 30 s.** `StepReport` and `Step` gain `termination_kind` |
| +(`namespace` on Linux, `process_group` on macOS) so the record is |
| +honest. What Retry does not get: a child that both leaves the group and |
| +scrubs its environment escapes the sweep, and Seatbelt does not prevent |
| +that; XCBBuildService and CoreSimulatorService are per-user launchd |
| +services and survive by design (they hold no lock on the tree). On a |
| +runner crash, startup kills every process with any attempt marker before |
| +reporting `runner_restarted`, as the Linux startup verifies namespaces. |
| +A worktree is removed only after termination, as today. |
| + |
| +## 5. Wire and API v1 changes |
| + |
| +Frames (`internal/wire`, strict decoding, so every field is explicit): |
| + |
| +- `hello` adds `platform {os, arch}`, `label`, `sandbox`, `capabilities |
| + {xcode, simulators[], toolchains, harness, tags[]}`. Bounds: 40 |
| + simulators, 300 bytes per string, 8 KB total. |
| +- `welcome` adds `role` and `release`. |
| +- `dispatch` adds `needs []string`. New step reason `placement_refused`. |
| +- `step` adds `termination_kind`. New checks reason `runner_offline`. |
| +- New sealed frames for the forge credential (§7, decision 2): |
| + `envelope{to_runner, ciphertext}` instance to worker, produced by the |
| + primary; the instance stores and relays, and cannot read it. |
| + |
| +Resources: `Runner` adds `label`, `role`, `since`, `platform`, |
| +`capabilities`; `RunnerList` at `GET /api/v1/runners`; `Snapshot.runners`; |
| +`Step` adds `runner_id`, `runner_label`, `needs`, `placement` |
| +(`placed`, `waiting_runner`, `no_runner`), `termination_kind`; `Task` |
| +adds `needs_you` value `runner_offline`. Coordinator tool results: |
| +`status` lists runners; `read_task` carries `runner_label` per step. |
| + |
| +Fixtures for the native apps: `api/runners.json` (Linux primary online, |
| +Mac worker offline), `api/task-placed.json` (`waiting_runner` then |
| +`placed`), `api/task-mac-checks.json` (an `xcodebuild test` pass and a |
| +fail with `exit_code`), `frames/hello-mac.json`, |
| +`frames/welcome-worker.json`, `frames/dispatch-needs.json`, |
| +`frames/step-process-group.json`. |
| + |
| +Copy for review (existing marker until Luna's pass): "Add %s to your |
| +team", "Waiting for %s (offline since %s)", "Checks can't run here (%s |
| +was offline)", "Needs you: %s has been offline for 30 minutes", "Checks |
| +are running on %s", "%s is offline; ask again when it is back", "Runners". |
| + |
| +## 6. Testing |
| + |
| +CI runs on Linux, so the Mac path is tested with a **fake mac runner**: |
| +the real thin runner started with `EQUIPO_FAKE_PLATFORM=darwin/arm64` |
| +reports a fixture capability report (recorded on tito-studio, probe P1), |
| +uses the process-group executor with no sandbox, and finds a fake |
| +`xcodebuild` on its `PATH` that passes, fails or hangs by scenario. |
| +Everything darwin-only (`srt` settings generation, `simctl` parsing, the |
| +plist, scheme discovery, the sweep) is unit-tested with recorded |
| +outputs. Headless scenarios, all under the two-minute budget: |
| + |
| +- M1 two runners, an iOS change: checks placed on the worker, a real |
| + pass on the task's SHA, review on the primary, Ready to merge with |
| + "Checks passed (xcodebuild test)". |
| +- M2 the worker is offline: `waiting_runner`, the card line, reconnect, |
| + checks run; and the 30-minute path with a fake clock to |
| + `runner_offline`, then review. |
| +- M3 no worker enrolled: `needs_macos` as today (the existing |
| + `4_checks_honest` must still pass). |
| +- M4 worker SIGKILLed mid-checks: failed with `termination_kind |
| + process_group`, Retry allowed, attempt 2 passes. |
| +- M5 the fake gate fails: a fix round from its 200 lines, then passes. |
| +- M6 worker enrolment in one tap, the role `worker`, the envelope |
| + delivered and decrypted, a dispatch refused by a runner lacking the |
| + need and re-placed. |
| +- M7 (slice D) Engineering placed on the worker pushes a branch with |
| + the §2.3 settings file validated in the init frame; ask the |
| + implementer pinned to the worker, and the offline line. |
| +- Guards: no capability string carries a home path or credential; the |
| + deny list is present in every generated settings file (mutation: |
| + dropping the state dir fails a test). |
| + |
| +**Staging witness on tito-studio**, by the builder, after the probes: |
| +install the staging runner under the `equipo` user with its own state |
| +root, enrol it as a worker of the staging owner, then re-judge the |
| +Woodstar witness task `tklkbx5vid3y` at `82a4a0cc`. Pass criterion: the |
| +checks step records `xcodebuild test` (or Woodstar's own gate), a real |
| +exit code, 200 lines of Xcode output, and `passed` or `failed`, never |
| +`cannot_run`; Review stays on the primary; Ready to merge carries the |
| +Mac result. Zero model turns for checks-only. Then the live |
| +`oficina/suite` scenario must still land on the primary unchanged. |
| + |
| +**Probes the builder runs on tito-studio first** (nothing is built on |
| +guesses): |
| + |
| +- P1 record `xcodebuild -version`, `xcode-select -p`, `xcrun simctl |
| + list -j devices available`, `scutil --get ComputerName` as fixtures. |
| +- P2 `srt --settings <draft> -- xcodebuild test ...` on Woodstar: does |
| + it run; which Mach services or paths the violation log names; whether |
| + `srt` has `allowMachLookup` or an equivalent (its README does not list |
| + one; Claude Code's settings do). |
| +- P3 with `HOME` set to an empty dir, `claude /login`: Keychain item or |
| + `.credentials.json`; whether refresh works headless afterwards. |
| +- P4 `launchctl bootstrap gui/$UID` of the plist as a non-admin user; |
| + behaviour across fast-user-switch and sleep. |
| +- P5 `srt -- codex exec` with `workspace-write`: do nested Seatbelt |
| + profiles compose or fail (decides when Codex comes to the Mac). |
| +- P6 a process group SIGKILL during `xcodebuild test`: what survives, |
| + and whether `simctl shutdown` is needed for the tree to be removable. |
| +- P7 `npm install -g @anthropic-ai/sandbox-runtime` under the `equipo` |
| + user: Node version present, where `srt` lands. |
| + |
| +## 7. Slices, decisions and risks |
| + |
| +| Slice | Content | Size | |
| +|---|---|---| |
| +| A Runners and placement | roles, one-tap worker enrolment, capability report, `runners` API and view, `needs` and placement in `advance`, offline waiting and `runner_offline`, per-runner dispatch and sync, fake mac runner, M1 to M6 minus the envelope, fixtures | 2 days | |
| +| B Darwin runner | darwin/arm64 release target and manifest, installer and plist, discovery, `--env-file`, self-update, process-group containment and sweep, `srt` checks profile, `xcodebuild test` synthesis, sealed envelope, unit tests on P1 fixtures | 3 days | |
| +| C Witness | P1 to P7 on tito-studio, the `equipo` user, staging worker, Woodstar real pass or fail, fixtures refreshed from the box | 1 day plus Paul's four steps | |
| +| D Mac Engineering and Review | Claude sandbox settings file and init validation, Engineering `needs`, session home per step, ask the implementer pinned, M7, live witness: Woodstar swipe-back built and tested on the Mac | 2 days | |
| +| E Codex on the Mac | after slice 5 and P5 | parked | |
| + |
| +Order follows Paul: A and B give checks-only (no model, no account on |
| +the Mac needed beyond the forge credential); D brings Engineering and |
| +Review with simulator access. |
| + |
| +**Decisions for Paul, three:** |
| + |
| +1. The dedicated `equipo` user on tito-studio (§3.5): recommended yes, |
| + four one-time steps for Paul. The alternative, running as his own |
| + user, makes Seatbelt the only wall around his home and shares his |
| + Claude Keychain item with the runner. |
| +2. How the worker gets the Amadan agent credential. Recommended: the |
| + primary seals its agent-wide entry to the worker's enrolment key |
| + (X25519 from the enrolment keypair) and the instance relays the |
| + envelope it cannot read, so one tap is still one tap. Alternative: |
| + Paul pastes the credential on the Mac once (`equipo-runner forge |
| + <file>`), which is a form by another name. |
| +3. The 30-minute offline rule (§1.3): checks give up honestly and review |
| + proceeds; Engineering waits and asks. The alternative is to wait |
| + indefinitely for both. |
| + |
| +**Risks.** The Keychain probe (P3) may force one account per macOS user; |
| +that costs nothing for checks-only and only limits Review independence |
| +on the Mac. Xcode under `srt` may need Mach allowances the runtime cannot |
| +express (P2); the fallback is `xcodebuild` run through a one-shot |
| +`claude -p` under Claude's own sandbox, which spends a model turn per |
| +check and is not the plan. A shared Mac is a shared CPU: one step at a |
| +time per worker, `caffeinate` only while a step runs, `ProcessType |
| +Standard`. The sealed envelope adds cryptography to enrolment; it reuses |
| +the enrolment key, and M6 plus the rule that the instance never holds a |
| +value that opens the forge keep it honest. Workers widen the push |
| +surface to a second machine; forge validation (branch, SHA, person, |
| +lease) runs there unchanged, and "two runners never touch one branch" |
| +holds because a task's Engineering steps stay on one runner for the |
| +task's life. |