Skip to main content

Crate rch_common

Crate rch_common 

Source
Expand description

Remote Compilation Helper - Common Library

Shared types, patterns, and utilities used by rch, rchd, and rch-wkr.

Re-exports§

pub use artifact_verify::ArtifactManifest;
pub use artifact_verify::FileHash;
pub use artifact_verify::VerificationFailure;
pub use artifact_verify::VerificationResult;
pub use artifact_verify::compute_file_hash;
pub use artifact_verify::create_manifest;
pub use artifact_verify::verify_artifacts;
pub use binary_hash::BinaryHashResult;
pub use binary_hash::binaries_equivalent;
pub use binary_hash::binary_contains_marker;
pub use binary_hash::compute_binary_hash;
pub use cargo_path_deps::CargoPathDependencyEdge;
pub use cargo_path_deps::CargoPathDependencyError;
pub use cargo_path_deps::CargoPathDependencyErrorKind;
pub use cargo_path_deps::CargoPathDependencyGraph;
pub use cargo_path_deps::CargoPathDependencyPackage;
pub use cargo_path_deps::resolve_cargo_path_dependency_graph;
pub use cargo_path_deps::resolve_cargo_path_dependency_graph_with_policy;
pub use dependency_closure_planner::DependencyClosurePlan;
pub use dependency_closure_planner::DependencyClosurePlanState;
pub use dependency_closure_planner::DependencyPlanIssue;
pub use dependency_closure_planner::DependencyRiskClass;
pub use dependency_closure_planner::DependencySyncAction;
pub use dependency_closure_planner::DependencySyncMetadata;
pub use dependency_closure_planner::DependencySyncReason;
pub use dependency_closure_planner::build_dependency_closure_plan;
pub use dependency_closure_planner::build_dependency_closure_plan_with_policy;
pub use dependency_closure_planner::plan_dependency_closure_from_graph;
pub use logging::LogConfig;
pub use logging::LogFormat;
pub use logging::LoggingGuards;
pub use logging::init_logging;
pub use mock_worker::MockWorkerServer;
pub use path_topology::DEFAULT_ALIAS_PROJECT_ROOT;
pub use path_topology::DEFAULT_CANONICAL_PROJECT_ROOT;
pub use path_topology::NormalizationDecision;
pub use path_topology::NormalizedProjectPath;
pub use path_topology::PathNormalizationError;
pub use path_topology::PathNormalizationErrorKind;
pub use path_topology::PathTopologyPolicy;
pub use path_topology::normalize_project_path;
pub use path_topology::normalize_project_path_with_policy;
pub use patterns::Classification;
pub use patterns::ClassificationDetails;
pub use patterns::ClassificationTier;
pub use patterns::CompilationKind;
pub use patterns::TierDecision;
pub use patterns::classify_command;
pub use patterns::classify_command_detailed;
pub use patterns::split_shell_commands;
pub use protocol::HookInput;
pub use protocol::HookOutput;
pub use protocol::ToolInput;
pub use repo_updater_contract::MockRepoUpdaterAdapter;
pub use repo_updater_contract::REPO_UPDATER_ALIAS_PROJECTS_ROOT;
pub use repo_updater_contract::REPO_UPDATER_CANONICAL_PROJECTS_ROOT;
pub use repo_updater_contract::REPO_UPDATER_CONTRACT_SCHEMA_VERSION;
pub use repo_updater_contract::REPO_UPDATER_DEFAULT_BINARY;
pub use repo_updater_contract::REPO_UPDATER_MIN_SUPPORTED_VERSION;
pub use repo_updater_contract::RepoUpdaterAdapter;
pub use repo_updater_contract::RepoUpdaterAdapterCommand;
pub use repo_updater_contract::RepoUpdaterAdapterContract;
pub use repo_updater_contract::RepoUpdaterAdapterRequest;
pub use repo_updater_contract::RepoUpdaterAdapterResponse;
pub use repo_updater_contract::RepoUpdaterFailure;
pub use repo_updater_contract::RepoUpdaterFailureKind;
pub use repo_updater_contract::RepoUpdaterFallbackMode;
pub use repo_updater_contract::RepoUpdaterIdempotencyGuarantee;
pub use repo_updater_contract::RepoUpdaterJsonEnvelope;
pub use repo_updater_contract::RepoUpdaterOutputFormat;
pub use repo_updater_contract::RepoUpdaterResponseStatus;
pub use repo_updater_contract::RepoUpdaterVersionCompatibility;
pub use repo_updater_contract::RepoUpdaterVersionPolicy;
pub use repo_updater_contract::build_invocation;
pub use repo_updater_contract::classify_exit_code;
pub use repo_updater_contract::evaluate_version_compatibility;
pub use repo_updater_contract::map_failure_kind_to_error_code;
pub use repo_updater_contract::repo_updater_envelope_schema;
pub use repo_updater_contract::repo_updater_request_schema;
pub use repo_updater_contract::repo_updater_response_schema;
pub use ssh_utils::CommandResult;
pub use ssh_utils::EnvPrefix;
pub use ssh_utils::build_env_prefix;
pub use ssh_utils::is_retryable_transport_error;
pub use ssh_utils::is_retryable_transport_error_text;
pub use ssh_utils::shell_escape_value;
pub use ssh::KnownHostsPolicy;
pub use ssh::SshClient;
pub use ssh::SshOptions;
pub use ssh::SshPool;
pub use test_change::TestChangeGuard;
pub use test_change::TestCodeChange;
pub use toolchain::ToolchainInfo;
pub use toolchain::wrap_command_with_color;
pub use toolchain::wrap_command_with_toolchain;
pub use types::AffinityConfig;
pub use types::BuildCancellationMetadata;
pub use types::BuildCancellationWorkerHealth;
pub use types::BuildHeartbeatPhase;
pub use types::BuildHeartbeatRequest;
pub use types::BuildLocation;
pub use types::BuildRecord;
pub use types::BuildStats;
pub use types::CircuitBreakerConfig;
pub use types::CircuitState;
pub use types::CircuitStats;
pub use types::ColorMode;
pub use types::CommandPriority;
pub use types::CommandTimingBreakdown;
pub use types::CompilationConfig;
pub use types::CompilationMetrics;
pub use types::CompilationTimer;
pub use types::CompilationTimingBreakdown;
pub use types::EnvironmentConfig;
pub use types::ExecutionConfig;
pub use types::FairnessConfig;
pub use types::FleetConfig;
pub use types::GeneralConfig;
pub use types::MetricsAggregator;
pub use types::OutputConfig;
pub use types::OutputVisibility;
pub use types::PathTopologyConfig;
pub use types::RchConfig;
pub use types::ReleaseRequest;
pub use types::RequiredRuntime;
pub use types::RetryConfig;
pub use types::SavedTimeStats;
pub use types::SelectedWorker;
pub use types::SelectionConfig;
pub use types::SelectionReason;
pub use types::SelectionRequest;
pub use types::SelectionResponse;
pub use types::SelectionStrategy;
pub use types::SelectionWeightConfig;
pub use types::SelfHealingConfig;
pub use types::SelfHealingLogLevel;
pub use types::SelfTestConfig;
pub use types::SelfTestFailureAction;
pub use types::SelfTestWorkers;
pub use types::TransferConfig;
pub use types::WorkerCapabilities;
pub use types::WorkerConfig;
pub use types::WorkerId;
pub use types::WorkerStatus;
pub use types::default_socket_path;
pub use types::validate_remote_base;
pub use testing::TestLogEntry;
pub use testing::TestLogger;
pub use testing::TestPhase;
pub use testing::TestResult;
pub use config::ConfigSource;
pub use config::ConfigValueSource;
pub use config::ConfigWarning;
pub use config::EnvError;
pub use config::EnvParser;
pub use config::Profile;
pub use config::Severity;
pub use config::Sourced;
pub use config::validate_config;
pub use discovery::DiscoveredHost;
pub use discovery::DiscoverySource;
pub use discovery::discover_all;
pub use discovery::parse_shell_aliases;
pub use discovery::parse_shell_aliases_content;
pub use discovery::parse_ssh_config;
pub use discovery::parse_ssh_config_content;
pub use ui::ErrorPanel;
pub use ui::ErrorSeverity;
pub use ui::Icons;
pub use ui::IntoErrorPanel;
pub use ui::OutputContext;
pub use ui::RchTheme;
pub use ui::ResultExt;
pub use ui::anyhow_to_json;
pub use ui::anyhow_to_panel;
pub use ui::display_anyhow_error;
pub use ui::display_error;
pub use ui::display_error_with_code;
pub use ui::error_to_json;
pub use ui::error_to_panel;
pub use errors::CodeExplanation;
pub use errors::CodeNamespace;
pub use errors::ErrorCategory;
pub use errors::ErrorCode;
pub use errors::ErrorEntry;
pub use errors::ReliabilityCategoryKind;
pub use errors::ReliabilityReasonCode;
pub use schema_versions::current_version as schema_version;
pub use schema_versions::ALL_COMPONENTS as SCHEMA_VERSION_COMPONENTS;
pub use schema_versions::SchemaComponent;
pub use api::API_VERSION;
pub use api::ApiError;
pub use api::ApiResponse;
pub use api::ErrorContext;
pub use api::LegacyErrorCode;
pub use hooks::HookResult;
pub use hooks::is_claude_code_installed;
pub use hooks::verify_and_install_claude_code_hook;

