Egonex-AI/Understand-Anything · error
Assembled graph is missing whole-file nodes for analyzed pat
Error message
Assembled graph is missing whole-file nodes for analyzed paths: ${missingAnalyzedPaths.join(', ')}; baseline not advanced What it means
After assembling the updated graph, finalize verifies that every path in plan.filesToReanalyze has whole-file node coverage in the assembled output (via hasAnalyzedFileCoverage). If any reanalyzed file produced no corresponding whole-file node, the graph would silently lose coverage for that file, so the script throws and leaves the baseline unadvanced. This is an anti-data-loss invariant for incremental updates.
Source
Thrown at understand-anything-plugin/skills/understand/finalize-incremental.mjs:441
if (plan.action !== 'SKIP') {
const previousGraph = readJson(graphPath, {});
const assembledRaw = readJson(join(intermediateDir, 'assembled-graph.json'));
if (!assembledRaw || !Array.isArray(assembledRaw.nodes) || !Array.isArray(assembledRaw.edges)) {
throw new Error('assembled-graph.json is missing or invalid; baseline not advanced');
}
const assembled = refreshGraphImports(
normalizeAssembled(assembledRaw),
scan.importMap ?? {},
importMapRefreshPaths,
);
const nodeIds = new Set(assembled.nodes.map(node => node.id));
const pathIndex = buildPathIndex(assembled.nodes);
const missingAnalyzedPaths = plan.filesToReanalyze.filter(
path => !hasAnalyzedFileCoverage(assembled.nodes, path),
);
if (missingAnalyzedPaths.length > 0) {
throw new Error(
`Assembled graph is missing whole-file nodes for analyzed paths: ` +
`${missingAnalyzedPaths.join(', ')}; baseline not advanced`,
);
}
if (plan.rerunArchitecture && !existsSync(join(intermediateDir, 'layers.json'))) {
throw new Error('Architecture update requires layers.json; baseline not advanced');
}
if (plan.rerunTour && !existsSync(join(intermediateDir, 'tour.json'))) {
throw new Error('Architecture update requires tour.json; baseline not advanced');
}
const rawLayers = plan.rerunArchitecture
? readJson(join(intermediateDir, 'layers.json'))
: previousGraph.layers ?? [];
const rawTour = plan.rerunTour
? readJson(join(intermediateDir, 'tour.json'))
: previousGraph.tour ?? [];
const now = new Date().toISOString();
const graph = {View on GitHub (pinned to 07edf82a04)
Solutions
- Regenerate the incremental plan so filesToReanalyze matches files that actually exist, then rerun analysis and finalize
- Check the listed missing paths: if files were deleted/renamed, replan instead of reusing the stale plan
- Inspect the analyzer logs for the listed paths to find parse failures, then fix or exclude those files
- Ensure path normalization (forward slashes, relative to project root) matches between plan, scan, and assembler
Example fix
// before: plan references a deleted file "filesToReanalyze": ["src/old-name.ts"] // file no longer exists // Error: Assembled graph is missing whole-file nodes for analyzed paths: src/old-name.ts ... // after: replan so deleted files are excluded rm .ua/intermediate/incremental-plan.json && rerun /understand incremental // plan.filesToReanalyze now reflects the current tree
Defensive patterns
Strategy: validation
Validate before calling
const plan = JSON.parse(fs.readFileSync('.ua/intermediate/incremental-plan.json','utf8'));
const missing = plan.filesToReanalyze.filter(p => !fs.existsSync(path.join(projectRoot, p)));
if (missing.length) throw new Error(`Stale plan paths (deleted/renamed): ${missing.join(', ')}; replan first`); Type guard
const hasFullCoverage = (assembled, plan) => plan.filesToReanalyze.every(p => assembled.nodes.some(n => n.path === p && n.type === 'file'));
Try / catch
try {
await run('node finalize-incremental.mjs .');
} catch (err) {
if (String(err.message).includes('missing whole-file nodes for analyzed paths')) {
fs.rmSync('.ua/intermediate/incremental-plan.json', { force: true });
await replanAndRerunIncremental();
} else throw err;
} Prevention
- Replan after any file rename/delete instead of reusing a stale plan
- Check analyzer output for skipped or failed files before finalizing
- Normalize paths to forward slashes relative to project root everywhere
- Rerun the pipeline rather than forcing finalize when this invariant trips; the baseline stays safe by design
When it happens
Trigger: An analysis agent returned an empty or partial result for one of plan.filesToReanalyze; a renamed/deleted file is still listed in filesToReanalyze; the assembler dropped nodes for files whose parsing failed; path casing/normalization mismatches make hasAnalyzedFileCoverage miss the node.
Common situations: File deleted from the working tree after planning but before analysis; syntax-error or unsupported-language file the analyzer skips; Windows/POSIX path separator differences; merge that both renamed and modified files, so the plan references the old path.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- knowledge-graph.json is missing or invalid; baseline not adv
- assembled-graph.json is missing or invalid; baseline not adv
- Invalid knowledge graph: ${result.fatal ?? "unknown error"}
- Invalid domain graph: ${result.fatal ?? "unknown error"}
- Freshness response was malformed
AI-assisted analysis of Egonex-AI/Understand-Anything@07edf82a04 (2026-09-07).
Data as JSON: /api/errors/b783bbc22d4b169c.
Report an issue: GitHub.