Docs / Start
Moving to RCH
From docs/guides/migration.md · last changed 2026-11-03 · Suggest a change
On this page 15 sections
- Overview
- Pre-Migration Checklist
- Step 1: Infrastructure Setup
- Step 2: Install Hooks
- Step 3: Validation
- Step 4: Canonical Topology Rollout Plan (/data/projects + /dp)
- Mixed-State Worker Handling (Critical)
- Validation Checklist (Per Phase Gate)
- Dry-Run Procedure + Evidence Template
- Step 5: Performance Tuning
- Common Migration Issues
- Rollback Plan
- Post-Migration
- Comparison: Before vs After
- Success Criteria
This guide helps you transition from local compilation to RCH remote compilation.
Overview#
Migrating to RCH involves:
- Setting up the infrastructure (workers, daemon)
- Installing hooks for your AI coding agent
- Validating behavior matches local compilation
- Tuning for optimal performance
The goal is transparent operation - your workflow shouldn't change.
Pre-Migration Checklist#
Before starting:
- [ ] Identify worker machines (existing servers, cloud VMs, spare desktops)
- [ ] Ensure SSH access to workers
- [ ] Verify workers have sufficient resources (CPU, RAM, disk)
- [ ] Document current build times as baseline
Step 1: Infrastructure Setup#
Install RCH on Workstation#
# From source
git clone https://github.com/Dicklesworthstone/remote_compilation_helper.git
cd remote_compilation_helper
cargo build --release
cp target/release/rch target/release/rchd ~/.local/bin/
# Or via cargo
cargo install --git https://github.com/Dicklesworthstone/remote_compilation_helper.gitConfigure Workers#
mkdir -p ~/.config/rch
cat > ~/.config/rch/workers.toml << 'EOF'
[[workers]]
id = "worker1"
host = "your-worker-ip"
user = "your-username"
identity_file = "~/.ssh/id_rsa"
total_slots = 8
priority = 100
EOFDeploy to Workers#
# Install RCH on workers
rch fleet deploy
# Verify
rch fleet verifyStart the Daemon#
rch daemon startStep 2: Install Hooks#
Claude Code#
rch hook install --agent=claude-codeThis adds RCH to Claude Code's PreToolUse hooks.
Verify Hook Installation#
rch hook statusShould show the hook is active.
Step 3: Validation#
Test Classification#
Verify commands are classified correctly:
# Should be REMOTE
rch classify "cargo build --release"
rch classify "cargo test"
rch classify "cargo check"
# Should be LOCAL
rch classify "cargo fmt"
rch classify "cargo install foo"
rch classify "cargo clean"
rch classify "git status"Test End-to-End#
Run a build with verbose output:
cd /path/to/rust/project
RCH_VERBOSE=1 cargo buildYou should see:
- Command classification
- Worker selection
- Transfer to worker
- Remote execution
- Artifact retrieval
Verify Artifacts#
After remote build:
# Check artifacts are present
ls -la target/release/
# Run the binary
./target/release/your-app --versionStep 4: Canonical Topology Rollout Plan (/data/projects + /dp)#
This phase is specifically for migrating existing workers to the canonical filesystem topology required by reliability workstreams:
/data/projectsmust exist as a directory/dpmust be a symlink resolving to/data/projects- workers failing topology preflight must be excluded from remote scheduling
Phase 0: Fleet Inventory and Segmentation#
- Capture a baseline before making any changes:
rch workers list
rch workers probe --all
rch status --workers- Segment workers into rollout cohorts (for example by region or host group):
canary(5-15% of fleet)batch-a(next 30-40%)batch-b(remainder)
- Record cohort membership in your operations notes before execution.
Phase 1: Canary Cohort#
Run migration only on canary workers first:
# Run bootstrap/enforcement for a single canary worker or a small set.
rch workers setup --worker <canary-id>
# Re-verify health and topology eligibility.
rch workers probe <canary-id>
rch status --workersGo/no-go rule for Phase 1:
- Proceed only if all canary workers are healthy or have explicit, understood, non-topology issues unrelated to migration.
Phase 2: Rolling Batch Migration#
Migrate the remaining cohorts in bounded batches. After each batch:
- Run worker setup for that cohort.
- Re-check worker probe + status.
- Stop immediately on repeated topology integrity failures.
Phase 3: Full-Fleet Validation and Stabilization#
After all cohorts are migrated:
- Run full worker health checks.
- Run representative compile/test workloads.
- Confirm no persistent preflight exclusion for topology reasons.
Mixed-State Worker Handling (Critical)#
During migration, mixed states are expected temporarily. Treat them explicitly:
| State Detected | Meaning | Required Action |
|---|---|---|
projects_root_ok=true |
Topology healthy | Keep worker eligible |
alias_missing |
/dp missing |
Re-run setup, verify symlink creation |
alias_wrong_target:* |
/dp points elsewhere |
Preserve both roots; select a compatible worker or have the operator reconcile the mapping after inspecting source owners |
alias_not_symlink |
/dp exists but wrong type |
Preserve the existing directory and its data; investigate its intended ownership before any operator repair |
alias_not_directory |
The alias resolves to a file or another non-directory object | Preserve the existing object; select a compatible worker or have the operator correct the mapping safely |
canonical_not_directory |
/data/projects exists but invalid type |
Manual integrity remediation before retry |
canonical_missing |
canonical root absent | Re-run setup, confirm directory creation |
source_topology_incompatible |
This worker rejected the dispatcher's requested physical mapping | Select a compatible worker; after safe operator correction, run rch workers capabilities --refresh to revalidate the exact mapping |
Workers with topology failures must remain excluded from remote scheduling until explicit revalidation confirms recovery.
The worker's default projects_root_ok check does not prove compatibility with
every dispatcher layout. A persisted source_topology_mismatches entry remains
ineligible for its exact mapping even if the worker's default topology is healthy.
Such permanent refusals exit 1; temporary source ownership contention retains
the bounded retry policy and retryable exit 103. See the configuration
guide
for diagnostics and recovery without replacing existing aliases or source roots.
Validation Checklist (Per Phase Gate)#
Use this checklist before promoting to the next phase:
- [ ]
rch workers probesucceeds for target cohort - [ ] No unresolved topology-preflight failure reasons in
rch status --workers - [ ] At least one representative
cargo buildandcargo testrun succeeds - [ ] No unexpected fail-open spikes during the phase window
- [ ] Operator notes include worker IDs, timestamps, and remediation actions
Dry-Run Procedure + Evidence Template#
Before each production phase, run and archive a dry-run evidence bundle:
# Example evidence capture commands
date -Iseconds
rch workers list
rch workers probe --all
rch status --workersEvidence template (store in your rollout notes):
Phase: <canary|batch-a|batch-b|final>
Timestamp: <ISO8601>
Cohort Workers: <comma-separated ids>
Preflight Summary: <healthy/degraded counts>
Topology Failures: <none | list of worker->reason>
Actions Taken: <commands + remediation>
Go/No-Go Decision: <go|no-go>
Approved By: <operator>Step 5: Performance Tuning#
Baseline Comparison#
Compare build times:
# Local build (RCH disabled)
RCH_ENABLED=false time cargo build --release
# Remote build
RCH_ENABLED=true time cargo build --releaseInitial Sync#
First sync to a worker is slow (full project transfer). Subsequent syncs are incremental.
Tips to minimize initial sync:
- Ensure
.gitignoreincludestarget/ - Add large data directories to excludes
- Consider pre-warming worker caches
Optimize Excludes#
# ~/.config/rch/config.toml
[transfer]
exclude_patterns = [
"target/",
".git/",
"node_modules/",
"benches/data/",
"test_fixtures/large/",
]Adjust Compression#
For different network conditions:
# Fast local network (100Mbps+)
compression_level = 1
# Moderate network (10-100Mbps)
compression_level = 3
# Slow network (<10Mbps)
compression_level = 9Common Migration Issues#
"Build runs locally instead of remote"#
- Check daemon is running:
rch daemon status - Check hook is installed:
rch hook status - Check command classification:
rch classify "your command" - Check confidence threshold: lower if needed
"Build slower than local"#
Expected for:
- Small projects (overhead exceeds benefit)
- First build (initial sync is slow)
- Poor network to workers
Solutions:
- Increase
min_local_time_msto skip small builds - Add more workers
- Improve network connectivity
"Build fails remotely but works locally"#
Common causes:
- Missing tools on worker (install via
rch fleet deploy) - Different Rust version (sync toolchains)
- Platform-specific code (workers must be same platform)
- Missing environment variables
Debug with:
RCH_LOG_LEVEL=debug cargo build 2>&1 | tee build.log"Artifacts missing after build"#
Check transfer patterns include your artifacts:
# .rch/config.toml
[transfer]
include_artifacts = [
"target/release/*",
"target/debug/*",
]Rollback Plan#
If migration causes instability or inconsistent topology states, roll back in reverse cohort order.
Rollback Triggers#
Initiate rollback when any of the following are true:
- sustained topology preflight failures after remediation attempts
- repeated
alias_wrong_target/alias_not_symlinkreoccurrence in the same cohort - materially elevated fail-open rate attributable to topology drift
- operator cannot prove canonical invariants for current rollout segment
Rollback Steps#
- Freeze rollout immediately (no new cohorts).
- Remove affected workers from routing (drain/disable) until repaired:
rch workers drain <worker-id>- Restore previously known-good worker topology configuration for the affected cohort.
- Re-run probe/status validation:
rch workers probe <worker-id>
rch status --workers- Re-enable workers only after explicit verification:
rch workers enable <worker-id>- If fleet-wide instability persists, temporarily disable RCH for local fallback:
export RCH_ENABLED=falseRollback Completion Criteria#
- All affected workers are either healthy and revalidated, or intentionally drained.
- No unknown topology-preflight failures remain.
- Incident notes include root cause, corrective action, and follow-up owner.
Post-Migration#
Document the Setup#
Record:
- Worker configurations
- Tuning decisions made
- Known issues and workarounds
Set Up Monitoring#
- Add health checks (see Monitoring Guide)
- Configure alerts for daemon/worker issues
- Track build performance over time
Team Onboarding#
Share with team:
- RCH overview and benefits
- How to check if RCH is working
- How to bypass RCH if needed
- Who to contact for issues
Comparison: Before vs After#
| Aspect | Before (Local) | After (RCH) |
|---|---|---|
| Build CPU | Workstation | Workers |
| Build parallelism | Limited by local cores | Limited by fleet cores |
| Concurrent agents | ~2-3 before throttling | Many (worker-limited) |
| Workstation responsiveness | Degraded during builds | Maintained |
| Setup complexity | None | Moderate (one-time) |
| Dependencies | Local tools | Tools on workers |
Success Criteria#
Migration is successful when:
- [ ] Builds complete successfully via RCH
- [ ] Build times are acceptable (≤ 15% overhead typical)
- [ ] Multiple agents can build concurrently
- [ ] Workstation remains responsive during builds
- [ ] Team is trained on RCH operation
- [ ] Monitoring and alerts are in place