{"record":{"id":"571c9dafba7be324","repo":"Graphify-Labs/graphify","slug":"module-graphify-has-no-attribute-name-r","errorCode":null,"errorMessage":"module 'graphify' has no attribute {name!r}","messagePattern":"module 'graphify' has no attribute (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"graphify/__init__.py","lineNumber":30,"sourceCode":"        \"cohesion_score\": (\"graphify.cluster\", \"cohesion_score\"),\n        \"god_nodes\": (\"graphify.analyze\", \"god_nodes\"),\n        \"surprising_connections\": (\"graphify.analyze\", \"surprising_connections\"),\n        \"suggest_questions\": (\"graphify.analyze\", \"suggest_questions\"),\n        \"generate\": (\"graphify.report\", \"generate\"),\n        \"to_json\": (\"graphify.export\", \"to_json\"),\n        \"to_html\": (\"graphify.export\", \"to_html\"),\n        \"to_svg\": (\"graphify.export\", \"to_svg\"),\n        \"to_canvas\": (\"graphify.export\", \"to_canvas\"),\n        \"to_wiki\": (\"graphify.wiki\", \"to_wiki\"),\n        \"reflect\": (\"graphify.reflect\", \"reflect\"),\n        \"save_query_result\": (\"graphify.ingest\", \"save_query_result\"),\n    }\n    if name in _map:\n        import importlib\n        mod_name, attr = _map[name]\n        mod = importlib.import_module(mod_name)\n        return getattr(mod, attr)\n    raise AttributeError(f\"module 'graphify' has no attribute {name!r}\")\n","sourceCodeStart":12,"sourceCodeEnd":31,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/__init__.py#L12-L31","documentation":"This is not a library exception: it is an explicit fail-fast guard in the graphify skill pipeline (tools/skillgen/expected/graphify__skill-vscode.md:415). After the extraction stage writes graphify-out/.graphify_extract.json, build_from_json() turns it into a networkx graph; if that graph has zero nodes, the script prints this error and exits 1 BEFORE writing graph.json, GRAPH_REPORT.md, or the analysis sidecar. The guard exists (#1392) so an empty re-extraction can never clobber a previously good graph.","triggerScenarios":"Running the graphify build/export step when build_from_json(extraction, root='INPUT_PATH', directed=IS_DIRECTED) returns a graph with G.number_of_nodes() == 0. Concrete causes: all corpus files were skipped by detection (binary-only corpus), the extractor produced no nodes/edges JSON, or .graphify_extract.json is structurally valid JSON but has an empty nodes list.","commonSituations":"Pointing graphify at a directory containing only images/binaries/build artifacts; a prior extraction step silently failed upstream while still writing an (empty) extract file; .gitignore or skip rules excluding every source file; running from the wrong working directory so the wrong tree is scanned.","solutions":["Check that graphify-out/.graphify_extract.json exists and its nodes array is non-empty; if empty, re-run the extraction step on the target path.","Verify the input path actually contains extractable text files (not only binaries) and that none of them are excluded by skip rules.","Re-run the full build from scratch: delete graphify-out/.graphify_extract.json and .graphify_detect.json so stale empty sidecars cannot be reused.","If extraction relies on an LLM/API step, inspect its token counts (extraction.get('input_tokens')) and logs for an upstream silent failure."],"exampleFix":"# before: pointing at a directory with no extractable text\n/graphify build ./assets-bin-only\n\n# after: point at the source tree and re-extract\nrm graphify-out/.graphify_extract.json graphify-out/.graphify_detect.json\n/graphify ./src","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\nextract_path = Path('graphify-out/.graphify_extract.json')\nif not extract_path.exists():\n    raise SystemExit('extraction sidecar missing - re-run extraction')\nextract = json.loads(extract_path.read_text(encoding='utf-8'))\nnodes = extract.get('nodes') or extract.get('symbols') or []\nif not nodes:\n    raise SystemExit('extraction produced 0 nodes - fix corpus/skip rules before building')\nprint(f'precheck ok: {len(nodes)} nodes')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate .graphify_extract.json has a non-empty nodes list before invoking the build/export step.","Keep extraction, detection, and build steps in one pipeline so an extraction failure aborts before sidecars are written.","Point graphify at source trees, not directories of binaries or generated artifacts.","Delete stale extract/detect sidecars when switching INPUT_PATH so empty leftovers are never reused."],"tags":["graphify","extraction","empty-graph","fail-fast","skillgen"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}