Tart ci

From danielraffel/pulp · View interactive version

Tart ci is an AI agent skill from the GitHub repository danielraffel/pulp. Stand up a fast, cached, isolated, disposable macOS CI lane on Tart — layered golden VM images, ephemeral per-job GitHub Actions runners, host-mounted caches, and a reusable per-repo vm-image manifest. Use when setting up VM-based CI for Pulp or generalizing it to another repo, building/refreshing g

How to use this skill

Skill file

Tart golden-VM CI lane

Run every macOS build/validation in a throwaway VM cloned from a versioned golden image so the host stays responsive and builds are reproducible. Generalizes to any repo via one vm-image manifest. Born from Pulp planning/2026-06-01-macos-ci-isolation-plan.md; the reusable macOS provider now lives in the sibling /Volumes/Workshop/Code/tartci repo. Pulp's tools/ci/tart-runner.sh / tart-run-job.sh scripts are the legacy/precursor shape and should stay as compatibility wrappers once the tartci lane graduates.

Current Pulp gate truth (read before rollout history)

Pulp's production required macOS gate is the local M1/M3/M5 JIT fleet. Each

host's checked-in profile can serve both mutually exclusive event classes:

pulp-build-pr-head at derived lease priority 100 and

pulp-build-merge-group at derived priority 110. Profiles must not set one

fixed lease priority for both classes; doing so defeats merge-group priority

and can leave reserved gate cores idle. The older pulp-gate-fast, M1-only,

static-runner, and pilot-label passages below are rollout history, not the

current production selector.

A profile proves compatibility, not live participation. JIT runners register

only while serving a job, and organization visibility does not prove that the

Pulp repository can assign one. Establish current capacity from enabled and

healthy Pulp supervisors, queue age, repository-visible registration, exact

job-to-runner binding, derived lease priority, completion, and VM/JIT cleanup.

Re-check M1, M3, and M5 live; do not preserve a dated incident snapshot as

topology. tools/scripts/runner_topology.json plus

runner_topology_check.py --mode=report is the declarative routing truth.

When reviewed cross-repo evidence is available, pass TartCI source profiles,

installed-profile receipts, and the private desired-fleet manifest through the

checker's read-only --fleet-profile, --fleet-receipt, and

--fleet-source-manifest inputs. A source profile must use the current TartCI

fields (assignment_mode = "event-class-v2", exact [[lane.tier]]

label/workflow/runner_group_id rows, and no fixed priority). This keeps private

Pulp labels and host declarations out of generic TartCI/Shipyard code.

Why (the failure modes this fixes)

Core pieces (all in `tools/ci/`)

| Script | Role |

|---|---|

| setup-ci-host.sh | One-command host onboarding (opinionated): install tart/sshpass, set ~/VMs (no FDA), acquire the golden (--copy-from or bake), install the launchd runner agent with a --class label. Mirrors docs/guides/mac-ci-host-setup.md. |

| tart-provision.sh | Build/refresh layered golden images; verify/tag/resize/manifest helpers. Subcommands: base → apple-xcode → pulp → runner. |

| tart-runner.sh | Ephemeral per-job GitHub Actions runner. Mints a JIT (single-job) runner config, clones the runner golden, boots with host ccache mounted, runs one job, destroys the VM. --loop boots a fresh VM only when there's queued work for --workflow-name / PULP_RUNNER_WORKFLOW_NAME (default Build and Test) AND a free VM slot (running_macos_vms < cap); --once for a pilot; --cap N overrides the per-host cap. Registers under a static name per (host, slot) — pulp-<class>-<NN>, derived from the pulp-build-<class> label (override with --name / --name-prefix / --slot or PULP_RUNNER_NAME[_PREFIX] / PULP_RUNNER_SLOT). --print-name echoes the derived name and exits (pure; no gh/tart — what test_tart_runner.py asserts). |

| tart-run-job.sh | Direct ephemeral build (no GitHub runner): clone golden → virtio-fs mount host caches → build+ctest in-guest → discard. Useful for Shipyard backend / manual builds. |

| pulp-worktree.sh | Per-branch worktrees + shared ccache (host-side dev isolation; complements the VM lane). |

