Skip to content

Commit b461c90

Browse files
HumanBean17claude
andauthored
fix: create .graph_hashes.json after init/reprocess so first increment is fast (#298)
Move _init_hash_tracker() call into write_kuzu() so that init and reprocess commands persist file hashes alongside the graph. Previously the first increment after init/reprocess treated all files as new, causing an unnecessary full rebuild. Closes #297 Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 673d062 commit b461c90

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

build_ast_graph.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,12 +3422,10 @@ def incremental_rebuild(
34223422
pass6_match_edges(tables, verbose=verbose)
34233423
write_kuzu(kuzu_path, tables, source_root=source_root, verbose=verbose)
34243424

3425-
n_files = _init_hash_tracker(source_root, kuzu_path)
3426-
34273425
return IncrementalResult(
34283426
mode="full_fallback",
34293427
files_changed=0,
3430-
files_added=n_files,
3428+
files_added=0,
34313429
files_removed=0,
34323430
dependents_reprocessed=0,
34333431
elapsed_sec=time.time() - t_start,
@@ -3648,12 +3646,10 @@ def _fallback_to_full(source_root: Path, kuzu_path: Path, verbose: bool, t_start
36483646
pass6_match_edges(tables, verbose=verbose)
36493647
write_kuzu(kuzu_path, tables, source_root=source_root, verbose=verbose)
36503648

3651-
n_files = _init_hash_tracker(source_root, kuzu_path)
3652-
36533649
return IncrementalResult(
36543650
mode="full_fallback",
36553651
files_changed=0,
3656-
files_added=n_files,
3652+
files_added=0,
36573653
files_removed=0,
36583654
dependents_reprocessed=0,
36593655
elapsed_sec=time.time() - t_start,
@@ -3785,6 +3781,7 @@ def write_kuzu(
37853781
_verbose_stderr_line(f"[graph] writing · routes/exposes written in {time.time() - t2:.2f}s")
37863782
_write_meta(conn, tables, source_root)
37873783
conn.close()
3784+
_init_hash_tracker(source_root, db_path)
37883785

37893786

37903787
# ---------- CLI ----------

0 commit comments

Comments
 (0)