Skip to content

fix: resolve inline <voc> references when loading .intent/.blacklist#455

Merged
JarbasAl merged 1 commit into
devfrom
fix/intent-loader-inline-voc
Jul 3, 2026
Merged

fix: resolve inline <voc> references when loading .intent/.blacklist#455
JarbasAl merged 1 commit into
devfrom
fix/intent-loader-inline-voc

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Jul 3, 2026

Copy link
Copy Markdown
Member

Loading a .intent or .blacklist file with an inline <name> vocabulary reference (OVOS-INTENT-1 §3.7) currently fails: the resource loader hands the line straight to the bracket expander, so <name> survives as literal text and the intent never matches the sibling vocabulary.

Fix

  • SkillResources._locale_vocabularies() builds a {name: members} map from every sibling .voc in this language's locale tree (user > skill > workshop precedence).
  • IntentFile.load / BlacklistFile.load gain a vocabularies attribute. When a line contains <name>, the §3.7 resolution is delegated to ovos_spec_tools.inline_keywords (rewrites <name>(a|b|c)) before the existing bracket expansion. Lines without inline references are untouched — no behavior change for existing skills.

Tests

test/unittests/test_inline_vocab_refs.py: a foo.intent with <thing> + sibling thing.voc, and a bar.blacklist with <pronoun> + pronoun.voc, both expand to the vocabulary members; plus a no-inline regression case. Red before, green after.

Relation to #414

PR #414 (feat/drop-resource-files-usage) routes all resource loading through ovos_spec_tools.LocaleResources and would resolve inline refs there too, but it is a large deprecation-bearing refactor still open. This is the smallest dev-targeted fix that unblocks skills on current dev now; #414 subsumes it.

🤖 Generated with Claude Code

Per OVOS-INTENT-1 §3.7 an inline <name> reference in a .intent or
.blacklist file must expand in place from the sibling vocabulary of that
name. The loader passed such lines straight to the bracket expander, so
<name> survived as literal text and the intent never matched.

Build a {name: members} map from every sibling .voc in the locale tree
(user > skill > workshop precedence) and delegate the §3.7 resolution to
ovos_spec_tools.inline_keywords before expansion. Files without inline
references are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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 reviews.

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7914e986-cb51-478b-974a-7e67495f597c

📥 Commits

Reviewing files that changed from the base of the PR and between ff771d4 and a107146.

📒 Files selected for processing (2)
  • ovos_workshop/resource_files.py
  • test/unittests/test_inline_vocab_refs.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/intent-loader-inline-voc

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.

@github-actions github-actions Bot added the fix label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Hello there! I've processed your latest changes. 🌊

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

🔍 Lint

The results are fresh out of the pipeline. 🏗️

ruff: issues found — see job log

📋 Repo Health

Scanning for any signs of 'comment' bad breath. 🌬️

✅ All required files present.

Latest Version: 9.1.0a1

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

Checking the terms and conditions of your code. 📝

✅ No license violations found.

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

🔨 Build Tests

Testing the recipe! Did the build turn out okay? 👨‍🍳

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

Powered by OVOS scripts and a bit of magic. ✨

@JarbasAl JarbasAl marked this pull request as ready for review July 3, 2026 17:46
@JarbasAl JarbasAl merged commit 13395c5 into dev Jul 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant