Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ jobs:
run: |
mise ls --global
test -z "$(mise ls --global --missing)"
for tool in claude codex uv node python; do mise exec -- "$tool" --version; done
for tool in claude codex uv node python mbx; do mise exec -- "$tool" --version; done
# Use mise's gh, not the runner's preinstalled one.
"$(mise which gh)" extension list | grep -q github/gh-stack
if [ "$(uname -s)" = "Darwin" ]; then
mise exec -- mbx --version
test -x "$HOME/.local/bin/hidden-display"
test -x "$HOME/.local/share/mise/command-wrappers/bin/cargo"
test "$(zsh -c 'command -v cargo')" = "$HOME/.local/share/mise/command-wrappers/bin/cargo"
Expand All @@ -134,4 +133,6 @@ jobs:
exit 1
fi
python3 -m unittest -v tests.test_hidden_display
else
test -f "$LOCALAPPDATA/mise/command-wrappers/bin/cargo.exe" || test -f "$LOCALAPPDATA/mise/command-wrappers/bin/cargo.cmd"
fi
10 changes: 5 additions & 5 deletions docs/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A profile supplies module defaults on initialization. Every resulting switch is
| `desktop` | Personal Hyprland input/appearance overrides (Omarchy only) | Off | Off |
| `git` | Personal Git include, its include block, and a bounded 1Password block in SSH config (the `git` module owns both) | On | On |
| `agents` | Shared instructions/skills and the OpenCode Go provider invariant | On | On |
| `tools` | mise harnesses, gh, uv, updater environment, harness update task; on macOS, `mbx` Cargo wrapper and `hidden-display` helper | On | On |
| `tools` | mise harnesses, gh, uv, `mbx` Cargo wrapper (except Intel macOS), updater environment, harness update task; on macOS, `hidden-display` helper | On | On |
| `runtimes` | Global Node LTS, Python 3.12, Python environment and Rust version-file settings | On | Off |
| `tools-re` | REA CLI, Ghidra on macOS, and local skill when `agents` is enabled | Off | Off |
| `shell` | Bash/Zsh/Fish/PowerShell startup files and shared shell environment | On | Off |
Expand Down Expand Up @@ -108,12 +108,12 @@ Earlier versions documented global REA registration. On a machine that used it,

The REA version belongs in `dotfiles.pins.rea` in `.chezmoidata.toml`; `harness:update` leaves it pinned. Ghidra follows Homebrew's formula. REA 6.8.0 accepts only Ghidra 12.1.x, while Homebrew supplies 12.2. Direct Ghidra analysis remains available; the local skill uses that route when REA rejects the installed version. A newer REA release can be tested and pinned when published. See the [released provider requirements](https://github.com/morluto/rea/blob/rea-agents-6.8.0/docs/installation.md#ghidra).

## macOS tools (`mbx` and `hidden-display`)
## Extra tools (`mbx` and `hidden-display`)

On macOS, the `tools` module also deploys two platform-specific helpers (ignored on Linux and Windows):
The `tools` module also deploys two helpers alongside the core harnesses:

