dstorage_vectors: add CLI validation and atomic output write #2302
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2302"
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?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-26T13:11:18Z.
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.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T09:47:21Z.
Red/green: tests/test_dstorage_vectors.py fails on main (1 failed) and passes with this PR (2 passed).
Runtime batch of 20 PRs tested by OreoFR (full build, ctest without the game, Python suite, translator): same results as main
09c153948, RTX 4070 Laptop / Windows 11.AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:01:34Z.
Verified by OreoFR
09c153948+ PR head5b7271be7; integration package 1 of 6 (20 PRs, merged without conflict)AI-assisted (Claude Code, Claude Opus 5.5).