Repository navigation
Conversation
Use the trigram index built for the current CLI invocation to skip terms that cannot contribute to literal scoring. Keep the original coverage denominator, whole-question scoring, and behavior for imported indexes. Refs Graphify-Labs#5429 Co-Authored-By: Codex <[email protected]>
|
Thanks for the pull request, @Max17190. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify review 
4 possible issues to check · High impact
The CLI marks unseeded queries with no cached trigram index for a one-shot optimization.
4 possible issues we couldn't confirm
- A persisted search index that is present but missing postings for the loaded rows still disables the one-shot query flag ·
graphify/cli.py:2296 - Skipping absent terms can drop source-file, rationale and attribute matches that the trigram index may not cover ·
graphify/serve.py:814 - New CLI test node omits community and location attributes that other query fixtures set, so it may fail on an unrelated missing-key error ·
tests/test_query_cli.py:61 - +1 more in Graphify
They don't change the score.
What this review covered
- Some lookups asked for files or lines that do not exist; the review was told and carried on.
- 4 of 4 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 1203 functions depend on this change
- 2 functions became more coupled.
main()(130 callers),_score_query()(26 callers). - 66 of 620 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 4f8f74d · Full report in the Graphify check
…batch Fold the Python-lambda (#5417), Go-import-shadow (#5411) and COBOL GO-TO (#5423) AST-output changes into one combined _AST_CACHE_SCHEMA bump 53 -> 54, so cached Python/Go/COBOL extractions re-run. Fix the #5422 regression test's cwd-fragile `query` assertion to check the queried node (returncode==0 is the real invariant). 0.9.119 changelog and version bump. The headline is the #5320 anyio regression fix (graph commands broke on core installs in 0.9.118). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in v0.9.119 via an authorship-preserving cherry-pick. A CLI full-graph scan now skips query terms that are provably absent (no trigram present), so a long question stops wasting time on terms that can match nothing; results are byte-identical. Thanks @Max17190! |
Why
When the trigram guard selects a full scan, the CLI scores every term against every node, including terms whose trigrams are missing. Fixes #5429.
Summary
Related work includes the trigram prefilter in #1431 and the opt-in SQLite snapshot in #5383.
Evidence
Five alternating fresh CLI pairs per workload on Apple M5, CPython 3.13.9, v8 at
013a6461. Each pair matched stdout, stderr, and exit status.The long misses are controlled stress cases. Ordinary-query ranges overlap. This optimization applies to full scans where the index rules out terms.
Test Plan
uv run --frozen pytest tests -q --tb=short(11,888 passed before a test-only edit)uv run --frozen pytest -q tests/test_query_cli.py tests/test_serve.pyuv run --frozen ruff check .uv run --frozen pyright(same 772 upstream diagnostics)uv run --frozen graphify update .The focused query suite passed on Python 3.11, 3.12, 3.13 and 3.14 on macOS, with 310 tests per version.
The seven hosted watcher failures under
/dev/shmalso occur on the exact upstreamv8base.