mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:25:52 +01:00
[PR #2302] dstorage_vectors: add CLI validation and atomic output write #2308
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2308
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2302
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/dstorage-vectors-safety📝 Commits (1)
5b7271bdstorage_vectors: add CLI validation and atomic output write📊 Changes
2 files changed (+169 additions, -2 deletions)
View changed files
📝
runtime/test/dstorage_vectors.py(+77 -2)➕
tests/test_dstorage_vectors.py(+92 -0)📄 Description
Claimed in the coordination issue as: DSTORAGE-VECTORS-CLI-USAGE-AND-ATOMIC-WRITE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192927392)
What and why
runtime/test/dstorage_vectors.pyintomain(argv=None) -> intusingargparse(outputpositional argument with-h/--helpsupport instead of indexingsys.argv[1])._validate_output_path()to reject empty/whitespace paths, trailing separators, directory/symlink-to-directory targets, and non-directory ancestors upfront with exit code2before generating vectors.write_file_atomic()writing UTF-8 LF (newline="\n") via sibling temp file,fsync, POSIX mode preservation, transient WindowsPermissionErrorretry, and existing-file preservation on failure, returning exit code1with anERROR:message onOSError.tests/test_dstorage_vectors.py.Tested
python -I tests/test_dstorage_vectors.py -v: 2 passed, 0 failed (detachedupstream/mainbaseline with only the new test file fails with 2 errors).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q runtime/test/dstorage_vectors.py tests/test_dstorage_vectors.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.