fix(watch): reconcile markdown links to semantic-backed documents (#3190) - #3191
fix(watch): reconcile markdown links to semantic-backed documents (#3190)#3191logan683 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Graphify review — findings
Adds Markdown link reconciliation to the incremental rebuild path via _reconcile_markdown_links, re-pointing authored links to their canonical file/page/semantic representative when both endpoints resolve uniquely, and pruning references AST edges whose link was removed from the owning Markdown source. Preserves existing edges instead of guessing when either endpoint is ambiguous or the owner wasn't re-parsed, and never overwrites an edge already occupying a representative pair since the graph is simple. Wires this into _reconcile_existing_graph and adds logger for debug tracing of preserved ambiguous links.
Worth a look
- reconciled edge dropped when representative pair already occupied by non-reference relation —
graphify/watch.py· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 544 functions depend on the 376 functions this change touches.
Health — this change adds coupling hotspots:
- new:
_rebuild_code()— 107 callers, 50 callees - new:
dispatch_command()— 2 callers, 122 callees - new:
watch()— 5 callers, 7 callees - new:
_reconcile_graph_html()— 6 callers, 5 callees - new:
_reconcile_existing_graph()— 1 callers, 8 callees - new:
test_poisoned_manifest_is_healed()— 0 callers, 6 callees
Verification — 544 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 388 function(s) in the blast radius were not formally verified this run
· 1 grounded finding(s) anchored inline below; 5 more finding(s) on lines outside this diff (see the check run).
| return preserved_edges | ||
|
|
||
|
|
||
| def _reconcile_existing_graph( |
There was a problem hiding this comment.
_reconcile_existing_graph()
fans out to 8 callees (efferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
|
Shipped in v0.9.52 via authorship-preserving cherry-pick so you keep contributor-graph credit. Thanks @logan683! Release: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.52 |
Fixes #3190.
Problem
When a Markdown document already carries semantic (LLM) nodes, #1915 and #1954 correctly exclude it
from AST quick-scan, so it never receives a canonical page node.
[[wikilinks]]in other notes stillresolve to that canonical id, and full reconcile discards the resulting edge silently — leaving no
dangling endpoint, so aggregate integrity checks stay clean.
Root cause
watch.pyexcludes semantic-backed documents from AST quick-scan (#1915), and #1954 extended that gateto documents whose semantic layer is concept- or rationale-typed. Correct for the document itself — its
semantic nodes are the sole representation. But another note's fresh
[[wikilink]]still resolves tothe deterministic page id for that path, and reconcile has no mapping from canonical page id to the
preserved representative, so the edge is discarded.
What changed
One new private helper,
_reconcile_markdown_links(...), implementing six cases:referencesEvidence
The overhead is real and stated up front. Change-gating is possible if preferred; correctness came
first.