feat: migrate en-US intents to language-agnostic file-intents - #45
Conversation
Replace all 14 IntentBuilder (Adapt) registrations in EnclosureControlSkill
with @intent_handler("*.intent") file-intents, matching the pattern already
used by eye_color/custom_eye_color/brightness. Each intent gets a new
locale/en-US/*.intent template built from the existing sibling .voc phrase
sets via <name> inline-vocab references (ovos-spec-tools expansion, verified
empirically end-to-end through a MiniCroft-backed skill load).
Single-entry .voc files (blink, crazy, down, left, mouth, narrow, right, up)
cannot be referenced via <name>: the padatious/padacioso template compiler
rejects a single-branch alternation group as malformed and silently drops
the whole intent. Those words are now written as plain literals in the
templates, and the now-consumerless en-US .voc files are deleted, along
with five .voc files (mute, perform, reboot, system, unmute) that had no
consumer left in the current handler set.
The blink handler's two independent Adapt "right"/"left" flags become one
{direction} entity slot; behaviour otherwise unchanged. golden_utterances.jsonl
rows for these intents are updated from intent_type "adapt" to "padatious"
with intent_label pointing at the new file basenames, so the existing
data-driven golden-utterance suite keeps validating routing. pyproject.toml
package-data gains the locale/*/*.entity glob the new direction.entity
(and the existing color/brightness entities) need to ship in the wheel.
Local run (en-US only): test/unittests (5), test/end2end/test_intents_en_us.py
(2), test/end2end/test_entity_constraints.py (3), test/end2end/test_golden_utterances.py
(54) all green.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
I've combed through the code with a fine-tooth comb. 🔍I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthEnsuring the repository remains a happy place. 😊 ✅ All required files present. Latest Version: ✅ 🔒 Security (pip-audit)Scanning for any 'unauthenticated' access points. 🕵️ ✅ No known vulnerabilities found (76 packages scanned). 🎙️ SkillChecking the skill's resources for any issues. 📦 🎙️ (unknown skill_id) — 13 languages en-US: 17 intents · 9 vocab · 15 dialogs · skill.json Translation coverage — 12 languages (6 partial, 6 incomplete)
🔍 LintJust a quick heads-up on the latest check. 🛎️ ❌ ruff: issues found — see job log 🧪 Spec LintChecking the alignment of your contribution. 📏 22 error(s), 22 warning(s) 📊 CoverageTest coverage audit: no stone left unturned. 🗿 ❌ 16.4% total coverage Per-file coverage (10 files)
Full report: download the 🏷️ Release PreviewSetting the stage for the upcoming deployment. 🎭 Current:
✅ PR title follows conventional commit format. 🚀 Release Channel Compatibility Predicted next version:
🔌 Skill Tests (ovoscope)Viewing the skill's intents through the Ovoscope lens. 🔬 ✅ 59/59 passed ✅ TestEntityConstraints — 3/3 ⚖️ License CheckNavigating the maze of open-source compliance. 🧩 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 🔨 Build TestsEnsuring no loose screws in the assembly. 🔩 ✅ All versions pass
May your merges be conflict-free! 🕊️ |
This replaces every
IntentBuilder(Adapt) registration inEnclosureControlSkillwith@intent_handler("*.intent")file-intents, the same pattern the skill already used for its color and brightness intents. Fourteen handlers move over: the look/right/left/up/down variants, blink, spin, narrow eyes, reset, and the three mouth animations (smile, listen, think), plus crazy eyes.Each new
locale/en-US/*.intenttemplate is built from the skill's existing sibling.vocphrase sets using<name>inline-vocabulary references, whichovos-spec-toolsexpands into literal alternation before padatious/padacioso compiles the template — this was verified empirically by booting a MiniCroft with the skill loaded and emitting real utterances through the padatious pipeline, not just read off the parser source.That verification turned up a real gap worth flagging for anyone touching file-intents elsewhere: a
.vocfile with only one phrase (blink.voc,crazy.voc,down.voc,left.voc,mouth.voc,narrow.voc,right.voc,up.vochere) cannot be referenced via<name>, because the resulting single-branch alternation group is rejected as malformed by the template compiler — and the whole intent silently fails to register, with no test failure pointing at the cause unless you're specifically watching the boot logs. Those eight words are written as plain literals in the new templates instead, and the now-consumerless en-US.vocfiles are deleted (along with five more —mute,perform,reboot,system,unmute— that had no consumer left in the handler set even before this change).The blink handler previously used two independent Adapt "right"/"left" keyword flags; those become a single
{direction}entity slot, with equivalent per-direction behavior.golden_utterances.jsonlrows for the migrated intents move fromintent_type: adapttointent_type: padatiouswithintent_labelpointing at the new file basenames, so the existing data-driven golden-utterance suite keeps validating routing without any test-harness changes.pyproject.toml's package-data gains thelocale/*/*.entityglob, which the newdirection.entity(and the pre-existingcolor/brightnessentities) need in order to actually ship in the built wheel.Non-English locales are untouched — they still carry their
.voc/Adapt-era resources for follow-up per-language PRs.Run locally against a throwaway venv pinning
ovos-padatious==2.0.17a1,ovos-workshop==9.6.4a1,ovos-spec-tools==1.10.3a1,ovoscope==1.6.20a1:test/unittests(5 tests),test/end2end/test_intents_en_us.py(2),test/end2end/test_entity_constraints.py(3), andtest/end2end/test_golden_utterances.py(54, including the negative-confusable rows) all pass.