Injectable boundary for the Duplicate command's owned filesystem effects.
The command claims a destination before copying so cleanup can remove only output owned by that operation. The backend keeps filesystem failures deterministic in tests.
Summary
Types
@type cleanup_result() :: {:ok, [String.t()]} | {:error, File.posix(), String.t()}
@type copy_result() :: :ok | {:ok, [String.t()]} | {:error, File.posix()} | {:error, File.posix(), String.t()}
@type entry_type() :: :directory | :file
@type t() :: module()
Callbacks
@callback claim_destination(String.t(), entry_type()) :: :ok | {:error, File.posix()}
@callback cleanup(String.t()) :: cleanup_result()
@callback copy(String.t(), String.t(), entry_type()) :: copy_result()