Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Merge origin/main into fix/sequential-definitions-retention

Martin Vogel70c7d456c2ba
diff --cc src/pipeline/pass_definitions.c
index dd00da45c,ed60d3f9a..4d544fc7f
--- a/src/pipeline/pass_definitions.c
+++ b/src/pipeline/pass_definitions.c
@@@ -770,9 -998,8 +998,9 @@@ int cbm_pipeline_pass_definitions(cbm_p
cbm_free_result(local_cache[j]);
}
}
- free(local_cache);
+ cbm_free(CBM_MEM_CLASS_EXTRACT, local_cache);
}
+ cbm_work_arena_release();
return CBM_NOT_FOUND;
}
@@@ -888,8 -1146,13 +1152,14 @@@
cbm_free_result(result);
}
}
+ cbm_work_arena_release(); /* the working arena compaction kept between files */
+ /* Every file's nodes exist now: link methods and diagram elements to
+ * their parents (without the cache each file linked its own above). */
+ if (local_cache) {
+ link_cached_def_parents(ctx, local_cache, file_count);
+ }
+
/* Phase 2: now that all extraction results are cached and Module
* nodes for every file are in the graph, walk the cache again to
* create IMPORTS / channel edges. Imports resolve against the full
diff --cc tests/test_parallel.c
index 3b8a6f31b,a641e7e0e..9dad1591c
--- a/tests/test_parallel.c
+++ b/tests/test_parallel.c
@@@ -4675,9 -5599,9 +5658,10 @@@ SUITE(parallel)
RUN_TEST(parallel_total_edges);
RUN_TEST(parallel_spill_mode_builds_the_same_graph);
RUN_TEST(parallel_post_extract_projection_spills_before_resolve);
+ RUN_TEST(sequential_definitions_cache_drops_trees_and_compacts);
RUN_TEST(parallel_empty_files);
RUN_TEST(parallel_args_json_no_overflow);
+ RUN_TEST(parallel_wide_definition_keeps_fp_sp_bt_f14);
/* Cleanup shared state */
parity_teardown();