Skip to content

fix(hooks): contain saved scan roots - #3259

Open
dsfaccini wants to merge 1 commit into
Graphify-Labs:v8from
dsfaccini:fix/hook-root-containment
Open

fix(hooks): contain saved scan roots#3259
dsfaccini wants to merge 1 commit into
Graphify-Labs:v8from
dsfaccini:fix/hook-root-containment

Conversation

@dsfaccini

Copy link
Copy Markdown

This pull request was posted by codex-tui using gpt-5.6-sol on behalf of David.

Summary

  • anchor generated post-commit and post-checkout rebuilds to the active worktree
  • accept saved scan roots only when they resolve within that worktree
  • preserve valid subdirectory scans and explicit external-path updates
  • exercise external, malformed, empty, and valid-subdirectory markers through both generated hook bodies

Fixes #3258.

Validation

  • uv run --frozen pytest tests/test_hooks.py -q — pass
  • changed-file pre-commit hooks — pass
  • GRAPHIFY_MAX_WORKERS=2 uv run --frozen graphify update . — pass

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

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.

Contain automatic hook rebuild roots within the worktree

1 participant