* feat(history): add opt-in JSONL persistence for transcripts
Adds history.persist (default off) mirroring the bounded snippet list to
history.jsonl under the XDG data directory so transcripts survive
restarts. Entries carry timestamp, duration, language and model when
known. Clearing history truncates the file, turning persistence off
deletes it, and disabling history removes it so nothing is retained
anywhere. Settings gains a Keep on Disk switch and a Clear button in the
Transcription History group.
Fixes#758
* test(history): rebind real tempfile when siblings mock sys.modules
test_recognition_manager and test_speech_recognition replace
sys.modules["tempfile"] with a MagicMock at import time, so the new
persistence tests were sharing one mock-named store path in full-suite
runs. Guard the TemporaryDirectory binding the same way
test_whisper_model_info already does.
* fix(history): sweep stale temp files, survive damaged stores, and keep session fields on late commits
* fix(history): reject lone-surrogate records and survive encode errors on write
---------
Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>