Summary
On v0.8.1, indexing a Django REST Framework app creates Method nodes for ViewSet actions, but does not emit served Route nodes or Route-[:HANDLES]->Method edges for those actions. This makes route inventory and endpoint impact analysis incomplete for DRF router/ViewSet apps.
Environment
- codebase-memory-mcp: 0.8.1
- OS: macOS Darwin arm64
- Project: large Python/Django monorepo
- Indexed project name:
Users-noam.siegel-Documents-GitHub-monorepo
Reproducer shape
The project has a DRF ViewSet action:
class CustomerTaskAdminViewSet(...):
@action(detail=True, methods=["post"])
def approve_draft_with_charge(self, request, pk=None):
...
The graph correctly has Method nodes for the viewset file:
codebase-memory-mcp cli query_graph '{"project":"Users-noam.siegel-Documents-GitHub-monorepo","query":"MATCH (m:Method) WHERE m.file_path = '"'"'apps/hoa/api/admin_api/viewsets/customer_tasks.py'"'"' RETURN m.name, m.in_degree, m.out_degree, m.start_line LIMIT 50"}'
Observed: 24 Method rows, including:
approve_draft_with_charge | in_degree=0 | out_degree=1 | start_line=986
But route inventory for related charge/task endpoints is sparse and has no file/action mapping:
codebase-memory-mcp cli query_graph '{"project":"Users-noam.siegel-Documents-GitHub-monorepo","query":"MATCH (r:Route) WHERE r.name CONTAINS '"'"'charge'"'"' OR r.qualified_name CONTAINS '"'"'charge'"'"' RETURN r.name, r.qualified_name, r.method, r.file_path LIMIT 50"}'
Observed only 3 Route rows, with blank file_path for each:
/api_admin/custom_actions/etl/ai_draft_reset_charge/ | __route__POST__/api_admin/custom_actions/etl/ai_draft_reset_charge/ | POST |
/tasks/:charge.violation.task | __route__ANY__/tasks/:charge.violation.task | |
/charges_v2/csv/ | __route__ANY__/charges_v2/csv/ | |
And there are no HANDLES edges:
codebase-memory-mcp cli query_graph '{"project":"Users-noam.siegel-Documents-GitHub-monorepo","query":"MATCH (r:Route)-[:HANDLES]->(m:Method) WHERE r.name CONTAINS '"'"'charge'"'"' OR r.qualified_name CONTAINS '"'"'charge'"'"' OR m.file_path CONTAINS '"'"'charges'"'"' RETURN r.name, r.qualified_name, m.name, m.file_path LIMIT 50"}'
Observed:
Expected
For DRF ViewSets/router-registered actions:
- Route nodes should be emitted for served action endpoints.
- Route nodes should carry route path/method/source metadata when knowable.
- Route-[:HANDLES]->Method should connect endpoint routes to the ViewSet action method.
Actual
The ViewSet action exists as a Method and call graph traversal can find it, but endpoint/route graph inventory does not connect the served route to the action.
Duplicate check
I found related but not duplicate issues:
This issue is the inverse route-extraction gap: missing DRF router/ViewSet served routes and missing HANDLES mappings.
Summary
On v0.8.1, indexing a Django REST Framework app creates Method nodes for ViewSet actions, but does not emit served Route nodes or Route-[:HANDLES]->Method edges for those actions. This makes route inventory and endpoint impact analysis incomplete for DRF router/ViewSet apps.
Environment
Users-noam.siegel-Documents-GitHub-monorepoReproducer shape
The project has a DRF ViewSet action:
The graph correctly has Method nodes for the viewset file:
Observed: 24 Method rows, including:
But route inventory for related charge/task endpoints is sparse and has no file/action mapping:
Observed only 3 Route rows, with blank
file_pathfor each:And there are no HANDLES edges:
Observed:
{"total":0,"rows":[]}Expected
For DRF ViewSets/router-registered actions:
Actual
The ViewSet action exists as a Method and call graph traversal can find it, but endpoint/route graph inventory does not connect the served route to the action.
Duplicate check
I found related but not duplicate issues:
This issue is the inverse route-extraction gap: missing DRF router/ViewSet served routes and missing HANDLES mappings.