Skip to content

Commit 36ea1cd

Browse files
author
SqlRush
committed
Support remaining PowerShell common aliases
1 parent 4af4548 commit 36ea1cd

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

docs/cc-100-roadmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ M5 补充:PowerShell native read-only classifier 现在覆盖显式 `more.com
223223

224224
M5 补充:PowerShell read-only classifier 现在把 `Get-Content -First` 作为 `-TotalCount`/`-Head` 的安全读取 alias 处理,保留缺值和越界路径拒绝。
225225

226-
M5 补充:PowerShell read-only classifier 现在识别常用 common parameter aliases `-EA`/`-EV`/`-WA`/`-WV`/`-Infa`/`-OB``-VB`/`-DB`,同时继续拒绝 `-OV`/`-PV` 这类会写入变量的 common aliases。
226+
M5 补充:PowerShell read-only classifier 现在识别常用 common parameter aliases `-EA`/`-EV`/`-WA`/`-WV`/`-Infa`/`-IV`/`-Proga`/`-OB``-VB`/`-DB`,同时继续拒绝 `-OV`/`-PV` 这类会写入变量的 common aliases。
227227

228228
M5 补充:Bash 前台输出和 `BashOutput` 现在都走统一 tool-result budget 截断/落盘路径;`BashOutput` 增加 100k 最大结果限制,大后台输出会保存完整内容并返回 `full_output_path` 元数据。
229229

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ test/parity/ # golden tests against TS/official behavior
223223
- 本轮补充:PowerShell native read-only classifier 现在覆盖 Windows `sort.exe <path>`/`sort.exe /R <path>` 的安全相对路径读取子集,并拒绝空输入、`/O` 输出文件、pass-through 和越界路径。
224224
- 本轮补充:PowerShell native read-only classifier 现在覆盖显式 `more.com <path>` 的安全相对路径读取子集,并拒绝裸 `more`、空输入、pass-through 和越界路径。
225225
- 本轮补充:PowerShell read-only classifier 现在把 `Get-Content -First` 作为 `-TotalCount`/`-Head` 的安全读取 alias 处理,保留缺值和越界路径拒绝。
226-
- 本轮补充:PowerShell read-only classifier 现在识别常用 common parameter aliases `-EA`/`-EV`/`-WA`/`-WV`/`-Infa`/`-OB``-VB`/`-DB`,同时继续拒绝 `-OV`/`-PV` 这类会写入变量的 common aliases。
226+
- 本轮补充:PowerShell read-only classifier 现在识别常用 common parameter aliases `-EA`/`-EV`/`-WA`/`-WV`/`-Infa`/`-IV`/`-Proga`/`-OB``-VB`/`-DB`,同时继续拒绝 `-OV`/`-PV` 这类会写入变量的 common aliases。
227227
- 本轮补充:`BashOutput` 现在设置 100k 最大结果大小,和前台 `Bash` 一起覆盖大输出 tool-result preview 截断、完整输出落盘及 `full_output_path` 元数据。
228228
- 本轮补充:Bash/PowerShell 后台命令现在会通过 tool progress 通道发 started/finished 事件,记录后台 ID、shell/status、exit/timed_out/cancelled、duration、时间戳和 stdout/stderr byte count,且 completed、timed_out、cancelled 终态测试确保 progress 不携带 command 文本。
229229
- 本轮补充:WebSearch domain filters 现在在 schema 层声明 array `items:string`,通用 tool schema validator 同步支持 `items` 校验;`allowed_domains`/`blocked_domains` 会拒绝空字符串、URL/port、非法 wildcard 和非域名 label。

internal/tools/powershell/tools.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,11 +1206,13 @@ var powerShellCommonValueFlags = stringSet(
12061206
"informationaction",
12071207
"infa",
12081208
"progressaction",
1209+
"proga",
12091210
"errorvariable",
12101211
"ev",
12111212
"warningvariable",
12121213
"wv",
12131214
"informationvariable",
1215+
"iv",
12141216
"outbuffer",
12151217
"ob",
12161218
)

internal/tools/powershell/tools_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ func TestPowerShellCommandClassification(t *testing.T) {
164164
"Get-Process -Name go",
165165
"Get-Process -WA SilentlyContinue",
166166
"Get-Process -Infa Continue",
167+
"Get-Process -Proga SilentlyContinue",
168+
"Get-Process -IV info",
167169
"Get-Process -VB",
168170
"Get-Process -DB",
169171
"ps -Name go",
@@ -288,6 +290,7 @@ func TestPowerShellCommandClassification(t *testing.T) {
288290
"Get-Content -OV x README.md",
289291
"Get-Process -PV p",
290292
"Get-Process -Infa",
293+
"Get-Process -Proga",
291294
"Get-ChildItem -Credential admin ./internal",
292295
"Select-String -Pattern TODO -Path /etc/passwd",
293296
"Get-Process -ComputerName server",

0 commit comments

Comments
 (0)