Egonex-AI/Understand-Anything · error
assembled-graph.json is missing or invalid; baseline not adv
Error message
assembled-graph.json is missing or invalid; baseline not advanced
What it means
For non-SKIP actions (reanalysis), finalize reads assembled-graph.json from the intermediate directory, which holds the merged output of the per-file analysis agents. If that file is missing or lacks valid nodes/edges arrays, the script throws instead of writing a partially updated graph, leaving the baseline unadvanced so the next run redoes the work.
Source
Thrown at understand-anything-plugin/skills/understand/finalize-incremental.mjs:428
if (!previousGraph || !Array.isArray(previousGraph.nodes) || !Array.isArray(previousGraph.edges)) {
throw new Error('knowledge-graph.json is missing or invalid; baseline not advanced');
}
const refreshedGraph = refreshGraphImports(
previousGraph,
scan.importMap ?? {},
importMapRefreshPaths,
);
atomicWriteJson(graphPath, {
...refreshedGraph,
project: projectMetadata(previousGraph.project, plan, scan),
});
}
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'))) {View on GitHub (pinned to 07edf82a04)
Solutions
- Rerun the incremental analysis steps (file-analyzer / graph assembly) so assembled-graph.json is regenerated, then finalize
- Validate the file before finalizing: node -e "const a=require('./.ua/intermediate/assembled-graph.json'); if(!Array.isArray(a.nodes)||!Array.isArray(a.edges)) process.exit(1)"
- If intermediates were cleaned prematurely, restart the incremental run from planning; the unadvanced baseline ensures files are reanalyzed
- Check for concurrent runs locking .ua/intermediate/ and serialize /understand invocations
Example fix
// before: finalizing without the assembled artifact
node finalize-incremental.mjs .
// Error: assembled-graph.json is missing or invalid; baseline not advanced
// after: guard in automation
if (!fs.existsSync('.ua/intermediate/assembled-graph.json')) {
await rerunIncrementalAnalysis();
}
await run('node finalize-incremental.mjs .'); Defensive patterns
Strategy: validation
Validate before calling
const p = '.ua/intermediate/assembled-graph.json';
if (!fs.existsSync(p)) throw new Error('Analysis assembly did not run; rerun incremental pipeline');
const a = JSON.parse(fs.readFileSync(p, 'utf8'));
if (!Array.isArray(a.nodes) || !Array.isArray(a.edges)) throw new Error('Malformed assembled graph'); Type guard
const isValidAssembledGraph = (a) => !!a && Array.isArray(a.nodes) && Array.isArray(a.edges);
Try / catch
try {
await run('node finalize-incremental.mjs .');
} catch (err) {
if (String(err.message).includes('assembled-graph.json is missing or invalid')) {
await rerunIncrementalAnalysisSteps();
await run('node finalize-incremental.mjs .');
} else throw err;
} Prevention
- Run planning, analysis, assembly, and finalize as one uninterrupted sequence
- Do not clean .ua/intermediate/ until finalize succeeds
- Ensure analyzer agents complete before finalizing (check their exit codes)
- Avoid concurrent /understand runs on the same project
When it happens
Trigger: The incremental analysis agents failed or were interrupted before writing assembled-graph.json; the file was cleaned from .ua/intermediate/ mid-run; the assembler wrote malformed JSON without nodes/edges arrays; finalize was invoked manually without running the analysis steps first.
Common situations: LLM agent step crashed or timed out; user ran finalize-incremental.mjs standalone after clearing intermediate files; disk-full or permission error truncated the assembler write; concurrency between two runs deleted the artifact.
Related errors
- knowledge-graph.json is missing or invalid; baseline not adv
- Fingerprint patch does not match the incremental plan commit
- FULL_UPDATE must run the full /understand pipeline
- Assembled graph is missing whole-file nodes for analyzed pat
- Architecture update requires layers.json; baseline not advan
AI-assisted analysis of Egonex-AI/Understand-Anything@07edf82a04 (2026-09-07).
Data as JSON: /api/errors/9d84b4dec176e467.
Report an issue: GitHub.