A modified path's layer key: its KG module (`PART_OF`) when enriched, otherwise its parent directory (`(root)` for top-level files). Purely path-derived in the fallback, so unenriched repos still get a walkthrough.
(path: &str, file_module: &BTreeMap<String, String>)
| 840 | /// otherwise its parent directory (`(root)` for top-level files). Purely |
| 841 | /// path-derived in the fallback, so unenriched repos still get a walkthrough. |
| 842 | fn layer_key(path: &str, file_module: &BTreeMap<String, String>) -> String { |
| 843 | if let Some(module) = file_module.get(path) { |
| 844 | return module.clone(); |
| 845 | } |
| 846 | match path.rsplit_once('/') { |
| 847 | Some((dir, _)) => dir.to_string(), |
| 848 | None => "(root)".to_string(), |
| 849 | } |
| 850 | } |
| 851 | |
| 852 | /// First non-empty line of a task's directive body, trimmed — the walkthrough |
| 853 | /// narrates with headlines, not whole bodies. |
no test coverage detected