Skip to content

refactor: use SpecMessage enum for spec topic strings#438

Merged
JarbasAl merged 1 commit into
devfrom
spec/utterance-handled-enum
Jun 28, 2026
Merged

refactor: use SpecMessage enum for spec topic strings#438
JarbasAl merged 1 commit into
devfrom
spec/utterance-handled-enum

Conversation

@JarbasAl

Copy link
Copy Markdown
Member

Convert hardcoded SPEC-topic string literals to the SpecMessage enum from ovos-spec-tools so the spec topics have a single source of truth.

Changes

Behavior-preserving — each enum .value equals 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_HANDLED
  • ovos_workshop/skills/converse.py — both the forward and reply emits → SpecMessage.UTTERANCE_HANDLED
  • ovos_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_HANDLED
  • test/unittests/test_decorators.py — assertion m.get("type") == SpecMessage.SPEAK.value

Imports added where missing (from ovos_spec_tools import SpecMessage); ovos.py already imported it.

Left untouched (not SpecMessage members)

Legacy/dynamic topics: mycroft.*, ovos.common_play.*, ovos.common_query.*, {skill_id} response topics, MIGRATION_MAP keys.

Validation

Fresh uv venv; test_ask_e2e, test_decorators, plus related skill/interaction/import tests — 69 passed.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@JarbasAl, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b3c02038-8fa5-4eb3-827f-a3745e2835a4

📥 Commits

Reviewing files that changed from the base of the PR and between cecbeca and 8211420.

📒 Files selected for processing (5)
  • ovos_workshop/skills/converse.py
  • ovos_workshop/skills/fallback.py
  • ovos_workshop/skills/ovos.py
  • test/unittests/test_ask_e2e.py
  • test/unittests/test_decorators.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spec/utterance-handled-enum

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.

@JarbasAl JarbasAl marked this pull request as draft June 28, 2026 00:57
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Beep! Automated checks have reached 100% completion. 🔋

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

📋 Repo Health

A routine checkup to keep the repo running smoothly. 🏥

✅ All required files present.

Latest Version: 9.0.1a3

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

⚖️ License Check

Scanning for any hidden proprietary blobs. 🌑

✅ No license violations found.

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

🔍 Lint

The 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 Tests

Structural analysis of your contribution is complete. 🔬

Python Build Install Tests
3.10 ⚠️
3.11
3.12
3.13
3.14

❌ 3.10: Install OK, tests failed
Check job logs for details.


The inspector has left the building 🕵️

@JarbasAl JarbasAl marked this pull request as ready for review June 28, 2026 01:08
@JarbasAl JarbasAl merged commit bf87625 into dev Jun 28, 2026
16 of 18 checks passed
@JarbasAl JarbasAl deleted the spec/utterance-handled-enum branch July 1, 2026 12:07
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.

1 participant