oudecheng f37a5ffe6e fix(platform): 收紧 safety guard 的 format 正则并按平台分组
原 \bformat\s+ 正则精度不足,会误伤 dart format、buf format、
pytest --format 等合法命令;Remove-Item 大写正则经 to_lowercase
后永远匹配不到,是潜在 bug。

改动:
- format 正则收紧为 \bformat\s+.*[a-z]:,要求出现盘符才拦截
- 按 Platform 分组注入规则,Unix 不再注入 Windows 专用规则
- Remove-Item 正则改为小写,与 guard_command 的大小写处理一致
- 平台相关测试加 #[cfg] 属性,避免跨平台失败
- 新增 test_format_pattern_precision 覆盖危险命令与误伤场景
- 新增 test_legitimate_format_commands_not_blocked 回归测试

验证:
- cargo test --lib platform::  11/11 通过
- cargo test --lib tools::bash 13/13 通过
2026-08-03 22:45:36 +08:00
..
2026-07-08 15:52:36 +08:00