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.

fix(k8s): address QA round 3 findings

Shane McCarron94882c26f9f3
diff --git a/src/pipeline/pipeline_incremental.c b/src/pipeline/pipeline_incremental.c
index 85443bec4..1799f8389 100644
--- a/src/pipeline/pipeline_incremental.c
+++ b/src/pipeline/pipeline_incremental.c
@@ -265,8 +265,16 @@ int cbm_pipeline_run_incremental(cbm_pipeline_t *p, const char *db_path, cbm_fil
cbm_log_info("pass.timing", "pass", "incr_semantic", "elapsed_ms",
itoa_buf((int)elapsed_ms(t)));
+ /* k8s pass runs after semantic (vs. after definitions in the full pipeline) because
+ * incremental has no parallel extraction phase to position it alongside.
+ * Note: File→Resource DEFINES edges and cross-file kustomize IMPORTS edges are not
+ * emitted here — File nodes (from pass_structure) are absent in the incremental gbuf,
+ * and gbuf_find_by_qn only resolves nodes from changed files. This is a known
+ * structural limitation of the incremental architecture. */
cbm_clock_gettime(CLOCK_MONOTONIC, &t);
- cbm_pipeline_pass_k8s(&ctx, changed_files, ci);
+ if (cbm_pipeline_pass_k8s(&ctx, changed_files, ci) != 0) {
+ cbm_log_info("incremental.warn", "msg", "k8s_pass_failed");
+ }
cbm_log_info("pass.timing", "pass", "incr_k8s", "elapsed_ms", itoa_buf((int)elapsed_ms(t)));
/* Merge new nodes/edges from gbuf into disk DB */
diff --git a/tests/test_pipeline.c b/tests/test_pipeline.c
index 353b6af06..140a267ba 100644
--- a/tests/test_pipeline.c
+++ b/tests/test_pipeline.c
@@ -5197,8 +5197,7 @@ TEST(incremental_kustomize_module_indexed) {
cbm_store_find_nodes_by_label(s, project, "Module", &nodes, &count);
bool found_kust = false;
for (int i = 0; i < count; i++) {
- if (nodes[i].properties_json &&
- strstr(nodes[i].properties_json, "kustomize")) {
+ if (nodes[i].properties_json && strstr(nodes[i].properties_json, "kustomize")) {
found_kust = true;
break;
}