Some parts of ScopeManager require paths to be canonical (ending in "/") -- they concatenate dir names directly to the path, and the code will go into an infinite traversal directory if it receives a path with no trailing "/" (as we learned on the filesystem branch). Other parts of ScopeManager requires paths to be _non_-canonical (no trailing "/" at end) -- the code is likely to break if it uses a path _with_ trailing "/" instead. See the two calls to FileUtils.canonicalizeFolderPath() (or stripTrailingSlash(), once #5527 lands), and possibly also three instances of the code `dir + "/"`. We should clean up ScopeManager so it makes more consistent assumptions about what paths look like.