Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5ad8aad
ci: configure shared fleet Rust cache
teamleaderleo Oct 7, 2026
3d9ea5f
ci: resolve stable fleet Rust target directories
teamleaderleo Oct 7, 2026
d571386
Merge remote-tracking branch 'origin/feat-cmux-next' into fix/fleet-r…
teamleaderleo Oct 8, 2026
53cf8fe
cx-m0p7 adapters: red tests for the VS Code family and Zed sources an…
lawrencecchen Oct 10, 2026
166eb3a
cx-m0p7 adapters: VS Code family and Zed project sources on project.s…
lawrencecchen Oct 10, 2026
30204c6
cx-m0p7 adapters: review fixes (no partial complete lists from a busy…
lawrencecchen Oct 10, 2026
365fbc2
Merge remote-tracking branch 'origin/feat-cmux-next-m0p7-projects-4' …
lawrencecchen Oct 10, 2026
f7eeb55
cx-m0p7 adapters: socket-level daemon test for the editor import repl…
lawrencecchen Oct 10, 2026
6aecd65
cx-m0p7 adapters: the socket test picks a non-temporary folder
lawrencecchen Oct 10, 2026
723bac5
Merge remote-tracking branch 'origin/feat-cmux-next-m0p7-projects-4' …
lawrencecchen Oct 10, 2026
966e9a2
Merge remote-tracking branch 'origin/feat-cmux-next-m0p7-projects-4' …
lawrencecchen Oct 10, 2026
f4abab4
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
63eeb64
cx-m0p7 adapters: daemon-capabilities.json lists project-list-v1
lawrencecchen Oct 10, 2026
6683150
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
c1bf51e
cmux-next: credential.session answers the backend team of the install…
lawrencecchen Oct 10, 2026
4ca47b6
test(cmux-vm): delete the cmux VM unit tests (cx-034r)
lawrencecchen Oct 10, 2026
e5dc62d
test(browser-parity): markdown, searchText, extract, storageState and…
lawrencecchen Oct 10, 2026
4d9d631
feat(browser-host): page.markdown, searchText, extract, dropdownOptio…
lawrencecchen Oct 10, 2026
6459968
release-notes: markdown and agent tool reads stay within the page-rea…
lawrencecchen Oct 10, 2026
596734a
test(browser-parity): a click in a child frame works beside 20,000 ne…
lawrencecchen Oct 10, 2026
909f9b1
feat(browser-host): a child frame's <iframe> is found by its place in…
lawrencecchen Oct 10, 2026
d3fc10d
test(browser-parity): tabs.content HTML masks sensitive values; frame…
lawrencecchen Oct 10, 2026
08c42a5
fix(browser-host): tabs.content HTML is an observe read; storageState…
lawrencecchen Oct 10, 2026
be01df2
test(bindings): delete the SDK unit tests (cx-034r)
lawrencecchen Oct 10, 2026
e247337
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
2a37d8f
Merge remote-tracking branch 'origin/feat-cmux-next' into HEAD
lawrencecchen Oct 10, 2026
768cc47
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
4f8c5ab
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
0d94be2
fix(messageslab): a Chief subagent link check is a URL property, not …
lawrencecchen Oct 10, 2026
ef7c3d8
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
521b219
Merge remote-tracking branch 'origin/feat-cmux-next' into feat-cmux-n…
lawrencecchen Oct 10, 2026
20cd2f6
ci: a base autofix bot commits generated files, tree inputs and fmt (…
teamleaderleo Oct 10, 2026
7af5d8b
fix(release-rails): resolve capabilities re-exported from another cmu…
teamleaderleo Oct 10, 2026
1e0c0bb
ci: format staged files before commit (#18808)
teamleaderleo Oct 10, 2026
08cd108
ci: check rustfmt on the cmux-tui packages a PR touches (#18800)
teamleaderleo Oct 10, 2026
7a52911
ci: add mini-first Swift canary for cmux-next (#18781)
teamleaderleo Oct 10, 2026
c980cc5
cmux-next: repin app FFI to current base release (#18776)
teamleaderleo Oct 10, 2026
8da37f7
cmux-next: same-tree cmux-tui is a hard check only for PRs that chang…
teamleaderleo Oct 10, 2026
1beff16
fix(ci): keep cmux-next minis first through bot retries (#18615)
teamleaderleo Oct 10, 2026
5c0a0fc
docs(cmux-next): map UI parity reference sources (#18561)
teamleaderleo Oct 10, 2026
c08fa90
fix(nightly): bound the publish notes step at 10 minutes (#18404)
teamleaderleo Oct 10, 2026
0e4c30a
ci(cmux-next): retry bad R2 binary reads and let the tree gate pin it…
teamleaderleo Oct 10, 2026
d808aa1
ci(gallery): capture narrow responsive states (#18901)
teamleaderleo Oct 10, 2026
dd68964
Merge feat-cmux-next into fix/fleet-rust-sccache
teamleaderleo Oct 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions scripts/ci/cmux-tui-rust-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ if [[ -n "$filter" && ! "$filter" =~ ^[A-Za-z0-9_:.-]{1,200}$ ]]; then
fi
umask 022
root="$(pwd -P)"
# Public CI keeps the step-private target directory. HQ marks managed workers
# with CMUX_FLEET_WORKER_TRUSTED and supplies this reviewed resolver so the
# pinned cmux-tui toolchain can reuse a stable target directory.
fleet_target_helper=""
if [[ "${CMUX_FLEET_WORKER_TRUSTED:-0}" == 1 ]]; then
fleet_target_helper="$root/scripts/ci/fleet-rust-cache.sh"
[[ -r "$fleet_target_helper" ]] || { echo "error: managed worker is missing the reviewed Rust target resolver" >&2; exit 78; }
# shellcheck disable=SC1090
source "$fleet_target_helper"
fi
export CARGO_TARGET_DIR="$root/.build/cmux-tui-rust-target"
# The step's checkout has empty submodules; ghostty-vt-sys builds
# libghostty-vt from ghostty-next (2026-10-05, step ee99e05f: "missing
Expand All @@ -42,6 +52,11 @@ if ! git -C "$root" submodule update --init --depth 1 ghostty-next; then
exit 3
fi
cd "$root/cmux-tui"
if [[ -n "$fleet_target_helper" ]]; then
CARGO_TARGET_DIR="$(fleet_rust_target_dir cmux-tui "" "$PWD")"
mkdir -p "$CARGO_TARGET_DIR"
export CARGO_TARGET_DIR
fi
# The step's own RUSTUP_HOME auto-installed the pinned toolchain WITHOUT the
# components rust-toolchain.toml lists (rustup 1.29.1, 2026-10-05: `cargo fmt`
# failed with "no such command"). Install them explicitly; from this directory
Expand Down
82 changes: 82 additions & 0 deletions scripts/ci/fleet-rust-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env bash
# Resolve a stable Cargo target directory for a managed fleet build.
#
# This helper is intentionally credential-free. HQ injects sccache and the
# worker-only R2 configuration in the managed worker recipe. Source checkouts
# use this file only to derive a target path from the toolchain selected by the
# manifest and the requested target triple.
#
# Source this file, then call:
# fleet_rust_target_dir PROJECT [TARGET_TRIPLE] [MANIFEST_DIR]
#
# PROJECT is a short workspace name (for example acpmux, chief, or cmux-tui).
# MANIFEST_DIR is the directory Cargo/rustup should inspect for its manifest;
# it defaults to the caller's current directory.

fleet_rust_cache_slug() {
local value="${1:-}"
[[ "$value" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]] || return 2
value="$(printf '%s' "$value" | tr '[:upper:]' '[:lower:]')"
printf '%s\n' "$value"
}

fleet_rust_target_dir() {
local project="${1:-}"
local requested_target="${2:-}"
local manifest_dir="${3:-$PWD}"
local toolchain rust_release rust_host target root project_key toolchain_key target_key

project_key="$(fleet_rust_cache_slug "$project")" || {
echo "fleet-rust-cache: invalid project name" >&2
return 2
}
[[ -d "$manifest_dir" ]] || {
echo "fleet-rust-cache: manifest directory does not exist: $manifest_dir" >&2
return 2
}

# Resolve both values from the manifest's working directory. `rustc` and
# `rustup` proxies honor rust-toolchain.toml only after changing into it.
toolchain="$(cd "$manifest_dir" && rustup show active-toolchain 2>/dev/null | awk 'NR == 1 {print $1}')" || true
rust_release="$(cd "$manifest_dir" && rustc -Vv 2>/dev/null | awk -F': ' '$1 == "release" {print $2; exit}')" || true
rust_host="$(cd "$manifest_dir" && rustc -Vv 2>/dev/null | awk -F': ' '$1 == "host" {print $2; exit}')" || true
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
[[ -n "$toolchain" && -n "$rust_release" && -n "$rust_host" ]] || {
echo "fleet-rust-cache: cannot identify the manifest Rust toolchain in $manifest_dir" >&2
return 78
}
target="${requested_target:-${CARGO_BUILD_TARGET:-$rust_host}}"
target_key="$(fleet_rust_cache_slug "$target")" || {
echo "fleet-rust-cache: invalid target triple" >&2
return 2
}
toolchain_key="$(fleet_rust_cache_slug "${toolchain}-${rust_release}-${rust_host}")" || {
echo "fleet-rust-cache: invalid toolchain identity" >&2
return 2
}
root="${CMUX_FLEET_RUST_TARGET_ROOT:-${CI_SHARED_CACHE_DIR:-$HOME/.cache/cmux-build-fleet}/rust-targets}"
[[ -n "$root" && "$root" != */.. && "$root" != *$'\n'* ]] || {
echo "fleet-rust-cache: invalid target root" >&2
return 2
}
root="${root%/}"
printf '%s/%s/%s/%s\n' "$root" "$project_key" "$toolchain_key" "$target_key"
}

if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
case "${1:-}" in
--target-dir)
[[ $# -ge 2 && $# -le 4 ]] || {
echo "usage: $0 --target-dir PROJECT [TARGET_TRIPLE] [MANIFEST_DIR]" >&2
exit 2
}
fleet_rust_target_dir "$2" "${3:-}" "${4:-$PWD}"
;;
-h|--help)
sed -n '2,17p' "$0" | sed 's/^# //'
;;
*)
echo "usage: $0 --target-dir PROJECT [TARGET_TRIPLE] [MANIFEST_DIR]" >&2
exit 2
;;
esac
fi
17 changes: 17 additions & 0 deletions scripts/cmux-next/build-acpmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ fi

command -v cargo >/dev/null 2>&1 || { echo "error: cargo is required to build acpmux" >&2; exit 1; }
command -v rustup >/dev/null 2>&1 || { echo "error: rustup is required to provision acpmux targets" >&2; exit 1; }

# HQ marks managed workers explicitly. Public CI and developer invocations keep
# their job-private temporary target directories.
fleet_target_helper=""
if [[ "${CMUX_FLEET_WORKER_TRUSTED:-0}" == 1 ]]; then
fleet_target_helper="$repo_root/scripts/ci/fleet-rust-cache.sh"
[[ -r "$fleet_target_helper" ]] || {
echo "error: managed worker is missing the reviewed Rust target resolver" >&2
exit 78
}
# shellcheck disable=SC1090
source "$fleet_target_helper"
fi
# Install the targets into the toolchain cargo actually uses: cmux-tui pins its
# own channel in rust-toolchain.toml, so rustup must run from that directory
# (from the repo root it would provision the default toolchain instead, and the
Expand All @@ -122,6 +135,10 @@ built_slices=()
for arch in $archs; do
target="$([[ "$arch" == arm64 ]] && printf aarch64 || printf x86_64)-apple-darwin"
target_dir="$build_root/$target"
if [[ -n "$fleet_target_helper" ]]; then
target_dir="$(fleet_rust_target_dir acpmux "$target" "$source_root/cmux-tui")"
mkdir -p "$target_dir"
fi
echo "==> building acpmux ($source_mode $source_commit, $target)"
(cd "$source_root/cmux-tui" && CARGO_TARGET_DIR="$target_dir" cargo build \
--locked --release --package acpmux --target "$target")
Expand Down
19 changes: 17 additions & 2 deletions scripts/cmux-next/build-optchat-chief.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ command -v cargo >/dev/null 2>&1 || { echo "error: cargo is required to build op
# toolchain cmux-tui pins, which the fleet already has for acpmux.
toolchain="$(sed -n 's/^channel *= *"\(.*\)"/\1/p' "$repo_root/cmux-tui/rust-toolchain.toml")"
[[ -n "$toolchain" ]] || { echo "error: cannot read cmux-tui/rust-toolchain.toml" >&2; exit 1; }
fleet_target_helper=""
if [[ "${CMUX_FLEET_WORKER_TRUSTED:-0}" == 1 ]]; then
fleet_target_helper="$repo_root/scripts/ci/fleet-rust-cache.sh"
[[ -r "$fleet_target_helper" ]] || {
echo "error: managed worker is missing the reviewed Rust target resolver" >&2
exit 78
}
# shellcheck disable=SC1090
source "$fleet_target_helper"
fi
targets=()
for arch in $archs; do targets+=("$([[ "$arch" == arm64 ]] && printf aarch64 || printf x86_64)-apple-darwin"); done
if command -v rustup >/dev/null 2>&1; then
Expand All @@ -98,11 +108,16 @@ slices=()
for target in "${targets[@]}"; do
echo "==> building optchat-chief ($commit, $target)"
# A persistent target dir under the crate keeps later fleet builds incremental.
target_dir="$crate/target/app"
if [[ -n "$fleet_target_helper" ]]; then
target_dir="$(fleet_rust_target_dir chief "$target" "$repo_root/cmux-tui")"
mkdir -p "$target_dir"
fi
# An app build never ships the inspector's placeholder page: build.rs fails
# when the page was not built (build-web-bundles.sh runs before this).
(cd "$crate" && OPTCHAT_BUILD_COMMIT="${commit:0:11}" OPTCHAT_REQUIRE_INSPECTOR_PAGE=1 CARGO_TARGET_DIR="$crate/target/app" \
(cd "$crate" && OPTCHAT_BUILD_COMMIT="${commit:0:11}" OPTCHAT_REQUIRE_INSPECTOR_PAGE=1 CARGO_TARGET_DIR="$target_dir" \
cargo "+$toolchain" build --locked --release --bin optchat-chief --target "$target")
slice="$crate/target/app/$target/release/optchat-chief"
slice="$target_dir/$target/release/optchat-chief"
[[ -x "$slice" ]] || { echo "error: cargo did not produce $slice" >&2; exit 1; }
slices+=("$slice")
done
Expand Down
66 changes: 66 additions & 0 deletions tests/test_ci_fleet_rust_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
set -euo pipefail

root="$(cd "$(dirname "$0")/.." && pwd)"
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
bin="$tmp/bin"
manifest="$tmp/cmux-tui"
mkdir -p "$bin" "$manifest"

cat > "$bin/rustc" <<'STUB'
#!/usr/bin/env bash
cat <<'OUT'
rustc 1.88.0 (stable)
binary: rustc
commit-hash: test
commit-date: test
host: aarch64-apple-darwin
release: 1.88.0
LLVM version: 20.1.8
OUT
STUB
cat > "$bin/rustup" <<'STUB'
#!/usr/bin/env bash
[[ "$*" == "show active-toolchain" ]] && echo '1.88.0-aarch64-apple-darwin (directory override)' || exit 0
STUB
chmod +x "$bin"/*

# Resolver uses the manifest-selected toolchain, compiler identity, project and
# target triple, and never reads a worker secret or mutates cache credentials.
out="$(env -i PATH="$bin:/usr/bin:/bin" HOME="$tmp/home" \
CMUX_FLEET_RUST_TARGET_ROOT="$tmp/rust-targets" \
bash -c 'source "$1/scripts/ci/fleet-rust-cache.sh"; \
[[ -z "${RUSTC_WRAPPER:-}" && -z "${AWS_SECRET_ACCESS_KEY:-}" ]]; \
fleet_rust_target_dir acpmux aarch64-apple-darwin "$2"; \
fleet_rust_target_dir acpmux x86_64-apple-darwin "$2"; \
fleet_rust_target_dir chief aarch64-apple-darwin "$2"' _ "$root" "$manifest" 2>/dev/null)"
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
expected="$tmp/rust-targets/acpmux/1.88.0-aarch64-apple-darwin-1.88.0-aarch64-apple-darwin/aarch64-apple-darwin"
expected_x86="$tmp/rust-targets/acpmux/1.88.0-aarch64-apple-darwin-1.88.0-aarch64-apple-darwin/x86_64-apple-darwin"
expected_chief="$tmp/rust-targets/chief/1.88.0-aarch64-apple-darwin-1.88.0-aarch64-apple-darwin/aarch64-apple-darwin"
[[ "$(printf '%s\n' "$out" | sed -n '1p')" == "$expected" ]] || { echo "unexpected acpmux target: $out" >&2; exit 1; }
[[ "$(printf '%s\n' "$out" | sed -n '2p')" == "$expected_x86" ]] || { echo "unexpected cross target: $out" >&2; exit 1; }
[[ "$(printf '%s\n' "$out" | sed -n '3p')" == "$expected_chief" ]] || { echo "unexpected chief target: $out" >&2; exit 1; }
[[ ! -e "$tmp/rust-targets" ]] || { echo "resolver created target directories" >&2; exit 1; }

# Slugs cannot escape the configured root, and missing manifest toolchains fail.
if env -i PATH="$bin:/usr/bin:/bin" HOME="$tmp/home" CMUX_FLEET_RUST_TARGET_ROOT="$tmp/rust-targets" \
bash -c 'source "$1/scripts/ci/fleet-rust-cache.sh"; fleet_rust_target_dir ../escape aarch64-apple-darwin "$2"' _ "$root" "$manifest" >/dev/null 2>&1; then
echo "accepted a path-like project name" >&2
exit 1
fi
if env -i PATH="$bin:/usr/bin:/bin" HOME="$tmp/home" CMUX_FLEET_RUST_TARGET_ROOT="$tmp/rust-targets" \
bash -c 'source "$1/scripts/ci/fleet-rust-cache.sh"; fleet_rust_target_dir acpmux "$2" "$3"' _ "$root" 'x/y' "$manifest" >/dev/null 2>&1; then
echo "accepted a path-like target" >&2
exit 1
fi

# Managed integration is explicit; no worker marker leaves existing defaults in
# place. These checks protect against restoring global CARGO_TARGET_DIR exports.
grep -q 'CMUX_FLEET_WORKER_TRUSTED' "$root/scripts/cmux-next/build-acpmux.sh"
grep -q 'CMUX_FLEET_WORKER_TRUSTED' "$root/scripts/cmux-next/build-optchat-chief.sh"
grep -q 'CMUX_FLEET_WORKER_TRUSTED' "$root/scripts/ci/cmux-tui-rust-check.sh"
! grep -q 'CMUX_FLEET_RUST_CACHE_SECRET_FILE' "$root/scripts/ci/fleet-rust-cache.sh"
! grep -q 'SCCACHE_NAMESPACE' "$root/scripts/ci/fleet-rust-cache.sh"

echo "fleet Rust target resolver tests passed"
Loading