abhigyanpatwari/GitNexus · error

Analyzer runtime payload scan exceeded ${limits.runtimeEntri

Error message

Analyzer runtime payload scan exceeded ${limits.runtimeEntries} entries: ${vendorRoot}

What it means

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.

Source

Thrown at gitnexus/src/core/analyzer-identity.ts:1443

): {
  manifests: DependencyInputs['vendoredManifests'];
  artifacts: RuntimeArtifact[];
} {
  const vendorRoot = path.join(packageRoot, 'vendor');
  if (!existsSync(vendorRoot) || !lstatSync(vendorRoot).isDirectory()) {
    recordDirectoryGuard(directoryGuards, packageRoot);
    return { manifests: [], artifacts: [] };
  }

  const manifests: DependencyInputs['vendoredManifests'] = [];
  const artifacts: RuntimeArtifact[] = [];
  if (!recordDirectoryGuard(directoryGuards, vendorRoot)) {
    throw new Error(`Analyzer vendored runtime directory is unavailable: ${vendorRoot}`);
  }
  const vendorEntries = readDirectory(vendorRoot, options);
  budget.entries += vendorEntries.length;
  if (budget.entries > limits.runtimeEntries) {
    throw new Error(
      `Analyzer runtime payload scan exceeded ${limits.runtimeEntries} entries: ${vendorRoot}`,
    );
  }
  for (const entry of vendorEntries) {
    if (!entry.isDirectory() || !entry.name.startsWith('tree-sitter-')) continue;
    const grammarRoot = path.join(vendorRoot, entry.name);
    const manifestPath = path.join(grammarRoot, 'package.json');
    if (isFile(manifestPath)) {
      options.onCacheMissWork?.({ kind: 'manifest-read', path: manifestPath });
      const read = readStableFileWithinBudget(manifestPath, budget, limits.runtimeBytes);
      manifests.push({
        canonicalPath: `vendor:${entry.name}/package.json`,
        absolutePath: manifestPath,
        bytes: read.bytes,
        state: read.state,
      });
    }
    artifacts.push(

View on GitHub (pinned to d540b00184)

Solutions

  1. Measure vendor entry density: `find <packageRoot>/vendor -type f | wc -l` and identify the bloated grammar.
  2. Prune grammar test corpora / generated parser sources not needed at runtime (move them out of vendor/ or delete before the scan).
  3. If optional grammars are not needed for this analysis, set GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1.
  4. Re-vendor only the runtime-essential artifacts (built `.node`, parser JSON) rather than the full grammar source tree.

Example fix

// before: vendor/tree-sitter-<lang>/test/corpus/ holds 200k examples
//   -> "Analyzer runtime payload scan exceeded 250000 entries: /pkg/vendor"
//
// after: vendor only built artifacts
//   $ rm -rf vendor/tree-sitter-*/test vendor/tree-sitter-*/examples
//   $ ls vendor/tree-sitter-*/  # confirm only parser + .node remain
Defensive patterns

Strategy: validation

Validate before calling

const { execSync } = require('node:child_process');
function assertVendorEntryCountFeasible(packageRoot, limit = 240_000) {
  let out;
  try {
    out = execSync('find vendor -type f 2>/dev/null | wc -l', { cwd: packageRoot, stdio: ['ignore','pipe','ignore'] }).toString().trim();
  } catch { return; }
  const count = Number(out);
  if (Number.isFinite(count) && count > limit) {
    throw new Error(`vendor/ entry count ${count} near the shared 250000 limit; prune grammar test/example corpora.`);
  }
}
// assertVendorEntryCountFeasible(process.cwd());

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/cd874967aa8715b0. Report an issue: GitHub.