Repository navigation
AI-Net-Guard v5.9.4
AI-Net-Guard v5.9.4 发布说明 (Release Notes)
双引擎热修维护版 (Hotfix Patch Release):在 v5.9.3 基础上修复 PowerShell 7.x(.NET Core / .NET 5+)下 Enter-GuardWriteLock 无法调用 4 参数 System.Threading.Mutex 构造函数的问题,完整打通 Windows PowerShell 5.1 与 PowerShell 7.x 双引擎本地与提权执行路径。
一、相较 v5.9.3 的修复内容
-
修复 PowerShell 7.x 下
Enter-GuardWriteLock写锁创建兼容(lib-guard-common.ps1)- 根因:Windows PowerShell 5.1(.NET Framework)支持
New-Object System.Threading.Mutex($false, $LockName, [ref]$createdNew, $mtxSec)四参数构造,而 PowerShell 7.x(.NET Core)已将该安全描述符构造迁至[System.Threading.MutexAcl]::Create;因此在 PowerShell 7.x(如pwsh 7.7)中直接运行07-mode.ps1、12-regression.ps1、14-apply-policy.ps1或09-rollback.ps1时,会在获取Global\AI-Net-Guard-PolicyEngine写锁阶段报错退出。 - 修复:运行时按是否存在
System.Threading.MutexAcl, System.Threading.AccessControl自动分流至[System.Threading.MutexAcl]::Create(...)或传统 4 参数构造,并在异常捕获后补全if (-not $mtx)空句柄保护,保留Global\命名空间与Administrators/SYSTEMACL 约束不变。
- 根因:Windows PowerShell 5.1(.NET Framework)支持
-
新增双引擎门禁断言(
test-stun-ports.ps1)- 门禁断言扩至 59 项,覆盖
MutexAcl分支与空句柄保护,并在 Windows PowerShell 5.1 与 PowerShell 7.7 双引擎下分别全量跑通(含跨引擎pwsh与powershell.exe真实双进程Global\写锁争用)。
- 门禁断言扩至 59 项,覆盖
二、验证范围与未验证事项
- 已执行并通过(非提权工作区 + 双引擎门禁):
- 全仓
.ps1脚本 100% 纯 ASCII、0 AST 解析错误; tests\test-stun-ports.ps1(Windows PowerShell 5.1):59/59 条断言 PASS;tests\test-stun-ports.ps1(PowerShell 7.7):59/59 条断言 PASS;gui\build.ps1 -RunSmokeTest:WPF Release 0 警告 0 错误,8 项 UI 冒烟 PASS。
- 全仓
- 尚未由本会话直接执行(需在本机管理员 PowerShell 运行同步与现网回归):
- 同步
C:\AI-Net-Guard\scripts\至v5.9.4,确认07-mode.ps1完成backup\auto-disabled-outbound-allow.json自愈并通过12-regression.ps1。
- 同步
三、同步本机 C:\AI-Net-Guard 并完成验收(管理员 PowerShell 执行)
在 管理员 PowerShell 中执行以下命令同步 v5.9.4 并完成自愈与回归验收:
$ws = "C:\path\to\AI-Net-Guard"; $root = "C:\AI-Net-Guard"; powershell -ExecutionPolicy Bypass -File "$ws\scripts\13-harden-acl.ps1" -Root $root -SyncWorkspace -WorkspaceRoot $ws -SkipVerification; & "$root\scripts\07-mode.ps1"; Get-Content "$root\backup\auto-disabled-outbound-allow.json"; Get-ScheduledTask -TaskName "AI-Guard*" | Select-Object TaskName, State; & "$root\scripts\12-regression.ps1"