Skip to content

refactor: hash-based change detection, file-based metadata evaluation - #1

Open
jdbadger wants to merge 1 commit into
mainfrom
change_detection_and_metadata_eval
Open

refactor: hash-based change detection, file-based metadata evaluation#1
jdbadger wants to merge 1 commit into
mainfrom
change_detection_and_metadata_eval

Conversation

@jdbadger

Copy link
Copy Markdown
Owner
  • Adds cache.CacheManager, integrates in Repo.cache
  • Add build_hashmap(), get_hashmap(), set_hashmap() methods to Repo
  • Move is_stale from RepoMetadata to Repo as computed property
  • Update IndexResult: remove nodes_updated, documents_checked fields
  • Fix CLI/MCP to use correct field names (nodes/documents vs nodes_indexed/documents_indexed)
  • Update all tests to match new API signatures
  • Add comprehensive docstrings for new methods
  • Update README programmatic usage example

@jdbadger jdbadger self-assigned this Jan 31, 2026
@jdbadger
jdbadger force-pushed the change_detection_and_metadata_eval branch from c063375 to ded6057 Compare February 6, 2026 18:02
Replace store-based change detection with a local file cache for
incremental indexing. Document hashes are now persisted via CacheManager
(XDG-compliant cache dir) instead of scrolling the Qdrant collection,
enabling faster hash comparison and eliminating expensive store queries
during index operations.

Key changes:
- Add CacheManager for per-repo hashmap caching (path → hash)
- Move document hash from DocumentMetadata to a computed property on
  Document, decoupling walker metadata from content hashing
- Replace store.get_document_hashes/count_nodes with cache-based
  hashmap diffing (_get_hashes_to_add/_get_hashes_to_delete)
- Switch store deletion from document_path to document_hash filtering
  (delete_by_hashes replaces delete_by_document_paths)
- Simplify Repo.get_one/get_all by removing store and with_metadata
  params; metadata is now evaluated from file state and cache
- Add Repo.is_stale as a computed property comparing cached vs current
  hashmaps
- Convert Walker.walk from async generator to sync generator, replace
  async file reads with synchronous reads
- Remove RepoMetadata.from_repo (no longer queries the store)
- Consolidate per-language parser tests into shared conftest fixtures
- Add new test suites for CacheManager, config, parser models, and
  walker fixtures
@jdbadger
jdbadger force-pushed the change_detection_and_metadata_eval branch from ded6057 to 5e8ad8f Compare February 7, 2026 22:44
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