Repository navigation
Description
Summary
The post-commit / post-checkout hooks written by graphify hook install resolve their
Python interpreter through a chain of probes. The second probe reads a path from a file
inside the working tree — graphify-out/.graphify_python — and then executes that path.
The README ("Team setup") says
graphify-out/ "is meant to be committed to git so everyone on the team starts with a map",
and the recommended .gitignore block excludes only cost.json (and optionally cache/).
.graphify_python is therefore a file the documentation actively encourages committing.
Put together: cloning a repository that followed that advice, and running graphify hook install
in it, means the repository's own contents decide which executable your git hooks run on your
next commit. That is a decision that should belong to the machine, not to the checkout.
Where
From a hook generated by 0.9.53 (.husky/post-commit, same block in post-checkout):
_PINNED='/…/uv/tools/graphifyy/bin/python'
if [ -n "$_PINNED" ] && [ -x "$_PINNED" ] && "$_PINNED" -c "$_GFY_PROBE" 2>/dev/null; then
GRAPHIFY_PYTHON="$_PINNED"
fi
# Second probe: read graphify-out/.graphify_python …
if [ -z "$GRAPHIFY_PYTHON" ]; then
_GFY_PYTHON_FILE="graphify-out/.graphify_python"
…
GRAPHIFY_PYTHON="$_FROM_FILE"The existing guards raise the bar but do not close it: the character allowlist rejects shell
metacharacters, not paths; -x and the find_spec('graphify') probe constrain what the
target must look like, not where it may come from or who wrote it.
Why the probe looks redundant
hook install already embeds _PINNED at install time, and the README documents that as the
mechanism ("graphify hook install embeds the current interpreter path directly into the hook
scripts at install time… If you reinstall or upgrade graphify, re-run graphify hook install").
On a normal setup _PINNED answers first and the working-tree probe never runs — so its cost
today is the trust it extends, not the problem it solves.
Suggested directions
- Drop the working-tree probe from the hooks and let
_PINNED→command -v graphifycover it.
Re-runninghook installafter an upgrade is already the documented fix for a stale pin. - If the file has to stay as a fallback, source it from outside the repository
(~/.config/graphify/or~/.graphify/), which survivesuv toolreinstalls just as well
without being checkout-controlled. - Failing both, add
graphify-out/.graphify_pythonto the recommended.gitignorein
"Team setup", so the documented workflow stops publishing it.
Happy to send a PR for (1) or (2) if you have a preference.
Environment
graphify 0.9.53, macOS 15 (Darwin 25.4.0), uv tool install, hooks via husky.
No impact observed locally: across 34 repositories here graphify-out/ is git-ignored in all 34
and no graphify-out/ file is tracked. Reporting it as a property of the documented team
workflow rather than as an incident.
Activity
AlexBloch-IA commentedon Sep 1, 2026
Follow-up: the same hook has a second working-tree-controlled input, with less validation than
the interpreter probe above.
The embedded Python block reads
graphify-out/.graphify_rootand uses its contents as the rootthat graphify then walks and parses:
There is no check that the value is absolute, and none that it resolves inside the repository —
not even the character allowlist the
.graphify_pythonprobe has. The same_rootis also usedto build the output path a few lines later (
(_root / _out) / 'reflections' / 'LESSONS.md'via_reflect), so it steers a write as well as a read.Two things make this worse than the interpreter path rather than better:
-xand satisfiesfind_spec('graphify'). This one takes any string thatPath()accepts.graphify-out/is meant to gointo git. A rebuild rooted somewhere else writes what it found into
graphify-out/, and thenext ordinary
git commitin that repository carries it to the remote. That turns aconfiguration file into a path for content to leave a machine by the repository's own
normal workflow.
Same suggested direction as the interpreter path: read it from outside the working tree, or —
if it stays where it is — require it to resolve inside the repository root before using it,
which is the invariant the field appears to be for in the first place.
Same environment as above: graphify 0.9.53, macOS, hooks via husky. Again no local impact
observed (
graphify-out/git-ignored in all 34 repositories here, nothing tracked); reportingit as a property of the documented workflow.
Catch symlink loop RuntimeError in the root guard
Catch symlink loop RuntimeError in the root guard
Keep the git hook rebuild root inside the repo
fix(hooks): run the rebuild from the checkout's top level (#3258)
chore: [HIMMEL-7394] sync to upstream 0.9.95 and carry the himmel del…