extract --out <dir>: semantic cache never saved, docs missing from manifest (relative source_file resolved against --out)
维护者通常 1 天内回复
评估
调研方向
从 __main__.py 中的 extract 开始,然后检查 cache.save_semantic_cache 和 check_semantic_cache,追踪 source_file 路径的解析方式。当 --out 与扫描的目录不同时,比较 _sem_extracted 和 files_by_type 使用的路径。完成的标准是语义缓存条目已保存,且清单记录了它们的 semantic_hash,使第二次运行能够复用这些文件。
由索引模型根据 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:
cache.save_semantic_cache(..., root=out_root)buildsPath(root) / "n1.md",is_file()is false, so the entry is skipped. Nothing is saved._sem_extracted(used to build_manifest_files) is compared against the absolute paths infiles_by_type. A relativesource_filenever matches, so no doc gets asemantic_hashinmanifest.jsonanddetect_incrementalre-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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Graphify-Labs/graphify 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Graphify-Labs/graphify#4860 · 1 条评论 ·
维护者通常 1 天内回复
-
Cache the claude backend system prompt via Anthropic prompt caching可能已有人在做 @Jvxoq 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
Graphify-Labs/graphify#4835 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 75/100
Graphify-Labs/graphify#4829 · 1 条评论 ·
维护者通常 1 天内回复
-
hooks: last-resort `python3` probe launches the Microsoft Store redirector on Windows (visible console flash, exit 9009)可能已有人在做 @Deepjyoti-Sarmah 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
Graphify-Labs/graphify#4563 · 2 条评论 ·
维护者通常 1 天内回复
-
GRAPHIFY_DISABLE_THINKING is ignored by the claude backend, so thinking eats max_tokens and extraction truncates可能已有人在做 @bercedev 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 69/100
Graphify-Labs/graphify#4546 · 1 条评论 ·
维护者通常 1 天内回复
查看 Graphify-Labs/graphify 的全部 Issue
相似的 Issue
-
priority middle
难度 1/5 1 小时以内 新手友好度 62/100
KATO-Hiro/AtCoderClans#12940 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 76/100
huggingface/huggingface_hub#5283 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement
难度 1/5 1 小时以内 新手友好度 86/100
维护者通常 1 天内回复
-
bug example
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复