The mounts list_files service method (api/oss/src/core/mounts/service.py) is really three unrelated views multiplexed by parameter shape: a shallow / with-counts view, a flat recency view, and a full browse view. The branches share about ten lines of setup and nothing else, and the mode matrix has silent edges (some flags are honored in one branch and ignored in another). Separately, roughly 500 of the file's ~1225 lines are Git-view policy (.gitignore spec loading, pruning, path-ignore matching) living inside MountsService, and the file-ops routes pass eight loose Query(...) params positionally into a wide service signature instead of the domain's parse-and-merge query-object pattern.
The goal is to make each view a named, separately-testable method and to move Git-view policy out of the service class.
Follow-up from the #5400 backend review (fixes stacked in #5411/#5412). Cited findings: review finding 3.1 (list_files is three unrelated views with silent mode edges), 3.2 (about 500 lines of Git-view policy belong in their own module), 1.4 (loose GET params should use the query-object pattern). This is a refactor with no behavior change intended; the review report is not in the repo, so this summary stands alone.
The mounts
list_filesservice method (api/oss/src/core/mounts/service.py) is really three unrelated views multiplexed by parameter shape: a shallow / with-counts view, a flat recency view, and a full browse view. The branches share about ten lines of setup and nothing else, and the mode matrix has silent edges (some flags are honored in one branch and ignored in another). Separately, roughly 500 of the file's ~1225 lines are Git-view policy (.gitignorespec loading, pruning, path-ignore matching) living insideMountsService, and the file-ops routes pass eight looseQuery(...)params positionally into a wide service signature instead of the domain's parse-and-merge query-object pattern.The goal is to make each view a named, separately-testable method and to move Git-view policy out of the service class.
list_filesinto named per-view service methods (e.g.list_files_shallow/list_files_flat/ browse) behind the same wire endpoint. The PR already proves the shape works: the now-removed paged method was the cleanest view precisely because it was a separate named method._path_gitignored) intocore/mounts/git_view.py;MountsServicekeeps its signatures and delegates. Unify the two.gitignorescopes behind one named contract (see the separategit_awaresemantics issue).Follow-up from the #5400 backend review (fixes stacked in #5411/#5412). Cited findings: review finding 3.1 (
list_filesis three unrelated views with silent mode edges), 3.2 (about 500 lines of Git-view policy belong in their own module), 1.4 (loose GET params should use the query-object pattern). This is a refactor with no behavior change intended; the review report is not in the repo, so this summary stands alone.