///|
/// Stable codes decouple integrations and localized guidance from message wording.
pub fn remediation_for(code : String) -> String {
match code {
"env_missing" | "env_empty" | "env_invalid" =>
"Check the required variable in the calling environment"
"path_missing" => "Add the required directory as a complete PATH entry"
"path_empty_entry" | "path_duplicate" =>
"Remove empty or duplicate PATH entries"
"file_missing" =>
"Verify the required project path exists under the diagnostic root"
"file_permission" | "path_access" | "config_access" =>
"Check current-user access, diagnostic root, and the symlink policy"
"path_unsafe" =>
"Use a root-relative path without traversal or special path syntax"
"tool_missing" =>
"Install the required tool and ensure its directory is in PATH"
"tool_exit" | "tool_execution" | "tool_version_parse" =>
"Verify the tool installation and its version command"
"tool_version" | "tool_conflict" =>
"Select a toolchain version compatible with the declared requirement"
"dependency_missing" =>
"Supply an observed dependency inventory from the package manager"
"dependency_mismatch"
| "dependency_conflict"
| "dependency_invalid_version" =>
"Reconcile the declared constraints and observed dependency versions"
"config_parse" | "config_root" =>
"Correct the JSON syntax and use an object at the root"
"config_required" | "config_type" | "config_value" =>
"Compare the configuration with the declared field schema"
"config_limit" | "config_schema" =>
"Reduce input size or schema complexity to the documented limits"
"dns_failure" => "Check the hostname and configured DNS resolver"
"tcp_failure" => "Check service availability, port and firewall"
"network_target" =>
"Provide a hostname or IP literal and a port between 1 and 65535"
"timeout" => "Check the target and retry with a bounded deadline"
"execution_error" => "Check platform capabilities and target access"
"dependency_blocked" =>
"Resolve the prerequisite findings before retrying this rule"
_ => ""
}
}