A consent recording or a voice bundle could be saved under a name like
.html, and /voice_audio then served it as a page from the backend's own
origin, where its script could use the API as the local admin. Consent
uploads now need an audio extension and content that decodes as audio;
bundle imports keep only audio or video extensions and refuse clips that
do not decode. /audio, /voice_audio and /demo_audio send nosniff and a
sandboxing Content-Security-Policy, and any file that is not audio, video
or a raster image is sent only as a download.
A running audiobook, Stories, dub or batch render resolves the voice's
reference path once and re-reads it per segment. Re-lock, unlock and
reference replacement now mark the superseded file under voices/.retired/
and a sweep (on lock and at startup) removes it once it is unreferenced
and older than 24 h.
Install staged audio with a restorable backup before committing its row,
restore on any failure, serialize lock/unlock/consent file swaps, name the
FileNotFoundError skip (CodeQL), and drop the real-timer race in the offline
delete test.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Same class as #2483: clear/delete/prune history and unlock unlinked audio
before the transaction committed; consent re-record deleted the previous
recording first; lock copied over the live locked take in place. Stage files
and swap/unlink after commit.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>