docs: def copy_artifact(src_path: str, artifact_hash: str, conf: Config):
      """Copy the artifact at `src_path` with hash `artifact_hash` to artifacts
         cache dir.
  
      If an artifact already exists at that location, it is assumed to be
      identical (since it's based on hash), and the copy is skipped.
  
      TODO: pruning policy to limit cache size.
      """
      cache_dir = conf.get_artifacts_cache_dir()
      if not isdir(cache_dir):
          makedirs(cache_dir)
      cached_artifact_path = join(cache_dir, artifact_hash)
      if isfile(cached_artifact_path) or isdir(cached_artifact_path):
          logger.debug('Skipping copy of existing cached artifact {} -> {}',
                       src_path, cached_artifact_path)
          return
      abs_src_path = join(conf.project_root, src_path)
      logger.debug('Caching artifact {} under {}',
                   abs_src_path, cached_artifact_path)
      shutil.copy(abs_src_path, cached_artifact_path)