Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(platform): per-dialect destructive-command classification

2 months ago

0029978
Authored
Max Weinbach7/7/2026, 11:30:04 AM
src/platform/approval.ts: shared dialect-neutral floor (full historical POSIX
destructive set — never newly-silent on any platform) extended by an
exhaustive per-dialect table. PowerShell gains the vocabulary Windows
sessions are steered into: Remove-Item/rm/ri/del/rd recurse+force in any
order or abbreviation (rm -r -fo), rd|del /s, Format-Volume, Clear-Disk,
Remove-Partition, Stop/Restart-Computer, device-path deletes, iex download-
and-execute, plus review-tier cmdlets. Closes the HIGH audit finding that the
human-in-the-loop gate was absent on Windows for exactly the dialect its
prompts recommend.

Also adds src/platform/host.ts (hostPlatform/toDesktopPlatform — the one
sanctioned process.platform read) and shell.ts shellDialect/quoteShellValue
(PowerShell smart-quote-family escaping). utils/approval.ts now delegates,
keeping its public shape.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Parent376dd5d

5 files changed
  • src/platform/approval.ts+128−0
  • src/platform/host.ts+33−0
  • src/platform/shell.ts+35−0
  • src/utils/approval.ts+13−49
  • test/platform/approval.test.ts+163−0