Skip to content

fix(index): re-extract unchanged files after an extractor change - #804

Merged
ajianaz merged 1 commit into
developfrom
fix/extractor-version-fingerprint
Nov 17, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/extractor-version-fingerprint

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

The fingerprint cora index stores per file, and compares to decide whether to skip it, is now v{EXTRACTOR_VERSION}:{mtime}:{size} instead of {mtime}:{size}. EXTRACTOR_VERSION (1 for now, in src/index/mod.rs) is bumped whenever an extractor starts to record symbols or edges it did not record before, or stops recording wrong ones.

Why

A file whose mtime:size matched was skipped, whatever extractor wrote its symbols, so an upgrade that improves an extractor never reached the files that had not changed until someone ran cora index --rebuild. This was measured: with a new extractor in place, cora dead-code on this repository reported the same 43 symbols before and after. Two extractor fixes (Ruby nesting in #801, function references and serde attributes in #802) depend on it. After this change the first cora index after such an upgrade re-extracts every file once (about 0.5 s for this repository) and later runs skip unchanged files as before. Closes #803.

Testing

  • Two tests first, red before: the stored fingerprint of a fresh index carries the extractor version; an index whose fingerprints are in the old mtime:size form is fully re-extracted on the next run and skipped on the one after.
  • Nothing else computes an index fingerprint (the other fingerprint uses are review de-duplication and the commit gate).
  • cargo test --features tree-sitter: 1549 passed, 0 failed; cargo fmt --all -- --check and clippy with -D warnings clean; Cora review of the staged diff: no findings.

@ajianaz
ajianaz merged commit 7755bb1 into develop Nov 17, 2026
16 checks passed
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.

fix(index): re-extract unchanged files after an extractor change (stale edges and symbols after an upgrade)

1 participant