Modules§

api
Unified API Types for Remote Compilation Helper
artifact_verify
Artifact integrity verification using blake3 hashes (bd-377q).
binary_hash
Binary hash computation utility for verifying remote compilation correctness.
cargo_path_deps
Cargo local path-dependency graph resolver.
config
Configuration system for RCH.
dependency_closure_planner
Dependency-closure planning on top of Cargo local path-dependency resolution.
discovery
Worker discovery from SSH config and shell aliases.
e2e
E2E Test Infrastructure
errors
Error catalog and definitions for Remote Compilation Helper
hooks
Daemon hook verification and installation.
logging
Structured logging initialization for RCH components.
mock
Mock transport layer for testing.
mock_worker
Mock worker server helper for tests.
path_topology
Canonical path topology utilities for host/worker project mapping.
patterns
Command classification patterns for identifying compilation commands.
protocol
Claude Code hook protocol definitions.
remote_compilation
Remote Compilation Verification via SSH.
remote_verification
Remote compilation verification via SSH.
repo_updater_contract
Stable contract for integrating RCH with repo_updater (ru).
schema_versions
Central registry of schema versions across the workspace.
ssh
SSH client utilities for remote command execution.
ssh_utils
Platform-independent SSH utilities.
test_change
Test code change generator for verifying remote compilation.
testing
Test utilities for RCH.
toolchain
Rust toolchain information types.
types
Common types used across RCH components.
ui
UI utilities for RCH terminal output.
util
Shared utilities for RCH.

Macros§

e2e_test
Macro for creating E2E tests with automatic harness setup and cleanup
test_guard
Create a TestGuard using the current function name.

Constants§

BUILD_COMMIT_ENV_VARS

Functions§

build_commit
build_version_value
build_version_value_static
build_version_value_with_commit