Skip to content

fix: scope validate_layers hook on tool_name - #17

Open
ryzizub wants to merge 2 commits into
mainfrom
fix/validate-layers-hook-scoping
Open

ryzizub wants to merge 2 commits into
mainfrom
fix/validate-layers-hook-scoping

Conversation

@ryzizub

@ryzizub ryzizub commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Makes hooks/validate_layers.sh confirm tool_name from the payload and exit 0 unless it is Edit, MultiEdit, or Write, following the hook scoping rule.

  • Matcher widened to Edit|MultiEdit|Write. README, CLAUDE.md ## Hooks, and the AGENTS.md tree updated to match.
  • The dart availability check now runs just before the validator, so edits outside FFCA pubspecs no longer print "dart not found".
  • New hooks/validate_layers_test.sh (15 cases) using scripts/test/fixtures, added as a step in the existing 🪝 Hook Tests CI job, which now sets up Dart. Three of its cases fail against the old hook.

Reviewer note: the tests pass HOME through to the hook because version-manager shims (asdf, fvm) need it to find dart.

🤖 Generated with Claude Code

@ryzizub
ryzizub force-pushed the fix/validate-layers-hook-scoping branch from d693799 to 4e493b9 Compare September 30, 2026 08:57
@ryzizub
ryzizub requested a review from a team as a code owner September 30, 2026 08:57
ryzizub and others added 2 commits October 1, 2026 15:39
The hook now exits 0 unless tool_name is Edit, MultiEdit, or Write, per
the hook scoping rule (a matcher is a filter, not a guarantee). The dart
check moves next to the validator run so unrelated edits stay silent.

Adds hooks/validate_layers_test.sh and a Script Tests CI job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryzizub
ryzizub force-pushed the fix/validate-layers-hook-scoping branch from 4e493b9 to 44fcc4f Compare October 1, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants