Files
codebase-memory-mcp/tests
Martin Vogel 085b4a718c fix(pipeline): unify LSP-override resolver across sequential and parallel paths
The sequential pass_calls and the parallel cbm_parallel_extract pipelines
each carried their own copy of the LSP-resolved-call lookup with
divergent confidence floors and different match semantics. Most production
indexing runs the parallel path, so projects produced different
CALLS-edge attributions depending on which pipeline mode kicked in:

  pass_calls.c   find_lsp_resolution      floor 0.6  (CBM_LSP_CONFIDENCE_FLOOR)
  pass_parallel  lsp_override_resolution_pp  floor 0.5  (hardcoded)

Both pipelines correctly invoke cbm_run_*_lsp through cbm_extract_file,
so result->resolved_calls is populated identically — the bug was at the
consumer.

Changes
-------

- New src/pipeline/lsp_resolve.h: static-inline cbm_pipeline_find_lsp_resolution
  and CBM_LSP_CONFIDENCE_FLOOR (0.6f). Single source of truth for the
  match rule (caller_qn equality + callee_qn short-name match + floor),
  with rationale and language-coverage notes inline.

- pass_calls.c: include lsp_resolve.h, drop the local copy, rename the
  call site to cbm_pipeline_find_lsp_resolution.

- pass_parallel.c: include lsp_resolve.h, drop lsp_override_resolution_pp,
  use cbm_pipeline_find_lsp_resolution at resolve_file_calls. Add an
  int lsp_overrides counter to resolve_worker_state_t (with adjusted
  cache-line padding for the new field), aggregate it per-worker,
  and emit it in the parallel.resolve.done log line so divergence
  between pipelines becomes observable in production telemetry.

- tests/test_parallel.c: parallel_python_lsp_override_emits_lsp_strategy_edges
  builds a single-file Python scenario (Greeter class + main() in one
  file), runs the parallel pipeline, walks every CALLS edge, asserts
  at least one carries an "lsp_*" strategy in its properties_json.
  Pins both halves of the wiring at once: the shared find helper IS
  consulted in the parallel path, AND the LSP-attributed strategy
  survives all the way to the gbuf edge. Single-file rather than
  cross-file because per-file py_lsp's resolved_calls callee_qn uses
  the import module path rather than the project-qualified QN, so
  cross-file LSP edges currently get dropped by cbm_gbuf_find_by_qn —
  a separate cross-file QN-mismatch bug to track elsewhere.

Full suite: 3250 passed, 0 failed (was 3249; +1 new regression test).
2026-05-09 18:11:23 +02:00
..
2026-04-15 23:56:03 +02:00