Skip to content

[Bug]: incremental update drops an importer's edge to a deleted file instead of leaving the unresolved-import placeholder #5633

In progress

Description

@0xkaushik-ai

Pre-flight checks

  • I have checked the Troubleshooting section in the README

What happened?

After deleting a file that an unchanged file imports, an incremental rebuild drops the importer's edges into it, because they dangle. A full build of the same tree keeps the broken import visible: an unresolved-import placeholder node and the importer's edge to it.

Seen in Python, TypeScript (also through an export * barrel) and C. Related to #5544, which is the same loss for import() on the graphify extract path.

Steps to reproduce

mkdir p && cd p
printf 'def f():\n    return 1\n' > a.py
printf 'from a import f\n\ndef g():\n    return f()\n' > b.py
graphify update .
rm a.py
graphify update .

Then compare with a fresh graphify update . of the same tree.

Error output or graph output

nodes, update:     b, b_g
nodes, full build: a, b, b_g
only in full build: b -> a  imports_from

TypeScript: deleting m.ts imported by n.ts loses ref_m and n -> ref_m.
Barrel: deleting lib/x.ts behind lib/index.ts (export * from './x') loses lib_index -> ref_x, the unresolved_reexport_* node and app -> lib_index_x.
C: deleting foo.h loses main -> foo (imports).

Graphify version

0.9.123 (v8 5d962d2d)

Operating System

Linux

Python Version

3.12.13

Installation Method

From source (uv sync --all-extras on v8)

Activity

  1. github-actions commented on Nov 29, 2026

    @github-actions

    Thanks for opening this issue, @0xkaushik-ai. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. Aadithya-kl commented on Nov 29, 2026

    @Aadithya-kl
    Contributor

    Opened a PR for this: #5638

  3. 0xkaushik-ai commented on Nov 30, 2026

    @0xkaushik-ai
    ContributorAuthor

    For reference, #5635 (opened earlier, linked with "Fixes #5633") already covers this one: it re-extracts the unchanged importers of a deleted file so they keep the unresolved-import placeholder a full build has, on both update and extract. It also handles the reverse case from #5631 (adding a file an unchanged importer was waiting on), with 8 regression tests comparing each incremental build against a full build.

    Happy for the maintainers to pick whichever approach fits best. @Aadithya-kl, thanks for jumping on it too; if anything in #5638 covers a case #5635 misses, I'd be glad to fold it in.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions