hooks: auto-approve bd CLI commands for research-step#76
Merged
Conversation
The research-step skill uses `bd` (beads) dozens of times per session across plan/execute/update-summary. The skill's SKILL.md frontmatter declares `Bash(bd:*)` in allowed-tools, but in practice that has not suppressed per-command permission prompts; users have had to manually add `Bash(bd:*)` via /permissions to make the friction stop. Approve `bd ...` invocations plugin-wide via approve-asta-bash.sh, the same way `asta ...` invocations are already approved. `bd` is a tool whose only purpose in this plugin is to back research-step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
b557c39 to
1931d16
Compare
Member
Author
|
Manually refactored into 3 distinct hooks:
|
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
Auto-approve
bd ...commands in the asta-preview plugin'sPermissionRequesthook, mirroring the existing auto-approval ofasta ...commands. Fixes the permission-prompt friction that thehtml-linearization-reproduction-and-reflection feedback report
flagged: the
research-stepskill usesbd(beads) dozens of times per session —bd list,bd show,bd ready,bd create,bd close,bd dep add,bd update, … — and each one was triggering a prompt until the user ran/permissionsto addBash(bd:*).The feedback report's literal suggestion was to have
inithand off to afewer-permission-promptsskill, but that skill isn't part of the asta-plugins distribution and may not be installed in every environment that loadsasta-preview. The plugin hook is portable: anyone who loadsasta-preview(vianpx plugins add, the Claude Code marketplace, or--plugin-dir) gets the bd allowlist automatically, with no per-environment configuration.Changes
plugins/asta-preview/hooks/approve-asta-bash.sh: add abd ...branch alongside the existingasta ...branch.plugins/asta/hooks/approve-asta-bash.sh: regenerated viamake build-plugins.tests/test_hooks.py: two new tests — one verifiesbd ...invocations are approved, one verifiesbd-prefix lookalikes (bdiff) are not matched.Validation
This is a permission-prompt UX gap. Eval sandboxes auto-approve every tool call, so the
asta_skillsbenchmark does not measure permission-prompt friction and cannot reproduce the baseline behavior. Validation is by:make check-plugins:plugins/astais in sync withplugins/asta-preview.The blast radius is bounded: the new branch only matches commands starting with
bd(literalb,d, space), and the negative-lookalike test guards againstbdiff/bd-somethingregressions. Noresearch-stepworkflow steps were modified.Out of scope
The same feedback report lists four other suggestions for
research-step(less-static task chain, lighterexperimenttask type,scope-triggered replan,definitionsschema feedback). They are not addressed here — the user asked for this one specifically.