You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: collapse dual-registered intent aliases at registration time
Root cause of the session blacklist bypass: this plugin subscribes to
both the legacy registration topic (name suffixed `<skill_id>:<file>.intent`)
and the OVOS-INTENT-4 spec topic (`<skill_id>:<file>`, suffix-less), so one
logical skill intent lands as TWO engine entries. Blacklisting one alias
left the other matchable.
This plugin owns its own back-compat for the legacy topic, so it now
collapses the alias at REGISTRATION time instead of at compare time:
- `register_intent` (legacy topic handler) now canonicalizes the intent
name — strips a trailing `.intent` suffix — before indexing, so both
wire messages land as a single engine entry, and only appends to the
manifest when the canonical name is new (`handle_register_template`
already replaced-in-place via `§8.1 replacement is implicit`).
- `__detach_intent` canonicalizes too, so detaching by either alias works.
- The engine (`padacioso.IntentContainer.add_intent`) keys intents by name
in a dict, so re-registration under the canonical name was already an
implicit replace, not a duplicate — no engine-level idempotency fix
needed here (unlike the padatious plugin's list-based engine).
- The session blacklist filter (`_calc_padacioso_intent`) no longer
dealiases `i["name"]` — engine matches are canonical by construction
now. It still canonicalizes the blacklist entries themselves, since old
sessions/mycroft.conf may still list an intent by its legacy
`.intent`-suffixed id. A one-time-per-entry LOG.warning flags any such
legacy blacklist entry as deprecated, naming the offending entry and its
canonical replacement, so operators can update their config.
Tests: TestSessionBlacklistAlias (compare-time suppression, either alias)
kept/updated; new TestRegistrationCollapse + TestSessionBlacklistCanonicalization
in test/test_registration_collapse.py cover the registration-time collapse
(single manifest entry, detach-by-legacy-name, deprecation warning).
test_malformed_samples.py updated: the warning/index now names the
canonicalized (alias-collapsed) intent name.
Known gap (see the same-shape padatious plugin PR for full detail):
ovos-workshop's register_intent_file() binds a skill's dispatch handler
only to the legacy `<skill_id>:<file>.intent` topic, not the spec
canonical one, so an orchestrator dispatching the canonicalized name no
longer reaches that handler. Not fixable in this plugin.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments