979b7d14fd
Two fixups the #75785 review required before landing: - grep fallback no longer uses --exclude-dir for protected dirs: grep matches exclude-dir globs against BASENAMES anywhere in the tree, so --exclude-dir=Downloads silently skipped every nested directory named Downloads (a repo's own Downloads/ included). Protected-dir searches now route through find's path-scoped -prune (same traversal-prevention the find backend uses) feeding grep via -exec. Regression test proves a nested work/repo/Downloads/notes.txt is still found while ~/Downloads is not (live filesystem, real find+grep). - exclusions gated on env.is_local (new BaseEnvironment flag, True on LocalEnvironment): sys.platform/Path.home() describe the controller, not the execution host — a macOS controller driving a Linux SSH/container backend must not prune the remote's unprotected Downloads. Environments without the flag default to local semantics (warning-carrying skip, never data loss). Both sabotage-verified: restoring basename --exclude-dir fails 2 tests.