From 224c87ce9363dcaad07e388307a47b1af77b2b5c Mon Sep 17 00:00:00 2001 From: Areg Noya Date: Sat, 11 Apr 2026 09:43:39 -0700 Subject: [PATCH] fix: connect graphify Obsidian output into a single component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs caused /graphify output to form disconnected components when dropped into an Obsidian vault: 1. `safe_name()` in `export.py` (both `to_obsidian` and `to_canvas`) did not strip trailing `.md`/`.mdx`/`.markdown` from the label before the caller appended the file extension. Nodes labelled after markdown sources (e.g. `CLAUDE.md`, `Guidelines.md`) produced filenames like `CLAUDE.md.md` while their incoming `[[CLAUDE.md]]` wikilinks resolved to the non-existent `CLAUDE.md` file. Every such link broke. 2. `report.py`'s `generate()` emitted community headings as plain prose (`### Community 15 - "Haptics"`) with zero wikilinks. Once the generated `GRAPH_REPORT.md` was copied into a vault as `-graph-report.md`, the entire community subgraph became unreachable from the report — the whole project cluster split off into a disconnected component. On one real vault (4549 notes across six graphify projects) these two bugs produced 52 connected components with ~21% of nodes stranded in 51 islands. After the fixes, re-running the report generator and regenerating the Obsidian export collapses the graph back to 1 component with 100% of nodes reachable from `master_index.md`. Fixes: - `export.py`: both `safe_name()` helpers now strip trailing Markdown extensions (`.md`, `.mdx`, `.markdown`, case-insensitive) after removing Obsidian-unsafe chars. Idempotent with the existing newline-stripping and sanitization. - `report.py`: added a module-level `_safe_community_name()` that mirrors `export.safe_name` so hub filenames and report links stay in sync. Inserted a `## Community Hubs (Navigation)` bullet list right after `## Summary` that emits `[[_COMMUNITY_|