Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Dereferencing symlinked source paths changes source-relative include lookup and can drop valid dependency edges.
1 open issue
What changed in this PR
This PR restores internal dependency edges when tree-sitter scans receive project-relative file paths, preserving caller-provided graph keys for downstream analysis.
Changes:
- Canonicalizes paths when matching resolved imports to scanned files.
- Passes absolute source paths to import resolvers.
- Adds regression coverage for relative and absolute file lists with project-root and nested scans.
| File | Description |
|---|---|
desloppify/tests/lang/common/test_treesitter_relative_graph.py |
Tests graph keys, dependency edges, and counts across four path combinations. |
desloppify/languages/_framework/treesitter/imports/graph.py |
Normalizes import matching while retaining original graph keys. |
Review effort: Balanced
|
|
||
| resolved = spec.resolve_import(import_text, filepath, scan_path) | ||
| resolved = spec.resolve_import( | ||
| import_text, str(Path(filepath).resolve()), scan_path |
github-actions Bot
added a commit
to citizenadam/desloppify
that referenced
this pull request
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Tree-sitter dependency graphs drop every internal edge when a file finder returns project-relative paths. A JavaScript scan therefore reports imported modules as orphaned and loses coverage propagation: the same nine-module project had zero edges before this fix and 27 afterward.
Canonicalize file paths for matching while preserving the caller's graph keys and edge representation. Pass an absolute source path to import resolvers so scans rooted in a subdirectory do not duplicate the relative path prefix. Regression tests cover relative and absolute file lists with both project-root and nested scan paths.
Validation: 13 focused import tests pass; Ruff and diff checks pass. The full
desloppify/tests/suite reports 5,812 passed, 5 skipped, and two existing failures of the shared review dry-run prompt assertion (Previously flagged issues); the same assertion fails with the original graph module restored. Tested using Python 3.12 and tree-sitter-language-pack 1.6.2. Verified the corrected graph against the original JavaScript project.