Repository navigation
Description
Summary
On a 20-file, docs-only vault, one incremental rebuild took the graph from
18 nodes / 16 edges to 20 nodes / 7 edges — node coverage improved,
but 56% of the edges disappeared. Both before and after graphs are on
disk (graphify's own dated backups), so this is a measured before/after, not
an impression.
The run reports two separate losses and exits 0:
[graphify] WARNING: dropped 9 out-of-scope node(s) attributed to file(s) not
dispatched for extraction: andrej-karpathy.md, canteen-daily-sales-anomaly-checker.md,
claude-code-routines.md, compounding-knowledge.md, graphify.md (+4 more).
The model mis-attributed them to another corpus file; they were excluded from
the graph (#1895).
[graphify] Extraction warning (7 issues): 7x missing required field 'source_file'
(e.g. Edge 0 missing required field 'source_file')
[graphify extract] wrote .../graph.json: 20 nodes, 7 edges, 13 communities
Neither warning mentions edges being removed, and the final summary line
reports the post-loss count as a plain result. Nothing in the output says the
graph just lost more than half its edges.
Why this is not one of the existing issues
I checked before filing:
- deep mode: nodes with out-of-scope source_file are warned about but still written to graph.json #1895 (closed) and Semantic extraction: nonexistent model-invented source_file bypasses #1895 graph filter #2217 (open) are about mis-attributed nodes
reachinggraph.json. Here the filter did its job — the 9 nodes were
correctly excluded. This report is about what that exclusion costs on the
edge side, which I could not find measured anywhere. - Extractor produces edges missing required field
source_file#1279 (closed) is edges persisted withsource_filemissing (8 of
161,975 — cosmetic). Here the disposition is the opposite: I verified
0 edges withoutsource_fileare persisted and 0 dangling edges
remain, so the 7 warned edges were dropped, not kept. - [Bug] build_merge severs edges from UNCHANGED files into re-extracted files (−12% doc↔code in one update cycle): endpoint nodes are replaced, the surviving edges dangle, and the dangling-edge drop silently eats them #1711 (open) is the closest mechanism (replace-per-source merge severing
edges into re-extracted files) and may well be the same root cause. I am
not claiming attribution — I can show the outcome, not which of these
paths produced it. If this is a duplicate of [Bug] build_merge severs edges from UNCHANGED files into re-extracted files (−12% doc↔code in one update cycle): endpoint nodes are replaced, the surviving edges dangle, and the dangling-edge drop silently eats them #1711 on a much smaller corpus,
treat it as an additional data point: that issue measured −12.2%, this is
−56% on 20 files.
Reproduction
Corpus: 20 Markdown files, no code, no PDFs. Prior graph built the day before
by the same command.
- Add 1 new
.md, edit 2 existing.md(ordinary[[wiki links]]between them). OLLAMA_API_KEY=local graphify . --backend ollama- Compare
graphify-out/graph.jsonwith the dated backup graphify writes
undergraphify-out/<YYYY-MM-DD>/.
Incremental scan reported: 0 code, 9 docs, 0 papers, 0 images changed; 11 unchanged; 0 deleted; 1 excluded → 12 files cached/unchanged, 8 re-extracted.
Measured
| before (2026-07-28) | after (2026-07-29) | |
|---|---|---|
| nodes | 18 | 20 |
| edges | 16 (all references, all with source_file) |
7 |
edges without source_file persisted |
0 | 0 |
| dangling edges | 0 | 0 |
import json
d = json.load(open('graphify-out/graph.json'))
nodes = {n['id'] for n in d['nodes']}
print(len(d['nodes']), len(d['links']))
print(sum(1 for l in d['links'] if not l.get('source_file'))) # 0
print(sum(1 for l in d['links']
if l['source'] not in nodes or l['target'] not in nodes)) # 0Practical effect
The surviving 7 edges are almost entirely a star out of one hub file
(log.md → references → X). Deliberate page-to-page [[wiki links]] between
two documents edited in the same run did not survive: graphify query finds
both pages as nodes, but the relationship between them is gone. On a vault
where the whole point is cross-linking, the graph degrades to a file list with
one hub — while graphify query still answers, which is what makes it easy to
miss.
Suggested handling
Not a fix proposal, just what would have surfaced this:
- Report edge delta in the write summary when it is negative, e.g.
wrote graph.json: 20 nodes, 7 edges (-9 vs base), 13 communities. - When the out-of-scope node filter drops N nodes, say how many edges were
dropped with them — the node warning currently implies the cost is N nodes. - Treat an edge failing a required-field check as a warning that names the
producing extractor and the endpoints, so it can be traced.
Environment
- graphify 0.9.29 (
uv tool install graphifyy), Python 3.11 - Backend: ollama,
qwen2.5-coder:7b, fully local - macOS 15 (Darwin 25.5.0), Apple Silicon
- Corpus: 20 Markdown files (~120 KB), no code
- Exit code: 0
Activity
joriwang commentedon Sep 18, 2026
A 13-rebuild longitudinal data point from a production CI pipeline, and a diagnostic blocker:
graph.jsonhas no version stampYour report is a 20-file before/after. I have the same measurement across 13 consecutive incremental rebuilds over 3 months on a real corpus, which I hope is useful for judging how often this fires and what correlates with it. It also turned up a case that I think is the strongest argument for your suggestion 1: the net edge count went UP while a third of the graph's edges were being destroyed.
Environment
graphify extract <root> --backend openaiagainst an OpenAI-compatible gateway on every push tomain, then commitsgraphify-out/back. Every row below is a warm incremental rebuild that exited 0 and published.graphify-out/<YYYY-MM-DD>/graph.jsonis graphify's own backup of the graph as it stood before that day's run overwrote it, so consecutive backup dirs are a before/after pair.Measured: edge retention across 13 rebuilds
Edge set keyed on
(source, target, relation). "code ids renamed" countsfile_type == "code"nodes whose(source_file, label)is present in both graphs but under a different id — I added it as a version-migration probe, for reasons below.Three of thirteen rebuilds lost edges (62–65% retention); ten retained 100%. Your −56% is therefore not an outlier — it's the same order as our three bad ones, on a corpus 70× larger.
The row that argues for your suggestion 1 better than mine does
08-05 → 08-12: 192 edges destroyed, 220 created, net +28. The summary line readswrote graph.json: 961 nodes, 576 edgesand the node count also rose. Every aggregate signal an operator would normally watch went up. A negative-delta report would not have fired here either, because the delta was positive — which suggests the summary needs churn, not just delta:576 edges (+28 net, −192 dropped, +220 added).I broke the 192 down by endpoint fate; 38 of them have a surviving endpoint in a file whose node set is untouched and a dead endpoint in a file whose nodes were re-minted, which is #1711's exact signature. I've posted the full breakdown there rather than duplicating it.
The diagnostic blocker: no version stamp
I could not attribute any of the three bad rows to a cause, and I want to be explicit about that rather than imply more than I can show.
graph.jsoncarriesbuilt_at_commitbut no graphify version. Our CI image tag was floating (…-graphify, i.e. latest) until we pinned it to0.9.33on 2026-08-05, so I tried to reconstruct version boundaries from CI-config git history. It isn't resolvable:08-12 → 08-21renamed 71 of 95codenode ids while keeping labels andsource_fileidentical (src_mujoco_builder_mujocobuilder_init→simulation_ssot_transform_xml_src_mujoco_builder_mujocobuilder_init). That is thesource_filereduced to bare basename for all nodes in 0.9.16 (was relative path in 0.9.13) — breaks resolution against a code root #1941 basename→path-anchored id fix, i.e. an upgrade artifact, and it alone accounts for most of that row's 219 lost edges. Not your bug.08-05 → 08-12renamed only 17/105 code ids but re-minted nodes in 399 files, which looks like a mass semantic re-dispatch — consistent with a prompt-fingerprint change invalidating the wholecache/semantic/p<fingerprint>/namespace at once. Also plausibly an upgrade artifact.06-11 → 06-12renamed zero code ids yet lost 96 edges and 19 nodes, with 485 files losing nodes and none gaining. Different signature again; I can't explain it.So:
graphify_versioningraph.jsonwould have made this report three times shorter and actually conclusive. Without it, an operator seeing a bad row cannot tell "the tool silently ate a third of my edges" from "I upgraded and ids moved", and a maintainer receiving such a report cannot tell whether to investigate. I'd raise this to the same priority as the delta reporting.The control group is the useful half: after pinning the version, five consecutive rebuilds retained 100% of edges, including
09-04 → 09-10which added 187 new documents (+320 nodes, +538 links, 0 lost). So on a pinned version, warm incremental rebuilds on this corpus do not lose edges. The losses cluster around version changes.Downstream-side detector
Until the summary reports churn, this is what I settled on for CI — it uses the dated backups graphify already writes, so it costs nothing extra:
Note it has to compare set membership, not counts — our worst row had a positive count delta.
On your three suggestions
08-05 → 08-12row above, negative-delta is not sufficient; churn is the signal.08-12 → 08-21row the node warning implies a cost of N nodes while 219 edges disappeared.08-05 → 08-12row dropped with both endpoints still present in the graph, which is otherwise untraceable.fix(extract): keep edges between kept nodes when edge source_file is …
fix(llm): pin source_file to the dispatched file in the extraction pr…
fix(llm): pin source_file to the dispatched file in the extraction pr…
omsenjalia commentedon Oct 18, 2026
This looks fixed on the
v8branch by 642e4b84 (fix(extract): keep edges between kept nodes when edge source_file is undispatched (#2276)). Could a maintainer confirm and close?