refactor: use SpecMessage enum for spec topic strings#438
Conversation
Replace hardcoded "ovos.utterance.handled" / "ovos.utterance.speak"
string literals with the SpecMessage enum from ovos-spec-tools so the
spec topics have a single source of truth. Behavior-preserving: each
enum .value equals the literal string previously emitted/asserted.
Source: fallback.py, converse.py (forward+reply), ovos.py matched-path
emit. Tests: test_ask_e2e.py (2 emits), test_decorators.py assertion
(SpecMessage.SPEAK.value).
Legacy/dynamic topics (mycroft.*, ovos.common_play.*, ovos.common_query.*,
{skill_id} response topics) are intentionally left untouched as they are
not SpecMessage members.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 48 minutes and 48 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Beep! Automated checks have reached 100% completion. 🔋I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthA routine checkup to keep the repo running smoothly. 🏥 ✅ All required files present. Latest Version: ✅ ⚖️ License CheckScanning for any hidden proprietary blobs. 🌑 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 🔍 LintThe results are fresh out of the pipeline. 🏗️ ❌ ruff: issues found — see job log 🔒 Security (pip-audit)Security report: No threats detected in the area. ✅ ✅ No known vulnerabilities found (72 packages scanned). 🔨 Build TestsStructural analysis of your contribution is complete. 🔬
❌ 3.10: Install OK, tests failed The inspector has left the building 🕵️ |
Convert hardcoded SPEC-topic string literals to the
SpecMessageenum fromovos-spec-toolsso the spec topics have a single source of truth.Changes
Behavior-preserving — each enum
.valueequals the literal string previously emitted/asserted (verified at runtime:SpecMessage.UTTERANCE_HANDLED.value == "ovos.utterance.handled",SpecMessage.SPEAK.value == "ovos.utterance.speak").Source:
ovos_workshop/skills/fallback.py—"ovos.utterance.handled"→SpecMessage.UTTERANCE_HANDLEDovos_workshop/skills/converse.py— both theforwardandreplyemits →SpecMessage.UTTERANCE_HANDLEDovos_workshop/skills/ovos.py— matched-path emit →SpecMessage.UTTERANCE_HANDLED(slated to move to core later; converted now for consistency)Tests:
test/unittests/test_ask_e2e.py— 2 mock-skill emits →SpecMessage.UTTERANCE_HANDLEDtest/unittests/test_decorators.py— assertionm.get("type") == SpecMessage.SPEAK.valueImports added where missing (
from ovos_spec_tools import SpecMessage);ovos.pyalready imported it.Left untouched (not SpecMessage members)
Legacy/dynamic topics:
mycroft.*,ovos.common_play.*,ovos.common_query.*,{skill_id}response topics,MIGRATION_MAPkeys.Validation
Fresh
uvvenv;test_ask_e2e,test_decorators, plus related skill/interaction/import tests — 69 passed.🤖 Generated with Claude Code