From 47521cf178cb374c02954ad75c07f6441f72b1a7 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 25 May 2026 18:02:03 +0900 Subject: [PATCH] fix(#701): add detail_entries structured key/value to doctor check JSON; booleans/ints emitted as JSON scalars --- rust/crates/rusty-claude-cli/src/main.rs | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index b478d557..4cc4a1eb 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -2009,6 +2009,37 @@ impl DiagnosticCheck { .collect::>(), ), ), + ( + // #701: structured key/value pairs parsed from prose detail strings. + // Each detail string is `"Key Label value"` separated by 2+ spaces. + // Booleans (`true`/`false`) and integers are emitted as JSON scalars. + "detail_entries".to_string(), + Value::Array( + self.details + .iter() + .map(|s| { + // Split on first run of 2+ spaces to separate key from value. + let parts: Vec<&str> = s.splitn(2, " ").collect(); + if parts.len() == 2 { + let k = parts[0].trim().to_string(); + let v_str = parts[1].trim(); + let v: Value = if v_str == "true" { + Value::Bool(true) + } else if v_str == "false" { + Value::Bool(false) + } else if let Ok(n) = v_str.parse::() { + Value::Number(n.into()) + } else { + Value::String(v_str.to_string()) + }; + json!({"key": k, "value": v}) + } else { + json!({"key": s.trim(), "value": Value::Null}) + } + }) + .collect::>(), + ), + ), ]); value.extend(self.data.clone()); Value::Object(value)