Patch — knowledge-graph wikilink-alias edge corruption fix (incl. 0.8.8) + migration 035 registration & guard test.
Rolls up 0.8.8 (the fix) and 0.8.9 (making its migration actually run). 0.8.8 alone shipped its migration unregistered (a no-op), so 0.8.9 is the first version where the repair takes effect on deploy.
Fix (0.8.8)
Obsidian wikilinks [[akb://…/x.md|alias]] had no parser handling, and the bare-akb:// scan didn't stop at |/], so the alias's first word leaked onto the edge target (…/x.md|PWC). One bug, two symptoms: the relations panel rendered a broken …%7CPWC "related to" link, and the graph drew no edges (corrupted target matched no node).
- Parser:
[[target|alias]]matcher + tightened_AKB_URI_RE. _store_edgenow validates the target exists via the same_resource_existsprimitive the explicitakb_linkpath uses (two paths, shared validation primitive; differ only in policy: reject vs. silent-skip). Behaviour note: a not-yet-existing target is now dropped rather than stored as a dangling edge (re-materialized on the next index).- Migration
035_fix_wikilink_alias_edges.py: repairs already-persisted rows (strip alias → re-validate → re-insert or drop orphan). Idempotent.
Registration fix (0.8.9)
Migrations run from an explicit hardcoded list in _apply_migrations, not a directory glob. 0.8.8 forgot to register 035 → no-op. This registers it and adds tests/test_migrations_registered_unit.py guarding against the omission class.
Verified on on-prem prod: migration repaired 4 corrupted edges; akb_relations returns clean URIs resolving to real titles; akb_graph returns connected edges.