Repository navigation
Conversation
…raphify-Labs#3771) Upgrading the package never touches hooks already on disk, so repos initialised before a hook fix (such as the Graphify-Labs#2253 console-window launcher) keep running the old script while `graphify hook status` says "installed". Status now compares the installed graphify block with the current template, ignoring the two per-install values (the pinned interpreter and the viz limit export), and tells the user to run `graphify hook install`, which already rewrites the block in place.
|
Thanks for the pull request, @bercedev. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic. |
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
Makes status report a hook as "installed (out of date: run graphify hook install to refresh it)" when its graphify block differs from what the current release would write. Package upgrades never rewrite hooks already on disk (#3771). The comparison covers only the text between the block's start and end markers, with the pinned interpreter (_PINNED) and the viz-limit export blanked. That way, user commands around the block or a different install-time Python don't trigger the warning. A block with no end marker skips the check and still reports plain "installed".
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 430 functions depend on the 236 functions this change touches.
Health — this change adds coupling hotspots:
- new:
main()— 98 callers, 3 callees - new:
install()— 40 callers, 7 callees - new:
dispatch_command()— 2 callers, 126 callees - new:
status()— 11 callers, 6 callees - new:
dispatch_install_cli()— 2 callers, 31 callees - new:
uninstall()— 9 callers, 5 callees - new:
_run_cli()— 6 callers, 7 callees - new:
uninstall_all()— 2 callers, 13 callees - …and 1 more — each is listed as a finding
Verification — 430 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: 251 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
22 of 308 test file(s) selected (7%) via static blast radius.
tests/test_affected_cli.py— impacttests/test_agents_platform.py— impacttests/test_codebuddy.py— impacttests/test_devin.py— impacttests/test_explain_cli.py— impacttests/test_extract_cli.py— impacttests/test_global_add_tag_inference.py— impacttests/test_god_nodes_cli.py— impacttests/test_hollow_chunks_arm_shrink_guard.py— impacttests/test_hook_chain_survives_skip.py— impacttests/test_hooks.py— impact, changed-testtests/test_incomplete_build_guard.py— impacttests/test_install.py— impacttests/test_install_references.py— impacttests/test_merge_chunks_validation.py— impacttests/test_multigraph_diagnostics.py— impacttests/test_no_dedup_flag.py— impacttests/test_path_cli.py— impacttests/test_query_cli.py— impacttests/test_query_induced_edges.py— impacttests/test_skill_auto_refresh.py— impacttests/test_unverified_semantic_shrink.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
Formal verification
No difference found (not proven): No behavior difference found in status (not a proof).
The verifier ran both versions of status 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.
· 1 grounded finding(s) anchored inline below; 8 more finding(s) on lines outside this diff (see the check run).
| return _VIZ_EXPORT_LINE_RE.sub("", _PINNED_LINE_RE.sub("_PINNED=''", block)) | ||
|
|
||
|
|
||
| def status(path: Path = Path(".")) -> str: |
There was a problem hiding this comment.
status()
fans out to 6 callees (efferent coupling); 11 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
Solidity free functions (#3906), VB.NET qualified calls (#3909), Astro frontmatter-only AST pass (#3902), surprise bonus/reason alignment (#3934), exclude-hubs stranded-neighbour (#3933), graph-DB push index (#3957), label retry keep-named (#3956), stale-hook status (#3951), virtual-workspace Cargo.toml skip (#3930), and symlinked-instructions install/uninstall handling (#3950/#3953). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Shipped in v0.9.73 (now on PyPI) via an authorship-preserving cherry-pick, so your commit keeps contributor-graph credit. Thanks @bercedev! |
What does this PR do?
Refs #3771.
Upgrading the package never touches hooks that are already on disk. So a repo that ran
graphify hook installbefore a hook fix (for example the #2253 console-window launcher) keeps running the old script. Until now,graphify hook statusstill saidinstalled, so nothing told the user the hook was stale.statusnow compares the graphify block in each hook with the current template and reports blocks from an older release:Before this change, the first
statusprintedinstalledfor both hooks.The comparison only looks at the text between the start and end markers, so user content around the block doesn't count. It also ignores the two values that differ per install: the
_PINNEDinterpreter path and theGRAPHIFY_VIZ_NODE_LIMITexport.statusalready checks the viz limit against.graphifyrcseparately. The refresh itself needed no change, becausehook installalready rewrites an existing block in place.Type of change
Verification & Invariants
Invariant:
hook statussays plaininstalledonly when the installed graphify block is the one the current release would write, apart from its per-install values.Limitations:
graphify hook install. Refreshing automatically (for example from the hook itself) would be a bigger change, so I left it for you to decide.init.templateDirtemplate are checked once they are in a repo, but the template itself is not checked or updated.hook installcan't rewrite those in place either.How was this tested?
test_status_flags_a_hook_block_from_an_older_graphifyis the regression test. The other two guard against false positives: a different pinned interpreter, and user lines outside the graphify block, must still reportinstalled. They pass both before and after.I also installed hooks with the real 0.9.25
hooks.pyinto a scratch repo, then ranstatusandinstallfrom this branch. The output is shown above.Graphify-specific checklist
uv run python -m tools.skillgen --bless) when changing their source fragments.Note: I used Claude Code while working on this fix. I reviewed and ran all of it myself.