{"record":{"id":"ad590ab26c6de45d","repo":"Graphify-Labs/graphify","slug":"no-sections-defined","errorCode":null,"errorMessage":"no sections defined","messagePattern":"no sections defined","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"graphify/callflow_html.py","lineNumber":1661,"sourceCode":"            f\"graphify output not found: {paths['graph']}. \"\n            \"Run graphify first or pass --graph /path/to/graph.json.\"\n        )\n\n    # Load data\n    nodes, edges, hyperedges, meta = load_graph(paths[\"graph\"])\n    labels = load_labels(paths[\"labels\"])\n    lang = detect_lang(args.lang, nodes, labels)\n    if paths[\"sections\"]:\n        sections = load_sections(paths[\"sections\"])\n    else:\n        sections = derive_sections_from_communities(nodes, labels, lang, args.max_sections)\n    sections = normalize_sections(sections, lang)\n    report_text = load_report(paths[\"report\"])\n\n    if not nodes:\n        raise ValueError(\"graph.json contains 0 nodes\")\n    if len(sections) <= 1:\n        raise ValueError(\"no sections defined\")\n\n    if verbose and len(nodes) >= 5000:\n        print(\"WARNING: Large graph -- Mermaid rendering may be slow. Consider --max-sections 5.\", file=sys.stderr)\n\n    node_ids = {node.get(\"id\") for node in nodes}\n    missing_endpoint_edges = [edge for edge in edges if edge.get(\"source\") not in node_ids or edge.get(\"target\") not in node_ids]\n    if verbose and missing_endpoint_edges:\n        print(f\"WARNING: {len(missing_endpoint_edges)} edges reference nodes not present in graph.json.\", file=sys.stderr)\n\n    meta[\"project_name\"] = infer_project_name(str(paths[\"graph\"]), meta)\n    meta[\"node_count\"] = len(nodes)\n    meta[\"edge_count\"] = len(edges)\n    meta[\"hyperedge_count\"] = len(hyperedges)\n\n    if args.output:\n        output_path = Path(args.output).expanduser()\n        if not output_path.is_absolute():\n            output_path = paths[\"base\"] / output_path","sourceCodeStart":1643,"sourceCodeEnd":1679,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/callflow_html.py#L1643-L1679","documentation":"Graph-existence preflight in the /graphify explain command of the aider fragment (tools/skillgen/fragments/core/aider.md:1135). Explain loads a single node and everything connected to it from graphify-out/graph.json; the guard exits 1 with a clear message when that file is missing rather than letting the subsequent json.loads fail.","triggerScenarios":"Running /graphify explain <node> when graphify-out/graph.json is absent from the current working directory — never built, wrong cwd, deleted, or a prior build terminated before export.","commonSituations":"Asking to explain a node before building the graph; agent in a subdir; CI/cleanup removed graphify-out/; the build step stopped at the empty-extraction or shrink-guard check.","solutions":["Run /graphify <path> to build, then retry /graphify explain.","Confirm cwd contains graphify-out/graph.json.","Fix any prior build failure that prevented graph.json from being written.","Rebuild after cleanup operations that removed graphify-out/."],"exampleFix":"# before\n/graphify explain Guardian\n# ERROR: No graph found ...\n\n# after\n/graphify .\n/graphify explain Guardian","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nif not Path('graphify-out/graph.json').is_file():\n    raise SystemExit('build the graph first: /graphify <path>')\nprint('ok - safe to run explain traversal')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the preflight before /graphify explain.","Confirm graph.json exists and is non-empty after each build.","Query from the correct working directory.","Rebuild the graph when it has been removed."],"tags":["graphify","aider","preflight","missing-file","explain"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}