Add context windows, web search, streamed answers, overlay move/resize; overhaul docs

- Context windows (contexts/*.yaml) scope answers to a defined domain
- Optional DuckDuckGo web search behind ai.web_search.enabled (default off)
- Stream partial answers into the overlay at first-token time
- Default Whisper to local base.en (~9x faster); offline model loading
- Priority-ordered loopback detection (BlackHole > Teams device)
- Overlay: drag interior to move, edges to resize
- Stop tracking model binaries (models/ is gitignored)
- README/CLAUDE.md overhaul + tracked config.example.yaml

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
spiro-alvin-nyasimi
2026-07-03 11:22:34 +03:00
parent 138580475c
commit 08118cc650
13 changed files with 1095 additions and 97 deletions

34
contexts/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Context windows
Each `.yaml` file here defines a **context window** — a well-defined scope the AI
reads *before* answering, so it stays on topic instead of drifting. The active
context is prepended to every question (spoken and on-screen) before it goes to
the model.
Example: with `python_flask_backend.yaml` active, asking *"what is STOMP"* gets
the Python/Flask-relevant answer first (the WebSocket sub-protocol you'd use from
a Flask backend), then a short note on other meanings — rather than a generic or
off-topic answer.
## Format
```yaml
name: Python / Flask — Senior Backend Engineer # display name
scope: Senior backend engineering interview … # one-line summary (optional)
active: true # mark exactly one file active
strict: false # false → answer in-context first, then variations
# true → stay strictly in-scope, no variations
definition: | # required: the scope + how to interpret questions
Free-form text describing the context…
```
## Choosing the active context
1. If `config.yaml` sets `ai.active_context: <filename-without-extension>`, that
file wins (e.g. `ai.active_context: python_flask_backend`).
2. Otherwise, the first file with `active: true` is used.
3. If none match, the assistant answers without a context (default behavior).
Files are reloaded when they change on disk, so editing a context takes effect
without restarting the app. To switch contexts, set `active: true` on one file
(and `false` on the others), or set `ai.active_context` in `config.yaml`.

View File

@@ -0,0 +1,31 @@
name: Python / Flask — Senior Backend Engineer
scope: Senior backend engineering interview focused on Python and the Flask web framework
active: true
strict: false
definition: |
This is a senior backend engineering interview centered on Python and the
Flask web framework. Interpret every question within Python/Flask backend
engineering first, even when the question does not say so explicitly, and
answer at the depth expected of a senior engineer.
When a term also has meanings outside this scope (e.g. STOMP, CORS, WSGI,
"workers", "streams"), give the Python/Flask-relevant answer first, then
briefly note other necessary variations so the answer stays accurate.
Assume strong familiarity with and expect depth on:
- Flask app structure: application factory, blueprints, extensions, config.
- Request lifecycle: WSGI, the app/request contexts, g, before/after request.
- Concurrency & deployment: the GIL, gunicorn/uwsgi workers, gevent/eventlet,
threads vs processes, async (ASGI/Quart) trade-offs.
- Data: SQLAlchemy ORM and Core, sessions, migrations (Alembic), connection
pooling, N+1 queries, transactions.
- APIs: RESTful design, status codes, pagination, versioning, serialization
(marshmallow/pydantic), input validation, error handling.
- Auth & security: sessions vs JWT, CSRF, CORS, OWASP basics, secrets, rate
limiting.
- Reliability & performance: caching (Redis), background jobs (Celery/RQ),
idempotency, observability (logging, metrics, tracing), profiling.
- Testing & quality: pytest, fixtures, test client, mocking, coverage, CI.
Keep answers interview-appropriate: precise, technically correct, and concise,
with concrete Python/Flask examples or trade-offs where helpful.