Skip to content

fix(indexer): preserve shared modules during file updates - #1429

Merged
Shashankss1205 merged 1 commit into
CodeGraphContext:mainfrom
lntutor:fix/module-reindex-1392
Jul 31, 2026
Merged

Shashankss1205 merged 1 commit into
CodeGraphContext:mainfrom
lntutor:fix/module-reindex-1392

Conversation

@lntutor

@lntutor lntutor commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve shared Module nodes when an owning file is removed during incremental indexing
  • purge modules only after their file containment edge is removed, so live IMPORTS/INCLUDES edges survive
  • add a Kùzu regression test covering two files that include a module from a re-indexed file

Verification

  • PYTHONPATH=src uv run pytest tests/unit/tools/test_kuzu_import_indexing.py tests/unit/tools/test_writer_path_normalization.py -q
  • PYTHONPATH=src uv run pytest tests/unit/tools -q
  • PYTHONPATH=src uv run bash tests/run_tests.sh fast (805 passed; 1 existing unrelated CLI inventory failure: prompt subcommands missing from its command matrix)
  • uv run ruff check --ignore F841 src/codegraphcontext/tools/indexing/persistence/writer.py tests/unit/tools/test_kuzu_import_indexing.py

Fixes #1392

Assisted-by: Codex

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Shashankss1205 Shashankss1205 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and verified locally: merged onto current main, kuzu import indexing tests green. Nice catch on shared Module nodes being destroyed by single-file updates.

@Shashankss1205
Shashankss1205 merged commit 4966815 into CodeGraphContext:main Jul 31, 2026
1 check failed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Jul 31, 2026
@Shashankss1205

Copy link
Copy Markdown
Collaborator

Thanks @lntutor for this contribution — merged! 🎉 Your whole series of fixes has been fantastic. We'd love to see you keep contributing — plenty of open issues with your name on them!

@Shashankss1205 Shashankss1205 added gssoc:approved GSSoC validation: counts toward scoring level:advanced GSSoC difficulty: 55 pts contributor / 30 mentor mentor:Shashankss1205 GSSoC mentor attribution: credits reviewing mentor quality:exceptional GSSoC quality: x1.5 contributor / +10 mentor type:bug GSSoC type bonus: bug labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC validation: counts toward scoring level:advanced GSSoC difficulty: 55 pts contributor / 30 mentor mentor:Shashankss1205 GSSoC mentor attribution: credits reviewing mentor quality:exceptional GSSoC quality: x1.5 contributor / +10 mentor type:bug GSSoC type bonus: bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug(indexer): Updating one file destroys globally-shared Module nodes and other files' edges

2 participants