Skip to content

feat(scripts): add smoke-test-hooks.py — validate registered hook exit codes#646

Merged
notque merged 1 commit into
mainfrom
feat/evolve-smoke-test-harness
May 20, 2026
Merged

feat(scripts): add smoke-test-hooks.py — validate registered hook exit codes#646
notque merged 1 commit into
mainfrom
feat/evolve-smoke-test-harness

Conversation

@notque
Copy link
Copy Markdown
Owner

@notque notque commented May 15, 2026

Summary

  • Adds scripts/smoke-test-hooks.py to validate all hooks registered in .claude/settings.json
  • Reads registered hooks from settings.json, fires each with event-appropriate mock stdin, asserts exit code is 0 or 2 (valid hook behavior)
  • Reports PASS/WARN/FAIL/MISSING/TIMEOUT per hook; compact mode suppresses passing hooks
  • Complements benchmark-hooks.py (timing) with correctness checks (exit codes)

Motivation

Evolution cycle identified this as the #1 infrastructure gap: hook registry grows faster than it is validated. 14+ unregistered hooks were blocked by absence of a test gate. This harness provides the mechanical guarantee future registration proposals require.

Evolution Cycle Scores

  • Consensus score: 3.0/3.0 (unanimous STRONG — Pragmatist, Purist, User Advocate)
  • A/B result: 5/5 test cases pass (100% win rate)

Test Results

Test Result
SessionStart hooks (9) all pass PASS
Compact mode suppresses passing hooks PASS
CI mode exits 0 when all pass PASS
Verbose mode shows stdout/stderr PASS
MISSING script detection works PASS
All 59 registered hooks pass smoke test PASS

Evolution Cycle

This PR was generated and validated by the toolkit-evolution skill (2026-05-15 cycle).

@notque notque enabled auto-merge (squash) May 15, 2026 03:24
…it codes

Reads all hooks wired in .claude/settings.json, fires each once with
event-appropriate mock stdin, and asserts exit code is 0 or 2 (valid
hook behavior). Reports PASS/WARN/FAIL/MISSING/TIMEOUT per hook.

Complements benchmark-hooks.py (timing) with correctness checks. Unblocks
future hook registration proposals that previously had no test gate.
All 59 currently-registered hooks pass (exit 0).
@notque notque force-pushed the feat/evolve-smoke-test-harness branch from 051940b to 5b4effc Compare May 20, 2026 23:29
@notque notque merged commit 4e5c232 into main May 20, 2026
6 checks passed
@notque notque deleted the feat/evolve-smoke-test-harness branch May 20, 2026 23:31
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