abhigyanpatwari/GitNexus · warning

callable-value-flow: candidate set exceeded the cap; no part

Error message

callable-value-flow: candidate set exceeded the cap; no partial CALLS emitted

What it means

The callable-value-flow pass bounds how many candidate targets one callable site may have (MAX_CALLABLE_VALUE_TARGETS, default 32, overridable via GITNEXUS_MAX_CALLABLE_VALUE_TARGETS). Above the cap the site is treated as overflowed and NO CALLS edges are emitted for it — a deliberate cliff, not a partial emit. The onWarn surfaces the site so the lost call chain is visible.

Source

Thrown at gitnexus/src/core/ingestion/scope-resolution/pipeline/run.ts:1238

      {
        lang: provider.language,
        skippedKeys: propertyDispatch.skippedKeys,
        skippedKeyNames: propertyDispatch.skippedKeyNames,
        fanoutCap: MAX_PROPERTY_DISPATCH_FANOUT,
      },
      'property-dispatch: keys over the fan-out cap were dropped (no CALLS synthesized for them)',
    );
  }
  const callableValueFlow =
    calleeIdAccumulator === undefined
      ? {
          emitted: 0,
          resolvedInvokes: 0,
          ambiguousInvokes: 0,
          unmatchedInvokes: 0,
          iterations: 0,
        }
      : emitCallableValueFlow({
          graph,
          scopes: indexes,
          parsedFiles: emitParsedFiles,
          nodeLookup: postHeritageNodeLookup,
          calleeIds: calleeIdAccumulator,
          language: provider.language,
          collapseByCallerTarget: provider.collapseMemberCallsByCallerTarget === true,
          isCallableValueTarget: provider.isCallableValueTarget,
          hasFileLocalCallableLinkage: provider.hasFileLocalCallableLinkage,
          deferredIndirectSites,
          callSignaturesBySite: deferredIndirectCollection.callSignaturesBySite,
          onWarn: (warning) =>
            logger.warn(
              warning,
              'callable-value-flow: candidate set exceeded the cap; no partial CALLS emitted',
            ),
        });
  const importsEmitted = callableFlowOnly

View on GitHub (pinned to 0d1aed942f)

Solutions

  1. Set GITNEXUS_MAX_CALLABLE_VALUE_TARGETS above the widest site's candidate count (e.g. 64–128) and re-run analyze
  2. Use the warning payload's context field to find the offending site, then narrow it in your own code (distinct names instead of one binding accumulating 33+ callables)
  3. Verify recovery with context()/impact() on a call site that previously missed its targets
  4. Keep the override proportional — every lifted site multiplies CALLS edges during emit

Example fix

# before
export GITNEXUS_MAX_CALLABLE_VALUE_TARGETS=   # unset → default 32, site overflowed
npx gitnexus analyze
# after
export GITNEXUS_MAX_CALLABLE_VALUE_TARGETS=96
npx gitnexus analyze   # overflowed site's CALLS chain emitted
Defensive patterns

Strategy: validation

Validate before calling

// Check the warn payload fields before relying on callable-flow coverage:
// the message carries { language, context, candidateCount, cap }.
const dropped = logLines.filter((l) => l.msg?.includes('callable-value-flow: candidate set exceeded'));
if (dropped.length > 0) {
  console.warn('sites losing CALLS:', dropped.map((d) => d.context));
}

Prevention

When it happens

Trigger: Emit-phase indexing where one callable value site (a variable/name bound to 33+ candidate callables, e.g. wide reassignment or a large dispatch table) overflows the bucket; the pass calls onWarn with a payload containing language, context (site description), candidateCount, and cap, which run.ts logs under this message.

Common situations: Repos with wide callable registries (function tables keyed by name), heavily overloaded dynamic assignment patterns, migration/utility modules re-exporting dozens of functions through one binding, or a lowered cap env value.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@0d1aed942f (2026-08-20). Data as JSON: /api/errors/9b8bb2520703ad3c. Report an issue: GitHub.