RCH

Docs / Operate

Configuration

From docs/guides/configuration.md · last changed 2026-11-07 · Suggest a change

On this page 9 sections

This guide consolidates how RCH configuration works, where files live, and how values are resolved when multiple layers exist.

Overview#

RCH has three primary configuration surfaces:

  1. Hook/CLI config (config.toml) for interception, transfer, and circuit breaker behavior.
  2. Worker definitions (workers.toml) for daemon-managed worker inventory.
  3. Daemon settings (daemon.toml) for health checks and socket behavior.

Precedence (Hook/CLI Config)#

For rch (the hook/CLI), the effective configuration is resolved in this order (lowest to highest):

  1. Built-in defaults
  2. User config: ~/.config/rch/config.toml
  3. Project config: .rch/config.toml
  4. Environment variables (RCH_*)
  5. Command-line flags (when a command supports them)

Tip: use rch config show --sources to see where each value came from.

Note: the config library includes support for .env / .rch.env files and profile presets (via RCH_PROFILE), but the current rch loader only applies user/project config + env overrides. Verify your effective values with rch config show --sources.

Hook/CLI Config File (config.toml)#

Location:

  • User: ~/.config/rch/config.toml
  • Project: .rch/config.toml

Sections and fields:

[general]#

  • enabled (bool, default true) — Master on/off switch for the hook.
  • log_level (string, default "info") — trace|debug|info|warn|error.
  • socket_path (string, default "$XDG_RUNTIME_DIR/rch.sock" if set, otherwise "~/.cache/rch/rch.sock"; falls back to "/tmp/rch.sock") — Unix socket path used to communicate with the daemon.

[timeouts]#

  • scale (number, default 1.0, inclusive range 1.0..=10.0) — Multiplies bounded slow-path control deadlines for healthy workers whose SSH, filesystem scans and locks take longer under load. Both integer and fractional TOML values are accepted. RCH_TIMING_SCALE overrides the file setting. Empty, malformed, non-finite and out-of-range values are errors rather than silently falling back to a different policy.
toml
[timeouts]
scale = 2.5

The client resolves defaults, user TOML, project TOML and the environment in that order. An explicit project scale = 1 resets a larger user value. The on-disk configuration cache stores only the file layers; each invocation reapplies the current environment. The client explicitly exports its validated value to embedded remote helpers, so workers need no environment setup for that job.

The daemon resolves its own user config.toml and RCH_TIMING_SCALE at startup, including starts without a configuration file. Restart rchd after changing its timing policy. A project setting or a variable supplied only to rch exec affects that invocation, not the daemon already running in another process. To use one fleet policy for both, set it in the user configuration and restart the daemon, or provide the variable to both processes.

Health monitoring and recovery of recorded workers share the same scaled worker_timeout_secs allowance. SSH connection-pool reuse checks also use the scale. Toolchain and capability checks keep their original elapsed deadline through connection setup, lock waits and publication. A late or cancelled capability check retains the previous complete snapshot; it cannot advertise new capacity or reset that snapshot's age. A late toolchain verdict cannot refresh a cached worker exclusion.

Periodic and on-demand telemetry retain their original collection deadline through SSH and publication. A periodic poll commits its sample and clears command-failure evidence together after checking the worker's endpoint and administrative generation. On-demand publication preserves its existing circuit behavior. Waiting for a busy telemetry cache cannot give an old sample a new freshness window or clear a failure after the probe deadline. If a timely remote sample cannot be published locally, the poll leaves existing evidence unchanged instead of recording a worker command failure. Exhausted remote polls have a fixed one-second local window to record failure; that window starts at the remote deadline, permits no more SSH work and cannot overwrite a newer successful observation.

Cancellation uses one overall deadline starting before recovery admission. Connection inspection, the remote stop attempt and local settlement consume that same allowance. Historical recovery checks also retain that deadline while waiting to publish transport evidence. Queued publication consumes the proof's lifetime; when a down endpoint recovers, its next probe remains due at the proof's original expiry. A response at or after expiry remains unconfirmed; the existing process identity, exact receipt and reservation-retention rules still apply. A timely remote confirmation stays recorded if later local settlement expires, while incomplete overall cancellation retains ownership. Durable completion and fallback disk receipts both use the scaled ten-second read allowance and terminate their owned local transport on timeout.

The disk monitor's mandatory completion acknowledgment uses the existing scaled heartbeat allowance when its pipe is full. The guardian also drains queued heartbeats before accepting that acknowledgment and normal supervisor exit. Parent loss, cancellation, abnormal exit and uncertain delivery still stop the owned process group.

Automatic recovery of a dead client's lease scales its five-minute control allowance and retains a fixed thirty seconds of local exit slack, within the one-hour cap. Admission, historical transport verification, SSH inspection, the recovery client and final journal confirmation consume one original deadline. The child receives the daemon's resolved timing scale and a whole-second timeout derived from the remaining allowance; the parent enforces the exact elapsed boundary. Readiness scans also bound queued lock waits while retaining candidates and their ownership for a later scan. These limits govern recovery control work and do not change compiler or test lifetimes.

Worker-side source namespace location and cancellation settlement share one five-second lock-admission budget multiplied by the transported scale. Current and legacy activity and metadata locks consume that same original window; waiting for the next lock does not renew it. A lock becoming free at or after the deadline cannot admit a registry transaction. The enclosing metadata guardian keeps its separate scaled fifteen-second program limit. Expiry retains the cancellation obligation and grants no source or slot release.

Recovery of temporarily bypassed workers keeps one captured allowance across its concurrency queue, admission, SSH setup, capability probes and optional canary. Telemetry retains its original, unscaled freshness limit through local publication and the canary; a longer control allowance cannot make an old sample current. An exhausted remote phase has a fixed one-second allowance for local failure bookkeeping, with no further SSH work.

Full worker rejoin stages the durable record removal before the final evidence check and acquires all live eligibility and circuit guards before committing. Expired or cancelled queued work retains quarantine. The final check uses the original deadline, telemetry expiry, endpoint and administrative authority. Once the atomic replacement commits under valid evidence, its outcome remains explicit even if the directory flush takes longer; unconfirmed durability retains the live quarantine for a later recovery attempt.

Newly durable, owner-validated job completion requests a fresh probe of the saved worker endpoint when recovery is waiting on backoff. The hint bounds queued local waits to one second; an admitted durable schedule write finishes synchronously. It preserves administrative disable/drain intent, quarantine, failure counters, active probes, and the spacing between successful recovery probes. Duplicate completion acknowledgments do not renew the hint. Returning slots supplies no health evidence: normal probes and any required canary must still pass before the worker can accept builds again.

The affected operations are worker toolchain/capability/telemetry probes, embedded disk-monitor admission and heartbeat observations, source-namespace control, cancellation observation and settlement, and completion-receipt retries. Their enclosing transport budgets must allow the same scaled work. Retry windows remain bounded by elapsed time. The shared duration policy caps each scaled control budget at one hour, even at scale 1.0; oversized configured base budgets and multiplication overflow cannot create an unbounded deadline. Fractional values remain fractional inside the control deadlines. OpenSSH's integer-only ConnectTimeout rounds upward: a five-second connection budget at scale 2.5 becomes 12.5s internally and 13s in the SSH argument. The enclosing elapsed deadline still applies; rounding the transport argument does not grant extra time to publish a result.

The scale does not change compiler/test lifetimes, signal-escalation grace, queue limits, periodic polling cadence, worker-exclusion cooldowns, resource or disk thresholds, or process-ownership evidence. A larger deadline cannot authorize a signal, declare an unknown process dead, bypass disk admission or release a reservation without its existing confirmation. Source acquisition, source release, completion receipts and telemetry reject evidence arriving at or after their elapsed deadline. An incomplete ownership acknowledgment remains a failure even when the transport exits successfully.

Scope binding and launch admission may retry an unknown observation while their original deadline is open. They recheck cancellation and process identity and keep the execution gate closed until positive evidence is available. Retries refuse a stopped or backward-moving observation clock. Cancellation settlement also stays bounded and retains the process record when cleanup is unconfirmed.

Use rch config set timeouts.scale 2.5, get, reset, show --sources, diff or export to manage and inspect this setting.

[compilation]#

  • confidence_threshold (float, default 0.85) — Minimum classifier confidence to intercept a command.
  • min_local_time_ms (u64, default 2000) — Skip interception if the estimated local runtime is shorter than this. Uses timing history from past builds.
  • remote_speedup_threshold (float, default 1.2) — Minimum predicted speedup ratio (local/remote) required for offloading. Set to 1.0 to always offload when other criteria are met. Set higher (e.g., 1.5) to only offload builds predicted to be significantly faster remotely.

