{"record":{"id":"81a6e95d461ace71","repo":"Graphify-Labs/graphify","slug":"graph-json-p-is-size-bytes-exceeds-merge-ma","errorCode":null,"errorMessage":"graph.json {p} is {size} bytes, exceeds {_MERGE_MAX_BYTES}-byte cap","messagePattern":"graph\\.json (.+?) is (.+?) bytes, exceeds (.+?)-byte cap","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"graphify/cli.py","lineNumber":2246,"sourceCode":"            print(\"Usage: graphify merge-driver <base> <current> <other>\", file=sys.stderr)\n            sys.exit(1)\n        _base_path, _current_path, _other_path = sys.argv[2], sys.argv[3], sys.argv[4]\n        # Hard caps so a malicious or corrupted graph.json cannot exhaust memory\n        # at parse time. 50 MB / 100k nodes are well above any realistic graph\n        # (typical graphs are <5 MB / <50k nodes); anything larger should fail\n        # the merge so a human can investigate.\n        _MERGE_MAX_BYTES = 50 * 1024 * 1024\n        _MERGE_MAX_NODES = 100_000\n        import networkx as _nx\n        from networkx.readwrite import json_graph as _jg\n        def _load_graph(p: str):\n            path_obj = Path(p)\n            try:\n                size = path_obj.stat().st_size\n            except OSError as exc:\n                raise RuntimeError(f\"cannot stat {p}: {exc}\") from exc\n            if size > _MERGE_MAX_BYTES:\n                raise RuntimeError(\n                    f\"graph.json {p} is {size} bytes, exceeds {_MERGE_MAX_BYTES}-byte cap\"\n                )\n            data = json.loads(path_obj.read_text(encoding=\"utf-8\"))\n            # A committed raw (--no-cluster) graph stores edges under \"edges\";\n            # parse via the shared links/edges-normalizing loader (#2212).\n            from graphify.paths import load_node_link_graph as _lnlg\n            return _lnlg(data), data\n        try:\n            G_cur, _ = _load_graph(_current_path)\n            G_oth, _ = _load_graph(_other_path)\n        except Exception as exc:\n            print(f\"[graphify merge-driver] error loading graphs: {exc}\", file=sys.stderr)\n            sys.exit(1)  # surface the conflict so git doesn't accept a corrupt merge\n        merged = _nx.compose(G_cur, G_oth)\n        if merged.number_of_nodes() > _MERGE_MAX_NODES:\n            print(\n                f\"[graphify merge-driver] merged graph has {merged.number_of_nodes()} nodes, \"\n                f\"exceeds {_MERGE_MAX_NODES}-node cap; aborting merge.\",","sourceCodeStart":2228,"sourceCodeEnd":2264,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/cli.py#L2228-L2264","documentation":"Graph-existence preflight in the devin fragment's /graphify ask flow (tools/skillgen/fragments/core/devin.md:1076). Before traversing the graph for a question, the skill checks graphify-out/graph.json exists and exits 1 with this message otherwise, preventing a confusing downstream load failure.","triggerScenarios":"Asking a graph question when graphify-out/graph.json is missing in the current working tree: no build ever ran, the graph was built in another directory, cleanup removed it, or a previous build exited before export.","commonSituations":"New workspace/clone; agent cwd mismatch; git clean or CI removed graphify-out/; prior build aborted at the empty-graph or shrink guard.","solutions":["Run /graphify <path> to build the graph first.","Make sure the query runs from the directory containing graphify-out/.","Resolve any earlier build failure that prevented graph.json from being written.","Rebuild after any process that deletes graphify-out/."],"exampleFix":"# before\n/graphify ask \"how do retries work?\"\n# ERROR: No graph found ...\n\n# after\n/graphify .\n/graphify ask \"how do retries work?\"","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nif not Path('graphify-out/graph.json').is_file():\n    print('graph missing - run /graphify <path> first')\nelse:\n    print('graph ready for ask traversal')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the existence check before ask queries.","Build the graph during workspace initialization.","Keep the querying process in the graph's directory.","Rebuild whenever graphify-out/ is removed."],"tags":["graphify","devin","preflight","missing-file","ask"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}