Skip to main content

Module reliability

Module reliability 

Source
Expand description

Reliability-doctor reason-code catalog (RCH-Rnnn).

This module mirrors the super::catalog::ErrorCode pattern but for the rch doctor --reliability diagnostics surface. Every diagnostic emitted by the reliability doctor carries one of these variants. The CLI/JSON representation is a stable RCH-Rnnn string, so agents and dashboards can branch on the code without parsing free-form snake_case strings.

§Code Ranges

RangeCategoryDescription
R001-R099TopologyWorker config + daemon worker capacity
R100-R199DiskPressureWorker disk-pressure tiers + telemetry
R200-R299ProcessTriageCancellation cleanup + process debt
R300-R399RepoConvergenceWorker repo-state convergence
R400-R499HelperCompatibilityrsync / ssh / cargo / zstd availability
R500-R599RolloutPostureself-healing config flags
R600-R699SchemaCompatibilityCross-binary schema-version drift

Discipline:

  • Variant identifiers are CamelCase.
  • Each variant has a fixed RCH-Rnnn code returned by ReliabilityReasonCode::code.
  • Each variant has a category (per the table above) for analytics grouping.
  • Each variant declares whether its remediation requires a daemon restart via ReliabilityReasonCode::requires_restart (consumed by the reliability doctor’s requires_restart field on RemediationStep).
  • Each variant carries a one-line remediation_hint for the diagnostic’s default suggestion text.

Adding a new variant requires:

  1. Pick the next free code in the right range.
  2. Add the variant to the enum below.
  3. Add an arm to every match self block (Rust’s exhaustiveness check will not let you forget — that’s the whole point of the enum).
  4. The unit tests in this module enforce uniqueness, format, and range-membership at cargo test time.

Enums§

ReliabilityCategoryKind
Stable category groups for reliability reason codes.
ReliabilityReasonCode
One reason code per emitted reliability diagnostic. Serializes to its canonical RCH-Rnnn string form via Serialize; deserializes the same form via Deserialize.