[documents] document_routes.py (1662 lines) mixes 6+ concerns — needs feature-based split #769
Labels
No labels
area:chat
area:core
area:llm
area:routes
area:tools
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sleepy/odysseus#769
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
"File:
routes/document_routes.py— 1662 lines This file is the single largest route file in the codebase and handles at least 6 distinct concerns: 1. Document CRUD (add, get, list, delete, update) 2. Collection management (create, delete, list collections) 3. Document search/query (search endpoint) 4. Scrape/URL ingestion (scrape endpoint, HTML processing) 5. Knowledge graph endpoints (graph construction, querying) 6. Admin/stats endpoints (usage stats, health) AGENTS.md: "Split files exceeding ~400 lines or containing multiple concerns" AGENTS.md: "Organize code by feature/domain, not by technical role" Action: Split into feature-based route modules: -routes/documents/crud.py— Document CRUD -routes/documents/collections.py— Collection management -routes/documents/search.py— Search/query -routes/documents/ingestion.py— Scrape/URL ingestion -routes/documents/knowledge_graph.py— Knowledge graph endpoints -routes/documents/admin.py— Stats/health -routes/documents/__init__.py— Router aggregation"