github Dicklesworthstone/destructive_command_guard v0.17.0

37 minutes ago

Highlights

This release closes commands that previously ran unguarded (PowerShell Tee-Object/Out-File truncation, commands behind builtin, zsh precommand modifiers and macOS launchers, shell variables past neutral commands, command -p eval), fixes Antigravity hook registration so dcg actually fires for run_command, gives the Codex hook a display label, stops the hook from blocking its own recommended dcg test --stdin heredoc form, stabilizes the test suite and strict Clippy gate, and switches release builds from opt-level = "z" to opt-level = 3.

Performance (opt-level = 3)

  • Release binaries are now compiled with opt-level = 3 across the entire binary instead of size-optimizing (opt-level = "z") non-regex crates.
  • Paired A/B benchmarks on the same commit (opt-level = 3 vs opt-level = "z" + regex opt-level = 3) show 16/16 measured hook workloads faster in CPU p50 with identical decisions and zero security regressions:
    • commit_message_300: 36.14 ms → 21.99 ms wall p50 (-39.2%), 36.25 ms → 21.02 ms CPU p50 (-42.0%)
    • quoted_data_300: 24.45 ms → 14.04 ms wall p50 (-42.6%), 24.50 ms → 13.66 ms CPU p50 (-44.2%)
    • python_300_safe: 36.74 ms → 24.95 ms wall p50 (-32.1%), 35.30 ms → 25.03 ms CPU p50 (-29.1%)
    • python_40_safe: 19.75 ms → 14.62 ms wall p50 (-26.0%)
    • short_ls: 3.16 ms → 2.83 ms wall p50 (-10.4%)

Agent Integrations & Installers

  • Antigravity (#652): dcg install --agy now writes "matcher": "run_command" (Antigravity's shell tool name) instead of "Bash", and re-running dcg install --agy migrates existing "Bash" entries in place.
  • Codex (#669): install.sh and install.ps1 now set "statusMessage": "dcg (destructive command guard)" on Codex hooks so /hooks no longer displays "Unnamed hook", while preserving any operator-supplied statusMessage.
  • Self-inspection heredocs (#665): Bare dcg test|explain|classify --stdin fed by a quoted heredoc is now treated as a structured data sink so the hook's own denial tip works without re-blocking.
  • OpenCode (#639): Explicit verdicts are emitted for warn decisions when dcg_explicit_verdict is requested.
  • Installer authentication (#638): Pinned release scripts are verified by SHA-256 and Minisign release identity before execution.

Security & Classifier Improvements

  • PowerShell Tee-Object and Out-File (#642): Non-append truncation is now guarded with the same filesystem rules as >, while credential and .git targets keep their stronger rules.
  • Wrappers & indirection: Commands reached via builtin, zsh noglob/nocorrect, macOS arch/xcrun, command -p eval, shell variables past neutral commands, and proven literal argument expansions (git reset $(echo --hard), F=--hard; git reset "$F") now reach the plain command's rules while honoring hash -p rebinding.
  • False-positive fixes: Resolved false positives for arithmetic shifts (#649), quoted conflict-marker/regex bodies (#654), long quoted Python heredocs (#647, #569), compared string literals inside python3 -c (#645), quoted python3 - heredocs with > and backticks followed by shell commands (#660), literal interpreter bindings (#608), quoted > in unresolved-command arguments (#621), and quoted heredocs after $VAR redirect targets (#439).
  • Crash & diagnostic fixes: Eliminated unbounded recursion before interpreter heredocs (#628) and inaccurate deadline reporting on incomplete regex evaluation (#643).
  • Test & lint stabilization (#670): Resolved all 52 post-v0.16.0 test regressions and 3 strict Clippy lints (cargo clippy --all-targets -- -D warnings clean).

Dependencies & Security Audit

  • Updated tru to 0.3.0 (serde-only library), rusqlite to 0.43.0, vergen-gix to 10.0.4, and compatible patch releases across Cargo.lock (ast-grep-core remains pinned at 0.45.3 to match ast-grep-language-dcg).
  • cargo audit reports 0 vulnerabilities (remaining advisories are informational: heapless in the build-script-only vergen-gix tree and unmaintained chrono / unsafe-libyaml).

Verification

Every release archive, installer script, and SHA256SUMS is accompanied by .sha256 and .minisig signatures verifiable with release/minisign.pub (key ID 69B3955C8D2E62A8):

minisign -Vm SHA256SUMS -p release/minisign.pub
sha256sum -c SHA256SUMS --ignore-missing

Don't miss a new destructive_command_guard release

NewReleases is sending notifications on new releases.