Files
alex d94188e565 typecheck: add the mypy gate and fix every error it found
Wave 1 auto-merged two branches into semantically broken calls while ruff, format and
pytest stayed green; a type checker is the mechanical answer. Measured on the base
(434745d): 35 errors in 10 files.

- pyproject: mypy as a dev dependency plus [tool.mypy] scoped to src/ at python 3.13.
  Per-module ignore_missing_imports only for the five genuinely untyped third parties,
  each comment naming the library (yt-dlp, PySceneDetect, faster-whisper, sherpa-onnx,
  pyannote.audio); no global ignore
- .pi/verify.json: fourth gate, `uv run mypy src/`, on settle
- config: replace the StageOptions union alias (mypy cannot build it while config
  imports the option modules that import it back) with five per-stage @overloads, so
  options_for("shots").model_copy(...) types as ShotOptions; _stt_backend returns
  SttBackend instead of str
- llm: build_model/llama_server_up/build_local_model take a new ModelEndpoints protocol
  instead of Settings, so vision and synthesis hand over the DescribeOptions/
  ReportOptions value they already hold (the wave-1 drift) rather than rebuilding a
  Settings bag; vision.llama_server_up follows and drops its Settings import
- doctor: the two shadowed locals are renamed (a bool over a list[str] in _key_checks,
  a ModelAssetCheck over a CheckStatus in _diarization_checks)
- media: narrow the optional activity curve into one adaptive_curve local instead of a
  use_curve bool mypy cannot narrow through
- pipeline: the cached-turns re-attribution also requires transcript is not None
- synthesis/vision/transcribe/mcp: separate AgentRunResult names for the map and reduce
  calls, list[BinaryImage] frame parts, a str weights location in both readiness
  branches, a Segment annotation, and a literal-keyed HTTP_TRANSPORTS map

All 35 sites were type-level: no fix changes runtime behaviour on an existing path (the
vision Agent "no overload" error was a cascade of the invalid build_model argument,
proven with a probe), so there is no failing behaviour test to write; the gate itself is
the regression check. 400 passed / 2 skipped stay green and no `# type: ignore` was
added.

Closes #10
2026-11-24 10:39:18 +00:00
..