* fix(gateway): reject artifact archives where a file collides with an implicit directory
When a run outputs both a file and a deeper file path whose parent directory
matches the first file's normalized name (e.g. 'Report' and
'report/slides/lesson.pptx', or Unicode NFC/NFD variations), the ZIP archive
builder allowed both entries because it only checked for exact full path
equality. On case-insensitive filesystems, extracting such archives fails because
the file entry blocks directory creation or vice versa.
This change collects all implicit directory prefixes from normalized casefolded
entries and rejects the archive with HTTP 409 (ArtifactArchiveError) if any file
entry name collides with an implicit directory, regardless of receipt order.
Fixes#7977
* fix(gateway): address review feedback on test portability and loop readability
Two tests in this suite failed on Windows hosts for POSIX-shaped reasons:
- test_archive_download_contains_only_presented_files wrote its CSV fixture
with write_text(), so Windows text mode translated the literal "\n" bytes to
CRLF; the archive then legitimately contained CRLF while the assertion
compared against the LF spelling.
- test_archive_rejects_a_path_replaced_during_read swaps the source file with
os.replace() while the archive still holds it open, which Windows refuses
with WinError 5, so that rename-under-read race is POSIX-only.
Write the fixture as bytes so its content is platform-independent, and skip
only the rename-based race on Windows: the same-size content change during
read (test_archive_rejects_same_size_content_change_with_restored_mtime) still
runs there and exercises the same mid-read revalidation.
Verified on Windows: both tests red on upstream main, green after the change
(one skipped); ruff check/format clean; the file is 28 passed, 7 skipped.