fix(opm): reject a registration that omits lang instead of defaulting it - #58
openvoiceos-bot wants to merge 1 commit into
Conversation
OVOS-INTENT-4 §3.2/§7.2 (OpenVoiceOS/architecture#261) makes lang a required identity field. handle_register_template and handle_register_entity_spec defaulted a missing lang to self.lang and indexed the registration under the plugin's own configured language, inventing a value the producer never sent. Both now skip the registration and log WARN naming the missing field. handle_deregister_entity_spec kept the same default-to-self.lang read, which under-removed: §8.3 says an omitted lang on deregister removes every language of the pair, not only self.lang. It now iterates every configured language when lang is omitted. padatious:register_intent, padatious:register_entity, detach_entity and detach_skill carry their own payload shape and are not INTENT-4 topics (§5-§8), so they are unchanged. 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: true
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 |
Stand by... check results incoming! 📡I've aggregated the results of the automated checks for this PR below. 🏷️ Release PreviewEnsuring our release notes are clear and concise. ✍️ Current:
🚀 Release Channel Compatibility Predicted next version:
⚖️ License CheckEnsuring no unlicensed code has snuck in. 🕵️ ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 📋 Repo HealthI've checked the repo's social skills (aka issue response time). 🗣️ ✅ All required files present. Latest Version: ✅ 🔌 Plugin DetectionIs this plugin ready for its debut in the Manager? 🎭 ❌ Plugin Status: ERRORS (1) Plugin Info:
OPM Detection:
Entry Point Validation:
⊘ No Issues:
🔌 Skill Tests (ovoscope)Putting the skill's conversational flow to the test. 🌊 ✅ 20/20 passed ✅ TestDetach — 2/2 🚌 Bus CoverageEnsuring every intent and event is reached by the test suite. 🎯 📊 CoverageHow deep does the testing rabbit hole go? 🐇 ✅ 92.9% total coverage Per-file coverage (7 files)
Full report: download the 🔨 Build TestsI've fired up the furnaces and forged your changes. ⚒️ ✅ All versions pass
Integrity verified by the OVOS Bot 💎 |
What changed
OVOS-INTENT-4 §3.2 and §7.2 (merged in OpenVoiceOS/architecture#261) make
langa required identity field on a registration.opm.pydefaulted a missinglangto the plugin's own language. It then indexed the registration under that language, a value the producer never sent.handle_register_template(§6) andhandle_register_entity_spec(§7): a missinglangnow skips the registration. It logs WARN and names the missing field, instead of defaulting toself.lang.handle_deregister_entity_spec(§8.3): the spec reads the other way for deregister. An omittedlangmust remove the entity from every language. The old code defaulted toself.langand removed only one language. It now loops over every configured language.padatious:register_intent,padatious:register_entity,detach_entity,detach_skill: left unchanged. These legacy pre-INTENT-4 bus topics carry their own payload shape. They use noskill_id,intent_name, orentity_namefields. §3.2's rule for "a message of §5 to §8" does not bind them.A registration without
langnames no entity. The entity identity is(skill_id, entity_name, lang). Silently repairing it with the plugin's own language hides the malformed message from the producer. It can also index the entity or intent under the wrong language.gh search code "ovos.entity.register" --owner OpenVoiceOS, and the same forovos.intent.register.template, found one producer:ovos-workshop/ovos_workshop/intents.py. It always sendslangon these topics, so no producer relies on the old default.Test plan
New regression tests, each confirmed to fail on the pre-fix code and pass after:
Full suite:
Reproduced against the installed PyPI package before the fix:
pyflakes nebulento/opm.py: only a pre-existing unused import unrelated to this change (ovos_bus_client.session.Session, present before this PR).