Repository navigation
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 5 advisory finding(s) below merit a look before merge.
Formal verification. 1 change(s) tested, no difference found (not proven).
Graphify review — findings
Moves the pinned interpreter out of the tracked hook scripts and into a gitignored graphify-out/.graphify_python sidecar, so install() writes sys.executable there and emits _PINNED='' in the hook bodies. Teaches the _PYTHON_DETECT probe to honor GRAPHIFY_OUT (with a graphify-out fallback) when reading the sidecar, and switches _merge_attr_line to read GRAPHIFY_OUT from the environment. Updates the hooks tests to assert machine-specific paths never leak into tracked scripts and that scripts stay byte-identical across machines.
Worth a look
- Installed hooks lose support for Python interpreter paths containing spaces —
graphify/hooks.py:35· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- GRAPHIFY_OUT env var reaches shell interpreter-path sink without validation —
graphify/hooks.py:44· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- GRAPHIFY_OUT newline injects extra .gitattributes entries —
graphify/hooks.py:591· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- GRAPHIFY_OUT can escape the repo when writing .graphify_python —
graphify/hooks.py:744· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- GRAPHIFY_OUT allows parent-directory traversal for sidecar write —
graphify/hooks.py:747· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 341 functions depend on the 187 functions this change touches.
Health — this change adds coupling hotspots:
- new:
install()— 37 callers, 8 callees - new:
dispatch_command()— 2 callers, 119 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 — 341 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: 194 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify install.
The verifier did not have enough to check install, 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 `path` is annotated `Path` — outside the synthesizable primitive/collection set
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.
· 7 more finding(s) on lines outside this diff (see the check run).
Summary
Fixes #2989.
graphify hook installwas embedding the absolute path of the Pythoninterpreter used to run the command directly into the tracked
.githooks/post-commitand.githooks/post-checkoutfiles.For example, installing Graphify on two different machines could produce:
Because these hook files are tracked, running
hook installon differentmachines could continuously rewrite the same tracked files and introduce
unnecessary churn or conflicts.
This change moves the machine-specific interpreter path into the existing
gitignored
graphify-out/.graphify_pythonsidecar while keeping the trackedhook templates portable.
What changed
1. Keep interpreter paths out of tracked hooks
The hook templates no longer receive the installing machine's
sys.executableas_PINNED.Instead,
graphify hook installrecords the sanitized interpreter path in:The existing runtime interpreter detection then uses this local sidecar before
falling back to launcher/PATH discovery.
_pinned_python()itself is retained because it is also used when configuringthe local
graphifymerge driver.2. Respect
GRAPHIFY_OUTThe sidecar location now follows the configured
GRAPHIFY_OUTdirectory.For example:
results in:
Runtime hook detection uses the same configured location and retains a fallback
to the default:
This keeps existing repositories compatible while allowing custom output
directories.
3. Fix corrupted post-checkout template text
The post-checkout template contained:
instead of the intended Unicode em dash:
Investigation showed that this was already present in the committed
graphify/hooks.pysource and was introduced by commit5c88af7. The existinghook writer already uses explicit UTF-8 encoding, so no encoding changes were
needed in
_install_hook().The source/template text has been corrected and regression coverage added.
Why this approach
The original
_PINNEDmechanism was introduced to support installations suchas uv/pipx where Graphify may live inside an isolated environment and the
Graphify launcher may not be available on the PATH used by GUI Git clients or
CI.
Removing the mechanism entirely could therefore regress those environments.
Instead, the interpreter path remains available at runtime through the
gitignored per-checkout sidecar, while the tracked hook remains
machine-independent.
The resulting flow is:
Regression coverage
Added/updated tests cover:
hook contents
graphify-out/.graphify_pythonis populated during hook installationGRAPHIFY_OUTdirectories workgraphify-outsidecarΓÇöValidation
Scope
The changes are limited to:
graphify/hooks.pytests/test_hooks.pyNo changes were made to the existing UTF-8 file-writing behavior of
_install_hook().