-
Notifications
You must be signed in to change notification settings - Fork 0
fix(agents): address hook review feedback #2208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,24 @@ | |
|
|
||
| Describe 'shared GitHub guardrail wiring' | ||
|
|
||
| registered_hook_commands() { | ||
| local config="$1" | ||
| case "$config" in | ||
| config/codex/hooks.json | config/claude/settings.json) | ||
| jq -r '.hooks.PreToolUse[] | select(.matcher == "Bash") | .hooks[]?.command' "$config" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Latent: exact-string matcher check will miss compound matchers. For Codex/Claude you use |
||
| ;; | ||
| config/cursor/hooks.json) | ||
| jq -r '.hooks.beforeShellExecution[]?.command' "$config" | ||
| ;; | ||
| config/copilot/config.json) | ||
| jq -r '.hooks.preToolUse[]?.command' "$config" | ||
| ;; | ||
| config/grok/plugin/hooks/hooks.json) | ||
| jq -r '.hooks.PreToolUse[] | select(.matcher | test("(^|\\|)Bash($|\\|)")) | .hooks[]?.command' "$config" | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| verify_wiring() { | ||
| local config hook | ||
| for config in \ | ||
|
|
@@ -11,7 +29,7 @@ verify_wiring() { | |
| config/copilot/config.json \ | ||
| config/grok/plugin/hooks/hooks.json; do | ||
| for hook in block-git-push.sh block-gh-settings.sh; do | ||
| if ! grep -Fq "config/shared/hooks/$hook" "$config"; then | ||
| if ! registered_hook_commands "$config" | grep -Fqx "\$HOME/dotfiles/config/shared/hooks/$hook"; then | ||
| printf 'missing %s in %s\n' "$hook" "$config" >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latent: HTTPie query-param syntax still false-blocked.
The new regex correctly excludes URL/option shapes, but HTTPie's URL query-parameter form
k==vstill matches: the middle class stops before the first=, then(:=|=)consumes the first=, and[^[:space:]]+greedily eats=value.Repro on any protected suffix:
This is pre-existing behavior (the old regex had it too), so it's not a regression — but since this PR is loosening HTTPie handling anyway, worth teaching the regex that
==is a URL query param, not a body. One option is to require the value not start with=, e.g.(:=|=)[^=[:space:]][^[:space:]]*.