# Resumable artifact transfer tools/remote_transfer.py is the shared implementation for artifact upload and download. The existing Windows sync-to-remote.ps1 and sync-from-remote.ps1 are thin adapters. Source synchronization remains Git over SSH. No transfer daemon or additional service is installed. Push the source and checkout an exact Linux snapshot containing this module. Pass that file as --remote-worker before the action: python tools/remote_transfer.py --help python tools/remote_transfer.py --remote-worker /data/prod2u/build-snapshots/SNAPSHOT/tools/remote_transfer.py upload LOCAL-FILE /data/prod2u/deliveries/ARTIFACT python tools/remote_transfer.py --remote-worker /data/prod2u/build-snapshots/SNAPSHOT/tools/remote_transfer.py download /data/prod2u/deliveries/ARTIFACT LOCAL-FILE --expected-sha256 SHA256 Quote paths containing spaces. Unicode and literal shell punctuation travel as data; JSON requests and file bytes use SSH stdin/stdout. Large chunk manifests also use stdin so they do not exceed Windows command-line limits. Remote artifact paths resolve under /data/prod2u. The only SSH host is the existing edk2-uefi-lab. The Python default chunk size is 4 MiB. The Windows adapters retain their 1 MiB default. --chunk-bytes accepts 64 KiB through 256 MiB. Each completed chunk is SHA256 verified before its .partial file is renamed. A transfer-specific transfer-parts directory and manifest persist beside the destination while work is incomplete. Repeat the same command to resume: every existing completed chunk is rechecked, and only missing or corrupt chunks are transferred. After every chunk is present, assembly verifies the complete file hash and size before the destination appears. A different existing destination causes DESTINATION_CONFLICT; use another filename or explicit --replace. Correct existing files are reused without transferring their chunks. Assembly also uses .partial. The implementation removes only its known stage files after success; unexpected files are preserved. A small destination .transfer.lock file remains for concurrency coordination. The final JSON receipt reports the whole hash/size, transferred/reused chunk indices and verified bytes transferred. It proves byte integrity, not product acceptance or software functionality. Stderr emits per-chunk progress. All console JSON and Windows adapter output use UTF-8. SSH transport failures retry with bounded delays 2/5/10/20/30 seconds. Use --retries 0 to stop after a single transport failure and resume later. Invalid arguments, an unexpected source hash, conflicting destinations and content corruption do not trigger blind retries. Exit codes are 0 for completed byte verification, 2 for input/conflict errors, 3 for incomplete/corrupt chunk data, and 255 for transport interruption after the configured retries. Windows and Linux externally terminated SSH processes normalize to the latter status. PowerShell adapters accept -RemoteWorker in addition to their prior path/hash arguments. The upload adapter retains -RemotePartial ending in .partial and derives the final destination from it. Both accept -ChunkBytes, -Retries and -Replace. If local script execution is disabled, invoke PowerShell with -NoProfile -ExecutionPolicy Bypass for that process; no machine policy change is needed. These adapters change console encoding only in the invoking process.