Skip to main content

Module explain

Module explain 

Source
Expand description

Operator-facing code-lookup surface (rch error explain).

Bridges the two parallel code namespaces in this workspace — super::ErrorCode (RCH-E001..E599, the primary error catalog) and super::ReliabilityReasonCode (RCH-R001..R699, the doctor reliability surface) — into a single uniform lookup so an operator who pastes any code from a log line into rch error explain gets a useful answer regardless of which namespace it came from.

§Surface

rch error explain <CODE>      # human form
rch error explain <CODE> --json
rch error list                # all codes
rch error list --category=worker
rch error list --json

§Wire shape (JSON)

{
  "code": "RCH-R104",
  "namespace": "reliability",
  "name": "WorkerDiskPressureTelemetryGap",
  "category": "disk_pressure",
  "description": "Worker is missing fresh disk telemetry.",
  "remediation": ["Run `rch workers probe <worker>` to refresh telemetry."],
  "requires_restart": false
}

Structs§

CodeExplanation
Resolved lookup result for either namespace. Produced by lookup.

Enums§

CodeNamespace
Which catalog the code came from.

Functions§

is_known
Whether a string parses as either a known reliability or error code.
is_known_category
Whether a category name matches at least one known code category.
known_categories
Known category names across both code namespaces, sorted for stable CLI help and JSON error payloads.
list_all
All known codes across both namespaces. Used by rch error list.
list_by_category
Subset of list_all filtered to one category (matches the snake_case category field on CodeExplanation). Empty result indicates an unknown category — caller can detect that.
lookup
Look up a code string. Accepts whitespace-padded input.
render_human
Render a CodeExplanation in a paste-ready human form. Used by the CLI when --json is not set.