add incremental rebuild orchestrator (PR-T3)#272
Merged
Conversation
7ad9acc to
29fe5dd
Compare
Implements build_ast_graph_incremental() which re-processes only changed files and their dependency closure, falling back to full rebuild when deps.json is missing, ontology is stale, or dirty set exceeds 50%. Key additions: - expand_to_closure: 8-rule fixed-point expansion using inverted .deps.json - pass1-5 subset variants for partial re-processing - _load_remaining_from_db + _merge_tables for pass6 global rerun - _write_nodes_incremental with duplicate-PK avoidance - _write_meta_incremental querying live DB for global stats - --changed-paths CLI flag and last_rebuild_mode GraphMeta field - 22 tests: equivalence, fallback, closure, deps merge, pass6 invariant, meta stats, CLI Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
29fe5dd to
87dd1bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build_ast_graph_incremental()— the core orchestrator for incremental Kuzu graph rebuild (PR-T3 fromplans/active/PLAN-TIER2-INCREMENTAL-REBUILD.md).deps.jsonmaps, deletes old data via symmetric delete helpers (PR-T2), re-runs pass1-5 on dirty subset only, loads remaining non-dirty data from DB, merges, runs pass6 globally, writes incremental data with duplicate-PK avoidance, rewrites all HTTP_CALLS/ASYNC_CALLS fresh.deps.jsonmissing, ontology stale, or dirty set >50%--changed-pathsCLI flag andlast_rebuild_modeGraphMeta fieldCode review fixes (post-implementation)
.deps.jsonoverwrite bug: Was writing only dirty-file entries (viapartial), losing all non-dirty deps. Extracted_write_dependency_index_data()to write the properly merged index.DECLARES_PRODUCERload:_load_remaining_from_dbwas loadingDECLARES_CLIENTbut notDECLARES_PRODUCER, creating asymmetry in merged data. Added load + merge.Manual evidence
Out of scope (do NOT touch)
incrementcommand) — future PRserver.py,kuzu_queries.py,search_lancedb.py— untouchedjava_ontology.py— untouched🤖 Generated with Claude Code