| .shipyard/vm-image.toml | The per-repo reuse unit (see below). |

The direct Tart guest build must invoke tools/ci/governed-build.sh for its

cmake --build step. The guest may have a TartCI profile or may run standalone;

the governed wrapper selects the bounded lease/profile share or its tier-0

fallback in either case. Do not reintroduce a caller-owned --parallel value

in tart-run-job.sh. The wrapper now caps and rewrites such a flag to the

governed share, so it can no longer exceed the lease, but it still pins the

job below a resized VM's share and bypasses the same build policy used by the

local and Shipyard paths.

The reusable runner path is now the sibling tartci repo:

guest process, ctest tail, and runner log together.

tartci runtime recent|summary|export --repo Generous-Corp/pulp --json and

pipe exports into shipyard metrics import tartci for long-term agent

baselines.

view for macOS VM slots and supervisor freshness.

The vm-image manifest (the unit of reuse)

A new repo adds one .shipyard/vm-image.toml and the same tart-provision.sh manifest <path> bakes it — no hand-provisioning. Two strategies:

Fields: base, disk_gb, auto_login, [toolchain].xcode (omit → no Xcode tier), [toolchain].rust + .rust_targets + .rosetta (Intel cross-build layer — omit → not installed), [brew].packages, [pip].packages, [caches].ccache_max, [[mounts]]. See .shipyard/vm-image.toml (Pulp: Xcode+Skia), .shipyard/vm-image.intel.toml (Intel cross-build layer), and tools/ci/examples/vm-image.rust-repo.toml (a light Rust profile, no Xcode — proves generalization).

