Feature: HANDLES edges and per-registration data for generic router.add(method, path, handler) registrations (TypeScript)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by tracing TypeScript route extraction and the framework-specific registration patterns that create Route nodes and HANDLES edges; the issue does not name source files or tests. Reproduce the reported generic router.add(method, path, handler) case and inspect how call-site arguments are stored on CALLS edges. Done means each method and path produces a route with its registration location and a HANDLES edge to the relevant handler target.
由索引模型根据 Issue 内容生成。
描述
Feature request: HANDLES edges for generic router.add(method, path, handler) registrations
Version: codebase-memory-mcp v0.12.1 (linux-amd64-portable), TypeScript project.
What happens
A hand-written router registers routes with a plain method call. The indexer creates the Route nodes
(path parameters normalised to {}), but no HANDLES edge from the route to the handler function, and the
Route node carries no method, file or line. Only framework-specific registrations (Express, Fastify, ...)
get HANDLES.
Minimal example
// router.ts
export class Router {
add(method: string, path: string, handler: (req: Request, ctx: { params: Record<string, string> }) => Promise<Response>) { /* ... */ }
}
// routes.ts
import { Router } from './router'
export async function replaceCredential(providerId: string, req: Request): Promise<Response> { /* ... */ }
export async function clearCredential(providerId: string, req: Request): Promise<Response> { /* ... */ }
export function registerRoutes(router: Router) {
router.add('PUT', '/v1/connections/:providerId/credential', async (req, ctx) => {
if (!authorize(req)) return unauthorized()
return replaceCredential(ctx.params.providerId, req)
})
router.add('DELETE', '/v1/connections/:providerId/credential', (req, ctx) => clearCredential(ctx.params.providerId, req))
}
Observed after index_repository(mode=full):
MATCH (r:Route) RETURN r.name, r.method→/v1/connections/{}/credential, method""(one node for PUT and DELETE)MATCH (r:Route)-[:HANDLES]->(f) RETURN f.name→ 0 rowsMATCH (f)-[r:CALLS]->(g) WHERE f.name='registerRoutes' AND g.name='add' RETURN r.args, r.line→ one edge
(one CALLS edge per caller/callee pair), carrying theargsof a single registration although the function
registers two routes (in the real project: 81 registrations in one function, one edge).
Expected
Routenodes per (method, path) withmethod,file_path,start_lineset.HANDLESedge from the route to the call target(s) in return position of the inline handler (here
replaceCredential/clearCredential), or to the referenced function when the handler argument is an
identifier.- Optionally the guard calls inside
ifconditions that lead to an early return (authorize) as a separate
edge/property, since they are the authorisation preconditions of the route.
Suggestion
A generic registration pattern in service_patterns keyed by callee name and argument positions
(callee: "router.add", method: 0, path: 1, handler: 2), configurable per project, would cover hand-written
routers without framework detection. The call-site arguments are already captured on the CALLS edge, so the data
exists; only the per-call-site linking is missing.
- 主要语言
- C
- 星标
- 45.8k
- 派生
- 3.8k
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 108
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DeusData/codebase-memory-mcp 的其他 Issue
-
bug ux/behavior
难度 2/5 1-3 小时 新手友好度 70/100
DeusData/codebase-memory-mcp#3191 ·
维护者通常 1 天内回复
-
documentation enhancement parsing/quality ux/behavior
难度 1/5 1-3 小时 新手友好度 82/100
DeusData/codebase-memory-mcp#3131 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug editor/integration parsing/quality ux/behavior
难度 2/5 1-3 小时 新手友好度 75/100
DeusData/codebase-memory-mcp#3062 · 2 条评论 ·
维护者通常 1 天内回复
-
bug documentation editor/integration parsing/quality
难度 2/5 1-3 小时 新手友好度 75/100
DeusData/codebase-memory-mcp#3050 · 1 条评论 ·
维护者通常 1 天内回复
-
editor/integration parsing/quality
难度 2/5 1-3 小时 新手友好度 68/100
DeusData/codebase-memory-mcp#2286 ·
维护者通常 1 天内回复
查看 DeusData/codebase-memory-mcp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
维护者通常 1 天内回复
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the game未关闭game: 010065A014024000 ios
难度 2/5 1-3 小时 新手友好度 76/100
seedds/nxnative#3714 · 1 条评论 ·
维护者通常 2 天内回复