Skip to content

fix(skill): find the uv-installed interpreter without uv tool run (#5182) - #5259

Open
nothariharan wants to merge 1 commit into
Graphify-Labs:v8from
nothariharan:fix/5182-skill-interpreter-pin
Open

nothariharan wants to merge 1 commit into
Graphify-Labs:v8from
nothariharan:fix/5182-skill-interpreter-pin

Conversation

@nothariharan

Copy link
Copy Markdown
Contributor

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 python first, whenever uv was 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 to graphify-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, or graphifyy/Scripts/python.exe on Windows) and checks graphify is importable there (a find_spec check, 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 and python3 checks, 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 and expected/ are regenerated, and the monolith roundtrip gets a predicate for the changed lines.

How it was verified

  • tests/test_skill_uv_interpreter_probe.py runs the real Step 1 block from the generated skills against stub uv, graphify and python executables:

    • pip install + uv on PATH: the pip interpreter is saved, and uv tool run / uv tool install never run;
    • uv tool install (both bin/ and Windows Scripts/ layouts, with and without a launcher): the uv tool interpreter is saved without uv tool run;
    • no generated POSIX skill contains 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 empty UV_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), graphify launcher (none / pip / uv tool) and python3 (absent / without graphify / with graphify), 48 states. On v8, uv tool run executes 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 .; pyright on the changed Python files; pytest tests/test_skill*.py tests/test_skillgen*.py tests/test_install.py tests/test_code_only_update_all_hosts.py on Windows (549 passed; the 2 aider/devin failures in test_code_only_update_all_hosts.py fail the same way on v8 without this change).

Not changed

The other points in #5182 are left as they are. The rm -f lines delete only the pipeline's own temp files under graphify-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 fallback uv tool install / pip install graphifyy still 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.

…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.
@github-actions github-actions Bot added the contributor Pull request from a returning community contributor label Nov 16, 2026
@github-actions

Copy link
Copy Markdown

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.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-safety
  • tests/test_4874_jvm_resolution.py — full-run-safety
  • tests/test_4909_reference_binding_scale.py — full-run-safety
  • tests/test_4978_reconcile_cost.py — full-run-safety
  • tests/test_4992_ts_import_types.py — full-run-safety
  • tests/test_5072_splittable_under_cap_retry.py — full-run-safety
  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_defines.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_affected_overrides.py — full-run-safety
  • tests/test_affected_path_file_node.py — full-run-safety
  • tests/test_affected_seed_reference_forms.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_alias_folding.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_backend_opt_in.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_benchmark_real_query.py — full-run-safety
  • tests/test_binary_media_words.py — full-run-safety
  • tests/test_blade_extractor.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_located_semantic_identity.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_ghost_fold_4955.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_c_include_resolution.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_cache_long_paths.py — full-run-safety
  • tests/test_cache_stale_import_target.py — full-run-safety
  • tests/test_cache_windows_case_4925.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_only_decl_ids_4904.py — full-run-safety
  • tests/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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor Pull request from a returning community contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant