Files
codebase-memory-mcp/tests/repro
Martin Vogel 751752bd21 fix(fqn): preserve full filename in File-node QNs so sibling files don't collide
cbm_pipeline_fqn_compute stripped the file extension for EVERY qualified
name, including File-node QNs (name=="__file__"). Two different files
whose names share a stem therefore collided on the File QN and the
graph kept only one node per stem:

- .env / .env.local / .env.production all strip to ".env" — only one
  survives per directory (#1077).
- a C/C++ header and its same-stem source (NodeController.h vs .cpp)
  strip to the same stem, so the header got no File node of its own,
  leaving it disconnected (#964's remaining half after #983 fixed the
  include→Class resolution).

File-node QNs now keep the full filename (tokenize_path splits on '/'
only, so the extension rides in the last segment and stays unique).
Extension stripping is retained for MODULE/symbol QNs (name==NULL or a
symbol name) — that stem unification is load-bearing for C/C++
declaration↔definition cross-file resolution, and is left untouched.
All 26 __file__ QN sites route through this one function, so node
creation and every lookup stay consistent.

Reproduce-first:
- fqn_file_qn_preserves_dotfile_variants_issue1077 and
  fqn_file_qn_distinguishes_same_stem_header_source_issue964 assert the
  distinct File QNs (RED before: both collide to the stripped stem).
- fqn_module_qn_still_strips_extension guards that module QNs are
  unaffected.
- repro_issue964 now asserts the header keeps its own File node AND is
  connected (CONTAINS_FILE + DEFINES the class it declares), matching
  the reporter's zero-inbound disconnection metric — GREEN.

Closes #1077
Closes #964

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-16 01:21:45 +02:00
..