[patch] MLAI-1310 - Reapply the governed-hook pipeline fix reverted for the release - #91
Open
shmuelqwak wants to merge 1 commit into
Open
Conversation
…elease Reapplies #86, which merged as b2eba5f and was reverted by #87 for release scheduling rather than for anything wrong with the change. This is a revert of that revert, so the restored content is byte-identical to what was reviewed and approved; the only edit on top is the version, which main has since moved to 0.6.7, so both manifests go to 0.6.8. Without it Cursor skill governance is non-functional again, exactly as it was before #86: Cursor concatenates the hook command onto printf %s '<b64>' | base64 -d | <command> and leaves the hook's own fd 0 as /dev/null, so the top-level ';' in `_JFAG_NOW=$(date +%s 2>/dev/null); … npx …` terminates that pipeline. npx then runs as a separate command inheriting /dev/null, agent-guard reads 0 bytes, cannot classify the event, and renders its no-opinion allow — indistinguishable from "this prompt was not a skill invocation". Both governed surfaces allow every skill, silently, at exit 0. Computing the deadline inside a command substitution scopes the ';' and keeps the hook one simple command, so it stays the tail of Cursor's pipeline, while the degrade-to-empty behaviour of the defensive clock read is preserved. Verified on top of current main: the governance suite is 41/41, validate-template passes, and the 53 unit tests (including those added by #89) pass. Against main's current hooks.json the suite fails 10 ways, so the regression cannot return unnoticed. AX-2205 (#89) touched neither hooks.json nor the validator, so the reapply carries no interaction with it.
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.
Reapplies #86, which merged as
b2eba5fand was reverted by #87 for release scheduling — not for anything wrong with the change. Fixes MLAI-1310.This is a revert of that revert, so the restored content is byte-identical to what was already reviewed and approved. The only edit on top is the version: main has since moved to
0.6.7, so both manifests go to0.6.8.What is broken on main right now
Cursor skill governance is non-functional again, exactly as before #86. Cursor concatenates the hook command onto a pipeline it builds and leaves the hook's own
fd 0as/dev/null:That top-level
;terminates the pipeline.base64 -dpipes into a bare assignment that reads nothing, andnpxruns as a separate command inheriting the shell's stdin —/dev/null. agent-guard reads 0 bytes, cannot classify the event, and renders its no-opinion allow, which is byte-identical to "this prompt was not a skill invocation". Both governed surfaces allow every skill, silently, at exit 0.Verified on main as it stands:
The fix, unchanged from #86
JF_AGENT_GUARD_ENFORCE_DEADLINE="$(_JFAG_NOW=$(date +%s 2>/dev/null); echo ${_JFAG_NOW:+$((_JFAG_NOW + 25))})" npx --yes …Computing the deadline inside a command substitution scopes the
;and keeps the hook one simple command, so it stays the tail of Cursor's pipeline. The defensive clock read is preserved, not reverted — an unreadable clock still yields an empty deadline, which agent-guard ignores in favour of its own budget, rather than the25(an instant in 1970) that the older inline form produced and that would floor the budget at 500 ms and block every skill.Verified on top of current main
validate-templateAnd the regression cannot return unnoticed — run against main's current
hooks.json, the suite fails 10 ways:Interaction with what landed meanwhile
AX-2205 - Add SH support(#89) touched neitherhooks.jsonnorscripts/validate-skill-governance.mjs, so this reapply carries no interaction with it. The only merge conflict was the version manifests, resolved to0.6.8.Review feedback from #86 is already folded in: the manifest bump, the corrected
date(1)sandbox comment, and the behavioural check that executes the empty-deadline degrade rather than asserting it in text.