- **Mr. Boxington (`~/.config/mise/conf.d/mbx.toml`, Apple Silicon macOS):** pins `mr-boxington` in `.chezmoidata.toml`, sets `MBX_CACHE_DIR` to `~/Library/Caches/mbx` with a `100GiB` soft budget (`MBX_GC_MAX_TOTAL_SIZE`), and adds a `[wrappers.cargo]` command wrapper (`MBX_CARGO_SHIM_MODE=1`) so plain `cargo` runs share APFS copy-on-write build outputs across worktrees. Projects that set `CARGO_TARGET_DIR`, `--target-dir`, or `build.target-dir` keep their own target directory; `build.build-dir` is also left intact (with the check lane disabled). Bypass `mbx` for one command with `MBX_DISABLE=1 cargo ...`. After enabling or updating it without bootstrap, run `mise install && mise reshim`. Note that `[env]` settings apply to shells with mise active, mise shims/wrappers, and `mise exec`; direct non-mise `mbx` calls and `rust-analyzer` use `mbx`'s own settings (`mbx settings set gc.max_total_size 100GiB` / `mbx setup`) unless configured separately.
- **Shared hidden display (`~/.local/bin/hidden-display`):** compiled from `~/.local/share/hidden-display/hidden-display.m` by bootstrap step 7 (or manually with `mkdir -p ~/.local/bin && clang -Wall -Wextra -fobjc-arc -framework Foundation -framework CoreGraphics ~/.local/share/hidden-display/hidden-display.m -o ~/.local/bin/hidden-display`). Keeps one per-user virtual display alive across GUI test runs (`hidden-display ensure|status|stop`); the `gui-testing` skill documents when and how agents use it.
- **Mr. Boxington (`~/.config/mise/conf.d/mbx.toml`):** deployed on Apple Silicon macOS, Linux, and Windows (skipped on Intel macOS, where `mr-boxington` has no release binary). Pins `mr-boxington` in `.chezmoidata.toml`, sets a `100GiB` soft budget (`MBX_GC_MAX_TOTAL_SIZE`), uses `mbx`'s native per-OS cache directory (`~/Library/Caches/mbx`, `~/.cache/mbx`, `%LOCALAPPDATA%\mbx`), and adds a `[wrappers.cargo]` command wrapper (`MBX_CARGO_SHIM_MODE=1`) so plain `cargo` runs share cached compilations and copy-on-write outputs on APFS, Btrfs, XFS, or ReFS Dev Drive (hard links on ext4; copies on plain NTFS; managed `target` symlinks on Windows use Developer Mode). Projects that set `CARGO_TARGET_DIR`, `--target-dir`, or `build.target-dir` keep their own target directory; `build.build-dir` is also left intact (with the check lane disabled). Bypass `mbx` for one command with `MBX_DISABLE=1 cargo ...` (or `$env:MBX_DISABLE="1"; try { cargo ... } finally { Remove-Item Env:MBX_DISABLE }` in PowerShell). After enabling or updating without bootstrap, run `mise install && mise reshim`. Note that `[env]` settings apply to shells with mise active, mise shims/wrappers, and `mise exec`; direct non-mise `mbx` calls and `rust-analyzer` use `mbx`'s own settings (`mbx settings set gc.max_total_size 100GiB` / `mbx setup`) unless configured separately.
- **Shared hidden display (`~/.local/bin/hidden-display`, macOS only):** compiled from `~/.local/share/hidden-display/hidden-display.m` by bootstrap step 7 (or manually with `mkdir -p ~/.local/bin && clang -Wall -Wextra -fobjc-arc -framework Foundation -framework CoreGraphics ~/.local/share/hidden-display/hidden-display.m -o ~/.local/bin/hidden-display`). Keeps one per-user virtual display alive across GUI test runs (`hidden-display ensure|status|stop`); the `gui-testing` skill documents when and how agents use it.

## Extending the repo

Expand Down
3 changes: 1 addition & 2 deletions home/.chezmoidata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ darwin = [
".config/iterm2",
".config/iterm2/**",
".config/mise/conf.d/github-public-ro.toml",
".config/mise/conf.d/mbx.toml",
".local/share/hidden-display",
".local/share/hidden-display/**",
]
Expand Down Expand Up @@ -148,5 +147,5 @@ ghStack = "v0.2.0"
ghStackCommit = "d4ab7ab47e5b3e3708a27c8c42abcdf4bc321419"
# REA is an optional analysis driver; its workflow skill is maintained locally.
rea = "6.8.0"
# Mr. Boxington (`mbx`) for APFS-backed shared Rust build caching on macOS.
# Mr. Boxington (`mbx`) for shared Rust build caching across worktrees.
mrBoxington = "1.30.0"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if and .bootstrap .modules.tools (eq .chezmoi.os "windows") -}}
# hash: {{ includeTemplate "mise/config.toml" . | sha256sum }}
# mbx: {{ .dotfiles.pins.mrBoxington }} {{ include "dot_config/mise/conf.d/mbx.toml.tmpl" | sha256sum }}

