{"record":{"id":"a722a577b39e7304","repo":"abhigyanpatwari/GitNexus","slug":"analyzer-dependency-graph-exceeded-limits-runtim-a722a5","errorCode":null,"errorMessage":"Analyzer dependency graph exceeded ${limits.runtimePackages} packages: ${packageRoot}","messagePattern":"Analyzer dependency graph exceeded (.+?) packages: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/analyzer-identity.ts","lineNumber":1262,"sourceCode":"        pathGuards,\n        limits,\n      );\n      if (!childRoot) {\n        edges.push({\n          parentLocator: parent.locator,\n          parentLabel: parent.label,\n          dependencyName,\n          childLocator: '<missing>',\n          childLabel: '<missing>',\n        });\n        continue;\n      }\n\n      let child = packages.get(childRoot);\n      if (!child) {\n        budget.packages += 1;\n        if (budget.packages > limits.runtimePackages) {\n          throw new Error(\n            `Analyzer dependency graph exceeded ${limits.runtimePackages} packages: ${packageRoot}`,\n          );\n        }\n        const manifestPath = path.join(childRoot, 'package.json');\n        recordDirectoryGuard(directoryGuards, childRoot);\n        const read = readManifest(manifestPath, options, budget, limits);\n        child = {\n          root: childRoot,\n          locator: runtimePackageLocator(packageRoot, childRoot),\n          manifestPath,\n          manifestBytes: read.bytes,\n          manifestState: read.state,\n          manifest: read.manifest,\n          label: manifestLabel(read.manifest),\n        };\n        packages.set(childRoot, child);\n        queue.push(child);\n      }","sourceCodeStart":1244,"sourceCodeEnd":1280,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/52924ef12c2290ceee4612526a828ec4cdf2047f/gitnexus/src/core/analyzer-identity.ts#L1244-L1280","documentation":"The dependency BFS admits each newly discovered package root after incrementing a package counter, throwing past limits.runtimePackages (default 10,000). Every admitted package contributes its manifest, locator, and payload tree to the receipt, so the bound caps total work and memory. A silently partial graph would be a correctness hole, hence the hard abort.","triggerScenarios":"BFS over the analyzer's dependency closure visits more than 10,000 distinct package roots — realistic mainly in forks with huge dependency closures, heavily aliased/duplicated installs where many names resolve to different roots, or tests that tightened runtimePackages below the fixture's package count.","commonSituations":"A fork merging an application into the analyzer package; installs with mass duplication defeating dedupe; unit tests with aggressive traversalLimits.","solutions":["Deduplicate/reinstall: 'rm -rf node_modules package-lock.json && npm install' to collapse duplicated package roots.","Trim the fork's manifest back to analyzer-relevant dependencies.","In tests, raise the tightened runtimePackages override (bounded by the 10,000 default) or shrink the fixture."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isRuntimePackagesLimitError(error: unknown): boolean {\n  return error instanceof Error && /^Analyzer dependency graph exceeded \\d+ packages:/.test(error.message);\n}","tryCatchPattern":"try {\n  identity = resolveAnalyzerRunnerIdentity(import.meta.url);\n} catch (error) {\n  if (isRuntimePackagesLimitError(error)) {\n    reportUserError('Dependency closure exceeds 10k packages; dedupe/reinstall node_modules.');\n  }\n  throw error;\n}","preventionTips":["Clean-reinstall to collapse duplicated package roots after major dependency surgery.","Avoid merging whole applications into the analyzer package in forks.","Keep test runtimePackages overrides sized above the fixture."],"tags":["gitnexus","analyzer-identity","limits","dependency-graph","node-modules"],"backgroundTag":"traversal-limit-exceeded","analyzedSha":"52924ef12c2290ceee4612526a828ec4cdf2047f","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}