Pulp's [toolchain] fields and [brew].packages are generated, not hand-edited. tools/toolchain/manifest.toml is the authority; python3 tools/toolchain/generate.py rewrites the owned keys in both vm-image files plus .mise.toml, .mise.toolchain.toml and mise.toolchain.lock, and the toolchain-test_generate-selftest drift test fails on any hand edit. The manifest's [evidence] table says per tool whether a pin is observed on the gate or a target: tart-provision.sh still installs the unversioned Homebrew [brew].packages and rustup ... stable, so the tiers alone do NOT produce the pinned versions; the pinned set is the mise layer below, which now refuses the golden unless check_env.py --require-tools passes inside it. The OS and Xcode are pinned at the tiers: base is the manifest's macos_base (by digest), Tier 0 and Tier 1 refuse a guest whose sw_vers -buildVersion is not macos_build, and Tier 1 copies the host's /Applications/Xcode.app (the default when its build is the pin) to the SAME path in the guest and refuses any other build, path or an unaccepted licence. Same Xcode at the same path is what lets hosts and VMs share one ccache. To learn what a golden really holds without booting it (gate hosts have no spare VM slot), attach its disk.img read-only and mount the Data volume with /sbin/mount_apfs -o rdonly,nobrowse (diskutil mount readOnly hangs on these images): read Applications/Xcode.app/Contents/version.plist, opt/homebrew/Cellar/<formula>/, and Users/admin/.rustup/toolchains/*/lib/rustlib/multirust-channel-manifest.toml, then unmount and hdiutil detach. The m3 golden of 2026-08-03 holds Xcode 26.5 (17F42), cmake 4.3.3, python 3.14.4, rustc 1.97.1, Homebrew node 26.0.0, Homebrew mise 2026.4.28, and no clang-format.

Intel (x86_64) cross-build lane — no native Intel hardware needed

Pulp's required darwin-x64 release leg **cross-compiles on Apple Silicon and

runs under Rosetta 2**. It routes through PULP_RELEASE_MACOS_RUNS_ON_JSON,

currently the base gate labels (served opportunistically by idle gate runners;

the dedicated pulp-build-vm-release pool is unused); the native Intel Mac Mini stays

in the separate advisory/nightly portability lane. The same cross-build recipe

is available interactively when you need an exact local proof.

```

tools/ci/tart-provision.sh manifest .shipyard/vm-image.intel.toml

tools/ci/tart-provision.sh tag pulp-intel-build pulp-intel-build

```

Pinned-toolchain layer (mise) — a candidate golden, never `:latest` by itself

.shipyard/vm-image.mise.toml bakes pulp-build-runner-mise-candidate on top

of pulp-build-runner:latest with tools/ci/mise-golden-layer.sh: the host's

pinned mise (sha256 checked on host AND guest), `MISE_ENV=toolchain mise

install --locked` from the committed lock, and the manifest's Rust installed

BY NAME with rustup self-update off. Its [mise] table is generated by

tools/toolchain/generate.py; never hand-edit it.

differ from HEAD, because the receipt records that commit.

(~/.cache/pulp-ci/golden-receipts/<vm>-mise.json): commit, lock and mise

digests, mise ls, rustup toolchain list, Xcode, and the in-guest

check_env.py --fleet-path --require-tools result (toolchain_check). The

layer refuses the bake when that check finds any difference, Xcode included.

when it opts in (MISE_ENV=toolchain, mise exec), so a candidate can sit

next to :latest on a host without changing any job.

which includes the candidate once this manifest is on main.

Verified base/runtime specifics (cirruslabs + Tart, 2026-06-01)

Caching strategy (the smart split)

The shared ccache directory is guest-writable: host ccache never reads its config

Every gate VM mounts $PULP_CI_CACHE/ccache (default ~/.cache/pulp-ci/ccache)

read-write, and ccache reads $CCACHE_DIR/ccache.conf by default. A guest that

writes prefix_command (or any launcher key) there would have it run by the next

host build that uses that CCACHE_DIR. So host-side ccache sets

CCACHE_CONFIGPATH to a host-owned file beside the mount, never inside it:

tools/ci/pulp-worktree.sh exports CCACHE_CONFIGPATH=$PULP_CI_CACHE/ccache-host.conf

(override PULP_HOST_CCACHE_CONFIG; a path inside the mounted directory is

refused), writes its max_size there, and tools/ci/tart-run-job.sh's host

stats read the same file. tools/ci/test_pulp_worktree_cache_env.py plants a

prefix_command in a shared ccache.conf and proves a host compile does not run

it (with a control proving the plant runs without the host config). Any new host

path that points CCACHE_DIR at a mounted directory needs the same setting.

Guest-written cache objects are still read by host builds; this closes command

execution through the config, not cache poisoning.

ccache correctness on a shared, many-worktree cache — the #3504 combo

A host that runs 100+ worktrees off one .git against one shared ccache is cold by construction unless paths are normalized AND depend mode is off. Two failure modes to keep straight:

These live in the versioned scripts so hosts converge, not just in one host's live config: tools/ci/bootstrap-macos-host.sh tune_ccache() writes them into the shared $CCACHE_DIR/ccache.conf (base_dir derived from the CI work root, never a hardcoded home), and tools/ci/pulp-worktree.sh cache_env() emits CCACHE_NODEPEND=true + CCACHE_COMPILERCHECK=content for the shipyard/worktree lane. .github/workflows/build.yml forces the same combo via job env for the GH-runner lane. Never turn depend mode back on for speed.

Shared Skia cache publication

Host worktrees select an immutable Skia/Dawn cache generation beneath

${PULP_SKIA_CACHE_ROOT:-$HOME/.cache/pulp/skia}. The generation directory is

keyed by platform plus the manifest asset SHA-256; SKIA_DIR points at that

generation root, not its parent or nested build/mac-gpu directory. Never

rsync or symlink an arbitrary checkout's external/skia-build into the cache:

directory existence does not prove materialized LFS content, asset digest,

platform slice, or the complete Skia/Dawn library pair.

setup.sh --ci and tools/ci/pulp-worktree.sh new use the canonical

fetch_skia_for_release.py validator with a bounded cache-specific lock.

Simultaneous cold worktrees publish through private sibling staging directories;

a pin rotation creates a new generation while existing consumers retain their

old immutable path. Recovery switches are explicit:

PULP_SKIA_CACHE_KEYING=0 and PULP_WORKTREE_SKIP_SKIA_FETCH=1; neither is a

fleet default.

GPU works in the guest (no hybrid lane needed)

Apple Virtualization provides Metal in the guest even with --no-graphics. Verified: pulp-screenshot --backend skia renders a real Skia/Metal PNG, nm pulp-ui-preview | grep MacGpuWindowHost = present. So the full mac lane (build + GPU + tests) runs in-VM.

Dependency updates → golden re-bake (don't get stuck on old deps)

Skia/Dawn are pinned in tools/deps/manifest.json (release-asset URL + sha256 per platform; tools/scripts/fetch_skia_for_release.py consumes it). Single source of truth = the manifest pin.

Concurrency & hosts

pulp-build-merge-group for merge-queue work and pulp-build-pr-head for PR

validation. M1, M3, and M5 have checked-in profiles compatible with both

classes; that configured topology is not proof that a host currently serves

either class. Only enabled, healthy Pulp gate supervisors provide live

capacity, and M1 deliberately waits 10 minutes before taking Pulp work.

Healthy idle JIT capacity has no registered runner, so prove participation

from supervisor state, queue age, and exact job-to-runner assignment rather

than a profile or static runner row. At the 2026-08-30 incident boundary M1

and M5 participate while M3's two compatible profiles remain intentionally

disabled pending the admission-fix canary; re-check instead of treating that

snapshot as durable topology.

Linux + Windows pool runners (join the Actions pool like macOS)

Each platform serves the GitHub Actions pool via its own ephemeral per-job

runner supervisor — the analog of tart-runner.sh for macOS:

| Supervisor | VM | Golden | Labels (pilot) | LaunchAgent |

|---|---|---|---|---|

| tools/ci/tart-runner.sh | Tart macOS | pulp-build-runner | …,pulp-build | com.danielraffel.pulp.tart-runner |

| tools/ci/tart-runner.sh --workflow-name Coverage | Tart macOS | pulp-build-runner | …,pulp-coverage-vm-macos | com.danielraffel.pulp.tart-runner-coverage-macos |

| tools/ci/tart-runner-linux.sh | Tart Linux | pulp-linux-build | …,Linux,ARM64,pulp-build-linux,pulp-host-<tag> | com.danielraffel.pulp.tart-runner-linux |

| tools/ci/qemu-runner-windows.sh | QEMU Windows | pulp-windows-build-*.qcow2 | …,Windows,ARM64,pulp-build-windows,pulp-host-<tag> | com.danielraffel.pulp.qemu-runner-windows |

All three: mint a JIT (single-job) runner config → boot a throwaway clone

(Tart CoW for Linux, qcow2 overlay on a dynamic SSH port for Windows) → run the

baked ~/actions-runner agent once → discard. The goldens carry the

actions-runner-{linux-arm64,win-arm64} agent (Windows install-if-missing if a

golden predates the bake). --loop only boots when there's queued

Build and Test work. The macOS coverage lane is the exception: it runs the

same Tart supervisor with --workflow-name Coverage and a dedicated

pulp-coverage-vm-macos label. Keep --queue-match-labels enabled for this

lane so hosted Coverage jobs do not boot a local VM that cannot claim them.

Coverage/sanitizer/release lanes must never reuse the warm macOS gate labels or

the shared pulp-build-vm build-pilot label. Coverage routing belongs in

PULP_COVERAGE_MACOS_RUNS_ON_JSON or a one-off macos_runner_selector_json

dispatch, with a dedicated ephemeral label such as pulp-coverage-vm-macos.

Per-platform opt-in/out is the Shipyard macOS GUI's "Serve CI builds from

this Mac" switch: each lane is a CIServingLane toggled by `launchctl

load/unload` of its LaunchAgent (the labels above). Install a lane on a host by

sed-templating its tools/launchd/*.plist.template into ~/Library/LaunchAgents

(replace $PULP_REPO, $HOME, $TART_HOME/$TARTCI_GOLDENS, and — for the

Linux/Windows lanes — $PULP_HOST_TAG; launchd doesn't expand shell vars).

Pulp CI routes to these via build.yml's opt-in

PULP_LOCAL_{LINUX,WINDOWS}_RUNS_ON_JSON repo vars (default off → github-hosted).

The Linux/Windows lanes MUST declare which machine they are. Every declared

Linux and Windows lane pins a host (pulp-host-macstudio / pulp-host-m5), and

GitHub selects a runner only when it carries EVERY requested label — so a

supervisor that registers without one produces a runner that is **online, idle,

and selectable by nothing**, while jobs queue against the lane it cannot serve.

Nothing reports an error: not the agent, not the job, not the API, and the

operator reads free capacity that does not exist. (Observed with 3 free Linux

runners and 8 queued Linux jobs.) So the supervisors refuse to register

unless a host label can be resolved — --host-tag / PULP_RUNNER_HOST_TAG, or

a shipyard runner tag that exactly names a declared label. Two neighbouring

vocabularies make the exact-match rule load-bearing: shipyard runner tag

answers studio on the Mac Studio (it names runners, <repo>-studio-NN)

whereas the routing label is pulp-host-macstudio; they agree on m1/m5

and disagree there, and no studio → macstudio mapping is stated anywhere, so

none is assumed. The declared tags come from tools/scripts/runner_topology.json

(the same contract the live-fleet checker reconciles against) via

tools/scripts/runner_labels.py; adding a machine is a lane edit, never a second

table. test_runner_topology_check.py pins it end to end — bare defaults must

die before minting a JIT config, since minting is the irreversible step that puts

a phantom runner in the fleet.

Hard-won Windows-runner gotchas:

ssh→cmd.exe→powershell chain it blows cmd's 8191-char limit ("The command line

is too long"), whether passed as a run.cmd --jitconfig arg OR embedded in a

powershell -EncodedCommand. Stream it into a file via ssh stdin, then run

Runner.Listener.exe run --jitconfig (Get-Content jit.cfg).

registration. Scrub C:\actions-runner\.runner, .credentials,

.credentials_rsaparams, .env, .path, and jit.cfg before every JIT run;

otherwise the guest can connect to GitHub and then fail with "runner

registration has been deleted" before claiming the queued job.

carries autocrlf churn that aborts a plain git checkout.

Shipping FROM a VM-only runner host

A VM-only host (no host-side cmake/Xcode/Skia — builds only ever run inside

the VMs) can serve the pool fine, but shipyard pr initiated on it needs

care: the default [targets.mac] is backend = "local" (build on the host) and

fails there ("cmake/git-lfs not found"). Don't reach for backend = "ssh" to a

build box either — auval (AU validation) needs a real login/audio session to

register the component, so it fails "didn't find the component" over a headless

ssh host cmd (compile + the rest of ctest pass; only the auval tests fail).

The lane where auval works is one with a session: the self-hosted pool's

auto-login VMs (auto_login = true in the manifest — this is why) or a

cloud macOS runner. So on a VM-only host set, in gitignored .shipyard.local:

[targets.mac]
backend  = "cloud"
workflow = "build"   # dispatch build.yml; resolve-provider routes mac local-first
platform = "macos-arm64"

shipyard pr then dispatches build.yml; its resolve-provider sends the mac

leg to the self-hosted pool's auto-login VM (auval green), with cloud overflow.

Flip a lane mid-flight with shipyard cloud retarget --target mac --provider <p>.

(SSH build hosts that you do want to drive headless need brew on the non-login

PATH — eval "$(brew shellenv)" in ~/.zshenv, not just ~/.zprofile — or

ssh host cmd won't find cmake.)

Diagnosing a red macOS leg (read the runner's LOCAL logs — `gh` is opaque)

On a self-hosted macOS runner, gh run view --log / --job returns **nothing

useful** for the build/test step — only "Process completed with exit code N"

(exit 8 = ctest had test failures), and check-run annotations are empty too. You

cannot tell which test failed from GitHub's API. But the runner persists

everything locally, so if you're on the runner host (true for Pulp's Mac

Studio — the deps here are the self-hosted Tart/Shipyard pool), read it directly:

  1. Find the work dir from the runner config — it is NOT ~/actions-runner-*/_work:

