fix(hooks): contain saved scan roots - #3259
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
Constrains the generated post-commit and post-checkout hooks to only honor a saved .graphify_root that resolves inside the current worktree, falling back to the worktree root when the marker is missing, empty, malformed, or points outside it. Saved subdirectory roots within the worktree are still accepted. Adds tests covering the external/empty/malformed rejection paths and the valid-subdirectory case.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 366 functions depend on the 195 functions this change touches.
Health — this change adds coupling hotspots:
- new:
dispatch_command()— 2 callers, 123 callees - new:
install()— 33 callers, 7 callees - new:
dispatch_install_cli()— 2 callers, 31 callees - new:
status()— 8 callers, 6 callees - new:
uninstall()— 9 callers, 5 callees - new:
uninstall_all()— 2 callers, 13 callees - new:
test_poisoned_manifest_is_healed()— 0 callers, 6 callees
Verification — 366 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 202 function(s) in the blast radius were not formally verified this run
· 7 more finding(s) on lines outside this diff (see the check run).
Summary
Fixes #3258.
Validation
uv run --frozen pytest tests/test_hooks.py -q— passGRAPHIFY_MAX_WORKERS=2 uv run --frozen graphify update .— pass