[transfer]#

  • compression_level (u32, default 3) — zstd compression level.
  • exclude_patterns (list) — Patterns excluded from transfer. Defaults include: target/, .git/, node_modules/, common build caches, and coverage output. Use rch config show to see the full effective list.
  • ssh_server_alive_interval_secs (u64, optional) — Sets ssh -o ServerAliveInterval for remote execution and rsync transfers to reduce dropped connections on flaky networks.
  • ssh_control_persist_secs (u64, optional) — Positive values opt Unix dispatches into one supervised foreground SSH connection, shared by preparation, transfers, execution and cleanup. The active dispatch pins the connection until cleanup; a completed dispatch reaps it instead of leaving a background ControlPersist process. Unset or 0 keeps one-shot transports. Windows workers and automatic recovery also retain their one-shot transports. Enable it for high-latency workers. A dispatch makes many short SSH requests, and without it each one pays a fresh handshake: several seconds per request on an intercontinental link, against about half a second on a reused connection. One such setup (#132) cut the fixed per-rch exec overhead from about 60 s to about 24 s. The connection still lasts for one dispatch only, so each rch exec pays one handshake.
  • sync_timeout_ms (u64, optional; 1000..=3600000) — Per-attempt timeout for uploading source to the worker. When unset, RCH uses a payload-aware default: 30 seconds plus one second per MiB at a conservative 1 MiB/s floor, capped at one hour. Each retry receives this full timeout and resumes the same partial immutable-base upload. This setting does not affect remote Cargo execution or artifact-return timeouts.
  • source_sync_silence_timeout_secs (u64, default 120) — Abort a source sync after this many seconds with no rsync output at all (no progress refresh, stats, or itemized line). This detects a dead channel or wedged rsync far faster than the wall-clock sync_timeout_ms cap, while a large but progressing transfer is never affected: every --info=progress2 refresh counts as forward progress. On a stall, the hook releases the worker's reservation and retries the build on another admissible worker. 0 disables silence detection.
  • rsync_bin (string, optional) — Explicit rsync binary for every local transfer. Unset (the default) lets RCH resolve one: the PATH rsync when it is rsync 3.1 or newer, otherwise a modern rsync from /opt/homebrew/bin, /usr/local/bin, or /opt/local/bin, otherwise the PATH binary driven with an openrsync/rsync 2.6.9-compatible flag set (no --info=*, zlib instead of zstd, no --append-verify; the zero-build-output detector fails open). ~ is expanded and a bare name is looked up on PATH. The RCH_RSYNC_BIN environment variable overrides this setting. rch doctor shows the resolved binary and flavour.

[circuit]#

  • failure_threshold (u32, default 3; alias down_after_failures) — Consecutive failures to open; consecutive connection failures also mark the worker temporarily offline.
  • success_threshold (u32, default 2) — Consecutive successes to close.
  • error_rate_threshold (float, default 0.5) — Error rate to open in window.
  • window_secs (u64, default 60) — Rolling error window size.
  • open_cooldown_secs (u64, default 30) — Cooldown before half-open.
  • half_open_max_probes (u32, default 1) — Concurrent probes allowed.
  • command_failure_threshold (u32, default 2) — Consecutive remote command failures to open, tracked separately from connection failures.
  • open_cooldown_max_secs (u64, default 480) — Maximum exponential circuit cooldown after repeated reopens, never less than open_cooldown_secs.
  • recovery_probe_interval_secs (u64, default 300) — Minimum interval between single bounded SSH attempts while offline. A larger open_cooldown_secs also applies. Other background polling waits for recovery; the first successful recovery probe restores transport availability.

These settings support rch config set, get, reset, show --sources, and diff. The failure threshold and recovery probe interval must be positive. Restart rchd after changing daemon circuit settings. rch workers disable <id> suppresses connections until an explicit enable; the administrative state is durable across daemon restarts.

Example:

toml
[general]
enabled = true
log_level = "info"
socket_path = "~/.cache/rch/rch.sock"

[compilation]
confidence_threshold = 0.85
min_local_time_ms = 2000
remote_speedup_threshold = 1.2

[transfer]
compression_level = 3
exclude_patterns = ["target/", "node_modules/"]
ssh_server_alive_interval_secs = 30
ssh_control_persist_secs = 60

[circuit]
failure_threshold = 3
success_threshold = 2
error_rate_threshold = 0.5
window_secs = 60
open_cooldown_secs = 30
half_open_max_probes = 1
command_failure_threshold = 2
open_cooldown_max_secs = 480
recovery_probe_interval_secs = 300

[path_topology]#

  • canonical_root (string, optional, default "/data/projects") — Canonical project root directory. Override this on systems where /data/projects is unavailable (e.g., macOS with SIP).
  • alias_root (string, optional, default "/dp") — Symlink alias root that points at the canonical root.

Environment variable overrides:

  • RCH_CANONICAL_PROJECT_ROOT
  • RCH_ALIAS_PROJECT_ROOT

Example (macOS):

toml
[path_topology]
canonical_root = "/Users/me/Projects"
alias_root = "/Users/me/p"

Worker compatibility and permanent namespace refusals#

For ordinary source mirrors, each selected worker must resolve the configured canonical and alias roots to the same physical directory. The worker may use a different symlink layout: both roots can be symlinks to one directory. However, /dp -> /data/projects and a separate real /Users/me/Projects directory are incompatible with a request for /Users/me/Projects plus /dp. The initializer refuses that mapping before taking source authority or copying sources. It never replaces an existing alias or merges distinct source trees.

A confirmed RCH_SOURCE_TOPOLOGY_INCOMPATIBLE refusal is permanent for that worker endpoint and requested mapping. After acknowledging the failed reservation, rch exec may select a different eligible worker within the caller's requested worker set. A pinned incompatible worker, or a pool containing only workers known to reject that mapping, exits 1, including when RCH_REQUIRE_REMOTE=1. It does not exit 103 or execute the command locally. JSON reports outcome: "refused", fallback_reason: "source_topology_incompatible", and the stable error marker; the initialization failure identifies the worker and the configured/physical paths. No compiler exit is invented for a command that never started.

These confirmed preflight refusals do not spend the execution retry budget (RCH_MAX_REMOTE_ATTEMPTS, default 3). Each rejected worker is excluded from the invocation, so relocation remains bounded by the eligible worker set. Actual execution and other pipeline failures still consume attempts, and --source-content-receipt remains restricted to its single selected worker.

The daemon saves namespace-initialization refusals across restarts. It excludes only the recorded endpoint/mapping pair: another worker, or a different compatible mapping on the same worker, remains eligible. Last-success affinity cannot override this exclusion. Isolated overlays, source-content receipt jobs, and off-root staging use their staging namespace as the placement key. A transient overlapping source owner remains separately classified and may still produce retryable exit 103. If another compatible worker is temporarily busy, the normal capacity retry policy still applies to that worker.

The admitted reservation records the exact requested roots. A refusal report cannot exclude a different mapping, and final admission checks the saved exclusions again in case another attempt reported a conflict during selection. Jobs admitted before this scope was recorded can complete normally; their late reports do not create new exclusions for unproven mappings.

If startup quarantines contradictory ownership records, it preserves every independently validated topology exclusion and archives the original snapshot before replacing it. If the snapshot is truncated, malformed, or has invalid topology records, startup retains the original file and stops with its path and repair instructions. An unreadable snapshot cannot establish that no permanent exclusions existed. Restore a valid ownership snapshot instead of deleting it to make an incompatible worker eligible again.

Worker capability reports also identify the roots they actually checked. A confirmed physical conflict for those exact roots can prevent selection before namespace initialization. A probe for different roots cannot prove the requested mapping incompatible; namespace initialization still validates it before source authority is acquired. Missing paths and failed probes are not classified as confirmed physical conflicts. These capability observations are updated by the worker probe; they cannot clear a saved namespace-initialization refusal.

Inspect the exact refusals with:

bash
rch workers list --json
rch workers capabilities --json
rch status --workers --json

Each affected worker exposes source_topology_mismatches with its requested mapping and diagnostic detail. To continue immediately, select a compatible worker, for example rch exec --worker compatible-builder -- cargo check, or remove an unnecessary pin so RCH can select an eligible peer. To restore an excluded mapping, have the operator reconcile its physical layout safely after checking existing source owners and the contents of both trees. Do not replace an existing alias, remove a real directory, or change dispatcher topology merely to suppress the refusal. Once the mapping actually resolves to one directory:

bash
rch workers capabilities --refresh

Refresh performs a read-only check of saved namespace refusals. Only a complete, successful check of the exact mapping and current endpoint clears the saved exclusion; failed probes, ordinary healthy-worker reports, elapsed time, and daemon restarts do not clear it. Refresh does not create directories, replace links, or release source ownership. Existing ownership and execution-recovery uncertainty always retain their stricter no-replay rules.

[api] — daemon status API over the tailnet#

rchd's rich state (/status, /workers/capabilities) lives on a 0600 Unix socket that only the local user can read. This section serves the same JSON on a TCP listener so agents and the fleet dashboard on other machines can ask a dispatcher "why are you local-only right now?" without ssh. It is designed for a Tailscale tailnet and is off unless bind is set.

  • bind (string, default "" = off) — "tailscale" resolves this machine's Tailscale IPv4 at daemon start (port 9101); "tailscale:PORT", "IP:PORT" or "[v6]:PORT" are taken literally. The address must be loopback or inside Tailscale's ranges (100.64.0.0/10, fd7a:115c:a1e0::/48); anything else is refused at startup — the payload carries worker hosts and IPs.
  • token (string, optional) — bearer token required on /status, /workers/capabilities, /workers/config, /repo-convergence/status[?worker=<id>]. Sent as Authorization: Bearer <token> or X-Rch-Token: <token>.
  • token_file (string, optional) — file holding the token (trimmed, ~ expanded). Wins over token. Keep it 0600.
  • no_token (bool, default false) — serve the status routes with no token. Honoured only when no token is configured and must be set explicitly, so an empty token is never an accidental open door.
  • allow_any_addr (bool, default false) — permit a bind outside loopback and the Tailscale ranges. You almost never want this.

/health, /ready, /metrics and /budget are served on the same listener without a token, exactly as on loopback :9100. A bad [api] section is logged with its fix and the daemon keeps running without the API — a dashboard knob must never stop builds. CLI overrides: rchd --api-bind, rchd --api-token-file. Set from the CLI:

bash
head -c 32 /dev/urandom | base64 | tr '+/' '-_' | tr -d '=' > ~/.config/rch/api.token
chmod 600 ~/.config/rch/api.token
rch config set api.bind tailscale
rch config set api.token_file ~/.config/rch/api.token
# then restart rchd; verify from another tailnet box:
curl -H "Authorization: Bearer $(cat ~/.config/rch/api.token)" http://100.x.y.z:9101/status | jq .daemon

[dashboard]#

  • url (string, optional) — where the fleet dashboard is served, e.g. https://rch-fleet.vercel.app. rch web opens it (--url and RCH_DASHBOARD_URL override). Agents use <url>/api/fleet?view=help.

Workers Config (workers.toml)#

Location: ~/.config/rch/workers.toml

Each worker entry:

  • id (string, required) — Unique identifier.
  • host (string, required) — Hostname or IP.
  • user (string, default "ubuntu") — SSH user.
  • identity_file (string, default "~/.ssh/id_rsa") — SSH key path.
  • total_slots (u32, default 8) — CPU slots available.
  • priority (u32, default 100) — Higher = preferred.
  • tags (list, default []) — Optional selection tags.
  • tools (list, default []) — Verified named tool probes; see below.
  • enabled (bool, default true) — Skip worker if false.

Example:

toml
[[workers]]
id = "worker-1"
host = "203.0.113.20"
user = "ubuntu"
identity_file = "~/.ssh/id_rsa"
total_slots = 16
priority = 100
tags = ["ssd", "fast"]
enabled = true
tools = [
  { name = "clang",  command = ["clang", "--version"] },
  { name = "ld.lld", command = ["/usr/bin/ld.lld", "--version"] },
]

tools — verified named tool probes#

Each entry declares a fixed argv that the worker runs as its configured user. The probe is judged by exit status alone — zero means present, anything else (missing binary, error exit, signal) means absent — and its output is discarded so a chatty tool cannot corrupt the fact stream.

  • name (string, required) — ASCII letters, digits, -, _, . or +. Anything else (a space, an =, a control character) is refused when the config loads: such a name could not survive the probe's RCH_FACT tool=<name> format and would be read back as a different name, which is a silent capability lie rather than a loud config error.
  • command (list of strings, required, non-empty) — the exact argv. It is never caller-supplied; RCH exposes no general remote-shell probe API, because a caller that could ask a worker to run an arbitrary command "to check for a tool" would be a remote execution primitive wearing a capability-probe hat.

Results appear in rch workers capabilities --refresh under Named tools, split into verified: and failed:. The split matters: a worker that declared a tool whose probe fails is broken, while a name nothing declared is usually a typo or a fleet that was never configured for it.

Declaring no tools sends the worker the byte-identical capability command it has always received, so adding probes to one worker cannot disturb the rest of a fleet — including workers still running an older rch-wkr.

Jobs require them with rch exec --job --require-tool NAME, or per project:

toml
# .rch/config.toml or ~/.config/rch/config.toml
[jobs]
required_tools = ["clang"]

Project defaults add to --require-tool in job mode only. Explicit --require-tool NAME also applies to normal compilations without bypassing their classifier or Rust target/toolchain requirements. Required tools demand strict remote execution; forced-local or disabled configuration refuses them. Both client and daemon need the verified-tools endpoint; older daemons reject it before worker reservation instead of ignoring the requirement.

A required tool no worker has verified admits no worker at all; selection reports capability_missing:tool:<name>:probe_failed or ...:not_declared.

required_tools and --require-tool (alias --require-toolchain) also take exact runtime versions, node@MAJOR.MINOR.PATCH and bun@MAJOR.MINOR.PATCH (for example required_tools = ["node@22.11.0"]). They match the version in the worker's reported capabilities exactly; ranges, partial versions and aliases are refused, and a mismatch reports capability_missing:runtime_version:node:required=<v>:observed=<v>. Rust has no such form: pin it with an exact rust-toolchain.toml channel, which RCH preflights on the worker (rustup run <toolchain> rustc --version) before selecting it. These cached presence probes do not identify the actual compiler or SDK bytes used in a particular build. rch admit --require-tool NAME -- <command> is a static requirement preview, not live worker or release qualification.

Daemon Config (daemon.toml)#

Location: ~/.config/rch/daemon.toml

Fields:

  • socket_path (default $XDG_RUNTIME_DIR/rch.sock or ~/.cache/rch/rch.sock) — Unix socket path.

  • health_check_interval_secs (default 30) — Health check cadence.

  • worker_timeout_secs (default 10) — Mark worker unreachable after timeout.

  • max_jobs_per_slot (default 1) — Max concurrent jobs per slot.

  • connection_pooling (default true) — Reuse SSH connections.

  • log_level (default "info") — Daemon logging level.

  • [project_lanes] (default empty) — how many builds of one project a worker may run at once, keyed by worker id. Without it, a worker runs at most one build per project, because builds share the worker's mirror of the project. Lane k > 0 syncs into its own mirror, <root>.rch-lane-<k>, with its own source lock and target dir. Each lane costs a full extra mirror on disk, so give lanes only to workers with the disk, cores and slots for them. Values are clamped to 1-8, and changes take effect after a daemon restart:

    toml
    [project_lanes]
    hz3 = 2
    hz4 = 2

Environment Variables (RCH_*)#

RCH uses environment variables for overrides, tooling, and testing. The list below groups variables by intent. If you are unsure whether a variable is applied in your version, verify with rch config show --sources or rch --help.

Core runtime overrides (hook/CLI)#

These are read by the hook configuration loader:

  • RCH_ENABLED
  • RCH_TIMING_SCALE (validated [timeouts].scale override, finite 1.0..=10.0)
  • RCH_LOG_LEVEL
  • RCH_SOCKET_PATH
  • RCH_CONFIDENCE_THRESHOLD
  • RCH_MIN_LOCAL_TIME_MS
  • RCH_REMOTE_SPEEDUP_THRESHOLD
  • RCH_COMPRESSION_LEVEL
  • RCH_COMPRESSION (legacy alias for RCH_COMPRESSION_LEVEL)
  • RCH_SYNC_TIMEOUT_MS (per-attempt source-upload timeout; 1000..=3600000)
  • RCH_CANONICAL_PROJECT_ROOT
  • RCH_ALIAS_PROJECT_ROOT

rch config export emits the loader-consumed names above so exported shell or .env output can be sourced directly. Use rch config show --sources to verify which layer supplied each value.

CLI/daemon options (documented in rch --help / validators)#

  • RCH_PROFILE
  • RCH_LOG_FORMAT
  • RCH_DAEMON_SOCKET (legacy alias for RCH_SOCKET_PATH; the canonical name wins when both are set)
  • RCH_DAEMON_TIMEOUT_MS (daemon socket connect/read timeout in milliseconds, 100..=600000, default 5000; the select-worker wait keeps RCH_DAEMON_RESPONSE_TIMEOUT_SECS / RCH_DAEMON_WAIT_RESPONSE_TIMEOUT_SECS)
  • RCH_TRANSFER_ZSTD_LEVEL (legacy alias for RCH_COMPRESSION_LEVEL, lowest precedence)
  • RCH_ENABLE_METRICS
  • RCH_TEST_MODE
  • RCH_WORKER (preferred worker override)
  • RCH_WORKERS (comma-separated preferred worker override list)

SSH identities are per worker (identity_file in workers.toml); there is no global RCH_SSH_KEY override.

Hook integration variables#

Used by hook integration scripts (see docs/extending/integration-hooks.md):

  • RCH_COMMAND
  • RCH_PROJECT
  • RCH_ESTIMATED_CORES
  • RCH_WORKER
  • RCH_LAST_BUILD_WORKER
  • RCH_BUILD_SUCCESS
  • RCH_BUILD_ERROR
  • RCH_AVAILABLE_WORKERS
  • RCH_TEST_HOOK

Fleet dashboard#

  • RCH_DASHBOARD_URL — the URL rch web opens (overrides [dashboard] url).

Installer / setup helpers#

  • RCH_CONFIG_DIR
  • RCH_INSTALL_DIR
  • RCH_NO_COLOR
  • RCH_NO_HOOK
  • RCH_SKIP_DOCTOR
  • RCH_INIT_HOST
  • RCH_VERBOSE

Mocking, test, and CI helpers#

  • RCH_MOCK_SSH
  • RCH_MOCK_CIRCUIT_OPEN
  • RCH_MOCK_NO_RUSTUP
  • RCH_MOCK_RSYNC_BYTES
  • RCH_MOCK_RSYNC_FAIL_ARTIFACTS
  • RCH_MOCK_RSYNC_FAIL_SYNC
  • RCH_MOCK_RSYNC_FILES
  • RCH_MOCK_SSH_DELAY_MS
  • RCH_MOCK_SSH_EXIT_CODE
  • RCH_MOCK_SSH_FAIL_CONNECT
  • RCH_MOCK_SSH_FAIL_EXECUTE
  • RCH_MOCK_SSH_STDERR
  • RCH_MOCK_SSH_STDOUT
  • RCH_MOCK_TOOLCHAIN_INSTALL_FAIL
  • RCH_E2E_VERBOSE
  • RCH_E2E_WORKERS_FILE
  • RCH_E2E_WORKER_HOST
  • RCH_E2E_WORKER_ID
  • RCH_E2E_WORKER_KEY
  • RCH_E2E_WORKER_SLOTS
  • RCH_E2E_WORKER_USER
  • RCH_CIRCUIT_FAILURE_THRESHOLD
  • RCH_CIRCUIT_RESET_TIMEOUT_SEC
  • RCH_OTEL_ENABLED
  • RCH_PRESET
  • RCH_BAD_BOOL
  • RCH_TEST_
  • RCH_TEST_1
  • RCH_TEST_123
  • RCH_TEST_12345
  • RCH_TEST_99999
  • RCH_TEST_BOOL_FALSE
  • RCH_TEST_BOOL_TRUE
  • RCH_TEST_LIST
  • RCH_TEST_MARKER_UNIQUE_12345_XYZ
  • RCH_TEST_OK
  • RCH_TEST_OPT
  • RCH_TEST_SRC
  • RCH_TEST_U64
  • RCH_TEST_U64_OOR
  • RCH_TEST_WORKER_HOST
  • RCH_TEST_WORKER_KEY
  • RCH_TEST_WORKER_USER

Documented but not yet wired in code#

These appear in docs/README but are not currently used by the config loader:

  • RCH_BYPASS
  • RCH_DRY_RUN
  • RCH_LOCAL_ONLY
  • RCH_STREAM_MODE
  • RCH_NO_CACHE

Per-Project Configuration#

Use .rch/config.toml when you need project-specific behavior (e.g. disable RCH for a repo or change thresholds). Only the sections above are recognized; unknown keys are ignored.

Debugging Configuration#

  • rch config show — Show effective config
  • rch config show --sources — Show value origins
  • rch config export — Export config to shell/.env format
  • rch doctor — Diagnose common misconfigurations
  • docs/QUICKSTART.md
  • docs/TROUBLESHOOTING.md
  • docs/runbooks/configuration-troubleshooting.md