You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 2, 2026. It is now read-only.
refactor(hooks): extract shared utilities and add security validation
QUAL-1: Extract ~200 lines of duplicated utilities from 5 handlers into
hook_utils.py module with setup_logging(), setup_timeout(), cancel_timeout(),
and read_json_input() functions.
SEC-1: Add validate_file_path() function with path traversal protection
to prevent arbitrary file access via malicious hook input.
DOC-1: Document PostToolUse and PreCompact hooks in README.md and
USER_GUIDE.md with configuration options and usage examples.
Changes:
- Create src/git_notes_memory/hooks/hook_utils.py with shared utilities
- Update 5 handlers to use centralized utilities
- Add path validation to session_analyzer.py
- Add 8 security tests for path validation
- Document all 5 hooks and their configuration options
- Add guidance config docs (HOOK_SESSION_START_INCLUDE_GUIDANCE)
Test coverage: 1327 tests passing, 86.34% coverage
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
0 commit comments