Files
codebase-memory-mcp/tests
Martin VogelandRithvikReddy0-0 1d5fd65602 fix(cross-repo): normalize URLs, match templates, run both directions
Distills the pass_cross_repo.c half of #536; the pass_calls.c half landed
separately as beaa776 (broader: covers the parallel path too).

match_http_routes could not match a stored HTTP_CALLS url_path that was a
full URL (scheme://host:port/path is stored raw from the call's first
string argument), never matched a concrete client path against a templated
route QN, and only ran consumer->provider, so a provider-side run found
nothing - and worse, destroyed previously recorded links: delete_cross_edges
wiped the provider's reverse edges and nothing recreated them.

- cr_url_path(): strip scheme://host[:port] before route-QN construction;
  a bare base URL maps to the root route path.
- cr_path_matches_template() + find_route_handler_fuzzy(): segment-wise
  fallback so /v2/orders/123 matches /v2/orders/{} (method-gated, only for
  edges the exact lookup missed; O(calls x routes) per project pair,
  bounded by CR_MAX_EDGES).
- Reverse-direction match_http_routes run so provider-side invocations
  find the consumer's HTTP_CALLS and re-create the wiped reverse edges.
  Row dedup needs no insert guard: the edges table upserts on its
  (source_id, target_id, type) UNIQUE key.

Four reproduce-first tests in tests/repro/repro_issue523.c (scheme-strip,
template fuzzy match, provider-side run, bidirectional convergence), all
red on the previous code, green with the fix.

Refs #523

Co-authored-by: RithvikReddy0-0 <rithvikreddymukkara@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-07-03 19:53:37 +02:00
..
2026-06-28 13:05:05 +02:00
2026-06-03 02:13:30 +02:00