mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-27 06:53:11 +08:00
Django REST Framework ViewSets expose extra endpoints through @action-decorated methods, e.g. @action(detail=True, methods=["post"], url_path="approve"). On main these methods carried no route_path, so Phase 2a created no Route node and no HANDLES edge for them -- the endpoint was invisible in the graph (#603). Add try_drf_action_decorator (internal/cbm/extract_defs.c): when a method's decorator identifier is "action", read the methods / url_path / detail kwargs and set *out_path/*out_method. The existing decorator-route pipeline (ensure_one_decorator_route, Phase 2a) then creates the Route + handler->Route HANDLES edge in the established direction. Fallbacks: method name for url_path, "GET" for methods; detail=True -> /{pk}/<seg>, else /<seg>. Reproduce-first guard: handles_drf_action_python in the edge_types_probe suite -- a DRF @action method must produce >=1 HANDLES edge (RED with 0 edges before the extractor, GREEN after). Known limitation: multi-method actions (methods=["get","post"]) capture only the first method -> a single Route. Distilled from #647 (thanks @muskiteer). Drops that PR's unrelated project-wide HANDLES edge-direction reversal, which was unnecessary for the fix and broke the handler->Route convention relied on by pass_cross_repo.c's find_route_handler. Closes #603 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com> Co-Authored-By: muskiteer <agarwal.vansh3110@gmail.com>