Description
Summary
When a Markdown document already carries semantic (LLM) nodes, #1915 and its #1954 follow-up correctly
exclude it from AST quick-scan, so it never receives a canonical page node. But [[wikilinks]] in
other notes still resolve to that canonical page id — which does not exist — and full reconcile
discards the edge silently.
Nothing is missing from the graph: the target is present as its preserved semantic document node,
under a different id. There is no mapping from the canonical page id to that preserved representative.
Environment
graphify 0.9.51, commit 281ccaa4ff38aaef3f19e823fb7645e19b28f591 (unmodified)
Python 3.13.14 · tree-sitter 0.25.2 · networkx 3.6.1 · Windows 11
run as: graphify update <root>
Expected vs actual
Expected: a uniquely resolvable [[link]] to an existing document yields a references edge to
that document.
Actual: if the target is semantic-backed, no edge is produced and nothing is reported.
Mechanism
Extraction resolves the link to the canonical page id for that path. That node does not exist, because
the target is semantic-backed and was never AST-quick-scanned. Reconcile then discards the edge —
silently, and without leaving a dangling endpoint behind, which is why aggregate integrity checks
stay clean.
Reproduce
root/
hub.md # contains: [[topic]]
topic.md # already carries semantic (LLM) nodes in the existing graph
graphify update root/ → the hub.md → topic.md references edge is absent, while topic.md's
semantic document node is present.
Nine self-contained tests covering this and the surrounding contract are in the linked PR; three
fail on unmodified 281ccaa4.
Why it is easy to miss
Node, semantic and hyperedge counts are all preserved, and no dangling endpoint appears. On one
~400-file corpus the link total was identical before and after — 82 edges removed, 82 added — so
every aggregate check passed. The loss is visible only by diffing edge identity, or by resolving
authored links against the graph.
Measured impact
404-file Markdown corpus, exhaustive sweep of 1,868 authored resolvable link pairs against the
post-update graph:
sweep-resolved references |
remainder | |
|---|---|---|
official 281ccaa4 |
1,739 | 129 |
| with the linked fix | 1,834 | 34 |
The remaining 34 are not losses: 27 have no unique representative and retain their existing
edges; 7 are already connected by a semantic relation, which a simple (non-multi) Graph cannot hold
in parallel with references. Disconnected authored pairs: 0.
Suggested fix
For a fresh references edge whose canonical page target is absent, re-point to a unique preserved
representative for the same normalized source, in this priority:
- exact canonical id
- unique
node_kind=page - unique non-AST
file_type=document - otherwise no mapping — report ambiguity
Never map concept-only sources, ambiguous sources, nonexistent or already-valid targets, or
non-references relations. Preserve existing edges for ambiguous targets rather than pruning them.
A tested implementation is linked.
Related
- watch._rebuild_code produces a ~4× bloated graph vs
graphify . --update— AST-scans Markdown docs, then merges preserved semantic nodes on top #1915 / #1915 follow-up: semantic-doc gate only accepts file_type=="document", so docs whose LLM layer is concept/rationale are still AST-quick-scanned #1954 — the semantic-doc gate this regresses against. Both are correct; the gap is the
missing representative mapping, not the gate. - Markdown [[wikilinks]] resolve sibling-only, dropping every cross-folder link in note-type vaults #2413 — adjacent but distinct. That concerns which path a bare link resolves to (sibling-only).
This concerns a target whose path resolves correctly but whose page node was never built: 12 of the
observed losses are same-folder sibling links, which sibling-only resolution handles correctly. - Non-deterministic graphs from identical inputs: extraction lacks seed/prompt-override controls and extract_corpus_parallel ignores extraction-spec #1695 — already-open semantic extraction / entity-ID nondeterminism. Context and amplifier for
the losses reported here, not the cause of them, and not duplicated by this report. - [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 — old surviving edges are severed when a re-extracted endpoint's ID changes.
- How this differs from both. [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/Non-deterministic graphs from identical inputs: extraction lacks seed/prompt-override controls and extract_corpus_parallel ignores extraction-spec #1695 sever an edge that already existed, because an endpoint
identity moved. Here nothing moved: a freshreferencesedge targets a canonical page ID that was
never created, because watch._rebuild_code produces a ~4× bloated graph vsgraphify . --update— AST-scans Markdown docs, then merges preserved semantic nodes on top #1915/#1915 follow-up: semantic-doc gate only accepts file_type=="document", so docs whose LLM layer is concept/rationale are still AST-quick-scanned #1954 skip AST page creation for semantic-backed documents. Same
silent drop site, different root cause. The candidate PR provides a conservative representative
rescue for this specific case only.
Activity
fix(watch): reconcile markdown links to semantic-backed documents (#3190
test(watch): pin that markdown reconcile does not resurrect a deleted…
chore: bump to 0.9.52
safishamsi commentedon Aug 29, 2026
Fixed in v0.9.52: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.52. Closing as resolved.
fix(watch): preserve unresolved authored reference edges (Graphify-La…
fix(watch): preserve unresolved authored reference edges (#3190)
chore: bump to 0.9.53