Repository navigation
fix: repair stale FTS on no-op updates - #1105
4 commits merged into
Conversation
|
Thanks for working on #1104! The fix looks promising, but I noticed two potential regressions: 1. Changing The existing opt-in test 2. Partial parse failures may restore an incorrect When Could we preserve the distinction between needing a full rebuild and having incomplete derived state, and add regression coverage for partial parse failures? Thanks again for the contribution! |
|
Thanks for catching these. I checked the current code and confirm both are still open:
This PR is not ready to treat either case as fixed. The correction should keep the user-visible pending state distinct from “needs a full source rebuild,” and keep derived-data state pending after partial parse failures. |
|
Thank you for this PR. I tested killed builds, Before I can merge it, please fix these:
After you push the fix, I will test it again. |
- incremental update that re-parses files reports the skip, including a repo path with spaces and non-ASCII characters - repeated build/update requests report every time and never create the embeddings table - no-change update reports the skip at postprocess none/minimal/full (guards the tirth8205#1105 no-op rewrite in tools/build.py) - interrupted-build repair reports the skip - postprocess with an empty embeddings table keeps status ok - skip, then embed, then refresh reports embeddings_refreshed and no notice - has_embeddings: no table, empty table, current and legacy rows - legacy index without provider identity fails the refresh and stops watch; an empty legacy table is a skip - watch exempts only the exact notice (duplicates ok; half-pair, altered text still fail); None/non-dict results are ignored - real MCP tools and CLI build/update/postprocess/--quiet report the notice, exit cleanly and never resolve a provider Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… into pr/code-review-graph-1104 # Conflicts: # code_review_graph/tools/build.py
code-review-graph reviewOverall risk: 0.70 (HIGH) — 7 changed function(s)/class(es), 3 affected flow(s), 1 test gap(s) (0 with no tested caller found, 1 reached only through a caller) Risk-scored changes
Affected execution flows
Reached only through a callerNo test names these directly, but a tested caller reaches them along the call path shown. That is a path in the call graph, not a record of execution -- the caller's tests may never take this branch. Treat it as where to look, not as coverage: these count as gaps and are scored as untested.
Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
|
Thanks for the detailed report. The current head
I reran the three targeted freshness regressions (3 passed) and both opt-in interruption and recovery tests (2 passed). The required Please take another look at this head when convenient. |
There was a problem hiding this comment.
🟡 Changes recommended
Pending-state recovery can skip unfinished language resolvers and mark the graph complete despite missing cross-file relationships.
3 open issues
What changed in this PR
This PR addresses #1104 by preserving pending derived-data state when post-processing is skipped and enabling later updates to repair stale full-text search (FTS) data without rebuilding source files.
Changes:
- Keep skipped post-processing visibly pending.
- Reconcile FTS drift on no-op updates, including older graphs marked complete.
- Add regression coverage for pending-state recovery, derived-data repair, and incomplete status reporting.
| File | Description |
|---|---|
| tests/test_freshness_metadata.py | Adds regression tests for FTS repair and pending-state handling. |
| code_review_graph/tools/build.py | Updates recovery, no-op reconciliation, and build-state transitions. |
Review effort: Balanced
| # but only rebuild source files when storage itself was interrupted. | ||
| interrupted = build_was_interrupted(store) | ||
| if interrupted and not full_rebuild: | ||
| if not graph_contents_are_complete(read_build_state(store)) and not full_rebuild: |
| warnings = _run_postprocess( | ||
| store, | ||
| build_result, | ||
| postprocess_level, |
| warnings = _run_postprocess( | ||
| store, | ||
| build_result, | ||
| postprocess_level, | ||
| full_rebuild=False, | ||
| changed_files=None, | ||
| repo_root=str(root), | ||
| ) | ||
| if warnings: | ||
| build_result["warnings"] = warnings | ||
| if build_result.get("postprocess_failed"): | ||
| build_result["status"] = "partial" | ||
| if not build_result.get("postprocess_contended"): | ||
| store.set_metadata(BUILD_STATE_KEY, BUILD_COMPLETE) | ||
| if embedding_provider and embedding_model: |
0160eb0
…view of tirth8205#1105) A no-op update on a complete graph now checks FTS only, and does not rewrite every edge. A pending no-op update forwards the embedding refresh. full_build runs its language resolvers before it records postprocess-pending, so a build stopped there gets a full rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # code_review_graph/tools/build.py
Ruby methods always carry their full lexical scope (tirth8205#933), so the leaf collision index from tirth8205#1087 now covers Python only, and the docs and tests say so. Generators are not component wrappers' functions (tirth8205#972 with tirth8205#1131). Partial graph coverage counts tracked files only (tirth8205#881 with tirth8205#1094). A pending marker recomputes all derived data (tirth8205#1105), so that test starts from a finished graph, the deleted-seed case now passes (tirth8205#1062 with tirth8205#673), and hooks.json keeps its events under a hooks key (tirth8205#1102 with tirth8205#1126). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Linked issue
Closes #1104
What & why
build_stateaspostprocess-pendingwhen an update skips post-processing.that incorrectly kept the
completemarker.How it was tested
uv run ruff check code_review_graph/— passed.uv run pytest tests/ --tb=short -q— 4,270 passed, 850 skipped, 2 xfailed, 2 xpassed.Used watchdog's KqueueObserver because native FSEvents segfaulted on this macOS host.
Checklist
uv run pytest tests/ --tb=short -quv run ruff check code_review_graph/uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optionaldocs/, docstrings)