fix(context): report unready graphs - #755
Conversation
Resolve graph paths without filesystem side effects before serving minimal context, and distinguish missing, empty, and commit-stale graphs with actionable responses.
code-review-graph reviewOverall risk: 0.60 (MEDIUM) — 17 changed function(s)/class(es), 0 affected flow(s), 5 test gap(s) Risk-scored changes
Test gaps
Token savings: this graph-backed report used ~57,144 fewer tokens (~95%) than reading every changed file in full (estimated, chars/4 approximation). Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
|
After refreshing onto current |
Linked issue
Closes #734
What & why
get_minimal_context_toolopenedGraphStorebefore checking graph readiness. In acold worktree, that created an empty database and returned
status: ok, which couldmake an agent trust analysis that contained no graph data.
This change resolves graph paths without filesystem side effects before opening the
store and returns an actionable
not_readyresponse for missing, empty, orcommit-stale graphs. The normal build path keeps its existing directory creation and
legacy migration behavior.
Regression coverage includes linked worktrees, default and external data directories,
registry overrides, legacy databases and sidecars, empty graphs, and stale build SHAs.
How it was tested
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)