Skip to content

fix(query): drop "get" filler verbs from query terms - #4686

Closed
AndresDiagoM wants to merge 1 commit into
Graphify-Labs:v8from
AndresDiagoM:fix/query-get-stopword
Closed

AndresDiagoM wants to merge 1 commit into
Graphify-Labs:v8from
AndresDiagoM:fix/query-get-stopword

Conversation

@AndresDiagoM

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #4684.

Questions such as "how does payroll.approve get authorized" keep the term get. In codebases whose
framework exports a symbol named Get (a NestJS @Get() decorator import, HTTP routers), that
symbol is a high-degree hub: the term exact-matches its label, gets _EXACT_MATCH_BONUS, and
becomes a BFS seed, so the traversal starts in the controller layer instead of at the content
words. #1602's guard covers short, low-degree leaves, not hubs.

This adds get, gets, got, getting to the English part of _QUERY_STOPWORDS, next to
work/works/working, which exist for the same reason, and extends the comment above the set.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Tests or CI
  • Refactor
  • Security fix

Verification & Invariants

Only query terms change. Node text, _find_node/explain/path/get_node resolution,
affected seed resolution, scoring constants and the all-stopwords fallback are unchanged. The
CLI, the MCP query_graph tool and the benchmark's real-graph mode all go through _query_terms
and inherit the change. No persisted graph, cache or generated artifact is affected.

Regression tests (tests/test_serve.py):

  • test_query_terms_drops_get_question_filler: ['payroll', 'approve', 'get', 'authorized'] → ['payroll', 'approve', 'authorized'].
  • test_query_terms_drops_get_variants: gets / got / getting.
  • test_query_terms_get_only_falls_back_to_unfiltered: "get" → ['get'], "how do I get it" → ['how', 'get'].
  • test_pick_seeds_get_question_ignores_framework_hub: 20 controllers importing a Get hub; seeds were ['get', 'approve'] before the fix, get is absent after it, and _find_node(G, "Get") still resolves the hub.

With the stopword line removed, the new term and seed tests fail (seeds ['get', 'approve']); with it, they pass.

Limitations. The filter applies to every question, not only bare HTTP-verb queries: in a mixed
question the word is dropped and the remaining terms drive seeding, e.g. GET endpoint →
['endpoint'], get user → ['user'], got request → ['request']. That loses the GET-vs-POST
distinction and a literal function or package named get/got in mixed questions. The
all-stopwords fallback only restores the term when nothing else is left. Identifiers that merely
contain the word (getter, getValue, get_user) are single tokens and unaffected, and
explain "Get" still finds the symbol.

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary.
  • Added a regression test (if bug fix) or isolated boundary test.
  • Kept the PR description synchronized with the final implementation.
  • Documented any limitations / unsupported cases explicitly.

How was this tested?

uv run --frozen pytest tests/test_serve.py -q            # 175 passed
uv run --frozen pytest tests -q                           # 8578 passed, 13 skipped (v8 baseline: 8571 passed, same 13 skipped)
uv run --frozen ruff check .                              # All checks passed
uv run --frozen pyright graphify/serve.py                 # 45 errors, identical to untouched v8 (none new)
python tests/bench_query_scoring.py --nodes 100000 --term-counts 3,5,10 --repeats 5   # all scenarios pass

Linux (WSL2, Ubuntu 22.04), Python 3.10.

Graphify-specific checklist

  • I updated generated skill artifacts (uv run python -m tools.skillgen --bless) when changing their source fragments. (not applicable: no fragments touched)
  • I confirmed that AST/structural extraction remains deterministic (no ambient state dependencies like ENV variables).
  • I reviewed changes for security implications (no unsafe interpolation into shell/Python).
  • I confirmed no API keys or local-only graph data are included.
  • (If applicable) I disclosed AI authorship in my commit messages. (Co-Authored-By trailers: OpenAI Codex wrote the implementation and tests; Claude designed the change, coordinated an independent review and drafted the issue and PR text.)

"get" survived stopwording, so a question like "how does X get
authorized" exact-matched framework hubs such as a NestJS Get decorator
import and made it a BFS seed. Graphify-Labs#1602 guards short low-degree leaves, not
hubs. Add get/gets/got/getting next to work/works/working; node text,
find_node/explain and the all-stopwords fallback are unchanged.

Fixes Graphify-Labs#4684

Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the contributor Pull request from a returning community contributor label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @AndresDiagoM. 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.10 and 3.13, and that the change keeps extraction deterministic.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Adds get, gets, got and getting to the query stopwords, so a question like "how does payroll approve get authorized" no longer seeds on a framework hub such as a NestJS Get decorator import (#4684). The filter only applies to query terms; node lookup stays unfiltered, so a symbol literally named Get is still findable via _find_node, and a query made only of these words falls back to the unfiltered terms. Tests cover the verb variants, the all-stopword fallback, and a hub-heavy graph where get is no longer picked as a seed.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 764 functions depend on the 407 functions this change touches.

Health — this change adds coupling hotspots:

  • worse: _score_query() — 18 callers, 7 callees
  • worse: _query_terms() — 22 callers, 3 callees

Verification — 764 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 567 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

16 of 443 test file(s) selected (4%) via static blast radius.

  • tests/test_benchmark.py — impact
  • tests/test_benchmark_raw_graph.py — impact
  • tests/test_benchmark_real_query.py — impact
  • tests/test_explain_same_file_tie.py — impact
  • tests/test_file_label_disambiguation.py — impact
  • tests/test_mcp_graph_view_cache.py — impact
  • tests/test_path_cli.py — impact
  • tests/test_query_induced_edges.py — impact
  • tests/test_query_mcp_direction.py — impact
  • tests/test_query_names_its_graph.py — impact
  • tests/test_query_seed_order.py — impact
  • tests/test_query_seeds.py — impact
  • tests/test_serve.py — impact, changed-test
  • tests/test_serve_http.py — impact
  • tests/test_terraform.py — impact
  • tests/test_truncation_full_answer.py — impact

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

· 2 more finding(s) on lines outside this diff (see the check run).

@safishamsi

Copy link
Copy Markdown
Member

Landed in v0.9.97, now on PyPI (pip install graphifyy==0.9.97). Filler verbs like get/got are dropped from query terms so a framework hub is not pulled in as a seed. Thanks for the fix, @AndresDiagoM.

@safishamsi safishamsi closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor Pull request from a returning community contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

query: "get" survives stopwording and exact-matches framework hubs like a NestJS Get decorator, hijacking BFS seeds (follow-up to #1602)

2 participants