修复 AGC 文件列举被无关临时锁删除打断(#552) #580
Reference in New Issue
Block a user
Delete Branch "fix/552-scoped-project-file-listing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
列举
assets时,原实现先递归扫描整个项目,再过滤范围;.agent/project.lock在枚举与读取元数据之间正常删除会使整次查询失败。现在在读取条目元数据前裁剪目标范围与受保护路径,只遍历目标子树及必要祖先。枚举后消失的文件/目录仅跳过
NotFound,其余权限与 IO 错误仍返回;进入排队目录前复核符号链接与 Windows 重解析点。通用文件树保留原有可见范围,Agent 结果继续过滤、排序后分页。通过通道协调真实项目写锁释放,确定性覆盖全量扫描的 TOCTOU 及定向
assets扫描;另覆盖目录消失/类型变化、权限错误、私有路径、链接、引擎目录和分页。同步更新 AGC 契约与共享排障记录。验证:
cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shell -- --test-threads=1 project_file_listing generic_file_tools local_project_file_commands external_listingcargo check --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shellnpm run check:encoding、npm run check:doc-index、git diff --check通过。Fixes #552