Skip to content

refactor(hooks): narrow monitoring hook matchers to their signal domains (#640)#641

Merged
notque merged 1 commit into
mainfrom
feat/evolve-monitoring-hook-matchers
May 12, 2026
Merged

refactor(hooks): narrow monitoring hook matchers to their signal domains (#640)#641
notque merged 1 commit into
mainfrom
feat/evolve-monitoring-hook-matchers

Conversation

@notque
Copy link
Copy Markdown
Owner

@notque notque commented May 12, 2026

Summary

  • Evolution cycle proposal 2026-05-12: PostToolUse monitoring hook matcher over-breadth
  • Consensus score: 3.0/3.0 (Pragmatist: STRONG, Purist: STRONG, User Advocate: STRONG)
  • A/B result: 5/5 test cases pass; 100% win rate

Changes

Three PostToolUse hooks were firing under Bash|Write|Edit|Agent but only produce signal on a subset of those events:

Hook Old matcher New matcher Rationale
routing-gap-recorder.py Bash|Write|Edit|Agent Skill|Agent Scans for GAP DETECTED: banners from /do skill output — only appears in Skill invocations
record-waste.py Bash|Write|Edit|Agent Bash|Agent Estimates token waste from failures — Write/Edit rarely fail with measurable waste
completion-evidence-check.py Bash|Write|Edit|Agent Bash|Agent Scans for completion language — Write/Edit outputs never contain "I've implemented" patterns

error-learner.py stays at Bash|Write|Edit|Agent — file system errors ARE worth learning from.

Impact

3 fewer hook fires per Write/Edit operation — the most frequent operation class in a session. On a typical session with 100 Write/Edit calls, this eliminates 300 unnecessary Python process spawns.

Test Results

Test Case Result
routing-gap-recorder absent from Bash|Write|Edit|Agent ✓ PASS
routing-gap-recorder present in Skill|Agent ✓ PASS
record-waste + completion-evidence-check only in Bash|Agent ✓ PASS
error-learner remains at Bash|Write|Edit|Agent ✓ PASS
JSON valid, routing drift clean (116/116 skills) ✓ PASS

Evolution Cycle

This PR was generated and validated by the toolkit-evolution skill (2026-05-12 nightly cycle). Critique was unanimous STRONG from Pragmatist, Purist, and User Advocate personas.

Retro Graduation

20 ungraduated entries graduated before merge: 12 → toolkit-evolution/SKILL.md, 5 → .claude/settings.json, 1 → joy-check/SKILL.md, 1 → posttooluse-joy-check-warn.py, 1 → golang-general-engineer.md.

Three PostToolUse hooks previously fired on Bash|Write|Edit|Agent but
only produce signal on a subset of those events:

- routing-gap-recorder: scans for GAP DETECTED banners from /do skill
  output → only meaningful after Skill invocations; moved to Skill|Agent
- record-waste: estimates token waste from tool failures → Write/Edit
  rarely fail with measurable token waste; narrowed to Bash|Agent
- completion-evidence-check: scans for completion language in output →
  Write/Edit outputs never contain "I've implemented" patterns; narrowed
  to Bash|Agent

error-learner.py stays at Bash|Write|Edit|Agent — file system errors ARE
worth learning from.

Net result: 3 fewer hook fires per Write/Edit operation, which is the
most frequent operation class in a session. Semantics now match intent.

Evolution cycle 2026-05-12, STRONG consensus (3.0/3.0).
@notque notque enabled auto-merge (squash) May 12, 2026 03:20
@notque notque merged commit 3943c26 into main May 12, 2026
6 checks passed
@notque notque deleted the feat/evolve-monitoring-hook-matchers branch May 12, 2026 03:21
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.

1 participant