> ## Documentation Index
> Fetch the complete documentation index at: https://joe-pro-ai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing

> 113 offline Python tests and 4 UI tests. Every network call is mocked, so no keys are needed.

The suite mocks every network call. It needs no API keys and never calls a live model.

## Run the tests

```powershell theme={"dark"}
.\.venv\Scripts\python.exe -m pip install -e ".[server,test]"
.\.venv\Scripts\pytest
```

```bash Linux or macOS theme={"dark"}
.venv/bin/pip install -e ".[server,test]"
.venv/bin/pytest -q
```

The UI helpers in `web/desk.js` have their own tests on Node's built-in runner:

```bash theme={"dark"}
node --test tests/desk.test.mjs
```

## Latest run

Run against the hackathon branch at commit `c3ea984`:

```text pytest theme={"dark"}
159 passed, 1 warning in 1.18s
```

```text node --test theme={"dark"}
tests 4, pass 4, fail 0
```

The one warning is a Starlette deprecation notice about its `httpx` test client. It is not a test failure.

## What is covered

| File | Tests | Covers |
| - | -: | - |
| `test_topics.py` | 33 | Label normalization, merge and keep-apart cases, typed points, dedupe, fact source merge, Mark said, heat, cooldown, session cap, failed calls spending a slot, idle-only auto expansion, save and load round trip, markdown export, routes |
| `test_recall_sources.py` | 22 | Obsidian vault walk and excludes, folder tags, background index and per-file cache, GBrain MCP recall over HTTP, source tags, a down source falling back, secret redaction |
| `test_live_flush.py` | 14 | Transcribe now and stop-keeps-the-last-words on Whisper and Meta (stream turn and file fallback), reconnect after a flush, double-flush guard, short and silent buffers skipped, buffered audio drained at stop, `/transcribe-now` 409, stop then start keeps the session |
| `test_openrouter.py` | 12 | Streaming JSON parse and recovery of cut-off objects, NEXT arriving first, deep model routing, JSON mode retry, `require_parameters` routing, no network without a key |
| `test_meta_errors.py` | 10 | Short reasons such as a 402 `billing_not_configured`, META\_STRICT defaults and error cards, non-strict fallback labels, Meta STT failure then Whisper |
| `test_meta_spend.py` | 10 | Meta prices per token, search and audio second, the spend log and \$5 cap refusing calls before any network, final-answer parsing past commentary, `false` verdicts only on retrieved sources, marker citations replaced by opened pages |
| `test_muse.py` | 9 | `input_audio` part shape, chat then Responses then text fallback, audio labels from billed usage, Muse Spark 1.3 Responses request and grounded URLs only, realtime speaker events, multipart file transcribe, replay script |
| `test_config.py` | 8 | Profile switches, Muse defaults and contributor refusal, path resolution, no hardcoded machine paths in source, start scripts use the venv Python |
| `test_text_input.py` | 8 | Paste and WebSocket captions, blank and huge input rejection, Ollama fallback, `/health` without secrets, click-only speech |
| `test_knowledge.py` | 7 | Notes retrieval and ranking, hidden paths, GBrain off when unset, GBrain failure and merge |
| `test_brief.py` | 6 | Verified only with a real source, substring and URL-prefix rejection, no honesty language, em dash stripping |
| `test_review.py` | 5 | Turn ids past 40, partial stream fallback, listen button recovery, foreign origin blocked, claim-check length and rate caps |
| `test_live.py` | 4 | Speech gate after silence and at the segment limit, model load failure, resampling |
| `test_coach.py` | 3 | Ollama JSON extraction and local verified downgrade |
| `test_voice.py` | 3 | ElevenLabs request, off until configured, key redaction |
| `test_benchmark.py` | 2 | STT latency summary |
| `test_audio.py` | 1 | Default loopback selection |
| `test_recording.py` | 1 | Mono WAV writing |
| `test_transcription.py` | 1 | WAV loading and resampling |
| **Total** | **159** | |

## What the tests do not prove

* **Live Meta Model API calls.** The test suite mocks Muse Spark 1.3 and Muse Voice Transcribe. The live proof is `scripts/stt_compare.py` (word error rate against a reference text) and a live Check this claim, both run on Nov 3, 2026. The results are on the [architecture page](https://joe-pro-ai.mintlify.site/architecture.md#measured-accuracy).
* **Live provider audio.** Whether a live provider accepts `input_audio` is checked by hand with `scripts/smoke_muse.py`, which prints `path: chat`, `path: responses`, or `path: text`.
* **Windows loopback.** WASAPI capture needs a real Windows PC and is checked by hand.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.