Repository navigation
Conversation
…bs#4440) graph_stats asks git for HEAD to report staleness. The child inherited the MCP stdio pipe, and on Windows git blocks on it: the call sat on the 3s timeout, or hung under Claude Code. prs.py already isolates stdin (Graphify-Labs#3318); these two _git_head copies were missed.
|
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.
Code graph out of date: Health delta baseline: last indexed commit e8eb76e, 18 commit(s) behind this PR's base. Impact and hotspot numbers below may be wrong.
No verdict: the code graph is out of date. Static checks found no blocking issues, but they compared against an outdated graph. The next push after the repository re-indexes gets a full review.
Not checked: tests were not run; formal verification proved 0 of 2 changed function(s) (1 sampled, not proven, 1 not verified).
Formal verification. PR-changed functions: 1/2 verified (0 proven, 1 may-equivalent, 0 distinguished) · 1 not verified (1 unsupported).
Not verified on this run: \_git\_head (unsupported).
Graphify review — findings
Fixes _git_head in both export and watch so git rev-parse HEAD runs with stdin=DEVNULL instead of inheriting the caller's stdin. Under an MCP stdio host on Windows, that inherited protocol pipe blocks git, so graph_stats no longer stalls on the 3-second timeout or hangs. A parametrized test asserts both modules pass DEVNULL.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 847 functions depend on the 144 functions this change touches.
Health — grade A; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_rebuild_code()— 177 callers, 59 callees (high)to_json()— 77 callers, 10 callees (high)to_obsidian()— 41 callers, 14 callees (high)main()— 110 callers, 3 callees (high)dispatch_command()— 2 callers, 132 callees (high)_make_graph()— 37 callers, 6 callees (high)run_pipeline()— 8 callers, 13 callees (high)to_canvas()— 20 callers, 5 callees (high)- …and 2 more
Verification — 847 functions in the blast radius were not formally verified this run (proofs are advisory here).
Health delta baseline: last indexed commit e8eb76e, 18 commit(s) behind this PR's base.
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: 600 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
53 of 413 test file(s) selected (13%) via static blast radius.
tests/test_atomic_canvas_export.py— impacttests/test_atomic_writes.py— impacttests/test_build.py— impacttests/test_cache_stale_import_target.py— impacttests/test_carried_hyperedge_remap.py— impacttests/test_cli_export.py— impacttests/test_community_labels_skill.py— impacttests/test_compact_graph_json.py— impacttests/test_confidence.py— impacttests/test_cross_extension_reexport_self_cycle.py— impacttests/test_dedup_shrink_refuses_force_write.py— impacttests/test_elixir_import_resolution.py— impacttests/test_elixir_qualified_calls.py— impacttests/test_elixir_unqualified_call_scope.py— impacttests/test_export.py— impacttests/test_export_control_characters.py— impacttests/test_export_direction.py— impacttests/test_export_idempotent_writes.py— impacttests/test_export_path_length.py— impacttests/test_external_stub_endpoints.py— impacttests/test_git_head_stdin.py— changed-testtests/test_go_qualified_resolution.py— impacttests/test_god_nodes_exclude_hubs.py— impacttests/test_hyperedge_roundtrip.py— impacttests/test_hypergraph.py— impacttests/test_incremental_unscanned_placeholders.py— impacttests/test_java_member_calls.py— impacttests/test_js_import_resolution.py— impacttests/test_kotlin_grammar.py— impacttests/test_labeling.py— impacttests/test_language_override_lifecycle.py— impacttests/test_lost_saved_semantic_nodes.py— impacttests/test_markdown_code_spans.py— impacttests/test_no_cluster_undeclared_endpoints.py— impacttests/test_obsidian_dangling_member.py— impacttests/test_obsidian_filename_cap.py— impacttests/test_obsidian_unicode_tags.py— impacttests/test_obsidian_vault_migration.py— impacttests/test_pipeline.py— impacttests/test_pr10_watch_overrides.py— impacttests/test_python_inherited_method_calls.py— impacttests/test_python_property_reads.py— impacttests/test_reflect.py— impacttests/test_rust_use_trees.py— impacttests/test_semantic_origin_stamp.py— impacttests/test_serve.py— impacttests/test_serve_http.py— impacttests/test_skill_persisted_scan_options.py— impacttests/test_terraform.py— impacttests/test_terraform_modules.py— impact- … and 3 more
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
Could not verify: Could not verify \_git\_head.
The verifier did not have enough to check \_git\_head, 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: no capturable inputs from the test suite; property tier: parameter `cwd` is annotated `'str | Path | None'` — outside the synthesizable primitive/collection set
No difference found (not proven): No behavior difference found in \_git\_head (not a proof).
The verifier ran both versions of \_git\_head 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.
Eight community PRs: Windows MCP-stdio hang (#4441), Rust use->declaration (#4443), JS/TS file-scope callback param shadowing (#4457), sibling-file-id symbol retention (#4452), TS class-field receiver scoping (#4297), Ollama /api/chat num_ctx (#4414), cluster label retention on majority overlap (#4451), and an ingest symlink test fix (#4442). AST cache schema bumped to 16. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in 0.9.91 as 9dfe132 (cherry-picked with your authorship preserved, so it shows on your contributions). Thanks @bercedev! Released to PyPI: https://pypi.org/project/graphifyy/0.9.91/ |
What does this PR do?
Fixes #4440.
graph_statsasks git forHEADso it can say whether the graph is stale._git_headrangit rev-parse HEADwithoutstdin=, so the child inherited the server's stdin, which under an MCP stdio host is the protocol pipe. On Windows git blocks on that pipe: the call sits on the 3s timeout and the staleness line loses itsHEADcomparison, or it hangs outright under Claude Code.prs.pyalready passesstdin=subprocess.DEVNULLto everygh/gitcall (#3318). The two_git_headcopies inexport.pyandwatch.pywere missed, so this adds it there.I went through the other
subprocesscalls ingraphify/.export._git_headis the only unguarded one a tool handler reaches (serve.pyimports it forgraph_stats).watch._git_headis the same function for the CLI path, so I changed it too rather than leave the two copies different.Type of change
Verification & Invariants
Invariant: a subprocess started by the server never inherits the MCP stdio pipe.
Limitation: I don't have a Windows machine, so I did not reproduce the hang. On Linux git doesn't block on that pipe. The test pins the argument, the same way
TestSubprocessStdinIsolationdoes forprs.py.How was this tested?
Linux, Python from the repo's
uv.lock.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.