abhigyanpatwari/GitNexus · error · Error
Invoked analyzer artifact is absent from the validated build
Error message
Invoked analyzer artifact is absent from the validated build: ${invokedArtifactPath} What it means
Thrown by resolveAnalyzerRunnerIdentity when the invoked analyzer artifact path (derived from process.argv[1] if it is inside buildRoot, else the analyzerModulePath) is not found among the validated build entries. cachedBuildDigestForPath returns null when the path is not isInside(buildRoot) or no build entry of kind 'file' matches its relative path. The identity cannot be issued without a digest for the very module being executed.
Source
Thrown at gitnexus/src/core/analyzer-identity.ts:2769
packageVersion,
buildKind: kind,
buildCanonicalization: BUILD_CANONICALIZATION,
dependencyCanonicalization: DEPENDENCY_RUNTIME_CANONICALIZATION,
traversalLimits,
runtimeVariant,
buildRootState: build.rootState,
buildDigest: build.digest,
buildEntries: build.entries,
buildDirectoryGuards: build.directoryGuards,
dependencyIdentity: dependency.identity,
dependencyFileGuards: dependencyFileGuards(dependencyInputs),
dependencyDirectoryGuards: dependencyDirectoryGuards(dependencyInputs),
dependencyPathGuards: dependencyPathGuards(dependencyInputs),
artifactEntries: dependency.entries,
};
const invokedDigest = cachedBuildDigestForPath(nextCache, invokedArtifactPath);
if (!invokedDigest) {
throw new Error(
`Invoked analyzer artifact is absent from the validated build: ${invokedArtifactPath}`,
);
}
const identity: AnalyzerRunnerIdentity = {
schemaVersion: ANALYZER_RUNNER_IDENTITY_SCHEMA_VERSION,
runtime: runnerRuntimeIdentity(runtimeVariant),
cliVersion: packageVersion,
invokedArtifact: {
path: invokedArtifactPath,
digest: invokedDigest,
},
build: {
kind,
rootPath: buildRoot,
canonicalization: BUILD_CANONICALIZATION,
digest: build.digest,
},
dependencyRuntime: dependency.identity,View on GitHub (pinned to d540b00184)
Solutions
- Invoke the analyzer from its built artifact, not its source: `node dist/cli.js` (or the published bin) instead of `tsx src/cli.ts`.
- Confirm invokedArtifactPath is inside buildRoot: `node -e "console.log(require('path').relative('<buildRoot>','<artifact>'))"` should yield a non-`..` relative path.
- Rebuild so the artifact exists in the build output: `npm run build` then retry.
- If using a symlinked bin, ensure the resolved real path still lies under buildRoot.
Example fix
// before: invoking source via tsx // $ tsx gitnexus/src/cli.ts analyze // -> "Invoked analyzer artifact is absent from the validated build: /repo/gitnexus/src/cli.ts" // // after: invoke the built artifact // $ npm --prefix gitnexus run build // $ node gitnexus/dist/cli.js analyze
Defensive patterns
Strategy: validation
Validate before calling
const fs = require('node:fs');
const path = require('node:path');
function assertInvokedArtifactInBuild(buildRoot, analyzerModuleUrl) {
const { fileURLToPath } = require('node:url');
const analyzerPath = path.resolve(fileURLToPath(analyzerModuleUrl));
const buildResolved = path.resolve(buildRoot);
const rel = path.relative(buildResolved, analyzerPath);
if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel)) {
throw new Error(`Analyzer module ${analyzerPath} is not under build root ${buildResolved}; invoke the built artifact.`);
}
const st = fs.lstatSync(analyzerPath);
if (!st.isFile()) throw new Error(`${analyzerPath} is not a regular file`);
}
// assertInvokedArtifactInBuild(buildRoot, import.meta.url); Prevention
- Invoke the analyzer from its built artifact (dist/...), not its source (src/...).
- Run `npm run build` before invoking; do not run via tsx/ts-node against source for identity resolution.
- Ensure symlinked bins resolve to a real path inside buildRoot.
- Confirm process.argv[1] (the entry) is the built file when relying on the default invoked-artifact resolution.
When it happens
Trigger: After the build is hashed and the nextCache assembled, cachedBuildDigestForPath(nextCache, invokedArtifactPath) is called. It returns null if invokedArtifactPath is outside buildRoot, or if its relativePath does not match any buildEntries file (e.g. the entry was pruned, the path points at a source file outside the build output, or buildRoot was mis-resolved).
Common situations: Invoking the analyzer from its TypeScript source (via tsx/ts-node) so analyzerModulePath points at `src/...` while buildRoot was resolved as `dist/`; running a stale shim whose target moved; a buildRoot that was resolved from a symlinked location so isInside returns false; an artifact path with a `..` traversal that resolves outside buildRoot; running the analyzer after `tsc` but pointing at the pre-build source.
Related errors
- Analyzer build changed while its identity was being computed
- Analyzer dependency graph exceeded ${limits.runtimeEdges} ed
- Analyzer dependency graph exceeded ${limits.runtimePackages}
- Analyzer runtime payload directory is unavailable: ${absolut
- Analyzer runtime payload scan exceeded ${limits.runtimeEntri
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/4702d82867cc30bc.
Report an issue: GitHub.