{"record":{"id":"f238ca206e9a0672","repo":"ruvnet/RuView","slug":"circle-requires-3-values-center-x-center-y-radius","errorCode":null,"errorMessage":"Circle requires 3 values: center_x,center_y,radius (got {})","messagePattern":"Circle requires 3 values: center_x,center_y,radius \\(got (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v2/crates/wifi-densepose-cli/src/mat.rs","lineNumber":820,"sourceCode":"        .map(|s| s.trim().parse::<f64>())\n        .collect::<std::result::Result<Vec<_>, _>>()\n        .context(\"Failed to parse bounds values as numbers\")?;\n\n    match zone_type {\n        ZoneType::Rectangle => {\n            if parts.len() != 4 {\n                anyhow::bail!(\n                    \"Rectangle requires 4 values: min_x,min_y,max_x,max_y (got {})\",\n                    parts.len()\n                );\n            }\n            Ok(ZoneBounds::rectangle(\n                parts[0], parts[1], parts[2], parts[3],\n            ))\n        }\n        ZoneType::Circle => {\n            if parts.len() != 3 {\n                anyhow::bail!(\n                    \"Circle requires 3 values: center_x,center_y,radius (got {})\",\n                    parts.len()\n                );\n            }\n            Ok(ZoneBounds::circle(parts[0], parts[1], parts[2]))\n        }\n    }\n}\n\n/// Execute the survivors command\nasync fn execute_survivors(args: SurvivorsArgs) -> Result<()> {\n    // Demo data\n    let survivors = vec![\n        SurvivorRow {\n            id: \"SURV-001\".to_string(),\n            zone: \"Zone A\".to_string(),\n            triage: format_triage(&TriageStatus::Immediate),\n            status: \"Active\".green().to_string(),","sourceCodeStart":802,"sourceCodeEnd":838,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/v2/crates/wifi-densepose-cli/src/mat.rs#L802-L838","documentation":"parse_bounds in the survivors command rejects a circle zone whose --bounds string does not contain exactly 3 comma-separated f64 values (center_x,center_y,radius). As with the rectangle branch, values must already parse as f64; this bail fires only when the arity is wrong.","triggerScenarios":"Passing --bounds '0,0,10,10' (4 values) with a circle zone type; copy-pasting rectangle syntax (4 values) for a circle.","commonSituations":"Switching a zone from rectangle to circle in a config without updating the bounds string; hand-authored zone definitions in automation scripts.","solutions":["Count the comma-separated values: a circle needs exactly center_x,center_y,radius","Use the 4-value min_x,min_y,max_x,max_y form only with the rectangle zone type","Quote the whole bounds string as a single shell argument","Check the radius is positive after fixing the count — a non-positive radius yields an empty zone"],"exampleFix":"// before\n$ ruview survivors --type circle --bounds '0,0,10,10'\n\n// after\n$ ruview survivors --type circle --bounds '5,5,3'","handlingStrategy":"validation","validationCode":"fn circle_bounds_ok(bounds: &str) -> bool {\n    bounds\n        .split(',')\n        .filter(|s| s.trim().parse::<f64>().is_ok())\n        .count()\n        == 3\n}","typeGuard":"enum ZoneSpec {\n    Rect([f64; 4]),\n    Circle([f64; 3]),\n}\n\nfn parse_zone_spec(kind: &str, bounds: &str) -> Option<ZoneSpec> {\n    let v: Vec<f64> = bounds\n        .split(',')\n        .map(|s| s.trim().parse())\n        .collect::<Result<_, _>>()\n        .ok()?;\n    match (kind, v.as_slice()) {\n        (\"rectangle\", [a, b, c, d]) => Some(ZoneSpec::Rect([*a, *b, *c, *d])),\n        (\"circle\", [a, b, r]) => Some(ZoneSpec::Circle([*a, *b, *r])),\n        _ => None,\n    }\n}","tryCatchPattern":null,"preventionTips":["Validate the value count in wrapper scripts before invoking the CLI","When switching zone types in config, update the bounds string in the same change","Prefer positive radii and min < max ordering so zones are non-empty"],"tags":["rust","cli","parsing","validation","zones"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}