Version
main @ e678b2b (v0.9.0-221)
Platform
macOS (Apple Silicon)
Install channel
GitHub release archive / install.sh / install.ps1
Binary variant
standard
What happened, and what did you expect?
In a production Next.js/React 19 monorepo (pnpm workspaces, ~2,800 nodes indexed), the graph contains only 10 HTTP_CALLS edges — all literal page paths from tests (/en-gb/slots, /games/list, …). None of the application's actual API calls are extracted, because every endpoint is a template literal composed from module-level string constants.
With the callee side now minting Route nodes correctly (#1059), this caller-side gap is the last blocker for CROSS_HTTP_CALLS: the linking pass still produces zero edges fleet-wide. Possibly related to the native-fetch under-extraction tracked in #856 / #706, but this is specifically about template-literal URL composition.
Suggested handling (in increasing order of ambition)
- Constant folding of template literals: when every
${...} part of a template literal resolves (within the module, or via an imported const) to a compile-time string, fold and extract the result. `${BASE}/users/me` with const BASE = 'api' → api/users/me. This alone covers the central-endpoints-map idiom below — the most common frontend pattern we know of.
- Imported-constant resolution at the call site:
fetch(API_ENDPOINTS.USER) / client.post(API_ENDPOINTS.GAME_LAUNCH_URL, ...) — resolve the member access to the folded constant from step 1 across module boundaries.
- Unresolvable-prefix canonicalization: when a leading
${...} can't be folded (e.g. ${getApiBaseUrl()}), mint the edge with the resolvable suffix (/api/users/me) and mark the prefix as dynamic (property url_prefix_dynamic: true), so cross-repo matching can still suffix-match against Route identities.
Steps 1+2 would take our monorepo from 0 extracted API calls to full coverage of the endpoints table; step 3 covers the wrapper-client pattern generically.
Environment
Next.js / React 19 micro-frontends, pnpm workspaces; calls via native fetch and a thin axios-style wrapper. Built from source on Linux x86_64, gcc, make -f Makefile.cbm cbm.
Reproduction
- Code: dummy snippet (mirrors our real endpoint-constants module + call sites):
endpoints.ts:
const BASE = 'api'
export const API_ENDPOINTS = {
LOGIN: `${BASE}/users/login`,
USER: `${BASE}/users/me`,
GAME_LAUNCH_URL: `${BASE}/games/launch`,
}
export const getApiBaseUrl = () => `${API_PROTOCOL}://${process.env.API_DOMAIN}/`
client.ts:
import { API_ENDPOINTS, getApiBaseUrl } from './endpoints'
const response = await fetch(`${getApiBaseUrl()}/${API_ENDPOINTS.USER}`, { method: 'GET' })
const result = await apiClient.post(API_ENDPOINTS.GAME_LAUNCH_URL, payload)
-
Command: codebase-memory-mcp cli index_repository --repo-path . then
codebase-memory-mcp cli query_graph with MATCH ()-[r:HTTP_CALLS]->() RETURN r.url_path
-
Result: no HTTP_CALLS edge for any of these call sites (only unrelated literal-string paths from tests are minted) / Expected: edges with url_path api/users/me, api/games/launch (or suffix-canonicalized equivalents)
Logs
Diagnostics trajectory (memory / performance / leak issues)
Project scale (if relevant)
2,845 nodes / 5,476 edges (Next.js pnpm-workspaces monorepo)
Confirmations
Version
main @ e678b2b (v0.9.0-221)
Platform
macOS (Apple Silicon)
Install channel
GitHub release archive / install.sh / install.ps1
Binary variant
standard
What happened, and what did you expect?
In a production Next.js/React 19 monorepo (pnpm workspaces, ~2,800 nodes indexed), the graph contains only 10
HTTP_CALLSedges — all literal page paths from tests (/en-gb/slots,/games/list, …). None of the application's actual API calls are extracted, because every endpoint is a template literal composed from module-level string constants.With the callee side now minting Route nodes correctly (#1059), this caller-side gap is the last blocker for
CROSS_HTTP_CALLS: the linking pass still produces zero edges fleet-wide. Possibly related to the native-fetch under-extraction tracked in #856 / #706, but this is specifically about template-literal URL composition.Suggested handling (in increasing order of ambition)
${...}part of a template literal resolves (within the module, or via an importedconst) to a compile-time string, fold and extract the result.`${BASE}/users/me`withconst BASE = 'api'→api/users/me. This alone covers the central-endpoints-map idiom below — the most common frontend pattern we know of.fetch(API_ENDPOINTS.USER)/client.post(API_ENDPOINTS.GAME_LAUNCH_URL, ...)— resolve the member access to the folded constant from step 1 across module boundaries.${...}can't be folded (e.g.${getApiBaseUrl()}), mint the edge with the resolvable suffix (/api/users/me) and mark the prefix as dynamic (propertyurl_prefix_dynamic: true), so cross-repo matching can still suffix-match against Route identities.Steps 1+2 would take our monorepo from 0 extracted API calls to full coverage of the endpoints table; step 3 covers the wrapper-client pattern generically.
Environment
Next.js / React 19 micro-frontends, pnpm workspaces; calls via native
fetchand a thin axios-style wrapper. Built from source on Linux x86_64, gcc,make -f Makefile.cbm cbm.Reproduction
endpoints.ts:client.ts:Command:
codebase-memory-mcp cli index_repository --repo-path .thencodebase-memory-mcp cli query_graphwithMATCH ()-[r:HTTP_CALLS]->() RETURN r.url_pathResult: no HTTP_CALLS edge for any of these call sites (only unrelated literal-string paths from tests are minted) / Expected: edges with url_path
api/users/me,api/games/launch(or suffix-canonicalized equivalents)Logs
Diagnostics trajectory (memory / performance / leak issues)
Project scale (if relevant)
2,845 nodes / 5,476 edges (Next.js pnpm-workspaces monorepo)
Confirmations