Skip to content

add FileDeps dataclass, .deps.json sidecar, and determinism test (PR-T1)#265

Merged
HumanBean17 merged 1 commit into
masterfrom
feat/tier2-pr1-foundation
Jun 6, 2026
Merged

add FileDeps dataclass, .deps.json sidecar, and determinism test (PR-T1)#265
HumanBean17 merged 1 commit into
masterfrom
feat/tier2-pr1-foundation

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Summary

  • Adds FileDeps dataclass, _build_file_deps, _write_dependency_index, _read_dependency_index, and DepsIndex to build_ast_graph.py
  • Every full rebuild now writes a .deps.json sidecar alongside the Kuzu database containing per-file dependency metadata for closure expansion in subsequent incremental runs
  • 5 new tests in tests/test_incremental_equivalence.py: determinism, deps-json written/validated/coverage/stale/missing

Implements

PR-T1 of plans/active/PLAN-TIER2-INCREMENTAL-REBUILD.md

Manual evidence

.venv/bin/ruff check .
# All checks passed

.venv/bin/python -m pytest tests/test_incremental_equivalence.py -v
# 5 passed

.venv/bin/python -m pytest tests -v
# 625 passed, 9 skipped

Design notes

  • .deps.json uses atomic write-temp-rename for safety
  • ext_hash uses sha256: prefix matching proposal §2.4 format
  • _read_dependency_index returns None on any corrupt/stale/missing file (broad except Exception after version validation)
  • _write_dependency_index is called after conn.close() in write_kuzu — the sidecar doesn't need a DB connection
  • test_perf_baseline_full_rebuild deferred (informational per plan)

🤖 Generated with Claude Code

Foundation for incremental Kuzu rebuild (Tier 2 plan). Every full rebuild
now writes a .deps.json sidecar alongside the Kuzu database containing
per-file dependency metadata (declared types, injects, extends, calls,
annotation usage, overrides, clients, producers) for closure expansion
in subsequent incremental runs.

Adds FileDeps dataclass, _build_file_deps, _write_dependency_index,
_read_dependency_index, DepsIndex. Wires into write_kuzu after _write_meta.
5 tests: determinism, deps-json written/validated/coverage/stale/missing.

Implements PR-T1 of plans/active/PLAN-TIER2-INCREMENTAL-REBUILD.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit de371f6 into master Jun 6, 2026
1 check 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.

1 participant