Skip to content

fix: harden assistant hooks and AST worker fallback#675

Open
Ammaar-Alam wants to merge 1 commit intosafishamsi:v6from
Ammaar-Alam:fix/harden-assistant-hooks
Open

fix: harden assistant hooks and AST worker fallback#675
Ammaar-Alam wants to merge 1 commit intosafishamsi:v6from
Ammaar-Alam:fix/harden-assistant-hooks

Conversation

@Ammaar-Alam
Copy link
Copy Markdown

@Ammaar-Alam Ammaar-Alam commented May 3, 2026

Summary

  • run the Codex hook-check command through the current Python environment's entry point instead of a possibly stale graphify binary from PATH
  • quote the Codex hook command for POSIX shells and Windows PowerShell
  • avoid target-repo graphify.py / graphify/ shadowing when Codex runs the hook from a project cwd
  • report hook install/read/write/status failures instead of crashing where filesystem access is denied
  • fall back to sequential AST extraction when process workers cannot start or the process pool breaks

Why

This makes Graphify more reliable in venv, uv/pipx, PowerShell, sandboxed, and protected-directory environments without changing the Codex hook payload behavior. hook-check remains a silent no-op and graph guidance still comes from AGENTS.md / installed skills.

Tests

  • .venv/bin/python -m pytest tests/test_install.py tests/test_hooks.py tests/test_extract.py -q --tb=short
  • .venv/bin/python -m pip install tree-sitter-sql
  • .venv/bin/python -m pytest tests/ -q --tb=short
  • git diff --check
  • .venv/bin/python -m compileall -q graphify
  • .venv/bin/python -m graphify update .
  • .venv/bin/python -m graphify hook-check

Links

@Ammaar-Alam Ammaar-Alam marked this pull request as ready for review May 3, 2026 04:47
@Ammaar-Alam Ammaar-Alam force-pushed the fix/harden-assistant-hooks branch 2 times, most recently from d3bad6d to 11e60d2 Compare May 3, 2026 04:55
@Ammaar-Alam Ammaar-Alam changed the title fix: harden graphify commands in constrained environments fix: harden hooks and extraction fallbacks in constrained environments May 3, 2026
@Ammaar-Alam Ammaar-Alam force-pushed the fix/harden-assistant-hooks branch from 11e60d2 to 4d49c78 Compare May 3, 2026 05:07
@Ammaar-Alam Ammaar-Alam changed the title fix: harden hooks and extraction fallbacks in constrained environments fix: harden assistant hooks and AST worker fallback May 3, 2026
@Ammaar-Alam Ammaar-Alam force-pushed the fix/harden-assistant-hooks branch from 4d49c78 to cbc2030 Compare May 3, 2026 05:18
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