`AtomicDirectoryPublishStep` is intended to make a prepared repository snapshot visible through symlinks…
harbor run -t mimo-v2.6-rl/format-code-task-000973harbor download mimo-v2.6-rl/format-code-task-000973Fix the following issue:
AtomicDirectoryPublishStep is intended to make a prepared repository snapshot visible through symlinks, but today it validates mappings while it is already publishing them. A bad later mapping can switch an earlier target, leave a copied master behind, or even expose a path outside the new snapshot. Retries using the same publish timestamp also fail after the first copy. Harden the public filesystem behavior of process_main() so plugins can safely use a set of publish locations as one operation.
Keep the existing constructor and the two publication modes. In normal symlink mode, / selects the root of the copied source snapshot and a relative mapping such as nested/file selects that existing path within the snapshot. A successful mapping makes its publish target a symlink through which the selected content is readable. The current master version remains named with the parent step's timestamp, and obsolete master versions are removed after a successful publication. Existing symlink targets may be replaced, but an existing real file or directory at a symlink-mode target is incompatible and must cause the operation to fail rather than be overwritten.
Validate the complete mapping set before making publication visible. Every selected source must exist, and normalization must not allow a relative source mapping to escape the new master snapshot (for example with ..). A missing or escaping source, an incompatible symlink-mode target, or an unsafe contents-mode destination must raise an exception. For any such validation failure, all pre-existing publish targets must still resolve to their original content, no requested new target may appear, the existing entries under the master directory must be unchanged, and no temporary publish link may remain. This all-or-nothing rule applies even when the invalid entry comes after a valid one.
When only_publish_directory_contents=True, the destination may be absent or an existing real directory, but it must not be a symlink. Keep the destination itself as a real directory and make its immediate entries an exact linked view of the selected source directory: remove stale destination entries, replace file-versus-directory conflicts safely, and leave each resulting entry as a symlink into the current master snapshot.
Finally, process_main() must be retryable on the same step with the same parent timestamp. If the source changes between calls, the second call succeeds, all published paths expose the newer snapshot, and only the current master version and intended publish targets remain. Do not change the behavior of valid root or nested mappings while adding these validation, cleanup, and retry guarantees.