From 9c7d7b35b15a03a53be600cb1d844171f12cf1a7 Mon Sep 17 00:00:00 2001 From: Thales Maciel Date: Thu, 26 Feb 2026 16:40:45 -0300 Subject: [PATCH] Add hardening regressions and update operational docs --- README.md | 5 +++++ tests/test_recorder.py | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 11a187a..9a294f6 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,8 @@ Create `~/.config/aman/config.json` (or let `aman` create it automatically on fi Recording input can be a device index (preferred) or a substring of the device name. +If `recording.input` is explicitly set and cannot be resolved, startup fails +instead of falling back to a default device. Config validation is strict: unknown fields are rejected with a startup error. @@ -97,6 +99,8 @@ Hotkey notes: AI cleanup is always enabled and uses the locked local Llama-3.2-3B GGUF model downloaded to `~/.cache/aman/models/` during daemon initialization. Model downloads use a network timeout and SHA256 verification before activation. +Cached models are checksum-verified on startup; mismatches trigger a forced +redownload. Use `-v/--verbose` to enable DEBUG logs, including recognized/processed transcript text and llama.cpp logs (`llama::` prefix). Without `-v`, logs are @@ -136,6 +140,7 @@ Service notes: - Press it again to stop and run STT. - Press `Esc` while recording to cancel without processing. - `Esc` is only captured during active recording. +- Recording start is aborted if the cancel listener cannot be armed. - Transcript contents are logged only when `-v/--verbose` is used. Wayland note: diff --git a/tests/test_recorder.py b/tests/test_recorder.py index 1016a00..889017a 100644 --- a/tests/test_recorder.py +++ b/tests/test_recorder.py @@ -137,6 +137,15 @@ class RecorderTests(unittest.TestCase): ): recorder.start_recording("NotADevice") + def test_start_recording_invalid_explicit_index_raises(self): + sd = _FakeSoundDevice() + with patch("recorder._sounddevice", return_value=sd): + with self.assertRaisesRegex( + ValueError, + "did not match any input device; available inputs: 1:Laptop Mic, 2:USB Interface", + ): + recorder.start_recording(99) + def test_start_recording_empty_input_uses_default(self): sd = _FakeSoundDevice() with patch("recorder._sounddevice", return_value=sd):