```bash

# workFolder is custom on Pulp's runners:

grep workFolder ~/actions-runner-pulp-studio-01/.runner

# → "/Volumes/Workshop/ci/pulp/work/pulp-studio-01"

```

  1. Read ctest's own result logs in the persisted build dir (clean:false on

self-hosted keeps build-<key> warm across runs; build-macos is the macOS

leg). These are the authoritative source for which test failed and why:

```bash

WS=/Volumes/Workshop/ci/pulp/work/pulp-studio-01/pulp/pulp # <workFolder>/<repo>/<repo>

cat "$WS/build-macos/Testing/Temporary/LastTestsFailed.log" # failed test names (+ ctest index)

grep -aA25 '<test name>' "$WS/build-macos/Testing/Temporary/LastTest.log" # the failing REQUIRE + expansion

```

LastTestsFailed.log lines look like 7675:pulp-import-design reports help…;

LastTest.log has the full Catch2 output (file:line: FAILED: + `with

expansion:). Check all three runners (pulp-studio-01/02/03`) — the leg runs

on whichever was free; the freshest LastTestsFailed.log mtime is the run.

  1. The step command/env (not its output) lives in

~/actions-runner-<name>/_diag/Worker_*.log (most-recent file = most-recent

job; match by the commit SHA, which the checkout echoes). Read step output

