Skip to content

Commit 4a8b874

Browse files
author
SqlRush
committed
Classify PowerShell new item property alias
1 parent b001a83 commit 4a8b874

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/cc-100-roadmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ M5 补充:Read/Edit 现在接受 `offset`/`limit` 和 `replace_all` 的 quoted
181181

182182
M5 补充:WebFetch prompt-focused excerpt 的 term scoring 现在会双向匹配常见单复数变体,例如 prompt `cost` 可命中正文 `costs`、prompt `candidates` 可命中正文 `candidate`,同时仍保持词边界匹配避免子串误命中。
183183

184-
M5 补充:PowerShell command canonicalization 现在补齐 mutating ItemProperty aliases:`sp`/`clp`/`cpp`/`mp`/`rp`/`rnp` 会分别归入 `Set/Clear/Copy/Move/Remove/Rename-ItemProperty` destructive 分类,避免属性变更 alias 被当成未知普通命令。
184+
M5 补充:PowerShell command canonicalization 现在补齐 mutating ItemProperty aliases:`sp`/`np`/`clp`/`cpp`/`mp`/`rp`/`rnp` 会分别归入 `Set/New/Clear/Copy/Move/Remove/Rename-ItemProperty` destructive 分类,避免属性变更 alias 被当成未知普通命令。
185185

186186
M5 补充:PowerShell command canonicalization 现在补齐 mutating service aliases:`sasv`/`spsv`/`rsv`/`ssv` 会分别归入 `Start/Stop/Restart/Set-Service` destructive 分类,避免服务状态或配置变更 alias 被当成未知普通命令。
187187

docs/claude-code-go-rewrite-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ test/parity/ # golden tests against TS/official behavior
252252
- 本轮补充:PowerShell native read-only classifier 补齐 `netstat -p <protocol>` 只读协议查询形态,协议值走 literal guard,缺值和动态表达式值仍拒绝。
253253
- 本轮补充:PowerShell native read-only classifier 收紧短 flag 合并校验,`netstat -ano` 这类纯开关组合仍允许,但包含 value/path flag 的组合(如 `-anop`)不再绕过缺值校验。
254254
- 本轮补充:PowerShell native read-only classifier 收紧 `/FO` 输出格式参数,`systeminfo`/`tasklist`/`whoami`/`getmac` 只接受 `CSV`/`LIST`/`TABLE` literal 值,无效格式和动态值不再进入只读 fast path。
255-
- 本轮补充:PowerShell command canonicalization 现在补齐 mutating ItemProperty aliases:`sp`/`clp`/`cpp`/`mp`/`rp`/`rnp` 会分别归入 `Set/Clear/Copy/Move/Remove/Rename-ItemProperty` destructive 分类,避免属性变更 alias 被当成未知普通命令。
255+
- 本轮补充:PowerShell command canonicalization 现在补齐 mutating ItemProperty aliases:`sp`/`np`/`clp`/`cpp`/`mp`/`rp`/`rnp` 会分别归入 `Set/New/Clear/Copy/Move/Remove/Rename-ItemProperty` destructive 分类,避免属性变更 alias 被当成未知普通命令。
256256
- 本轮补充:PowerShell command canonicalization 现在补齐 mutating service aliases:`sasv`/`spsv`/`rsv`/`ssv` 会分别归入 `Start/Stop/Restart/Set-Service` destructive 分类,避免服务状态或配置变更 alias 被当成未知普通命令。
257257
- 本轮补充:`BashOutput` 现在设置 100k 最大结果大小,和前台 `Bash` 一起覆盖大输出 tool-result preview 截断、完整输出落盘及 `full_output_path` 元数据。
258258
- 本轮补充:Bash/PowerShell 后台命令现在会通过 tool progress 通道发 started/finished 事件,记录后台 ID、shell/status、exit/timed_out/cancelled、duration、时间戳和 stdout/stderr byte count,且 completed、timed_out、cancelled 终态测试确保 progress 不携带 command 文本。

internal/tools/powershell/tools.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,8 @@ func powerShellAliasTarget(name string) string {
23172317
return "set-item"
23182318
case "sp":
23192319
return "set-itemproperty"
2320+
case "np":
2321+
return "new-itemproperty"
23202322
case "cpp":
23212323
return "copy-itemproperty"
23222324
case "mp":

internal/tools/powershell/tools_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ func TestPowerShellCommandClassification(t *testing.T) {
554554
"si variable:x 1",
555555
"Set-ItemProperty . -Name Mode -Value x",
556556
"sp . -Name Mode -Value x",
557+
"New-ItemProperty . -Name Mode -Value x",
558+
"np . -Name Mode -Value x",
557559
"Clear-ItemProperty . -Name Mode",
558560
"clp . -Name Mode",
559561
"Copy-ItemProperty . other -Name Mode",

0 commit comments

Comments
 (0)