feat: emit INTENT-4 template registrations in the intent runner - #153
Draft
JarbasAl wants to merge 1 commit into
Draft
feat: emit INTENT-4 template registrations in the intent runner#153JarbasAl wants to merge 1 commit into
JarbasAl wants to merge 1 commit into
Conversation
|
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 |
Checking back in with the latest test results. 📡I've aggregated the results of the automated checks for this PR below. 🔍 LintThe latest check cycle has concluded. 🔄 ❌ ruff: issues found — see job log 🔎 Type CheckAnalysis complete! Check out the details below. 📊 ✅ mypy: no type errors found 🔨 Build TestsThe build process has successfully terminated. 🏁 ✅ All versions pass
Making code review just a little bit easier. 💆♂️ |
The runner's _register_templates() only emitted the legacy
padatious:register_intent topic. kw-template-matcher (from 0.1.6a1)
also binds the OVOS-INTENT-4 §6 spec topic
ovos.intent.register.template and keys templates learned from it as
"skill_id:intent_name" — the same skill-prefixed form m2v-style
fighters return in IntentHandlerMatch.match_type. The runner never
emitted that topic, so its own transformer slot lookup (always keyed
by the bare, normalised intent id) could only ever hit the legacy-topic
registration.
Emit ovos.intent.register.template alongside the legacy topic (mirrored
onto the transformer bus, matching ovos-workshop's own dual-emit in
Skill.register_template()), and make _transform_slots try both the bare
and the "arena:<intent_id>" skill-prefixed lookup keys so a transformer
that only recognises the spec-form key still fills slots. Both
registration messages carry context={"skill_id": "arena"}: OVOS-INTENT-4
§3.1 engines key registration on message.context, not message.data.
Adds the floor pin keyword-template-matcher>=0.1.6a1 to the test extra.
Fail-before: with only the source change reverted,
test_register_templates_emits_spec_topic and
test_transform_slots_falls_back_to_skill_prefixed_key fail (2 failed,
23 passed in tests/test_intent_pipeline.py); with only the context
argument reverted, test_register_templates_emits_spec_topic fails with
KeyError: 'skill_id' on seen[0].context. All 25 pass with the fix. The
22 failures elsewhere in the suite fail identically on origin/dev in
the same venv (missing `datasets` and similar), unchanged by this
branch.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JarbasAl
force-pushed
the
feat/spec-topic-registration
branch
from
September 8, 2026 03:06
22c6e0c to
e14466e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The runner's
_register_templates()only ever emitted the legacypadatious:register_intentbus topic. kw-template-matcher's dev head (merge commit 5640d79, "fix: register templates from ovos.intent.register.template and key by skill_id:intent_name") now also binds the OVOS-INTENT-4 §6 spec topic,ovos.intent.register.template, and keys templates learned from it as"skill_id:intent_name"— the same skill-prefixed form m2v-style fighters return inIntentHandlerMatch.match_type. Since the runner never emitted that topic, and its own transformer slot lookup was always keyed by the bare, normalised intent id, m2v-form fighter labels never scored any slots through a configured intent transformer.I traced both the producer and consumer side before making this change. ovos-workshop's
PadatiousIntentContainer.register_template()(ovos_workshop/intents.py) dual-emits the legacypadatious:register_intenttopic and the spec topic viaSpecMessage.INTENT_REGISTER_TEMPLATE(ovos_spec_tools.messages.SpecMessage, value"ovos.intent.register.template"), with payload fieldsskill_id,intent_name,samples,lang,blacklist,slot_blacklist. kw-template-matcher'sKeywordTemplateMatcher.handle_register_template(kw_template_matcher/opm.py) reads exactly those fields and registers the resulting templates underf"{skill_id}:{intent_name}", distinct fromhandle_register_intent's bare-name key for the legacy topic. This change makes the runner emit the same spec-topic message ovos-workshop emits, mirrored onto the transformer bus alongside the legacy one, and makes_transform_slotstry both the bare intent id and the"arena:<intent_id>"skill-prefixed form so a transformer that only recognised the spec-form key still fills slots.Two new tests cover this: one asserts the runner actually emits
ovos.intent.register.templatewith the expected payload shape, the other registers a template only via the spec topic (bypassing the legacy emission) and confirms_transform_slotsstill finds it through the skill-prefixed fallback key. Reverting only the source change (keeping the tests) makes both fail — zero messages captured on the first, and empty slots instead of{"song": "africa"}on the second — and re-applying the fix makes both pass. The full targeted suite (test_intent_pipeline,test_intent_bench,test_runner,test_registry,test_registry_validation) passes at 136/136 against the fix.I added a floor pin,
keyword-template-matcher>=0.1.6a1, to thetestoptional-dependency group so CI installs the plugin once that release reaches PyPI. kw-template-matcher's 0.1.5a1 PyPI publish shipped a broken sdist (itssetup.pyreads arequirements.txtthe sdist doesn't include) and is not installable; the first installable release with this spec-topic support will be 0.1.6a1, expected on the plugin's next merge. Until then,keyword-template-matcher>=0.1.6a1will fail to resolve in CI and the existingskipifguard onTestIntentTransformers(checking whetherkw_template_matcheris importable) will keep those tests skipping rather than failing the build. My local verification installed the plugin from a clone of its dev head directly into a throwaway venv — a test-only workaround, not something declared as a dependency anywhere in this repo.Both registration messages, the legacy
padatious:register_intentand the specovos.intent.register.template, carrycontext={"skill_id": "arena"}. OVOS-INTENT-4 §3.1 has engines key a registration onmessage.context['skill_id'], not on the data payload, and ovos-padatious from 2.1.2a2 rejects a registration that carries the id only in data.test_register_templates_emits_spec_topicasserts the context key; with the context argument removed it fails withKeyError: 'skill_id'.The test extra pins
keyword-template-matcher>=0.1.6a1, the floor that binds the spec topic; 0.1.7a2 is on PyPI, so CI resolves it. The 22 other failures in the full local suite fail identically onorigin/devin the same venv (missingdatasets), unchanged by this branch.