Repository navigation
Conversation
…raphify-Labs#5563) Surgical resubmission of Graphify-Labs#5592 layered directly on Graphify-Labs#5589 cross-library sibling-sourced resolution and Graphify-Labs#5597 variable tracking. - Tracks caller assignments in source order at program level - Propagates caller-defined variable bases across sourcing chains - Fails closed on UNC, out-of-root, cycles, and multi-caller conflicts - Supersedes local fallback decoy edges Fixes Graphify-Labs#5563
|
Thanks for the pull request, @m3lonxd. 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 review 
10 possible issues to check · High impact
The Bash extractor now tracks variable assignments in source order and records variable-based source paths for cross-file resolution.
10 possible issues we couldn't confirm
- Variable-source resolution can stay ambiguous after a loader's base changes, because collected candidate bases are never reset between passe ·
graphify/symbol_resolution.py:676 - A
sourceinside a function can bind to a variable path assigned later in the file ·graphify/extractors/bash.py:729 - Variables assigned or unset inside if blocks, loops or functions are not tracked, so the recorded base can be stale ·
graphify/extractors/bash.py:693 - +7 more in Graphify
They don't change the score.
What this review covered
- Some lookups asked for files or lines that do not exist; the review was told and carried on.
- 5 of 5 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 4139 functions depend on this change
- 4 functions became more coupled. Largest:
extract()(1429 callers),extract_bash()(62 callers),resolve_bash_source_edges()(18 callers). - 3 of 658 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed cb00f8a
Extractor accuracy (Swift #5641, Apex #5627, Python #5647, TypeScript #5604/#5614/#5612, Bash caller-var #5602), GitHub Actions run-step extraction (#5603), incremental correctness (#5634/#5638/#5636), symlink and semantic-cache fixes (#5617/#5618), export/report hardening and perf (#5643/#5644/#5645/#5646/#5619/#5620/#5621), and CLI/docs/skill/install work (#5629/#5628/#5626/#5624/#5623/#5625/#5642/#5583). AST cache schema 59 to 60; Swift/Apex/Python/Bash/GHA inputs re-extract on first build. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in v0.9.124 (just released to PyPI), cherry-picked with your authorship preserved so it shows under your name in the history. Thanks @m3lonxd for resolving caller-defined variable bases in sourced scripts — verified green in the full suite and, where applicable, smoke-tested against the published package. 🙏 |
Summary
Fixes #5563.
This is the surgical follow-up to #5592 requested by @safishamsi, rebased and layered directly on top of #5589 (cross-library sibling-sourced resolution) and #5597 (single-script variable tracking) in
v0.9.123.Rather than the earlier ~1500-line rewrite, this PR adds ONLY the distinct missing capability for caller-defined variable bases in sourced scripts (
. "$VAR/rel.sh"/source "$VAR/rel.sh"):sourcelines do not leak backward.entry.sh -> bootstrap.sh -> lib/x.sh) using bounded fixed-point propagation.Nonepoison sentinel) fail closed with 0 false edges.scan_rootat both extraction and resolution stages.graphify/cache.pycompletely untouched (0 diff lines), preserving AST cache schema 59.Testing & Verification
tests/test_symbol_resolution.py,tests/test_unc_probe_guard.py,tests/test_extract.py -k "bash or unc or 5563").ruff check ., cleanbandit -ll, and 100%python -m tools.skillgen --checkaudit compliance.