abhigyanpatwari/GitNexus · error

Analyzer runtime payload scan exceeded ${limits.runtimeEntri

Error message

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

What it means

Thrown by collectArtifacts when the cumulative directory-entry count across the runtime-payload scan exceeds limits.runtimeEntries (default 250_000). Every entry of every scanned directory (minus pruned node_modules/.git/.hg/.svn) increments budget.entries; the throw prevents the identity scan from walking an unbounded file tree.

Source

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

  canonicalPrefix: string,
  directoryGuards: Map<string, DependencyDirectoryGuard>,
  options: AnalyzerIdentityResolveOptions,
  budget: RuntimeArtifactScanBudget,
  limits: AnalyzerIdentityTraversalLimits,
): RuntimeArtifact[] {
  const artifacts: RuntimeArtifact[] = [];
  const pending: Array<{ absoluteDir: string; depth: number }> = [{ absoluteDir: root, depth: 0 }];
  while (pending.length > 0) {
    const next = pending.pop();
    if (!next) break;
    const { absoluteDir, depth } = next;
    if (!recordDirectoryGuard(directoryGuards, absoluteDir)) {
      throw new Error(`Analyzer runtime payload directory is unavailable: ${absoluteDir}`);
    }
    const entries = readDirectory(absoluteDir, options);
    budget.entries += entries.length;
    if (budget.entries > limits.runtimeEntries) {
      throw new Error(
        `Analyzer runtime payload scan exceeded ${limits.runtimeEntries} entries: ${root}`,
      );
    }
    for (const entry of entries) {
      const absolutePath = path.join(absoluteDir, entry.name);
      const relativePath = path.relative(root, absolutePath).split(path.sep).join('/');
      const stat = lstatSync(absolutePath);
      // Nested dependencies are collected from their manifests as separate
      // packages. Only prune those separately traversed trees and VCS
      // metadata; generic cache/model directories can contain loadable code,
      // native addons, Wasm modules, or data consumed by the runtime.
      //
      // Pruning is decided by NAME alone. These four names never carry analyzer
      // payload in any form: `node_modules` is traversed separately through
      // `resolveDependencyPackageRoot` (which follows links and guards each
      // hop), and a `.git`/`.hg`/`.svn` entry is VCS metadata whether it is a
      // directory, a symbolic link into a shared store, or — inside a submodule
      // or linked worktree checkout — a regular file holding a gitdir pointer.

View on GitHub (pinned to d540b00184)

Solutions

  1. Identify the heavy directory: `find <packageRoot> -type f | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head` and relocate or gitignore the offender.
  2. Move generated/asset corpora out of the package root that the analyzer scans, or under a name the build consumes separately.
  3. Run `npm install --omit=dev` so dev-only source/sourcemap trees are absent.
  4. If the tree is legitimately that large, split the package so the analyzer root only sees the runtime-essential subset.

Example fix

// before: package root contains coverage/ with 300k files
//   -> "Analyzer runtime payload scan exceeded 250000 entries: /pkg"
//
// after: exclude generated dirs from the analyzer root
//   $ mv coverage/ ../coverage-archive
//   $ echo 'coverage/' >> .gitignore
Defensive patterns

Strategy: validation

Validate before calling

const { execSync } = require('node:child_process');
function assertEntryCountFeasible(packageRoot, limit = 240_000) {
  // Count non-pruned entries (exclude node_modules and VCS dirs, mirroring collectArtifacts).
  let out;
  try {
    out = execSync(
      `find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/.hg/*' -not -path '*/.svn/*' | 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(`Entry count ${count} near the 250000 analyzer limit; clean generated/asset dirs.`);
  }
}
// assertEntryCountFeasible(process.cwd());

Prevention

When it happens

Trigger: collectArtifacts walks the package root (or a dependency package root, or a vendored grammar root) recursively; each readDirectory() result length is added to budget.entries. If the scanned tree (excluding the four pruned names) holds more than 250k entries total, the next directory read pushes the counter over and throws.

Common situations: A package that ships a large generated directory inside its root (e.g. a bundled `dist` with tens of thousands of chunks, a checked-in `data/` corpus, source maps, or vendored WASM/asset trees); a dependency that itself contains a deep unminified source tree; a repository that accidentally committed `coverage/` or `node-gyp-build` artifacts alongside (not under) node_modules.

Related errors


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