Regenerates the materialized Cursor memory rule for `root`, writing only when content changed (hash check) and only when the tracedecay Cursor plugin is installed and the target file is absent or tracedecay-generated. Workspaces without an initialized store still rewrite the managed rule to an empty placeholder so stale facts from another workspace cannot remain always-applied. Fail-open: returns
(root: &Path)
| 480 | /// an empty placeholder so stale facts from another workspace cannot remain |
| 481 | /// always-applied. Fail-open: returns whether the file was (re)written. |
| 482 | pub async fn regenerate_cursor_memory_rule(root: &Path) -> bool { |
| 483 | if !memory_injection_enabled() { |
| 484 | return false; |
| 485 | } |
| 486 | let Some(home) = dirs::home_dir() else { |
| 487 | return false; |
| 488 | }; |
| 489 | regenerate_cursor_memory_rule_with_home(root, &home).await |
| 490 | } |
| 491 | |
| 492 | async fn regenerate_cursor_memory_rule_with_home(root: &Path, home: &Path) -> bool { |
| 493 | let rule_path = crate::agents::cursor::cursor_memory_rule_path(home); |
no test coverage detected