from the ctest logs in (2), not from the Worker log.

A "red macOS leg with exit code 8" on a change that can't plausibly affect macOS

is usually a pre-existing failure on main that the (flaky/overflowing) gate

let slip — e.g. a stale exact-match CLI assertion. Read the ctest log, fix the

real failing test, don't chase your own diff. (Found 2026-06-03: #3386's

--emit swiftui broke two test_import_design_tool.cpp exact-match asserts on

main, reddening every PR's macOS gate.)

Diagnosing a queued macOS job that never starts (the fleet looks "ready")

An empty GET repos/<o>/<r>/actions/runners proves nothing: gate runners are

just-in-time, minted per job, so none are registered between jobs. And

tartci pool status reporting fleet ready: yes / 5/5 only means the lane

supervisors are alive, not that they can clone. Read the lane's own record on

each host instead:

  1. Lane log — ~/Library/Logs/tartci/macos-fleet-pulp-gate*.log. A healthy

lane with demand prints queued=N … → booting ephemeral VM and then

vm … up at <ip> — launching JIT runner. If it sees queued=N but every

cycle ends in Shipyard admission failed before clone, `VM DHCP … breaker

open, SCAN BLIND`, or a lease refusal, that line names the blocker.

  1. Admission verdict — ~/.tartci/state/macos-fleet/<lane>/*.admission-precheck.json

holds Shipyard's last verdict (verdict, reason, plus the error text

when admission failed). Check observed_at first: the file is rewritten

only when Shipyard produces output, so a silent crash leaves an old verdict

behind. Reproduce it by hand with the lane's environment so ghapp resolves

the same repository the lane uses:

```bash

SHIPYARD_GH_APP_REPO=Generous-Corp/pulp GH_REPO=Generous-Corp/pulp \

shipyard runner admission-clean --repo Generous-Corp/pulp --base main \

--labels self-hosted,macOS,ARM64,pulp-build,pulp-build-vm,pulp-build-pr-head --json

```

  1. DHCP breaker — tartci vm-dhcp status. cause=probe_unreported with

failed_probes=0 means the granted probe never cloned a VM (it bailed

earlier, usually at admission), not that VMs lost DHCP; fix the earlier

blocker, then tartci vm-dhcp probe-now on each host instead of waiting

for the 300 s probe cadence.

On 2026-10-12 every host showed fleet ready: yes while no VM could clone for

about three hours: a Shipyard release asked GitHub for a bulk open-PR list with

a nested commits{authors} connection (about 1,000,000 nodes, over the

500,000 limit), so every admission check failed, and the DHCP breaker then

blamed DHCP. The lane log and admission JSON named the cause in one read.

Rollout: pilot → graduate

  1. Additive pilot (safe): run tartci serve macos --once with a non-required label (pulp-build-vm). Trigger a real job without touching required routing: gh workflow run build.yml -f macos_runner_selector_json='["self-hosted","pulp-build-vm"]'. Confirm green.
  2. Required-label prevalidation (safe): run a one-shot VM with pulp-build plus a unique proof label, then dispatch Build and Test with macos_runner_selector_json requiring both labels. This proves a VM can satisfy the required label while bare-metal pulp-build remains online. Verified 2026-06-10: run 27250564395, runner tartci-phase6-pulp-build-proof-r2-20260610, macOS (ARM64) [operator] success, macos alias success, VM/JIT runner cleaned up. Cancel unrelated Linux/Windows legs after macos is green.
  3. Graduated production default route: the configured M1/M3/M5 VM

supervisor profiles share the base

self-hosted,macOS,ARM64,pulp-build,pulp-build-vm labels and select one

mutually exclusive event-class label per job. Merge groups receive priority

110; PR heads receive priority 100. This keeps merge-queue work ahead

without reserving a permanently static VM slot. Treat a host as live only

after its matching supervisors and a current assignment or service receipt

prove participation.

The following June runs prove the underlying ephemeral base pool; they

predate event-class V2 and are not V2 assignment receipts:

  1. Historical rollback: the former bare-metal selector and launchd commands

are intentionally not preserved here; copying them would bypass the current

event-class contract. If rollback is required, derive the reviewed selector

from tools/scripts/runner_topology.json, preserve both event classes and

their repository-scoped registration authority, and change one idle host at

a time with a proven assignment receipt.

Rolling a CI-path tool to the fleet (Shipyard, tartci, the ghapp wrapper)

Never update every host at once. Update ONE host, run the lane-path check above

(admission must return admit or defer, never an observation error), confirm

a gate VM clones there, then update the rest. A version check is not a

functional check. Emergency rollback: shipyard update --to vX.Y.Z on each host

works even when shipyard runner fleet-update refuses. A rollback does not

hold on its own: tartci's tool-freshness watchdog sees the host as behind and

reinstalls the newest soaked release (the bad one) within hours. On every

rolled-back host, also set auto_apply = false under [tools.shipyard] in

~/.config/tartci/tool-freshness.toml, and remove it once a fixed release

ships. An unaccepted Xcode license turns /usr/bin/python3 and /usr/bin/git

into shims that exit 69, which breaks fleet-update and several tartci

commands until someone runs sudo xcodebuild -license accept on that host.

Gotchas (hard-won)

dynamic labels.** The 2026-08-30 M1/M5 incident produced exact-label

pulp-build-pr-head runners that were online and idle in the organization

inventory but invisible to Pulp's repository runner endpoint, so GitHub could

never assign the queued PR jobs. The fleet-wide contract is

pulp-build-merge-group|1 and pulp-build-pr-head|1, both repository-scoped,

rendered through

TARTCI_RUNNER_WORKFLOW_TIER_GROUPS for M1, M3, and M5. Do not infer usable

capacity from an organization row. A PR-head proof requires the runner in the

repository endpoint, online then busy, an exact job-to-runner binding, job

completion, and ephemeral reclamation. TartCI must fail closed before JIT

minting when an organization group's repository access cannot be proven; a

401/403/404 records a contract-keyed denial so the loop does not keep booting

VMs. Roll profiles out only through tartci pool off ->

tartci fleet-macos install ... --apply -> receipt verification ->

tartci pool on, one idle host at a time. Preserve active jobs and the M1

delayed-fallback policy.

1. while sleep N; do … cannot be stopped promptly — bash defers a trapped signal until the current foreground command returns, so the refresher ignores its own SIGTERM until the interval elapses and adds up to a full interval to every build's exit. Background the sleep and wait on it; wait is signal-interruptible.

2. A background child inherits the caller's stdout, and a caller that runs the wrapper inside a command substitution blocks until every holder of that pipe closes it. An un-redirected refresher makes out="$(governed-build.sh …)" hang for a full interval after the build finished. Detach the refresher's fds at spawn.

Tests: test/test_governed_build.sh (ctest governed-build-wrapper) — the granted-lease case is timed at the default interval specifically to catch trap 1.

reports zero running guests while tart run processes or guest setup are

present, treat the state as unknown/fail-closed. Resolve the exact

receipt-bound profile and its tart_home, query that store, and corroborate

with process state. Pulp can detect profile/receipt/source-manifest drift from

fixtures; TartCI must own the live bound-store plus active-process check.

1. While tart run is up, does bridge100 appear? (ifconfig -l). If it doesn't, the VM network was never created. Read launchctl print system/com.apple.pfd (no root). On m5, pfd, which InternetSharing waits on, sat in spawn scheduled with last exit code = 3 and thousands of runs, logging only "no pf starter references held", so InternetSharing never answered any VM. A healthy pfd serves its requests and then idle-exits with last exit code = 0; exit 3 with a climbing run count is the fault. The cause was pf left Disabled with no enable reference after a reboot (sudo pfctl -s info, sudo pfctl -s References). The fix, verified on m5 on 2026-10-07: sudo pfctl -E. It takes one ref-counted pf enable reference and prints a token; keep the token, which is the undo key (sudo pfctl -X <token>). pfd then serves, bridge100 comes up on the next VM, and the VM-DHCP breaker closes on its probe's address. The reference does not survive a reboot, so after any reboot check pfd again. Restarting the InternetSharing process did not help.

2. bridge100 is up but bootpd is not loaded: launchctl print system/com.apple.bootpd exits 113, "Could not find service". Run sudo launchctl bootstrap system /System/Library/LaunchDaemons/bootps.plist, proven on m5 with SIP on. A bootpd kickstart, or disable/enable, cannot load a job launchd doesn't have.

3. Loaded but silent: sudo launchctl kickstart -k system/com.apple.bootpd.

Normal states that are not faults:

Never kickstart com.apple.NetworkSharing (SIP refuses it: "150: Operation not permitted while System Integrity Protection is engaged"), and never pfctl -d (it drops every holder's references; undo your own -E with pfctl -X <token> instead). On the host, tartci doctor fleet names the failing layer (vm_dhcp_*) once the installed tartci records it, and the VM-DHCP breaker probes again by itself.

Store & hygiene

TART_HOME is declared by the host, never by the repo — hosts with an external build SSD keep the store on a /Volumes mount, hosts on internal storage keep it under $HOME, and both are correct. Exclude it from Spotlight (.metadata_never_index). Tag goldens :<date> + roll :latest. Ephemeral job VMs are deleted after use; confirm cleanup (tart delete fails silently on a running VM — stop → delete → verify). Reclaim with tart-provision.sh list + prune.

pulp-worktree.sh gc deletes nothing, by design — the classifier lives elsewhere.

Its help says so ("the safety classifier is not yet available"), so a gc --apply that

reports zero candidates is the documented behaviour, not a broken run. To actually reclaim

worktrees use tools/scripts/clean_worktrees.sh, which carries the affirmative

classification: exact git merge-base --is-ancestor into origin/main, a live-process

check, git's own dirty check, and a lineage veto. Two traps it exists to survive, both of

which read as "idle" when wrong: git worktree list --porcelain reports the physical

path (/private/var/...) while a process launched through the logical path carries

/var/... on its argv, and printf ... | grep -q under pipefail reports a match as

failure (grep exits first, printf takes SIGPIPE). Either one silently clears a worktree

with a live build in it. Uncommitted content is reported AT RISK and never removed, and a

deleted upstream branch is still not merge proof.

Fleet hosts may export PULP_WORKTREES_ROOT (M3: /Volumes/Workshop/Code/agent-worktrees; m5s: /Volumes/Atelier/Code/agent-worktrees),

while the helper's canonical local override is PULP_WT_ROOT; the helper accepts

both, with PULP_WT_ROOT taking precedence. Always verify the resolved root in

pulp-worktree.sh list before interpreting an age or budget report. The

documented --max-total-gb option is currently report-only until the affirmative

classifier can prove ownership, branch state, and absence of active processes.

Persistent native Actions runners have a separate storage rule: their

RUSTUP_HOME and CARGO_HOME belong under each runner's own internal-APFS

_toolcache, never behind ~/.rustup/~/.cargo symlinks into the external VM

store. Their captured .path starts with /usr/bin:/bin:/usr/sbin:/sbin so

runner bootstrap resolves system tar before Homebrew. The private fleet

manifest declares this through actions_runner_policy; apply is idle-gated and

must not interrupt a live Runner.Worker.

Generated Shipyard pin updates

The generated VM-image toolchain blocks are refreshed by

tools/toolchain/generate.py when Pulp updates its pinned Shipyard release.

Keep those generated files in sync with the manifest and digest; no separate

TartCI behavior change is implied.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.