fix: preserve shell guard on helper failure - #101
Conversation
95c504b to
dda6472
Compare
|
Rebased onto v0.1.46 (a4c9972). The consolidated tests/block-monk-windows.ps1 regression passes locally for a missing helper, a failing helper (net.exe), and malformed-success output (cmd.exe), while preserving the shipped command-boundary cases. Ready for maintainer workflow approval/review. |
dda6472 to
5d0411c
Compare
|
Rebased onto the current Fresh validation:
Current head: |
Buffer raw stdin bytes, preserve UTF-8/BOM payloads through the helper path, and fall back to the native parser when the helper fails or returns invalid output. Cover both packaged Windows hooks with the regression matrix.
c3879e7 to
b45f19a
Compare
|
Thanks for the PR — we ported this approach into the fix that shipped in v0.1.54. This PR no longer merges cleanly against current |
Summary
monk-agent hook block-monkfailsRoot cause
hooks/block-monk.ps1returned immediately whenever the configured helper path existed. A helper failure propagated its exit code without producing deny JSON, and a successful but malformed response was relayed without validation. In both cases, directmonkcommands bypassed the native fallback that is supposed to preserve the shell guard when the companion is unhealthy.Impact
The guard now remains active through interrupted updates, incompatible helpers, and initialization failures. Direct
monkcommands are denied while ordinary commands still exit cleanly with no hook output.Validation
net.execmd.exemonk cluster listand allowecho monkmonk-agentv0.1.45 still denies/allows the same casesgit diff --check.github/workflows/install-e2e.ymlwith PyYAMLCloses #100