Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

extract --out <dir>: semantic cache never saved, docs missing from manifest (relative source_file resolved against --out)

オープン 初心者向け
#4,831 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

__main__.py の extract から始め、次に cache.save_semantic_cache と check_semantic_cache を調べて、source_file のパスがどのように解決されるかを追跡してください。--out がスキャン対象のディレクトリと異なる場合に、_sem_extracted と files_by_type で使われるパスを比較してください。セマンティックキャッシュのエントリが保存され、マニフェストにその semantic_hash が記録されることで、2回目の実行でファイルが再利用されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Version: graphify 0.9.7 (uv tool install graphifyy), macOS, --backend claude-cli

Problem
graphify extract <dir> --out <other> never reuses the semantic cache. Every run re-extracts every doc and reports 0 files cached/unchanged. <other>/graphify-out/cache/semantic/ stays empty.

Cause
The LLM returns source_file relative to the scanned dir (e.g. n1.md). In __main__.py (extract), two places treat it as a path under the output root (out_root) instead:

  1. cache.save_semantic_cache(..., root=out_root) builds Path(root) / "n1.md", is_file() is false, so the entry is skipped. Nothing is saved.
  2. _sem_extracted (used to build _manifest_files) is compared against the absolute paths in files_by_type. A relative source_file never matches, so no doc gets a semantic_hash in manifest.json and detect_incremental re-queues all of them.

When --out is omitted (out_root == target), (1) resolves correctly.

Repro

mkdir vault out cwd
for i in 1 2 3; do echo "# Note $i. Alice uses Redis." > vault/n$i.md; done
cd cwd
graphify extract ../vault --out ../out --backend claude-cli --max-concurrency 1   # run twice

Run 2: incremental summary: 0 files cached/unchanged, 3 re-extracted, tokens spent again, out/graphify-out/cache/semantic/ empty, manifest.json is {}.

Workaround
Omit --out and set GRAPHIFY_OUT=/abs/path/graphify-out. Run 2 then reports 3 files cached/unchanged, 0 re-extracted and spends no tokens. On a ~106-doc vault this took a nightly run from ~340k in / ~66k out tokens to ~17k / ~7k.

Suggested fix
Resolve relative source_file against target (the scanned dir) in save_semantic_cache and when building _sem_extracted, while keeping the cache key relative to out_root as check_semantic_cache already does.

主要言語
Python
スター
124k
フォーク
11.9k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Graphify-Labs/graphify のほかの issue

Graphify-Labs/graphify の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。