Repository navigation
fix(skill): find the uv-installed interpreter without uv tool run (#5182) - #5259
nothariharan wants to merge 1 commit into
Conversation
…aphify-Labs#5182) Step 1 probed for a uv tool install with `uv tool run --from graphifyy`. When graphifyy is not a uv tool (pip, pipx or venv installs on a machine that also has uv), that builds a throwaway env from the latest PyPI release, and Step 1 saved that interpreter over the user's own install. Read the interpreter out of `uv tool dir` instead, as the PowerShell skill already does, so the probe never touches the network.
|
Thanks for the pull request, @nothariharan. 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.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify reviewed this change.
No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.
Not checked: tests were not run; no formal proof of the changed code.
Graphify review — findings
Fixes the uv interpreter probe in every generated graphify skill so it no longer falls back to uv tool run --from graphifyy, which spun up a throwaway env from the latest PyPI release when graphifyy wasn't a uv tool (#5182). A new _graphify_uv_python helper now looks up uv tool dir and uses graphifyy/bin/python (or Scripts/python.exe on Windows) only if it exists and can import graphify. If neither does, the probe falls through to the shebang/python3 detection and the uv tool install --upgrade retry reuses the same helper.
Review partial — this diff was larger than one review pass covers, so later files were not reviewed; some findings may be missing.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1133 functions depend on the 1034 functions this change touches.
Health — grade A; 7 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
render()— 16 callers, 5 callees (high)audit_coverage()— 8 callers, 6 callees (high)main()— 3 callers, 11 callees (medium)monolith_roundtrip()— 3 callers, 6 callees (medium)test_an_unreported_file_is_retried_instead_of_cached_as_complete()— 0 callers, 6 callees (medium)test_audit_catches_a_dropped_non_allowlisted_heading()— 0 callers, 6 callees (medium)test_update_preserves_undispatched_semantic_stamps()— 0 callers, 6 callees (medium)
Verification — 1133 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: 1133 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
582 of 582 test file(s) selected (100%) via static blast radius.
Escalated to a full run for safety (
noncode-change,uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.
tests/pi.test.ts— full-run-safetytests/test_4874_jvm_resolution.py— full-run-safetytests/test_4909_reference_binding_scale.py— full-run-safetytests/test_4978_reconcile_cost.py— full-run-safetytests/test_4992_ts_import_types.py— full-run-safetytests/test_5072_splittable_under_cap_retry.py— full-run-safetytests/test_affected_cli.py— full-run-safetytests/test_affected_defines.py— full-run-safetytests/test_affected_member_seed.py— full-run-safetytests/test_affected_overrides.py— full-run-safetytests/test_affected_path_file_node.py— full-run-safetytests/test_affected_seed_reference_forms.py— full-run-safetytests/test_agents_platform.py— full-run-safetytests/test_alias_folding.py— full-run-safetytests/test_analyze.py— full-run-safetytests/test_anthropic_custom_endpoint.py— full-run-safetytests/test_antigravity_install.py— full-run-safetytests/test_apm_fallback_version.py— full-run-safetytests/test_architecture_doc.py— full-run-safetytests/test_astro_extraction.py— full-run-safetytests/test_astro_import_ids.py— full-run-safetytests/test_atomic_canvas_export.py— full-run-safetytests/test_atomic_version_stamp.py— full-run-safetytests/test_atomic_writes.py— full-run-safetytests/test_backend_env_isolation.py— full-run-safetytests/test_backend_extras.py— full-run-safetytests/test_backend_opt_in.py— full-run-safetytests/test_benchmark.py— full-run-safetytests/test_benchmark_raw_graph.py— full-run-safetytests/test_benchmark_real_query.py— full-run-safetytests/test_binary_media_words.py— full-run-safetytests/test_blade_extractor.py— full-run-safetytests/test_build.py— full-run-safetytests/test_build_located_semantic_identity.py— full-run-safetytests/test_build_merge_dedup_scope.py— full-run-safetytests/test_build_merge_ghost_fold_4955.py— full-run-safetytests/test_build_merge_hyperedges_and_prune.py— full-run-safetytests/test_build_merge_shrink_guard.py— full-run-safetytests/test_builtin_global_type_refs.py— full-run-safetytests/test_c_include_resolution.py— full-run-safetytests/test_cache.py— full-run-safetytests/test_cache_long_paths.py— full-run-safetytests/test_cache_stale_import_target.py— full-run-safetytests/test_cache_windows_case_4925.py— full-run-safetytests/test_callflow_html.py— full-run-safetytests/test_cargo_introspect.py— full-run-safetytests/test_cargo_missing_manifest.py— full-run-safetytests/test_carried_hyperedge_remap.py— full-run-safetytests/test_case_only_decl_ids_4904.py— full-run-safetytests/test_case_sensitive_resolution.py— full-run-safety- … and 532 more
non-code file(s) changed (
graphify/skill-agents.md,graphify/skill-aider.md,graphify/skill-amp.md,graphify/skill-claw.md,graphify/skill-codex.md…) → running the full suite for safety (a code graph can't see config/fixture/data deps)
changed code file(s) with no mapped test (
graphify/skill-agents.md,graphify/skill-aider.md,graphify/skill-amp.md,graphify/skill-claw.md,graphify/skill-codex.md…) — a coverage gap or a missing link — running the full suite rather than only the selected tests
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.
Fixes the real part of #5182 (the unpinned
uv tool run --from graphifyy).The bug
Step 1 of every POSIX skill picked the Python interpreter by running
uv tool run --from graphifyy pythonfirst, wheneveruvwas on PATH. That only finds the user's install when graphifyy is installed as a uv tool. For a pip, pipx or venv install on a machine that also has uv, the command builds a throwaway env from the latest PyPI release instead. Step 1 then saves that interpreter tographify-out/.graphify_python, and every later step runs it in place of the version the user installed.The fix
Step 1 now reads the interpreter straight out of
uv tool dir(graphifyy/bin/python, orgraphifyy/Scripts/python.exeon Windows) and checks graphify is importable there (afind_speccheck, no full import). This is the lookup the PowerShell skill already does. It never touches the network. If graphifyy is not a uv tool, detection falls through to the existing launcher-shebang andpython3checks, as before.The change is in the three Step 1 sources (
fragments/shell/posix.md,fragments/core/aider.md,fragments/core/devin.md). The 15 generated skills andexpected/are regenerated, and the monolith roundtrip gets a predicate for the changed lines.How it was verified
tests/test_skill_uv_interpreter_probe.pyruns the real Step 1 block from the generated skills against stubuv,graphifyand python executables:uv tool run/uv tool installnever run;bin/and WindowsScripts/layouts, with and without a launcher): the uv tool interpreter is saved withoutuv tool run;uv tool run.With the fragment changes reverted, all 24 tests fail; the pip case saves the PyPI throwaway interpreter.
Against the real
uv(0.11.32) with an emptyUV_CACHE_DIR: the v8 Step 1 downloaded a fresh env and saved...\uvcache\archive-v0\...\python.exe. With this change it saved the installed graphifyy interpreter and created no uv cache.Ran Step 1 over every combination of uv on PATH, uv tool env (none /
bin/Scripts),graphifylauncher (none / pip / uv tool) andpython3(absent / without graphify / with graphify), 48 states. On v8,uv tool runexecutes in 28 of them, and in 4 an installed graphify loses to the PyPI download. With this change, neither happens in any state.python -m tools.skillgen --check,--audit-coverage,--schema-singleton,--monolith-roundtrip,--always-on-roundtrip;ruff check .;pyrighton the changed Python files;pytest tests/test_skill*.py tests/test_skillgen*.py tests/test_install.py tests/test_code_only_update_all_hosts.pyon Windows (549 passed; the 2 aider/devin failures intest_code_only_update_all_hosts.pyfail the same way on v8 without this change).Not changed
The other points in #5182 are left as they are. The
rm -flines delete only the pipeline's own temp files undergraphify-out/. The "do not ask" lines are about defaulting the path, not narrowing an existing graph, and not asking for an API key, none of which is destructive. The fallbackuv tool install/pip install graphifyystill installs the latest release: it only runs when graphify can't be imported at all, and pinning it would need the install step to stamp a version into the skill text.