Enhance syncback documentation and optimize clean mode functionality

- Added detailed explanations of clean mode, its purpose, and benefits, clarifying its role in achieving an accurate filesystem state.
- Updated the syncback process to include scanning of the project folder for orphan removal, ensuring comprehensive path collection.
- Emphasized the importance of understanding expected outputs before modifying code in response to failing tests, reinforcing testing philosophy.
This commit is contained in:
Joe 2026-02-01 19:29:42 -06:00
parent 2e6f909a71
commit 1f476d6cc9
2 changed files with 29 additions and 0 deletions

View file

@ -256,6 +256,14 @@ pub fn syncback_loop_with_stats(
// Collect paths from the project tree definition
collect_paths_from_project(&project.tree, project_path, &mut dirs_to_scan);
// Also scan the project folder itself - files like src.luau that exist
// alongside default.project.json5 should be considered for orphan removal
let project_path_buf = project_path.to_path_buf();
if !dirs_to_scan.contains(&project_path_buf) {
log::trace!("Adding project folder to scan: {}", project_path.display());
dirs_to_scan.push(project_path_buf);
}
// Also check instance metadata for paths that might not be in project
// (e.g., from nested project references)
let root = old_tree.root();