# Pick up PATH entries a fresh winget install added, keeping the session PATH
$env:Path = $env:Path + ";" + [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
Expand All @@ -15,12 +16,38 @@ if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

# Add mise shims to persistent user PATH so non-shell programs (e.g. VS Code) can find tools.
# This is the Windows equivalent of adding shims to PATH in .zprofile on macOS.
mise reshim
if ($LASTEXITCODE -ne 0) {
Write-Error "mise reshim failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}

# Add mise command wrappers and shims to persistent user PATH so non-shell programs
# (e.g. VS Code, coding agents) resolve wrapped tools like `cargo` through mise.
$shimDir = Join-Path $env:LOCALAPPDATA "mise\shims"
$wrapperDir = Join-Path $env:LOCALAPPDATA "mise\command-wrappers\bin"
$userPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
if ($userPath -notlike "*$shimDir*") {
[System.Environment]::SetEnvironmentVariable("Path", "$shimDir;$userPath", "User")
Write-Host "Added mise shims to user PATH: $shimDir"
$entries = @()
if ($userPath) {
$entries = @($userPath -split ';' | Where-Object { $_ -ne '' })
}
$updated = $false
if (-not ($entries -icontains $shimDir)) {
$entries = @($shimDir) + $entries
$updated = $true
}
$wrapperIdx = -1
$shimIdx = -1
for ($i = 0; $i -lt $entries.Count; $i++) {
if ($wrapperIdx -lt 0 -and $entries[$i] -ieq $wrapperDir) { $wrapperIdx = $i }
if ($shimIdx -lt 0 -and $entries[$i] -ieq $shimDir) { $shimIdx = $i }
}
if ($wrapperIdx -lt 0 -or $wrapperIdx -gt $shimIdx) {
$entries = @($wrapperDir) + @($entries | Where-Object { $_ -ine $wrapperDir })
$updated = $true
}
if ($updated) {
[System.Environment]::SetEnvironmentVariable("Path", ($entries -join ';'), "User")
Write-Host "Updated user PATH for mise command wrappers and shims."
}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

# hash: {{ includeTemplate "mise/config.toml" . | sha256sum }}
{{- if and (eq .chezmoi.os "darwin") (eq .chezmoi.arch "arm64") }}
{{- if not (and (eq .chezmoi.os "darwin") (ne .chezmoi.arch "arm64")) }}
# mbx: {{ .dotfiles.pins.mrBoxington }} {{ include "dot_config/mise/conf.d/mbx.toml.tmpl" | sha256sum }}
{{- end }}

Expand Down
18 changes: 9 additions & 9 deletions home/Documents/WindowsPowerShell/profile.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Add ~/.local/bin to PATH
$localBin = Join-Path $HOME ".local\bin"
if (-not (($env:PATH -split ';') -icontains $localBin)) {
$env:PATH = "$localBin;$env:PATH"
}

# mise (shims only — mise activate does not support Windows PowerShell 5.1)
# mise (shims + command wrappers — mise activate does not support Windows PowerShell 5.1)
# Prepend low-to-high so precedence is: ~/.local/bin > command-wrappers\bin > shims.
$miseShims = Join-Path $HOME "AppData\Local\mise\shims"
if (-not (($env:PATH -split ';') -icontains $miseShims)) {
$env:PATH = "$miseShims;$env:PATH"
$miseWrappers = Join-Path $HOME "AppData\Local\mise\command-wrappers\bin"
$localBin = Join-Path $HOME ".local\bin"
foreach ($dir in @($miseShims, $miseWrappers, $localBin)) {
if (Test-Path $dir) {
$rest = ($env:PATH -split ';') | Where-Object { $_ -ne '' -and $_ -ine $dir }
$env:PATH = (@($dir) + $rest) -join ';'
}
}
2 changes: 1 addition & 1 deletion home/dot_config/fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for brew_bin in /opt/homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/brew $HOME
end

# Add ~/.cargo/bin (rustup proxies + `cargo install` bins) BEFORE `mise activate` so
# mise-managed toolchains and command wrappers (e.g. `mbx` for `cargo` on macOS) stay
# mise-managed toolchains and command wrappers (e.g. `mbx` for `cargo`) stay
# ahead of ~/.cargo/bin in both interactive and non-interactive fish shells. Use --move
# so inherited PATH entries still land in deterministic order; add ~/.local/bin last
# so it stays highest priority.
Expand Down
18 changes: 10 additions & 8 deletions home/dot_config/mise/conf.d/mbx.toml.tmpl
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{{- if and (eq .chezmoi.os "darwin") (eq .chezmoi.arch "arm64") -}}
# Route plain `cargo` calls through Mr. Boxington (`mbx`) on Apple Silicon macOS
# so per-worktree Rust builds share APFS copy-on-write blocks under a bounded
# cache budget. Projects that set CARGO_TARGET_DIR, --target-dir, or
# build.target-dir keep their own target directory; build.build-dir is also
# preserved (without the check lane).
{{- if not (and (eq .chezmoi.os "darwin") (ne .chezmoi.arch "arm64")) -}}
# Route plain `cargo` calls through Mr. Boxington (`mbx`) so per-worktree Rust
# builds share cached compilations and copy-on-write outputs (APFS, Btrfs, XFS,
# ReFS Dev Drive) under a bounded cache budget. Uses mbx's native per-OS cache
# directory (`~/Library/Caches/mbx`, `~/.cache/mbx`, `%LOCALAPPDATA%\mbx`).
# Projects that set CARGO_TARGET_DIR, --target-dir, or build.target-dir keep
# their own target directory; build.build-dir is also preserved (without the
# check lane).
#
# Bypass for one command:
# MBX_DISABLE=1 cargo build
# POSIX: MBX_DISABLE=1 cargo build
# PowerShell: $env:MBX_DISABLE="1"; try { cargo build } finally { Remove-Item Env:MBX_DISABLE }

[tools]
mr-boxington = "{{ .dotfiles.pins.mrBoxington }}"

[env]
MBX_CACHE_DIR = "{{ `{{ env.HOME }}` }}/Library/Caches/mbx"
MBX_GC_MAX_TOTAL_SIZE = "100GiB"

[wrappers.cargo]
Expand Down
2 changes: 1 addition & 1 deletion home/dot_config/shell/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unset _brew
# Precedence (highest first): ~/.local/bin > mise command-wrappers > mise shims > cargo > brew > system.
# Listed low-to-high because path_prepend moves each to the front.
#
# Rust: cargo/rustc resolve via mise's command-wrappers (when configured, e.g. mbx on macOS)
# Rust: cargo/rustc resolve via mise's command-wrappers (when configured, e.g. mbx)
# and shims. mise's rust backend delegates to rustup, so ~/.cargo/bin holds rustup's proxies
# (cargo -> rustup, ...) plus `cargo install` binaries — kept below mise so wrappers and
# per-repo rust-toolchain.toml switching stay authoritative. (We deliberately don't source
Expand Down
20 changes: 13 additions & 7 deletions tests/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,11 @@ def test_gui_testing_skill_is_deployed_to_all_harnesses(self):
for harness in [".claude/skills", ".codex/skills", ".pi/agent/skills"]:
self.assertEqual((self.home / harness / "gui-testing").resolve(), skill.resolve())

def test_mbx_and_hidden_display_are_scoped_to_macos_tools(self):
def test_mbx_and_hidden_display_scoping(self):
pin = tomllib.loads((ROOT / "home/.chezmoidata.toml").read_text())["dotfiles"]["pins"]["mrBoxington"]
build_script = ROOT / "home/.chezmoiscripts/run_onchange_after_07-install-hidden-display-darwin.sh.tmpl"
mise_script = ROOT / "home/.chezmoiscripts/run_onchange_after_02-install-mise-tools.sh.tmpl"
mise_sh_script = ROOT / "home/.chezmoiscripts/run_onchange_after_02-install-mise-tools.sh.tmpl"
mise_ps1_script = ROOT / "home/.chezmoiscripts/run_onchange_after_02-install-mise-tools.ps1.tmpl"
targets = [
("darwin", "arm64"),
("darwin", "amd64"),
Expand All @@ -607,7 +608,7 @@ def test_mbx_and_hidden_display_are_scoped_to_macos_tools(self):
)
managed = self.chezmoi("managed").stdout.splitlines()
expect_darwin = platform == "darwin" and tools_enabled
expect_mbx = expect_darwin and arch == "arm64"
expect_mbx = tools_enabled and not (platform == "darwin" and arch != "arm64")
self.assertEqual(".config/mise/conf.d/mbx.toml" in managed, expect_mbx)
self.assertEqual(".local/share/hidden-display/hidden-display.m" in managed, expect_darwin)
self.assertNotIn(".local/bin", managed)
Expand All @@ -621,26 +622,31 @@ def test_mbx_and_hidden_display_are_scoped_to_macos_tools(self):
mbx_body = self.chezmoi("cat", str(self.home / ".config/mise/conf.d/mbx.toml")).stdout
mbx_cfg = tomllib.loads(mbx_body)
self.assertEqual(mbx_cfg["tools"]["mr-boxington"], pin)
self.assertEqual(mbx_cfg["env"]["MBX_CACHE_DIR"], "{{ env.HOME }}/Library/Caches/mbx")
self.assertNotIn("MBX_CACHE_DIR", mbx_cfg["env"])
self.assertEqual(mbx_cfg["env"]["MBX_GC_MAX_TOTAL_SIZE"], "100GiB")
self.assertEqual(
mbx_cfg["wrappers"]["cargo"],
{"command": "mbx", "env": {"MBX_CARGO_SHIM_MODE": "1"}},
)
rendered_mise = self.chezmoi("execute-template", "-f", str(mise_script)).stdout
if platform != "windows" and tools_enabled:
rendered_mise = self.chezmoi("execute-template", "-f", str(mise_sh_script)).stdout
self.assertIn("mise install", rendered_mise)
self.assertIn("mise reshim", rendered_mise)
self.assertEqual("# mbx:" in rendered_mise, expect_mbx)
# Windows with runtimes and tools keeps .local/bin/python3.cmd without .local/share.
if platform == "windows" and tools_enabled:
rendered_ps1 = self.chezmoi("execute-template", "-f", str(mise_ps1_script)).stdout
self.assertIn("# mbx:", rendered_ps1)
self.assertIn("mise reshim", rendered_ps1)
self.assertIn(r"mise\command-wrappers\bin", rendered_ps1)
# Windows with runtimes and tools keeps .local/bin/python3.cmd and mbx.toml without .local/share.
self.platform = "windows"
self.arch = "amd64"
self.configure("standalone", bootstrap=False, modules={"tools": True, "runtimes": True})
win_managed = self.chezmoi("managed").stdout.splitlines()
self.assertIn(".local/bin/python3.cmd", win_managed)
self.assertIn(".config/mise/conf.d/mbx.toml", win_managed)
self.assertNotIn(".local/share", win_managed)
self.assertNotIn(".local/share/hidden-display/hidden-display.m", win_managed)
self.assertNotIn(".config/mise/conf.d/mbx.toml", win_managed)

def test_hidden_display_build_script_installs_into_local_bin(self):
self.platform = "darwin"
Expand Down
Loading