test(export): cover many/empty id-less hyperedges; open 0.9.45 (#2775)

Adds the multi-id-less case (the real corpus had 183/234 id-less) and the
empty-string-id case (falsy, treated as id-less). Dates the released 0.9.44 and
opens the 0.9.45 section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
safishamsi
2026-08-16 18:28:53 +01:00
co-authored by Claude Opus 4.8
parent ae8d059231
commit 0524982346
2 changed files with 25 additions and 1 deletions
+5 -1
View File
@@ -2,7 +2,11 @@
Full release notes with details on each version: [GitHub Releases](https://github.com/safishamsi/graphify/releases)
## 0.9.44 (unreleased)
## 0.9.45 (unreleased)
- Fix: loading a `graph.json` that contains a hyperedge with no `id` field (the semantic extractor emits them and they persist verbatim) no longer crashes the incremental re-extract with `KeyError: 'id'`; id-less hyperedges are tolerated and retained (#2775, thanks @ousamabenyounes).
## 0.9.44 (2026-08-15)
- Feature: `graphify hook install` reads a committed `.graphifyrc` (`viz_node_limit=<int>`) and bakes the visualization node limit into the generated git hooks, so a project-wide limit is shared via version control and survives hook regeneration; `hook status` reports it (#2760, thanks @hopstreax). The baked value uses a `${GRAPHIFY_VIZ_NODE_LIMIT:-<n>}` default so an explicit per-run env var still wins, and `hook status` degrades gracefully on a malformed `.graphifyrc`.
- Fix: `graphify install` (Claude always-on) now writes the CLAUDE.md registration into `$CLAUDE_CONFIG_DIR` when that env var relocates the Claude profile, instead of always mutating the default `~/.claude/CLAUDE.md` (part of #2694, thanks @AromalBiju1).
+20
View File
@@ -151,6 +151,26 @@ def test_attach_hyperedges_tolerates_id_less_persisted():
assert len(G.graph["hyperedges"]) == 2
def test_attach_hyperedges_tolerates_many_id_less_persisted():
"""The real corpus had 183/234 persisted hyperedges id-less: all of them must
load without crashing and be retained (#2775)."""
G = nx.DiGraph()
G.graph["hyperedges"] = [
{"nodes": ["a", "b"], "type": "project", "attributes": {}} for _ in range(5)
]
attach_hyperedges(G, [{"id": "flow_a", "nodes": ["A", "B"]}])
assert len(G.graph["hyperedges"]) == 6 # 5 id-less retained + 1 appended
def test_attach_hyperedges_treats_empty_id_as_id_less():
"""An empty-string id is falsy, so it is treated the same as a missing id:
it seeds nothing into the dedup set and does not crash."""
G = nx.DiGraph()
G.graph["hyperedges"] = [{"id": "", "nodes": ["a", "b"], "type": "project"}]
attach_hyperedges(G, [{"id": "flow_a", "nodes": ["A", "B"]}])
assert len(G.graph["hyperedges"]) == 2
# ---------------------------------------------------------------------------
# 3. to_json includes hyperedges key
# ---------------------------------------------------------------------------