ZARA-001: Restore the canonical wake entrypoint #32

Merged
lost-rob0t merged 2 commits from fix/zara-001-wake-entrypoint into master 2026-07-18 19:58:46 +00:00
lost-rob0t commented 2026-07-18 19:51:35 +00:00 (Migrated from github.com)

Closes #2.

Root cause

WakeWordListener.active_mode_async retained a duplicated command-capture block under the timeout branch in addition to the canonical capture path. The legacy scripts/zara_wake.py also duplicated the wake implementation and invoked main() before newly added sample-rate helpers were defined.

Files changed

  • zara/wake.py: removed the duplicated active-command capture block while preserving the existing Prolog-first routing and configuration behavior.
  • scripts/zara_wake.py: replaced the divergent implementation with a compatibility wrapper that delegates to zara.wake.main.
  • t/test_wake_import.py: added import safety and single-capture state-machine regression coverage with external services and hardware mocked.
  • scripts/test-entrypoints.sh: added the required non-interactive syntax, import, and CLI entrypoint checks.

Tests added

  • Importing zara.wake does not open an audio input stream.
  • One active_mode_async turn captures, transcribes, routes, and responds exactly once.

Whisper, sounddevice, Prolog, memory, notifications, and TTS are mocked; the tests require no microphone, network, model download, or desktop session.

Commands run and results

  • git fetch origin --prune — passed; local master matched origin/master at f20facd.
  • nix develop -c pytest -q t/test_wake_import.py — passed, 2 tests.
  • nix develop -c bash scripts/test-entrypoints.sh — passed.
  • nix develop -c pytest — passed, 2 tests.
  • nix build — passed; all five default derivations built successfully.
  • git diff --check — passed.

Remaining limitations

This correctness repair intentionally does not change wake latency, timeout behavior, provider/model configuration, or other roadmap items. Those remain assigned to their dependency-ordered ZARA issues.

Closes #2. ## Root cause `WakeWordListener.active_mode_async` retained a duplicated command-capture block under the timeout branch in addition to the canonical capture path. The legacy `scripts/zara_wake.py` also duplicated the wake implementation and invoked `main()` before newly added sample-rate helpers were defined. ## Files changed - `zara/wake.py`: removed the duplicated active-command capture block while preserving the existing Prolog-first routing and configuration behavior. - `scripts/zara_wake.py`: replaced the divergent implementation with a compatibility wrapper that delegates to `zara.wake.main`. - `t/test_wake_import.py`: added import safety and single-capture state-machine regression coverage with external services and hardware mocked. - `scripts/test-entrypoints.sh`: added the required non-interactive syntax, import, and CLI entrypoint checks. ## Tests added - Importing `zara.wake` does not open an audio input stream. - One `active_mode_async` turn captures, transcribes, routes, and responds exactly once. Whisper, sounddevice, Prolog, memory, notifications, and TTS are mocked; the tests require no microphone, network, model download, or desktop session. ## Commands run and results - `git fetch origin --prune` — passed; local `master` matched `origin/master` at `f20facd`. - `nix develop -c pytest -q t/test_wake_import.py` — passed, 2 tests. - `nix develop -c bash scripts/test-entrypoints.sh` — passed. - `nix develop -c pytest` — passed, 2 tests. - `nix build` — passed; all five default derivations built successfully. - `git diff --check` — passed. ## Remaining limitations This correctness repair intentionally does not change wake latency, timeout behavior, provider/model configuration, or other roadmap items. Those remain assigned to their dependency-ordered ZARA issues.
Sign in to join this conversation.
No description provided.