feat(wake): Zarathushtra wake word with edit-distance matching #291

Closed
nsaspy wants to merge 0 commits from feature/wake-words-edit-distance into master
Owner

Summary

  • Add "zarathushtra" to the default wake words and match all wake phrases with Levenshtein tolerance (~25% of phrase length, at least one edit), so close transcriptions such as "Zaratustra" or "Sara" still trigger the listener
  • Resolve wake words in order: [wake].words in config.toml override, then kb_config:wake_word/1 via PrologEngine.get_wake_words(), then built-in defaults
  • Add wake_word/1 default facts to kb/config.pl and validated user overrides through modules/config_loader.pl (~/.zarathushtra/config.pl)
  • Derive the Whisper initial prompt and the ready message from the resolved wake words
  • Document wake word configuration in wiki/install.org

Test plan

  • New t/test_wake_words.py (19 tests): edit distance, span matching (exact/fuzzy/punctuation/negatives), _wake_command behavior incl. custom instance words, resolve_wake_words precedence and failure fallbacks, PrologEngine.get_wake_words
  • New PlUnit tests in t/prolog_config.pl: default zarathushtra fact, user override, empty-phrase rejection
  • Full ZARA-021 gate: nix develop -c bash scripts/test-all.sh — 10/10 phases passed at candidate SHA 5fce64f

Note: phase 10 (test-entrypoints.sh) requires NIX_CONFIG="experimental-features = nix-command flakes" on machines where the suite's isolated XDG_CONFIG_HOME hides ~/.config/nix/nix.conf; identical behavior confirmed on master.

## Summary - Add "zarathushtra" to the default wake words and match all wake phrases with Levenshtein tolerance (~25% of phrase length, at least one edit), so close transcriptions such as "Zaratustra" or "Sara" still trigger the listener - Resolve wake words in order: `[wake].words` in config.toml override, then `kb_config:wake_word/1` via `PrologEngine.get_wake_words()`, then built-in defaults - Add `wake_word/1` default facts to `kb/config.pl` and validated user overrides through `modules/config_loader.pl` (`~/.zarathushtra/config.pl`) - Derive the Whisper initial prompt and the ready message from the resolved wake words - Document wake word configuration in `wiki/install.org` ## Test plan - New `t/test_wake_words.py` (19 tests): edit distance, span matching (exact/fuzzy/punctuation/negatives), `_wake_command` behavior incl. custom instance words, `resolve_wake_words` precedence and failure fallbacks, `PrologEngine.get_wake_words` - New PlUnit tests in `t/prolog_config.pl`: default `zarathushtra` fact, user override, empty-phrase rejection - Full ZARA-021 gate: `nix develop -c bash scripts/test-all.sh` — 10/10 phases passed at candidate SHA 5fce64f Note: phase 10 (`test-entrypoints.sh`) requires `NIX_CONFIG="experimental-features = nix-command flakes"` on machines where the suite's isolated `XDG_CONFIG_HOME` hides `~/.config/nix/nix.conf`; identical behavior confirmed on master.
nsaspy closed this pull request 2026-09-04 23:08:46 +00:00
Some checks failed
CI / test (pull_request) Failing after 5s
CI / shared mic / Arch Linux (pull_request) Failing after 11m10s
CI / shared mic / Ubuntu 24.04 (pull_request) Failing after 12m23s

Pull request closed

Sign in to join this conversation.
No description provided.