What: routes/files.py is 945 lines (~19% of src/) and covers tree, view, save, upload, delete, mkdir, rename, move, download, search, bulk_delete, bulk_move — plus an in-process search-index cache.
Why: Cognitive load when touching any one concern. The matching test file is 2k+ lines.
Approach: Convert routes/files.py into a package: routes/files/{tree,view,write,mutate,search,_safety}.py. Lift the search index into mcontrol/file_search.py. Re-export the router from routes/files/__init__.py so existing imports stay green.
What:
routes/files.pyis 945 lines (~19% ofsrc/) and covers tree, view, save, upload, delete, mkdir, rename, move, download, search, bulk_delete, bulk_move — plus an in-process search-index cache.Why: Cognitive load when touching any one concern. The matching test file is 2k+ lines.
Approach: Convert
routes/files.pyinto a package:routes/files/{tree,view,write,mutate,search,_safety}.py. Lift the search index intomcontrol/file_search.py. Re-export the router fromroutes/files/__init__.pyso existing imports stay green.