Skip to content

Make TTS voice renames rollback-safe - #81

Draft
Blackspirits wants to merge 3 commits into
upl/review-base-4771from
fix/voice-rename-rollback-4771
Draft

Blackspirits wants to merge 3 commits into
upl/review-base-4771from
fix/voice-rename-rollback-4771

Conversation

@Blackspirits

@Blackspirits Blackspirits commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

The new TTS Voice Manager renames a file-backed clone by moving its sidecars first and its WAV last. Two failure modes can corrupt or destroy voice data:

  • on case-sensitive file systems, names that differ only by case are treated as the same file and moved with overwrite:true, so renaming CaseVoice to caseVoice can overwrite an existing distinct voice;
  • if a sidecar/WAV move fails after earlier files have already moved, the voice can be left split across old and new base names with no rollback.

This change:

  • stages the WAV and all matching sidecars under unique temporary names before publishing any destination
  • checks all destination paths only after staging, which makes case-only renames portable across case-sensitive and case-insensitive file systems
  • never uses overwrite semantics for a rename destination
  • rolls back staged/published files in reverse order on failure
  • moves published case-only paths through a temporary file during rollback so original casing can be restored reliably
  • keeps enumeration/staging errors inside the existing error return contract
  • makes prepared-cache cleanup best-effort so cache deletion cannot roll back an otherwise successful voice rename
  • preserves the existing name validation, non-file voice restrictions, delete behavior and logging

Regression coverage

  • successful WAV + transcript rename still moves sidecars and drops the prepared cache
  • an existing target voice is still refused
  • a target-sidecar collision leaves WAV and all source sidecars unchanged and leaves no staging files
  • a case-only rename succeeds when there is no distinct target
  • on a case-sensitive file system, a distinct target differing only by case is preserved rather than overwritten
  • existing invalid-name/delete/non-file tests remain in place

Validation

  • diff is limited to VoiceFileRename.cs and VoiceFileRenameTests.cs
  • upstream later advanced from the review base to 9c0f6bdd77bc12bafff66f748b97c8b3d3a2d5b7; the intervening commits only update Turkish.json and do not touch the TTS Voice Manager rename path
  • full solution restore passed
  • full solution build passed
  • full solution test suite passed on the first run
  • retry step was not used
  • validation run: #34760867384

Base is upstream 4771a22765acdbdf5bd5b8a1c02f378c15e73ac9.

AI assistance: ChatGPT was used to adversarially review the newly introduced Voice Manager file-rename flow, identify cross-platform overwrite and partial-move failure modes, design rollback-safe staging, and add focused regressions.

@Blackspirits Blackspirits left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial re-check: the final diff remains limited to the rename helper and focused regression tests. Source files are staged before destination checks, no destination uses overwrite semantics, partial staging/publishing paths attempt reverse-order rollback, case-only renames are handled without destroying a distinct case-sensitive target, and cache cleanup is intentionally best-effort after the rename transaction. Full CI run #34760867384 passed restore/build/full tests on the first run with no retry. No blocker identified. Keep draft; no merge/promotion performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant