Skip to content

refactor!: drop the enclosure abstraction from PHALPlugin - #406

Draft
JarbasAl wants to merge 2 commits into
devfrom
feat/phal-drop-enclosure
Draft

refactor!: drop the enclosure abstraction from PHALPlugin#406
JarbasAl wants to merge 2 commits into
devfrom
feat/phal-drop-enclosure

Conversation

@JarbasAl

Copy link
Copy Markdown
Member

Removes the legacy Mark-1 enclosure.* protocol from the PHALPlugin base as a breaking change.

What changes

PHALPlugin no longer wires enclosure.*. Removed:

  • register_enclosure_namespace() and its __init__ call
  • the enclosure.* bus.remove(...) calls from shutdown()
  • every enclosure handler: on_eyes_*, on_system_*, _on_mouth_*, on_text/on_display/on_weather_display, on_reset/on_no_internet, on_talk/on_think/on_listen/on_smile/on_viseme/on_viseme_list/on_display_reset
  • the mouth-event gating (mouth_events_active, _activate_mouth_events, _deactivate_mouth_events, _mouth_events)

PHALPlugin keeps the core lifecycle only: register_core_events() + the audio in/out, wake, sleep and speak handlers.

Where the protocol goes

  • Listener side — hardware enclosure plugins mix in EnclosureProtocolListener from ovos-ui-enclosure-protocol (the same wiring + no-op handlers, extracted verbatim).
  • Producer sideEnclosureAPI lives in ovos-gui-api-client alongside GUIInterface, so self.gui and self.enclosure come from one client.

Modern visual output is handled by GUIInterface (OVOS-GUI-1) and its template system.

Tests

test_phal_template_extended.py reworked: drops the enclosure-handler/mouth-event tests, adds assertions that no enclosure.* subscriptions are wired and the abstraction's attributes are gone, and verifies the core-event register/shutdown wiring. Full suite green locally (965 passed; the one unrelated langcodes TTS-session failure is pre-existing and independent of this change).

Part of the enclosure→GUI migration (mk1 modeled as a GUI; abstraction dropped from core).

The legacy Mark-1 enclosure.* protocol is no longer baked into the PHAL base.
register_enclosure_namespace() and every enclosure command handler (on_eyes_*,
on_system_*, _on_mouth_*, on_text/on_display/on_weather_display, on_reset/
on_no_internet, mouth-event gating) are removed. PHALPlugin now wires only the
core lifecycle events (audio in/out, wake, sleep, speak).

Hardware enclosure plugins mix in EnclosureProtocolListener from
ovos-ui-enclosure-protocol instead; the EnclosureAPI producer lives in
ovos-gui-api-client (self.gui + self.enclosure from one client).
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8cc9e4e1-14f9-4aff-b68e-5663d95540bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/phal-drop-enclosure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greetings! The CI pipeline has delivered its findings. 🏗️

I've aggregated the results of the automated checks for this PR below.

📋 Repo Health

Ensuring the repo is ready for a marathon (aka long-term support). 🏁

✅ All required files present.

Latest Version: 2.7.0a1

ovos_plugin_manager/version.py — Version file
README.md — README
LICENSE — License file
pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
CHANGELOG.md — Changelog
ovos_plugin_manager/version.py has valid version block markers

🏷️ Release Preview

Ensuring the 'Thanks' section includes your name! 🤝

Caution

Breaking change — this PR will bump the MAJOR version (2.7.0a13.0.0a1).
Downstream dependents may break. Double-check compatibility before merging.

Current: 2.7.0a1Next: 3.0.0a1

Signal Value
Label breaking
PR title refactor!: drop the enclosure abstraction from PHALPlugin
Bump major

⚠️ No conventional commit prefix — alpha-only bump.
Suggested: fix: update the thing or feat: update the thing


🚀 Release Channel Compatibility

Predicted next version: 3.0.0a1

Channel Status Note Current Constraint
Stable Too new (must be <0.10.0) ovos-plugin-manager>=0.9.0,<0.10.0
Testing Too new (must be <3.0.0) ovos-plugin-manager>=1.0.3,<3.0.0
Alpha Compatible ovos-plugin-manager>=2.7.0a1

⚖️ License Check

The license check is now finished. 🏁

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🔍 Lint

Evaluating the overall impact of your changes. 📈

ruff: issues found — see job log

📊 Coverage

Ensuring the logic is battle-tested. ⚔️

84.8% total coverage

Files below 80% coverage (21 files)
File Coverage Missing lines
ovos_plugin_manager/utils/audio.py 22.5% 69
ovos_plugin_manager/hardware/__init__.py 31.6% 13
ovos_plugin_manager/templates/gui.py 39.0% 25
ovos_plugin_manager/audio.py 40.5% 22
ovos_plugin_manager/templates/language.py 58.0% 21
ovos_plugin_manager/audio2ipa.py 58.1% 13
ovos_plugin_manager/gui.py 62.5% 15
ovos_plugin_manager/postag.py 63.0% 17
ovos_plugin_manager/segmentation.py 63.0% 17
ovos_plugin_manager/tokenization.py 63.0% 17
ovos_plugin_manager/templates/solvers.py 68.5% 82
ovos_plugin_manager/plugin_entry.py 69.1% 46
ovos_plugin_manager/coreference.py 69.2% 16
ovos_plugin_manager/templates/ocp.py 72.2% 5
ovos_plugin_manager/dialog_transformers.py 72.7% 3
ovos_plugin_manager/templates/segmentation.py 73.7% 5
ovos_plugin_manager/templates/audio2ipa.py 75.0% 3
ovos_plugin_manager/templates/postag.py 75.0% 5
ovos_plugin_manager/templates/hotwords.py 77.4% 7
ovos_plugin_manager/persona.py 77.8% 2
ovos_plugin_manager/templates/keywords.py 78.9% 4

Full report: download the coverage-report artifact.

🔨 Build Tests

The build pipeline has reached its destination. 📍

✅ All versions pass

Python Build Install Tests
3.9
3.10
3.11
3.12
3.13
3.14

🔒 Security (pip-audit)

Security check! Are we safe from vulnerabilities? 🛡️

✅ No known vulnerabilities found (64 packages scanned).


Code quality is our top priority ✨

@JarbasAl JarbasAl changed the title feat!: drop the enclosure abstraction from PHALPlugin refactor!: drop the enclosure abstraction from PHALPlugin Jun 25, 2026
The record/speak/wake/sleep lifecycle (recognizer_loop:record_begin/record_end/
sleep/audio_output_start/audio_output_end, mycroft.awoken, speak) drives the
enclosure, so it moves to EnclosureProtocolListener.register_core_events()
alongside the enclosure.* commands. PHALPlugin now wires no bus events at all:
it is a background Thread with self.bus, runtime_requirements, emit, run and a
shutdown that just stops. Hardware enclosure plugins mix in the listener.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant