Repository navigation
test(mods): fail a plugin that ships hooks/register.* but names no modules - #9949
Conversation
A hooks/register.* file loads only when hooks/hooks.json lists it under "modules". These cases expect test-plugin-mods.sh to fail such a plugin, even when claude is absent, and to keep passing a register file beside a modules array. They fail against the current script (PASS=20 FAIL=6). Refs: #7294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1zWtmVHsCdqJk7AEeNE2b
…dules Without a "modules" key Claude Code never loads the register file, and test-plugin-mods.sh skipped the plugin silently, so the mod shipped untested and inert. The script now fails such a plugin before any CLI check, so it fails even where claude is absent. No plugin on main trips it today. The mod-authoring convention's packaging paragraph names the check. Refs: #7294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1zWtmVHsCdqJk7AEeNE2b
The first commit on this branch was built from a stale index and reverted the split-child trust changes from #9940. This puts those six files back to origin/main, so the branch differs from main only in test-plugin-mods.sh, its test, and the mod-authoring README. Refs: #7294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1zWtmVHsCdqJk7AEeNE2b
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed No security issues found in PR #9949. The change touches three files: a convention doc paragraph,
critical-findings: 0 |
|
claude-review reviewed No findings. I read the full diff (3 files), the PR context, and
|
Refs: #7294
Summary
A plugin can ship
hooks/register.*while itshooks/hooks.jsonnames nomodules. Claude Code then never loads the mod, andscripts/test-plugin-mods.shskipped the plugin without a word, so the mod shipped untested and inert. This came out of the #7294 digest of the mods troubleshoot page (decision D15: build this one gap check, consumer CI).Fix
scripts/test-plugin-mods.shnow fails, with exit 1, any plugin whosehooks/holds aregister.*file whilehooks.jsonis missing or names nomodules(absent or empty). The check runs before the CLI checks, so it fails even whereclaudeis absent or too old.scripts/test-plugin-mods.test.shgains four cases: register file beside ahooks.jsonwith nomodules, register file with nohooks.json, register file beside an emptymodulesarray, and register file beside a realmodulesarray (still passes).Verification
PASS=20 FAIL=6(the three failing exit codes, the two missing error lines, and "a register file with no modules runs no test"). The first commit also reverted the six fix(pr-pipeline): close two non-listed paths into split-child trust #9940 files by mistake (a stale index); the last commit restores them, so the squashed diff is the three files above only.bash scripts/test-plugin-mods.test.shprintsPASS=26 FAIL=0;bash scripts/validate-plugins.test.shprintsPASS=6 FAIL=0.bash scripts/test-plugin-mods.shon this tree runs every mod'sclaude plugin testand endsAll mod tests passed., so no plugin on main trips the new check.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01X1zWtmVHsCdqJk7AEeNE2b