You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
query: a snake_case name with a schema prefix (public.<name>()) loses to single-token labels; explain finds it #5080
Summary:graphify query <snake_case name> does not find a SQL function whose label carries a schema prefix (public.<name>()), while explain on the same name finds it. The full-query tier of _score_query only fires when the joined query tokens equal or prefix the label, so the leading public token defeats it, and nodes whose whole label is one of the query's tokens take the seeds instead.
Version: observed on 0.9.93 against a private code graph (names changed below). The same logic is on v8 / v0.9.103 by reading graphify/serve.py, _score_query (~617), the if joined: block (~705-713).
Shape of the graph (names changed):
a SQL migration defines public.sweep_widget_state() (node label public.sweep_widget_state(), source_file migrations/042_widget_sweep.sql); it appears in four migrations in total;
elsewhere in the graph there are nodes whose whole label is one of the tokens: SWEEP (a constant), WIDGET (a constant), State (a type).
$ graphify query sweep_widget_state
# exit 0; Start: ['SWEEP', 'WIDGET', 'State']; 55 nodes shown, none of them public.sweep_widget_state()
# (--budget 20000 and 80000: 82 nodes shown, still none)
$ graphify explain sweep_widget_state
# exit 3; lists the four public.sweep_widget_state() nodes with their path::symbol forms
$ graphify query public.sweep_widget_state
# exit 3 (query's own name refusal), the same four nodes listed
_search_tokens turns the query into sweep widget state and the label into public sweep widget state. joined in (norm_label, bare_label, label_tokens, nid_lower) is false and label_tokens.startswith(joined) is false, so the function gets only the per-token tiers, where an exact single-token label (SWEEP) outscores it. Another public.-prefixed function in the same graph, whose tokens are no other node's whole label, ranks fine, so the miss needs both: the qualifier defeating the full-query tier, and other nodes whose whole label is one of the tokens.
Expected: a query whose tokens equal the label's tokens after a leading qualifier (schema, namespace, module) gets the full-query bonus, or at least the prefix-tier bonus, so query sweep_widget_state seeds on public.sweep_widget_state() as explain resolves it. For example, also accept label_tokens.endswith(" " + joined) (a token-aligned suffix) in that block, maybe weighted between the exact and prefix tiers.
Activity
github-actions commentedon Nov 7, 2026
Thanks for opening this issue, @Larrynguyen191. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
houyunsun commentedon Nov 8, 2026
本轮提交 1 个 PR:#5095(修 #5080)。
问题:
graphify query sweep_widget_state找不到public.sweep_widget_state(),而explain同名却能找到。根因是_score_query的全查询层只在“等于/前缀”时给分,标签的 token 串带了public前缀,于是落到逐词层——那里单 token 完全相等的SWEEP/WIDGET/State拿满分,把目标挤出种子。修复:在 exact 与 prefix 之间新增“限定词尾部”层级,标签为
<限定词><分隔符><名字>且查询正好是<名字>时给分(分隔符含.::/:@,另支持 CamelCase 末尾段;按限定词 token 数衰减、上限 4;跳过扩展名和纯数字段)。改动 2 文件 +173/−0。验证:修复前种子
['SWEEP','State','WIDGET']→ 修复后['public.sweep_widget_state()',...];只回滚源码时 2 failed,修复后 4 passed;全量 381 failed → 379 failed,差值恰为两个新用例。PR 状态 open / mergeable=clean,11 项 check 全绿。需要说明的决定:原本在 huggingface/transformers 上完成了 DynamicCache 混合层
batch_select_indices的完整修复与测试,但其 PR 模板有 Code Agent Policy(首次贡献者须确认代码非 LLM 所写、自主 agent 不应提 PR),与该约束冲突,故整份放弃、未提交、未在 issue 留言。另:autogen 当日 5 个优质 bug 已全部被他人开 PR;crewAI、transformers #50470 也均被认领。fix(query): match a label's name after its schema/namespace qualifier