fix: skip merge attribute for ignored graph output - #2701
Conversation
Contributor: Som Samantray
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).
Formal verification. 1 change(s) tested, no difference found (not proven).
Graphify review — findings
This PR adds a plan document and implements a guard in graphify/hooks.py so that hook installation skips adding the .gitattributes merge rule when the graph output path is ignored by Git, while still registering the local merge driver. It refactors the attribute-line helper by extracting a _merge_attr_path() function and introduces a _graph_path_is_ignored() helper that shells out to git check-ignore. A new test verifies that installation on a repo ignoring the graph output registers the driver but does not create .gitattributes.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 304 functions depend on the 158 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
install()— 26 callers, 6 callees
Verification — 304 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: 165 function(s) in the blast radius were not formally verified this run
Formal verification
No difference found (not proven): No behavior difference found in \_merge\_attr\_line (not a proof).
The verifier ran both versions of \_merge\_attr\_line on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify \_register\_merge\_driver.
The verifier did not have enough to check \_register\_merge\_driver, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: parameter `root` is annotated `Path` — outside the synthesizable primitive/collection set
· 1 more finding(s) on lines outside this diff (see the check run).
Summary
Fixes #2595.
merge.graphifydriver when graph output is ignored..gitattributesmutation when Git reports the graph path is ignored.Validation
uv run pytest tests/test_hooks.py -q— 79 passeduv run ruff check graphify/hooks.py tests/test_hooks.py— passeduv run pyright graphify/hooks.py— 0 errorsopenaidependency and unavailable shallow-clone skillgen baseline refs)Contributor
Som Samantray