Skip to content

V1 - revamp original architecture and design - #1

Merged
Yalhash merged 26 commits into
mainfrom
v1
Oct 28, 2026
Merged

Yalhash merged 26 commits into
mainfrom
v1

Conversation

@Yalhash

@Yalhash Yalhash commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Switch to a pipeline-based flow with smarter concurrency, backflow and buffering handling

Yalhash and others added 26 commits October 27, 2026 23:42
Remove the v0 prototype sources (kept at tag v0.1.0). Add pyproject.toml
(hatchling, src layout, console entry point), dependency groups, pytest,
ruff and mypy config, an MIT license, a config example, and a CI workflow
that tests on Windows, macOS and Linux (Python 3.10 and 3.12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
Pure-Python core (stdlib + numpy): immutable Utterance model, typed errors,
event bus, ring buffer, VAD endpointing state machine, session with
language lock, and the threaded pipeline (front end, single ASR worker,
coordinator) with bounded queues, ID-based ordering and backpressure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
WASAPI loopback, sounddevice and WAV/array playback sources; soxr
resampling; Silero (onnxruntime) and energy VAD; faster-whisper;
OpenAI/Google translation and structured-output suggestions over a
stdlib HTTP client; keyring secrets; fakes for every port; Windows
capture exclusion with build check and read-back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
Typed config with one precedence order and keyring secrets; composition
root; Qt-free controller and presenter; overlay, settings dialog, global
hotkeys, capture-shield filter for every top-level window, single thread
bridge; CLI with demo and headless modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
…cript

Coordinator counts posted vs handled messages and AsrQueue counts in-flight
segments, so wait_idle()/drain() have no window where work is in hand but
invisible. stop() now drains the coordinator before returning. Tests that
assumed real-time pacing now enforce it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
Silero adapter now reads frame length (incl. 64-sample context) and state
shapes from the model; faster-whisper's bundled model uses h/c with 576-
sample input. Rename OverlayWindow.scroll (shadowed QWidget.scroll). Fix
QShortcut/connect typing, config defaults, Windows-only ctypes access.
WindowsShield records why it did not hide a window. CI captures the tail
of a crashed test run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
…n; numpy typing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
…ld result

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
- model load failure now stops capture; ERROR is not overwritten by
  'falling behind'; open utterances are marked failed on stop
- a model that finishes loading after Stop no longer reports Listening
- start() waits for a still-running ASR worker: never two workers
- suggestions target the latest final utterance with text (skip failed)
- rebuild re-dispatches translations dropped by the old pipeline
Each with a regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
- ConfigStore: environment overrides are never written into config.toml, and
  a config file that failed to load is never overwritten with defaults
- a failed pipeline rebuild keeps the conversation for the next build
- clearing the conversation is confirmed by a ConversationCleared event, so
  results already in flight cannot bring old rows back
- privacy changes rebuild the pipeline; language policy follows the config
- WASAPI loopback detects default-device changes with a fresh PortAudio probe
- HTTP: Google 403 quota/rate limits mapped correctly; dropped connections
  become ProviderUnavailable
- Silero: prefer known single-model files and smoke-test each candidate
- WAV reader tolerates a truncated last frame
- PyQt excepthook so an error in a slot is logged instead of aborting
- settings dialog keeps unknown values and shows where an API key comes from
Each fix has a regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
…te type

- Capture shield filter reads the native handle with internalWinId() instead of
  winId(). winId() creates a native window when there is none and returned None
  for windows mid-creation/teardown, raising TypeError on every click. Windows
  without a handle yet are skipped; WinIdChange arrives once they have one.
  Failures log one line per window instead of a traceback per event.
- Shutdown closes the shield filter (disconnects destroyed/status_changed) and
  detaches the presenter (NullView) before any widget is deleted, so destroying
  windows can no longer push a status into deleted labels.
- asr.compute_type defaults to "auto" (int8 on CPU, float16 on CUDA) instead of
  "default", which kept the model's float16 and made CTranslate2 convert to slow
  float32 on CPUs with a warning. A saved "default" is read as "auto"; values are
  validated; Settings offers a Precision choice; the chosen device and type are
  logged at load.

Regression tests: no native handle is ever created by the filter; clicking every
overlay button (with tooltips) logs no shield warning and creates no native child
windows (real native windows on Windows CI); a closed filter stays silent while
windows are destroyed; the demo app quits with no unhandled error after flushing
deferred deletes; presenter.detach(); compute-type default, migration and
validation; adapter passes "auto" and reports the effective type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
PyQt6 does not expose QWidget.internalWinId(). Call winId() only once the native
window exists, where it returns the existing handle instead of creating one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
…nces

Windows CI (Python 3.10) hit an access violation in the click test. WinIdChange is
also sent from a window's destructor, and for windows Qt creates in C++ (tooltips,
menus) PyQt cannot always tell a wrapper is stale. The filter now:
- shields synchronously only on Show, when the window is certainly alive;
- turns WinIdChange into a re-scan of QApplication.topLevelWidgets() on the next
  event-loop turn, never touching the object the event came with;
- keeps no widget references (close() no longer disconnects per widget).
This is also the likely source of winId() returning None in the reported error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
- Settings -> Translation and Suggestions get an editable model dropdown: a
  built-in list at once, then the chat models the OpenAI key can use (GET
  /v1/models, filtered to general text models, loaded on a worker thread and
  cached for the session; Refresh reloads). Any model ID can be typed; a current
  model missing from the account's list is kept and marked.
- Defaults unchanged (gpt-4o-mini / gpt-4.1-mini). The built-in list notes that
  OpenAI retires both on 2027-01-14 (named replacement: gpt-6-luna).
- Requests now fit the model family: older chat models get temperature;
  reasoning models get reasoning_effort (none for translation, low for
  suggestions) instead. An HTTP 400 naming one of these parameters steps the
  effort down (none -> minimal -> low) or drops the parameter, retries once, and
  is remembered per model for the session.
- HttpClient gains get_json. The dialog receives the catalog from app.py, so the
  UI still never imports an adapter (architecture test unchanged).

Tests: options per family, effort fallback and memory, temperature drop,
non-retried 400s, model filtering and ordering, typed errors, catalog cache,
GET transport; dialog list, typed model, background load with cache, failure
fallback, Google provider disables the model field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178pC5oqSRqfEmqPtHZ2Dne
@Yalhash
Yalhash merged commit 3a6ff84 into main Oct 28, 2026
9 checks passed
@Yalhash
Yalhash deleted the v1 branch November 7, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant