Skip to content

providers: delete dead hal0.voice impl; document lemond-only STT/TTS dispatch#647

Merged
thinmintdev merged 1 commit into
mainfrom
afk/620-retire-voice
Jun 7, 2026
Merged

providers: delete dead hal0.voice impl; document lemond-only STT/TTS dispatch#647
thinmintdev merged 1 commit into
mainfrom
afk/620-retire-voice

Conversation

@thinmintdev

@thinmintdev thinmintdev commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Closes #620

Scope (minimal, per maintainer decision)

Delete only the dead local provider implementation — the in-process
classes that ran Moonshine/Kokoro — while keeping moonshine and
kokoro as valid capability-provider identifiers
. lemond (and the
toolbox images) serve STT/TTS now, so the in-process hal0 provider
classes had no live importers and are pure dead code.

Deleted (the #620 win — dead code, no live importers)

  • src/hal0/voice/ — the entire re-export shim package (__init__.py, kokoro.py, moonshine.py)
  • src/hal0/providers/kokoro.pyKokoroProvider impl
  • src/hal0/providers/moonshine.pyMoonshineProvider impl
  • tests/providers/test_kokoro.py, tests/providers/test_moonshine.py — tests for the deleted impls

Kept VALID (capability layer untouched — these stay valid provider identifiers)

  • config/schema.py _VALID_PROVIDERS — still includes moonshine + kokoro (a SlotConfig(provider="kokoro") validates fine)
  • slots/state.py SELF_MANAGED_PROVIDERS — still {kokoro, moonshine, vibevoice}
  • capabilities/config.py default provider = "kokoro", capabilities/catalog.py, api/routes/backends.py + models.py classification — all unchanged

Mechanically forced by the deletion

  • providers/__init__.py — drop the kokoro/moonshine imports + _PROVIDERS registrations (the runtime classes are gone; the identifiers remain valid config values). get_provider("kokoro") now raises KeyError.
  • tests/providers/test_lemonade.py — assert live providers resolve and the retired voice classes raise KeyError from get_provider().

Doc (the #620 doc ask)

  • tests/test_import.py — remove the now-deleted hal0.voice module from the import parametrization.
  • ARCHITECTURE.md — document lemond-only STT/TTS dispatch, while explicitly noting kokoro/moonshine remain capability-provider identifiers served by lemond/toolbox (not by an in-process hal0 provider class).

Tests / lint

  • tests/config/test_schema.py tests/test_import.py59 passed (the two failures the broad version introduced — test_all_valid_providers stays green because moonshine/kokoro remain valid; hal0.voice import entry removed)
  • tests/slots/ tests/providers/265 passed (no regression from reverting the over-broad enum/SELF_MANAGED changes)
  • ruff check → all checks passed; ruff format --check → all formatted

Deferred (not in this PR)

comfyui is not in config/schema.py _VALID_PROVIDERS even though installer/etc-hal0/slots/img.toml declares provider = "comfyui". This is a pre-existing latent gap on main (not introduced or fixed here). Flagging for a separate issue to keep this PR minimal-scope.

🤖 Generated with Claude Code

@thinmintdev thinmintdev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEWER VERDICT: APPROVE — conditional on green CI (python checks currently pending; the deleted/modified test files are exactly what those checks validate, so certify on green). Adversarial dangling-ref pass is clean.

SPEC (#620): All 5 ACs met.

  • Moonshine + Kokoro providers + voice/ shims removed: providers/{moonshine,kokoro}.py deleted; entire voice/ package (__init__.py, kokoro.py, moonshine.py) deleted; dropped from _PROVIDERS, __all__.
  • Live exceptions retained: ComfyUIProvider, FLMProvider kept in registry; LlamaServerProvider intact.
  • _VALID_PROVIDERS reconciled — comfyui gap fixed (added), moonshine/kokoro removed. (This is the issue-mandated fix, not scope creep.)
  • test_legacy_providers_still_registered rewritten → test_live_providers_registered + test_retired_voice_providers_not_registered; test_kokoro/test_moonshine deleted.
  • ARCHITECTURE documents lemond-only dispatch + the 3 live exceptions + pi-coder-is-v0.4-gated note.

STANDARDS / adversarial grep: ZERO live importers of providers.moonshine/providers.kokoro/MoonshineProvider/KokoroProvider/hal0.voice anywhere in src/. Remaining moonshine/kokoro string hits are capability keys / lemond recipe names / migration maps / forward-compat enum values — not provider-class usage. Dispatcher has no voice refs. STT/TTS path intact (lemond whispercpp/kokoro recipes).

Non-blocking findings (maintainer option, do NOT gate):

  1. Behavioral asymmetry: llama-server/flm stay in _VALID_PROVIDERS and round-trip-as-ignored, but moonshine/kokoro now hard-ValidationError (schema.py:427 provider_valid). #620 explicitly calls the path "vestigial, not a supported runtime" so this is intended — but a user-authored legacy slot TOML with provider="moonshine" will now fail to load. No shipped/seed TOML does this (verified). If smoother legacy upgrades are wanted, keep-as-ignored (like llama-server/flm) is the safe pattern. Flagging for the merge-gate advisor.
  2. Stale docstrings still list MoonshineProvider/KokoroProvider as examples: providers/base.py:108, providers/lemonade.py:23.

Merge-ready on green. ARCHITECTURE.md overlaps #649 (see report) — sequential merge needs rebase of the 2nd.

@thinmintdev thinmintdev marked this pull request as draft June 7, 2026 22:11
@thinmintdev

Copy link
Copy Markdown
Contributor Author

Converted to draft — needs a scoping decision.

Deleting the hal0.voice provider classes is fine (no live importers). But this PR also makes moonshine/kokoro invalid SlotConfig providers, which the capability layer still depends on: src/hal0/capabilities/config.py:17 defaults provider = "kokoro", capabilities/catalog.py maps tts/stt capabilities → moonshine/kokoro, and config.py schema still lists them. Hence test_all_valid_providersValidationError (red on previously-green main).

Decision needed: (A) keep moonshine/kokoro as valid capability-provider identifiers (lemond/toolbox serve them) and delete only the dead local impl — minimal, unblocks now; or (B) fully remove them, which requires migrating the capability defaults/catalog off those names. Reviewer read it as intended-(B); the capability-layer refs say (B) is bigger than this PR. Holding for the call.

…dispatch (closes #620)

Minimal scope per maintainer: remove ONLY the dead local provider
implementation — the `hal0.voice` package plus `providers/{kokoro,moonshine}.py`
classes that ran Moonshine/Kokoro in-process. Confirmed no live importers.

`moonshine` and `kokoro` REMAIN valid capability-provider identifiers
everywhere the capability layer uses them (`SlotConfig.provider`
validation in `config/schema.py`, `capabilities/config.py` default
`provider="kokoro"`, `capabilities/catalog.py`, the backend/model
classification in `api/routes`). The actual STT/TTS inference is served
by lemond (whispercpp + kokoro recipes) or the corresponding toolbox
image — not by an in-process hal0 provider class. Those files are left
untouched.

- providers/__init__.py: drop the deleted kokoro/moonshine imports +
  registrations (the runtime provider classes are gone; the identifiers
  stay valid as config values).
- tests/providers/test_lemonade.py: assert the live providers resolve and
  the retired voice provider classes raise KeyError from get_provider().
- tests/test_import.py: drop the now-deleted hal0.voice module from the
  import parametrization.
- ARCHITECTURE.md: document lemond-only STT/TTS dispatch while noting
  kokoro/moonshine remain capability providers served by lemond/toolbox.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thinmintdev thinmintdev force-pushed the afk/620-retire-voice branch from 832d4cf to 0c1e72c Compare June 7, 2026 22:46
@thinmintdev thinmintdev changed the title providers: retire vestigial voice providers + document lemond-only dispatch providers: delete dead hal0.voice impl; document lemond-only STT/TTS dispatch Jun 7, 2026

@thinmintdev thinmintdev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEWER VERDICT: APPROVE — conditional on green CI (python/γ pending; the deleted-test changes are what those checks validate — certify on green). Re-review of the MINIMAL re-scope (squashed commit 0c1e72c, 11 files). Confirmed truly minimal, NO capability-layer regression. All 6 verification points pass:

  1. Dead impls deleted, no live importersvoice/{__init__,kokoro,moonshine}.py + providers/{kokoro,moonshine}.py all gone. Zero live imports of hal0.voice/providers.moonshine/providers.kokoro/MoonshineProvider/KokoroProvider in src/; the only remaining mentions are docstrings/removal-notes (providers/init.py:15,41; base.py:108; lemonade.py:23). ✓

  2. _VALID_PROVIDERS UNCHANGED — still {lemonade, llama-server, flm, moonshine, kokoro} (schema.py:89). config/schema.py is byte-identical to main (not in the PR diff). So test_all_valid_providers passes legitimately, not by weakening the assertion. ✓

  3. SELF_MANAGED_PROVIDERS restored to {kokoro, moonshine, vibevoice} (state.py:124) — vibevoice is back; the prior over-broad version that dropped it is corrected. ✓

  4. test_import.py no longer references hal0.voice — the diff removes the "hal0.voice" entry from the import-smoke list. ✓

  5. ARCHITECTURE.md states impls retired, identifiers remain — explicitly: "The dead local MoonshineProvider/KokoroProvider implementation classes (the hal0.voice package …) were deleted in #620 — they had no live importers. moonshine and kokoro remain valid capability-provider identifiers in the config/capability layer (SlotConfig.provider, capabilities/config.py, capabilities/catalog.py …); inference is served by lemond (whispercpp + kokoro recipes)." Correct framing. ✓

  6. comfyui-gap is genuinely PRE-EXISTING on main_VALID_PROVIDERS on main lacks comfyui while installer/etc-hal0/slots/img.toml:18 seeds provider = "comfyui". This latent gap exists identically on main and is untouched here (schema.py byte-identical). Correctly deferred to a separate issue, NOT introduced by this PR. ✓

This addresses my prior review's sole non-blocking concern (the behavioral asymmetry / hard-ValidationError on legacy moonshine/kokoro TOMLs): by leaving _VALID_PROVIDERS intact, those configs still load — no upgrade break. Both prior stale-docstring nits (base.py:108, lemonade.py:23) persist but remain non-blocking.

Scope is exactly: delete dead in-process impls + drop their _PROVIDERS registrations + document lemond-only dispatch. No dispatcher, schema, capabilities, or CLI regression. Merge-ready on green.

@thinmintdev thinmintdev marked this pull request as ready for review June 7, 2026 22:57
@thinmintdev thinmintdev merged commit 2db4c68 into main Jun 7, 2026
4 checks passed
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.

providers: retire vestigial voice providers (Moonshine/Kokoro) + document lemond-only dispatch (PR-10)

1 participant