| 850 | } |
| 851 | |
| 852 | fn doctor_check_plugin_rule(dc: &mut DoctorCounters, rule_path: &Path) { |
| 853 | if !rule_path.exists() { |
| 854 | dc.warn(&format!( |
| 855 | "{} not found — run `tracedecay install --agent cursor`", |
| 856 | rule_path.display() |
| 857 | )); |
| 858 | return; |
| 859 | } |
| 860 | let contents = std::fs::read_to_string(rule_path).unwrap_or_default(); |
| 861 | if contents.contains("alwaysApply: true") && contents.contains("tracedecay MCP tools") { |
| 862 | dc.pass(&format!( |
| 863 | "Cursor plugin tracedecay rule active in {}", |
| 864 | rule_path.display() |
| 865 | )); |
| 866 | } else { |
| 867 | dc.fail(&format!( |
| 868 | "Cursor plugin tracedecay rule is incomplete in {} — run `tracedecay install --agent cursor`", |
| 869 | rule_path.display() |
| 870 | )); |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | #[cfg(test)] |
| 875 | #[allow(clippy::unwrap_used, clippy::expect_used)] |