Reconcile graph lifecycle changes safely - #735
Closed
marlon-costa-dc wants to merge 5 commits into
Closed
Conversation
tirth8205
added a commit
that referenced
this pull request
Jul 27, 2026
fix(watch): reconcile graph lifecycle changes safely (#735)
Owner
|
Validated and incorporated through #758, merged as 38e2b31. All five Marlon Costa contributor commits are preserved in the integration history. The corrected version also preserves live untracked graph files and fails closed on incomplete updates and startup post-processing errors. Validation passed 399 focused tests, real process-pool parity, Ruff, diff checks, a full graph/post-process build, CodeQL, Python 3.10–3.13, and Windows. Closing this original PR because its corrected form is now on main. |
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
Runtime motivation
Watch mode previously missed offline and directory lifecycle changes, used one Timer per event, and swallowed callback failures. That could leave stale graph data or keep a failed watcher alive under systemd.
Validation
_create_watch_handlerdid not existUV_PROJECT_ENVIRONMENT=.venv-crg uv run pytest tests/test_graph.py tests/test_incremental.py tests/test_postprocessing.py --tb=short -q: 153 passedUV_PROJECT_ENVIRONMENT=.venv-crg uv run pytest tests/ --tb=short -q: 1972 passed, 3 unrelated pre-existing failures, 5 skipped, 2 xpassedUV_PROJECT_ENVIRONMENT=.venv-crg uv run ruff check code_review_graph/graph.py code_review_graph/incremental.py tests/test_graph.py tests/test_incremental.py: passedcode_review_graph/embeddings.pystatus --jsonhad one Python file, then Ctrl-C producedWatch stopped.and fixture teardown completedNon-overlap
This PR does not overlap #686, #729, or #694: it is limited to graph-store permanent deletion semantics and watch lifecycle reconciliation/debounce/fail-closed behavior. It deliberately excludes fork hot-path optimizations and BLAS/OpenMP environment tuning.