Repository navigation
[patch] MLAI-1333 - Fix skill governance on Windows - #118
Open
nadav-dvir wants to merge 1 commit into
Open
nadav-dvir wants to merge 1 commit into
nadav-dvir wants to merge 1 commit into
Conversation
- Run beforeSubmitPrompt and preToolUse through the vendored ./modules/core/enforce-skill.mjs with --client cursor, so the hook is one node command with no POSIX syntax - Update validate-skill-governance.mjs: assert the launcher command, check the fetch bounds, deadline and fail-open on what npx receives, and keep the payload-pipeline checks from MLAI-1310 - README: drop the POSIX shell requirement - Bump the plugin to 0.6.20 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows, the skill-governance hooks never ran: they were POSIX one-liners (
${VAR:-…},$(( ))), and Cursor runs hooks in the platform's default shell, so skills were allowed unchecked. This PR runs them through the shared launcher that JFrog agent hooks now vendors intoplugins/jfrog/modules/core/enforce-skill.mjs(synced in #115 and #117). The hook is a singlenodecommand with a path relative to the plugin root, like the existingsessionStarthooks.The launcher sets the same deadline (now + 25s) and fetch bounds, and passes Agent Guard's exit 0 and 2 through. On any other failure it answers
{}with exit 0 and writes[jfrog-agent-guard] skill governance did not run (<cause>); this skill was not governed.to stderr, which Cursor keeps in its hook output log.Changes
plugins/jfrog/hooks/hooks.json:beforeSubmitPromptandpreToolUse(Read) runnode "./modules/core/enforce-skill.mjs" --client cursor, andpreToolUseadds--prefer-offlineas before.failClosed: falseand the timeouts are unchanged.scripts/validate-skill-governance.mjs:{}with exit 0 and the stderr cause on fail-open.date(1)degrade check, because the clock is now read in node.runHooknow runs from the plugin root, which the relative path needs.MLAI-1310 payload delivery
All of the pipeline checks still pass:
;,&&or||;printf %s '<b64>' | base64 -d | <command>under sh, bash and zsh.The launcher reads the payload from its stdin, which is that pipeline.
Not verified here: how Cursor on Windows delivers the payload. The pipeline above is the macOS and Linux path. Before merging, please run one governed skill on a Windows Cursor install and confirm it gets a verdict.
Testing
node scripts/validate-skill-governance.mjs: all 38 checks pass.hooks.json, 8 checks fail.node scripts/validate-template.mjspasses.node --test plugins/jfrog/scripts/*.test.mjs: 53 pass.🤖 Generated with Claude Code