diff --git a/graphify/__main__.py b/graphify/__main__.py index e2b3d9e67..e9e39a2b0 100644 --- a/graphify/__main__.py +++ b/graphify/__main__.py @@ -1308,7 +1308,8 @@ def main() -> None: questions = suggest_questions(G, communities, labels) tokens = {"input": 0, "output": 0} report = generate(G, communities, cohesion, labels, gods, surprises, - {}, tokens, str(watch_path), suggested_questions=questions) + {"warning": "cluster-only mode — file stats not available"}, + tokens, str(watch_path), suggested_questions=questions) out = watch_path / "graphify-out" (out / "GRAPH_REPORT.md").write_text(report, encoding="utf-8") to_json(G, communities, str(out / "graph.json")) diff --git a/graphify/skill.md b/graphify/skill.md index eef1144f8..6ec8ae2df 100644 --- a/graphify/skill.md +++ b/graphify/skill.md @@ -862,6 +862,17 @@ if deleted: # Merge: new nodes/edges into existing graph G_existing.update(G_new) print(f'Merged: {G_existing.number_of_nodes()} nodes, {G_existing.number_of_edges()} edges') + +# Write merged result back to .graphify_extract.json so Step 4 sees the full graph +merged_out = { + 'nodes': [{'id': n, **d} for n, d in G_existing.nodes(data=True)], + 'edges': [{'source': u, 'target': v, **d} for u, v, d in G_existing.edges(data=True)], + 'hyperedges': new_extraction.get('hyperedges', []), + 'input_tokens': new_extraction.get('input_tokens', 0), + 'output_tokens': new_extraction.get('output_tokens', 0), +} +Path('graphify-out/.graphify_extract.json').write_text(json.dumps(merged_out)) +print(f'[graphify update] Merged extraction written ({len(merged_out[\"nodes\"])} nodes, {len(merged_out[\"edges\"])} edges)') " ```