oficina / equipo Public

Mac runners slice F: spec addendum and implementation plan (draft)

Spec §8 records what moved since 2026-11-07 (protocol 35, the
paulequipo user and its open home, production-only enrolment,
mac-placement-wait, token connections, the bubblewrap-certified
Linux launch, the missing darwin Claude pin and tool proxy, the
injection defences) and the slice F design deltas. The plan has
17 tasks, tests first with mutation checks. Draft for Astra review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 80012819a2cfd372f36f3fd64b86d68b0e8a6170 parent 8bd40ed
2 files changed, +1,143 −0
  • docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md +926 −0
  • docs/superpowers/specs/2026-11-07-equipo-mac-runners.md +217 −0
diff --git a/docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md b/docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md
new file mode 100644
index 00000000..1508ec31
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md
@@ -0,0 +1,926 @@
+# Mac runners slice F: Engineering on a Mac worker
+
+Status: draft for Astra review, 2026-11-28. Spec:
+`docs/superpowers/specs/2026-11-07-equipo-mac-runners.md` rev 4 plus its
+§8 addendum (2026-11-28), which is current where they differ. Branch
+`mac-slice-f` from `origin/main` 8bd40ed1. Controller brief:
+`CONTROLLER-BRIEF-mac-slice-f.md`.
+
+Paul (2026-11-28): "Surely mac runners need to be able to do native Mac
+and iOS development?" Slice F lets a Mac worker run Engineering steps
+with Claude Code, so iOS and Mac changes are made and built on a Mac. The
+primary still holds the forge, pushes, reviews and merges.
+
+## 0. Ground rules for every task
+
+- **Tests first.** Each task writes its failing tests, runs them and
+ sees them fail for the stated reason, then implements. Every guard
+ named in a task gets a **mutation check**: break the guarded line,
+ watch a named test fail, restore. Record the commands and results in
+ `docs/superpowers/plans/MAC-SLICE-F-PROGRESS.md` (AGENTS.md).
+- **Targeted runs while iterating**, for example
+ `go test ./internal/runner/thin/ -run TestWorkerEngineering -count=1`.
+ `make ci` once before the whole-branch review. Darwin code builds on
+ Linux: `GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build ./...` and
+ `make vet` (which vets the runner for darwin/arm64) on every task that
+ touches darwin files.
+- **What only a Mac can show** is unit-tested with recorded outputs and
+ fakes, and proven by the shipped probes (task 13) once a release runs
+ on the Studio. A recorded output is labelled with the date and the
+ machine it came from.
+- **Protocol 36** (`wire.ProtocolMacEngineering`) gates every new frame
+ field. `wire.Encode(f, p)` for p < 36 drops them, and the protocol
+ fixture tests encode each new frame at 35 and 36. Confirm the number
+ with the parent before code (other branches allocate numbers too). At
+ most one migration; take the next free number at the time.
+- **Copy.** Every new user-facing string goes in `internal/equipo/copy.go`
+ marked `// COPY REVIEW PENDING` and in the copy-review JSON
+ `docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json` (task 14).
+ No em dashes, no exclamation marks.
+- **Round limit.** Astra reviews this plan, the risky tasks (3, 7, 8,
+ 9, 10, 11, 14) and the whole branch, **at most three rounds each**.
+ After round 3, the controller fixes what is clearly right, writes down
+ what stays open, and asks the parent. It never starts a fourth round.
+- **Never** merge, deploy, enrol, change Studio state, sign in to a
+ provider, or run a live model turn. The one exception is the shipped
+ probe turn in task 13, which runs only on the Studio after a deploy
+ done by someone else.
+
+## 1. What exists and what is missing
+
+Built (slices A to E, `RUNNERS-PROGRESS.md`, `DARWIN-PROGRESS.md`): per
+runner mailbox, roles, protocol negotiation, capability report, placement
+with start authorization and withdrawal, the Engineering pin column
+(`tasks.engineering_runner`), transfers and blob relay, the primary's
+`publish`/`published` path (`thin/relay.go: publishWorker`, crash and
+cancel tests), the darwin runner build, the srt checks profile, the
+process-group gate (`mac.Gate`), probes P1 to P7, the launchd agent, the
+installer, self-update, the taint.
+
+Missing for slice F:
+
+1. The worker refuses every step but Checks (`thin/worker.go: Exec`).
+2. Placement never sends Engineering to a worker. `mac-placement-wait`
+ (unmerged) parks Mac Engineering as `waiting_mac_engineering`.
+3. No darwin Claude Code pin. No darwin launch policy: Linux
+ Engineering is a bubblewrap-certified launch (`provider.BuildPolicy`,
+ `claude.PolicyInputs`, `containment.Manager`).
+4. No MCP tool endpoint on a Mac (the Linux tool proxy is Linux-only and
+ digest-certified).
+5. Native permission answers hard-code `/workspace`
+ (`provider/claude/answers.go`).
+6. A worker has no connections, no seal key and no `Conns`. The
+ Connections page adds only to the primary.
+7. Inbound transfers carry one commit. Engineering needs the base, and
+ for a rebase round also the old base and the candidate.
+8. The worker never uploads an outbound pack. `PublishedReport` carries
+ no change files, and the primary queues no change diffs for a
+ worker's candidate.
+9. Ask the implementer on a worker: no kept sessions there.
+10. No probes for Claude's own sandbox on a Mac (F1 to F5).
+11. No home-permission guard for a Mac that holds a model credential.
+12. No M9 scenario.
+
+## 2. Task order
+
+| # | Task | Risk | Astra |
+|---|---|---|---|
+| 0 | Base: merge `mac-placement-wait`, allocate protocol and migration | low | no |
+| 1 | Read-only probes and static reads (Studio as paulca, pinned CLI on docs-t1) | low | no |
+| 2 | Wire, protocol 36, fixtures | medium | whole-branch |
+| 3 | Instance placement, pinning, waiting reasons, switch | high | yes |
+| 4 | Primary: Engineering inbound packs, change files and diffs at publish | medium | whole-branch |
+| 5 | Darwin Claude Code pin and self-provisioning | medium | whole-branch |
+| 6 | Darwin MCP tool endpoint in the runner binary | medium | whole-branch |
+| 7 | Native permission port (workspace root as policy) | high | yes |
+| 8 | Darwin Engineering policy and settings | high | yes |
+| 9 | Darwin Engineering executor and termination | high | yes |
+| 10 | Worker Engineering `Exec`, secret check, outbound pack | high | yes |
+| 11 | Worker connections, seal key, "Add Claude to <Mac>" | high | yes |
+| 12 | Ask the implementer pinned on the worker | medium | whole-branch |
+| 13 | Shipped probes F1 to F5 and the `claude` tag | medium | whole-branch |
+| 14 | Home guard, D1 default, views and copy | high | yes |
+| 15 | M9 headless scenarios on Linux CI | medium | whole-branch |
+| 16 | Release, docs, `make ci`, whole-branch review | medium | yes |
+| 17 | Live witness on production (after someone else deploys) | n/a | no |
+
+Tasks 5, 6 and 7 do not depend on each other and may run in parallel
+worktrees. Task 8 needs 5 to 7. Tasks 9 and 10 need 8. Task 11 can start
+after 2. Tasks 12 and 13 need 10.
+
+---
+
+## Task 0. Base
+
+1. `git merge origin/mac-placement-wait` into `mac-slice-f`, or rebase
+ onto main if it has merged by then. Run its tests:
+ `go test ./internal/thintest/ -run 'MacWait|Macrecheck|Placement' -count=1`
+ and `go test ./internal/equipo/ -run TestMacWait -count=1`.
+2. Ask the parent for the protocol number (expected 36) and the next
+ free migration number. Write both at the top of the progress file.
+3. Create `MAC-SLICE-F-PROGRESS.md` from the `DARWIN-PROGRESS.md`
+ layout: Done, Decisions, Only the Mac can show, Open issues, Copy.
+
+Done when the branch builds, the placement-wait tests pass, and the
+progress file exists.
+
+## Task 1. Read-only probes and static reads
+
+Before any Darwin code, as slice C did. Nothing on the Studio changes.
+SSH as `paulca` only (`ssh -o BatchMode=yes tito-studio`, sandbox off;
+`~/.ssh` is read-denied in the sandbox). No `sudo`. Never read
+`paulequipo`'s files: its home can be listed, but its contents are not
+ours to read. Scratch on docs-t1 in `mktemp -d` under `$TMPDIR`, removed
+at the end of the task.
+
+**On the Studio, as paulca** (record the output in the progress file,
+dated):
+
+- R1 `sw_vers`, `xcodebuild -version`, `xcode-select -p`,
+ `xcrun simctl list -j runtimes`, `xcrun simctl list -j devices
+ available | head`, `swift --version`, `sysctl hw.ncpu hw.memsize`,
+ `uptime`. Already seen 2026-11-28: macOS 27.2, Xcode 27.2 (27B52),
+ iOS 27.0 and 27.2 runtimes, M5 Ultra, 36 cores, 96 GB, load about 1.7.
+- R2 `ls -led /Users/*` (the ACL picture), `id paulequipo`,
+ `ps -axo user,pid,etime,command | grep equipo-runner` (which binary is
+ running and since when).
+- R3 `sandbox-exec -p '(version 1)(allow default)' /usr/bin/true` and the
+ same with a nested `sandbox-exec` inside it. Record whether macOS 27.2
+ allows a Seatbelt profile to be applied inside another. This decides
+ whether the CLI's own Bash sandbox could ever run under an outer
+ profile. The spec assumes not.
+- R4 `ps -E -p $$` and `sysctl kern.procargs2` read of a same-user
+ process, from a plain shell and from inside a `sandbox-exec` profile
+ with `(deny default)(allow process-exec)(allow file-read*)`. This
+ shows what Seatbelt's `process-info*` operations govern on 27.2, as
+ background for F3. F3 itself is the proof.
+
+**On docs-t1, static reads of the pinned CLI.** Fetch the official Claude
+Code 2.1.312 release manifest and the `darwin-arm64` binary (about
+200 MB; that is within the "ask before a few GB" rule) into the scratch
+dir. Check the binary against the manifest digest, then read it with
+`strings`/`rg`, without running it. Record, citing what you matched:
+
+- S1 the darwin-arm64 digest and the manifest URL. This becomes
+ `claude.ExecutableSHA256DarwinArm64` in task 5.
+- S2 the sandbox settings keys this build reads:
+ `sandbox.filesystem.allowWrite`, `allowRead`, `denyRead`, `denyWrite`;
+ `sandbox.network.allowedDomains` (and what empty means: no network,
+ or ask); `allowUnixSockets`, `allowLocalBinding`, `allowMachLookup`;
+ `failIfUnavailable`, `allowUnsandboxedCommands`, `excludedCommands`,
+ `enableWeakerNestedSandbox`. A key the spec needs that is absent is a
+ stop: write it up and ask the parent.
+- S3 the version of `@anthropic-ai/sandbox-runtime` the build embeds,
+ and that version's macOS profile generator. Read the source of that
+ tag (`macos-sandbox-utils.ts`) for what it allows by default:
+ `process-info*`, `mach-lookup` for `securityd`, `file-read*` breadth,
+ `sysctl-read`. Record it.
+- S4 whether the build reads the OAuth token from a file descriptor
+ (for example a `*_FILE_DESCRIPTOR` variable next to
+ `CLAUDE_CODE_OAUTH_TOKEN`), and whether `CLAUDE_CODE_OAUTH_TOKEN` set
+ skips every Keychain read and write (`security`,
+ `Claude Code-credentials`).
+- S5 how the Bash tool spawns its shell on darwin (`detached`,
+ `setsid`, a new process group) and whether
+ `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` removes anything beyond the provider
+ credentials. Process-group termination (task 9) depends on this.
+
+Delete the scratch dir. Done when R1 to R4 and S1 to S5 are in the
+progress file, and any stop is raised.
+
+## Task 2. Wire, protocol 36, fixtures
+
+Files: `internal/wire/` (`runners.go`, `tasks.go`, a new
+`mac_engineering.go`), `internal/wire/testdata/frames/`,
+`docs/api/` fixtures if the API changes.
+
+Tests first (`internal/wire`):
+
+- `TestProtocol36Constants`: `ProtocolMacEngineering == 36`,
+ `ProtocolCurrent == 36`, `Spoken(99) == 36`. Update the existing
+ constant tests that pin 35.
+- `TestEncodeDropsMacEngineeringBelow36`: each new field is gone at 35
+ and present at 36.
+- Fixture round-trips: `frames/dispatch-mac-engineering.json`,
+ `frames/blob-engineering.json` (a header with `commits`),
+ `frames/published-change-files.json`, `frames/hello-worker-conns.json`,
+ `frames/step-mac-engineering.json`.
+
+Changes:
+
+- `TransferHeader.Commits []string` (omitempty): the exact commits an
+ inbound Engineering pack must yield. Checks transfers leave it empty,
+ and the existing meaning stands.
+- `DispatchCommand.XcodeAccess` (`"sandboxed"` or `""`): the instance's
+ decision. A worker refuses a value its own trusted report does not
+ support (task 10).
+- `StepReport.XcodeAccess` echoes what ran; `StepReport.MadeOn` is not
+ needed, since the instance knows the runner.
+- `PublishedReport.ChangeFiles *ChangeFiles` (omitempty). Change diffs
+ travel as today's `FrameChangeDiff`, bound to the worker's task, step
+ and attempt.
+- New step reasons: `secret_in_candidate`, `workspace_too_large`,
+ `engineering_unavailable` (the worker cannot run Engineering now:
+ CLI unpinned, probes not passed, home open). New placements:
+ `waiting_mac_connection`, `waiting_mac_update`. New Needs-you kinds:
+ `mac_connection`, `mac_update`.
+- Worker hello: `Connections` and `SealKey` may be non-empty from a
+ worker at 36. The instance ignores both from a worker below 36.
+
+Mutations: drop the `< 36` clear in `Encode`; mis-tag a field as always
+present. Both must fail a named test.
+
+## Task 3. Instance placement, pinning, waiting reasons, switch
+
+Files: `internal/equipo/chat/runners.go` (`place`, `macEngineering`,
+`placeWaiting`), `macsandbox.go`, `transfers.go`, `tasks.go`, the store
+config for `EQUIPO_MAC_ENGINEERING`, `internal/thintest/` contracts.
+
+Tests first, as contracts in `internal/thintest/`
+(`mac_engineering_contract_test.go`), each with a primary and a fake
+worker at protocol 36 unless stated:
+
+1. `TestContractMacEngineeringPlacedOnWorker`: switch on, the repository
+ needs macOS, the worker covers `macos, xcode, ios_simulator, claude`.
+ Engineering is placed on the worker, the task is pinned to it, and an
+ inbound transfer naming `commits: [base]` is opened in the same
+ transaction as the dispatch.
+2. `TestContractMacEngineeringSwitchOff`: switch unset. The step waits
+ `waiting_mac_engineering` exactly as on `mac-placement-wait`.
+3. `TestContractMacEngineeringNeedsConnection`: the worker lacks only
+ `claude`. Placement `waiting_mac_connection`, Needs you
+ `mac_connection` naming the Mac, no dispatch. When the worker's next
+ hello adds `claude`, `placeWaiting` places it.
+4. `TestContractMacEngineeringOldWorker`: the worker speaks 35.
+ `waiting_mac_update`, Needs you `mac_update`. It never receives a
+ dispatch with `commits` or `xcode_access`.
+5. `TestContractMacEngineeringOffline`: the fitting worker is offline.
+ `waiting_runner`; after 30 minutes Needs you `runner_offline` (spec
+ §1.4); Cancel works; it never falls to the Linux primary.
+6. `TestContractMacEngineeringPinHolds`: a fix round, a Retry, a
+ republish and a rebase round all go to the pinned worker, even when a
+ second fitting worker exists. A rebase dispatch carries `commits:
+ [base, from_base, candidate]`.
+7. `TestContractMacEngineeringPinnedRemoved`: the pinned worker is
+ removed. The step follows the existing removal path (quarantine,
+ Recover). After Recover, the next Engineering step re-pins to a
+ fitting Mac, or waits `waiting_mac`. It is never placed on the Linux
+ primary.
+8. `TestContractMacEngineeringXcodeAccess`: `xcode_access: sandboxed` is
+ sent only when the instance holds the worker sandbox-proven
+ (`sandboxProven`) **and** its probe report has F5 `denied`; otherwise
+ empty. A tainted Mac gets empty.
+9. `TestContractWorkerEngineeringReports`: a worker's Engineering
+ report with `pushed: true` is refused; `committed` with a candidate
+ opens the outbound transfer for exactly that candidate; `done` with
+ `pushed: false` waits for the primary's `published` (the existing
+ `TestContractPublishedBeforeWorkerDone` extended to Engineering).
+10. `TestContractReviewStaysOnPrimary`: Review of a Mac-made candidate is
+ placed on the primary after publication. Checks go to the Mac by
+ their needs. The merge decision never auto-merges a Mac-made
+ candidate unless base-gate certification applies (it cannot, on a
+ worker): Ready to merge asks.
+
+Changes:
+
+- `engineeringNeeds` adds `wire.TagClaude` for Mac work.
+- `macEngineering`: switch off, return today's waits. Switch on: pinned
+ worker first (if enrolled, not removing, protocol ≥ 36), else the
+ §1.4 order among workers covering the needs. When a Mac covers
+ everything but `claude`, wait `waiting_mac_connection`. When the only
+ covering Macs speak < 36, wait `waiting_mac_update`.
+- Dispatch to a worker: open the inbound transfer with `Commits`, and
+ ask the primary for the pack with `send_pack` (as checks do). Decide
+ `XcodeAccess`.
+- `needsYou` and the decision text for the two new kinds (task 14 writes
+ the copy).
+- The instance setting `EQUIPO_MAC_ENGINEERING` is read at boot and
+ shown on the Machines page to owners.
+
+Mutations: place on the primary when the pin is removed; omit `claude`
+from the needs; send `xcode_access` without F5; let a 35 worker get
+Engineering; skip the transfer in the dispatch transaction. Each must
+fail a named contract.
+
+## Task 4. Primary: Engineering packs, change files and diffs
+
+Files: `internal/runner/thin/relay.go` (`packCandidate`, `publishWorker`),
+`change_files.go`, `change_diffs.go`.
+
+Tests first (`internal/runner/thin/relay_test.go`):
+
+- `TestPackCommitsYieldsExactlyTheList`: a pack for `commits: [a, b, c]`
+ holds those three commits with complete trees and no other commit.
+ Index it into an empty bare repository and check `rev-list --no-walk`.
+- `TestPackCommitsRefusesUnknownOrForeign`: a commit not in the clone, a
+ non-SHA, or a repository that is not `ValidHub` is refused before git
+ runs.
+- `TestPublishWorkerCarriesChangeFiles`: after a worker publication is
+ pushed, the `published` report carries `ChangeFiles` for base to
+ candidate, and change-diff frames are queued for the worker's task,
+ step and attempt, leaving out the primary's known secrets.
+- `TestPublishWorkerOversizeDeclared`: an inbound Engineering pack over
+ `wire.MaxTransferBytes` is declared oversize. The instance then ends
+ the step `workspace_too_large` (contract in task 3's file).
+
+Changes: `packCandidate` becomes `packCommits(header)`. With an empty
+`Commits` it keeps today's single-candidate behaviour, so checks are
+unchanged. `publishWorker` computes change files and queues diffs at 36
+after a push succeeds. A failure to compute them is a diagnostic, never a
+push failure.
+
+Mutations: walk history (drop `--no-walk`); attach change files before
+the push; include the bearer token in a diff. Each fails a named test.
+
+## Task 5. Darwin Claude Code pin and self-provisioning
+
+Files: `internal/runner/provider/claude/pins.go`, new
+`internal/runner/mac/claude.go`, `thin/mac.go` (`macTools`,
+`newMacHost`).
+
+The worker runs only the 2.1.312 darwin-arm64 binary whose digest
+(task 1, S1) is compiled in as `claude.ExecutableSHA256DarwinArm64`. It
+never runs a `claude` found on `PATH`. It provisions the binary itself,
+so Paul has no install step.
+
+Tests first (`internal/runner/mac/claude_test.go`):
+
+- `TestClaudePinDarwin`: `ReleasePinFor("darwin", "arm64")` is the
+ constant; every other darwin arch has none.
+- `TestProvisionChecksDigestBeforeExec`: a served binary with one byte
+ changed is refused, never made executable, and leaves nothing behind.
+- `TestProvisionBoundsAndPlace`: size bound (512 MB), written only under
+ `~/.local/lib/equipo-runner/tools/claude-2.1.312/` through an
+ `os.Root`, mode 0700, no symlink followed. An existing file with the
+ wrong digest is replaced.
+- `TestProvisionOnlyFromTheOfficialURL`: the URL is built from the
+ version and platform constants. Configuration can name a local file
+ for tests only under the `testbuild` tag.
+- `TestVerifyBeforeEveryLaunch`: the launcher re-hashes the file before
+ each launch (the cost is acceptable: once per step). A swapped file
+ stops the launch with `engineering_unavailable`.
+- `TestCapabilitiesClaudeVersionOnlyWhenPinned`: `harness.claude` is
+ reported only for a verified pinned binary.
+
+Env-gated (`EQUIPO_CLAUDE_DARWIN_BINARY=<path>`), run once on docs-t1
+with the task 1 download: the real binary matches the pin.
+
+Mutations: skip the digest check; follow a symlink; accept `PATH`
+`claude`. Each fails a named test.
+
+## Task 6. Darwin MCP tool endpoint
+
+The Linux tool proxy stays byte-identical. Its certified digest check in
+`make release-runner` must stay green, so do not touch `internal/toolproxy`.
+On darwin, `equipo-runner tool-proxy --socket <path>` speaks the same
+stdio MCP protocol to the CLI and the same framing to the runner's step
+socket.
+
+Files: `internal/runner/tool_proxy_serve_darwin.go` (now refuses), a new
+darwin-only command in `cmd/equipo-runner`, `thin/mcp.go`
+(`openToolSet`), `thin/toolsocket_other.go`.
+
+Tests first:
+
+- `TestDarwinToolProxySpeaksTheProtocol` (builds on Linux with a
+ `darwin || testbuild` split for the shared code): the permission tool,
+ `submit_candidate` and `ask_person` round-trip through a socket pair,
+ with the same replies the Linux proxy gives (a recorded transcript
+ from the Linux proxy's tests is the oracle).
+- `TestToolSocketPeerUID`: on darwin the socket accepts only the
+ runner's own uid (`LOCAL_PEERCRED`, `peer_darwin.go`); the test fakes
+ the peer check through its seam.
+- `TestToolSocketPathFits`: the step socket path stays under 104 bytes on
+ a Mac (`/Users/<name>/...` paths are long; use the scratch root's short
+ `t/` directory).
+- The existing release test that the Linux tool proxy is the certified
+ build passes unchanged.
+
+Mutations: accept any peer uid; reply allow to a permission request the
+Linux proxy denies. Each fails a named test.
+
+## Task 7. Native permission port
+
+Spec §4.4, "Native file permissions, ported explicitly". Files:
+`internal/runner/provider/claude/answers.go` and its tests.
+
+Make the workspace root (and the read-only research root) a policy
+field. Linux keeps `/workspace` and `/research`, and its certified
+policy hashes must not change: assert the Linux settings bytes are
+identical before and after.
+
+Tests first (`answers_test.go`, new `answers_darwin_policy_test.go`
+running on Linux with a temp dir standing in for the Mac paths):
+
+- `TestPermissionLinuxUnchanged`: every existing answer test passes with
+ the root `/workspace`; the generated Linux settings hash is unchanged.
+- `TestPermissionRootIsResolved`: a request for `<root>/a` is allowed;
+ the same file through a symlinked alias of the root (the stand-in for
+ `/var` to `/private/var`) is resolved with `realpath` and allowed only
+ if it lands inside the real root.
+- `TestPermissionRefusesEscapes`: `..` components, a glob whose
+ expansion leaves the root, an absolute path outside, a symlink inside
+ the tree pointing out, and a symlink swapped between check and use
+ (the generated native deny rules are the second layer; the test shows
+ the deny rule matches the target).
+- `TestPermissionDeniedPathsGenerated`: Read, Edit, Write, Glob and Grep
+ deny rules are generated for every §4.2 path (runner state, accounts
+ root, session homes, `~/.ssh`, `~/.aws`, `~/.gnupg`, `~/.config/op`,
+ `~/Library/Keychains`, every other `/Users/*` home, `/Volumes`, the
+ install dir), each as `Tool(/<path>)` and `Tool(/<path>/**)`.
+- `TestStepAndReadPermissionShareThePort`: `StepPermission` and
+ `ReadPermission` take the same policy and refuse the same escapes.
+- "Nobody to ask" stays the default for anything not decided.
+
+Mutations: compare prefixes without resolving; drop the `..` check;
+skip generating one deny path. Each fails a named test.
+
+## Task 8. Darwin Engineering policy and settings
+
+Files: new `internal/runner/mac/engineering.go` (settings and policy),
+`internal/runner/provider/claude/launcher_darwin.go` or a
+`darwinPolicy` beside `PolicyInputs`, `internal/runner/mac/profile.go`
+(share the §4.2 path list with checks).
+
+The darwin policy is its own certified shape, not `provider.BuildPolicy`
+with bubblewrap fields faked. It records: the pinned CLI digest, the
+argv, the settings JSON, the MCP JSON (the darwin tool endpoint), the
+workspace root, the attempt scratch, the denied paths, the environment
+keys, and `xcode_access`. Before launch the launcher regenerates it from
+its inputs and requires byte equality, as `validatePolicy` does.
+
+Settings, generated per attempt (keys confirmed by task 1, S2):
+
+- `disableAllHooks: true`, plugins off, `autoMemoryEnabled: false`,
+ `--setting-sources ''`, `--strict-mcp-config`, `--disable-slash-commands`,
+ `--permission-mode manual`, `--permission-prompt-tool
+ mcp__equipo__permission`, tools `Bash,Read,Write,Edit,Glob,Grep` (as
+ Linux Engineering).
+- `sandbox.enabled: true`, `failIfUnavailable: true`,
+ `allowUnsandboxedCommands: false`, `excludedCommands: []`,
+ `autoAllowBashIfSandboxed: true`.
+- `filesystem.allowWrite`: the worktree and the attempt scratch. With
+ `xcode_access: sandboxed`, also the attempt's DerivedData under
+ scratch, the runner user's `DARWIN_USER_TEMP_DIR` (resolved as the
+ checks profile does, `mac/usertemp.go`),
+ `~/Library/Developer/Xcode/DerivedData`, and the SwiftPM caches.
+ `denyRead` and `denyWrite`: the §4.2 list plus the connection's
+ dedicated home and its runtime copy.
+- `network.allowedDomains: []` (no network for Bash; if S2 shows empty
+ means "ask", the permission tool answers deny, and F1 proves no
+ connection is made), `allowUnixSockets: []`,
+ `allowLocalBinding: false`, `allowMachLookup`: the P2 list
+ (`mac.CheckMachServices`, narrowed by P2's record) when sandboxed
+ Xcode access is on, else `[]`.
+- `permissions.deny`: task 7's generated rules. `ask`: the native tools
+ on the workspace root.
+- Environment from scratch: `HOME` the runner user's home (Xcode needs
+ it), `CLAUDE_CONFIG_DIR` the runtime copy,
+ `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1`, `DISABLE_AUTOUPDATER=1`,
+ `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`, `TMPDIR` the attempt
+ scratch, `DEVELOPER_DIR` from `xcode-select -p`, a fixed `PATH`, `LANG`,
+ `EQUIPO_ATTEMPT=<marker>`. The token goes by descriptor if S4 found
+ one; otherwise in `CLAUDE_CODE_OAUTH_TOKEN`, and F3 must prove the
+ sandboxed shell cannot read it.
+
+Tests first (`internal/runner/mac/engineering_test.go`):
+
+- `TestEngineeringSettingsExact`: golden JSON for both Xcode modes.
+- `TestEngineeringSettingsRefuses`: a worktree inside a denied place;
+ relative paths; globs; a scratch inside the worktree; a token home
+ inside the worktree.
+- `TestEngineeringNoMachWithoutAccess`: `allowMachLookup` is empty unless
+ `xcode_access` is `sandboxed`.
+- `TestEngineeringPolicyValidatedBeforeLaunch`: one byte changed in the
+ stored settings, a different argv, or an extra environment key stops
+ the launch.
+- `TestEngineeringEnvFromScratch`: nothing from the runner's own
+ environment leaks through except the listed keys (the checks gate's
+ `TestGate` inherited-environment mutation, reused).
+- `TestEngineeringTokenNotInArgvOrPolicy`: the token never appears in
+ argv, the stored policy, the step log or a report.
+
+Mutations: allow network; drop the accounts root from `denyRead`; grant
+Mach lookups without access; inherit the environment. Each fails a named
+test.
+
+## Task 9. Darwin Engineering executor and termination
+
+Spec §5. Files: `internal/runner/mac/gate.go` (pull the process-group
+executor out so the gate and Engineering share it), a new
+`internal/runner/mac/launch.go` implementing `thin`'s `starter` for a
+Mac, `thin/step.go` (`recordedStart`), `thin/state.go` recovery.
+
+The claude process starts in its own session and process group, under
+`caffeinate -i -w`, with the attempt marker in its environment. The
+record (marker, then group id) is written before the process starts, and
+a failed record starts nothing. Cancel or timeout: close stdin, wait for
+a graceful end (as `stopStep`), then `SIGTERM` to the group, 10 s,
+`SIGKILL`, the marked sweep (`ps -E`), `simctl shutdown` for simulators
+the attempt booted. Termination is proven when `kill(-pgid, 0)` is
+`ESRCH` and no marked process is left within 30 s.
+`termination_kind: process_group`.
+
+If task 1 (S5) shows the Bash tool's shell leaves the group, the sweep
+by marker is what catches it. That is why the marker must survive the
+CLI's environment scrub (S5). If it does not survive, stop and raise it:
+the honest limit in §5 would then cover every Bash command, which is not
+acceptable for Engineering.
+
+Tests first (`internal/runner/mac/launch_test.go`, Linux-runnable with
+the `/proc` sweep):
+
+- `TestEngineeringLaunchRecordsBeforeStart`.
+- `TestEngineeringTerminationGroupAndMarker`: a fake CLI that forks a
+ child which calls `setsid` (leaves the group) but keeps the marker.
+ The sweep kills it, and the proof waits for it.
+- `TestEngineeringTerminationUnprovenKeepsRecord`: a marked process that
+ survives SIGKILL (simulated by the seam) leaves the step unterminated.
+ No Retry until a restart proves it.
+- `TestRestartKillsMarkedEngineering`: startup after a crash kills every
+ marked process and reports `runner_restarted` with the proof.
+- `TestEngineeringShutsDownBootedSimulators`: only the simulators the
+ attempt booted (recorded `simctl list` before and after).
+
+Mutations: proof without the sweep; record after start; shut down
+simulators that were already booted. Each fails a named test.
+
+## Task 10. Worker Engineering `Exec`, secret check, outbound pack
+
+Files: `internal/runner/thin/worker.go` (split into `worker_checks.go`
+and `worker_engineering.go` to stay under the size budget),
+`engineer.go` (share `stepPrompt`, `fixPrompt`, `rebasePrompt`,
+`commitMessage`, `splitHeadline`, `emptyStepReason`), `relay.go` (the
+worker's outbound upload), `state.go` (phases).
+
+Flow for one attempt on a worker:
+
+1. Guards: specialist Engineering; owner; `ValidHub`; `ValidTaskBranch`;
+ protocol 36 spoken; a non-empty base; `engineering_unavailable` when
+ the CLI is unpinned, the F probes have not passed, or the home guard
+ (task 14) fails; `XcodeAccess` not stronger than the worker's own
+ trusted report allows.
+2. Marker recorded, lease (`AuthorizeStep`).
+3. Await the inbound pack. Check the header against the step row,
+ including `Commits`. Index it. Require each listed commit with a
+ complete tree.
+4. Prepare the tree in the worker's steps dir under scratch, from the
+ worker store with only those commits. For a rebase round, use
+ `TaskTree.Rebase` (merge-tree with the explicit merge base, which needs
+ only the three commits).
+5. Pick a connection among the worker's own (task 11). Failover among
+ them on limit or sign-in refusal, as `refused` does on the primary,
+ with a fresh tree each time.
+6. Run through the darwin launcher (tasks 8 and 9). Keep the session for
+ fix rounds and questions (task 12). Fix rounds resume the kept
+ session as on Linux (`fixSession`).
+7. Commit with the existing `tree.Commit` (Equipo Engineering identity,
+ parent the base). Same rules for unfinished (`step_timeout`), no-shell
+ and empty results. Compute `Apple` from changed files.
+8. **Secret check** before anything leaves: for every known secret of
+ this worker (each connection's token, its runner credential, the seal
+ key's private half if stored), as raw text and base64, over the diff
+ `base..candidate`; then the pinned darwin gitleaks with the trusted
+ configuration, offline, inside srt with no network, over the changed
+ files. Any hit ends the step `secret_in_candidate` with no upload; the
+ log line names the file, never the secret.
+9. Record phase `committed` durably, report `committed` with the
+ candidate. The instance opens the outbound transfer. Upload the thin
+ pack (`pack-objects --revs --thin` of `^base candidate`) as blob
+ frames. End `done`, `pushed: false`.
+10. Restart after `committed`: resume the upload, never run the CLI
+ again for that attempt.
+
+Research hand-off: the quoted findings text arrives in the dispatch, as
+on the primary. Kept images are not relayed in slice F, and the prompt
+says the images stay on the main runner. Explore tasks: the same
+Engineering step; the preview runs on the primary from the published
+candidate.
+
+Tests first (`internal/runner/thin/worker_engineering_test.go`, with the
+fake CLI and the process-group executor without a sandbox, `testbuild`
+only):
+
+- `TestWorkerEngineeringCommitsAndUploads`: one attempt to `done`,
+ `pushed: false`. The outbound pack indexes on the primary side
+ (`publishWorker`) to exactly the candidate.
+- `TestWorkerEngineeringRefusesGuards`: one case per guard in step 1.
+- `TestWorkerEngineeringRebaseRound`: conflicts listed in the prompt; the
+ commit's parent is the new base.
+- `TestWorkerEngineeringFixRoundResumes`: the second round resumes the
+ kept session on the same worker.
+- `TestWorkerEngineeringSecretInCandidate`: the fake CLI writes the
+ connection's token (raw, then base64) into a file. Refused, nothing
+ uploaded, the log names the file only. A gitleaks-detectable fake key
+ is refused too.
+- `TestWorkerEngineeringRestartAfterCommit`: SIGKILL after `committed`;
+ the restart uploads and never relaunches the CLI.
+- `TestWorkerEngineeringFailover`: the first connection is limited; the
+ second runs from a fresh tree; usage of both reported.
+- `TestWorkerChecksUnchanged`: every existing worker checks test passes.
+
+Mutations: skip the base64 form; upload before the secret check; reuse
+the refused attempt's tree; relaunch after `committed`; accept a
+`pushed: true` path. Each fails a named test.
+
+## Task 11. Worker connections and "Add Claude to <Mac>"
+
+Files: `thin/run.go` (`runWorker`: `Conns`, seal key, hello
+connections), `thin/conns.go`, `thin/connector.go`, `thin/token.go`,
+`thin/signin.go`; instance `internal/equipo/chat/connections.go`,
+`internal/equipo/chat_connections.go`, `connections_view.go`, templates.
+
+Runner side: a worker at 36 opens `Conns` over its own accounts root,
+sends `Connections` and `SealKey` in hello, and accepts the same connect
+commands the primary does, addressed to its runner id. Only Claude token
+connections, either a pasted token or the sign-in by link where the
+worker runs the pinned CLI's `setup-token` in a pty. Codex, API key and
+endpoint kinds are refused on a Mac with a clear reason.
+
+Instance side: the Connections page groups rows by machine (the primary's
+first, then each worker by label). For a person with a Mac worker at 36
+it offers "Add Claude to <Mac>". Starting a connection names the runner
+id; the card seals to that runner's key; the runner check in the
+transaction (`runner_id = ?`) already scopes acceptance. Needs you
+`mac_connection` links straight to that card.
+
+Tests first:
+
+- `TestContractWorkerConnectionScoped` (thintest): a connection started
+ for the worker is delivered only to the worker's mailbox; a sealed
+ token for the worker cannot be accepted by the primary, or the reverse;
+ a worker below 36 is never offered.
+- `TestWorkerHelloConnections` (thin): hello lists the worker's
+ connections and seal key at 36, none at 35.
+- `TestWorkerTokenConnectionStored` (thin): the token lands in
+ `.oauth-token`, 0600, in a 0700 dedicated home under the accounts root.
+ A home guard failure (task 14) refuses to store it.
+- `TestWorkerSetupTokenUsesPinnedCLI`: the sign-in pty runs only the
+ pinned binary.
+- `TestConnectionsPageGroupsByMachine` (equipo): rows grouped, "Add
+ Claude to Tito Studio" shown only for a Mac worker at 36.
+- `TestWorkerRefusesOtherConnectionKinds`.
+
+Mutations: deliver a worker connection to the primary; show the add
+button for a worker at 35; store the token with 0644. Each fails a named
+test.
+
+## Task 12. Ask the implementer, pinned on the worker
+
+Spec §1.4 and §4.4. Files: `thin/ask.go`, `thin/run.go` (`runWorker`
+wiring for asks), the worker's kept-session store.
+
+The worker keeps the Engineering session per (step, attempt, account,
+session id) under its state dir with the same retention as the primary.
+An ask placed on the step's runner (built in slice B) runs the `answer`
+action there, with `git_log`, `git_diff` and `git_show` over the worker's
+store, on the kept session. It uses Read-only native tools under the
+ported `ReadPermission` (task 7) and the same darwin launcher with the
+read-only settings: `denyWrite` includes the worktree.
+
+Tests first:
+
+- `TestWorkerAskAnswersFromKeptSession`.
+- `TestWorkerAskRefusesOtherAttemptOrAccount`: a later attempt, another
+ account, or a session id that is not the recorded one is refused.
+- `TestContractAskMacOffline` (thintest): the worker is offline, so the
+ answer is "Tito Studio is offline; ask again when it is back" (exists
+ as `TestContractAskOfflineRunner`; extend it for a Mac-made step).
+- `TestWorkerAskCannotWrite`: the read-only settings deny writes to the
+ worktree.
+
+Mutations: answer on a non-pinned attempt; allow Write in the answer
+settings. Each fails a named test.
+
+## Task 13. Shipped probes F1 to F5, and the `claude` tag
+
+Files: `internal/runner/mac/probe.go`, a new `probe_engineering.go`, the
+fixture under `internal/runner/mac/fixtures/`, `thin/mac.go`
+(`macProbes`), `thin/capabilities.go`.
+
+The probes ship in the binary and run on the Mac as the runner user, as
+P1 to P7 do. They are reported in `capabilities.probes` and trusted only
+for this runner version, this settings profile and the verified pinned
+CLI, for under a day. They run once a Claude connection exists, with
+**one short probe turn** on the connection's glance model, prompted to
+run one fixed script with Bash. The verdict never reads model text. As
+in P2: every probe has a control that must succeed, a missing line is
+not a denial, and outside observers (a loopback listener, sentinel
+files with nonces) decide.
+
+- **F1 sandbox on, no network.** The script's control writes a nonce to
+ the worktree (must appear). A TCP connect to a loopback listener the
+ runner holds, a DNS lookup of a name the runner watches, and an HTTPS
+ request through the CLI's proxy must all fail, and the listener sees
+ nothing.
+- **F2 reads denied.** Nonce sentinels in the runner state dir, the
+ accounts root, the connection's runtime copy, `~/Library/Keychains`,
+ another `/Users/*` home (one P4 shows closed) and `/Volumes`: none of
+ their nonces may appear in the worktree.
+- **F3 the token is out of reach.** From inside Bash the script copies
+ whatever each source yields into the probe tree: `ps -E -p $PPID`,
+ `ps -E` of every own process, `sysctl kern.procargs2` of the CLI's pid,
+ `launchctl getenv CLAUDE_CODE_OAUTH_TOKEN`, `env`, and the token file
+ read by path. The runner then searches the probe tree for the token,
+ raw and base64, and deletes the tree. The probe tree is never
+ committed, uploaded or logged. Any hit fails F3.
+- **F4 process group.** The script forks a `setsid` child that sleeps.
+ The runner cancels the turn; the marked sweep must find and end it,
+ and the proof must hold.
+- **F5 Xcode under Claude's sandbox.** Run only when P2 is `denied`. The
+ P2 hostile fixture (run-script phase, SwiftPM build tool plugin,
+ XCTest on the newest iPhone simulator) is built and tested by
+ `xcodebuild` from the Bash tool under the `xcode_access: sandboxed`
+ settings. Every sentinel read, connection and Keychain read must be
+ denied, and the build and test must complete (a failed build is not a
+ denial).
+
+The `claude` tag is reported when the pinned CLI is verified, F1 to F4
+are `denied`/`passed` for this version and profile, the home guard
+passes, and at least one Claude connection is usable. F5 decides only
+`xcode_access`. The Machines page shows F1 to F5 beside P1 to P7.
+
+Tests first (`internal/runner/mac/probe_engineering_test.go`, recorded
+outputs and fakes):
+
+- `TestF1RequiresControlAndListener`: a "denied" line with the listener
+ hit is a failure; a missing control is `unavailable`.
+- `TestF2NoncesDecide`.
+- `TestF3AnySourceYieldsSentinelFails`.
+- `TestF4SweepProof`.
+- `TestF5OnlyAfterP2AndNeedsTheBuild`.
+- `TestClaudeTagNeedsEverything`: drop any one input and the tag goes.
+- `TestProbeTurnVerdictIgnoresModelText`: the fake CLI claims success
+ in text while the sentinels say otherwise; the verdict follows the
+ sentinels.
+
+Mutations: accept a missing line as denied; ignore the listener; give
+the tag without a connection; run F5 before P2. Each fails a named test.
+
+## Task 14. Home guard, D1 default, views and copy
+
+**Home guard** (spec §8.3). A worker refuses to store or use a model
+connection while another user can list or traverse its home, or read
+its state dir, config dir or accounts root. The check is the same
+list/traverse/open test P4 uses, run against the runner's own paths,
+plus mode bits and ACLs (`ls -led`). The refusal text says the one fix:
+"Run `chmod 700 ~` as <user> on <Mac>, then try again." The worker does
+not change permissions itself; that would be changing Studio state
+without the person.
+
+**D1 default** (spec §8.7, Paul may overrule). While a Mac worker holds
+a model connection, the instance does not offer "Run outside the
+sandbox" for checks on it (`macsandbox.go`), and the worker refuses an
+unsandboxed dispatch (`sandbox_unproven`). Isolate this in one predicate
+(`unsandboxedAllowed(runner)`) so that if Paul rules otherwise the change
+is a few lines plus a warning string.
+
+**Views.** The step line names the Mac when Engineering ran on a worker
+(house rule 2026-11-07.8: only when it is not the primary). Without
+Xcode access, the Engineering card says the Mac's checks build it. The
+new waits and Needs you lines show (`mac_connection`, `mac_update`,
+`workspace_too_large`, `secret_in_candidate`). The Machines page shows
+F1 to F5 and whether Engineering can run there.
+
+**Copy** (drafts; Luna reviews all, Paul sees the user-facing card
+lines). Write every new string to `copy.go` as `// COPY REVIEW PENDING`
+and to `docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json` in the
+copy-review skill's format, each with its key, context and draft.
+Starting drafts:
+
+- `work.needs.mac_connection`: "Needs you: %s needs Claude to make this
+ change"
+- `work.decide.mac_connection_why`: "This change needs a Mac. %s is
+ ready, but it has no Claude connection yet."
+- `work.decide.mac_connection_ask`: "Add Claude to %s and it starts by
+ itself."
+- `chat.connections.add_to`: "Add Claude to %s"
+- `work.needs.mac_update`: "Needs you: %s needs an update to make
+ changes"
+- `work.reason.workspace_too_large`: "the project is too large to send
+ to the Mac"
+- `work.reason.secret_in_candidate`: "the change contained a secret, so
+ it was not sent"
+- `work.step.made_on`: "Made on %s"
+- `work.step.no_xcode`: "Built and tested by the Mac's checks, not
+ while making the change"
+- `runner.mac.home_open`: "Other people on this Mac can open %s's
+ home folder. Run chmod 700 ~ as %s, then try again."
+- `runner.engineering`: "Makes changes" / `runner.engineering_off`:
+ "Doesn't make changes yet"
+- the F1 to F5 probe names and verdict lines, following
+ `runner.probe.P1` and on.
+
+The `mac-placement-wait` strings that slice F makes untrue
+(`work.needs.mac_engineering`, `work.decide.mac_engineering_why`:
+"Mac runners can't make changes yet") are rewritten for the switch-off
+case only ("Mac changes are turned off on this Equipo") and go into the
+same JSON.
+
+Tests first: `TestHomeGuard*` (thin, with temp homes and modes),
+`TestUnsandboxedNotOfferedWithConnection` (thintest),
+`TestMacEngineeringViews` (equipo, each line on the step, task and
+Needs you), and `make copy-release-check` stays as it is (pending copy
+blocks release, which is correct).
+
+Mutations: let the guard pass a 0750 home; offer the unsandboxed choice
+with a connection held. Each fails a named test.
+
+## Task 15. M9 on Linux CI
+
+Files: `internal/headless/mac_test.go` (extend `TestMacWorker`),
+`thin/fakeworker_testbuild.go`, `internal/fakeclaude`.
+
+The fake worker is the real thin runner under `testbuild` with
+`EQUIPO_FAKE_PLATFORM=darwin/arm64`, the fixture capability report with
+F1 to F5 `denied`, the fake CLI, and the process-group executor without a
+sandbox. `scripts/no-fake-worker.sh` keeps it out of releases.
+
+Scenarios, inside the headless budget:
+
+- **M9a** Woodstar-shaped repository (an `.xcodeproj` with a shared
+ scheme and an `.equipo/gates.json` gate needing Xcode). Engineering is
+ placed on the worker, the inbound pack is relayed, the fake CLI edits
+ a Swift file, the worker commits and uploads a thin pack, the primary
+ pushes, change files and diffs appear, checks run on the worker, review
+ runs on the primary, Ready to merge asks (no auto-merge).
+- **M9b** a fix round from the checks output stays on the worker and
+ resumes its session; a push failure then Retry republishes the same
+ commit without running Engineering again.
+- **M9c** a rebase round on the worker.
+- **M9d** ask the implementer answered on the worker; refused for
+ another attempt; the offline line when the worker is stopped.
+- **M9e** the worker is SIGKILLed mid-Engineering: process-group
+ termination, Retry on the same worker, done.
+- **M9f** switch off: the step waits, nothing reaches the worker.
+- **M9g** a worker at protocol 35 (a binary built from `main` at the
+ branch point, cached as M8 does): `waiting_mac_update`, never an
+ Engineering dispatch.
+- **M9h** secret in candidate: refused, nothing pushed.
+- The `oficina/suite` scenario and every slice 1 to 4 and A to E
+ scenario stay green, especially Linux termination before Retry.
+
+## Task 16. Release, docs, `make ci`, whole-branch review
+
+- The release needs no new Mac artifact: the runner provisions the CLI
+ (task 5), and gitleaks for darwin already ships. `make release-runner`
+ and `scripts/staged-artifacts.py` stay green. The Linux tool proxy
+ digest is unchanged.
+- `docs/mac-runner.md` gains "Make changes on the Mac": turn the switch
+ on (owner), `chmod 700 ~` as the runner user if the Machines page asks,
+ then "Add Claude to <Mac>" and sign in. This is draft copy, so it goes
+ in the copy JSON.
+- `make ci` once. Fix what it finds. Push.
+- Whole-branch Astra review (max three rounds), then the controller
+ report and a handoff with the witness runbook for task 17.
+
+## Task 17. Live witness on production (not the controller's to start)
+
+Runs only after the parent has merged and deployed the release
+(`scripts/upgrade-thin.sh`, per AGENTS.md), the Studio has self-updated,
+and the owner has set `EQUIPO_MAC_ENGINEERING=1`. The controller writes
+the runbook and the read-only checks. It does not run any of the steps
+that change things.
+
+1. The Machines page shows the Studio at protocol 36, P1 to P7 and the
+ home guard. If the guard fails, Paul runs `chmod 700 ~` as
+ `paulequipo` (his step).
+2. Paul taps "Add Claude to Tito Studio" and signs in (his step). F1 to
+ F5 run; the Machines page shows them, and `claude` appears in the
+ Studio's tags.
+3. The Woodstar swipe-back witness task (`tklkbx5vid3y` from
+ `82a4a0cc`, or a fresh "Fix the Woodstar iOS swipe-back bug"):
+ Engineering on Tito Studio, with `xcode_access` as F5 decided;
+ candidate relayed, pushed by docs-t1; checks on the Studio record
+ `xcodebuild test` (or Woodstar's gate), a real exit code and 200
+ lines; review on docs-t1; a fix round, if any, on the Studio; one ask
+ to the implementer answered from the Studio; Ready to merge asks Paul.
+ Nothing auto-merges.
+4. Read-only checks afterwards: no unmarked processes left on the Studio
+ (`ps` as paulca), the worker's step dirs swept, and the outbound
+ transfer closed.
+
+Pass means every line of step 3 happened as written. A Woodstar build
+failing for Woodstar's own reasons is still a pass if the failure is
+reported honestly.
+
+## 3. Risks and honest limits
+
+- `sandbox-exec` is deprecated. `failIfUnavailable` turns its removal
+ into a stop (`engineering_unavailable`), never a silent unsandboxed
+ run.
+- The claude process itself runs outside any sandbox on the Mac, as the
+ runner user, talking to Anthropic (the trust Paul granted, §4.4). Its
+ native file tools are confined by permission rules (task 7), not by
+ Seatbelt.
+- Without F5 the Mac makes changes it cannot build while making them.
+ Checks build them, so fix rounds cost a round trip. That is slower, not
+ unsafe.
+- SwiftPM packages need network to resolve. Bash has none, so a project
+ whose packages are not already in the runner user's caches fails its
+ build with `needs_network`, honestly. A package mirror is later work.
+- A shared CPU: one step at a time per worker, so a long Engineering
+ step delays that Mac's checks.
+- `have` lists and thin inbound packs remain open (slice B note).
+ Engineering inbound packs are whole packs of the listed commits, so
+ large repositories hit the 64 MB bound early.
diff --git a/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md b/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md
index c51f799a..40618511 100644
--- a/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md
+++ b/docs/superpowers/specs/2026-11-07-equipo-mac-runners.md
@@ -645,3 +645,220 @@ per candidate; the 64 MB bound and TTL keep it small, and the instance
stores opaque bytes it never interprets. The mailbox migration touches
every command path; slice A ships alone, with every slice 1 to 4
scenario green before B begins.
+
+## 8. Addendum, 2026-11-28: slice F against today's code
+
+Written while planning slice F (plan
+`docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md`), from `main`
+at 8bd40ed1, the unmerged branch `mac-placement-wait` (570375ec) and
+read-only probes of tito-studio as `paulca`. Sections 1 to 7 stay as
+accepted; where this section disagrees with them about slice F, this
+section is current. Nothing here reopens slices A to E.
+
+### 8.1 Facts that moved
+
+- **Numbers.** Migrations are past 0114 and the runner protocol is 35
+ (`wire.ProtocolCurrent = ProtocolChangeDiffs`). "Migration 0045" and
+ "protocol 2" in §§1 to 3 are history. Slice F takes the next protocol
+ (36, `ProtocolMacEngineering`, confirmed with the parent before code,
+ since other branches also allocate numbers) and at most one migration.
+- **The machine.** tito-studio is reached at its own Tailscale address
+ (100.76.110.54), not 100.64.0.1. It runs macOS 27.2 on an M5 Ultra (36
+ cores, 96 GB), Xcode 27.2 (27B52), with iOS 27.0 and 27.2 simulator
+ runtimes. Seven people have homes there and several run Claude Code
+ sessions all day, so it is a busy shared machine. Sleep is off.
+ `DevToolsSecurity` reports developer mode off; simulator work as a
+ `_developer` member does not need it.
+- **The runner user** is `paulequipo` (Paul, 2026-11-10 and 2026-11-13:
+ any Standard user with "equipo" in its name; the 11-11 taint
+ accepted). Its home is `drwxr-x---` group `staff` with no ACL for
+ other users, so **every other Studio user can list and traverse it**
+ (verified from `paulca`). Paul's own home has the ACL that shuts out
+ `paulequipo`; the reverse direction was never needed while the Mac
+ held no secret. Slice F puts a model credential on the Mac, so it now
+ matters (§8.3).
+- **Enrolment.** The Studio is enrolled to production as worker "Tito
+ Studio" (2026-11-28). One enrolment per macOS user, so there is no
+ staging worker. The slice F witness therefore runs on production
+ behind an instance switch (§8.6), unless Paul makes a second Mac user
+ for staging.
+- **Placement.** `mac-placement-wait` (to merge before slice F) makes
+ Mac work wait instead of running on Linux: checks needing macOS with no
+ fitting runner wait (`waiting_mac`), and Engineering for a repository
+ whose base gate needs Xcode (`RepoInfo.NeedsMacOS`) never runs on a
+ Linux primary (`waiting_mac`, or `waiting_mac_engineering` while the
+ only fitting runners are workers). §1.4's "Engineering runs on the
+ primary with today's summary" no longer holds. Slice F replaces
+ `waiting_mac_engineering` with placement on the worker.
+- **Checks sandbox.** srt is installed privately with pinned Node,
+ ripgrep and lockfile, not `npm install -g`. The P2 verdict lives only
+ in the worker's memory and is trusted only under those pins; a runner
+ that ever ran checks outside the sandbox is tainted for good. Ruling 2
+ became, by delegation (2026-11-11), "checks wait for the Mac's
+ sandbox; the task's creator may run one attempt outside it from the
+ task page" (`chat/macsandbox.go`).
+- **Accounts.** §3.4 (`equipo-runner login claude`, the Keychain
+ hypothesis, probe P3) is superseded by Connections (2026-11-08) and
+ token connections (Paul, 2026-11-10): a pasted or runner-made
+ `claude setup-token` token rests in `.oauth-token` in a dedicated home
+ and reaches the CLI as `CLAUDE_CODE_OAUTH_TOKEN`, with
+ `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1`. Connection rows carry a
+ `runner_id`, but a worker's hello sends no connections and no seal
+ key, and the Connections page only adds to the primary.
+- **Claude Code pin.** Every runner pins Claude Code 2.1.312 by digest:
+ `claude.ExecutableSHA256` is the certified linux/amd64 build, with an
+ arm64 test pin. There is no darwin pin. Many runner behaviours were
+ read statically from 2.1.312 (subprocess scrub, remote settings,
+ setup-token), so the Mac must run the same version.
+- **Engineering on Linux** is no longer "`claude -p` as today" plus a
+ settings file. It is a certified launch: `provider.BuildPolicy` needs a
+ bubblewrap version, `/opt` mounts, `/home/runner` and `/workspace`;
+ the CLI runs inside the containment namespace, and its own Bash sandbox
+ runs nested inside that. None of this exists on a Mac. The Darwin path
+ needs its own policy and launcher (§8.2).
+- **The tool proxy.** Engineering's permission prompt and
+ `submit_candidate` reach the runner through the MCP tool proxy. The
+ Mac release has no tool proxy (its Linux build's digest is certified,
+ and a portability edit changed its bytes). On a Mac the runner binary
+ itself serves that MCP endpoint in a darwin-only mode; the Linux tool
+ proxy stays byte-identical.
+- **Injection defences** (2026-11-19). Gates come from the base
+ (`.equipo/gates.json`), and "Mac worker results remain diagnostic until
+ their executor can enforce immutable base gates, and cannot grant
+ standing auto-merge authority." Slice F keeps that: a Mac-made
+ candidate merges only on a person's tap. Prompts quote untrusted text
+ in data blocks; the worker builds its prompts with the same functions.
+- **Secrets in candidates.** gitleaks 8.30.1 is pinned and ships for
+ darwin/arm64 too. Engineering's change diffs leave out the primary's
+ known secrets. For a worker's candidate, the worker checks its own
+ known secrets before upload (§8.3) and the primary computes change
+ files and diffs when it publishes. `PublishedReport` carries neither
+ today.
+- **carlos guard.** Previews, sites and the devbox need the guarded
+ `carlos` CLI. They stay on the primary; a worker never looks carlos up.
+- **Engineering grew** after 11-07: kept sessions and fix rounds that
+ resume them, unfinished work kept on `step_timeout`, rebase rounds
+ (`merge-tree` with an explicit merge base), the Research hand-off
+ (quoted findings plus kept images), scheduler holds, failover across
+ connections, change diffs, task kinds (`change`, `explore`). A worker
+ carries each one or refuses it out loud (plan task 10). Copy, Design,
+ Research, Preview, Publish and Merge steps stay on the primary.
+
+### 8.2 The Darwin Engineering launch
+
+The worker runs the pinned 2.1.312 darwin-arm64 CLI, which it fetches
+itself from the official release and checks against a digest compiled
+into the runner. It never runs a `claude` from `PATH`, and it never
+needs Paul to install one. Each launch gets:
+
+- the §4.4 Engineering settings, generated per attempt and checked
+ byte-for-byte before launch, as `validatePolicy` does on Linux.
+ Settings keys the pinned build does not read are a stop, not a guess.
+ Plan task 1 reads them statically from the binary;
+- the worktree at its real path (`realpath`, no `/private` alias) as the
+ workspace root of the ported native permission rules (§4.4);
+- the runner's darwin tool-proxy mode as the only MCP server, on a
+ 0600 socket in a 0700 directory, peer uid checked;
+- a runtime copy of the connection's dedicated home as
+ `CLAUDE_CONFIG_DIR`, and the token in the environment, or through a
+ file descriptor if the pinned build reads one (task 1 checks);
+- process-group termination exactly as §5, reusing the checks gate's
+ executor.
+
+**Xcode access for Engineering follows the proof.** Engineering's Bash
+sandbox gets the Mach services Xcode needs only when this Mac's P2 is
+denied **and** probe F5 (P2's hostile fixture built by `xcodebuild`
+under Claude's own sandbox settings, since the CLI's embedded sandbox
+runtime is not the pinned srt) is denied too. Otherwise Engineering on
+the Mac runs with no Mach services: it edits, reads and uses tools that
+need no Xcode service. The build and test then happen in Checks, and
+the step says so. Reason: code that XCBBuildService or a simulator runs
+for the repository would run outside Seatbelt, with network, as the user
+that now holds a Claude token.
+
+### 8.3 A model credential on a shared Mac
+
+Until now the Mac held only its runner identity. After slice F it holds
+a long-lived Claude token. Three consequences, all in the plan:
+
+1. **Unix permissions.** The worker refuses to store or use a model
+ connection while its home, state dir, config dir or accounts root can
+ be listed or read by another user. It says the one command that fixes
+ it, run as the runner user: `chmod 700 ~`.
+2. **The sandbox is the only thing between repository code and the
+ token.** On Linux a PID namespace hides the CLI's environment from its
+ Bash commands. On a Mac there is no namespace, so probe F3 checks,
+ from inside the CLI's Bash sandbox, that the CLI's environment and the
+ token file cannot be read (`ps -E`, `sysctl kern.procargs2`, the file
+ by path). If F3 is not denied, the worker takes no Engineering.
+3. **Outside-the-sandbox runs reach the token.** A check run outside the
+ sandbox on that Mac (the creator's per-attempt choice) runs as the user
+ that holds the token, with network. **Decision for Paul, D1** (§8.7).
+
+The worker also checks every candidate before upload, for each of its
+known secrets (its connections' tokens and its runner credential, also
+base64-encoded) and with gitleaks under the trusted configuration. A
+hit refuses the step with `secret_in_candidate`; nothing is uploaded.
+
+### 8.4 Packs for Engineering
+
+An inbound Engineering transfer names exactly the commits its pack must
+yield (`TransferHeader.Commits`, protocol 36): the base; for a rebase
+round, also the old base and the candidate. The worker's tree has only
+those commits, no history, like the depth-1 clones the index already
+makes. The outbound pack is thin against the base (`^base candidate`),
+which the primary already indexes with `--fix-thin` beside its clone.
+Repositories without commits are never Mac work (no gate, so no
+`needs_macos`), and a worker refuses an empty base. The 64 MB bound
+stands. Over it, Engineering ends `workspace_too_large` with Needs you,
+rather than running on Linux.
+
+### 8.5 Placement, pinning and connections
+
+Engineering for Mac work needs `macos`, `xcode`, `ios_simulator` (when
+the repository has a shared scheme) and `claude`. A worker advertises
+`claude` only when the pinned CLI is verified, F1 to F4 passed for this
+version and profile, and it holds at least one usable Claude
+connection. When a Mac fits everything but `claude`, the step waits with
+a reason the person can act on: no Claude connection on that Mac ("Add
+Claude to Tito Studio"), or the Mac's runner is older than protocol 36.
+Pinning (§1.4) is unchanged and now real: fix rounds, retries, rebases,
+republishes and questions go to the task's Engineering runner. A removed
+pinned worker leaves the task at Recover. It is never re-pinned silently
+to the Linux primary.
+
+Connections on a worker: its hello sends its connections and its seal
+key; the Connections page groups connections by machine and offers "Add
+Claude to <Mac>" for a Mac worker. The token is sealed to that worker's
+key in the browser, or made by that worker's own `setup-token` sign-in,
+as on the primary. Only Claude token connections run on a Mac in slice
+F. Codex stays slice G; metered and endpoint connections stay on the
+primary.
+
+### 8.6 Witness and switch
+
+`EQUIPO_MAC_ENGINEERING=1` on the instance enables placement on a
+worker. Unset, Mac Engineering waits as `mac-placement-wait` left it, so
+the release can deploy inert. The live witness (§6, M9, slice F row) runs
+on production with the Studio after the release is deployed by whoever
+holds that authority. It needs Paul once: to sign in when adding Claude
+to Tito Studio. M9 itself runs offline on Linux CI with the test build's
+fake worker and fake CLI.
+
+### 8.7 Decisions
+
+- **D1 (Paul).** A Mac that holds a model connection: may a check still
+ run outside its sandbox on the creator's choice? Recommended default,
+ which the plan builds: **no.** While a Mac holds a model connection,
+ the "Run outside the sandbox" choice is not offered for it, and the
+ worker refuses an unsandboxed dispatch. Checks there wait for the
+ sandbox. If Paul rules yes, the choice stays, its warning names the
+ Claude connection, and the connection is marked "sign in again" after
+ such a run. Either way the change is small and is isolated in plan
+ task 14.
+- **Settled here, by the controller's reading of the accepted rulings:**
+ Review stays on the primary (the table's "Mac Engineering and Review"
+ means Review of Mac-made candidates). Research images are not relayed
+ in slice F; the findings text is, and the prompt says the images are on
+ the main runner. A tainted Mac may still run Engineering: its candidate
+ is reviewed on the primary, cannot push, and merges only on a tap.