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
| Range | Category | Description |
|---|---|---|
| R001-R099 | Topology | Worker config + daemon worker capacity |
| R100-R199 | DiskPressure | Worker disk-pressure tiers + telemetry |
| R200-R299 | ProcessTriage | Cancellation cleanup + process debt |
| R300-R399 | RepoConvergence | Worker repo-state convergence |
| R400-R499 | HelperCompatibility | rsync / ssh / cargo / zstd availability |
| R500-R599 | RolloutPosture | self-healing config flags |
| R600-R699 | SchemaCompatibility | Cross-binary schema-version drift |
Discipline:
- Variant identifiers are CamelCase.
- Each variant has a fixed
RCH-Rnnncode returned byReliabilityReasonCode::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’srequires_restartfield onRemediationStep). - Each variant carries a one-line
remediation_hintfor the diagnostic’s default suggestion text.
Adding a new variant requires:
- Pick the next free code in the right range.
- Add the variant to the enum below.
- Add an arm to every
match selfblock (Rust’s exhaustiveness check will not let you forget — that’s the whole point of the enum). - The unit tests in this module enforce uniqueness, format, and
range-membership at
cargo testtime.
Enums§
- Reliability
Category Kind - Stable category groups for reliability reason codes.
- Reliability
Reason Code - One reason code per emitted reliability diagnostic. Serializes to its
canonical
RCH-Rnnnstring form viaSerialize; deserializes the same form viaDeserialize.