Repository navigation
Description
Summary
During an incremental semantic --update on a project graph, to_json (via build_merge) refuses to write with:
[graphify] Replaced 23 node(s) from re-extracted source file(s).
[graphify] Deduplicated 2 node(s) (2 exact).
[graphify] WARNING: Refusing to overwrite — saved semantic node(s) are missing from the new graph: glossary_first_contact, glossary_the_nudge.
graph.json written: False
The two "missing" nodes ARE present in the freshly extracted chunk that was passed to build_merge — they are then dropped by the immediately preceding exact-duplicate dedup ("Deduplicated 2 node(s) (2 exact)"), and the shrink-guard (#479) afterwards compares the saved cache against the post-dedup graph and counts them as missing. The guard's refusal discards a healthy merged graph.
Reproduction shape
- Project graph previously built with semantic nodes from a doc chunk that covered two files at once (chunk =
CLAUDE.md+GLOSSARY.mdin one extraction). - Later
--update: the chunk set changes soGLOSSARY.mdis re-extracted alone (cache-first:save_semantic_cacherun beforebuild_merge, prompt_file consistent). build_merge([extraction], graph_path=..., root='.', ast_sources=[...])replaces theGLOSSARY.md-sourced nodes (23 replaced) and dedups 2 exact duplicates (the two nodes whose ids/labels collide with nodes still present from the old two-file chunk's provenance handling).to_jsonrefuses: the deduped nodes are counted as "saved semantic node(s) missing from the new graph".
Observed on graphify 0.9.97 (installed via uv tool install graphifyy), Python 3.12, Linux. The refusal is deterministic across retries, including with a fully cache-first flow (the skill's documented Part-B order).
Impact
The writer refuses a valid merge, so the on-disk graph silently stays stale (new concept nodes from the re-extracted doc never land), and the operator is invited to re-run — but re-running re-extracts and re-refuses identically. In an agent workflow this is expensive: each "retry" is another full LLM extraction of unchanged documents.
Expected behavior
Nodes removed by the merge's own dedup step should not count as "missing" in the #479 shrink-guard comparison — the guard should compare against the pre-dedup node set (or dedup should preserve one copy of an "exact duplicate" whose id the saved cache references).
Workaround
Accept the refusal, keep the previous on-disk graph.json, and let the next full rebuild (or graphify update . --force for AST-only content) pick up the missing concept nodes. Works, but the doc-side semantic content lags until a full rebuild.
Happy to provide the full extraction chunk + graph.json pair if useful.
Activity
github-actions commentedon Nov 1, 2026
Thanks for opening this issue, @webmasterarbez. 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.
test(guard): pin that the #479 write guard still refuses a real loss (#…
feat(dedup): report which ids deduplicate_entities merged away (#4940)
feat(build): carry the dedup merge map on the built graph (#4940)
fix(guard): a saved node dedup folded into a twin is not a lost node (#…
safishamsi commentedon Nov 2, 2026
Fixed in 0.9.101 (published to PyPI) via #4952. The write guard no longer refuses a healthy graph when dedup folds a saved node into a surviving twin; a genuine loss is still refused.
fix(build): report ghost folds on the dedup remap channel (#4955)