[Bug]: graphify query prints a different answer on each run (BFS walks a set in hash order)
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
graphify/serve.py の _bfs を読み、その走査順が graphify query の出力とトークン予算にどう影響するかを追ってください。Issue の PYTHONHASHSEED ループで再現し、次に同じクエリを異なるシードで確認してください。実行ごとに出力と保持されるエッジが安定すれば完了です。Issue ではテストファイルは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
Pre-flight checks
- I have checked the Troubleshooting section in the README
What happened?
graphify query prints a different answer on every run, on the same graph. _bfs in graphify/serve.py walks each level as a set of node ids (frontier = set(start_nodes), for n in frontier:), so the EDGE lines come out in string-hash order, which Python randomizes per process. query is not in _HASHSEED_PINNED_COMMANDS, and the MCP server runs the same traversal in a long-running process, so nothing pins it. The order also decides which edges survive the token budget.
Distinct outputs over 10 runs (PYTHONHASHSEED 1 to 10):
| repo | query | budget | distinct outputs |
|---|---|---|---|
| flask | how does url_for work | 50k | 10 |
| click | how does echo work | 50k | 10 |
| django | how does slugify work | default | 10 |
| django | how does the queryset build sql | 50k | 10 |
On a FastAPI template repo, graphify query 'how does cn() work' run 6 times gave 5 different outputs.
Steps to reproduce
cd flask && graphify update .
for s in 1 2 3; do PYTHONHASHSEED=$s graphify query "how does url_for work" --budget 50000 | md5sum; done
Three different hashes.
Error output or graph output
Example, first 3 contains EDGE lines on a tiny graph (one seed, 60 neighbours), seeds 1 / 2 / 3:
helper_7, helper_17, helper_6 | helper_1, helper_13, helper_17 | helper_18, helper_17, helper_8
Graphify version
0.9.105 (v8 at 5eedffa8)
Operating System
Windows (also seen on Linux)
Python Version
3.12
Installation Method
uv tool install (recommended)
Additional context
_dfs uses a list stack and is already stable. Related but different: #2817 and #1667 (cluster order), #3743 (hash seed pinned for other commands).
- 主要言語
- Python
- スター
- 124k
- フォーク
- 11.9k
- 平均マージ
- 2時間 35分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Graphify-Labs/graphify のほかの issue
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)対応中かも @rohit-jsfreaky が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Graphify-Labs/graphify#5110 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Graphify-Labs/graphify#5006 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
extract --out <dir>: semantic cache never saved, docs missing from manifest (relative source_file resolved against --out)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4831 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
hooks: last-resort `python3` probe launches the Microsoft Store redirector on Windows (visible console flash, exit 9009)対応中かも @Deepjyoti-Sarmah が 22 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4563 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
GRAPHIFY_DISABLE_THINKING is ignored by the claude backend, so thinking eats max_tokens and extraction truncates対応中かも @bercedev が 22 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
Graphify-Labs/graphify#4546 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
Graphify-Labs/graphify の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Treat corrupt-shape state files as missing in `load_state`対応中かも @Qrytics が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
OvertureMaps/overturemaps-py#175 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
awslabs/visual-asset-management-system#1278 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws-samples/sample-per-model-bedrock#835 ·
メンテナーはふだん 1 日以内に返信