Incremental updates leave import edges stale after files are added or removed #1

Closed
opened 2026-09-04 07:52:01 +02:00 by nami-ai · 1 comment
Collaborator

index update discovers and hashes all files but only reprocesses files whose content hash changed (src/index/pipeline.rs:59-79). Import resolution is then performed only for that changed set (src/index/pipeline.rs:110-132). Adding, deleting, or renaming a file can change whether an unchanged importer resolves, but that importer is never re-resolved.

Reproduction:

  1. Create a.py containing import c, with no c.py.
  2. Run index create.
  3. Add c.py.
  4. Run index update.
  5. find importers c.py returns []; a full index create finds a.py.

Please re-resolve affected importers when the file set changes, or fall back to rebuilding the import graph while retaining the content-hash optimization for symbols and file content.

`index update` discovers and hashes all files but only reprocesses files whose content hash changed (`src/index/pipeline.rs:59-79`). Import resolution is then performed only for that `changed` set (`src/index/pipeline.rs:110-132`). Adding, deleting, or renaming a file can change whether an unchanged importer resolves, but that importer is never re-resolved. Reproduction: 1. Create `a.py` containing `import c`, with no `c.py`. 2. Run `index create`. 3. Add `c.py`. 4. Run `index update`. 5. `find importers c.py` returns `[]`; a full `index create` finds `a.py`. Please re-resolve affected importers when the file set changes, or fall back to rebuilding the import graph while retaining the content-hash optimization for symbols and file content.
Owner

Fixed in commit 4338e28.

Fixed in commit 4338e28.
Sign in to join this conversation.
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: endergebnis/rustytokens#1