Skip to content

fix(hooks): harden all 15 hooks with binary checks + error logging#113

Merged
ShaheerKhawaja merged 1 commit into
mainfrom
fix/v2.0-hook-hardening
Apr 16, 2026
Merged

fix(hooks): harden all 15 hooks with binary checks + error logging#113
ShaheerKhawaja merged 1 commit into
mainfrom
fix/v2.0-hook-hardening

Conversation

@ShaheerKhawaja

Copy link
Copy Markdown
Owner

Summary

  • Add binary availability guards to all 15 hooks (_HAS_BUN, _HAS_PYTHON, _HAS_JQ)
  • Add _log_error() function -> ~/.productionos/logs/hook-errors.log
  • Fix eval-gate.sh: check eval-runner.ts exists before calling
  • Guard bun calls with availability check
  • Create hooks/README.md (inventory, dependencies, error handling, config guide)
  • All 15 hooks pass bash -n syntax check

Test plan

  • bash -n hooks/*.sh — all 15 pass
  • bun test — 0 fail
  • Hooks degrade gracefully when bun/python3/jq missing

Add to every hook:
- Binary availability guards (_HAS_BUN, _HAS_PYTHON, _HAS_JQ)
- _log_error() function -> ~/.productionos/logs/hook-errors.log
- Graceful degradation when dependencies missing

Fix eval-gate.sh:
- Check eval-runner.ts exists before calling bun run eval
- Guard bun calls with _HAS_BUN check

Add hooks/README.md:
- Complete inventory of all 15 hooks with dependencies
- Error handling documentation
- Configuration guide (disable, frequency, add new)

bash -n hooks/*.sh: all 15 pass syntax check.
@ShaheerKhawaja
ShaheerKhawaja merged commit 8637cc7 into main Apr 16, 2026
4 checks passed
@ShaheerKhawaja
ShaheerKhawaja deleted the fix/v2.0-hook-hardening branch April 16, 2026 13:42
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