{"record":{"id":"cd874967aa8715b0","repo":"abhigyanpatwari/GitNexus","slug":"analyzer-runtime-payload-scan-exceeded-limits-ru-cd8749","errorCode":null,"errorMessage":"Analyzer runtime payload scan exceeded ${limits.runtimeEntries} entries: ${vendorRoot}","messagePattern":"Analyzer runtime payload scan exceeded (.+?) entries: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/analyzer-identity.ts","lineNumber":1443,"sourceCode":"): {\n  manifests: DependencyInputs['vendoredManifests'];\n  artifacts: RuntimeArtifact[];\n} {\n  const vendorRoot = path.join(packageRoot, 'vendor');\n  if (!existsSync(vendorRoot) || !lstatSync(vendorRoot).isDirectory()) {\n    recordDirectoryGuard(directoryGuards, packageRoot);\n    return { manifests: [], artifacts: [] };\n  }\n\n  const manifests: DependencyInputs['vendoredManifests'] = [];\n  const artifacts: RuntimeArtifact[] = [];\n  if (!recordDirectoryGuard(directoryGuards, vendorRoot)) {\n    throw new Error(`Analyzer vendored runtime directory is unavailable: ${vendorRoot}`);\n  }\n  const vendorEntries = readDirectory(vendorRoot, options);\n  budget.entries += vendorEntries.length;\n  if (budget.entries > limits.runtimeEntries) {\n    throw new Error(\n      `Analyzer runtime payload scan exceeded ${limits.runtimeEntries} entries: ${vendorRoot}`,\n    );\n  }\n  for (const entry of vendorEntries) {\n    if (!entry.isDirectory() || !entry.name.startsWith('tree-sitter-')) continue;\n    const grammarRoot = path.join(vendorRoot, entry.name);\n    const manifestPath = path.join(grammarRoot, 'package.json');\n    if (isFile(manifestPath)) {\n      options.onCacheMissWork?.({ kind: 'manifest-read', path: manifestPath });\n      const read = readStableFileWithinBudget(manifestPath, budget, limits.runtimeBytes);\n      manifests.push({\n        canonicalPath: `vendor:${entry.name}/package.json`,\n        absolutePath: manifestPath,\n        bytes: read.bytes,\n        state: read.state,\n      });\n    }\n    artifacts.push(","sourceCodeStart":1425,"sourceCodeEnd":1461,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/core/analyzer-identity.ts#L1425-L1461","documentation":"Thrown by collectVendoredGrammarInputs when the entry count of the vendor directory scan (vendorEntries.length plus any prior entries in the same shared budget) exceeds limits.runtimeEntries (default 250_000). It is the same ceiling as error 83 but reported against the vendor root, because the vendored-grammar scan shares the single RuntimeArtifactScanBudget with the rest of the runtime-payload traversal.","triggerScenarios":"collectVendoredGrammarInputs reads vendor/ and adds vendorEntries.length to budget.entries; if the shared budget (already charged by collectRuntimePackages' artifact scans) crosses 250k, the throw fires naming vendorRoot. A vendor/ directory with an enormous number of entries — or a budget already near the cap from the package scan — trips it.","commonSituations":"A vendored tree-sitter grammar that bundles a large test corpus or generated parser sources (hundreds of `.c` files from grammar expansion); a vendor/ directory accidentally containing a full git checkout or build output; running the scan after the package-root scan already charged most of the 250k budget.","solutions":["Measure vendor entry density: `find <packageRoot>/vendor -type f | wc -l` and identify the bloated grammar.","Prune grammar test corpora / generated parser sources not needed at runtime (move them out of vendor/ or delete before the scan).","If optional grammars are not needed for this analysis, set GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1.","Re-vendor only the runtime-essential artifacts (built `.node`, parser JSON) rather than the full grammar source tree."],"exampleFix":"// before: vendor/tree-sitter-<lang>/test/corpus/ holds 200k examples\n//   -> \"Analyzer runtime payload scan exceeded 250000 entries: /pkg/vendor\"\n//\n// after: vendor only built artifacts\n//   $ rm -rf vendor/tree-sitter-*/test vendor/tree-sitter-*/examples\n//   $ ls vendor/tree-sitter-*/  # confirm only parser + .node remain","handlingStrategy":"validation","validationCode":"const { execSync } = require('node:child_process');\nfunction assertVendorEntryCountFeasible(packageRoot, limit = 240_000) {\n  let out;\n  try {\n    out = execSync('find vendor -type f 2>/dev/null | wc -l', { cwd: packageRoot, stdio: ['ignore','pipe','ignore'] }).toString().trim();\n  } catch { return; }\n  const count = Number(out);\n  if (Number.isFinite(count) && count > limit) {\n    throw new Error(`vendor/ entry count ${count} near the shared 250000 limit; prune grammar test/example corpora.`);\n  }\n}\n// assertVendorEntryCountFeasible(process.cwd());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Vendor only built artifacts (parser JSON, .node) — not full grammar source/test/example trees.","Prune `vendor/tree-sitter-*/test` and `vendor/tree-sitter-*/examples` before identity resolution.","Set GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 when the optional grammars are not needed for this analysis.","Remember vendor shares the single 250k-entry budget with the rest of the runtime scan."],"tags":["analyzer-identity","filesystem","budget-limit","vendored-grammars"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}