Skip to content

fix: preserve dependency edges for relative tree-sitter file paths - #781

Open
daBOB wants to merge 1 commit into
peteromallet:mainfrom
daBOB:fix/tree-sitter-graph-path-normalization
Open

daBOB wants to merge 1 commit into
peteromallet:mainfrom
daBOB:fix/tree-sitter-graph-path-normalization

Conversation

@daBOB

@daBOB daBOB commented Sep 24, 2026

Copy link
Copy Markdown

The shared tree-sitter dependency builder drops valid imports when discovered file keys are project-relative: it normalizes resolver output to absolute paths and compares those against the original relative key set. Normalize membership lookups while preserving the caller-visible graph keys, including the existing scan-relative resolver fallback.

This addresses the path-normalization portion of #715. CommonJS query expansion is outside this change.

Validation:

  • Six real-parser regressions cover relative, dotted, absolute and mixed JavaScript keys, the generic file-discovery integration, Kotlin absolute resolver output, and exclusion of an existing file outside the scanned set. Before the fix: five failed, one passed. After: all six pass.
  • Shared-language and JavaScript suites: 512 passed, 2 skipped. Scoped Ruff and formatting checks pass.
  • Full desloppify/tests/: 5814 passed, 5 skipped, 2 failed. Both failures are the existing TestCmdReviewPrepare::test_do_run_batches_dry_run_generates_packet_and_prompts assertion that prompts contain Previously flagged issues (unit and integration wrappers). Both reproduce on pristine upstream HEAD 3a7735d without this patch.
  • Read-only validation against 52 authored browser modules restores 126 static import edges and 51 imported modules, previously zero. An Android multi-module tree still has no resolved edges due to the separate Kotlin resolver source-root limitation; this change does not claim to repair that resolver.

No suppressions, score changes, or language-query changes.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant